summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-07-28 18:07:44 +0530
committerPranav Kant <pranavk@collabora.co.uk>2017-10-02 10:57:15 +0530
commit9874cd5efae7fb45f68da0e5ebc7701fdad0414a (patch)
treef5895b5a779958e436117149bd25943e31e491c2 /vcl
parent706e4d198683f6c2075a91050d21a298ad186cc6 (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.cxx15
-rw-r--r--vcl/source/window/dialog.cxx2
2 files changed, 17 insertions, 0 deletions
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 5df29a0d3560..3bd877ea7162 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -18,11 +18,13 @@
*/
#include <comphelper/processfactory.hxx>
+#include <comphelper/lok.hxx>
#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>
#include <vcl/uitest/logger.hxx>
@@ -412,6 +414,19 @@ void Control::ImplInitSettings()
ApplySettings(*this);
}
+void Control::LogicInvalidate(const tools::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);
+ }
+}
+
tools::Rectangle Control::DrawControlText( OutputDevice& _rTargetDevice, const tools::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 679c83ba462b..b4e5b6a667fb 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -514,6 +514,7 @@ void Dialog::doDeferredInit(WinBits nBits)
Dialog::Dialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription)
: SystemWindow(WindowType::DIALOG)
, mnInitFlag(InitFlag::Default)
+ , maID(rID)
{
ImplInitDialogData();
loadUI(pParent, OUStringToOString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription);
@@ -522,6 +523,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);