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:
parent
f747378c4d
commit
a8aa8d76db
@ -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 );
|
return m_aPropertyMap.getByName( rName );
|
||||||
}
|
}
|
||||||
|
@ -1058,7 +1058,7 @@ beans::PropertyState SvxUnoTextRangeBase::_getPropertyState(const SfxItemPropert
|
|||||||
throw beans::UnknownPropertyException();
|
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;
|
SolarMutexGuard aGuard;
|
||||||
|
|
||||||
@ -1364,9 +1364,9 @@ void SAL_CALL SvxUnoTextRangeBase::setAllPropertiesToDefault()
|
|||||||
|
|
||||||
if( pForwarder )
|
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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ public:
|
|||||||
|
|
||||||
rtl::Reference< SfxItemPropertySetInfo > const & getPropertySetInfo() const;
|
rtl::Reference< SfxItemPropertySetInfo > const & getPropertySetInfo() const;
|
||||||
const SfxItemPropertyMap& getPropertyMap() const { return m_aPropertyMap;}
|
const SfxItemPropertyMap& getPropertyMap() const { return m_aPropertyMap;}
|
||||||
const SfxItemPropertyMapEntry* getPropertyMapEntry(const OUString& rName) const;
|
const SfxItemPropertyMapEntry* getPropertyMapEntry(std::u16string_view rName) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SvxIDPropertyCombine
|
struct SvxIDPropertyCombine
|
||||||
|
@ -290,7 +290,7 @@ protected:
|
|||||||
SAL_DLLPRIVATE css::beans::PropertyState _getPropertyState( const SfxItemPropertyMapEntry* pMap, sal_Int32 nPara = -1 );
|
SAL_DLLPRIVATE css::beans::PropertyState _getPropertyState( const SfxItemPropertyMapEntry* pMap, sal_Int32 nPara = -1 );
|
||||||
/// @throws css::beans::UnknownPropertyException
|
/// @throws css::beans::UnknownPropertyException
|
||||||
/// @throws css::uno::RuntimeException
|
/// @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::beans::UnknownPropertyException
|
||||||
/// @throws css::uno::RuntimeException
|
/// @throws css::uno::RuntimeException
|
||||||
SAL_DLLPRIVATE css::uno::Sequence< css::beans::PropertyState > _getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName, sal_Int32 nPara = -1 );
|
SAL_DLLPRIVATE css::uno::Sequence< css::beans::PropertyState > _getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName, sal_Int32 nPara = -1 );
|
||||||
|
@ -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
|
class SVL_DLLPUBLIC SfxItemPropertyMap
|
||||||
{
|
{
|
||||||
|
o3tl::sorted_vector< const SfxItemPropertyMapEntry*, SfxItemPropertyMapCompare > m_aMap;
|
||||||
|
mutable css::uno::Sequence< css::beans::Property > m_aPropSeq;
|
||||||
public:
|
public:
|
||||||
SfxItemPropertyMap( std::span<const SfxItemPropertyMapEntry> pEntries );
|
SfxItemPropertyMap( std::span<const SfxItemPropertyMapEntry> pEntries );
|
||||||
SfxItemPropertyMap( const SfxItemPropertyMap& rSource );
|
SfxItemPropertyMap( const SfxItemPropertyMap& rSource );
|
||||||
~SfxItemPropertyMap();
|
~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;
|
css::uno::Sequence< css::beans::Property > const & getProperties() const;
|
||||||
/// @throws css::beans::UnknownPropertyException
|
/// @throws css::beans::UnknownPropertyException
|
||||||
css::beans::Property getPropertyByName( const OUString & rName ) const;
|
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; }
|
const o3tl::sorted_vector< const SfxItemPropertyMapEntry*, SfxItemPropertyMapCompare >& getPropertyEntries() const { return m_aMap; }
|
||||||
private:
|
|
||||||
std::unordered_map< OUString, const SfxItemPropertyMapEntry* > m_aMap;
|
|
||||||
mutable css::uno::Sequence< css::beans::Property > m_aPropSeq;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class SfxItemPropertySetInfo;
|
class SfxItemPropertySetInfo;
|
||||||
|
@ -308,7 +308,7 @@ Sequence< PropertyValue > SAL_CALL
|
|||||||
|
|
||||||
std::vector<PropertyValue> aProps;
|
std::vector<PropertyValue> aProps;
|
||||||
aProps.reserve(aPropertyMap.getPropertyEntries().size());
|
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,
|
aProps.push_back(PropertyValue(pEntry->aName, pEntry->nWID,
|
||||||
aConfig.GetProperty(pEntry->nWID),
|
aConfig.GetProperty(pEntry->nWID),
|
||||||
css::beans::PropertyState_DIRECT_VALUE));
|
css::beans::PropertyState_DIRECT_VALUE));
|
||||||
|
@ -280,9 +280,8 @@ namespace
|
|||||||
uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
|
uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
|
||||||
SvxUnoPropertyMapProvider aMap;
|
SvxUnoPropertyMapProvider aMap;
|
||||||
const SfxItemPropertyMap& rPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
|
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) )
|
if ( xInfo->hasPropertyByName(pProp->aName) )
|
||||||
{
|
{
|
||||||
const SfxPoolItem* pItem = _rItemSet.GetItem(pProp->nWID);
|
const SfxPoolItem* pItem = _rItemSet.GetItem(pProp->nWID);
|
||||||
@ -301,9 +300,8 @@ namespace
|
|||||||
const uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
|
const uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
|
||||||
SvxUnoPropertyMapProvider aMap;
|
SvxUnoPropertyMapProvider aMap;
|
||||||
const SfxItemPropertyMap& rPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
|
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;
|
const SfxPoolItem* pItem = nullptr;
|
||||||
if ( SfxItemState::SET == _rItemSet.GetItemState(pProp->nWID, true, &pItem) && xInfo->hasPropertyByName(pProp->aName) )
|
if ( SfxItemState::SET == _rItemSet.GetItemState(pProp->nWID, true, &pItem) && xInfo->hasPropertyByName(pProp->aName) )
|
||||||
{
|
{
|
||||||
|
@ -40,12 +40,12 @@ class ScDocOptionsHelper
|
|||||||
public:
|
public:
|
||||||
static bool setPropertyValue( ScDocOptions& rOptions,
|
static bool setPropertyValue( ScDocOptions& rOptions,
|
||||||
const SfxItemPropertyMap& rPropMap,
|
const SfxItemPropertyMap& rPropMap,
|
||||||
const OUString& rPropertyName,
|
std::u16string_view aPropertyName,
|
||||||
const css::uno::Any& aValue );
|
const css::uno::Any& aValue );
|
||||||
static css::uno::Any getPropertyValue(
|
static css::uno::Any getPropertyValue(
|
||||||
const ScDocOptions& rOptions,
|
const ScDocOptions& rOptions,
|
||||||
const SfxItemPropertyMap& rPropMap,
|
const SfxItemPropertyMap& rPropMap,
|
||||||
const OUString& rPropertyName );
|
std::u16string_view PropertyName );
|
||||||
};
|
};
|
||||||
|
|
||||||
// empty doc object to supply only doc options
|
// empty doc object to supply only doc options
|
||||||
|
@ -169,21 +169,21 @@ private:
|
|||||||
OUString aStyleName;
|
OUString aStyleName;
|
||||||
SfxStyleSheetBase* pStyle_cached;
|
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::beans::UnknownPropertyException
|
||||||
/// @throws css::uno::RuntimeException
|
/// @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::beans::UnknownPropertyException
|
||||||
/// @throws css::lang::WrappedTargetException
|
/// @throws css::lang::WrappedTargetException
|
||||||
/// @throws css::uno::RuntimeException
|
/// @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::beans::UnknownPropertyException
|
||||||
/// @throws css::lang::WrappedTargetException
|
/// @throws css::lang::WrappedTargetException
|
||||||
/// @throws css::uno::RuntimeException
|
/// @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::lang::IllegalArgumentException
|
||||||
/// @throws css::uno::RuntimeException
|
/// @throws css::uno::RuntimeException
|
||||||
void setPropertyValue_Impl( const OUString& rPropertyName,
|
void setPropertyValue_Impl( std::u16string_view rPropertyName,
|
||||||
const SfxItemPropertyMapEntry* pEntry,
|
const SfxItemPropertyMapEntry* pEntry,
|
||||||
const css::uno::Any* pValue );
|
const css::uno::Any* pValue );
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ using namespace com::sun::star;
|
|||||||
|
|
||||||
bool ScDocOptionsHelper::setPropertyValue( ScDocOptions& rOptions,
|
bool ScDocOptionsHelper::setPropertyValue( ScDocOptions& rOptions,
|
||||||
const SfxItemPropertyMap& rPropMap,
|
const SfxItemPropertyMap& rPropMap,
|
||||||
const OUString& aPropertyName, const uno::Any& aValue )
|
std::u16string_view aPropertyName, const uno::Any& aValue )
|
||||||
{
|
{
|
||||||
//! use map (with new identifiers)
|
//! use map (with new identifiers)
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ bool ScDocOptionsHelper::setPropertyValue( ScDocOptions& rOptions,
|
|||||||
uno::Any ScDocOptionsHelper::getPropertyValue(
|
uno::Any ScDocOptionsHelper::getPropertyValue(
|
||||||
const ScDocOptions& rOptions,
|
const ScDocOptions& rOptions,
|
||||||
const SfxItemPropertyMap& rPropMap,
|
const SfxItemPropertyMap& rPropMap,
|
||||||
const OUString& aPropertyName )
|
std::u16string_view aPropertyName )
|
||||||
{
|
{
|
||||||
uno::Any aRet;
|
uno::Any aRet;
|
||||||
const SfxItemPropertyMapEntry* pEntry = rPropMap.getByName( aPropertyName );
|
const SfxItemPropertyMapEntry* pEntry = rPropMap.getByName( aPropertyName );
|
||||||
|
@ -1161,7 +1161,7 @@ uno::Reference<container::XIndexReplace> ScStyleObj::CreateEmptyNumberingRules()
|
|||||||
|
|
||||||
// beans::XPropertyState
|
// beans::XPropertyState
|
||||||
|
|
||||||
const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( const OUString& rPropName,
|
const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( std::u16string_view rPropName,
|
||||||
const SfxItemPropertyMapEntry*& rpResultEntry )
|
const SfxItemPropertyMapEntry*& rpResultEntry )
|
||||||
{
|
{
|
||||||
SfxStyleSheetBase* pStyle = GetStyle_Impl( true );
|
SfxStyleSheetBase* pStyle = GetStyle_Impl( true );
|
||||||
@ -1195,7 +1195,7 @@ const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( const OUString& rPropName,
|
|||||||
return nullptr;
|
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;
|
beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE;
|
||||||
|
|
||||||
@ -1279,7 +1279,7 @@ void SAL_CALL ScStyleObj::setPropertyToDefault( const OUString& aPropertyName )
|
|||||||
setPropertyValue_Impl( aPropertyName, pEntry, nullptr );
|
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;
|
uno::Any aAny;
|
||||||
|
|
||||||
@ -1531,7 +1531,7 @@ void SAL_CALL ScStyleObj::setPropertyValue( const OUString& aPropertyName, const
|
|||||||
setPropertyValue_Impl( aPropertyName, pEntry, &aValue );
|
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 );
|
SfxStyleSheetBase* pStyle = GetStyle_Impl( true );
|
||||||
if ( !(pStyle && pEntry) )
|
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));
|
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;
|
uno::Any aAny;
|
||||||
SfxStyleSheetBase* pStyle = GetStyle_Impl( true );
|
SfxStyleSheetBase* pStyle = GetStyle_Impl( true );
|
||||||
|
@ -1485,9 +1485,8 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, bool bCursor
|
|||||||
const SfxPoolItem* pItem = nullptr;
|
const SfxPoolItem* pItem = nullptr;
|
||||||
if ( rNewSet.GetItemState( nWhich, true, &pItem ) == SfxItemState::SET && pItem )
|
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 )
|
if ( pEntry->nWID == nWhich )
|
||||||
{
|
{
|
||||||
css::uno::Any aVal;
|
css::uno::Any aVal;
|
||||||
|
@ -138,7 +138,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/// @throws css::uno::RuntimeException
|
/// @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);
|
void setPropertyValue_Impl(const OUString& aPropertyName, const css::uno::Any& aValue);
|
||||||
css::uno::Any getPropertyValue_Impl(const OUString& PropertyName);
|
css::uno::Any getPropertyValue_Impl(const OUString& PropertyName);
|
||||||
|
@ -1492,7 +1492,7 @@ Any SAL_CALL SdStyleSheet::getPropertyDefault( const OUString& aPropertyName )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** this is used because our property map is not sorted yet */
|
/** 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);
|
return GetStylePropertySet().getPropertyMapEntry(rPropertyName);
|
||||||
}
|
}
|
||||||
|
@ -2831,9 +2831,8 @@ void SdMasterPage::setBackground( const Any& rValue )
|
|||||||
Reference< beans::XPropertySetInfo > xSetInfo( xInputSet->getPropertySetInfo(), UNO_SET_THROW );
|
Reference< beans::XPropertySetInfo > xSetInfo( xInputSet->getPropertySetInfo(), UNO_SET_THROW );
|
||||||
Reference< beans::XPropertyState > xSetStates( xInputSet, UNO_QUERY );
|
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;
|
const OUString& rPropName = pProp->aName;
|
||||||
if( xSetInfo->hasPropertyByName( rPropName ) )
|
if( xSetInfo->hasPropertyByName( rPropName ) )
|
||||||
{
|
{
|
||||||
|
@ -97,9 +97,8 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet )
|
|||||||
|
|
||||||
if( maUsrAnys.AreThereOwnUsrAnys() )
|
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 );
|
uno::Any* pAny = maUsrAnys.GetUsrAnyForID( *pProp );
|
||||||
if( pAny )
|
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 */
|
/** 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);
|
return mpPropSet->getPropertyMap().getByName(rPropertyName);
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ class SdUnoPageBackground final : public ::cppu::WeakImplHelper<
|
|||||||
std::unique_ptr<SfxItemSet> mpSet;
|
std::unique_ptr<SfxItemSet> mpSet;
|
||||||
SdrModel* mpDoc;
|
SdrModel* mpDoc;
|
||||||
|
|
||||||
const SfxItemPropertyMapEntry* getPropertyMapEntry( const OUString& rPropertyName ) const noexcept;
|
const SfxItemPropertyMapEntry* getPropertyMapEntry( std::u16string_view rPropertyName ) const noexcept;
|
||||||
public:
|
public:
|
||||||
SdUnoPageBackground( SdDrawDocument* pDoc = nullptr, const SfxItemSet* pSet = nullptr);
|
SdUnoPageBackground( SdDrawDocument* pDoc = nullptr, const SfxItemSet* pSet = nullptr);
|
||||||
virtual ~SdUnoPageBackground() noexcept override;
|
virtual ~SdUnoPageBackground() noexcept override;
|
||||||
|
@ -41,7 +41,7 @@ SfxItemPropertyMap::SfxItemPropertyMap( std::span<const SfxItemPropertyMapEntry>
|
|||||||
for (const auto & pEntry : pEntries)
|
for (const auto & pEntry : pEntries)
|
||||||
{
|
{
|
||||||
assert(!pEntry.aName.isEmpty() && "empty name? might be something left an empty entry at the end of this array");
|
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);
|
struct Compare
|
||||||
if (it == m_aMap.end())
|
{
|
||||||
|
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 nullptr;
|
||||||
return it->second;
|
return *it;
|
||||||
}
|
}
|
||||||
|
|
||||||
uno::Sequence<beans::Property> const & SfxItemPropertyMap::getProperties() const
|
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() );
|
m_aPropSeq.realloc( m_aMap.size() );
|
||||||
beans::Property* pPropArray = m_aPropSeq.getArray();
|
beans::Property* pPropArray = m_aPropSeq.getArray();
|
||||||
sal_uInt32 n = 0;
|
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].Name = pEntry->aName;
|
||||||
pPropArray[n].Handle = pEntry->nWID;
|
pPropArray[n].Handle = pEntry->nWID;
|
||||||
pPropArray[n].Type = pEntry->aType;
|
pPropArray[n].Type = pEntry->aType;
|
||||||
@ -94,7 +104,7 @@ beans::Property SfxItemPropertyMap::getPropertyByName( const OUString& rName ) c
|
|||||||
return aProp;
|
return aProp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SfxItemPropertyMap::hasPropertyByName( const OUString & rName ) const
|
bool SfxItemPropertyMap::hasPropertyByName( std::u16string_view rName ) const
|
||||||
{
|
{
|
||||||
return getByName(rName) != nullptr;
|
return getByName(rName) != nullptr;
|
||||||
}
|
}
|
||||||
|
@ -523,9 +523,8 @@ static void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemProper
|
|||||||
|
|
||||||
const SfxItemPropertyMap& rSrc = rPropSet.getPropertyMap();
|
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;
|
const sal_uInt16 nWID = pSrcProp->nWID;
|
||||||
if(SfxItemPool::IsWhich(nWID)
|
if(SfxItemPool::IsWhich(nWID)
|
||||||
&& (nWID < OWN_ATTR_VALUE_START || nWID > OWN_ATTR_VALUE_END)
|
&& (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));
|
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)
|
if(pSrcProp->nWID)
|
||||||
{
|
{
|
||||||
uno::Any* pUsrAny = rAnys.GetUsrAnyForID(*pSrcProp);
|
uno::Any* pUsrAny = rAnys.GetUsrAnyForID(*pSrcProp);
|
||||||
|
@ -184,7 +184,7 @@ namespace SwUnoCursorHelper
|
|||||||
css::uno::Any GetPropertyValue(
|
css::uno::Any GetPropertyValue(
|
||||||
SwPaM& rPaM,
|
SwPaM& rPaM,
|
||||||
const SfxItemPropertySet & rPropSet,
|
const SfxItemPropertySet & rPropSet,
|
||||||
const OUString& rPropertyName);
|
std::u16string_view rPropertyName);
|
||||||
/// @throws css::beans::UnknownPropertyException
|
/// @throws css::beans::UnknownPropertyException
|
||||||
/// @throws css::uno::RuntimeException
|
/// @throws css::uno::RuntimeException
|
||||||
css::uno::Sequence< css::beans::PropertyState > GetPropertyStates(
|
css::uno::Sequence< css::beans::PropertyState > GetPropertyStates(
|
||||||
@ -205,14 +205,14 @@ namespace SwUnoCursorHelper
|
|||||||
void SetPropertyToDefault(
|
void SetPropertyToDefault(
|
||||||
SwPaM & rPaM,
|
SwPaM & rPaM,
|
||||||
const SfxItemPropertySet & rPropSet,
|
const SfxItemPropertySet & rPropSet,
|
||||||
const OUString& rPropertyName);
|
std::u16string_view rPropertyName);
|
||||||
/// @throws css::beans::UnknownPropertyException
|
/// @throws css::beans::UnknownPropertyException
|
||||||
/// @throws css::lang::WrappedTargetException
|
/// @throws css::lang::WrappedTargetException
|
||||||
/// @throws css::uno::RuntimeException
|
/// @throws css::uno::RuntimeException
|
||||||
css::uno::Any GetPropertyDefault(
|
css::uno::Any GetPropertyDefault(
|
||||||
SwPaM const & rPaM,
|
SwPaM const & rPaM,
|
||||||
const SfxItemPropertySet & rPropSet,
|
const SfxItemPropertySet & rPropSet,
|
||||||
const OUString& rPropertyName);
|
std::u16string_view rPropertyName);
|
||||||
|
|
||||||
bool SetPageDesc(
|
bool SetPageDesc(
|
||||||
const css::uno::Any& rValue,
|
const css::uno::Any& rValue,
|
||||||
|
@ -1419,9 +1419,8 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl(
|
|||||||
{
|
{
|
||||||
const SfxItemPropertyMap& rPropMap =
|
const SfxItemPropertyMap& rPropMap =
|
||||||
aSwMapProvider.GetPropertySet( PROPERTY_MAP_TEXT_CURSOR )->getPropertyMap();
|
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 );
|
const SfxPoolItem* pItem = pSet->GetItem( pEntry->nWID );
|
||||||
if ( pItem )
|
if ( pItem )
|
||||||
{
|
{
|
||||||
@ -1609,9 +1608,8 @@ void SwAccessibleParagraph::_getRunAttributesImpl(
|
|||||||
|
|
||||||
const SfxItemPropertyMap& rPropMap =
|
const SfxItemPropertyMap& rPropMap =
|
||||||
aSwMapProvider.GetPropertySet( PROPERTY_MAP_TEXT_CURSOR )->getPropertyMap();
|
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 );
|
const SfxPoolItem* pItem( nullptr );
|
||||||
// #i82637# - Found character attributes, whose value equals the value of
|
// #i82637# - Found character attributes, whose value equals the value of
|
||||||
// the corresponding default character attributes, are excluded.
|
// the corresponding default character attributes, are excluded.
|
||||||
|
@ -304,9 +304,8 @@ static uno::Any GetParaListAutoFormat(SwTextNode const& rNode)
|
|||||||
SfxItemPropertyMap const& rMap(rPropSet.getPropertyMap());
|
SfxItemPropertyMap const& rMap(rPropSet.getPropertyMap());
|
||||||
std::vector<beans::NamedValue> props;
|
std::vector<beans::NamedValue> props;
|
||||||
// have to iterate the map, not the item set?
|
// 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)
|
if (SfxItemPropertySet::getPropertyState(*pEntry, *pSet) == PropertyState_DIRECT_VALUE)
|
||||||
{
|
{
|
||||||
Any value;
|
Any value;
|
||||||
|
@ -309,7 +309,7 @@ static sal_Int32 lcl_PropName2TokenPos(std::u16string_view rPropertyName)
|
|||||||
return SAL_MAX_INT32;
|
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() );
|
sal_uInt16 nId = lcl_GetPropMapIdForFieldType( rTyp.Which() );
|
||||||
const SfxItemPropertySet* pSet = aSwMapProvider.GetPropertySet( nId );
|
const SfxItemPropertySet* pSet = aSwMapProvider.GetPropertySet( nId );
|
||||||
|
@ -1871,7 +1871,7 @@ SwXTextCursor::setString(const OUString& aString)
|
|||||||
|
|
||||||
uno::Any SwUnoCursorHelper::GetPropertyValue(
|
uno::Any SwUnoCursorHelper::GetPropertyValue(
|
||||||
SwPaM& rPaM, const SfxItemPropertySet& rPropSet,
|
SwPaM& rPaM, const SfxItemPropertySet& rPropSet,
|
||||||
const OUString& rPropertyName)
|
std::u16string_view rPropertyName)
|
||||||
{
|
{
|
||||||
uno::Any aAny;
|
uno::Any aAny;
|
||||||
SfxItemPropertyMapEntry const*const pEntry =
|
SfxItemPropertyMapEntry const*const pEntry =
|
||||||
@ -2163,7 +2163,7 @@ lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc,
|
|||||||
|
|
||||||
void SwUnoCursorHelper::SetPropertyToDefault(
|
void SwUnoCursorHelper::SetPropertyToDefault(
|
||||||
SwPaM& rPaM, const SfxItemPropertySet& rPropSet,
|
SwPaM& rPaM, const SfxItemPropertySet& rPropSet,
|
||||||
const OUString& rPropertyName)
|
std::u16string_view rPropertyName)
|
||||||
{
|
{
|
||||||
SwDoc& rDoc = rPaM.GetDoc();
|
SwDoc& rDoc = rPaM.GetDoc();
|
||||||
SfxItemPropertyMapEntry const*const pEntry =
|
SfxItemPropertyMapEntry const*const pEntry =
|
||||||
@ -2201,7 +2201,7 @@ void SwUnoCursorHelper::SetPropertyToDefault(
|
|||||||
|
|
||||||
uno::Any SwUnoCursorHelper::GetPropertyDefault(
|
uno::Any SwUnoCursorHelper::GetPropertyDefault(
|
||||||
SwPaM const & rPaM, const SfxItemPropertySet& rPropSet,
|
SwPaM const & rPaM, const SfxItemPropertySet& rPropSet,
|
||||||
const OUString& rPropertyName)
|
std::u16string_view rPropertyName)
|
||||||
{
|
{
|
||||||
SfxItemPropertyMapEntry const*const pEntry =
|
SfxItemPropertyMapEntry const*const pEntry =
|
||||||
rPropSet.getPropertyMap().getByName(rPropertyName);
|
rPropSet.getPropertyMap().getByName(rPropertyName);
|
||||||
|
@ -527,7 +527,7 @@ public:
|
|||||||
: mrMap(rMap)
|
: mrMap(rMap)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
bool AllowsKey(const OUString& rName)
|
bool AllowsKey(std::u16string_view rName)
|
||||||
{
|
{
|
||||||
return mrMap.hasPropertyByName(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
|
// TODO: Optimize - and fix! the old iteration filled each WhichId
|
||||||
// only once but there are more properties than WhichIds
|
// 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 )
|
if ( pEntry->nWID == nWID )
|
||||||
{
|
{
|
||||||
beans::PropertyValue aPropertyValue;
|
beans::PropertyValue aPropertyValue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user