tdf#164900 table text in different columns no longer lined up

Revert "tdf#161846 use unordered_map in SfxItemPropertyMap"

This reverts commit c39978f41dccbeb2e973c919a67d9b1d974f8f3c.

Change-Id: I26cadb32b426fd3b48179b67c677213a78b4999c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180903
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2025-01-29 15:26:07 +02:00
parent f747378c4d
commit a8aa8d76db
25 changed files with 74 additions and 69 deletions

View File

@ -209,7 +209,7 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertyMapEntry* pMap,
}
const SfxItemPropertyMapEntry* SvxItemPropertySet::getPropertyMapEntry(const OUString& rName) const
const SfxItemPropertyMapEntry* SvxItemPropertySet::getPropertyMapEntry(std::u16string_view rName) const
{
return m_aPropertyMap.getByName( rName );
}

View File

@ -1058,7 +1058,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;
@ -1364,9 +1364,9 @@ void SAL_CALL SvxUnoTextRangeBase::setAllPropertiesToDefault()
if( pForwarder )
{
for (auto const & rPair : mpPropSet->getPropertyMap().getPropertyEntries())
for (const SfxItemPropertyMapEntry* entry : mpPropSet->getPropertyMap().getPropertyEntries())
{
_setPropertyToDefault( pForwarder, rPair.second, -1 );
_setPropertyToDefault( pForwarder, entry, -1 );
}
}
}

View File

@ -51,7 +51,7 @@ public:
rtl::Reference< SfxItemPropertySetInfo > const & getPropertySetInfo() const;
const SfxItemPropertyMap& getPropertyMap() const { return m_aPropertyMap;}
const SfxItemPropertyMapEntry* getPropertyMapEntry(const OUString& rName) const;
const SfxItemPropertyMapEntry* getPropertyMapEntry(std::u16string_view rName) const;
};
struct SvxIDPropertyCombine

View File

@ -290,7 +290,7 @@ protected:
SAL_DLLPRIVATE css::beans::PropertyState _getPropertyState( const SfxItemPropertyMapEntry* pMap, sal_Int32 nPara = -1 );
/// @throws css::beans::UnknownPropertyException
/// @throws css::uno::RuntimeException
SAL_DLLPRIVATE css::beans::PropertyState _getPropertyState( const OUString& PropertyName, sal_Int32 nPara = -1 );
SAL_DLLPRIVATE css::beans::PropertyState _getPropertyState( std::u16string_view PropertyName, sal_Int32 nPara = -1 );
/// @throws css::beans::UnknownPropertyException
/// @throws css::uno::RuntimeException
SAL_DLLPRIVATE css::uno::Sequence< css::beans::PropertyState > _getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName, sal_Int32 nPara = -1 );

View File

