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

New commits:
commit a0fc5c330f82c3cf24d9c62488abbc24285dd7d0
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: Wed Aug 28 18:35:21 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>

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 48547e25ebb7..afef27787738 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4716,9 +4716,13 @@ Color ImpEditEngine::GetAutoColor() const
 {
     Color aColor;
 
-    if (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current())
+    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