svx/inc/sdr/properties/textproperties.hxx |    1 +
 svx/source/table/svdotable.cxx            |    5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit f06353aadfc1a9329da0d5fe0cb5878d124b01aa
Author:     Maxim Monastirsky <momonas...@gmail.com>
AuthorDate: Wed Oct 19 21:19:39 2022 +0300
Commit:     Maxim Monastirsky <momonas...@gmail.com>
CommitDate: Mon Nov 14 09:35:27 2022 +0100

    svx: Update tables on style changes
    
    After modifying a cell style, it is required to broadcast
    the SfxHintId::DataChanged hint on that style, to update
    the table appearance. However, it doesn't work when only
    text attributes (e.g. font name or color) were changed,
    unless the table is also moved around a bit.
    
    It seems to be the same problem as i#101556, whose fix
    didn't handle the table case. The problem here is that
    the change hint is handled by the individual cells
    properties objects, and nothing updates the table's
    properties object.
    
    Change-Id: I30ebc85c16b20c5354f02a309e6fa3dd4b31f669
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142665
    Tested-by: Jenkins
    Reviewed-by: Maxim Monastirsky <momonas...@gmail.com>

diff --git a/svx/inc/sdr/properties/textproperties.hxx 
b/svx/inc/sdr/properties/textproperties.hxx
index 916e5a7f6b5b..8a5065442ed0 100644
--- a/svx/inc/sdr/properties/textproperties.hxx
+++ b/svx/inc/sdr/properties/textproperties.hxx
@@ -79,6 +79,7 @@ namespace sdr::properties
 
             // #i101556# versioning support
             virtual sal_uInt32 getVersion() const override;
+            void increaseVersion() { maVersion++; }
         };
 } // end of namespace sdr::properties
 
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index a22baf6d07b7..7764f35d1842 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -666,8 +666,11 @@ void SdrTableObjImpl::DragEdge( bool mbHorizontal, int 
nEdge, sal_Int32 nOffset
 // XModifyListener
 
 
-void SAL_CALL SdrTableObjImpl::modified( const css::lang::EventObject& 
/*aEvent*/ )
+void SAL_CALL SdrTableObjImpl::modified( const css::lang::EventObject& aEvent )
 {
+    if (aEvent.Source == mxTableStyle && mpTableObj)
+        
static_cast<TextProperties&>(mpTableObj->GetProperties()).increaseVersion();
+
     update();
 }
 

Reply via email to