editeng/source/uno/unofield.cxx | 4 editeng/source/uno/unoipset.cxx | 14 +-- editeng/source/uno/unotext.cxx | 34 +++---- include/editeng/unoipset.hxx | 14 +-- include/editeng/unotext.hxx | 16 +-- include/svl/itemprop.hxx | 38 +++++--- include/svx/unoshape.hxx | 64 +++++++------- linguistic/source/lngopt.cxx | 14 +-- reportdesign/source/ui/misc/UITools.cxx | 22 ++-- sc/inc/cellsuno.hxx | 27 +++--- sc/inc/styleuno.hxx | 5 - sc/source/ui/unoobj/afmtuno.cxx | 4 sc/source/ui/unoobj/cellsuno.cxx | 60 ++++++------- sc/source/ui/unoobj/condformatuno.cxx | 24 ++--- sc/source/ui/unoobj/defltuno.cxx | 10 +- sc/source/ui/unoobj/optuno.cxx | 4 sc/source/ui/unoobj/styleuno.cxx | 24 ++--- sc/source/ui/unoobj/textuno.cxx | 4 sc/source/ui/view/viewfunc.cxx | 8 - sd/inc/stlsheet.hxx | 3 sd/source/core/stlsheet.cxx | 12 +- sd/source/ui/inc/unokywds.hxx | 29 +++--- sd/source/ui/slideshow/slideshow.cxx | 4 sd/source/ui/unoidl/unolayer.cxx | 4 sd/source/ui/unoidl/unomodel.cxx | 4 sd/source/ui/unoidl/unoobj.cxx | 4 sd/source/ui/unoidl/unopage.cxx | 15 +-- sd/source/ui/unoidl/unopback.cxx | 32 +++---- sd/source/ui/unoidl/unopback.hxx | 4 sd/source/ui/unoidl/unosrch.cxx | 4 sfx2/source/doc/iframe.cxx | 4 svl/source/items/itemprop.cxx | 112 ++++++++++++++++-------- svx/source/inc/cell.hxx | 2 svx/source/table/cell.cxx | 12 +- svx/source/unodraw/shapeimpl.hxx | 16 +-- svx/source/unodraw/tableshape.cxx | 4 svx/source/unodraw/unoshap2.cxx | 10 +- svx/source/unodraw/unoshap3.cxx | 24 ++--- svx/source/unodraw/unoshap4.cxx | 20 ++-- svx/source/unodraw/unoshape.cxx | 48 +++++----- sw/inc/unocrsrhelper.hxx | 7 - sw/source/core/access/accpara.cxx | 18 ++-- sw/source/core/inc/unoport.hxx | 2 sw/source/core/unocore/SwXTextDefaults.cxx | 10 +- sw/source/core/unocore/unocrsrhelper.cxx | 18 ++-- sw/source/core/unocore/unodraw.cxx | 10 +- sw/source/core/unocore/unofield.cxx | 6 - sw/source/core/unocore/unoframe.cxx | 10 +- sw/source/core/unocore/unoidx.cxx | 8 - sw/source/core/unocore/unomap.cxx | 2 sw/source/core/unocore/unoobj.cxx | 22 ++-- sw/source/core/unocore/unoparagraph.cxx | 24 ++--- sw/source/core/unocore/unoport.cxx | 10 +- sw/source/core/unocore/unosect.cxx | 10 +- sw/source/core/unocore/unosett.cxx | 16 +-- sw/source/core/unocore/unosrch.cxx | 6 - sw/source/core/unocore/unostyle.cxx | 130 ++++++++++++++--------------- sw/source/core/unocore/unotbl.cxx | 16 +-- sw/source/core/unocore/unotext.cxx | 2 sw/source/uibase/uno/unoatxt.cxx | 4 sw/source/uibase/uno/unomailmerge.cxx | 8 - sw/source/uibase/uno/unotxdoc.cxx | 10 +- sw/source/uibase/uno/unotxvw.cxx | 4 vcl/source/uitest/uno/uiobject_uno.cxx | 1 vcl/source/uitest/uno/uitest_uno.cxx | 1 65 files changed, 582 insertions(+), 530 deletions(-)
New commits: commit 6c934d0feb6a391fda0939e8db5d12aafeb93cc6 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Mon Apr 12 09:21:42 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Apr 15 15:53:25 2021 +0200 store ptr to the original entries in SfxItemPropertyMap instead of copying them to a new data structure that is practically identical. Helps startup time since we build a ton of these when loading documents. And use o3tl::sorted_vector as a dense map data structure to reduce allocations and improve cache friendliness, since this is a build-once thing. Change-Id: I950be03b1a21c0c81c40f2677d4215f5e8e256cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114015 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index da56f0fcac7b..389856b4a5ef 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -705,7 +705,7 @@ void SAL_CALL SvxUnoTextField::setPropertyValue( const OUString& aPropertyName, return; } - const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMap().getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMap().getByName( aPropertyName ); if ( !pMap ) throw beans::UnknownPropertyException(aPropertyName); @@ -760,7 +760,7 @@ uno::Any SAL_CALL SvxUnoTextField::getPropertyValue( const OUString& PropertyNam uno::Any aValue; - const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMap().getByName( PropertyName ); + const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMap().getByName( PropertyName ); if ( !pMap ) throw beans::UnknownPropertyException(PropertyName); diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx index fc70a623d0ef..9b7e24e18c5f 100644 --- a/editeng/source/uno/unoipset.cxx +++ b/editeng/source/uno/unoipset.cxx @@ -52,7 +52,7 @@ SvxItemPropertySet::~SvxItemPropertySet() } -uno::Any* SvxItemPropertySet::GetUsrAnyForID(SfxItemPropertySimpleEntry const & entry) const +uno::Any* SvxItemPropertySet::GetUsrAnyForID(SfxItemPropertyMapEntry const & entry) const { for (auto const & pActual : aCombineList) { @@ -64,7 +64,7 @@ uno::Any* SvxItemPropertySet::GetUsrAnyForID(SfxItemPropertySimpleEntry const & void SvxItemPropertySet::AddUsrAnyForID( - const uno::Any& rAny, SfxItemPropertySimpleEntry const & entry) + const uno::Any& rAny, SfxItemPropertyMapEntry const & entry) { std::unique_ptr<SvxIDPropertyCombine> pNew(new SvxIDPropertyCombine); pNew->nWID = entry.nWID; @@ -90,7 +90,7 @@ static bool SvxUnoCheckForPositiveValue( const uno::Any& rVal ) } -uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry* pMap, const SfxItemSet& rSet, bool bSearchInParent, bool bDontConvertNegativeValues ) +uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertyMapEntry* pMap, const SfxItemSet& rSet, bool bSearchInParent, bool bDontConvertNegativeValues ) { uno::Any aVal; if(!pMap || !pMap->nWID) @@ -136,7 +136,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry* } -void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const uno::Any& rVal, SfxItemSet& rSet, bool bDontConvertNegativeValues ) +void SvxItemPropertySet::setPropertyValue( const SfxItemPropertyMapEntry* pMap, const uno::Any& rVal, SfxItemSet& rSet, bool bDontConvertNegativeValues ) { if(!pMap || !pMap->nWID) return; @@ -184,7 +184,7 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa } -uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry* pMap ) const +uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertyMapEntry* pMap ) const { // Already entered a value? Then finish quickly uno::Any* pUsrAny = GetUsrAnyForID(*pMap); @@ -236,7 +236,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry* } -void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const uno::Any& rVal ) const +void SvxItemPropertySet::setPropertyValue( const SfxItemPropertyMapEntry* pMap, const uno::Any& rVal ) const { uno::Any* pUsrAny = GetUsrAnyForID(*pMap); if(!pUsrAny) @@ -246,7 +246,7 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa } -const SfxItemPropertySimpleEntry* SvxItemPropertySet::getPropertyMapEntry(std::u16string_view rName) const +const SfxItemPropertyMapEntry* SvxItemPropertySet::getPropertyMapEntry(std::u16string_view rName) const { return m_aPropertyMap.getByName( rName ); } diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index af0a3db58ce0..d688e5701503 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -427,7 +427,7 @@ void SvxUnoTextRangeBase::_setPropertyValue( const OUString& PropertyName, const { CheckSelection( maSelection, pForwarder ); - const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName ); + const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName ); if ( pMap ) { ESelection aSel( GetSelection() ); @@ -477,7 +477,7 @@ void SvxUnoTextRangeBase::_setPropertyValue( const OUString& PropertyName, const throw beans::UnknownPropertyException(PropertyName); } -void SvxUnoTextRangeBase::setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const uno::Any& rValue, const ESelection& rSelection, const SfxItemSet& rOldSet, SfxItemSet& rNewSet ) +void SvxUnoTextRangeBase::setPropertyValue( const SfxItemPropertyMapEntry* pMap, const uno::Any& rValue, const ESelection& rSelection, const SfxItemSet& rOldSet, SfxItemSet& rNewSet ) { if(!SetPropertyValueHelper( pMap, rValue, rNewSet, &rSelection, GetEditSource() )) { @@ -488,7 +488,7 @@ void SvxUnoTextRangeBase::setPropertyValue( const SfxItemPropertySimpleEntry* pM } } -bool SvxUnoTextRangeBase::SetPropertyValueHelper( const SfxItemPropertySimpleEntry* pMap, const uno::Any& aValue, SfxItemSet& rNewSet, const ESelection* pSelection /* = NULL */, SvxEditSource* pEditSource /* = NULL*/ ) +bool SvxUnoTextRangeBase::SetPropertyValueHelper( const SfxItemPropertyMapEntry* pMap, const uno::Any& aValue, SfxItemSet& rNewSet, const ESelection* pSelection /* = NULL */, SvxEditSource* pEditSource /* = NULL*/ ) { switch( pMap->nWID ) { @@ -598,7 +598,7 @@ uno::Any SvxUnoTextRangeBase::_getPropertyValue(const OUString& PropertyName, sa SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr; if( pForwarder ) { - const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName ); + const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName ); if( pMap ) { std::unique_ptr<SfxItemSet> pAttribs; @@ -619,7 +619,7 @@ uno::Any SvxUnoTextRangeBase::_getPropertyValue(const OUString& PropertyName, sa throw beans::UnknownPropertyException(PropertyName); } -void SvxUnoTextRangeBase::getPropertyValue( const SfxItemPropertySimpleEntry* pMap, uno::Any& rAny, const SfxItemSet& rSet ) +void SvxUnoTextRangeBase::getPropertyValue( const SfxItemPropertyMapEntry* pMap, uno::Any& rAny, const SfxItemSet& rSet ) { switch( pMap->nWID ) { @@ -659,7 +659,7 @@ void SvxUnoTextRangeBase::getPropertyValue( const SfxItemPropertySimpleEntry* pM } } -bool SvxUnoTextRangeBase::GetPropertyValueHelper( SfxItemSet const & rSet, const SfxItemPropertySimpleEntry* pMap, uno::Any& aAny, const ESelection* pSelection /* = NULL */, SvxEditSource* pEditSource /* = NULL */ ) +bool SvxUnoTextRangeBase::GetPropertyValueHelper( SfxItemSet const & rSet, const SfxItemPropertyMapEntry* pMap, uno::Any& aAny, const ESelection* pSelection /* = NULL */, SvxEditSource* pEditSource /* = NULL */ ) { switch( pMap->nWID ) { @@ -778,7 +778,7 @@ void SvxUnoTextRangeBase::_setPropertyValues( const uno::Sequence< OUString >& a for( ; nCount; nCount--, pPropertyNames++, pValues++ ) { - const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry( *pPropertyNames ); + const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry( *pPropertyNames ); if( pMap ) { @@ -893,7 +893,7 @@ uno::Sequence< uno::Any > SvxUnoTextRangeBase::_getPropertyValues( const uno::Se for( ; nCount; nCount--, pPropertyNames++, pValues++ ) { - const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry( *pPropertyNames ); + const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry( *pPropertyNames ); if( pMap ) { getPropertyValue( pMap, *pValues, *pAttribs ); @@ -926,7 +926,7 @@ const sal_uInt16 aSvxUnoFontDescriptorWhichMap[] = { EE_CHAR_FONTINFO, EE_CHAR_F EE_CHAR_UNDERLINE, EE_CHAR_WEIGHT, EE_CHAR_STRIKEOUT, EE_CHAR_CASEMAP, EE_CHAR_WLM, 0 }; -beans::PropertyState SvxUnoTextRangeBase::_getPropertyState(const SfxItemPropertySimpleEntry* pMap, sal_Int32 nPara) +beans::PropertyState SvxUnoTextRangeBase::_getPropertyState(const SfxItemPropertyMapEntry* pMap, sal_Int32 nPara) { if ( pMap ) { @@ -1051,7 +1051,7 @@ uno::Sequence< beans::PropertyState > SvxUnoTextRangeBase::_getPropertyStates(co beans::PropertyState* pState = aRet.getArray(); for( const OUString& rName : PropertyName ) { - const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry( rName ); + const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry( rName ); if( !_getOnePropertyStates(pSet.get(), pMap, *pState++) ) { throw beans::UnknownPropertyException(rName); @@ -1062,7 +1062,7 @@ uno::Sequence< beans::PropertyState > SvxUnoTextRangeBase::_getPropertyStates(co return aRet; } -bool SvxUnoTextRangeBase::_getOnePropertyStates(const SfxItemSet* pSet, const SfxItemPropertySimpleEntry* pMap, beans::PropertyState& rState) +bool SvxUnoTextRangeBase::_getOnePropertyStates(const SfxItemSet* pSet, const SfxItemPropertyMapEntry* pMap, beans::PropertyState& rState) { bool bUnknownPropertyFound = false; if(pSet && pMap) @@ -1161,7 +1161,7 @@ void SvxUnoTextRangeBase::_setPropertyToDefault(const OUString& PropertyName, sa if( pForwarder ) { - const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry( PropertyName ); + const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry( PropertyName ); if ( pMap ) { CheckSelection( maSelection, mpEditSource->GetTextForwarder() ); @@ -1173,7 +1173,7 @@ void SvxUnoTextRangeBase::_setPropertyToDefault(const OUString& PropertyName, sa throw beans::UnknownPropertyException(PropertyName); } -void SvxUnoTextRangeBase::_setPropertyToDefault(SvxTextForwarder* pForwarder, const SfxItemPropertySimpleEntry* pMap, sal_Int32 nPara ) +void SvxUnoTextRangeBase::_setPropertyToDefault(SvxTextForwarder* pForwarder, const SfxItemPropertyMapEntry* pMap, sal_Int32 nPara ) { do { @@ -1221,7 +1221,7 @@ uno::Any SAL_CALL SvxUnoTextRangeBase::getPropertyDefault( const OUString& aProp SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr; if( pForwarder ) { - const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry( aPropertyName ); + const SfxItemPropertyMapEntry* pMap = mpPropSet->getPropertyMapEntry( aPropertyName ); if( pMap ) { SfxItemPool* pPool = pForwarder->GetPool(); @@ -1268,9 +1268,9 @@ void SAL_CALL SvxUnoTextRangeBase::setAllPropertiesToDefault() if( pForwarder ) { - for (auto & entry : mpPropSet->getPropertyMap().getPropertyEntries()) + for (const SfxItemPropertyMapEntry* entry : mpPropSet->getPropertyMap().getPropertyEntries()) { - _setPropertyToDefault( pForwarder, &entry.second, -1 ); + _setPropertyToDefault( pForwarder, entry, -1 ); } } } @@ -1970,7 +1970,7 @@ static void SvxPropertyValuesToItemSet( { for (const beans::PropertyValue& rProp : rPropertyValues) { - const SfxItemPropertySimpleEntry *pEntry = pPropSet->getPropertyMap().getByName( rProp.Name ); + const SfxItemPropertyMapEntry *pEntry = pPropSet->getPropertyMap().getByName( rProp.Name ); if (!pEntry) throw beans::UnknownPropertyException( "Unknown property: " + rProp.Name, static_cast < cppu::OWeakObject * > ( nullptr ) ); // Note: there is no need to take special care of the properties diff --git a/include/editeng/unoipset.hxx b/include/editeng/unoipset.hxx index 0a4d8c2fe3ad..e510462b4dc9 100644 --- a/include/editeng/unoipset.hxx +++ b/include/editeng/unoipset.hxx @@ -45,21 +45,21 @@ public: SvxItemPropertySet( SvxItemPropertySet const & ) = delete; // MSVC2015 workaround // Methods, which work directly with the ItemSet - static css::uno::Any getPropertyValue( const SfxItemPropertySimpleEntry* pMap, const SfxItemSet& rSet, bool bSearchInParent, bool bDontConvertNegativeValues ); - static void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const css::uno::Any& rVal, SfxItemSet& rSet, bool bDontConvertNegativeValues ); + static css::uno::Any getPropertyValue( const SfxItemPropertyMapEntry* pMap, const SfxItemSet& rSet, bool bSearchInParent, bool bDontConvertNegativeValues ); + 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 SfxItemPropertySimpleEntry* pMap ) const; - void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const css::uno::Any& rVal ) const; + css::uno::Any getPropertyValue( const SfxItemPropertyMapEntry* pMap ) const; + void setPropertyValue( const SfxItemPropertyMapEntry* pMap, const css::uno::Any& rVal ) const; bool AreThereOwnUsrAnys() const { return ! aCombineList.empty(); } - css::uno::Any* GetUsrAnyForID(SfxItemPropertySimpleEntry const & entry) const; - void AddUsrAnyForID(const css::uno::Any& rAny, SfxItemPropertySimpleEntry const & entry); + 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 SfxItemPropertySimpleEntry* getPropertyMapEntry(std::u16string_view rName) const; + const SfxItemPropertyMapEntry* getPropertyMapEntry(std::u16string_view rName) const; }; /** converts the given any with a metric to 100th/mm if needed */ diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx index a07a8cf059e1..069e7e06789d 100644 --- a/include/editeng/unotext.hxx +++ b/include/editeng/unotext.hxx @@ -271,30 +271,30 @@ protected: /// @throws css::beans::UnknownPropertyException /// @throws css::uno::RuntimeException - css::beans::PropertyState _getPropertyState( const SfxItemPropertySimpleEntry* pMap, sal_Int32 nPara = -1 ); + css::beans::PropertyState _getPropertyState( const SfxItemPropertyMapEntry* pMap, sal_Int32 nPara = -1 ); /// @throws css::beans::UnknownPropertyException /// @throws css::uno::RuntimeException - css::beans::PropertyState _getPropertyState( std::u16string_view PropertyName, sal_Int32 nPara = -1 ); + css::beans::PropertyState _getPropertyState( std::u16string_view PropertyName, sal_Int32 nPara = -1 ); /// @throws css::beans::UnknownPropertyException /// @throws css::uno::RuntimeException css::uno::Sequence< css::beans::PropertyState > _getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName, sal_Int32 nPara = -1 ); // returns true if property found or false if unknown property - static bool _getOnePropertyStates(const SfxItemSet* pSet, const SfxItemPropertySimpleEntry* pMap, css::beans::PropertyState& rState); + static bool _getOnePropertyStates(const SfxItemSet* pSet, const SfxItemPropertyMapEntry* pMap, css::beans::PropertyState& rState); /// @throws css::beans::UnknownPropertyException /// @throws css::uno::RuntimeException void _setPropertyToDefault( const OUString& PropertyName, sal_Int32 nPara = -1 ); /// @throws css::beans::UnknownPropertyException /// @throws css::uno::RuntimeException - void _setPropertyToDefault( SvxTextForwarder* pForwarder, const SfxItemPropertySimpleEntry* pMap, sal_Int32 nPara ); + void _setPropertyToDefault( SvxTextForwarder* pForwarder, const SfxItemPropertyMapEntry* pMap, sal_Int32 nPara ); void SetEditSource( SvxEditSource* _pEditSource ) throw(); /// @throws css::beans::UnknownPropertyException /// @throws css::uno::RuntimeException - void getPropertyValue( const SfxItemPropertySimpleEntry* pMap, css::uno::Any& rAny, const SfxItemSet& rSet ); + void getPropertyValue( const SfxItemPropertyMapEntry* pMap, css::uno::Any& rAny, const SfxItemSet& rSet ); /// @throws css::beans::UnknownPropertyException /// @throws css::lang::IllegalArgumentException - void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const css::uno::Any& rValue, const ESelection& rSelection, const SfxItemSet& rOldSet, SfxItemSet& rNewSet ); + void setPropertyValue( const SfxItemPropertyMapEntry* pMap, const css::uno::Any& rValue, const ESelection& rSelection, const SfxItemSet& rOldSet, SfxItemSet& rNewSet ); SvxUnoTextRangeBase(const SvxItemPropertySet* _pSet); SvxUnoTextRangeBase(const SvxEditSource* pSource, const SvxItemPropertySet* _pSet); @@ -323,9 +323,9 @@ public: const SvxItemPropertySet* getPropertySet() const throw() { return mpPropSet; } SvxEditSource* GetEditSource() const throw() { return mpEditSource.get(); } - static bool SetPropertyValueHelper( const SfxItemPropertySimpleEntry* pMap, const css::uno::Any& aValue, SfxItemSet& rNewSet, const ESelection* pSelection = nullptr, SvxEditSource* pEditSource = nullptr ); + static bool SetPropertyValueHelper( const SfxItemPropertyMapEntry* pMap, const css::uno::Any& aValue, SfxItemSet& rNewSet, const ESelection* pSelection = nullptr, SvxEditSource* pEditSource = nullptr ); /// @throws css::uno::RuntimeException - static bool GetPropertyValueHelper( SfxItemSet const & rSet, const SfxItemPropertySimpleEntry* pMap, css::uno::Any& aAny, const ESelection* pSelection = nullptr, SvxEditSource* pEditSource = nullptr ); + static bool GetPropertyValueHelper( SfxItemSet const & rSet, const SfxItemPropertyMapEntry* pMap, css::uno::Any& aAny, const ESelection* pSelection = nullptr, SvxEditSource* pEditSource = nullptr ); void attachField( std::unique_ptr<SvxFieldData> pData ) throw(); diff --git a/include/svl/itemprop.hxx b/include/svl/itemprop.hxx index 6403dbbc1fa6..4ea43eab7e64 100644 --- a/include/svl/itemprop.hxx +++ b/include/svl/itemprop.hxx @@ -27,6 +27,7 @@ #include <svl/svldllapi.h> #include <vector> #include <unordered_map> +#include <o3tl/sorted_vector.hxx> #include <string_view> // values from com/sun/star/beans/PropertyAttribute @@ -35,7 +36,7 @@ /// map a property between beans::XPropertySet and SfxPoolItem struct SfxItemPropertyMapEntry { - std::u16string_view aName; ///< name of property + OUString aName; ///< name of property css::uno::Type aType; ///< UNO type of property sal_uInt16 nWID; ///< WhichId of SfxPoolItem /// flag bitmap, @see css::beans::PropertyAttribute @@ -45,7 +46,7 @@ struct SfxItemPropertyMapEntry sal_uInt8 nMemberId; PropertyMoreFlags nMoreFlags; - SfxItemPropertyMapEntry(std::u16string_view _aName, sal_uInt16 _nWID, css::uno::Type const & _rType, + SfxItemPropertyMapEntry(const OUString & _aName, sal_uInt16 _nWID, css::uno::Type const & _rType, sal_Int16 _nFlags, sal_uInt8 const _nMemberId, PropertyMoreFlags _nMoreFlags = PropertyMoreFlags::NONE) : aName( _aName ) , aType( _rType ) @@ -104,35 +105,41 @@ struct SfxItemPropertySimpleEntry } }; + struct SfxItemPropertyNamedEntry : public SfxItemPropertySimpleEntry { OUString sName; SfxItemPropertyNamedEntry( const OUString& rName, const SfxItemPropertySimpleEntry& rSimpleEntry) : SfxItemPropertySimpleEntry( rSimpleEntry ) , sName( rName ) -{ -} + { + } +}; + +struct SfxItemPropertyMapCompare +{ + bool operator() ( const SfxItemPropertyMapEntry * lhs, const SfxItemPropertyMapEntry * rhs ) const + { + return lhs->aName < rhs->aName; + } }; class SVL_DLLPUBLIC SfxItemPropertyMap { - std::unordered_map< std::u16string_view, - SfxItemPropertySimpleEntry > m_aMap; + o3tl::sorted_vector< const SfxItemPropertyMapEntry*, SfxItemPropertyMapCompare > m_aMap; mutable css::uno::Sequence< css::beans::Property > m_aPropSeq; public: SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries ); SfxItemPropertyMap( const SfxItemPropertyMap& rSource ); ~SfxItemPropertyMap(); - const SfxItemPropertySimpleEntry* getByName( std::u16string_view rName ) const; + const SfxItemPropertyMapEntry* getByName( std::u16string_view rName ) const; css::uno::Sequence< css::beans::Property > const & getProperties() const; /// @throws css::beans::UnknownPropertyException css::beans::Property getPropertyByName( const OUString & rName ) const; bool hasPropertyByName( std::u16string_view rName ) const; - void mergeProperties( const css::uno::Sequence< css::beans::Property >& rPropSeq ); - const std::unordered_map< std::u16string_view, - SfxItemPropertySimpleEntry >& getPropertyEntries() const { return m_aMap; } + const o3tl::sorted_vector< const SfxItemPropertyMapEntry*, SfxItemPropertyMapCompare >& getPropertyEntries() const { return m_aMap; } sal_uInt32 getSize() const; }; @@ -148,7 +155,7 @@ public: ~SfxItemPropertySet(); /// @throws css::uno::RuntimeException - void getPropertyValue( const SfxItemPropertySimpleEntry& rEntry, + void getPropertyValue( const SfxItemPropertyMapEntry& rEntry, const SfxItemSet& rSet, css::uno::Any& rAny) const; /// @throws css::uno::RuntimeException @@ -163,7 +170,7 @@ public: const SfxItemSet& rSet ) const; /// @throws css::uno::RuntimeException /// @throws css::lang::IllegalArgumentException - void setPropertyValue( const SfxItemPropertySimpleEntry& rEntry, + void setPropertyValue( const SfxItemPropertyMapEntry& rEntry, const css::uno::Any& aVal, SfxItemSet& rSet ) const; /// @throws css::uno::RuntimeException @@ -177,7 +184,7 @@ public: css::beans::PropertyState getPropertyState(const OUString& rName, const SfxItemSet& rSet)const; css::beans::PropertyState - getPropertyState(const SfxItemPropertySimpleEntry& rEntry, const SfxItemSet& rSet) const + getPropertyState(const SfxItemPropertyMapEntry& rEntry, const SfxItemSet& rSet) const throw(); css::uno::Reference<css::beans::XPropertySetInfo> const & @@ -213,7 +220,6 @@ class SAL_DLLPUBLIC_TEMPLATE SfxExtItemPropertySetInfo_Base : public cppu::WeakI class SVL_DLLPUBLIC SfxExtItemPropertySetInfo final : public SfxExtItemPropertySetInfo_Base { - SfxItemPropertyMap aExtMap; public: SfxExtItemPropertySetInfo( const SfxItemPropertyMapEntry *pMap, @@ -228,6 +234,10 @@ public: virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) override; + +private: + std::unordered_map<OUString, SfxItemPropertySimpleEntry> maMap; + mutable css::uno::Sequence< css::beans::Property > m_aPropSeq; }; #endif diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx index 1cd151d316ec..44ffc43e4f3b 100644 --- a/include/svx/unoshape.hxx +++ b/include/svx/unoshape.hxx @@ -81,10 +81,10 @@ class SvxShapeMaster; class SvxItemPropertySet; class SfxItemSet; -void SVXCORE_DLLPUBLIC SvxItemPropertySet_setPropertyValue( const SfxItemPropertySimpleEntry* pMap, +void SVXCORE_DLLPUBLIC SvxItemPropertySet_setPropertyValue( const SfxItemPropertyMapEntry* pMap, const css::uno::Any& rVal, SfxItemSet& rSet ); -css::uno::Any SVXCORE_DLLPUBLIC SvxItemPropertySet_getPropertyValue( const SfxItemPropertySimpleEntry* pMap, const SfxItemSet& rSet ); +css::uno::Any SVXCORE_DLLPUBLIC SvxItemPropertySet_getPropertyValue( const SfxItemPropertyMapEntry* pMap, const SfxItemSet& rSet ); // WARNING: if you update the supported interfaces, @@ -147,7 +147,7 @@ protected: void ForceMetricToItemPoolMetric(basegfx::B2DHomMatrix& rB2DHomMatrix) const throw(); void ForceMetricTo100th_mm(basegfx::B2DHomMatrix& rB2DHomMatrix) const throw(); - css::uno::Any GetAnyForItem( SfxItemSet const & aSet, const SfxItemPropertySimpleEntry* pMap ) const; + css::uno::Any GetAnyForItem( SfxItemSet const & aSet, const SfxItemPropertyMapEntry* pMap ) const; bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName ); @@ -171,17 +171,17 @@ protected: /// @throws css::lang::IllegalArgumentException /// @throws css::lang::WrappedTargetException /// @throws css::uno::RuntimeException - virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ); + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ); /// @throws css::beans::UnknownPropertyException /// @throws css::lang::WrappedTargetException /// @throws css::uno::RuntimeException - virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ); + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ); /// @throws css::beans::UnknownPropertyException /// @throws css::uno::RuntimeException - virtual bool getPropertyStateImpl( const SfxItemPropertySimpleEntry* pProperty, css::beans::PropertyState& rState ); + virtual bool getPropertyStateImpl( const SfxItemPropertyMapEntry* pProperty, css::beans::PropertyState& rState ); /// @throws css::beans::UnknownPropertyException /// @throws css::uno::RuntimeException - virtual bool setPropertyToDefaultImpl( const SfxItemPropertySimpleEntry* pProperty ); + virtual bool setPropertyToDefaultImpl( const SfxItemPropertyMapEntry* pProperty ); public: /// @throws css::uno::RuntimeException @@ -359,10 +359,10 @@ protected: protected: // override these for special property handling in subcasses. Return true if property is handled - virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; - virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; - virtual bool getPropertyStateImpl( const SfxItemPropertySimpleEntry* pProperty, css::beans::PropertyState& rState ) override; - virtual bool setPropertyToDefaultImpl( const SfxItemPropertySimpleEntry* pProperty ) override; + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override; + virtual bool getPropertyStateImpl( const SfxItemPropertyMapEntry* pProperty, css::beans::PropertyState& rState ) override; + virtual bool setPropertyToDefaultImpl( const SfxItemPropertyMapEntry* pProperty ) override; public: SvxShapeText(SdrObject* pObj); @@ -591,8 +591,8 @@ class SVXCORE_DLLPUBLIC SvxOle2Shape : public SvxShapeText { protected: // override these for special property handling in subcasses. Return true if property is handled - virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; - virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override; void resetModifiedState(); @@ -617,8 +617,8 @@ class SvxShapePolyPolygon final : public SvxShapeText using SvxUnoTextRangeBase::getPropertyValue; // override these for special property handling in subcasses. Return true if property is handled - virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; - virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override; // local helper to detect PolygonKind from SdrObject::GetObjIdentifier() css::drawing::PolygonKind GetPolygonKind() const; @@ -645,8 +645,8 @@ class SvxGraphicObject final : public SvxShapeText using SvxUnoTextRangeBase::getPropertyValue; // override these for special property handling in subcasses. Return true if property is handled - virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; - virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override; public: SvxGraphicObject(SdrObject* pObj); @@ -668,8 +668,8 @@ protected: public: Svx3DSceneObject(SdrObject* pObj, SvxDrawPage* pDrawPage); // override these for special property handling in subcasses. Return true if property is handled - virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; - virtual bool getPropertyValueImpl(const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl(const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override; virtual ~Svx3DSceneObject() throw() override; @@ -709,8 +709,8 @@ public: class Svx3DCubeObject final : public SvxShape { // override these for special property handling in subcasses. Return true if property is handled - virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; - virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override; public: Svx3DCubeObject(SdrObject* pObj); @@ -729,8 +729,8 @@ public: Svx3DSphereObject(SdrObject* pObj); private: // override these for special property handling in subcasses. Return true if property is handled - virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; - virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override; virtual ~Svx3DSphereObject() throw() override; @@ -744,8 +744,8 @@ private: class Svx3DLatheObject final : public SvxShape { // override these for special property handling in subcasses. Return true if property is handled - virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; - virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override; public: Svx3DLatheObject(SdrObject* pObj); @@ -764,8 +764,8 @@ public: Svx3DExtrudeObject(SdrObject* pObj); private: // override these for special property handling in subcasses. Return true if property is handled - virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; - virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override; virtual ~Svx3DExtrudeObject() throw() override; @@ -779,8 +779,8 @@ private: class Svx3DPolygonObject final : public SvxShape { // override these for special property handling in subcasses. Return true if property is handled - virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; - virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override; public: Svx3DPolygonObject(SdrObject* pObj); @@ -802,7 +802,7 @@ protected: public: SvxCustomShape(SdrObject* pObj); // override these for special property handling in subcasses. Return true if property is handled - virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override; virtual ~SvxCustomShape() throw () override; @@ -840,8 +840,8 @@ public: private: // override these for special property handling in subcasses. Return true if property is handled - virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; - virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override; OUString referer_; }; diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index f7d7e4c0bf29..ac9f0678ffaf 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -220,7 +220,7 @@ void SAL_CALL LinguProps::setPropertyValue( { MutexGuard aGuard( GetLinguMutex() ); - const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName ); + const SfxItemPropertyMapEntry* pCur = aPropertyMap.getByName( rPropertyName ); if (pCur) { Any aOld( aConfig.GetProperty( pCur->nWID ) ); @@ -239,7 +239,7 @@ Any SAL_CALL LinguProps::getPropertyValue( const OUString& rPropertyName ) Any aRet; - const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName ); + const SfxItemPropertyMapEntry* pCur = aPropertyMap.getByName( rPropertyName ); if(pCur) { aRet = aConfig.GetProperty( pCur->nWID ); @@ -256,7 +256,7 @@ void SAL_CALL LinguProps::addPropertyChangeListener( if (!bDisposing && rxListener.is()) { - const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName ); + const SfxItemPropertyMapEntry* pCur = aPropertyMap.getByName( rPropertyName ); if(pCur) aPropListeners.addInterface( pCur->nWID, rxListener ); } @@ -270,7 +270,7 @@ void SAL_CALL LinguProps::removePropertyChangeListener( if (!bDisposing && rxListener.is()) { - const SfxItemPropertySimpleEntry* pCur = aPropertyMap.getByName( rPropertyName ); + const SfxItemPropertyMapEntry* pCur = aPropertyMap.getByName( rPropertyName ); if(pCur) aPropListeners.removeInterface( pCur->nWID, rxListener ); } @@ -319,9 +319,9 @@ Sequence< PropertyValue > SAL_CALL std::vector<PropertyValue> aProps; aProps.reserve(aPropertyMap.getPropertyEntries().size()); - for(auto & rPair : aPropertyMap.getPropertyEntries()) - aProps.push_back(PropertyValue(OUString(rPair.first), rPair.second.nWID, - aConfig.GetProperty(rPair.second.nWID), + for(auto pEntry : aPropertyMap.getPropertyEntries()) + aProps.push_back(PropertyValue(pEntry->aName, pEntry->nWID, + aConfig.GetProperty(pEntry->nWID), css::beans::PropertyState_DIRECT_VALUE)); return comphelper::containerToSequence(aProps); } diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 14262558618c..1981b229e567 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -276,15 +276,15 @@ namespace uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo(); SvxUnoPropertyMapProvider aMap; const SfxItemPropertyMap& rPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap(); - for (const auto& rProp : rPropertyMap.getPropertyEntries()) + for (const auto pProp : rPropertyMap.getPropertyEntries()) { - if ( xInfo->hasPropertyByName(OUString(rProp.first)) ) + if ( xInfo->hasPropertyByName(pProp->aName) ) { - const SfxPoolItem* pItem = _rItemSet.GetItem(rProp.second.nWID); + const SfxPoolItem* pItem = _rItemSet.GetItem(pProp->nWID); if ( pItem ) { - ::std::unique_ptr<SfxPoolItem> pClone(pItem->CloneSetWhich(rProp.second.nWID)); - pClone->PutValue(_xShape->getPropertyValue(OUString(rProp.first)), rProp.second.nMemberId); + ::std::unique_ptr<SfxPoolItem> pClone(pItem->CloneSetWhich(pProp->nWID)); + pClone->PutValue(_xShape->getPropertyValue(pProp->aName), pProp->nMemberId); _rItemSet.Put(std::move(pClone)); } } @@ -296,20 +296,20 @@ namespace const uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo(); SvxUnoPropertyMapProvider aMap; const SfxItemPropertyMap& rPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap(); - for (const auto& rProp : rPropertyMap.getPropertyEntries()) + for (const auto pProp : rPropertyMap.getPropertyEntries()) { - if ( SfxItemState::SET == _rItemSet.GetItemState(rProp.second.nWID) && xInfo->hasPropertyByName(OUString(rProp.first)) ) + if ( SfxItemState::SET == _rItemSet.GetItemState(pProp->nWID) && xInfo->hasPropertyByName(pProp->aName) ) { - if ( ( rProp.second.nFlags & beans::PropertyAttribute::READONLY ) != beans::PropertyAttribute::READONLY ) + if ( ( pProp->nFlags & beans::PropertyAttribute::READONLY ) != beans::PropertyAttribute::READONLY ) { - const SfxPoolItem* pItem = _rItemSet.GetItem(rProp.second.nWID); + const SfxPoolItem* pItem = _rItemSet.GetItem(pProp->nWID); if ( pItem ) { uno::Any aValue; - pItem->QueryValue(aValue,rProp.second.nMemberId); + pItem->QueryValue(aValue, pProp->nMemberId); try { - _xShape->setPropertyValue(OUString(rProp.first), aValue); + _xShape->setPropertyValue(pProp->aName, aValue); } catch(uno::Exception&) { // shapes have a bug so we ignore this one. diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx index 29e33e37974e..ca0dc2fcc2df 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -114,6 +114,7 @@ class SfxItemPropertyMap; class SfxItemPropertySet; class SfxItemSet; struct SfxItemPropertySimpleEntry; +struct SfxItemPropertyMapEntry; namespace editeng { class SvxBorderLine; } @@ -220,13 +221,13 @@ protected: // GetItemPropertyMap for derived classes must contain all entries, including base class virtual const SfxItemPropertyMap& GetItemPropertyMap(); css::beans::PropertyState GetOnePropertyState( - sal_uInt16 nItemWhich, const SfxItemPropertySimpleEntry* pEntry ); + sal_uInt16 nItemWhich, const SfxItemPropertyMapEntry* pEntry ); /// @throws css::uno::RuntimeException - virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, + virtual void GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, css::uno::Any& ); /// @throws css::lang::IllegalArgumentException /// @throws css::uno::RuntimeException - virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, + virtual void SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, const css::uno::Any& aValue ); public: @@ -477,9 +478,9 @@ private: protected: const ScRange& GetRange() const { return aRange; } virtual const SfxItemPropertyMap& GetItemPropertyMap() override; - virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, + virtual void GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, css::uno::Any& ) override; - virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, + virtual void SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, const css::uno::Any& aValue ) override; /// @throws css::lang::IndexOutOfBoundsException @@ -650,9 +651,9 @@ private: sal_Int32 GetResultType_Impl() const; virtual const SfxItemPropertyMap& GetItemPropertyMap() override; - virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, + virtual void GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, css::uno::Any& ) override; - virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, + virtual void SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, const css::uno::Any& aValue ) override; public: @@ -789,9 +790,9 @@ private: protected: virtual const SfxItemPropertyMap& GetItemPropertyMap() override; - virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, + virtual void GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, css::uno::Any& ) override; - virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, + virtual void SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, const css::uno::Any& aValue ) override; public: @@ -966,9 +967,9 @@ private: const SfxItemPropertySet* pColPropSet; virtual const SfxItemPropertyMap& GetItemPropertyMap() override; - virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, + virtual void GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, css::uno::Any& ) override; - virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, + virtual void SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, const css::uno::Any& aValue ) override; public: @@ -1004,9 +1005,9 @@ private: const SfxItemPropertySet* pRowPropSet; virtual const SfxItemPropertyMap& GetItemPropertyMap() override; - virtual void GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, + virtual void GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, css::uno::Any& ) override; - virtual void SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, + virtual void SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, const css::uno::Any& aValue ) override; public: diff --git a/sc/inc/styleuno.hxx b/sc/inc/styleuno.hxx index 7fb72dd4abea..53dcdcb05e38 100644 --- a/sc/inc/styleuno.hxx +++ b/sc/inc/styleuno.hxx @@ -44,6 +44,7 @@ class SfxItemSet; class ScStyleFamilyObj; class ScStyleObj; struct SfxItemPropertySimpleEntry; +struct SfxItemPropertyMapEntry; class ScStyleFamiliesObj final : public ::cppu::WeakImplHelper< css::container::XIndexAccess, @@ -173,7 +174,7 @@ private: SfxStyleSheetBase* pStyle_cached; SfxStyleSheetBase* GetStyle_Impl( bool bUseCachedValue = false ); - const SfxItemSet* GetStyleItemSet_Impl( std::u16string_view rPropName, const SfxItemPropertySimpleEntry*& rpEntry ); + const SfxItemSet* GetStyleItemSet_Impl( std::u16string_view rPropName, const SfxItemPropertyMapEntry*& rpEntry ); /// @throws css::beans::UnknownPropertyException /// @throws css::uno::RuntimeException css::beans::PropertyState getPropertyState_Impl( std::u16string_view PropertyName ); @@ -188,7 +189,7 @@ private: /// @throws css::lang::IllegalArgumentException /// @throws css::uno::RuntimeException void setPropertyValue_Impl( std::u16string_view rPropertyName, - const SfxItemPropertySimpleEntry* pEntry, + const SfxItemPropertyMapEntry* pEntry, const css::uno::Any* pValue ); public: diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx index b343fd1afe36..b67d9a6edd15 100644 --- a/sc/source/ui/unoobj/afmtuno.cxx +++ b/sc/source/ui/unoobj/afmtuno.cxx @@ -566,7 +566,7 @@ void SAL_CALL ScAutoFormatFieldObj::setPropertyValue( { SolarMutexGuard aGuard; ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat(); - const SfxItemPropertySimpleEntry* pEntry = + const SfxItemPropertyMapEntry* pEntry = aPropSet.getPropertyMap().getByName( aPropertyName ); if ( !(pEntry && pEntry->nWID && nFormatIndex < pFormats->size()) ) @@ -668,7 +668,7 @@ uno::Any SAL_CALL ScAutoFormatFieldObj::getPropertyValue( const OUString& aPrope uno::Any aVal; ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat(); - const SfxItemPropertySimpleEntry* pEntry = + const SfxItemPropertyMapEntry* pEntry = aPropSet.getPropertyMap().getByName( aPropertyName ); if ( pEntry && pEntry->nWID && nFormatIndex < pFormats->size() ) diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 8365bd4013f1..bd234108221b 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -1772,7 +1772,7 @@ const SfxItemPropertyMap& ScCellRangesBase::GetItemPropertyMap() return pPropSet->getPropertyMap(); } -static void lcl_GetPropertyWhich( const SfxItemPropertySimpleEntry* pEntry, +static void lcl_GetPropertyWhich( const SfxItemPropertyMapEntry* pEntry, sal_uInt16& rItemWhich ) { // Which-ID of the affected items also when the item can't handle @@ -1803,7 +1803,7 @@ static void lcl_GetPropertyWhich( const SfxItemPropertySimpleEntry* pEntry, } -beans::PropertyState ScCellRangesBase::GetOnePropertyState( sal_uInt16 nItemWhich, const SfxItemPropertySimpleEntry* pEntry ) +beans::PropertyState ScCellRangesBase::GetOnePropertyState( sal_uInt16 nItemWhich, const SfxItemPropertyMapEntry* pEntry ) { beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE; if ( nItemWhich ) // item wid (from map or special case) @@ -1859,7 +1859,7 @@ beans::PropertyState SAL_CALL ScCellRangesBase::getPropertyState( const OUString const SfxItemPropertyMap& rMap = GetItemPropertyMap(); // from derived class sal_uInt16 nItemWhich = 0; - const SfxItemPropertySimpleEntry* pEntry = rMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rMap.getByName( aPropertyName ); lcl_GetPropertyWhich( pEntry, nItemWhich ); return GetOnePropertyState( nItemWhich, pEntry ); } @@ -1875,7 +1875,7 @@ uno::Sequence<beans::PropertyState> SAL_CALL ScCellRangesBase::getPropertyStates std::transform(aPropertyNames.begin(), aPropertyNames.end(), aRet.begin(), [this, &rPropertyMap](const auto& rName) -> beans::PropertyState { sal_uInt16 nItemWhich = 0; - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( rName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( rName ); lcl_GetPropertyWhich( pEntry, nItemWhich ); return GetOnePropertyState(nItemWhich, pEntry); }); @@ -1890,7 +1890,7 @@ void SAL_CALL ScCellRangesBase::setPropertyToDefault( const OUString& aPropertyN const SfxItemPropertyMap& rPropertyMap = GetItemPropertyMap(); // from derived class sal_uInt16 nItemWhich = 0; - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); lcl_GetPropertyWhich( pEntry, nItemWhich ); if ( nItemWhich ) // item wid (from map or special case) { @@ -1937,7 +1937,7 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyDefault( const OUString& aPropert { ScDocument& rDoc = pDocShell->GetDocument(); const SfxItemPropertyMap& rPropertyMap = GetItemPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( pEntry ) { if ( IsScItemWid( pEntry->nWID ) ) @@ -2040,7 +2040,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCellRangesBase::getPropertySe return aRef; } -static void lcl_SetCellProperty( const SfxItemPropertySimpleEntry& rEntry, const uno::Any& rValue, +static void lcl_SetCellProperty( const SfxItemPropertyMapEntry& rEntry, const uno::Any& rValue, ScPatternAttr& rPattern, const ScDocument &rDoc, sal_uInt16& rFirstItemId, sal_uInt16& rSecondItemId ) { @@ -2158,14 +2158,14 @@ void SAL_CALL ScCellRangesBase::setPropertyValue( throw uno::RuntimeException(); const SfxItemPropertyMap& rPropertyMap = GetItemPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); SetOnePropertyValue( pEntry, aValue ); } -void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, const uno::Any& aValue ) +void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, const uno::Any& aValue ) { if ( !pEntry ) return; @@ -2370,7 +2370,7 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyValue( const OUString& aPropertyN throw uno::RuntimeException(); const SfxItemPropertyMap& rPropertyMap = GetItemPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -2379,7 +2379,7 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyValue( const OUString& aPropertyN return aAny; } -void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, uno::Any& rAny ) +void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, uno::Any& rAny ) { if ( !pEntry ) return; @@ -2578,7 +2578,7 @@ void SAL_CALL ScCellRangesBase::setPropertyValues( const uno::Sequence< OUString const OUString* pNames = aPropertyNames.getConstArray(); const uno::Any* pValues = aValues.getConstArray(); - std::unique_ptr<const SfxItemPropertySimpleEntry*[]> pEntryArray(new const SfxItemPropertySimpleEntry*[nCount]); + std::unique_ptr<const SfxItemPropertyMapEntry*[]> pEntryArray(new const SfxItemPropertyMapEntry*[nCount]); sal_Int32 i; for(i = 0; i < nCount; i++) @@ -2586,7 +2586,7 @@ void SAL_CALL ScCellRangesBase::setPropertyValues( const uno::Sequence< OUString // first loop: find all properties in map, but handle only CellStyle // (CellStyle must be set before any other cell properties) - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( pNames[i] ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( pNames[i] ); pEntryArray[i] = pEntry; if (pEntry) { @@ -2612,7 +2612,7 @@ void SAL_CALL ScCellRangesBase::setPropertyValues( const uno::Sequence< OUString { // second loop: handle other properties - const SfxItemPropertySimpleEntry* pEntry = pEntryArray[i]; + const SfxItemPropertyMapEntry* pEntry = pEntryArray[i]; if ( pEntry ) { if ( IsScItemWid( pEntry->nWID ) ) // can be handled by SfxItemPropertySet @@ -2658,7 +2658,7 @@ uno::Sequence<uno::Any> SAL_CALL ScCellRangesBase::getPropertyValues( uno::Any* pProperties = aRet.getArray(); for(sal_Int32 i = 0; i < aPropertyNames.getLength(); i++) { - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyNames[i] ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyNames[i] ); GetOnePropertyValue( pEntry, pProperties[i] ); } return aRet; @@ -2713,7 +2713,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL ScCellRangesBase::set const OUString* pNames = aPropertyNames.getConstArray(); const uno::Any* pValues = aValues.getConstArray(); - std::unique_ptr<const SfxItemPropertySimpleEntry*[]> pMapArray(new const SfxItemPropertySimpleEntry*[nCount]); + std::unique_ptr<const SfxItemPropertyMapEntry*[]> pMapArray(new const SfxItemPropertyMapEntry*[nCount]); sal_Int32 i; for(i = 0; i < nCount; i++) @@ -2721,7 +2721,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL ScCellRangesBase::set // first loop: find all properties in map, but handle only CellStyle // (CellStyle must be set before any other cell properties) - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( pNames[i] ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( pNames[i] ); pMapArray[i] = pEntry; if (pEntry) { @@ -2748,7 +2748,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL ScCellRangesBase::set { // second loop: handle other properties - const SfxItemPropertySimpleEntry* pEntry = pMapArray[i]; + const SfxItemPropertyMapEntry* pEntry = pMapArray[i]; if ( pEntry && ((pEntry->nFlags & beans::PropertyAttribute::READONLY) == 0)) { if ( IsScItemWid( pEntry->nWID ) ) // can be handled by SfxItemPropertySet @@ -2824,7 +2824,7 @@ uno::Sequence< beans::GetPropertyTolerantResult > SAL_CALL ScCellRangesBase::get for(sal_Int32 i = 0; i < nCount; i++) { - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyNames[i] ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyNames[i] ); if (!pEntry) { pReturns[i].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; @@ -2854,7 +2854,7 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL ScCellRangesBas sal_Int32 j = 0; for(sal_Int32 i = 0; i < nCount; i++) { - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyNames[i] ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyNames[i] ); if (!pEntry) { pReturns[i].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; @@ -5709,7 +5709,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCellRangeObj::getPropertySetI return aRef; } -void ScCellRangeObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, const uno::Any& aValue ) +void ScCellRangeObj::SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, const uno::Any& aValue ) { // Range has only Position and Size in addition to ScCellRangesBase, both are ReadOnly // -> nothing to do here @@ -5717,7 +5717,7 @@ void ScCellRangeObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEnt ScCellRangesBase::SetOnePropertyValue( pEntry, aValue ); } -void ScCellRangeObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, uno::Any& rAny ) +void ScCellRangeObj::GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, uno::Any& rAny ) { if ( !pEntry ) return; @@ -6407,7 +6407,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCellObj::getPropertySetInfo() return aRef; } -void ScCellObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, const uno::Any& aValue ) +void ScCellObj::SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, const uno::Any& aValue ) { if ( !pEntry ) return; @@ -6428,7 +6428,7 @@ void ScCellObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, c ScCellRangeObj::SetOnePropertyValue( pEntry, aValue ); } -void ScCellObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, uno::Any& rAny ) +void ScCellObj::GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, uno::Any& rAny ) { if ( !pEntry ) return; @@ -7810,7 +7810,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScTableSheetObj::getPropertySet return aRef; } -void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, const uno::Any& aValue ) +void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, const uno::Any& aValue ) { if ( !pEntry ) return; @@ -8137,7 +8137,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn ScCellRangeObj::SetOnePropertyValue(pEntry, aValue); // base class, no Item WID } -void ScTableSheetObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, +void ScTableSheetObj::GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, uno::Any& rAny ) { if ( !pEntry ) @@ -8380,7 +8380,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScTableColumnObj::getPropertySe return aRef; } -void ScTableColumnObj::SetOnePropertyValue(const SfxItemPropertySimpleEntry* pEntry, const uno::Any& aValue) +void ScTableColumnObj::SetOnePropertyValue(const SfxItemPropertyMapEntry* pEntry, const uno::Any& aValue) { if ( !pEntry ) return; @@ -8443,7 +8443,7 @@ void ScTableColumnObj::SetOnePropertyValue(const SfxItemPropertySimpleEntry* pEn ScCellRangeObj::SetOnePropertyValue(pEntry, aValue); // base class, no Item WID } -void ScTableColumnObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, uno::Any& rAny ) +void ScTableColumnObj::GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, uno::Any& rAny ) { if ( !pEntry ) return; @@ -8516,7 +8516,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScTableRowObj::getPropertySetIn return aRef; } -void ScTableRowObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, const uno::Any& aValue ) +void ScTableRowObj::SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, const uno::Any& aValue ) { if ( !pEntry ) return; @@ -8590,7 +8590,7 @@ void ScTableRowObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntr ScCellRangeObj::SetOnePropertyValue(pEntry, aValue); // base class, no Item WID } -void ScTableRowObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntry, uno::Any& rAny ) +void ScTableRowObj::GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntry, uno::Any& rAny ) { if ( !pEntry ) return; diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx index b64fd3ec96b6..e5e65dd7dcbf 100644 --- a/sc/source/ui/unoobj/condformatuno.cxx +++ b/sc/source/ui/unoobj/condformatuno.cxx @@ -562,7 +562,7 @@ void SAL_CALL ScCondFormatObj::setPropertyValue( SolarMutexGuard aGuard; const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -600,7 +600,7 @@ uno::Any SAL_CALL ScCondFormatObj::getPropertyValue( const OUString& aPropertyNa SolarMutexGuard aGuard; const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -702,7 +702,7 @@ void SAL_CALL ScConditionEntryObj::setPropertyValue( SolarMutexGuard aGuard; const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -765,7 +765,7 @@ uno::Any SAL_CALL ScConditionEntryObj::getPropertyValue( const OUString& aProper SolarMutexGuard aGuard; const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -909,7 +909,7 @@ void SAL_CALL ScColorScaleFormatObj::setPropertyValue( SolarMutexGuard aGuard; const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -943,7 +943,7 @@ uno::Any SAL_CALL ScColorScaleFormatObj::getPropertyValue( const OUString& aProp SolarMutexGuard aGuard; const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -1159,7 +1159,7 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue( SolarMutexGuard aGuard; const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -1283,7 +1283,7 @@ uno::Any SAL_CALL ScDataBarFormatObj::getPropertyValue( const OUString& aPropert SolarMutexGuard aGuard; const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -1534,7 +1534,7 @@ void SAL_CALL ScIconSetFormatObj::setPropertyValue( SolarMutexGuard aGuard; const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -1605,7 +1605,7 @@ uno::Any SAL_CALL ScIconSetFormatObj::getPropertyValue( const OUString& aPropert SolarMutexGuard aGuard; const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -1799,7 +1799,7 @@ void SAL_CALL ScCondDateFormatObj::setPropertyValue( SolarMutexGuard aGuard; const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -1841,7 +1841,7 @@ uno::Any SAL_CALL ScCondDateFormatObj::getPropertyValue( const OUString& aProper SolarMutexGuard aGuard; const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx index 22a98d6bd3eb..b09a5a004d2b 100644 --- a/sc/source/ui/unoobj/defltuno.cxx +++ b/sc/source/ui/unoobj/defltuno.cxx @@ -121,7 +121,7 @@ void SAL_CALL ScDocDefaultsObj::setPropertyValue( if ( !pDocShell ) throw uno::RuntimeException(); - const SfxItemPropertySimpleEntry* pEntry = aPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = aPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); if(!pEntry->nWID) @@ -203,7 +203,7 @@ uno::Any SAL_CALL ScDocDefaultsObj::getPropertyValue( const OUString& aPropertyN throw uno::RuntimeException(); uno::Any aRet; - const SfxItemPropertySimpleEntry* pEntry = aPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = aPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -248,7 +248,7 @@ beans::PropertyState SAL_CALL ScDocDefaultsObj::getPropertyState( const OUString if ( !pDocShell ) throw uno::RuntimeException(); - const SfxItemPropertySimpleEntry* pEntry = aPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = aPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -293,7 +293,7 @@ void SAL_CALL ScDocDefaultsObj::setPropertyToDefault( const OUString& aPropertyN if ( !pDocShell ) throw uno::RuntimeException(); - const SfxItemPropertySimpleEntry* pEntry = aPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = aPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -315,7 +315,7 @@ uno::Any SAL_CALL ScDocDefaultsObj::getPropertyDefault( const OUString& aPropert if ( !pDocShell ) throw uno::RuntimeException(); - const SfxItemPropertySimpleEntry* pEntry = aPropertyMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = aPropertyMap.getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); diff --git a/sc/source/ui/unoobj/optuno.cxx b/sc/source/ui/unoobj/optuno.cxx index dccfb6851492..a18508f21f4f 100644 --- a/sc/source/ui/unoobj/optuno.cxx +++ b/sc/source/ui/unoobj/optuno.cxx @@ -57,7 +57,7 @@ bool ScDocOptionsHelper::setPropertyValue( ScDocOptions& rOptions, { //! use map (with new identifiers) - const SfxItemPropertySimpleEntry* pEntry = rPropMap.getByName(aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropMap.getByName(aPropertyName ); if( !pEntry || !pEntry->nWID ) return false; switch( pEntry->nWID ) @@ -132,7 +132,7 @@ uno::Any ScDocOptionsHelper::getPropertyValue( std::u16string_view aPropertyName ) { uno::Any aRet; - const SfxItemPropertySimpleEntry* pEntry = rPropMap.getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = rPropMap.getByName( aPropertyName ); if( !pEntry || !pEntry->nWID ) return aRet; switch( pEntry->nWID ) diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index de1563ed8f58..46933ed8ab97 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -1120,12 +1120,12 @@ uno::Reference<container::XIndexReplace> ScStyleObj::CreateEmptyNumberingRules() // beans::XPropertyState const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( std::u16string_view rPropName, - const SfxItemPropertySimpleEntry*& rpResultEntry ) + const SfxItemPropertyMapEntry*& rpResultEntry ) { SfxStyleSheetBase* pStyle = GetStyle_Impl( true ); if ( pStyle ) { - const SfxItemPropertySimpleEntry* pEntry = nullptr; + const SfxItemPropertyMapEntry* pEntry = nullptr; if ( eFamily == SfxStyleFamily::Page ) { pEntry = lcl_GetHeaderStyleMap()->getByName( rPropName ); @@ -1157,7 +1157,7 @@ beans::PropertyState ScStyleObj::getPropertyState_Impl( std::u16string_view aPro { beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE; - const SfxItemPropertySimpleEntry* pResultEntry = nullptr; + const SfxItemPropertyMapEntry* pResultEntry = nullptr; const SfxItemSet* pItemSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry ); if ( pItemSet && pResultEntry ) @@ -1215,7 +1215,7 @@ void SAL_CALL ScStyleObj::setPropertyToDefault( const OUString& aPropertyName ) SolarMutexGuard aGuard; GetStyle_Impl(); - const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap().getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = pPropSet->getPropertyMap().getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); @@ -1226,7 +1226,7 @@ uno::Any ScStyleObj::getPropertyDefault_Impl( std::u16string_view aPropertyName { uno::Any aAny; - const SfxItemPropertySimpleEntry* pResultEntry = nullptr; + const SfxItemPropertyMapEntry* pResultEntry = nullptr; const SfxItemSet* pStyleSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry ); if ( pStyleSet && pResultEntry ) @@ -1340,7 +1340,7 @@ void SAL_CALL ScStyleObj::setPropertyValues( const uno::Sequence< OUString >& aP const SfxItemPropertyMap& rPropertyMap = pPropSet->getPropertyMap(); for ( sal_Int32 i = 0; i < aPropertyNames.getLength(); i++ ) { - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( pNames[i] ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( pNames[i] ); setPropertyValue_Impl( pNames[i], pEntry, &pValues[i] ); } } @@ -1434,7 +1434,7 @@ void SAL_CALL ScStyleObj::setPropertiesToDefault( const uno::Sequence<OUString>& const SfxItemPropertyMap& rPropertyMap = pPropSet->getPropertyMap(); for ( const OUString& rName : aPropertyNames ) { - const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( rName ); + const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( rName ); setPropertyValue_Impl( rName, pEntry, nullptr ); } } @@ -1452,14 +1452,14 @@ void SAL_CALL ScStyleObj::setPropertyValue( const OUString& aPropertyName, const SolarMutexGuard aGuard; GetStyle_Impl(); - const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap().getByName( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = pPropSet->getPropertyMap().getByName( aPropertyName ); if ( !pEntry ) throw beans::UnknownPropertyException(aPropertyName); setPropertyValue_Impl( aPropertyName, pEntry, &aValue ); } -void ScStyleObj::setPropertyValue_Impl( std::u16string_view rPropertyName, const SfxItemPropertySimpleEntry* pEntry, const uno::Any* pValue ) +void ScStyleObj::setPropertyValue_Impl( std::u16string_view rPropertyName, const SfxItemPropertyMapEntry* pEntry, const uno::Any* pValue ) { SfxStyleSheetBase* pStyle = GetStyle_Impl( true ); if ( !(pStyle && pEntry) ) @@ -1475,7 +1475,7 @@ void ScStyleObj::setPropertyValue_Impl( std::u16string_view rPropertyName, const { if(pEntry->nWID == SC_WID_UNO_HEADERSET) { - const SfxItemPropertySimpleEntry* pHeaderEntry = lcl_GetHeaderStyleMap()->getByName( rPropertyName ); + const SfxItemPropertyMapEntry* pHeaderEntry = lcl_GetHeaderStyleMap()->getByName( rPropertyName ); if ( pHeaderEntry ) // only item-WIDs in header/footer map { SvxSetItem aNewHeader( rSet.Get(ATTR_PAGE_HEADERSET) ); @@ -1489,7 +1489,7 @@ void ScStyleObj::setPropertyValue_Impl( std::u16string_view rPropertyName, const } else if(pEntry->nWID == SC_WID_UNO_FOOTERSET) { - const SfxItemPropertySimpleEntry* pFooterEntry = lcl_GetFooterStyleMap()->getByName( rPropertyName ); + const SfxItemPropertyMapEntry* pFooterEntry = lcl_GetFooterStyleMap()->getByName( rPropertyName ); if ( pFooterEntry ) // only item-WIDs in header/footer map { SvxSetItem aNewFooter( rSet.Get(ATTR_PAGE_FOOTERSET) ); @@ -1780,7 +1780,7 @@ uno::Any ScStyleObj::getPropertyValue_Impl( std::u16string_view aPropertyName ) } else { - const SfxItemPropertySimpleEntry* pResultEntry = nullptr; + const SfxItemPropertyMapEntry* pResultEntry = nullptr; const SfxItemSet* pItemSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry ); if ( pItemSet && pResultEntry ) diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 0d2ae5bd744e..346e784f0836 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -52,7 +52,7 @@ using namespace com::sun::star; static const SvxItemPropertySet * lcl_GetHdFtPropertySet() { static const SvxItemPropertySet aHdFtPropertySet_Impl = [] { - SfxItemPropertyMapEntry aHdFtPropertyMap_Impl[] = + static SfxItemPropertyMapEntry aHdFtPropertyMap_Impl[] = { SVX_UNOEDIT_CHAR_PROPERTIES, SVX_UNOEDIT_FONT_PROPERTIES, @@ -65,7 +65,7 @@ static const SvxItemPropertySet * lcl_GetHdFtPropertySet() // (headers/footers are in twips) SfxItemPropertyMapEntry* pEntry = aHdFtPropertyMap_Impl; - while (!pEntry->aName.empty()) + while (!pEntry->aName.isEmpty()) { if ( ( pEntry->nWID == EE_CHAR_FONTHEIGHT || pEntry->nWID == EE_CHAR_FONTHEIGHT_CJK || diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 048e663d81ad..73363238a85a 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1252,14 +1252,14 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, bool bCursor const SfxPoolItem* pItem = nullptr; if ( rNewSet.GetItemState( nWhich, true, &pItem ) == SfxItemState::SET && pItem ) { - for ( const auto& rProp : rMap.getPropertyEntries()) + for ( const auto pEntry : rMap.getPropertyEntries()) { - if ( rProp.second.nWID == nWhich ) + if ( pEntry->nWID == nWhich ) { css::uno::Any aVal; - pItem->QueryValue( aVal, rProp.second.nMemberId ); + pItem->QueryValue( aVal, pEntry->nMemberId ); aProperties.realloc( nCount + 1 ); - aProperties[ nCount ].Name = rProp.first; + aProperties[ nCount ].Name = pEntry->aName; aProperties[ nCount ].Value = aVal; ++nCount; } diff --git a/sd/inc/stlsheet.hxx b/sd/inc/stlsheet.hxx index e0eced36a280..c0dd967e3120 100644 --- a/sd/inc/stlsheet.hxx +++ b/sd/inc/stlsheet.hxx @@ -40,6 +40,7 @@ class ModifyListenerForwarder; struct SfxItemPropertySimpleEntry; +struct SfxItemPropertyMapEntry; typedef cppu::ImplInheritanceHelper< SfxUnoStyleSheet, css::beans::XPropertySet, @@ -128,7 +129,7 @@ public: private: /// @throws css::uno::RuntimeException - static const SfxItemPropertySimpleEntry* getPropertyMapEntry( std::u16string_view rPropertyName ); + static const SfxItemPropertyMapEntry* getPropertyMapEntry( std::u16string_view rPropertyName ); virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; virtual ~SdStyleSheet() override; diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index a470ff28c4f1..dbf164e41235 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -961,7 +961,7 @@ void SAL_CALL SdStyleSheet::setPropertyValue( const OUString& aPropertyName, con SolarMutexGuard aGuard; throwIfDisposed(); - const SfxItemPropertySimpleEntry* pEntry = getPropertyMapEntry( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = getPropertyMapEntry( aPropertyName ); if( pEntry == nullptr ) { throw UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this)); @@ -1047,7 +1047,7 @@ Any SAL_CALL SdStyleSheet::getPropertyValue( const OUString& PropertyName ) throwIfDisposed(); - const SfxItemPropertySimpleEntry* pEntry = getPropertyMapEntry( PropertyName ); + const SfxItemPropertyMapEntry* pEntry = getPropertyMapEntry( PropertyName ); if( pEntry == nullptr ) { throw UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this)); @@ -1159,7 +1159,7 @@ PropertyState SAL_CALL SdStyleSheet::getPropertyState( const OUString& PropertyN throwIfDisposed(); - const SfxItemPropertySimpleEntry* pEntry = getPropertyMapEntry( PropertyName ); + const SfxItemPropertyMapEntry* pEntry = getPropertyMapEntry( PropertyName ); if( pEntry == nullptr ) throw UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this)); @@ -1252,7 +1252,7 @@ void SAL_CALL SdStyleSheet::setPropertyToDefault( const OUString& PropertyName ) throwIfDisposed(); - const SfxItemPropertySimpleEntry* pEntry = getPropertyMapEntry( PropertyName ); + const SfxItemPropertyMapEntry* pEntry = getPropertyMapEntry( PropertyName ); if( pEntry == nullptr ) throw UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this)); @@ -1276,7 +1276,7 @@ Any SAL_CALL SdStyleSheet::getPropertyDefault( const OUString& aPropertyName ) throwIfDisposed(); - const SfxItemPropertySimpleEntry* pEntry = getPropertyMapEntry( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = getPropertyMapEntry( aPropertyName ); if( pEntry == nullptr ) throw UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this)); Any aRet; @@ -1303,7 +1303,7 @@ Any SAL_CALL SdStyleSheet::getPropertyDefault( const OUString& aPropertyName ) } /** this is used because our property map is not sorted yet */ -const SfxItemPropertySimpleEntry* SdStyleSheet::getPropertyMapEntry( std::u16string_view rPropertyName ) +const SfxItemPropertyMapEntry* SdStyleSheet::getPropertyMapEntry( std::u16string_view rPropertyName ) { return GetStylePropertySet().getPropertyMapEntry(rPropertyName); } diff --git a/sd/source/ui/inc/unokywds.hxx b/sd/source/ui/inc/unokywds.hxx index 41384cf08371..13a4cd4dd258 100644 --- a/sd/source/ui/inc/unokywds.hxx +++ b/sd/source/ui/inc/unokywds.hxx @@ -44,20 +44,21 @@ inline constexpr OUStringLiteral sUNO_Service_ImageMapPolygonObject = u"com.sun.star.image.ImageMapPolygonObject"; // properties -inline const char16_t sUNO_Prop_ForbiddenCharacters[] = u"ForbiddenCharacters"; -inline const char16_t sUNO_Prop_MapUnit[] = u"MapUnit"; -inline const char16_t sUNO_Prop_VisibleArea[] = u"VisibleArea"; -inline const char16_t sUNO_Prop_TabStop[] = u"TabStop"; -inline const char16_t sUNO_Prop_CharLocale[] = u"CharLocale"; -inline const char16_t sUNO_Prop_AutomContFocus[] = u"AutomaticControlFocus"; -inline const char16_t sUNO_Prop_ApplyFrmDsgnMode[] = u"ApplyFormDesignMode"; -inline const char16_t sUNO_Prop_IsBackgroundVisible[] = u"IsBackgroundVisible"; -inline const char16_t sUNO_Prop_IsBackgroundObjectsVisible[] = u"IsBackgroundObjectsVisible"; -inline const char16_t sUNO_Prop_UserDefinedAttributes[] = u"UserDefinedAttributes"; -inline const char16_t sUNO_Prop_BookmarkURL[] = u"BookmarkURL"; -inline const char16_t sUNO_Prop_RuntimeUID[] = u"RuntimeUID"; -inline const char16_t sUNO_Prop_HasValidSignatures[] = u"HasValidSignatures"; -inline const char16_t sUNO_Prop_InteropGrabBag[] = u"InteropGrabBag"; +inline constexpr OUStringLiteral sUNO_Prop_ForbiddenCharacters = u"ForbiddenCharacters"; +inline constexpr OUStringLiteral sUNO_Prop_MapUnit = u"MapUnit"; +inline constexpr OUStringLiteral sUNO_Prop_VisibleArea = u"VisibleArea"; +inline constexpr OUStringLiteral sUNO_Prop_TabStop = u"TabStop"; +inline constexpr OUStringLiteral sUNO_Prop_CharLocale = u"CharLocale"; +inline constexpr OUStringLiteral sUNO_Prop_AutomContFocus = u"AutomaticControlFocus"; +inline constexpr OUStringLiteral sUNO_Prop_ApplyFrmDsgnMode = u"ApplyFormDesignMode"; +inline constexpr OUStringLiteral sUNO_Prop_IsBackgroundVisible = u"IsBackgroundVisible"; +inline constexpr OUStringLiteral sUNO_Prop_IsBackgroundObjectsVisible + = u"IsBackgroundObjectsVisible"; +inline constexpr OUStringLiteral sUNO_Prop_UserDefinedAttributes = u"UserDefinedAttributes"; +inline constexpr OUStringLiteral sUNO_Prop_BookmarkURL = u"BookmarkURL"; +inline constexpr OUStringLiteral sUNO_Prop_RuntimeUID = u"RuntimeUID"; +inline constexpr OUStringLiteral sUNO_Prop_HasValidSignatures = u"HasValidSignatures"; +inline constexpr OUStringLiteral sUNO_Prop_InteropGrabBag = u"InteropGrabBag"; // view settings inline constexpr OUStringLiteral sUNO_View_ViewId = u"ViewId"; diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index 8873162436be..e9917f16b467 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -264,7 +264,7 @@ void SAL_CALL SlideShow::setPropertyValue( const OUString& aPropertyName, const sd::PresentationSettings& rPresSettings = mpDoc->getPresentationSettings(); - const SfxItemPropertySimpleEntry* pEntry = maPropSet.getPropertyMapEntry(aPropertyName); + const SfxItemPropertyMapEntry* pEntry = maPropSet.getPropertyMapEntry(aPropertyName); if( pEntry && ((pEntry->nFlags & PropertyAttribute::READONLY) != 0) ) throw PropertyVetoException(); @@ -526,7 +526,7 @@ Any SAL_CALL SlideShow::getPropertyValue( const OUString& PropertyName ) const sd::PresentationSettings& rPresSettings = mpDoc->getPresentationSettings(); - const SfxItemPropertySimpleEntry* pEntry = maPropSet.getPropertyMapEntry(PropertyName); + const SfxItemPropertyMapEntry* pEntry = maPropSet.getPropertyMapEntry(PropertyName); switch( pEntry ? pEntry->nWID : -1 ) { diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index dff010b3722e..dabcd24f0af2 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -120,7 +120,7 @@ void SAL_CALL SdLayer::setPropertyValue( const OUString& aPropertyName, const un if(pLayer == nullptr || mxLayerManager == nullptr) throw lang::DisposedException(); - const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMapEntry(aPropertyName); + const SfxItemPropertyMapEntry* pEntry = pPropSet->getPropertyMapEntry(aPropertyName); switch( pEntry ? pEntry->nWID : -1 ) { @@ -188,7 +188,7 @@ uno::Any SAL_CALL SdLayer::getPropertyValue( const OUString& PropertyName ) if(pLayer == nullptr || mxLayerManager == nullptr) throw lang::DisposedException(); - const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMapEntry(PropertyName); + const SfxItemPropertyMapEntry* pEntry = pPropSet->getPropertyMapEntry(PropertyName); uno::Any aValue; diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index fcdb050d7843..cb3569a7689d 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1188,7 +1188,7 @@ void SAL_CALL SdXImpressDocument::setPropertyValue( const OUString& aPropertyNam if( nullptr == mpDoc ) throw lang::DisposedException(); - const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(aPropertyName); + const SfxItemPropertyMapEntry* pEntry = mpPropSet->getPropertyMapEntry(aPropertyName); switch( pEntry ? pEntry->nWID : -1 ) { @@ -1270,7 +1270,7 @@ uno::Any SAL_CALL SdXImpressDocument::getPropertyValue( const OUString& Property if( nullptr == mpDoc ) throw lang::DisposedException(); - const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(PropertyName); + const SfxItemPropertyMapEntry* pEntry = mpPropSet->getPropertyMapEntry(PropertyName); switch( pEntry ? pEntry->nWID : -1 ) { diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index fdedfb6dcc35..e9e017de3f8d 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -415,7 +415,7 @@ void SAL_CALL SdXShape::setPropertyValue( const OUString& aPropertyName, const c { SolarMutexGuard aGuard; - const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(aPropertyName); + const SfxItemPropertyMapEntry* pEntry = mpPropSet->getPropertyMapEntry(aPropertyName); if( pEntry ) { @@ -656,7 +656,7 @@ css::uno::Any SAL_CALL SdXShape::getPropertyValue( const OUString& PropertyName uno::Any aRet; - const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(PropertyName); + const SfxItemPropertyMapEntry* pEntry = mpPropSet->getPropertyMapEntry(PropertyName); if( pEntry && mpShape->GetSdrObject() ) { diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 02bd803cdeb9..eed82fceddd8 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -582,7 +582,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName throwIfDisposed(); - const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(aPropertyName); + const SfxItemPropertyMapEntry* pEntry = mpPropSet->getPropertyMapEntry(aPropertyName); switch( pEntry ? pEntry->nWID : -1 ) { @@ -992,7 +992,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) uno::Any aAny; - const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(PropertyName); + const SfxItemPropertyMapEntry* pEntry = mpPropSet->getPropertyMapEntry(PropertyName); sal_Int16 nEntry = pEntry ? pEntry->nWID : -1; switch (nEntry) @@ -2780,14 +2780,15 @@ void SdMasterPage::setBackground( const Any& rValue ) Reference< beans::XPropertySetInfo > xSetInfo( xInputSet->getPropertySetInfo(), UNO_SET_THROW ); Reference< beans::XPropertyState > xSetStates( xInputSet, UNO_QUERY ); - for( const auto& rProp : ImplGetPageBackgroundPropertySet()->getPropertyMap().getPropertyEntries() ) + for( const auto pProp : ImplGetPageBackgroundPropertySet()->getPropertyMap().getPropertyEntries() ) { - if( xSetInfo->hasPropertyByName( OUString(rProp.first) ) ) + const OUString& rPropName = pProp->aName; + if( xSetInfo->hasPropertyByName( rPropName ) ) { - if( !xSetStates.is() || xSetStates->getPropertyState( OUString(rProp.first) ) == beans::PropertyState_DIRECT_VALUE ) - xStyleSet->setPropertyValue( OUString(rProp.first), xInputSet->getPropertyValue( OUString(rProp.first) ) ); + if( !xSetStates.is() || xSetStates->getPropertyState( rPropName ) == beans::PropertyState_DIRECT_VALUE ) + xStyleSet->setPropertyValue( rPropName, xInputSet->getPropertyValue( rPropName ) ); else - xSetStates->setPropertyToDefault( OUString(rProp.first) ); + xSetStates->setPropertyToDefault( rPropName ); } } } diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index 60a1ac6bbe14..88ff72ef92a8 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -100,24 +100,24 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet ) if( mpPropSet->AreThereOwnUsrAnys() ) { - for( const auto& rProp : mpPropSet->getPropertyMap().getPropertyEntries() ) + for( const auto pProp : mpPropSet->getPropertyMap().getPropertyEntries() ) { - uno::Any* pAny = mpPropSet->GetUsrAnyForID( rProp.second ); + uno::Any* pAny = mpPropSet->GetUsrAnyForID( *pProp ); if( pAny ) { - OUString aPropertyName( rProp.first ); - switch( rProp.second.nWID ) + const OUString & aPropertyName = pProp->aName; + switch( pProp->nWID ) { case XATTR_FILLFLOATTRANSPARENCE : case XATTR_FILLGRADIENT : { if ( ( pAny->getValueType() == ::cppu::UnoType< css::awt::Gradient>::get() ) - && ( rProp.second.nMemberId == MID_FILLGRADIENT ) ) + && ( pProp->nMemberId == MID_FILLGRADIENT ) ) { setPropertyValue( aPropertyName, *pAny ); } else if ( ( pAny->getValueType() == ::cppu::UnoType<OUString>::get() ) && - ( rProp.second.nMemberId == MID_NAME ) ) + ( pProp->nMemberId == MID_NAME ) ) { setPropertyValue( aPropertyName, *pAny ); } @@ -126,12 +126,12 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet ) case XATTR_FILLHATCH : { if ( ( pAny->getValueType() == ::cppu::UnoType< css::drawing::Hatch>::get() ) - && ( rProp.second.nMemberId == MID_FILLHATCH ) ) + && ( pProp->nMemberId == MID_FILLHATCH ) ) { setPropertyValue( aPropertyName, *pAny ); } else if ( ( pAny->getValueType() == ::cppu::UnoType<OUString>::get() ) && - ( rProp.second.nMemberId == MID_NAME ) ) + ( pProp->nMemberId == MID_NAME ) ) { setPropertyValue( aPropertyName, *pAny ); } @@ -139,13 +139,13 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet ) break; case XATTR_FILLBITMAP : { - if (rProp.second.nMemberId == MID_BITMAP && + if (pProp->nMemberId == MID_BITMAP && (pAny->getValueType() == cppu::UnoType<css::awt::XBitmap>::get() || pAny->getValueType() == cppu::UnoType<css::graphic::XGraphic>::get())) { setPropertyValue( aPropertyName, *pAny ); } - else if (pAny->getValueType() == ::cppu::UnoType<OUString>::get() && rProp.second.nMemberId == MID_NAME) + else if (pAny->getValueType() == ::cppu::UnoType<OUString>::get() && pProp->nMemberId == MID_NAME) { setPropertyValue( aPropertyName, *pAny ); } @@ -189,7 +189,7 @@ void SAL_CALL SdUnoPageBackground::setPropertyValue( const OUString& aPropertyNa { SolarMutexGuard aGuard; - const SfxItemPropertySimpleEntry* pEntry = getPropertyMapEntry( aPropertyName ); + const SfxItemPropertyMapEntry* pEntry = getPropertyMapEntry( aPropertyName ); if( pEntry == nullptr ) { @@ -244,7 +244,7 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyValue( const OUString& Propert SolarMutexGuard aGuard; uno::Any aAny; - const SfxItemPropertySimpleEntry* pEntry = getPropertyMapEntry(PropertyName); + const SfxItemPropertyMapEntry* pEntry = getPropertyMapEntry(PropertyName); if( pEntry == nullptr ) { @@ -299,7 +299,7 @@ beans::PropertyState SAL_CALL SdUnoPageBackground::getPropertyState( const OUStr { SolarMutexGuard aGuard; - const SfxItemPropertySimpleEntry* pEntry = getPropertyMapEntry(PropertyName); + const SfxItemPropertyMapEntry* pEntry = getPropertyMapEntry(PropertyName); if( pEntry == nullptr ) throw beans::UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this)); @@ -359,7 +359,7 @@ void SAL_CALL SdUnoPageBackground::setPropertyToDefault( const OUString& Propert { SolarMutexGuard aGuard; - const SfxItemPropertySimpleEntry* pEntry = getPropertyMapEntry(PropertyName); + const SfxItemPropertyMapEntry* pEntry = getPropertyMapEntry(PropertyName); ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits