sc/source/ui/app/inputwin.cxx      |    8 ++++++++
 starmath/source/edit.cxx           |    8 ++++++++
 svx/source/dialog/weldeditview.cxx |    7 -------
 3 files changed, 16 insertions(+), 7 deletions(-)

New commits:
commit 0cd1a953d1191de1d5c9eb09e31ca5f672c29837
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Aug 30 10:45:19 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Sep 5 16:04:25 2022 +0200

    its not ideal to wait until Paint to set the bg color
    
    set it at construction time
    
    Change-Id: I8923ea8f79c4bf18054fc697e2b35caad1b12486
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139024
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139413

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 817a68dc044f..5e28dd9c643e 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1550,6 +1550,10 @@ void ScTextWnd::InitEditEngine()
     m_xEditView->setEditViewCallbacks(this);
     m_xEditView->SetInsertMode(bIsInsertMode);
 
+    const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
+    Color aBgColor = rStyleSettings.GetWindowColor();
+    m_xEditView->SetBackgroundColor(aBgColor);
+
     if (pAcc)
     {
         pAcc->InitAcc(nullptr, m_xEditView.get(),
@@ -2064,6 +2068,10 @@ void ScTextWnd::MakeDialogEditView()
     m_xEditView = std::make_unique<EditView>(m_xEditEngine.get(), nullptr);
     m_xEditView->setEditViewCallbacks(this);
 
+    const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
+    Color aBgColor = rStyleSettings.GetWindowColor();
+    m_xEditView->SetBackgroundColor(aBgColor);
+
     if (pAcc)
     {
         pAcc->InitAcc(nullptr, m_xEditView.get(),
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index a0e75f18b408..1c92b03fb2b1 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -100,6 +100,12 @@ void SmEditTextWindow::SetDrawingArea(weld::DrawingArea* 
pDrawingArea)
 {
     weld::CustomWidgetController::SetDrawingArea(pDrawingArea);
 
+    const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
+    Color aBgColor = rStyleSettings.GetWindowColor();
+
+    OutputDevice& rDevice = pDrawingArea->get_ref_device();
+    rDevice.SetBackground(aBgColor);
+
     SetHelpId(HID_SMA_COMMAND_WIN_EDIT);
 
     EnableRTL(false);
@@ -113,6 +119,8 @@ void SmEditTextWindow::SetDrawingArea(weld::DrawingArea* 
pDrawingArea)
 
     m_xEditView->SetOutputArea(mrEditWindow.AdjustScrollBars());
 
+    m_xEditView->SetBackgroundColor(aBgColor);
+
     pDrawingArea->set_cursor(PointerStyle::Text);
 
     pEditEngine->SetStatusEventHdl(LINK(this, SmEditTextWindow, 
EditStatusHdl));
diff --git a/svx/source/dialog/weldeditview.cxx 
b/svx/source/dialog/weldeditview.cxx
index 4d900093b044..c00c887f3c71 100644
--- a/svx/source/dialog/weldeditview.cxx
+++ b/svx/source/dialog/weldeditview.cxx
@@ -161,13 +161,6 @@ void WeldEditView::Resize()
 
 void WeldEditView::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect)
 {
-    const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
-    Color aBgColor = rStyleSettings.GetWindowColor();
-
-    rRenderContext.SetBackground(aBgColor);
-    if (EditView* pEditView = GetEditView())
-        pEditView->SetBackgroundColor(aBgColor);
-
     DoPaint(rRenderContext, rRect);
 }
 

Reply via email to