diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-03-11 23:33:26 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-03-17 23:54:43 +0100 |
commit | 6abe9cfa924236b9915888470723fec612e1a16d (patch) | |
tree | 5d035ffe592c5de7016084e3306c67a123e30652 | |
parent | c21667c0f961a47cff7f477e3db30679586add98 (diff) |
refactor out to limit scope: RES_PARATR_OUTLINELEVEL
- also: OSL_ENSURE -> SAL_WARN_IF
Change-Id: I0754b886661b39baa65a2e5de671fd50b2c26d46
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 95744bf8601d..95184246dd38 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -2019,6 +2019,13 @@ uno::Any SwXStyle::GetStyleProperty<FN_UNO_NUM_RULES>(const SfxItemPropertySimpl uno::Reference<container::XIndexReplace> xRules(new SwXNumberingRules(*pRule, GetDoc())); return uno::makeAny<uno::Reference<container::XIndexReplace>>(xRules); } +template<> +uno::Any SwXStyle::GetStyleProperty<RES_PARATR_OUTLINELEVEL>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, SwStyleBase_Impl& rBase) + throw(uno::RuntimeException, std::exception) +{ + SAL_WARN_IF(SFX_STYLE_FAMILY_PARA == GetFamily(), "sw.uno", "only paras"); + return uno::makeAny<sal_Int16>(rBase.getNewBase()->GetCollection()->GetAttrOutlineLevel()); +} uno::Any SwXStyle::lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, SwStyleBase_Impl& rBase) throw(uno::RuntimeException, std::exception) @@ -2062,13 +2069,9 @@ uno::Any SwXStyle::lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry { return GetStyleProperty<FN_UNO_NUM_RULES>(rEntry, rPropSet, rBase); } - break; case RES_PARATR_OUTLINELEVEL: { - OSL_ENSURE( SFX_STYLE_FAMILY_PARA == eFamily, "only paras" ); - int nLevel = rBase.getNewBase()->GetCollection()->GetAttrOutlineLevel(); - aRet <<= static_cast<sal_Int16>( nLevel ); - break; + return GetStyleProperty<RES_PARATR_OUTLINELEVEL>(rEntry, rPropSet, rBase); } case FN_UNO_FOLLOW_STYLE: { |