diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2022-02-17 22:13:54 +0100 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2022-02-17 23:56:37 +0100 |
commit | 4c0b033ece143b6f398157e812ff1c6b22e2855d (patch) | |
tree | 7fbe9893be41bfa51a42c90e289c54a7b4072d25 /svx/source/toolbars | |
parent | 3fb587e89421a862a1e65f47cad17839e2b832e4 (diff) |
tdf#147409 tdf#146866 use SetPropertyValue for toggle
The toggles (Textpath,SameLetterHeights) and (Extrusion,Extrusion)
change a value by directly writing the value into the property. That
is lines (*pAny) <<= bOn;, for example. But that does not trigger
InvalidateHash() of the SdrCustomShapeGeometryItem. So the item has
still aHashState 'Valid'. On the other hand because of the change the
hash itself has changed. Therefore the == comparison between the
original item and its clone returns 'false' in customshapeitem.cxx#238.
And as a result, the assert in itempool.cxx#679 fails.
My solution replaces the direct writing with setting the value via
SetPropertyValue(), which includes the needed InvalidateHash(). The
method InvalidateHash() is private and so cannot be directly used in
fontwork.cxx and extrusionbar.cxx.
Change-Id: Ib6021defb61478de9cbefa8f26466a2fe21352a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130117
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'svx/source/toolbars')
-rw-r--r-- | svx/source/toolbars/extrusionbar.cxx | 13 | ||||
-rw-r--r-- | svx/source/toolbars/fontworkbar.cxx | 5 |
2 files changed, 12 insertions, 6 deletions
diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx index 26ac4805cde0..10b56ad4b369 100644 --- a/svx/source/toolbars/extrusionbar.cxx +++ b/svx/source/toolbars/extrusionbar.cxx @@ -125,23 +125,26 @@ static void impl_execute( SfxRequest const & rReq, SdrCustomShapeGeometryItem& r { case SID_EXTRUSION_TOGGLE: { - css::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion ); - bool bOn(false); - if( pAny ) + css::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion ); + if ( pAny ) { (*pAny) >>= bOn; bOn = !bOn; - (*pAny) <<= bOn; + css::beans::PropertyValue aPropValue; + aPropValue.Name = sExtrusion; + aPropValue.Value <<= bOn; + rGeometryItem.SetPropertyValue(sExtrusion, aPropValue); } else { css::beans::PropertyValue aPropValue; aPropValue.Name = sExtrusion; aPropValue.Value <<= true; - rGeometryItem.SetPropertyValue( sExtrusion, aPropValue ); + rGeometryItem.SetPropertyValue(sExtrusion, aPropValue); bOn = true; } + // draw:extrusion-diffusion has default 0% and c3DDiffuseAmt has default 100%. We set property // "Diffusion" with value 100% here if it does not exist already. This forces, that the // property is written to file in case an extrusion is newly created, and users of old diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx index 888e2d2f43a9..7b2e8653b09d 100644 --- a/svx/source/toolbars/fontworkbar.cxx +++ b/svx/source/toolbars/fontworkbar.cxx @@ -247,7 +247,10 @@ static void impl_execute( SfxRequest const & rReq, SdrCustomShapeGeometryItem& r bool bOn = false; (*pAny) >>= bOn; bOn = !bOn; - (*pAny) <<= bOn; + css::beans::PropertyValue aPropValue; + aPropValue.Name = "SameLetterHeights"; + aPropValue.Value <<= bOn; + rGeometryItem.SetPropertyValue("TextPath", aPropValue); } } break; |