Resolves: tdf#160159 update spellchecking area colors when style changes

so for the case of using "automatic" for the document background the
spelling checking textbox background area updates to match

Change-Id: I8723afb946176596b0a5fa43aa3bb3c036dee12c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165476
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165630
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 0a50fbf..fe2804c 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1147,6 +1147,13 @@ void SentenceEditWindow_Impl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
    // tdf#132288 don't merge equal adjacent attributes
    m_xEditEngine->DisableAttributeExpanding();

    SetDocumentColor(pDrawingArea);
}

void SentenceEditWindow_Impl::SetDocumentColor(weld::DrawingArea* pDrawingArea)
{
    if (!pDrawingArea || !m_xEditView || !m_xEditEngine)
        return;
    // tdf#142631 use document background color in this widget
    Color aBgColor = svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
    OutputDevice& rDevice = pDrawingArea->get_ref_device();
@@ -1155,6 +1162,12 @@ void SentenceEditWindow_Impl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
    m_xEditEngine->SetBackgroundColor(aBgColor);
}

void SentenceEditWindow_Impl::StyleUpdated()
{
    SetDocumentColor(GetDrawingArea());
    WeldEditView::StyleUpdated();
}

SentenceEditWindow_Impl::~SentenceEditWindow_Impl()
{
}
diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx
index 3b8d2f9..da3870d 100644
--- a/cui/source/inc/SpellDialog.hxx
+++ b/cui/source/inc/SpellDialog.hxx
@@ -65,6 +65,7 @@ private:

protected:
    virtual bool    KeyInput( const KeyEvent& rKEvt ) override;
    virtual void    StyleUpdated() override;

public:
    SentenceEditWindow_Impl();
@@ -113,6 +114,8 @@ public:
    void            MoveErrorEnd(tools::Long nOffset);

    void            ResetIgnoreErrorsAt()   { m_aIgnoreErrorsAt.clear(); }

    void            SetDocumentColor(weld::DrawingArea* pDrawingArea);
};

// class SvxSpellDialog ---------------------------------------------