From 974ea04ddd1b82e5d5c0171bd8ad29310e3f2bd7 Mon Sep 17 00:00:00 2001 From: Tamás Zolnai Date: Thu, 1 Feb 2018 19:55:51 +0100 Subject: lokdialog: Color/font picker in dialogs don't show preview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Invalidation needs to be passed upward to the right parent window. It should work similar to other dialog items, but this preview class is not derived from the Control class. Change-Id: I5fb2b6438b8be92d55609c8d3c25110b49d0e6d7 Reviewed-on: https://gerrit.libreoffice.org/49101 Tested-by: Jenkins Reviewed-by: Tamás Zolnai --- cui/source/tabpages/backgrnd.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'cui/source/tabpages') diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 00bdcd0cadd8..3926e04f83fd 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,7 @@ #include #include #include +#include using namespace css; @@ -154,6 +156,7 @@ 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: @@ -310,6 +313,25 @@ 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 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) -- cgit