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 /vcl | |
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 'vcl')
-rw-r--r-- | vcl/source/control/ctrl.cxx | 15 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index bab54bbf8711..48f93e045145 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -18,12 +18,14 @@ */ #include <comphelper/processfactory.hxx> +#include <comphelper/lok.hxx> #include <tools/rc.h> #include <vcl/svapp.hxx> #include <vcl/event.hxx> #include <vcl/ctrl.hxx> #include <vcl/decoview.hxx> +#include <vcl/dialog.hxx> #include <vcl/salnativewidgets.hxx> #include <vcl/settings.hxx> @@ -416,6 +418,19 @@ void Control::ImplInitSettings(const bool, const bool) ApplySettings(*this); } +void Control::LogicInvalidate(const Rectangle* /*pRectangle*/) +{ + // Several repaint, resize invalidations are emitted when we are painting, + // ignore all of those + if (comphelper::LibreOfficeKit::isActive() && !comphelper::LibreOfficeKit::isDialogPainting()) + { + // For now just invalidate the whole dialog + Dialog* pParentDlg = GetParentDialog(); + if (pParentDlg) + pParentDlg->LogicInvalidate(nullptr); + } +} + Rectangle Control::DrawControlText( OutputDevice& _rTargetDevice, const Rectangle& rRect, const OUString& _rStr, DrawTextFlags _nStyle, MetricVector* _pVector, OUString* _pDisplayText, const Size* i_pDeviceSize ) const { diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 4c7c7b9146d3..b41d7210cb1c 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -522,6 +522,7 @@ void Dialog::doDeferredInit(WinBits nBits) Dialog::Dialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription) : SystemWindow(WINDOW_DIALOG) , mnInitFlag(InitFlag::Default) + , maID(rID) { ImplInitDialogData(); loadUI(pParent, OUStringToOString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription); @@ -530,6 +531,7 @@ Dialog::Dialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXML Dialog::Dialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription, WindowType nType, InitFlag eFlag) : SystemWindow(nType) , mnInitFlag(eFlag) + , maID(rID) { ImplInitDialogData(); loadUI(pParent, OUStringToOString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription); |