/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// Select the 5th row with no modifier
uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({
{ "Row", uno::Any(sal_Int32(5 - 1)) },
{ "Modifier", uno::Any(sal_uInt16(0)) }
}));
dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, aArgs);
// Check if it is selected
OString aResult = apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), "text/plain;charset=utf-8"_ostr);
OString aExpected("1\t2\t3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t16\t17\t18\t19\t20\t21\n"_ostr);
CPPUNIT_ASSERT_EQUAL(aExpected, aResult);
// Check if all the rows from 5th to 10th get selected
aResult = apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), "text/plain;charset=utf-8"_ostr);
aExpected = "1\t2\t3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t16\t17\t18\t19\t20\t21\n2\t3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t16\t17\t18\t19\t20\t21\t22\n3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t16\t17\t18\t19\t20\t21\t22\t23\n4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t16\t17\t18\t19\t20\t21\t22\t23\t24\n5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t16\t17\t18\t19\t20\t21\t22\t23\t24\t25\n6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t16\t17\t18\t19\t20\t21\t22\t23\t24\t25\t26\n"_ostr;
CPPUNIT_ASSERT_EQUAL(aExpected, aResult);
// When we copy this, we don't get anything useful, but we must not crash // (used to happen)
aResult = apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), "text/plain;charset=utf-8"_ostr);
CPPUNIT_ASSERT_EQUAL("9"_ostr, aResult);
// TODO check that we really selected what we wanted here
// When we copy this, we don't get anything useful, but we must not crash // (used to happen)
aResult = apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), "text/plain;charset=utf-8"_ostr);
CPPUNIT_ASSERT_EQUAL("1"_ostr, aResult);
// TODO check that we really selected what we wanted here
// Test for deselection of already selected rows // First Deselect Row 13 because copy doesn't work for multiple selections
aArgs = comphelper::InitPropertySequence({ { "Row", uno::Any(static_cast<sal_Int32>(13 - 1)) },
{ "Modifier", uno::Any(KEY_MOD1) } });
dispatchCommand(mxComponent, u".uno:SelectRow"_ustr, aArgs);
// should be an empty string
CPPUNIT_ASSERT_EQUAL(OString(), apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), "text/plain;charset=utf-8"_ostr));
}
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testViewCursors)
{
ScModelObj* pModelObj = createDoc("select-row-cols.ods");
ScTestViewCallback aView1;
SfxLokHelper::createView();
pModelObj->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
ScTestViewCallback aView2(/*bDeleteListenerOnDestruct*/false); // This was false, the new view did not get the view (cell) cursor of the old view.
CPPUNIT_ASSERT(aView2.m_bViewCursorInvalidated);
CPPUNIT_ASSERT(aView2.m_bOwnCursorInvalidated);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::DOWN);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::DOWN);
Scheduler::ProcessEventsToIdle();
SfxLokHelper::destroyView(SfxLokHelper::getView());
CPPUNIT_ASSERT(aView1.m_bViewCursorInvalidated);
}
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testTextViewSelection)
{ // Create two views, and leave the second one current.
ScModelObj* pModelObj = createDoc("select-row-cols.ods");
ScTestViewCallback aView1;
SfxLokHelper::createView();
pModelObj->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
ScTestViewCallback aView2;
// Create a selection on two cells in the second view, that's a text selection in LOK terms.
aView1.m_bTextViewSelectionInvalidated = false;
dispatchCommand(mxComponent, u".uno:GoRightSel"_ustr, {}); // Make sure the first view got its notification.
CPPUNIT_ASSERT(aView1.m_bTextViewSelectionInvalidated);
}
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testDocumentSizeChanged)
{ // Load a document that doesn't have much content.
createDoc("small.ods");
setupLibreOfficeKitViewCallback(SfxViewShell::Current());
// Go to the A30 cell -- that will extend the document size.
uno::Sequence<beans::PropertyValue> aPropertyValues =
{
comphelper::makePropertyValue(u"ToPoint"_ustr, u"$A$30"_ustr),
};
dispatchCommand(mxComponent, u".uno:GoToCell"_ustr, aPropertyValues); // Assert that the size in the payload is not 0.
CPPUNIT_ASSERT(m_aDocumentSize.getWidth() > 0);
CPPUNIT_ASSERT(m_aDocumentSize.getHeight() > 0);
}
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testViewLock)
{ // Load a document that has a shape and create two views.
ScModelObj* pModelObj = createDoc("shape.ods");
ScTestViewCallback aView1;
SfxLokHelper::createView();
pModelObj->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
ScTestViewCallback aView2;
// Begin text edit in the second view and assert that the first gets a lock // notification. const ScViewData* pViewData = ScDocShell::GetViewData();
CPPUNIT_ASSERT(pViewData);
ScTabViewShell* pViewShell = pViewData->GetViewShell();
CPPUNIT_ASSERT(pViewShell);
SdrModel* pDrawModel = pViewData->GetDocument().GetDrawLayer();
SdrPage* pDrawPage = pDrawModel->GetPage(0);
SdrObject* pObject = pDrawPage->GetObj(0);
SdrView* pView = pViewShell->GetScDrawView();
aView1.m_bViewLock = false;
pView->SdrBeginTextEdit(pObject);
CPPUNIT_ASSERT(aView1.m_bViewLock);
// End text edit in the second view, and assert that the lock is removed in // the first view.
pView->SdrEndTextEdit();
CPPUNIT_ASSERT(!aView1.m_bViewLock);
}
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testUndoShells)
{
ScModelObj* pModelObj = createDoc("small.ods"); // Clear the currently selected cell.
dispatchCommand(mxComponent, u".uno:ClearContents"_ustr, {});
auto pDocShell = dynamic_cast<ScDocShell*>(pModelObj->GetEmbeddedObject());
CPPUNIT_ASSERT(pDocShell);
ScDocument& rDoc = pDocShell->GetDocument();
ScUndoManager* pUndoManager = rDoc.GetUndoManager();
CPPUNIT_ASSERT(pUndoManager);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pUndoManager->GetUndoActionCount());
sal_Int32 nView1 = SfxLokHelper::getView(); // This was -1: ScSimpleUndo did not remember what view shell created it.
CPPUNIT_ASSERT_EQUAL(ViewShellId(nView1), pUndoManager->GetUndoAction()->GetViewShellId());
}
// text edit a cell in view #1
SfxLokHelper::setView(nView1);
aView2.m_bInvalidateTiles = false;
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'x', 0);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 'x', 0);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT(lcl_hasEditView(*pViewData));
CPPUNIT_ASSERT(aView2.m_bInvalidateTiles);
// text edit a cell in view #1 until // we can be sure we are out of the initial tile for (int i = 0; i < 40; ++i)
{
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'x', 0);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 'x', 0);
}
Scheduler::ProcessEventsToIdle();
// text edit a cell in view #1 inside the new tile and // check that view #2 receive a tile invalidate message
aView2.m_bInvalidateTiles = false;
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'x', 0);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 'x', 0);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT(aView2.m_bInvalidateTiles);
// text edit a cell in view #1
SfxLokHelper::setView(nView1);
aView3.m_bInvalidateTiles = false;
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'y', 0);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 'y', 0);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT(aView3.m_bInvalidateTiles);
}
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCreateViewGraphicSelection)
{ // Load a document that has a shape and create two views.
ScModelObj* pModelObj = createDoc("shape.ods");
ScTestViewCallback aView1;
// Mark the graphic in the first view. const ScViewData* pViewData = ScDocShell::GetViewData();
CPPUNIT_ASSERT(pViewData);
ScTabViewShell* pViewShell = pViewData->GetViewShell();
CPPUNIT_ASSERT(pViewShell);
SdrModel* pDrawModel = pViewData->GetDocument().GetDrawLayer();
SdrPage* pDrawPage = pDrawModel->GetPage(0);
SdrObject* pObject = pDrawPage->GetObj(0);
SdrView* pView = pViewShell->GetScDrawView();
aView1.m_bGraphicSelection = false;
aView1.m_bGraphicViewSelection = false;
pView->MarkObj(pObject, pView->GetSdrPageView());
CPPUNIT_ASSERT(aView1.m_bGraphicSelection);
// Create a second view. int nView1 = SfxLokHelper::getView();
SfxLokHelper::createView();
pModelObj->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
ScTestViewCallback aView2;
CPPUNIT_ASSERT(aView2.m_bGraphicViewSelection);
CPPUNIT_ASSERT(aView1.m_bGraphicViewSelection);
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testGraphicInvalidate)
{ // Load a document that has a shape and create two views.
ScModelObj* pModelObj = createDoc("shape.ods");
ScTestViewCallback aView;
// move on the right for (int i = 0; i < 200; ++i)
{
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RIGHT);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RIGHT);
}
Scheduler::ProcessEventsToIdle();
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCommentCallback)
{ // Comments callback are emitted only if tiled annotations are off
comphelper::LibreOfficeKit::setTiledAnnotations(false);
// FIXME: Hack because previous tests do not destroy ScDocument(with annotations) on exit (?).
ScPostIt::mnLastPostItId = 1;
// Edit a comment // Select some random cell, we should be able to edit the cell note without // selecting the cell if (pTabViewShell)
pTabViewShell->SetCursor(3, 100);
aArgs = comphelper::InitPropertySequence(
{
{"Id", uno::Any(OUString::createFromAscii(aCommentId))},
{"Text", uno::Any(u"Edited comment"_ustr)},
{"Author", uno::Any(u"LOK User2"_ustr)},
});
dispatchCommand(mxComponent, u".uno:EditAnnotation"_ustr, aArgs);
// We received a LOK_CALLBACK_COMMENT callback with comment 'Modify' action
CPPUNIT_ASSERT_EQUAL(std::string("Modify"), aView1.m_aCommentCallbackResult.get<std::string>("action"));
CPPUNIT_ASSERT_EQUAL(std::string("Modify"), aView2.m_aCommentCallbackResult.get<std::string>("action"));
CPPUNIT_ASSERT_EQUAL(aCommentId, aView1.m_aCommentCallbackResult.get<std::string>("id"));
CPPUNIT_ASSERT_EQUAL(aCommentId, aView2.m_aCommentCallbackResult.get<std::string>("id"));
CPPUNIT_ASSERT_EQUAL(std::string("LOK User2"), aView1.m_aCommentCallbackResult.get<std::string>("author"));
CPPUNIT_ASSERT_EQUAL(std::string("LOK User2"), aView2.m_aCommentCallbackResult.get<std::string>("author"));
CPPUNIT_ASSERT_EQUAL(std::string("Edited comment"), aView1.m_aCommentCallbackResult.get<std::string>("text"));
CPPUNIT_ASSERT_EQUAL(std::string("Edited comment"), aView2.m_aCommentCallbackResult.get<std::string>("text"));
CPPUNIT_ASSERT_EQUAL(std::string("3 3 3 3"), aView1.m_aCommentCallbackResult.get<std::string>("cellRange"));
CPPUNIT_ASSERT_EQUAL(std::string("3 3 3 3"), aView2.m_aCommentCallbackResult.get<std::string>("cellRange"));
// Delete the comment if (pTabViewShell)
pTabViewShell->SetCursor(4, 43);
aArgs = comphelper::InitPropertySequence(
{
{"Id", uno::Any(OUString::createFromAscii(aCommentId))}
});
dispatchCommand(mxComponent, u".uno:DeleteNote"_ustr, aArgs);
// We received a LOK_CALLBACK_COMMENT callback with comment 'Remove' action
CPPUNIT_ASSERT_EQUAL(std::string("Remove"), aView1.m_aCommentCallbackResult.get<std::string>("action"));
CPPUNIT_ASSERT_EQUAL(std::string("Remove"), aView2.m_aCommentCallbackResult.get<std::string>("action"));
CPPUNIT_ASSERT_EQUAL(aCommentId, aView1.m_aCommentCallbackResult.get<std::string>("id"));
CPPUNIT_ASSERT_EQUAL(aCommentId, aView2.m_aCommentCallbackResult.get<std::string>("id"));
}
comphelper::LibreOfficeKit::setTiledAnnotations(true);
}
// text edit a cell in view #1
SfxLokHelper::setView(nView1);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'x', 0);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 'x', 0);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
Scheduler::ProcessEventsToIdle();
// check that undo action count in not 0
CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetUndoActionCount());
// try to execute undo in view #2
SfxLokHelper::setView(nView2);
dispatchCommand(mxComponent, u".uno:Undo"_ustr, {}); // check that undo has not been executed on view #2
CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetUndoActionCount());
// try to execute undo in view #1
SfxLokHelper::setView(nView1);
dispatchCommand(mxComponent, u".uno:Undo"_ustr, {}); // check that undo has been executed on view #1
CPPUNIT_ASSERT_EQUAL(std::size_t(0), pUndoManager->GetUndoActionCount());
// check that redo action count in not 0
CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetRedoActionCount());
// try to execute redo in view #2
SfxLokHelper::setView(nView2);
dispatchCommand(mxComponent, u".uno:Redo"_ustr, {}); // check that redo has not been executed on view #2
CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetRedoActionCount());
// try to execute redo in view #1
SfxLokHelper::setView(nView1);
dispatchCommand(mxComponent, u".uno:Redo"_ustr, {}); // check that redo has been executed on view #1
CPPUNIT_ASSERT_EQUAL(std::size_t(0), pUndoManager->GetRedoActionCount());
}
// text edit a cell in view #1
SfxLokHelper::setView(nView1);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'x', 0);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 'x', 0);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
Scheduler::ProcessEventsToIdle();
// check that undo action count in not 0
CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetUndoActionCount());
// try to execute undo in view #2
SfxLokHelper::setView(nView2);
dispatchCommand(mxComponent, u".uno:Undo"_ustr, {}); // check that undo has not been executed on view #2
CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetUndoActionCount());
// try to execute undo in view #2 in repair mode
SfxLokHelper::setView(nView2);
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
{
{"Repair", uno::Any(true)}
}));
dispatchCommand(mxComponent, u".uno:Undo"_ustr, aPropertyValues); // check that undo has been executed on view #2 in repair mode
CPPUNIT_ASSERT_EQUAL(std::size_t(0), pUndoManager->GetUndoActionCount());
}
// we need to paint a tile in the view for triggering the tile invalidation solution int nCanvasWidth = 256; int nCanvasHeight = 256;
std::vector<unsignedchar> aBuffer(nCanvasWidth * nCanvasHeight * 4);
ScopedVclPtrInstance<VirtualDevice> pDevice(DeviceFormat::WITHOUT_ALPHA);
pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(), aBuffer.data());
pModelObj->paintTile(*pDevice, nCanvasWidth, nCanvasHeight, /*nTilePosX=*/0, /*nTilePosY=*/0, /*nTileWidth=*/3840, /*nTileHeight=*/3840);
Scheduler::ProcessEventsToIdle();
// insert an image in view and see if both views are invalidated
aView.m_bInvalidateTiles = false;
uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({
{ "FileName", uno::Any(createFileURL(u"smile.png")) }
}));
dispatchCommand(mxComponent, u".uno:InsertGraphic"_ustr, aArgs);
CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
// undo image insertion in view and see if both views are invalidated
aView.m_bInvalidateTiles = false;
uno::Sequence<beans::PropertyValue> aArgs2;
dispatchCommand(mxComponent, u".uno:Undo"_ustr, aArgs2);
CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
}
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testDocumentSizeWithTwoViews)
{ // Open a document that has the cursor far away & paint a tile
ScModelObj* pModelObj = createDoc("cursor-away.ods");
// Set the visible area, and press page down
pModelObj->setClientVisibleArea(tools::Rectangle(750, 1861, 20583, 6997));
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::PAGEDOWN);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::PAGEDOWN);
Scheduler::ProcessEventsToIdle();
pView->SetCursor(0, 0); // sequence of chinese IME compositions when 'nihao' is typed in an IME const std::vector<OString> aUtf8Inputs{ "年"_ostr, "你"_ostr, "你好"_ostr, "你哈"_ostr, "你好"_ostr, "你好"_ostr };
std::vector<OUString> aInputs;
std::transform(aUtf8Inputs.begin(), aUtf8Inputs.end(),
std::back_inserter(aInputs), [](OString aInput) { return OUString::fromUtf8(aInput);
}); for (constauto& aInput: aInputs)
{
pDocWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, aInput);
}
pDocWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, u""_ustr);
// commit the string to the cell
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
Scheduler::ProcessEventsToIdle();
// set the same state as now and we don't expect any change (no-toggle)
params =
{
comphelper::makePropertyValue(u"Enable"_ustr, uno::Any(!bSet)),
};
dispatchCommand(mxComponent, u".uno:SpellOnline"_ustr, params);
CPPUNIT_ASSERT_EQUAL(!bSet, pView->IsAutoSpell());
}
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testInvalidationLoop)
{ // Load the document with a form control.
createDoc("invalidation-loop.fods"); // Without the accompanying fix in place, this test would have never returned due to an infinite // invalidation loop between ScGridWindow::Paint() and vcl::Window::ImplPosSizeWindow().
Scheduler::ProcessEventsToIdle();
}
int nView1 = SfxLokHelper::getView();
ScTestViewCallback aView1;
CPPUNIT_ASSERT(!lcl_hasEditView(*pViewData));
SfxLokHelper::setView(nView1);
aView1.ClearAllInvalids();
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::PAGEDOWN | KEY_MOD1);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::PAGEDOWN | KEY_MOD1);
Scheduler::ProcessEventsToIdle(); // switching sheets should trigger no unnecessary invalidations
CPPUNIT_ASSERT(!aView1.m_bInvalidateTiles);
// Get the known columns/rows of this sheet 2 now we have switched to it so // it knows what range to broadcast invalidations for if it knows cells need // to be redrawn.
tools::JsonWriter aJsonWriter1;
pModelObj->getRowColumnHeaders(tools::Rectangle(0, 15, 19650, 5400), aJsonWriter1);
aJsonWriter1.finishAndGetAsOString();
Scheduler::ProcessEventsToIdle();
aView1.ClearAllInvalids();
// switching back should also trigger no unnecessary invalidations
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::PAGEUP | KEY_MOD1);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::PAGEUP | KEY_MOD1);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT(!aView1.m_bInvalidateTiles);
// The 2nd sheet has formulas that depend on B1 in the first sheet. So if // we change B1 there should be an invalidation in the second sheet for the // range that depends on it. Because this is a single user document with no // active view on the 2nd sheet this will happen on switching back to sheet 2
typeCharsInCell("101", 1, 0, pView, pModelObj); // Type '101' in B1
aView1.ClearAllInvalids();
// Paint it to make it valid again
getTile(pModelObj, 0, 0, 3840, 3840);
// switching back to sheet 1 should trigger no unnecessary invalidations
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::PAGEUP | KEY_MOD1);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::PAGEUP | KEY_MOD1);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT(!aView1.m_bInvalidateTiles);
// switching to sheet 2 should trigger no unnecessary invalidations this time
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::PAGEDOWN | KEY_MOD1);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::PAGEDOWN | KEY_MOD1);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT(!aView1.m_bInvalidateTiles);
CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testGetRowColumnHeadersInvalidation)
{ // NOTE NOTE NOTE // If you run this test in isolation using CPPUNIT_TEST_NAME=, it will fail because the invalidations // will be different.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.