editeng/source/editeng/impedit3.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 1aed9e3dae4b17e677a2af9e9f76a67d7c57dec0
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Wed Aug 28 14:13:10 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Aug 29 11:22:28 2024 +0200

    If there editeng backcolor is unknown, assume bg is the doccolor
    
    Change-Id: I65b2cd329db2c5868e6e84592303fd277ed63d56
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172534
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172564
    Tested-by: Jenkins

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 4c11d780c6f8..d8a89139cd59 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4955,10 +4955,13 @@ Color ImpEditEngine::GetAutoColor() const
 {
     Color aColor;
 
-    SfxViewShell* pKitSh = comphelper::LibreOfficeKit::isActive() ? 
SfxViewShell::Current() : nullptr;
+    const SfxViewShell* pKitSh = comphelper::LibreOfficeKit::isActive() ? 
SfxViewShell::Current() : nullptr;
     if (pKitSh)
     {
-        if (GetBackgroundColor().IsDark() )
+        Color aBackgroundColor = GetBackgroundColor();
+        if (aBackgroundColor == COL_AUTO)
+            aBackgroundColor = pKitSh->GetColorConfigColor(svtools::DOCCOLOR);
+        if (aBackgroundColor.IsDark())
             aColor = COL_WHITE;
         else
             aColor = COL_BLACK;

Reply via email to