diff options
-rw-r--r-- | sw/qa/extras/tiledrendering/tiledrendering.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/crsr/viscrs.cxx | 3 |
3 files changed, 14 insertions, 5 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index f6fb64fe6652..b61a11013d12 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -707,7 +707,10 @@ public: break; case LOK_CALLBACK_VIEW_CURSOR_VISIBLE: { - m_bViewCursorVisible = OString("true") == pPayload; + std::stringstream aStream(pPayload); + boost::property_tree::ptree aTree; + boost::property_tree::read_json(aStream, aTree); + m_bViewCursorVisible = aTree.get_child("visible").get_value<std::string>() == "true"; } break; case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION: @@ -871,6 +874,8 @@ void SwTiledRenderingTest::testViewCursorVisibility() pXTextDocument->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>()); ViewCallback aView2; SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView2); + // This failed, initially the view cursor in the second view wasn't visible. + CPPUNIT_ASSERT(aView2.m_bViewCursorVisible); // Click on the shape in the second view. aView1.m_bViewCursorVisible = true; @@ -1374,6 +1379,7 @@ void SwTiledRenderingTest::testCreateViewGraphicSelection() SdrView* pView = pWrtShell->GetDrawView(); aView1.m_bGraphicSelection = true; pView->MarkObj(pObject, pView->GetSdrPageView()); + pWrtShell->HideCursor(); CPPUNIT_ASSERT(aView1.m_bGraphicSelection); // Create a second view. diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 99f75a4058c3..f45cc955d62a 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1247,8 +1247,14 @@ void SwCursorShell::NotifyCursor(SfxViewShell* pOtherShell) const } else { - // Cursor position and visibility. + // Cursor position. m_pVisibleCursor->_SetPosAndShow(pOtherShell); + // Cursor visibility. + if (GetSfxViewShell() != pOtherShell) + { + OString aPayload = OString::boolean(m_bSVCursorVis); + SfxLokHelper::notifyOtherView(GetSfxViewShell(), pOtherShell, LOK_CALLBACK_VIEW_CURSOR_VISIBLE, "visible", aPayload); + } // Text selection. m_pCurrentCursor->Show(pOtherShell); // Graphic selection. diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 4ac52fbb1612..01c851df18b0 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -204,10 +204,7 @@ void SwVisibleCursor::_SetPosAndShow(SfxViewShell* pViewShell) if (pViewShell == m_pCursorShell->GetSfxViewShell()) pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr()); else - { SfxLokHelper::notifyOtherView(m_pCursorShell->GetSfxViewShell(), pViewShell, LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect); - SfxLokHelper::notifyOtherView(m_pCursorShell->GetSfxViewShell(), pViewShell, LOK_CALLBACK_VIEW_CURSOR_VISIBLE, "visible", OString::boolean(m_bIsVisible)); - } } else { |