diff options
Diffstat (limited to 'sfx2/source/view/lokhelper.cxx')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 685cbe4a4a73..d39c3ac2cacb 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -139,7 +139,7 @@ void SfxLokHelper::notifyWindow(vcl::LOKWindowId nLOKWindowId, if (SfxLokHelper::getViewsCount() <= 0 || nLOKWindowId == 0) return; - SfxViewShell* pViewShell = SfxViewShell::GetFirst(); + OString aPayload = OString("{ \"dialogId\": \"") + OString::number(nLOKWindowId) + OString("\""); aPayload += OString(", \"action\": \"") + OUStringToOString(rAction, RTL_TEXTENCODING_UTF8).getStr() + OString("\""); @@ -153,11 +153,8 @@ void SfxLokHelper::notifyWindow(vcl::LOKWindowId nLOKWindowId, } aPayload += "}"; - while (pViewShell) - { + if (SfxViewShell* pViewShell = SfxViewShell::Current()) pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DIALOG, aPayload.getStr()); - pViewShell = SfxViewShell::GetNext(*pViewShell); - } } void SfxLokHelper::notifyWindowChild(vcl::LOKWindowId nLOKWindowId, const OUString& rAction, const Point& rPos) @@ -165,17 +162,14 @@ void SfxLokHelper::notifyWindowChild(vcl::LOKWindowId nLOKWindowId, const OUStri if (SfxLokHelper::getViewsCount() <= 0 || nLOKWindowId == 0) return; - SfxViewShell* pViewShell = SfxViewShell::GetFirst(); + const OString aPayload = OString("{ \"dialogId\": \"") + OString::number(nLOKWindowId) + OString("\", \"action\": \"") + OUStringToOString(rAction, RTL_TEXTENCODING_UTF8).getStr() + OString("\", \"position\": \"") + OString::number(rPos.getX()) + OString(", ") + OString::number(rPos.getY()) + + "\" }"; - while (pViewShell) - { + if (SfxViewShell* pViewShell = SfxViewShell::Current()) pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DIALOG_CHILD, aPayload.getStr()); - pViewShell = SfxViewShell::GetNext(*pViewShell); - } } void SfxLokHelper::notifyInvalidation(SfxViewShell* pThisView, const OString& rPayload) |