diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-07-28 18:07:44 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-11-15 17:07:06 +0100 |
commit | a0b8633ad73888d99c16948c0311b9c795683454 (patch) | |
tree | 99aa8e91fab82f54d2f86dbea0c61d1f8cdc5468 /sfx2 | |
parent | 4ab3ce170705ac87e0ba368b861cd3d7030fff25 (diff) |
lokdialog: Dialog invalidation support
For now, just invalidate the whole dialog whenever any of the controls
in the dialog get invalidated.
Since during dialog painting, many such invalidations are triggered,
don't listen to them when we are painting.
Change-Id: Ia8fc12cf9469691d60e91ef770d687e5ff01a7ef
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 13 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index dd35973c024c..4b4bacd82b1c 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -18,7 +18,10 @@ */ #include <stdlib.h> + +#include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> + #include <osl/file.hxx> #include <vcl/fixed.hxx> #include <vcl/help.hxx> @@ -29,6 +32,7 @@ #include <vcl/idle.hxx> #include <sfx2/basedlgs.hxx> +#include <sfx2/lokhelper.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/tabdlg.hxx> #include <sfx2/app.hxx> @@ -394,6 +398,13 @@ void SfxModelessDialog::FillInfo(SfxChildWinInfo& rInfo) const } +void SfxModelessDialog::LogicInvalidate(const Rectangle* /*pRectangle*/) +{ + if (!comphelper::LibreOfficeKit::isDialogPainting()) + SfxLokHelper::notifyDialogInvalidation(maID); +} + + bool SfxFloatingWindow::Notify( NotifyEvent& rEvt ) /* [Description] diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index bfcd000eba01..5be64690ac47 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -132,6 +132,19 @@ void SfxLokHelper::notifyOtherViews(SfxViewShell* pThisView, int nType, const OS } } +void SfxLokHelper::notifyDialogInvalidation(const OUString& rDialogID) +{ + if (SfxLokHelper::getViewsCount() <= 0) + return; + + SfxViewShell* pViewShell = SfxViewShell::GetFirst(); + while (pViewShell) + { + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DIALOG_INVALIDATE, OUStringToOString(rDialogID, RTL_TEXTENCODING_UTF8).getStr()); + pViewShell = SfxViewShell::GetNext(*pViewShell); + } +} + void SfxLokHelper::notifyInvalidation(SfxViewShell* pThisView, const OString& rPayload) { std::stringstream ss; |