[Libreoffice-commits] core.git: include/svx svx/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Dec 9 16:21:35 UTC 2020
include/svx/weldeditview.hxx | 2 ++
svx/source/dialog/weldeditview.cxx | 15 ++++++++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
New commits:
commit 1b27638ce1434b0fee73685cb9cfc55dcc0c8b0b
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Dec 9 15:07:28 2020 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Dec 9 17:20:51 2020 +0100
split WeldEditView::Paint so a subclass can render a specific bg
Change-Id: Id502b98c6754db9dd6314c4bd960ca8065a0fa42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107473
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/svx/weldeditview.hxx b/include/svx/weldeditview.hxx
index 1fca83df4c70..1b96c4954da9 100644
--- a/include/svx/weldeditview.hxx
+++ b/include/svx/weldeditview.hxx
@@ -55,6 +55,8 @@ protected:
void InitAccessible();
+ void DoPaint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect);
+
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
virtual bool MouseMove(const MouseEvent& rMEvt) override;
virtual bool MouseButtonDown(const MouseEvent& rMEvt) override;
diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx
index 61c258a3730a..d14afb6dfec4 100644
--- a/svx/source/dialog/weldeditview.cxx
+++ b/svx/source/dialog/weldeditview.cxx
@@ -126,20 +126,25 @@ void WeldEditView::Resize()
void WeldEditView::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
{
- rRenderContext.Push(PushFlags::ALL);
- rRenderContext.SetClipRegion();
-
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
Color aBgColor = rStyleSettings.GetWindowColor();
rRenderContext.SetBackground(aBgColor);
+ if (EditView* pEditView = GetEditView())
+ pEditView->SetBackgroundColor(aBgColor);
+
+ DoPaint(rRenderContext, rRect);
+}
+
+void WeldEditView::DoPaint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
+{
+ rRenderContext.Push(PushFlags::ALL);
+ rRenderContext.SetClipRegion();
std::vector<tools::Rectangle> aLogicRects;
if (EditView* pEditView = GetEditView())
{
- pEditView->SetBackgroundColor(aBgColor);
-
pEditView->Paint(rRect, &rRenderContext);
if (HasFocus())
More information about the Libreoffice-commits
mailing list