[Libreoffice-commits] core.git: cui/source include/vcl vcl/source
Tamás Zolnai
tamas.zolnai at collabora.com
Sat Feb 10 15:35:37 UTC 2018
cui/source/tabpages/backgrnd.cxx | 20 --------------------
include/vcl/ctrl.hxx | 2 --
include/vcl/window.hxx | 2 +-
vcl/source/control/ctrl.cxx | 18 ------------------
vcl/source/window/paint.cxx | 8 +++++++-
5 files changed, 8 insertions(+), 42 deletions(-)
New commits:
commit b33287cde2d270d83e2658529be768a99dba98f0
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date: Sat Feb 10 13:24:21 2018 +0100
lokdialog: Handle dialog items' invalidation in general
Change-Id: Ib7b178fe97964bc5fd6ac173a143ba8ba089e237
Reviewed-on: https://gerrit.libreoffice.org/49240
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 3926e04f83fd..637f73c34c59 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -156,7 +156,6 @@ protected:
virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const ::tools::Rectangle& rRect ) override;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
virtual void Resize() override;
- virtual void LogicInvalidate(const ::tools::Rectangle* pRectangle) override;
private:
@@ -313,25 +312,6 @@ void BackgroundPreviewImpl::DataChanged( const DataChangedEvent& rDCEvt )
Window::DataChanged( rDCEvt );
}
-
-void BackgroundPreviewImpl::LogicInvalidate(const ::tools::Rectangle* /*pRectangle*/)
-{
- // Invalidate the container dialog or floating window
- // The code is same as in Control::LogicInvalidate() method
- if (comphelper::LibreOfficeKit::isActive() && !comphelper::LibreOfficeKit::isDialogPainting())
- {
- if (VclPtr<vcl::Window> pParent = GetParentWithLOKNotifier())
- {
- // invalidate the complete floating window for now
- if (pParent->ImplIsFloatingWindow())
- return pParent->LogicInvalidate(nullptr);
-
- const ::tools::Rectangle aRect(Point(GetOutOffXPixel(), GetOutOffYPixel()), Size(GetOutputWidthPixel(), GetOutputHeightPixel()));
- pParent->LogicInvalidate(&aRect);
- }
- }
-}
-
#define HDL(hdl) LINK(this,SvxBackgroundTabPage,hdl)
SvxBackgroundTabPage::SvxBackgroundTabPage(vcl::Window* pParent, const SfxItemSet& rCoreSet)
diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx
index 8e2926ae1774..cb68cfe8f78a 100644
--- a/include/vcl/ctrl.hxx
+++ b/include/vcl/ctrl.hxx
@@ -44,8 +44,6 @@ private:
SAL_DLLPRIVATE void ImplInitControlData();
- virtual void LogicInvalidate(const tools::Rectangle* pRectangle) override;
-
Control (const Control &) = delete;
Control & operator= (const Control &) = delete;
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 2cd63578b0f1..486ae567c1bc 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -567,7 +567,7 @@ public:
SAL_DLLPRIVATE bool ImplIsWindowOrChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const;
SAL_DLLPRIVATE bool ImplIsChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const;
- bool ImplIsFloatingWindow() const;
+ SAL_DLLPRIVATE bool ImplIsFloatingWindow() const;
SAL_DLLPRIVATE bool ImplIsPushButton() const;
SAL_DLLPRIVATE bool ImplIsSplitter() const;
SAL_DLLPRIVATE bool ImplIsOverlapWindow() const;
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 4ece999ab75b..7cc4cff385bf 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -416,24 +416,6 @@ 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())
- {
- if (VclPtr<vcl::Window> pParent = GetParentWithLOKNotifier())
- {
- // invalidate the complete floating window for now
- if (pParent->ImplIsFloatingWindow())
- return pParent->LogicInvalidate(nullptr);
-
- const tools::Rectangle aRect(Point(GetOutOffXPixel(), GetOutOffYPixel()), Size(GetOutputWidthPixel(), GetOutputHeightPixel()));
- pParent->LogicInvalidate(&aRect);
- }
- }
-}
-
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/paint.cxx b/vcl/source/window/paint.cxx
index 53b4e8cc55f1..80f09b193b66 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1189,7 +1189,7 @@ void Window::Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags )
void Window::LogicInvalidate(const tools::Rectangle* pRectangle)
{
- if (comphelper::LibreOfficeKit::isDialogPainting())
+ if (comphelper::LibreOfficeKit::isDialogPainting() || !comphelper::LibreOfficeKit::isActive())
return;
if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
@@ -1201,6 +1201,12 @@ void Window::LogicInvalidate(const tools::Rectangle* pRectangle)
pNotifier->notifyWindow(GetLOKWindowId(), "invalidate", aPayload);
}
+ // Added for dialog items. Pass invalidation to the parent window.
+ else if (VclPtr<vcl::Window> pParent = GetParentWithLOKNotifier())
+ {
+ const tools::Rectangle aRect(Point(GetOutOffXPixel(), GetOutOffYPixel()), Size(GetOutputWidthPixel(), GetOutputHeightPixel()));
+ pParent->LogicInvalidate(&aRect);
+ }
}
void Window::Validate()
More information about the Libreoffice-commits
mailing list