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-09 18:42:33 +0100 |
commit | 7484f1691cbe9513dabf084effe8a0366b737a80 (patch) | |
tree | 1c7e6479d1e3191cbb8765b8a2dbcf969c93fe31 /vcl | |
parent | 5f0f59840d5a7d05ba19587099a3c587172d447d (diff) |
lok: custom widgets: render editbox borders
Change-Id: I1962a4a1397363b1c15e49d57b0bbcc9c232ce30
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/edit.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index e92c2639b23d..dbc15519c4a9 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -55,6 +55,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> +#include <comphelper/lok.hxx> #include <sot/exchange.hxx> #include <sot/formats.hxx> @@ -985,7 +986,7 @@ void Edit::ImplClearBackground(vcl::RenderContext& rRenderContext, const tools:: } } -void Edit::ImplPaintBorder(vcl::RenderContext const & rRenderContext) +void Edit::ImplPaintBorder(vcl::RenderContext& rRenderContext) { // this is not needed when double-buffering if (SupportsDoubleBuffering()) @@ -1042,7 +1043,17 @@ void Edit::ImplPaintBorder(vcl::RenderContext const & rRenderContext) } 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()); } } } |