diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-11-05 14:01:42 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-11-15 17:07:17 +0100 |
commit | f13dfb4c018080e94d8ed247984bf2f37e0653b8 (patch) | |
tree | 0307994500d53238cfd8a97954f1153dfd034b91 /sfx2 | |
parent | dd2c566b29b74d025761df77f5744c5b21e97625 (diff) |
lokdialog: Support painting parts of the dialog
Pass the dimensions of the region to the paintDialog call to paint only
that much of the region in the dialog.
The DIALOG_INVALIDATE callback also returns a 'rectangle' field now in
the payload that tells the region of the dialog invalidated. It can be
used in combination with the new paintDialog call then to paint only the
invalidated region in the dialog.
Change-Id: Iebb228865c71684e0f75dd01271b71ae41a0f906
Reviewed-on: https://gerrit.libreoffice.org/44472
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 8128f88fef10..7e43b7ff0ce6 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -132,15 +132,18 @@ void SfxLokHelper::notifyOtherViews(SfxViewShell* pThisView, int nType, const OS } } -void SfxLokHelper::notifyDialog(const OUString& rDialogID, const OUString& rAction) +void SfxLokHelper::notifyDialog(const OUString& rDialogID, const OUString& rAction, const Rectangle* rRect) { if (SfxLokHelper::getViewsCount() <= 0 || rDialogID.isEmpty()) return; SfxViewShell* pViewShell = SfxViewShell::GetFirst(); - const OString aPayload = OString("{ \"dialogId\": \"") + OUStringToOString(rDialogID, RTL_TEXTENCODING_UTF8).getStr() + - OString("\", \"action\": \"") + OUStringToOString(rAction, RTL_TEXTENCODING_UTF8).getStr() + - + "\" }"; + 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("\""); + + aPayload += "}"; while (pViewShell) { |