summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-11-28 02:25:36 +0530
committerJan Holesovsky <kendy@collabora.com>2017-11-28 19:49:29 +0100
commitf2fad6dcc1404e8358e348a91a06f5c7e9369384 (patch)
tree2a3e7c755f1e2307cb9a4921e3d899e222b8dbd0
parent5535ccc828e6159e5627ac016fc11b5588923264 (diff)
lokdialog: Notify the current view only
Change-Id: I55e0dbf1677a24905d337c58184a4419c1020a87
-rw-r--r--sfx2/source/view/lokhelper.cxx14
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)