diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-12-01 13:54:45 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-12-04 17:14:02 +0530 |
commit | b5e27fd809845577a90cc1811de062c070110078 (patch) | |
tree | 679cb1c3712b6b0a5b693dfa9990e6de8592cc62 /vcl/source/control/ctrl.cxx | |
parent | 3d8154ec427777eadf5719f194662e5ade78fae5 (diff) |
lokdialog: Simplify; make the LOK dialog API more generic
Merge the dialog floating window callbacks and function calls into one.
Unique window ids across vcl::Window is enough to distinguish between
them.
Floating windows don't have a LOK notifier as they are created in the
vcl itself (so we can't access them from sfx2). Use the parent LOK
notifier in that case (which would be a dialog).
This API should also help in autopopup filter tunneling later.
Change-Id: I63a2c97ffdd84695dc967e14c793089a7c50b41b
Diffstat (limited to 'vcl/source/control/ctrl.cxx')
-rw-r--r-- | vcl/source/control/ctrl.cxx | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index b62c90563d46..37dc3dcdad8a 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -421,25 +421,15 @@ void Control::LogicInvalidate(const tools::Rectangle* /*pRectangle*/) // ignore all of those if (comphelper::LibreOfficeKit::isActive() && !comphelper::LibreOfficeKit::isDialogPainting()) { - // If parent is a floating window, trigger an invalidate there - vcl::Window* pWindow = this; - while (pWindow) + if (vcl::Window* pParent = GetParentWithLOKNotifier()) { - if (pWindow->ImplIsFloatingWindow()) - { - static_cast<FloatingWindow*>(pWindow)->LogicInvalidate(nullptr); - return; - } + // invalidate the complete floating window for now + if (pParent->ImplIsFloatingWindow()) + return pParent->LogicInvalidate(nullptr); - pWindow = pWindow->GetParent(); + const tools::Rectangle aRect(Point(GetOutOffXPixel(), GetOutOffYPixel()), Size(GetOutputWidthPixel(), GetOutputHeightPixel())); + pParent->LogicInvalidate(&aRect); } - - // otherwise, for now, just invalidate the whole dialog - Dialog* pParentDlg = GetParentDialog(); - - const tools::Rectangle aRect(Point(GetOutOffXPixel(), GetOutOffYPixel()), Size(GetOutputWidthPixel(), GetOutputHeightPixel())); - if (pParentDlg) - pParentDlg->LogicInvalidate(&aRect); } } |