diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-11-14 18:45:02 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-11-16 10:13:32 +0100 |
commit | 9c2a2aff948cf8b14e4f35a5637ae07c2a2f687c (patch) | |
tree | 20b46e02963734e91db78de112d1d531cc12288b /sfx2 | |
parent | 135b86cee45d20fbd8b1253954443be07d7f4abc (diff) |
lokdialog: Expose cursor visible status
Change the notifyDialog API a bit. Use a std::vector to keep track of
each payload item that needs to be fed to the resulting JSON.
Change-Id: If3229a88d2df5368e14290a0e80ebe6206780639
Reviewed-on: https://gerrit.libreoffice.org/44722
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 7e43b7ff0ce6..d24e0a7a3db6 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -132,7 +132,9 @@ void SfxLokHelper::notifyOtherViews(SfxViewShell* pThisView, int nType, const OS } } -void SfxLokHelper::notifyDialog(const OUString& rDialogID, const OUString& rAction, const Rectangle* rRect) +void SfxLokHelper::notifyDialog(const OUString& rDialogID, + const OUString& rAction, + const std::vector<vcl::LOKPayloadItem>& rPayload) { if (SfxLokHelper::getViewsCount() <= 0 || rDialogID.isEmpty()) return; @@ -140,9 +142,15 @@ void SfxLokHelper::notifyDialog(const OUString& rDialogID, const OUString& rActi SfxViewShell* pViewShell = SfxViewShell::GetFirst(); OString aPayload = OString("{ \"dialogId\": \"") + OUStringToOString(rDialogID, RTL_TEXTENCODING_UTF8).getStr() + OString("\""); aPayload += OString(", \"action\": \"") + OUStringToOString(rAction, RTL_TEXTENCODING_UTF8).getStr() + OString("\""); - if (!rAction.isEmpty() && rRect && !rRect->IsEmpty()) - aPayload += OString(", \"rectangle\": \"") + rRect->toString() + OString("\""); + for (const auto& rItem: rPayload) + { + if (!rItem.first.isEmpty() && !rItem.second.isEmpty()) + { + aPayload += OString(", \"") + rItem.first + OString("\": \"") + + rItem.second + OString("\""); + } + } aPayload += "}"; while (pViewShell) |