diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 11 | ||||
-rw-r--r-- | sd/source/ui/inc/ViewShellBase.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/ViewShellBase.cxx | 19 |
3 files changed, 31 insertions, 1 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index b5ba3ae13f91..a80a8de2e9c1 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -1118,7 +1118,6 @@ void SdTiledRenderingTest::testCreateViewGraphicSelection() // Load a document and register a callback. SdXImpressDocument* pXImpressDocument = createDoc("shape.odp"); - pXImpressDocument->initializeForTiledRendering({}); ViewCallback aView1; SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView1); @@ -1134,10 +1133,20 @@ void SdTiledRenderingTest::testCreateViewGraphicSelection() // Now create a new view. aView1.m_bGraphicSelectionInvalidated = false; SfxLokHelper::createView(); + pXImpressDocument->initializeForTiledRendering({}); // This failed, creating a new view affected the graphic selection of an // existing view. CPPUNIT_ASSERT(!aView1.m_bGraphicSelectionInvalidated); + // Check that when the first view has a shape selected and we register a + // callback on the second view, then it gets a "graphic view selection". + ViewCallback aView2; + aView2.m_bGraphicViewSelectionInvalidated = false; + SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView2); + // This failed, the created new view had no "view selection" of the first + // view's selected shape. + CPPUNIT_ASSERT(aView2.m_bGraphicViewSelectionInvalidated); + mxComponent->dispose(); mxComponent.clear(); comphelper::LibreOfficeKit::setActive(false); diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx index f47a49a0a049..b2c5e47d5b0d 100644 --- a/sd/source/ui/inc/ViewShellBase.hxx +++ b/sd/source/ui/inc/ViewShellBase.hxx @@ -219,6 +219,8 @@ public: OUString RetrieveLabelFromCommand( const OUString& aCmdURL ) const; /// See SfxViewShell::getPart(). int getPart() const override; + /// See SfxViewShell::NotifyCursor(). + void NotifyCursor(SfxViewShell* pViewShell) const override; protected: diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index eb2a8adfce3c..6f718f119072 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -90,6 +90,7 @@ #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include "fubullet.hxx" +#include "drawview.hxx" using namespace sd; #define ViewShellBase @@ -1033,6 +1034,24 @@ int ViewShellBase::getPart() const return 0; } +void ViewShellBase::NotifyCursor(SfxViewShell* pOtherShell) const +{ + ViewShell* pThisShell = framework::FrameworkHelper::Instance(*const_cast<ViewShellBase*>(this))->GetViewShell(FrameworkHelper::msCenterPaneURL).get(); + + DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(pThisShell); + if (!pDrawViewShell) + return; + + if (this == pOtherShell) + return; + + DrawView* pDrawView = pDrawViewShell->GetDrawView(); + if (!pDrawView) + return; + + pDrawView->AdjustMarkHdl(pOtherShell); +} + //===== ViewShellBase::Implementation ========================================= ViewShellBase::Implementation::Implementation (ViewShellBase& rBase) |