cui/source/dialogs/SpellDialog.cxx |   13 +++++++++++++
 cui/source/inc/SpellDialog.hxx     |    3 +++
 sfx2/source/doc/objstor.cxx        |    6 +++++-
 3 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit b037311742a31fa8dc8c77c8232d6540c41ded44
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Sun Apr 28 13:16:59 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon May 6 19:23:34 2024 +0200

    tdf#160827: fix crash when retrieving _MarkAsFinal value (docx) (take 2)
    
    Change-Id: I3f2ad56a205877be54b0dbfe361b76db3436f5ca
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166798
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
    Tested-by: Jenkins
    (cherry picked from commit 45d2d90d2354a6a32297cde52c0041915499b19b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166726
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit 2ed402dada3b8b64c6f23cf5afc068848ab1a528)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166834
    (cherry picked from commit 5c6b34cb3f8651da008c0b78da4211f4ee8f20f2)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166840
    Tested-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 4dee93d1e917..91e4bb9ff61a 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2308,7 +2308,11 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
                     uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = 
xPropertySet->getPropertySetInfo();
                     if (xPropertySetInfo.is() && 
xPropertySetInfo->hasPropertyByName("_MarkAsFinal"))
                     {
-                        if 
(xPropertySet->getPropertyValue("_MarkAsFinal").get<bool>())
+                        Any anyMarkAsFinal = 
xPropertySet->getPropertyValue("_MarkAsFinal");
+                        if (
+                               ( (anyMarkAsFinal.getValueType() == 
cppu::UnoType<bool>::get()) && (anyMarkAsFinal.get<bool>()) ) ||
+                               ( (anyMarkAsFinal.getValueType() == 
cppu::UnoType<OUString>::get()) && (anyMarkAsFinal.get<OUString>() == "true") )
+                        )
                         {
                             uno::Reference< lang::XMultiServiceFactory > 
xFactory(GetModel(), uno::UNO_QUERY);
                             uno::Reference< beans::XPropertySet > 
xSettings(xFactory->createInstance("com.sun.star.document.Settings"), 
uno::UNO_QUERY);
commit d5349dfd55a0ec0c96fd6c62af34e599cb60e6ce
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Mar 29 16:22:10 2024 +0000
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon May 6 19:23:25 2024 +0200

    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 <fit...@ubuntu.com>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165630
    (cherry picked from commit 18e17288781f1b974d8b08ec1253271cd42e66ef)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166847
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>

diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index 0a50fbfb8cd7..fe2804c81151 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 3b8d2f9fa02f..da3870dad5eb 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 ---------------------------------------------

Reply via email to