diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-12-23 22:10:29 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-12-24 00:03:49 +0100 |
commit | 3a7a4b6c307a49f593c2929b278ad504bfe9b7c6 (patch) | |
tree | 6d17a97a9523593cde3d1d6ba30adea219198f0e /sw/source/core/unocore | |
parent | c1626aee4928c5a716cddf08d9e20779440e14ee (diff) |
refactor SwXStyle::ApplyDescriptorProperties
Change-Id: I219e75082c655a0895c75932863e596fcfccc656
Diffstat (limited to 'sw/source/core/unocore')
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 457f8047c2c8..d6d601843a26 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -989,6 +989,14 @@ public: } void ClearAllProperties( ) { m_vPropertyValues.clear(); } + void Apply(SwXStyle& rStyle) + { + for(auto pPropertyPair : m_vPropertyValues) + { + if(pPropertyPair.second.hasValue()) + rStyle.setPropertyValue(pPropertyPair.first, pPropertyPair.second); + } + } static void GetProperty(const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any& rAny ) { rAny = rxPropertySet->getPropertyValue( rPropertyName ); @@ -1300,22 +1308,12 @@ uno::Reference<beans::XPropertySetInfo> SwXStyle::getPropertySetInfo() throw( un return m_rEntry.m_xPSInfo; } -void SwXStyle::ApplyDescriptorProperties() +void SwXStyle::ApplyDescriptorProperties() { m_bIsDescriptor = false; m_xStyleData.clear(); m_xStyleFamily.clear(); - - const PropertyEntryVector_t& rPropertyVector = m_pPropertiesImpl->GetPropertyVector(); - PropertyEntryVector_t::const_iterator aIt = rPropertyVector.begin(); - while(aIt != rPropertyVector.end()) - { - const uno::Any* pAny(nullptr); - m_pPropertiesImpl->GetProperty(aIt->sName, pAny); - if(pAny->hasValue()) - setPropertyValue(aIt->sName, *pAny); - ++aIt; - } + m_pPropertiesImpl->Apply(*this); } class SwStyleBase_Impl |