diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 40 | ||||
-rw-r--r-- | sd/source/ui/func/futext.cxx | 4 |
2 files changed, 41 insertions, 3 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 948f06d9a9a0..40fc29639a05 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -65,6 +65,7 @@ public: void testResizeTableColumn(); void testViewCursors(); void testViewCursorParts(); + void testCursorViews(); CPPUNIT_TEST_SUITE(SdTiledRenderingTest); CPPUNIT_TEST(testRegisterCallback); @@ -86,6 +87,7 @@ public: CPPUNIT_TEST(testResizeTableColumn); CPPUNIT_TEST(testViewCursors); CPPUNIT_TEST(testViewCursorParts); + CPPUNIT_TEST(testCursorViews); CPPUNIT_TEST_SUITE_END(); private: @@ -818,11 +820,13 @@ public: bool m_bGraphicViewSelectionInvalidated; /// Our current part, to be able to decide if a view cursor/selection is relevant for us. int m_nPart; + bool m_bCursorVisibleChanged; ViewCallback() : m_bGraphicSelectionInvalidated(false), m_bGraphicViewSelectionInvalidated(false), - m_nPart(0) + m_nPart(0), + m_bCursorVisibleChanged(false) { } @@ -850,6 +854,11 @@ public: m_bGraphicViewSelectionInvalidated = true; } break; + case LOK_CALLBACK_CURSOR_VISIBLE: + { + m_bCursorVisibleChanged = true; + } + break; } } }; @@ -925,6 +934,35 @@ void SdTiledRenderingTest::testViewCursorParts() comphelper::LibreOfficeKit::setActive(false); } +void SdTiledRenderingTest::testCursorViews() +{ + comphelper::LibreOfficeKit::setActive(); + + // Create the first view. + SdXImpressDocument* pXImpressDocument = createDoc("shape.odp"); + ViewCallback aView1; + SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView1); + + // Begin text edit on the only object on the slide. + sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); + SdPage* pActualPage = pViewShell->GetActualPage(); + SdrObject* pObject = pActualPage->GetObj(0); + SdrView* pView = pViewShell->GetView(); + pView->MarkObj(pObject, pView->GetSdrPageView()); + pView->SdrBeginTextEdit(pObject); + + // Make sure that cursor state is not changed just because we create a second view. + aView1.m_bCursorVisibleChanged = false; + SfxLokHelper::createView(); + pXImpressDocument->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>()); + Scheduler::ProcessEventsToIdle(); + CPPUNIT_ASSERT(!aView1.m_bCursorVisibleChanged); + + mxComponent->dispose(); + mxComponent.clear(); + comphelper::LibreOfficeKit::setActive(false); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdTiledRenderingTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index a80fd6cd2c51..a27c0c49a7e9 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -979,7 +979,7 @@ void FuText::Activate() OutlinerView* pOLV = mpView->GetTextEditOutlinerView(); if (pOLV) - pOLV->ShowCursor(); + pOLV->ShowCursor(/*bGotoCursor=*/true, /*bActivate=*/true); FuConstruct::Activate(); @@ -992,7 +992,7 @@ void FuText::Deactivate() OutlinerView* pOLV = mpView->GetTextEditOutlinerView(); if (pOLV) - pOLV->HideCursor(); + pOLV->HideCursor(/*bDeactivate=*/true); mpView->SetHitTolerancePixel( HITPIX ); |