diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-10-30 18:46:07 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-11-08 09:14:39 +0100 |
commit | 9c5bc82fdfa67d0149806a0b55962edc7925dd0f (patch) | |
tree | 57d2af2d53076ba7dba5faacaf30ef937b10e4b3 | |
parent | e9f5fce4e514bd15094e8588e835325e5027c80a (diff) |
lok: custom widgets: render editbox borders
Change-Id: I1962a4a1397363b1c15e49d57b0bbcc9c232ce30
-rw-r--r-- | include/vcl/edit.hxx | 2 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 15 |
2 files changed, 14 insertions, 3 deletions
diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx index 9588da8b6fe6..45006a407414 100644 --- a/include/vcl/edit.hxx +++ b/include/vcl/edit.hxx @@ -111,7 +111,7 @@ private: SAL_DLLPRIVATE void ImplInsertText( const OUString& rStr, const Selection* pNewSelection = nullptr, bool bIsUserInput = false ); SAL_DLLPRIVATE static OUString ImplGetValidString( const OUString& rString ); SAL_DLLPRIVATE void ImplClearBackground(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRectangle, long nXStart, long nXEnd); - SAL_DLLPRIVATE void ImplPaintBorder(vcl::RenderContext const & rRenderContext, long nXStart, long nXEnd); + SAL_DLLPRIVATE void ImplPaintBorder(vcl::RenderContext& rRenderContext, long nXStart, long nXEnd); SAL_DLLPRIVATE void ImplShowCursor( bool bOnlyIfVisible = true ); SAL_DLLPRIVATE void ImplAlign(); SAL_DLLPRIVATE void ImplAlignAndPaint(); diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 7560860de9de..38797d68c783 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -57,6 +57,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> +#include <comphelper/lok.hxx> #include <sot/exchange.hxx> #include <sot/formats.hxx> @@ -1000,7 +1001,7 @@ void Edit::ImplClearBackground(vcl::RenderContext& rRenderContext, const tools:: } } -void Edit::ImplPaintBorder(vcl::RenderContext const & rRenderContext, long nXStart, long nXEnd) +void Edit::ImplPaintBorder(vcl::RenderContext& rRenderContext, long nXStart, long nXEnd) { // this is not needed when double-buffering if (SupportsDoubleBuffering()) @@ -1062,7 +1063,17 @@ void Edit::ImplPaintBorder(vcl::RenderContext const & rRenderContext, long nXSta } else { - pBorder->Paint(*pBorder, tools::Rectangle()); + // For some mysterious reaon, in headless/svp rendering, + // pBorder has bad clipping region (shows as 1x1@0,0), + // and therefore doesn't render anything at all. + // In the case that we know we're in headless/svp, we + // render directly on the current context (the edit control). + // But if we (the editbox) are part of a more complex control + // (e.g. spinbox), we render not (i.e. we let pBorder pretend). + if (!mbIsSubEdit && comphelper::LibreOfficeKit::isActive()) + pBorder->Paint(rRenderContext, tools::Rectangle()); + else + pBorder->Paint(*pBorder, tools::Rectangle()); } } } |