diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-21 11:29:49 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-07-20 17:02:12 +0200 |
commit | c64ac7b2e9898cc56266ea8b32321bdd8558da34 (patch) | |
tree | 60b4be9385437b130b0949fa604bca47bfe64de8 /sw/source/core | |
parent | f31e970376b77d905bc30cbf65d54ceddccb8994 (diff) |
sw lok: add LOK_CALLBACK_TEXT_VIEW_SELECTION
So a view can be aware where selections of other views are.
Change-Id: I5026b1ff2b99a4eedfd0bde32a05ceb8e2f424bc
Reviewed-on: https://gerrit.libreoffice.org/26542
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
(cherry picked from commit 9f66db9c474f71f43d7a3667230241fd4fa4183f)
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/crsr/viscrs.cxx | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index bb1c3630f1e3..585a0f414738 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -198,26 +198,7 @@ void SwVisibleCursor::_SetPosAndShow() Rectangle aSVRect(aRect.Pos().getX(), aRect.Pos().getY(), aRect.Pos().getX() + aRect.SSize().Width(), aRect.Pos().getY() + aRect.SSize().Height()); OString sRect = aSVRect.toString(); m_pCursorShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr()); - - if (SfxLokHelper::getViews() > 1) - { - // Notify other views about the invalidated cursor. - SfxViewShell* pViewShell = SfxViewShell::GetFirst(); - while (pViewShell) - { - if (pViewShell != m_pCursorShell->GetSfxViewShell()) - { - boost::property_tree::ptree aTree; - aTree.put("viewId", SfxLokHelper::getView(m_pCursorShell->GetSfxViewShell())); - aTree.put("rectangle", sRect.getStr()); - std::stringstream aStream; - boost::property_tree::write_json(aStream, aTree); - OString aPayload = aStream.str().c_str(); - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, aPayload.getStr()); - } - pViewShell = SfxViewShell::GetNext(*pViewShell); - } - } + SfxLokHelper::notifyOtherViews(m_pCursorShell->GetSfxViewShell(), LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect); } if ( !m_pCursorShell->IsCursorReadonly() || m_pCursorShell->GetViewOptions()->IsSelectionInReadonly() ) @@ -416,6 +397,7 @@ void SwSelPaintRects::Show(std::vector<OString>* pSelectionRectangles) if (!pSelectionRectangles) { GetShell()->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRect.getStr()); + SfxLokHelper::notifyOtherViews(GetShell()->GetSfxViewShell(), LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", sRect); } else pSelectionRectangles->push_back(sRect); @@ -625,6 +607,7 @@ void SwShellCursor::Show() } OString sRect = comphelper::string::join("; ", aRect); GetShell()->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRect.getStr()); + SfxLokHelper::notifyOtherViews(GetShell()->GetSfxViewShell(), LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", sRect); } } |