Kaydet (Commit) 3acfdeca authored tarafından Pranav Kant's avatar Pranav Kant Kaydeden (comit) Jan Holesovsky

lokdialog: Notify the current view only

Change-Id: I55e0dbf1677a24905d337c58184a4419c1020a87
üst 1dda69be
...@@ -151,7 +151,7 @@ void SfxLokHelper::notifyWindow(vcl::LOKWindowId nLOKWindowId, ...@@ -151,7 +151,7 @@ void SfxLokHelper::notifyWindow(vcl::LOKWindowId nLOKWindowId,
if (SfxLokHelper::getViewsCount() <= 0 || nLOKWindowId == 0) if (SfxLokHelper::getViewsCount() <= 0 || nLOKWindowId == 0)
return; return;
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
OString aPayload = OString("{ \"dialogId\": \"") + OString::number(nLOKWindowId) + OString("\""); OString aPayload = OString("{ \"dialogId\": \"") + OString::number(nLOKWindowId) + OString("\"");
aPayload += OString(", \"action\": \"") + OUStringToOString(rAction, RTL_TEXTENCODING_UTF8).getStr() + OString("\""); aPayload += OString(", \"action\": \"") + OUStringToOString(rAction, RTL_TEXTENCODING_UTF8).getStr() + OString("\"");
...@@ -165,11 +165,8 @@ void SfxLokHelper::notifyWindow(vcl::LOKWindowId nLOKWindowId, ...@@ -165,11 +165,8 @@ void SfxLokHelper::notifyWindow(vcl::LOKWindowId nLOKWindowId,
} }
aPayload += "}"; aPayload += "}";
while (pViewShell) if (SfxViewShell* pViewShell = SfxViewShell::Current())
{
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DIALOG, aPayload.getStr()); pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DIALOG, aPayload.getStr());
pViewShell = SfxViewShell::GetNext(*pViewShell);
}
} }
void SfxLokHelper::notifyWindowChild(vcl::LOKWindowId nLOKWindowId, const OUString& rAction, const Point& rPos) void SfxLokHelper::notifyWindowChild(vcl::LOKWindowId nLOKWindowId, const OUString& rAction, const Point& rPos)
...@@ -177,17 +174,14 @@ void SfxLokHelper::notifyWindowChild(vcl::LOKWindowId nLOKWindowId, const OUStri ...@@ -177,17 +174,14 @@ void SfxLokHelper::notifyWindowChild(vcl::LOKWindowId nLOKWindowId, const OUStri
if (SfxLokHelper::getViewsCount() <= 0 || nLOKWindowId == 0) if (SfxLokHelper::getViewsCount() <= 0 || nLOKWindowId == 0)
return; return;
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
const OString aPayload = OString("{ \"dialogId\": \"") + OString::number(nLOKWindowId) + const OString aPayload = OString("{ \"dialogId\": \"") + OString::number(nLOKWindowId) +
OString("\", \"action\": \"") + OUStringToOString(rAction, RTL_TEXTENCODING_UTF8).getStr() + OString("\", \"action\": \"") + OUStringToOString(rAction, RTL_TEXTENCODING_UTF8).getStr() +
OString("\", \"position\": \"") + OString::number(rPos.getX()) + OString(", ") + OString::number(rPos.getY()) + 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->libreOfficeKitViewCallback(LOK_CALLBACK_DIALOG_CHILD, aPayload.getStr());
pViewShell = SfxViewShell::GetNext(*pViewShell);
}
} }
void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, const OString& rPayload) void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, const OString& rPayload)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment