diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-07-28 18:07:44 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-10-02 10:57:15 +0530 |
commit | 9874cd5efae7fb45f68da0e5ebc7701fdad0414a (patch) | |
tree | f5895b5a779958e436117149bd25943e31e491c2 /sfx2 | |
parent | 706e4d198683f6c2075a91050d21a298ad186cc6 (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 fceeab0d7e50..0d2d90d142de 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> @@ -390,6 +394,13 @@ void SfxModelessDialog::FillInfo(SfxChildWinInfo& rInfo) const } +void SfxModelessDialog::LogicInvalidate(const tools::Rectangle* /*pRectangle*/) +{ + if (!comphelper::LibreOfficeKit::isDialogPainting()) + SfxLokHelper::notifyDialogInvalidation(maID); +} + + bool SfxFloatingWindow::EventNotify( NotifyEvent& rEvt ) /* [Description] diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 1597174af5b0..d63d0ad2fb4f 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -144,6 +144,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 const* pThisView, const OString& rPayload) { OStringBuffer aBuf; |