summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-01-14 21:22:52 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-01-15 21:42:47 +0100
commit911ecc33046b82cbf3053ab89c9c263db1d7396d (patch)
tree60d755a5e9a0d15cb84f7031b87014748395e0e7
parentd409cb6e96d26c34b299f651989794f15a64a75d (diff)
refactor out to limit scope: RES_PARATR_NUMRULE
Change-Id: Iecea747a436de1afe529e024974006a256aa5f5a
-rw-r--r--sw/source/core/unocore/unostyle.cxx36
1 files changed, 19 insertions, 17 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 328b55f0f611..f36ce71b3756 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1790,6 +1790,24 @@ void SwXStyle::SetPropertyValue<RES_PARATR_DROP>(const SfxItemPropertySimpleEntr
pDrop->SetCharFormat(pStyle->GetCharFormat());
rStyleSet.Put(*pDrop);
}
+template<>
+void SwXStyle::SetPropertyValue<RES_PARATR_NUMRULE>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase)
+{
+ uno::Any aValue(rValue);
+ lcl_TranslateMetric(rEntry, m_pDoc, aValue);
+ lcl_SetDefaultWay(rEntry, rPropSet, aValue, o_rStyleBase);
+ // --> OD 2006-10-18 #i70223#
+ if(SFX_STYLE_FAMILY_PARA == m_rEntry.m_eFamily &&
+ o_rStyleBase.getNewBase().is() && o_rStyleBase.getNewBase()->GetCollection() &&
+ //rBase.getNewBase()->GetCollection()->GetOutlineLevel() < MAXLEVEL /* assigned to list level of outline style */) //#outline level,removed by zhaojianwei
+ o_rStyleBase.getNewBase()->GetCollection()->IsAssignedToListLevelOfOutlineStyle()) ////<-end,add by zhaojianwei
+ {
+ OUString sNewNumberingRuleName;
+ aValue >>= sNewNumberingRuleName;
+ if(sNewNumberingRuleName.isEmpty() || sNewNumberingRuleName != m_pDoc->GetOutlineNumRule()->GetName())
+ o_rStyleBase.getNewBase()->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle();
+ }
+}
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)
{
@@ -1880,25 +1898,9 @@ void SwXStyle::SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, const
bDone = true;
break;
case RES_PARATR_NUMRULE:
- {
- lcl_SetDefaultWay(rEntry, rPropSet, aValue, rBase);
- // --> OD 2006-10-18 #i70223#
- if ( SFX_STYLE_FAMILY_PARA == eFamily &&
- rBase.getNewBase().is() && rBase.getNewBase()->GetCollection() &&
- //rBase.getNewBase()->GetCollection()->GetOutlineLevel() < MAXLEVEL /* assigned to list level of outline style */) //#outline level,removed by zhaojianwei
- rBase.getNewBase()->GetCollection()->IsAssignedToListLevelOfOutlineStyle() ) ////<-end,add by zhaojianwei
- {
- OUString sNewNumberingRuleName;
- aValue >>= sNewNumberingRuleName;
- if ( sNewNumberingRuleName.isEmpty() ||
- sNewNumberingRuleName != pDoc->GetOutlineNumRule()->GetName() )
- {
- rBase.getNewBase()->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle();
- }
- }
+ SetPropertyValue<RES_PARATR_NUMRULE>(rEntry, rPropSet, rValue, rBase);
bDone = true;
break;
- }
default:
{
// nothing to do