diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-01-02 18:06:15 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-01-16 11:03:03 +0100 |
commit | d632f64124af502147faa66b697fe1733f3aa4de (patch) | |
tree | c1b7fddf6dd3bb20aac67a4336b89d60ece4c2b9 /sw/source | |
parent | d9df090ea8e3b8715626d7ca226931897b59485a (diff) |
refactor out to limit scope: FN_UNO_FOLLOW_STYLE
Change-Id: I2f5f36fe9b9c7d1ee4289f2af268c25ebf8963d9
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index c2179437c561..f825542214cb 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1606,6 +1606,16 @@ void SwXStyle::SetPropertyValue<RES_PARATR_OUTLINELEVEL>(const SfxItemPropertySi if(0 <= nLevel && nLevel <= MAXLEVEL) o_rStyleBase.getNewBase()->GetCollection()->SetAttrOutlineLevel(nLevel); } +template<> +void SwXStyle::SetPropertyValue<FN_UNO_FOLLOW_STYLE>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + if(!rValue.has<OUString>()) + return; + const auto sValue(rValue.get<OUString>()); + OUString aString; + SwStyleNameMapper::FillUIName(sValue, aString, m_rEntry.m_aPoolId, true); + o_rStyleBase.getNewBase()->SetFollow(aString); +} void SwXStyle::SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& rBase) throw(beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException, std::exception) @@ -1653,23 +1663,13 @@ void SwXStyle::SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, const bDone = true; break; case RES_PARATR_OUTLINELEVEL: - { SetPropertyValue<RES_PARATR_OUTLINELEVEL>(rEntry, rPropSet, rValue, rBase); bDone = true; break; - } - case FN_UNO_FOLLOW_STYLE: - { - OUString sTmp; - aValue >>= sTmp; - OUString aString; - SwStyleNameMapper::FillUIName(sTmp, aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), true ) ; - rBase.getNewBase()->SetFollow( aString ); - + SetPropertyValue<FN_UNO_FOLLOW_STYLE>(rEntry, rPropSet, rValue, rBase); bDone = true; break; - } case RES_PAGEDESC : { if (MID_PAGEDESC_PAGEDESCNAME != nMemberId) |