diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-08-25 08:42:39 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-08-25 18:11:43 +0200 |
commit | c6f25506b02fbd2a087b7e790283921bf8550206 (patch) | |
tree | ddf8257b16946884e42b857f3f3661c910e1a529 /include/editeng | |
parent | 8befed1f019061cd0b0ef06f6b717f5bc77afdee (diff) |
i#114206 sd: unshare shape properties for the same type before insertion
Regression from commit 9bd99c08e8662becdd5ac8b47ef6f953c14e65fc
(CWS-TOOLING: integrate CWS os128, 2009-06-03), the problem was that the
SvxItemPropertySet was both used to store a property map (information
about UNO properties) and also as a descriptor for a not yet inserted
shape.
The above commit improved performance by sharing a single instance of an
SvxItemPropertySet for the same shape types: this works for the property
map, but doing the same for property values is problematic.
In practice, this eliminates the need for a workaround in oox/, the
user-visible problem was that loading a document with smartart, then
loading a document with group shapes (but without smartart) and saving
it would copy information from the first, closed document (!) to the
second document.
Just removing the oox/ workaround would make
make -C oox -sr CppunitTest_oox_drawingml CPPUNIT_TEST_NAME="testGroupShapeSmartArt testTdf131082"
fail, unsharing the descriptor piece makes it pass again.
Change-Id: Icdff2108ad0da18ce0ade081b1938dd74bc0ae90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120996
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'include/editeng')
-rw-r--r-- | include/editeng/unoipset.hxx | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/include/editeng/unoipset.hxx b/include/editeng/unoipset.hxx index 2c079a06b37f..b4ea97f6cb28 100644 --- a/include/editeng/unoipset.hxx +++ b/include/editeng/unoipset.hxx @@ -28,13 +28,12 @@ namespace com::sun::star::beans { class XPropertySetInfo; } class SfxItemSet; -struct SvxIDPropertyCombine; +class SvxItemPropertySetUsrAnys; class EDITENG_DLLPUBLIC SvxItemPropertySet { SfxItemPropertyMap m_aPropertyMap; mutable css::uno::Reference<css::beans::XPropertySetInfo> m_xInfo; - ::std::vector< SvxIDPropertyCombine > aCombineList; SfxItemPool& mrItemPool; public: @@ -49,17 +48,33 @@ public: static void setPropertyValue( const SfxItemPropertyMapEntry* pMap, const css::uno::Any& rVal, SfxItemSet& rSet, bool bDontConvertNegativeValues ); // Methods that use Any instead - css::uno::Any getPropertyValue( const SfxItemPropertyMapEntry* pMap ) const; - void setPropertyValue( const SfxItemPropertyMapEntry* pMap, const css::uno::Any& rVal ) const; + css::uno::Any getPropertyValue( const SfxItemPropertyMapEntry* pMap, SvxItemPropertySetUsrAnys& rAnys ) const; + static void setPropertyValue( const SfxItemPropertyMapEntry* pMap, const css::uno::Any& rVal, SvxItemPropertySetUsrAnys& rAnys ); + + css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const; + const SfxItemPropertyMap& getPropertyMap() const { return m_aPropertyMap;} + const SfxItemPropertyMapEntry* getPropertyMapEntry(std::u16string_view rName) const; +}; + +struct SvxIDPropertyCombine +{ + sal_uInt16 nWID; + sal_uInt8 memberId; + css::uno::Any aAny; +}; + +class EDITENG_DLLPUBLIC SvxItemPropertySetUsrAnys +{ + ::std::vector< SvxIDPropertyCombine > aCombineList; + +public: + SvxItemPropertySetUsrAnys(); + ~SvxItemPropertySetUsrAnys(); bool AreThereOwnUsrAnys() const { return ! aCombineList.empty(); } css::uno::Any* GetUsrAnyForID(SfxItemPropertyMapEntry const & entry) const; void AddUsrAnyForID(const css::uno::Any& rAny, SfxItemPropertyMapEntry const & entry); void ClearAllUsrAny(); - - css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const; - const SfxItemPropertyMap& getPropertyMap() const { return m_aPropertyMap;} - const SfxItemPropertyMapEntry* getPropertyMapEntry(std::u16string_view rName) const; }; /** converts the given any with a metric to 100th/mm if needed */ |