diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2022-10-19 21:19:39 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2022-11-14 09:35:27 +0100 |
commit | f06353aadfc1a9329da0d5fe0cb5878d124b01aa (patch) | |
tree | 6ed6c156d655b1c97bf5d5006c6e8f0e69d17a8b /svx | |
parent | c6688def010fcb6854c6d896efe7186ff6c63475 (diff) |
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 <momonasmon@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/sdr/properties/textproperties.hxx | 1 | ||||
-rw-r--r-- | svx/source/table/svdotable.cxx | 5 |
2 files changed, 5 insertions, 1 deletions
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(); } |