diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-01-02 17:44:11 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-01-16 11:03:02 +0100 |
commit | d9df090ea8e3b8715626d7ca226931897b59485a (patch) | |
tree | 3d45ce218a9e7f1fb68c476625e85093e65ba014 | |
parent | 62e0d000182d1f2dfba9ba5e41ddf1ce608eadf9 (diff) |
refactor out to limit scope: RES_PARATR_OUTLINELEVEL
Change-Id: Ia06a716f4ddcfd6884f5b9578d7c0b361d3f66f4
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index cd1127ce2551..c2179437c561 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1597,6 +1597,16 @@ void SwXStyle::SetPropertyValue<FN_UNO_NUM_RULES>(const SfxItemPropertySimpleEnt } o_rStyleBase.getNewBase()->SetNumRule(aSetRule); } +template<> +void SwXStyle::SetPropertyValue<RES_PARATR_OUTLINELEVEL>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase) +{ + if(!rValue.has<sal_Int16>()) + return; + const auto nLevel(rValue.get<sal_Int16>()); + if(0 <= nLevel && nLevel <= MAXLEVEL) + o_rStyleBase.getNewBase()->GetCollection()->SetAttrOutlineLevel(nLevel); +} + 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) { @@ -1644,11 +1654,7 @@ void SwXStyle::SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, const break; case RES_PARATR_OUTLINELEVEL: { - sal_Int16 nLevel = 0; - aValue >>= nLevel; - if( 0 <= nLevel && nLevel <= MAXLEVEL) - rBase.getNewBase()->GetCollection()->SetAttrOutlineLevel( nLevel ); - + SetPropertyValue<RES_PARATR_OUTLINELEVEL>(rEntry, rPropSet, rValue, rBase); bDone = true; break; } |