@ -70,23 +70,29 @@ struct SfxItemPropertyMapEntry
}
};
struct SfxItemPropertyMapCompare
{
bool operator() ( const SfxItemPropertyMapEntry * lhs, const SfxItemPropertyMapEntry * rhs ) const
{
return lhs->aName < rhs->aName;
}
};
class SVL_DLLPUBLIC SfxItemPropertyMap
{
o3tl::sorted_vector< const SfxItemPropertyMapEntry*, SfxItemPropertyMapCompare > m_aMap;
mutable css::uno::Sequence< css::beans::Property > m_aPropSeq;
public:
SfxItemPropertyMap( std::span<const SfxItemPropertyMapEntry> pEntries );
SfxItemPropertyMap( const SfxItemPropertyMap& rSource );
~SfxItemPropertyMap();
const SfxItemPropertyMapEntry* getByName( const OUString & 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( const OUString & rName ) const;
bool hasPropertyByName( std::u16string_view rName ) const;
const std::unordered_map< OUString, const SfxItemPropertyMapEntry* >& getPropertyEntries() const { return m_aMap; }
private:
std::unordered_map< OUString, const SfxItemPropertyMapEntry* > m_aMap;
mutable css::uno::Sequence< css::beans::Property > m_aPropSeq;
const o3tl::sorted_vector< const SfxItemPropertyMapEntry*, SfxItemPropertyMapCompare >& getPropertyEntries() const { return m_aMap; }
};
class SfxItemPropertySetInfo;

View File

@ -308,7 +308,7 @@ Sequence< PropertyValue > SAL_CALL
std::vector<PropertyValue> aProps;
aProps.reserve(aPropertyMap.getPropertyEntries().size());
for(auto const & [aName, pEntry] : aPropertyMap.getPropertyEntries())
for(auto pEntry : aPropertyMap.getPropertyEntries())
aProps.push_back(PropertyValue(pEntry->aName, pEntry->nWID,
aConfig.GetProperty(pEntry->nWID),
css::beans::PropertyState_DIRECT_VALUE));

View File

@ -280,9 +280,8 @@ namespace
uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
SvxUnoPropertyMapProvider aMap;
const SfxItemPropertyMap& rPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
for (const auto & rPair : rPropertyMap.getPropertyEntries())
for (const auto pProp : rPropertyMap.getPropertyEntries())
{
const SfxItemPropertyMapEntry* pProp = rPair.second;
if ( xInfo->hasPropertyByName(pProp->aName) )
{
const SfxPoolItem* pItem = _rItemSet.GetItem(pProp->nWID);
@ -301,9 +300,8 @@ namespace
const uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
SvxUnoPropertyMapProvider aMap;
const SfxItemPropertyMap& rPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
for (const auto & rPair : rPropertyMap.getPropertyEntries())
for (const auto pProp : rPropertyMap.getPropertyEntries())
{
const SfxItemPropertyMapEntry* pProp = rPair.second;
const SfxPoolItem* pItem = nullptr;
if ( SfxItemState::SET == _rItemSet.GetItemState(pProp->nWID, true, &pItem) && xInfo->hasPropertyByName(pProp->aName) )
{

View File

@ -40,12 +40,12 @@ class ScDocOptionsHelper
public:
static bool setPropertyValue( ScDocOptions& rOptions,
const SfxItemPropertyMap& rPropMap,
const OUString& rPropertyName,
std::u16string_view aPropertyName,
const css::uno::Any& aValue );
static css::uno::Any getPropertyValue(
const ScDocOptions& rOptions,
const SfxItemPropertyMap& rPropMap,
const OUString& rPropertyName );
std::u16string_view PropertyName );
};
// empty doc object to supply only doc options

View File

@ -169,21 +169,21 @@ private:
OUString aStyleName;
SfxStyleSheetBase* pStyle_cached;
const SfxItemSet* GetStyleItemSet_Impl( const OUString& rPropName, const SfxItemPropertyMapEntry*& 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( 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 SfxItemPropertyMapEntry* pEntry,
const css::uno::Any* pValue );

View File

@ -30,7 +30,7 @@ using namespace com::sun::star;
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)
@ -103,7 +103,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 SfxItemPropertyMapEntry* pEntry = rPropMap.getByName( aPropertyName );

View File

@ -1161,7 +1161,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 SfxItemPropertyMapEntry*& rpResultEntry )
{
SfxStyleSheetBase* pStyle = GetStyle_Impl( true );
@ -1195,7 +1195,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;
@ -1279,7 +1279,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;
@ -1531,7 +1531,7 @@ void SAL_CALL ScStyleObj::setPropertyValue( const OUString& aPropertyName, const
setPropertyValue_Impl( aPropertyName, pEntry, &aValue );
}
void ScStyleObj::setPropertyValue_Impl( const OUString& rPropertyName, const SfxItemPropertyMapEntry* 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) )
@ -1872,7 +1872,7 @@ void ScStyleObj::setPropertyValue_Impl( const OUString& rPropertyName, const Sfx
static_cast<SfxStyleSheet*>(GetStyle_Impl())->Broadcast(SfxHint(SfxHintId::DataChanged));
}
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 );

View File

@ -1485,9 +1485,8 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, bool bCursor
const SfxPoolItem* pItem = nullptr;
if ( rNewSet.GetItemState( nWhich, true, &pItem ) == SfxItemState::SET && pItem )
{
for ( const auto & rPair : rMap.getPropertyEntries())
for ( const auto pEntry : rMap.getPropertyEntries())
{
const SfxItemPropertyMapEntry* pEntry = rPair.second;
if ( pEntry->nWID == nWhich )
{
css::uno::Any aVal;

View File

@ -138,7 +138,7 @@ public:
private:
/// @throws css::uno::RuntimeException
static const SfxItemPropertyMapEntry* getPropertyMapEntry( const OUString& rPropertyName );
static const SfxItemPropertyMapEntry* getPropertyMapEntry( std::u16string_view rPropertyName );
void setPropertyValue_Impl(const OUString& aPropertyName, const css::uno::Any& aValue);
css::uno::Any getPropertyValue_Impl(const OUString& PropertyName);

View File

@ -1492,7 +1492,7 @@ Any SAL_CALL SdStyleSheet::getPropertyDefault( const OUString& aPropertyName )
}
/** this is used because our property map is not sorted yet */
const SfxItemPropertyMapEntry* SdStyleSheet::getPropertyMapEntry( const OUString& rPropertyName )
const SfxItemPropertyMapEntry* SdStyleSheet::getPropertyMapEntry( std::u16string_view rPropertyName )
{
return GetStylePropertySet().getPropertyMapEntry(rPropertyName);
}

View File

@ -2831,9 +2831,8 @@ 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 & rPair : ImplGetPageBackgroundPropertySet()->getPropertyMap().getPropertyEntries() )
for( const auto pProp : ImplGetPageBackgroundPropertySet()->getPropertyMap().getPropertyEntries() )
{
const SfxItemPropertyMapEntry* pProp = rPair.second;
const OUString& rPropName = pProp->aName;
if( xSetInfo->hasPropertyByName( rPropName ) )
{

View File

@ -97,9 +97,8 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet )
if( maUsrAnys.AreThereOwnUsrAnys() )
{
for( const auto & rPair : mpPropSet->getPropertyMap().getPropertyEntries() )
for( const auto pProp : mpPropSet->getPropertyMap().getPropertyEntries() )
{
const SfxItemPropertyMapEntry* pProp = rPair.second;
uno::Any* pAny = maUsrAnys.GetUsrAnyForID( *pProp );
if( pAny )
{
@ -399,7 +398,7 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyDefault( const OUString& aProp
}
/** this is used because our property map is not sorted yet */
const SfxItemPropertyMapEntry* SdUnoPageBackground::getPropertyMapEntry( const OUString& rPropertyName ) const noexcept
const SfxItemPropertyMapEntry* SdUnoPageBackground::getPropertyMapEntry( std::u16string_view rPropertyName ) const noexcept
{
return mpPropSet->getPropertyMap().getByName(rPropertyName);
}

View File

@ -51,7 +51,7 @@ class SdUnoPageBackground final : public ::cppu::WeakImplHelper<
std::unique_ptr<SfxItemSet> mpSet;
SdrModel* mpDoc;
const SfxItemPropertyMapEntry* getPropertyMapEntry( const OUString& rPropertyName ) const noexcept;
const SfxItemPropertyMapEntry* getPropertyMapEntry( std::u16string_view rPropertyName ) const noexcept;
public:
SdUnoPageBackground( SdDrawDocument* pDoc = nullptr, const SfxItemSet* pSet = nullptr);
virtual ~SdUnoPageBackground() noexcept override;

View File

@ -41,7 +41,7 @@ SfxItemPropertyMap::SfxItemPropertyMap( std::span<const SfxItemPropertyMapEntry>
for (const auto & pEntry : pEntries)
{
assert(!pEntry.aName.isEmpty() && "empty name? might be something left an empty entry at the end of this array");
m_aMap.insert( { pEntry.aName, &pEntry } );
m_aMap.insert( &pEntry );
}
}
@ -51,12 +51,23 @@ SfxItemPropertyMap::~SfxItemPropertyMap()
{
}
const SfxItemPropertyMapEntry* SfxItemPropertyMap::getByName( const OUString & rName ) const
const SfxItemPropertyMapEntry* SfxItemPropertyMap::getByName( std::u16string_view rName ) const
{
auto it = m_aMap.find(rName);
if (it == m_aMap.end())
struct Compare
{
bool operator() ( const SfxItemPropertyMapEntry* lhs, std::u16string_view rhs ) const
{
return lhs->aName < rhs;
}
bool operator() ( std::u16string_view lhs, const SfxItemPropertyMapEntry* rhs ) const
{
return lhs < rhs->aName;
}
};
auto it = std::lower_bound(m_aMap.begin(), m_aMap.end(), rName, Compare());
if (it == m_aMap.end() || Compare()(rName, *it))
return nullptr;
return it->second;
return *it;
}
uno::Sequence<beans::Property> const & SfxItemPropertyMap::getProperties() const
@ -66,9 +77,8 @@ uno::Sequence<beans::Property> const & SfxItemPropertyMap::getProperties() const
m_aPropSeq.realloc( m_aMap.size() );
beans::Property* pPropArray = m_aPropSeq.getArray();
sal_uInt32 n = 0;
for( const auto & rPair : m_aMap )
for( const SfxItemPropertyMapEntry* pEntry : m_aMap )
{
const SfxItemPropertyMapEntry* pEntry = rPair.second;
pPropArray[n].Name = pEntry->aName;
pPropArray[n].Handle = pEntry->nWID;
pPropArray[n].Type = pEntry->aType;
@ -94,7 +104,7 @@ beans::Property SfxItemPropertyMap::getPropertyByName( const OUString& rName ) c
return aProp;
}
bool SfxItemPropertyMap::hasPropertyByName( const OUString & rName ) const
bool SfxItemPropertyMap::hasPropertyByName( std::u16string_view rName ) const
{
return getByName(rName) != nullptr;
}

View File

@ -523,9 +523,8 @@ static void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemProper
const SfxItemPropertyMap& rSrc = rPropSet.getPropertyMap();
for(const auto & rPair : rSrc.getPropertyEntries())
for(const SfxItemPropertyMapEntry* pSrcProp : rSrc.getPropertyEntries())
{
const SfxItemPropertyMapEntry* pSrcProp = rPair.second;
const sal_uInt16 nWID = pSrcProp->nWID;
if(SfxItemPool::IsWhich(nWID)
&& (nWID < OWN_ATTR_VALUE_START || nWID > OWN_ATTR_VALUE_END)
@ -533,9 +532,8 @@ static void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemProper
rSet.Put(rSet.GetPool()->GetUserOrPoolDefaultItem(nWID));
}
for(const auto & rPair : rSrc.getPropertyEntries())
for(const SfxItemPropertyMapEntry* pSrcProp : rSrc.getPropertyEntries())
{
const SfxItemPropertyMapEntry* pSrcProp = rPair.second;
if(pSrcProp->nWID)
{
uno::Any* pUsrAny = rAnys.GetUsrAnyForID(*pSrcProp);

View File

@ -184,7 +184,7 @@ namespace SwUnoCursorHelper
css::uno::Any GetPropertyValue(
SwPaM& rPaM,
const SfxItemPropertySet & rPropSet,
const OUString& rPropertyName);
std::u16string_view rPropertyName);
/// @throws css::beans::UnknownPropertyException
/// @throws css::uno::RuntimeException
css::uno::Sequence< css::beans::PropertyState > GetPropertyStates(
@ -205,14 +205,14 @@ namespace SwUnoCursorHelper
void SetPropertyToDefault(
SwPaM & rPaM,
const SfxItemPropertySet & rPropSet,
const OUString& rPropertyName);
std::u16string_view rPropertyName);
/// @throws css::beans::UnknownPropertyException
/// @throws css::lang::WrappedTargetException
/// @throws css::uno::RuntimeException
css::uno::Any GetPropertyDefault(
SwPaM const & rPaM,
const SfxItemPropertySet & rPropSet,
const OUString& rPropertyName);
std::u16string_view rPropertyName);
bool SetPageDesc(
const css::uno::Any& rValue,

View File

@ -1419,9 +1419,8 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl(
{
const SfxItemPropertyMap& rPropMap =
aSwMapProvider.GetPropertySet( PROPERTY_MAP_TEXT_CURSOR )->getPropertyMap();
for ( const auto & rPair : rPropMap.getPropertyEntries() )
for ( const auto pEntry : rPropMap.getPropertyEntries() )
{
const SfxItemPropertyMapEntry* pEntry = rPair.second;
const SfxPoolItem* pItem = pSet->GetItem( pEntry->nWID );
if ( pItem )
{
@ -1609,9 +1608,8 @@ void SwAccessibleParagraph::_getRunAttributesImpl(
const SfxItemPropertyMap& rPropMap =
aSwMapProvider.GetPropertySet( PROPERTY_MAP_TEXT_CURSOR )->getPropertyMap();
for ( const auto & rPair : rPropMap.getPropertyEntries() )
for ( const auto pEntry : rPropMap.getPropertyEntries() )
{
const SfxItemPropertyMapEntry* pEntry = rPair.second;
const SfxPoolItem* pItem( nullptr );
// #i82637# - Found character attributes, whose value equals the value of
// the corresponding default character attributes, are excluded.

View File

@ -304,9 +304,8 @@ static uno::Any GetParaListAutoFormat(SwTextNode const& rNode)
SfxItemPropertyMap const& rMap(rPropSet.getPropertyMap());
std::vector<beans::NamedValue> props;
// have to iterate the map, not the item set?
for (auto const & rPair : rMap.getPropertyEntries())
for (auto const pEntry : rMap.getPropertyEntries())
{
const SfxItemPropertyMapEntry* pEntry = rPair.second;
if (SfxItemPropertySet::getPropertyState(*pEntry, *pSet) == PropertyState_DIRECT_VALUE)
{
Any value;

View File

@ -309,7 +309,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 );

View File

@ -1871,7 +1871,7 @@ SwXTextCursor::setString(const OUString& aString)
uno::Any SwUnoCursorHelper::GetPropertyValue(
SwPaM& rPaM, const SfxItemPropertySet& rPropSet,
const OUString& rPropertyName)
std::u16string_view rPropertyName)
{
uno::Any aAny;
SfxItemPropertyMapEntry const*const pEntry =
@ -2163,7 +2163,7 @@ lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc,
void SwUnoCursorHelper::SetPropertyToDefault(
SwPaM& rPaM, const SfxItemPropertySet& rPropSet,
const OUString& rPropertyName)
std::u16string_view rPropertyName)
{
SwDoc& rDoc = rPaM.GetDoc();
SfxItemPropertyMapEntry const*const pEntry =
@ -2201,7 +2201,7 @@ void SwUnoCursorHelper::SetPropertyToDefault(
uno::Any SwUnoCursorHelper::GetPropertyDefault(
SwPaM const & rPaM, const SfxItemPropertySet& rPropSet,
const OUString& rPropertyName)
std::u16string_view rPropertyName)
{
SfxItemPropertyMapEntry const*const pEntry =
rPropSet.getPropertyMap().getByName(rPropertyName);

View File

@ -527,7 +527,7 @@ public:
: mrMap(rMap)
{ }
bool AllowsKey(const OUString& rName)
bool AllowsKey(std::u16string_view rName)
{
return mrMap.hasPropertyByName(rName);
}
@ -4397,9 +4397,8 @@ uno::Sequence< beans::PropertyValue > SwXAutoStyle::getProperties()
// TODO: Optimize - and fix! the old iteration filled each WhichId
// only once but there are more properties than WhichIds
for( const auto & rPair : rMap.getPropertyEntries() )
for( const auto pEntry : rMap.getPropertyEntries() )
{
const SfxItemPropertyMapEntry* pEntry = rPair.second;
if ( pEntry->nWID == nWID )
{
beans::PropertyValue aPropertyValue;