cui/source/tabpages/backgrnd.cxx | 22 ++++++++++++++++++++++ include/vcl/window.hxx | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-)
New commits: commit 81e6d59738c67e2050428bce9c0f490eebacb7f2 Author: Tamás Zolnai <tamas.zol...@collabora.com> Date: Fri Feb 2 19:10:19 2018 +0100 lokdialog: Color/font picker in dialogs don't show preview 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. Reviewed-on: https://gerrit.libreoffice.org/49101 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> (cherry picked from commit 974ea04ddd1b82e5d5c0171bd8ad29310e3f2bd7) Change-Id: I5fb2b6438b8be92d55609c8d3c25110b49d0e6d7 Reviewed-on: https://gerrit.libreoffice.org/49160 Reviewed-by: Andras Timar <andras.ti...@collabora.com> Tested-by: Andras Timar <andras.ti...@collabora.com> diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 43d8fdd2eddb..2554da1581b7 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -23,6 +23,7 @@ #include <vcl/msgbox.hxx> #include <vcl/settings.hxx> #include <vcl/idle.hxx> +#include <vcl/window.hxx> #include <tools/urlobj.hxx> #include <sfx2/dialoghelper.hxx> #include <sfx2/objsh.hxx> @@ -51,6 +52,7 @@ #include <svl/intitem.hxx> #include <sfx2/request.hxx> #include <svtools/grfmgr.hxx> +#include <comphelper/lok.hxx> using namespace css; @@ -160,6 +162,7 @@ protected: virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect ) override; virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; virtual void Resize() override; + virtual void LogicInvalidate(const Rectangle* pRectangle) override; private: @@ -321,6 +324,25 @@ void BackgroundPreviewImpl::DataChanged( const DataChangedEvent& rDCEvt ) Window::DataChanged( rDCEvt ); } + +void BackgroundPreviewImpl::LogicInvalidate(const 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 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/window.hxx b/include/vcl/window.hxx index 7f15b5dac267..dcdaddc75c12 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -560,7 +560,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; - SAL_DLLPRIVATE bool ImplIsFloatingWindow() const; + bool ImplIsFloatingWindow() const; SAL_DLLPRIVATE bool ImplIsPushButton() const; SAL_DLLPRIVATE bool ImplIsSplitter() const; SAL_DLLPRIVATE bool ImplIsOverlapWindow() const; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits