diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 26 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 9 |
2 files changed, 21 insertions, 14 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 41131604709a..68707875bf0d 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -88,6 +88,19 @@ std::size_t SfxLokHelper::getViews() return rViewArr.size(); } +void SfxLokHelper::notifyOtherView(SfxViewShell* pThisView, SfxViewShell* pOtherView, int nType, const OString& rKey, const OString& rPayload) +{ + boost::property_tree::ptree aTree; + aTree.put("viewId", SfxLokHelper::getView(pThisView)); + aTree.put(rKey.getStr(), rPayload.getStr()); + aTree.put("part", pThisView->getPart()); + aTree.put(rKey.getStr(), rPayload.getStr()); + std::stringstream aStream; + boost::property_tree::write_json(aStream, aTree); + OString aPayload = aStream.str().c_str(); + pOtherView->libreOfficeKitViewCallback(nType, aPayload.getStr()); +} + void SfxLokHelper::notifyOtherViews(SfxViewShell* pThisView, int nType, const OString& rKey, const OString& rPayload) { if (SfxLokHelper::getViews() <= 1) @@ -97,17 +110,8 @@ void SfxLokHelper::notifyOtherViews(SfxViewShell* pThisView, int nType, const OS while (pViewShell) { if (pViewShell != pThisView) - { - boost::property_tree::ptree aTree; - aTree.put("viewId", SfxLokHelper::getView(pThisView)); - aTree.put(rKey.getStr(), rPayload.getStr()); - aTree.put("part", pThisView->getPart()); - aTree.put(rKey.getStr(), rPayload.getStr()); - std::stringstream aStream; - boost::property_tree::write_json(aStream, aTree); - OString aPayload = aStream.str().c_str(); - pViewShell->libreOfficeKitViewCallback(nType, aPayload.getStr()); - } + notifyOtherView(pThisView, pViewShell, nType, rKey, rPayload); + pViewShell = SfxViewShell::GetNext(*pViewShell); } } diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 694ea7d6dc58..de2f3e82a547 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1609,12 +1609,11 @@ void SfxViewShell::registerLibreOfficeKitViewCallback(LibreOfficeKitCallback pCa pImp->m_pLibreOfficeKitViewCallback = pCallback; pImp->m_pLibreOfficeKitViewData = pData; - // Ask other views to send their cursor position to the new view. + // Ask other views to tell us about their cursors. SfxViewShell* pViewShell = SfxViewShell::GetFirst(); while (pViewShell) { - pViewShell->ShowCursor(false); - pViewShell->ShowCursor(); + pViewShell->NotifyCursor(this); pViewShell = SfxViewShell::GetNext(*pViewShell); } } @@ -1642,6 +1641,10 @@ void SfxViewShell::libreOfficeKitViewCallback(int nType, const char* pPayload) c pImp->m_pLibreOfficeKitViewCallback(nType, pPayload, pImp->m_pLibreOfficeKitViewData); } +void SfxViewShell::NotifyCursor(SfxViewShell* /*pViewShell*/) const +{ +} + void SfxViewShell::setTiledSearching(bool bTiledSearching) { pImp->m_bTiledSearching = bTiledSearching; |