svx/source/svdraw/svdmrkv.cxx | 5 ++++- sw/qa/extras/tiledrendering/tiledrendering.cxx | 4 ++++ sw/source/core/crsr/crsrsh.cxx | 9 ++++++--- 3 files changed, 14 insertions(+), 4 deletions(-)
New commits: commit 786cc8a5a3cd34329c72b867e5fd7896b10a7351 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Tue Sep 13 10:06:52 2016 +0200 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. Change-Id: Iff3979235e1c12cc64867c3184354967f451370b Reviewed-on: https://gerrit.libreoffice.org/28857 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Jenkins <c...@libreoffice.org> diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index eb14f29..402c61e 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -767,9 +767,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 e61f23f..a2a88e1 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -1303,10 +1303,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 bfa0bc0..241d8d4 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1192,12 +1192,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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits