editeng/source/uno/unoipset.cxx | 2 +- editeng/source/uno/unotext.cxx | 2 +- include/editeng/unoipset.hxx | 2 +- include/editeng/unotext.hxx | 2 +- include/svl/itemprop.hxx | 4 ++-- sc/inc/optuno.hxx | 4 ++-- sc/inc/styleuno.hxx | 10 +++++----- sc/source/ui/unoobj/optuno.cxx | 4 ++-- sc/source/ui/unoobj/styleuno.cxx | 18 +++++++++--------- sd/inc/stlsheet.hxx | 2 +- sd/source/core/stlsheet.cxx | 2 +- sd/source/ui/unoidl/unopback.cxx | 2 +- sd/source/ui/unoidl/unopback.hxx | 2 +- svl/source/items/itemprop.cxx | 6 +++--- sw/source/core/unocore/unofield.cxx | 2 +- 15 files changed, 32 insertions(+), 32 deletions(-)
New commits: commit 27d585cd2d0a0157896c4af11f2463f0197e3eb2 Author: Noel <noel.gran...@collabora.co.uk> AuthorDate: Fri Dec 18 20:23:40 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Dec 19 08:02:56 2020 +0100 use more string_view in SfxItemPropertyMap Change-Id: I053dedcbf0b110a61752722d247d6ee5e9ba481d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107977 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx index c9d54c83e972..523b29794461 100644 --- a/editeng/source/uno/unoipset.cxx +++ b/editeng/source/uno/unoipset.cxx @@ -246,7 +246,7 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa } -const SfxItemPropertySimpleEntry* SvxItemPropertySet::getPropertyMapEntry(const OUString &rName) const +const SfxItemPropertySimpleEntry* 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 6761f8b8b622..9476ba7659c7 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -1017,7 +1017,7 @@ beans::PropertyState SvxUnoTextRangeBase::_getPropertyState(const SfxItemPropert throw beans::UnknownPropertyException(); } -beans::PropertyState SvxUnoTextRangeBase::_getPropertyState(const OUString& PropertyName, sal_Int32 nPara /* = -1 */) +beans::PropertyState SvxUnoTextRangeBase::_getPropertyState(std::u16string_view PropertyName, sal_Int32 nPara /* = -1 */) { SolarMutexGuard aGuard; diff --git a/include/editeng/unoipset.hxx b/include/editeng/unoipset.hxx index c05ff656ee9c..0a4d8c2fe3ad 100644 --- a/include/editeng/unoipset.hxx +++ b/include/editeng/unoipset.hxx @@ -59,7 +59,7 @@ public: css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const; const SfxItemPropertyMap& getPropertyMap() const { return m_aPropertyMap;} - const SfxItemPropertySimpleEntry* getPropertyMapEntry(const OUString &rName) const; + const SfxItemPropertySimpleEntry* 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 86841fbb0d56..a07a8cf059e1 100644 --- a/include/editeng/unotext.hxx +++ b/include/editeng/unotext.hxx @@ -274,7 +274,7 @@ protected: css::beans::PropertyState _getPropertyState( const SfxItemPropertySimpleEntry* pMap, sal_Int32 nPara = -1 ); /// @throws css::beans::UnknownPropertyException /// @throws css::uno::RuntimeException - css::beans::PropertyState _getPropertyState( const OUString& 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 ); diff --git a/include/svl/itemprop.hxx b/include/svl/itemprop.hxx index e985977f265a..67cedb7a64b6 100644 --- a/include/svl/itemprop.hxx +++ b/include/svl/itemprop.hxx @@ -124,11 +124,11 @@ public: SfxItemPropertyMap( const SfxItemPropertyMap& rSource ); ~SfxItemPropertyMap(); - const SfxItemPropertySimpleEntry* getByName( const OUString &rName ) const; + const SfxItemPropertySimpleEntry* 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( const OUString& rName ) const; + bool hasPropertyByName( std::u16string_view rName ) const; void mergeProperties( const css::uno::Sequence< css::beans::Property >& rPropSeq ); PropertyEntryVector_t getPropertyEntries() const; diff --git a/sc/inc/optuno.hxx b/sc/inc/optuno.hxx index 35e7ad28e3d5..8ce6d9c149d1 100644 --- a/sc/inc/optuno.hxx +++ b/sc/inc/optuno.hxx @@ -44,12 +44,12 @@ public: static bool setPropertyValue( ScDocOptions& rOptions, const SfxItemPropertyMap& rPropMap, - const OUString& aPropertyName, + std::u16string_view aPropertyName, const css::uno::Any& aValue ); static css::uno::Any getPropertyValue( const ScDocOptions& rOptions, const SfxItemPropertyMap& rPropMap, - const OUString& PropertyName ); + std::u16string_view PropertyName ); }; // empty doc object to supply only doc options diff --git a/sc/inc/styleuno.hxx b/sc/inc/styleuno.hxx index 9921bbb4f108..84179f8a27fb 100644 --- a/sc/inc/styleuno.hxx +++ b/sc/inc/styleuno.hxx @@ -174,21 +174,21 @@ private: SfxStyleSheetBase* pStyle_cached; SfxStyleSheetBase* GetStyle_Impl( bool bUseCachedValue = false ); - const SfxItemSet* GetStyleItemSet_Impl( const OUString& rPropName, const SfxItemPropertySimpleEntry*& rpEntry ); + const SfxItemSet* GetStyleItemSet_Impl( std::u16string_view rPropName, const SfxItemPropertySimpleEntry*& rpEntry ); /// @throws css::beans::UnknownPropertyException /// @throws css::uno::RuntimeException - css::beans::PropertyState getPropertyState_Impl( const OUString& PropertyName ); + css::beans::PropertyState getPropertyState_Impl( std::u16string_view PropertyName ); /// @throws css::beans::UnknownPropertyException /// @throws css::lang::WrappedTargetException /// @throws css::uno::RuntimeException - css::uno::Any getPropertyDefault_Impl( const OUString& aPropertyName ); + css::uno::Any getPropertyDefault_Impl( std::u16string_view aPropertyName ); /// @throws css::beans::UnknownPropertyException /// @throws css::lang::WrappedTargetException /// @throws css::uno::RuntimeException - css::uno::Any getPropertyValue_Impl( const OUString& aPropertyName ); + css::uno::Any getPropertyValue_Impl( std::u16string_view aPropertyName ); /// @throws css::lang::IllegalArgumentException /// @throws css::uno::RuntimeException - void setPropertyValue_Impl( const OUString& rPropertyName, + void setPropertyValue_Impl( std::u16string_view rPropertyName, const SfxItemPropertySimpleEntry* pEntry, const css::uno::Any* pValue ); diff --git a/sc/source/ui/unoobj/optuno.cxx b/sc/source/ui/unoobj/optuno.cxx index 495c6934ec00..dccfb6851492 100644 --- a/sc/source/ui/unoobj/optuno.cxx +++ b/sc/source/ui/unoobj/optuno.cxx @@ -53,7 +53,7 @@ const SfxItemPropertyMapEntry* ScDocOptionsHelper::GetPropertyMap() bool ScDocOptionsHelper::setPropertyValue( ScDocOptions& rOptions, const SfxItemPropertyMap& rPropMap, - const OUString& aPropertyName, const uno::Any& aValue ) + std::u16string_view aPropertyName, const uno::Any& aValue ) { //! use map (with new identifiers) @@ -129,7 +129,7 @@ bool ScDocOptionsHelper::setPropertyValue( ScDocOptions& rOptions, uno::Any ScDocOptionsHelper::getPropertyValue( const ScDocOptions& rOptions, const SfxItemPropertyMap& rPropMap, - const OUString& aPropertyName ) + std::u16string_view aPropertyName ) { uno::Any aRet; const SfxItemPropertySimpleEntry* pEntry = rPropMap.getByName( aPropertyName ); diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 9dfddc407d77..81db396a5f6f 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -1121,7 +1121,7 @@ uno::Reference<container::XIndexReplace> ScStyleObj::CreateEmptyNumberingRules() // beans::XPropertyState -const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( const OUString& rPropName, +const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( std::u16string_view rPropName, const SfxItemPropertySimpleEntry*& rpResultEntry ) { SfxStyleSheetBase* pStyle = GetStyle_Impl( true ); @@ -1155,7 +1155,7 @@ const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( const OUString& rPropName, return nullptr; } -beans::PropertyState ScStyleObj::getPropertyState_Impl( const OUString& aPropertyName ) +beans::PropertyState ScStyleObj::getPropertyState_Impl( std::u16string_view aPropertyName ) { beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE; @@ -1224,7 +1224,7 @@ void SAL_CALL ScStyleObj::setPropertyToDefault( const OUString& aPropertyName ) setPropertyValue_Impl( aPropertyName, pEntry, nullptr ); } -uno::Any ScStyleObj::getPropertyDefault_Impl( const OUString& aPropertyName ) +uno::Any ScStyleObj::getPropertyDefault_Impl( std::u16string_view aPropertyName ) { uno::Any aAny; @@ -1273,7 +1273,7 @@ uno::Any ScStyleObj::getPropertyDefault_Impl( const OUString& aPropertyName ) case ATTR_PAGE_SCALETO: { const ScPageScaleToItem aItem(static_cast<const ScPageScaleToItem&>(pItemSet->Get(nWhich))); - if ( aPropertyName == SC_UNO_PAGE_SCALETOX ) + if ( aPropertyName == u"" SC_UNO_PAGE_SCALETOX ) aAny <<= static_cast<sal_Int16>(aItem.GetWidth()); else aAny <<= static_cast<sal_Int16>(aItem.GetHeight()); @@ -1461,7 +1461,7 @@ void SAL_CALL ScStyleObj::setPropertyValue( const OUString& aPropertyName, const setPropertyValue_Impl( aPropertyName, pEntry, &aValue ); } -void ScStyleObj::setPropertyValue_Impl( const OUString& rPropertyName, const SfxItemPropertySimpleEntry* pEntry, const uno::Any* pValue ) +void ScStyleObj::setPropertyValue_Impl( std::u16string_view rPropertyName, const SfxItemPropertySimpleEntry* pEntry, const uno::Any* pValue ) { SfxStyleSheetBase* pStyle = GetStyle_Impl( true ); if ( !(pStyle && pEntry) ) @@ -1652,7 +1652,7 @@ void ScStyleObj::setPropertyValue_Impl( const OUString& rPropertyName, const Sfx if (*pValue >>= nPages) { ScPageScaleToItem aItem = rSet.Get(ATTR_PAGE_SCALETO); - if (rPropertyName == SC_UNO_PAGE_SCALETOX) + if (rPropertyName == u"" SC_UNO_PAGE_SCALETOX) aItem.SetWidth(static_cast<sal_uInt16>(nPages)); else aItem.SetHeight(static_cast<sal_uInt16>(nPages)); @@ -1769,12 +1769,12 @@ void ScStyleObj::setPropertyValue_Impl( const OUString& rPropertyName, const Sfx } } -uno::Any ScStyleObj::getPropertyValue_Impl( const OUString& aPropertyName ) +uno::Any ScStyleObj::getPropertyValue_Impl( std::u16string_view aPropertyName ) { uno::Any aAny; SfxStyleSheetBase* pStyle = GetStyle_Impl( true ); - if ( aPropertyName == SC_UNONAME_DISPNAME ) // read-only + if ( aPropertyName == u"" SC_UNONAME_DISPNAME ) // read-only { // core always has the display name if ( pStyle ) @@ -1847,7 +1847,7 @@ uno::Any ScStyleObj::getPropertyValue_Impl( const OUString& aPropertyName ) case ATTR_PAGE_SCALETO: { const ScPageScaleToItem& aItem(pItemSet->Get(ATTR_PAGE_SCALETO)); - if ( aPropertyName == SC_UNO_PAGE_SCALETOX ) + if ( aPropertyName == u"" SC_UNO_PAGE_SCALETOX ) aAny <<= static_cast<sal_Int16>(aItem.GetWidth()); else aAny <<= static_cast<sal_Int16>(aItem.GetHeight()); diff --git a/sd/inc/stlsheet.hxx b/sd/inc/stlsheet.hxx index 42f6a4e4bde4..dc32df9fa5eb 100644 --- a/sd/inc/stlsheet.hxx +++ b/sd/inc/stlsheet.hxx @@ -129,7 +129,7 @@ public: private: /// @throws css::uno::RuntimeException - static const SfxItemPropertySimpleEntry* getPropertyMapEntry( const OUString& rPropertyName ); + static const SfxItemPropertySimpleEntry* 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 52d05351b3b9..8b4ca07413bd 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -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( const OUString& rPropertyName ) +const SfxItemPropertySimpleEntry* SdStyleSheet::getPropertyMapEntry( std::u16string_view rPropertyName ) { return GetStylePropertySet().getPropertyMapEntry(rPropertyName); } diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index 9163969fe4a6..10aff03c05bf 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -405,7 +405,7 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyDefault( const OUString& aProp } /** this is used because our property map is not sorted yet */ -const SfxItemPropertySimpleEntry* SdUnoPageBackground::getPropertyMapEntry( const OUString& rPropertyName ) const throw() +const SfxItemPropertySimpleEntry* SdUnoPageBackground::getPropertyMapEntry( std::u16string_view rPropertyName ) const throw() { return mpPropSet->getPropertyMap().getByName(rPropertyName); } diff --git a/sd/source/ui/unoidl/unopback.hxx b/sd/source/ui/unoidl/unopback.hxx index d0fda4567ed3..fc3193068ad7 100644 --- a/sd/source/ui/unoidl/unopback.hxx +++ b/sd/source/ui/unoidl/unopback.hxx @@ -52,7 +52,7 @@ class SdUnoPageBackground final : public ::cppu::WeakImplHelper< std::unique_ptr<SfxItemSet> mpSet; SdrModel* mpDoc; - const SfxItemPropertySimpleEntry* getPropertyMapEntry( const OUString& rPropertyName ) const throw(); + const SfxItemPropertySimpleEntry* getPropertyMapEntry( std::u16string_view rPropertyName ) const throw(); public: SdUnoPageBackground( SdDrawDocument* pDoc = nullptr, const SfxItemSet* pSet = nullptr); virtual ~SdUnoPageBackground() throw() override; diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx index f3b7719e36ff..1d8a3f5b1ec1 100644 --- a/svl/source/items/itemprop.cxx +++ b/svl/source/items/itemprop.cxx @@ -35,7 +35,7 @@ using namespace com::sun::star::beans; using namespace com::sun::star::lang; using namespace com::sun::star::uno; -typedef std::unordered_map< OUString, +typedef std::unordered_map< std::u16string_view, SfxItemPropertySimpleEntry > SfxItemPropertyHashMap_t; class SfxItemPropertyMap_Impl : public SfxItemPropertyHashMap_t @@ -72,7 +72,7 @@ SfxItemPropertyMap::~SfxItemPropertyMap() { } -const SfxItemPropertySimpleEntry* SfxItemPropertyMap::getByName( const OUString &rName ) const +const SfxItemPropertySimpleEntry* SfxItemPropertyMap::getByName( std::u16string_view rName ) const { SfxItemPropertyHashMap_t::const_iterator aIter = m_pImpl->find(rName); if( aIter == m_pImpl->end() ) @@ -117,7 +117,7 @@ beans::Property SfxItemPropertyMap::getPropertyByName( const OUString & rName ) return aProp; } -bool SfxItemPropertyMap::hasPropertyByName( const OUString& rName ) const +bool SfxItemPropertyMap::hasPropertyByName( std::u16string_view rName ) const { SfxItemPropertyHashMap_t::const_iterator aIter = m_pImpl->find(rName); return aIter != m_pImpl->end(); diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index dbb264b51b77..e4e0ea629d15 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -306,7 +306,7 @@ static sal_Int32 lcl_PropName2TokenPos(std::u16string_view rPropertyName) return SAL_MAX_INT32; } -static sal_uInt16 GetFieldTypeMId( const OUString& rProperty, const SwFieldType& rTyp ) +static sal_uInt16 GetFieldTypeMId( std::u16string_view rProperty, const SwFieldType& rTyp ) { sal_uInt16 nId = lcl_GetPropMapIdForFieldType( rTyp.Which() ); const SfxItemPropertySet* pSet = aSwMapProvider.GetPropertySet( nId ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits