summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-13 10:06:52 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-14 10:10:31 +0200
commitac5f21587c09f700c1cbbe33ed73edfcc53ed666 (patch)
tree6d22c9ad540f93361792b45ac8e3b6d6cb5841fb
parent176c7905f469bcefb06dc0772a6bbadfc8a8833f (diff)
sw: emit LOK_CALLBACK_GRAPHIC_VIEW_SELECTION as part of registerCallback()
Have a Writer shape selection in the first view, create a new view, the second view doesn't see the selection. But the same works if the shape selection is created when the second view was created earlier. Emit the svx selection state as part of SwCursorShell::NotifyCursor() to fix the problem, but take care of not sending the status to the new view itself. Reviewed-on: https://gerrit.libreoffice.org/28857 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 786cc8a5a3cd34329c72b867e5fd7896b10a7351) Conflicts: sw/source/core/crsr/crsrsh.cxx Change-Id: Iff3979235e1c12cc64867c3184354967f451370b
-rw-r--r--svx/source/svdraw/svdmrkv.cxx5
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx4
-rw-r--r--sw/source/core/crsr/crsrsh.cxx9
3 files changed, 14 insertions, 4 deletions
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index a1533906d3b0..20ff410e82ce 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -777,9 +777,12 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
if(SfxViewShell* pViewShell = GetSfxViewShell())
{
if (pOtherShell)
+ {
// An other shell wants to know about our existing
// selection.
- SfxLokHelper::notifyOtherView(pViewShell, pOtherShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelection);
+ if (pViewShell != pOtherShell)
+ SfxLokHelper::notifyOtherView(pViewShell, pOtherShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelection);
+ }
else
{
// We have a new selection, so both pViewShell and the
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 048ade6c634b..ada126f2723c 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -1304,10 +1304,14 @@ void SwTiledRenderingTest::testCreateViewGraphicSelection()
// Make sure that the hidden text cursor isn't visible in the second view, either.
ViewCallback aView2;
aView2.m_bViewCursorVisible = true;
+ aView2.m_bGraphicViewSelection = false;
SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView2);
// This was true, the second view didn't get the visibility of the text
// cursor of the first view.
CPPUNIT_ASSERT(!aView2.m_bViewCursorVisible);
+ // This was false, the second view didn't get the graphic selection of the
+ // first view.
+ CPPUNIT_ASSERT(aView2.m_bGraphicViewSelection);
mxComponent->dispose();
mxComponent.clear();
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 72ed33c446d6..d88d21c52c02 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1224,12 +1224,15 @@ OUString SwCursorShell::getPageRectangles()
return OUString::fromUtf8(comphelper::string::join("; ", v).getStr());
}
-void SwCursorShell::NotifyCursor(SfxViewShell* pViewShell) const
+void SwCursorShell::NotifyCursor(SfxViewShell* pOtherShell) const
{
// Cursor position and visibility.
- m_pVisibleCursor->_SetPosAndShow(pViewShell);
+ m_pVisibleCursor->_SetPosAndShow(pOtherShell);
// Text selection.
- m_pCurrentCursor->Show(pViewShell);
+ m_pCurrentCursor->Show(pOtherShell);
+ // Graphic selection.
+ auto pView = const_cast<SdrView*>(GetDrawView());
+ pView->AdjustMarkHdl(pOtherShell);
}
/// go to the next SSelection