cui/source/dialogs/SpellDialog.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 9adcf14d9b2e9dffd47a26eae202da348675a5e4
Author:     Rafael Lima <[email protected]>
AuthorDate: Wed Nov 2 18:54:24 2022 +0200
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Jan 2 19:03:52 2023 +0000

    tdf#116566 Make Spellcheck dialog respect dark background
    
    This patch makes the sentence in the spellcheck dialog respect the colors 
in the selected color scheme. More specifically, it uses the AutoSpellcheck 
color and the Font Color in the Edit Engine.
    
    Change-Id: I0f8e842417645250c9145d1e37d8cf52c290379e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142147
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>
    (cherry picked from commit 1de8308d40fad8e9281d2b491f8c5c919fda82f4)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144910

diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index 49e1415e744e..21f7f2b4da80 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1140,6 +1140,7 @@ void 
SentenceEditWindow_Impl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
     OutputDevice& rDevice = pDrawingArea->get_ref_device();
     rDevice.SetBackground(aBgColor);
     m_xEditView->SetBackgroundColor(aBgColor);
+    m_xEditEngine->SetBackgroundColor(aBgColor);
 }
 
 SentenceEditWindow_Impl::~SentenceEditWindow_Impl()
@@ -1671,8 +1672,13 @@ void SentenceEditWindow_Impl::MoveErrorMarkTo(sal_Int32 
nStart, sal_Int32 nEnd,
     m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_WEIGHT_CJK);
     m_xEditEngine->RemoveAttribs(aAll, false, EE_CHAR_WEIGHT_CTL);
 
+    // tdf#116566 Use color defined in the current Color Scheme
+    Color aSpellErrorCollor = 
svtools::ColorConfig().GetColorValue(svtools::SPELL).nColor;
+
+    // TODO: Create a new Color Scheme entry for grammar mistakes and use it 
below
+    // instead of using hardcoded COL_LIGHTBLUE
     SfxItemSet aSet(m_xEditEngine->GetEmptyItemSet());
-    aSet.Put(SvxColorItem(bGrammarError ? COL_LIGHTBLUE : COL_LIGHTRED, 
EE_CHAR_COLOR));
+    aSet.Put(SvxColorItem(bGrammarError ? COL_LIGHTBLUE : aSpellErrorCollor, 
EE_CHAR_COLOR));
     aSet.Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT));
     aSet.Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT_CJK));
     aSet.Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT_CTL));

Reply via email to