From 446a37ece35dbe4c442f0679dd1cb4df79ed87a7 Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Sun, 5 Nov 2017 14:01:42 +0530 Subject: 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 Reviewed-by: pranavk --- sfx2/source/view/lokhelper.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index eccb3b1bf1f0..633e221e4f86 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -144,15 +144,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 tools::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) { -- cgit