diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-03-13 00:13:19 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-03-17 23:54:43 +0100 |
commit | 5d26fe7e64bd58f7ec706aa3260382bef5b45a2f (patch) | |
tree | 2be0db731d3a083e6cea65673343b563971ee441 | |
parent | refactor out to limit scope: RES_PAGEDESC (diff) | |
download | core-5d26fe7e64bd58f7ec706aa3260382bef5b45a2f.tar.gz core-5d26fe7e64bd58f7ec706aa3260382bef5b45a2f.zip |
refactor out to limit scope: FN_UNO_IS_AUTO_UPDATE
Change-Id: If7b16373f7655afb4ca0527c181fcff555482a46
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 7647be9edc89..5f65c21ba6ac 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -2052,6 +2052,17 @@ uno::Any SwXStyle::GetStyleProperty<RES_PAGEDESC>(const SfxItemPropertySimpleEnt SwStyleNameMapper::FillProgName(pDesc->GetName(), aString, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, true); return uno::makeAny(aString); } +template<> +uno::Any SwXStyle::GetStyleProperty<FN_UNO_IS_AUTO_UPDATE>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet&, SwStyleBase_Impl& rBase) + throw(uno::RuntimeException, std::exception) +{ + switch(GetFamily()) + { + case SFX_STYLE_FAMILY_PARA : return uno::makeAny<bool>(rBase.getNewBase()->GetCollection()->IsAutoUpdateFormat()); + case SFX_STYLE_FAMILY_FRAME: return uno::makeAny<bool>(rBase.getNewBase()->GetFrameFormat()->IsAutoUpdateFormat()); + default: return uno::Any(); + } +} uno::Any SwXStyle::lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, SwStyleBase_Impl& rBase) throw(uno::RuntimeException, std::exception) @@ -2114,13 +2125,7 @@ uno::Any SwXStyle::lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry } case FN_UNO_IS_AUTO_UPDATE: { - bool bAuto = false; - if(SFX_STYLE_FAMILY_PARA == eFamily) - bAuto = rBase.getNewBase()->GetCollection()->IsAutoUpdateFormat(); - else if(SFX_STYLE_FAMILY_FRAME == eFamily) - bAuto = rBase.getNewBase()->GetFrameFormat()->IsAutoUpdateFormat(); - aRet <<= bAuto; - break; + return GetStyleProperty<FN_UNO_IS_AUTO_UPDATE>(rEntry, rPropSet, rBase); } case FN_UNO_DISPLAY_NAME: { |