include/svl/itempool.hxx | 13 +++++++ include/svl/poolitem.hxx | 6 +++ include/svx/xit.hxx | 5 +- svl/source/items/itempool.cxx | 44 ++++++++++++++++++++++++ svl/source/items/itemset.cxx | 17 +++++++-- svl/source/items/poolitem.cxx | 1 svx/source/xoutdev/xattr.cxx | 71 +++++++++++++++++++++------------------- svx/source/xoutdev/xattrbmp.cxx | 8 ++-- 8 files changed, 122 insertions(+), 43 deletions(-)
New commits: commit be5fad6d0755e3d1e7ab5c9d4bfda8248b4e51d2 Author: Armin Le Grand (Collabora) <armin.le.gr...@me.com> AuthorDate: Fri Jul 26 20:15:56 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Jul 29 08:01:06 2024 +0200 tdf#161875 buffer NameOrIndex Items for fast Surrogates Problem is that collecting the Items using the ItemSets and PoolItemHolders is too expensive when used too often. For read-only access it is okay to have the Items directly registerd (for write access we *need* the ItemSets and PoolItemHolders, see iterateItemSurrogates). This is limited to Items which need to support surrogates, but can further be limited to the here critical ones - the ones derived from NameOrIndex. This is done here by checking if the Item is a NameOrIndex based one by adding a bool to the item that gets set in the NameOrIndex constructor. If needed this can be changed, e.g. by using besides the SFX_ITEMINFOFLAG_SUPPORT_SURROGATE another flag signaling this. Since only Items that are currently held by an ItemSet or a PoolItemHolder get registered it is not necessary to change the Item's RefCount in any way, doing that may lead (again, we had that with directly set Items at the Pool in the past) to long-living Items that only get cleaned-up when the pool/ document gets destructed. This buffering is now SfxItemType-based, no longer using the WhichID, so the result needs to be checked for WhichID additionally - if needed (?). All in all it's anyways a compromize, every usage of the surrogate mechanism is a 'hack' in the sense that for lazy reasons not the model data is traversed directly, but assumed that all Items set at a pool/model *are* model/document data (what is not always true). CheckNamedItem does not need to be static, changed that. Also all accesses to maRegisteredNameOrIndex *have* to work on the MasterPool instance, same as buffered ItemSets or PoolItemHolders, corrected that, too. Number of instances in the buffer need to be counted, else an instance will be removed too early: The same instance of an Item can be referenced by multiple sets/holders, so the first remove from the buffer would already remove even when the Item is referenced multiple times. Added that. Added more asserts & made sure that all constructors/ destructors of SfxItemSet do take care of registering Items for the surrogate mechanism as needed. Change-Id: Ib33e7f0bd4abd32a3bb68278f33b0abb9a4754c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171084 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/include/svl/itempool.hxx b/include/svl/itempool.hxx index 7c3868ca9996..030a09d0f688 100644 --- a/include/svl/itempool.hxx +++ b/include/svl/itempool.hxx @@ -136,6 +136,8 @@ typedef std::unordered_set<SfxPoolItemHolder*> registeredSfxPoolItemHolders; typedef std::vector<const SfxPoolItem*> ItemSurrogates; typedef std::unordered_map<sal_uInt16, const ItemInfo*> userItemInfos; typedef std::vector<const ItemInfo*> itemInfoVector; +typedef std::unordered_map<const SfxPoolItem*, sal_uInt32> NameOrIndexContent; +typedef std::unordered_map<SfxItemType, NameOrIndexContent> registeredNameOrIndex; /** Base class for providers of defaults of SfxPoolItems. * @@ -165,6 +167,11 @@ class SVL_DLLPUBLIC SfxItemPool : public salhelper::SimpleReferenceObject registeredSfxItemSets maRegisteredSfxItemSets; registeredSfxPoolItemHolders maRegisteredSfxPoolItemHolders; + + // place to register all NameOrIndex Items that are either set in an + // SfxItemSet or SfxPolItemHolder for this Model/Pool + registeredNameOrIndex maRegisteredNameOrIndex; + bool mbShutdownHintSent; itemInfoVector maItemInfos; @@ -204,6 +211,9 @@ private: void registerPoolItemHolder(SfxPoolItemHolder& rHolder); void unregisterPoolItemHolder(SfxPoolItemHolder& rHolder); + void registerNameOrIndex(const SfxPoolItem& rItem); + void unregisterNameOrIndex(const SfxPoolItem& rItem); + public: // for default SfxItemSet::CTOR, set default WhichRanges const WhichRangesContainer& GetMergedIdRanges() const; @@ -311,6 +321,9 @@ public: // Read commit text for more information void GetItemSurrogates(ItemSurrogates& rTarget, sal_uInt16 nWhich) const; + // special version for read-oly itemSurrogates for NameOrIndex Items + void GetItemSurrogatesForItem(ItemSurrogates& rTarget, const SfxPoolItem& rItem) const; + sal_uInt16 GetFirstWhich() const { return mnStart; } sal_uInt16 GetLastWhich() const { return mnEnd; } bool IsInRange( sal_uInt16 nWhich ) const { return nWhich >= mnStart && nWhich <= mnEnd; } diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx index 111ee2253f7f..17ab04f32166 100644 --- a/include/svl/poolitem.hxx +++ b/include/svl/poolitem.hxx @@ -580,6 +580,10 @@ class SVL_DLLPUBLIC SfxPoolItem // be fixed at that Items we may remove this again. bool m_bShareable : 1; + // for speedup/buffering we need to identify NameOrIndex + // Items quickly + bool m_bNameOrIndex : 1; + protected: #ifdef DBG_UTIL // this flag will make debugging item stuff much simpler @@ -590,6 +594,7 @@ protected: void setDynamicDefault() { m_bDynamicDefault = true; } void setIsSetItem() { m_bIsSetItem = true; } void setNonShareable() { m_bShareable = false; } + void setNameOrIndex() { m_bNameOrIndex = true; } // access ItemInstanceManager for this Item, default // is nullptr. If you overload this it is expected that @@ -615,6 +620,7 @@ public: bool isDynamicDefault() const { return m_bDynamicDefault; } bool isSetItem() const { return m_bIsSetItem; } bool isShareable() const { return m_bShareable; } + bool isNameOrIndex() const { return m_bNameOrIndex; } bool isPooled() const { return GetRefCount() > 0; } diff --git a/include/svx/xit.hxx b/include/svx/xit.hxx index 5902424a7d05..7fd0fbd09327 100644 --- a/include/svx/xit.hxx +++ b/include/svx/xit.hxx @@ -55,12 +55,11 @@ public: bool IsIndex() const { return (m_nPalIndex >= 0); } sal_Int32 GetPalIndex() const { return m_nPalIndex; } - /** this static checks if the given NameOrIndex item has a unique name for its value. + /** this checks if the given NameOrIndex item has a unique name for its value. The returned String is a unique name for an item with this value in both given pools. - Argument pPool2 can be null. If returned string equals NameOrIndex->GetName(), the name was already unique. */ - static OUString CheckNamedItem( const NameOrIndex* pCheckItem, const sal_uInt16 nWhich, const SfxItemPool* pPool1, SvxCompareValueFunc pCompareValueFunc, TranslateId pPrefixResId, const XPropertyListRef &pDefaults ); + OUString CheckNamedItem(const sal_uInt16 nWhich, const SfxItemPool* pPool1, SvxCompareValueFunc pCompareValueFunc, TranslateId pPrefixResId, const XPropertyListRef &pDefaults) const; void dumpAsXml(xmlTextWriterPtr pWriter) const override; }; diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index 54a348251944..f624eb0aded9 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -402,6 +402,8 @@ void SfxItemPool::registerPoolItemHolder(SfxPoolItemHolder& rHolder) SAL_WARN("svl.items", "SfxItemPool::registerPoolItemHolder: SfxPoolItemHolder was already registered (!)"); } #endif + if (rHolder.is() && rHolder.getItem()->isNameOrIndex()) + registerNameOrIndex(*rHolder.getItem()); } void SfxItemPool::unregisterPoolItemHolder(SfxPoolItemHolder& rHolder) @@ -418,6 +420,31 @@ void SfxItemPool::unregisterPoolItemHolder(SfxPoolItemHolder& rHolder) SAL_WARN("svl.items", "SfxItemPool::unregisterPoolItemHolder: SfxPoolItemHolder was not registered (!)"); } #endif + if (rHolder.is() && rHolder.getItem()->isNameOrIndex()) + unregisterNameOrIndex(*rHolder.getItem()); +} + +void SfxItemPool::registerNameOrIndex(const SfxPoolItem& rItem) +{ + assert(rItem.isNameOrIndex() && "ITEM: only Items derived from NameOrIndex supported for this mechanism (!)"); + NameOrIndexContent& rTarget(GetMasterPool()->maRegisteredNameOrIndex[rItem.ItemType()]); + NameOrIndexContent::iterator aHit(rTarget.find(&rItem)); + if (aHit == rTarget.end()) + rTarget.insert(std::pair<const SfxPoolItem*, sal_uInt32>(&rItem, 0)); + else + aHit->second++; +} + +void SfxItemPool::unregisterNameOrIndex(const SfxPoolItem& rItem) +{ + assert(rItem.isNameOrIndex() && "ITEM: only Items derived from NameOrIndex supported for this mechanism (!)"); + NameOrIndexContent& rTarget(GetMasterPool()->maRegisteredNameOrIndex[rItem.ItemType()]); + NameOrIndexContent::iterator aHit(rTarget.find(&rItem)); + assert(aHit != rTarget.end() && "ITEM: malformed order of buffered NameOrIndex Items, entry *expected* (!)"); + if (0 == aHit->second) + rTarget.erase(aHit); + else + aHit->second--; } SfxItemPool* SfxItemPool::getTargetPool(sal_uInt16 nWhich) const @@ -484,6 +511,7 @@ SfxItemPool::SfxItemPool(const OUString& rName) /* Pool name to identify in the , eDefMetric(MapUnit::MapCM) , maRegisteredSfxItemSets() , maRegisteredSfxPoolItemHolders() +, maRegisteredNameOrIndex() , mbShutdownHintSent(false) , maItemInfos() , maUserItemInfos() @@ -509,6 +537,7 @@ SfxItemPool::SfxItemPool(const SfxItemPool& rPool) // Copy from this instance , eDefMetric(MapUnit::MapCM) , maRegisteredSfxItemSets() , maRegisteredSfxPoolItemHolders() +, maRegisteredNameOrIndex() , mbShutdownHintSent(false) , maItemInfos(rPool.maItemInfos) , maUserItemInfos(rPool.maUserItemInfos) @@ -853,6 +882,21 @@ void SfxItemPool::iterateItemSurrogates( } } +void SfxItemPool::GetItemSurrogatesForItem(ItemSurrogates& rTarget, const SfxPoolItem& rItem) const +{ + assert(rItem.isNameOrIndex() && "ITEM: only Items derived from NameOrIndex supported for this mechanism (!)"); + const registeredNameOrIndex& rRegistered(GetMasterPool()->maRegisteredNameOrIndex); + registeredNameOrIndex::const_iterator aHit(rRegistered.find(rItem.ItemType())); + if (aHit != rRegistered.end()) + { + rTarget.clear(); + rTarget.reserve(aHit->second.size()); + for (const auto& entry : aHit->second) + rTarget.push_back(entry.first); + } + // rTarget = ItemSurrogates(aHit->second.begin(), aHit->second.end()); +} + void SfxItemPool::GetItemSurrogates(ItemSurrogates& rTarget, sal_uInt16 nWhich) const { rTarget.clear(); diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index 523ffc857509..8c7e772a1efd 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -256,7 +256,7 @@ SfxItemSet::SfxItemSet(SfxItemPool& pool, WhichRangesContainer wids) SfxItemSet::SfxItemSet( const SfxItemSet& rASet ) : m_pPool( rASet.m_pPool ) , m_pParent( rASet.m_pParent ) -, m_nRegister( rASet.m_nRegister ) +, m_nRegister( 0 ) #ifdef DBG_UTIL , m_nRegisteredSfxItemIter(0) #endif @@ -271,11 +271,14 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ) return; for (const auto& rSource : rASet.m_aPoolItemMap) - m_aPoolItemMap[rSource.first] = implCreateItemEntry(*GetPool(), rSource.second, false); + { + const SfxPoolItem* pNew(implCreateItemEntry(*GetPool(), rSource.second, false)); + m_aPoolItemMap[rSource.first] = pNew; + if (m_nRegister != rASet.m_nRegister) + checkAddPoolRegistration(pNew); + } assert(m_aWhichRanges.validRanges2()); - if (0 != m_nRegister) - GetPool()->registerItemSet(*this); } SfxItemSet::SfxItemSet(SfxItemSet&& rASet) noexcept @@ -397,6 +400,9 @@ void SfxItemSet::checkRemovePoolRegistration(const SfxPoolItem* pItem) // deregister when no more Items that NeedsSurrogateSupport exist if (0 == m_nRegister) GetPool()->unregisterItemSet(*this); + + if (pItem->isNameOrIndex()) + GetPool()->unregisterNameOrIndex(*pItem); } void SfxItemSet::checkAddPoolRegistration(const SfxPoolItem* pItem) @@ -421,6 +427,9 @@ void SfxItemSet::checkAddPoolRegistration(const SfxPoolItem* pItem) if (0 == m_nRegister) GetPool()->registerItemSet(*this); + if (pItem->isNameOrIndex()) + GetPool()->registerNameOrIndex(*pItem); + // increment counter m_nRegister++; } diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index 85aa8b998878..dd628225a7d8 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.cxx @@ -526,6 +526,7 @@ SfxPoolItem::SfxPoolItem(sal_uInt16 const nWhich, SfxItemType eType) , m_bDynamicDefault(false) , m_bIsSetItem(false) , m_bShareable(true) + , m_bNameOrIndex(false) #ifdef DBG_UTIL , m_bDeleted(false) #endif diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index a7b307c066e8..bbcfe8e28678 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -101,18 +101,21 @@ NameOrIndex::NameOrIndex(TypedWhichId<NameOrIndex> _nWhich, sal_Int32 nIndex, Sf SfxStringItem(_nWhich, OUString(), eItemType), m_nPalIndex(nIndex) { + setNameOrIndex(); } NameOrIndex::NameOrIndex(TypedWhichId<NameOrIndex> _nWhich, const OUString& rName, SfxItemType eItemType) : SfxStringItem(_nWhich, rName, eItemType), m_nPalIndex(-1) { + setNameOrIndex(); } NameOrIndex::NameOrIndex(const NameOrIndex& rNameOrIndex) : SfxStringItem(rNameOrIndex), m_nPalIndex(rNameOrIndex.m_nPalIndex) { + setNameOrIndex(); } bool NameOrIndex::operator==(const SfxPoolItem& rItem) const @@ -131,11 +134,11 @@ NameOrIndex* NameOrIndex::Clone(SfxItemPool* /*pPool*/) const Argument pPool2 can be null. If returned string equals NameOrIndex->GetName(), the name was already unique. */ -OUString NameOrIndex::CheckNamedItem( const NameOrIndex* pCheckItem, const sal_uInt16 nWhich, const SfxItemPool* pPool1, SvxCompareValueFunc pCompareValueFunc, TranslateId pPrefixResId, const XPropertyListRef &pDefaults ) +OUString NameOrIndex::CheckNamedItem(const sal_uInt16 nWhich, const SfxItemPool* pPool1, SvxCompareValueFunc pCompareValueFunc, TranslateId pPrefixResId, const XPropertyListRef &pDefaults) const { bool bForceNew = false; - OUString aUniqueName = SvxUnogetInternalNameForItem(nWhich, pCheckItem->GetName()); + OUString aUniqueName = SvxUnogetInternalNameForItem(nWhich, GetName()); // 2. if we have a name check if there is already an item with the // same name in the documents pool with a different line end or start @@ -143,16 +146,18 @@ OUString NameOrIndex::CheckNamedItem( const NameOrIndex* pCheckItem, const sal_u if (!aUniqueName.isEmpty() && pPool1) { ItemSurrogates aSurrogates; - pPool1->GetItemSurrogates(aSurrogates, nWhich); + // use special version to get buffered NameOrIndex Items + pPool1->GetItemSurrogatesForItem(aSurrogates, *this); for (const SfxPoolItem* pItem : aSurrogates) { const NameOrIndex *pNameOrIndex = static_cast<const NameOrIndex*>(pItem); - if( pNameOrIndex->GetName() == pCheckItem->GetName() ) + // need to check for WhichID, GetItemSurrogatesForItem does buffer on type only + if( pNameOrIndex->Which() == nWhich && pNameOrIndex->GetName() == GetName() ) { // if there is already an item with the same name and the same // value it's ok to set it - if( !pCompareValueFunc( pNameOrIndex, pCheckItem ) ) + if( !pCompareValueFunc( pNameOrIndex, this ) ) { // same name but different value, we need a new name for this item aUniqueName.clear(); @@ -185,26 +190,26 @@ OUString NameOrIndex::CheckNamedItem( const NameOrIndex* pCheckItem, const sal_u { case XATTR_FILLBITMAP: { - const GraphicObject& rGraphicObjectA(static_cast<const XFillBitmapItem*>(pCheckItem)->GetGraphicObject()); + const GraphicObject& rGraphicObjectA(static_cast<const XFillBitmapItem*>(this)->GetGraphicObject()); const GraphicObject& rGraphicObjectB(static_cast<const XBitmapEntry*>(pEntry)->GetGraphicObject()); bFound = (rGraphicObjectA == rGraphicObjectB); break; } case XATTR_LINEDASH: - bFound = static_cast<const XLineDashItem*>(pCheckItem)->GetDashValue() == static_cast<const XDashEntry*>(pEntry)->GetDash(); + bFound = static_cast<const XLineDashItem*>(this)->GetDashValue() == static_cast<const XDashEntry*>(pEntry)->GetDash(); break; case XATTR_LINESTART: - bFound = static_cast<const XLineStartItem*>(pCheckItem)->GetLineStartValue() == static_cast<const XLineEndEntry*>(pEntry)->GetLineEnd(); + bFound = static_cast<const XLineStartItem*>(this)->GetLineStartValue() == static_cast<const XLineEndEntry*>(pEntry)->GetLineEnd(); break; case XATTR_LINEEND: - bFound = static_cast<const XLineEndItem*>(pCheckItem)->GetLineEndValue() == static_cast<const XLineEndEntry*>(pEntry)->GetLineEnd(); + bFound = static_cast<const XLineEndItem*>(this)->GetLineEndValue() == static_cast<const XLineEndEntry*>(pEntry)->GetLineEnd(); break; case XATTR_FILLGRADIENT: - bFound = static_cast<const XFillGradientItem*>(pCheckItem)->GetGradientValue() == static_cast<const XGradientEntry*>(pEntry)->GetGradient(); + bFound = static_cast<const XFillGradientItem*>(this)->GetGradientValue() == static_cast<const XGradientEntry*>(pEntry)->GetGradient(); break; case XATTR_FILLHATCH: - bFound = static_cast<const XFillHatchItem*>(pCheckItem)->GetHatchValue() == static_cast<const XHatchEntry*>(pEntry)->GetHatch(); + bFound = static_cast<const XFillHatchItem*>(this)->GetHatchValue() == static_cast<const XHatchEntry*>(pEntry)->GetHatch(); break; } @@ -230,14 +235,16 @@ OUString NameOrIndex::CheckNamedItem( const NameOrIndex* pCheckItem, const sal_u if (aUniqueName.isEmpty() && pPool1) { ItemSurrogates aSurrogates; - pPool1->GetItemSurrogates(aSurrogates, nWhich); + // use special version to get buffered NameOrIndex Items + pPool1->GetItemSurrogatesForItem(aSurrogates, *this); for (const SfxPoolItem* pItem : aSurrogates) { const NameOrIndex *pNameOrIndex = static_cast<const NameOrIndex*>(pItem); - if( !pNameOrIndex->GetName().isEmpty() ) + // need to check for WhichID, GetItemSurrogatesForItem does buffer on type only + if( pNameOrIndex->Which() == nWhich && !pNameOrIndex->GetName().isEmpty() ) { - if( !bForceNew && pCompareValueFunc( pNameOrIndex, pCheckItem ) ) + if( !bForceNew && pCompareValueFunc( pNameOrIndex, this ) ) return pNameOrIndex->GetName(); if( pNameOrIndex->GetName().startsWith( aUser ) ) @@ -958,10 +965,10 @@ bool XLineDashItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* std::unique_ptr<XLineDashItem> XLineDashItem::checkForUniqueItem( SdrModel& rModel ) const { - const OUString aUniqueName = NameOrIndex::CheckNamedItem( - this, XATTR_LINEDASH, &rModel.GetItemPool(), - XLineDashItem::CompareValueFunc, RID_SVXSTR_DASH20, - rModel.GetPropertyList( XPropertyListType::Dash ) ); + const OUString aUniqueName(CheckNamedItem( + XATTR_LINEDASH, &rModel.GetItemPool(), + XLineDashItem::CompareValueFunc, RID_SVXSTR_DASH20, + rModel.GetPropertyList(XPropertyListType::Dash))); // if the given name is not valid, replace it! if( aUniqueName != GetName() ) @@ -2467,10 +2474,10 @@ bool XFillGradientItem::CompareValueFunc( const NameOrIndex* p1, const NameOrInd std::unique_ptr<XFillGradientItem> XFillGradientItem::checkForUniqueItem( SdrModel& rModel ) const { - const OUString aUniqueName = NameOrIndex::CheckNamedItem( - this, Which(), &rModel.GetItemPool(), - XFillGradientItem::CompareValueFunc, RID_SVXSTR_GRADIENT, - rModel.GetPropertyList( XPropertyListType::Gradient ) ); + const OUString aUniqueName(CheckNamedItem( + Which(), &rModel.GetItemPool(), + XFillGradientItem::CompareValueFunc, RID_SVXSTR_GRADIENT, + rModel.GetPropertyList(XPropertyListType::Gradient))); // if the given name is not valid, replace it! if( aUniqueName != GetName() ) @@ -2586,12 +2593,12 @@ std::unique_ptr<XFillFloatTransparenceItem> XFillFloatTransparenceItem::checkFor // #85953# unique name only necessary when enabled if(IsEnabled()) { - const OUString aUniqueName = NameOrIndex::CheckNamedItem( this, - XATTR_FILLFLOATTRANSPARENCE, - &rModel.GetItemPool(), - XFillFloatTransparenceItem::CompareValueFunc, - RID_SVXSTR_TRASNGR0, - XPropertyListRef() ); + const OUString aUniqueName(CheckNamedItem( + XATTR_FILLFLOATTRANSPARENCE, + &rModel.GetItemPool(), + XFillFloatTransparenceItem::CompareValueFunc, + RID_SVXSTR_TRASNGR0, + XPropertyListRef())); // if the given name is not valid, replace it! if( aUniqueName != GetName() ) @@ -2861,10 +2868,10 @@ bool XFillHatchItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* std::unique_ptr<XFillHatchItem> XFillHatchItem::checkForUniqueItem( SdrModel& rModel ) const { - const OUString aUniqueName = NameOrIndex::CheckNamedItem( - this, XATTR_FILLHATCH, &rModel.GetItemPool(), - XFillHatchItem::CompareValueFunc, RID_SVXSTR_HATCH10, - rModel.GetPropertyList( XPropertyListType::Hatch ) ); + const OUString aUniqueName(CheckNamedItem( + XATTR_FILLHATCH, &rModel.GetItemPool(), + XFillHatchItem::CompareValueFunc, RID_SVXSTR_HATCH10, + rModel.GetPropertyList(XPropertyListType::Hatch))); // if the given name is not valid, replace it! if( aUniqueName != GetName() ) diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx index fba490ba2594..60e7f6925f6f 100644 --- a/svx/source/xoutdev/xattrbmp.cxx +++ b/svx/source/xoutdev/xattrbmp.cxx @@ -312,10 +312,10 @@ std::unique_ptr<XFillBitmapItem> XFillBitmapItem::checkForUniqueItem( SdrModel& XPropertyListType aListType = XPropertyListType::Bitmap; if(isPattern()) aListType = XPropertyListType::Pattern; - const OUString aUniqueName = NameOrIndex::CheckNamedItem( - this, XATTR_FILLBITMAP, &rModel.GetItemPool(), - XFillBitmapItem::CompareValueFunc, RID_SVXSTR_BMP21, - rModel.GetPropertyList( aListType ) ); + const OUString aUniqueName(CheckNamedItem( + XATTR_FILLBITMAP, &rModel.GetItemPool(), + XFillBitmapItem::CompareValueFunc, RID_SVXSTR_BMP21, + rModel.GetPropertyList(aListType))); // if the given name is not valid, replace it! if( aUniqueName != GetName() )