summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-01-14 19:36:36 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-01-15 21:42:46 +0100
commit29a9ce2c18b73d2f3a04d44f215846327ea72c85 (patch)
treeb388fc71b6216109391f9951d3e280a2edc08b05
parent85613a7184487339f49b654f390d30b306f2fc58 (diff)
refactor to limit scope: SID_SWREGISTER_COLLECTION
Change-Id: I67c259f4da968b9decc4ac95195864a28283d1b5
-rw-r--r--sw/source/core/unocore/unostyle.cxx23
1 files changed, 14 insertions, 9 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 9bcb47057641..ece91c4f76e9 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1729,6 +1729,19 @@ void SwXStyle::SetPropertyValue<FN_UNO_CATEGORY>(const SfxItemPropertySimpleEntr
throw lang::IllegalArgumentException();
o_rStyleBase.getNewBase()->SetMask( pUnoToCoreIt->second|SFXSTYLEBIT_USERDEF );
}
+template<>
+void SwXStyle::SetPropertyValue<SID_SWREGISTER_COLLECTION>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase)
+{
+ OUString sName;
+ rValue >>= sName;
+ SwRegisterItem aReg(!sName.isEmpty());
+ aReg.SetWhich(SID_SWREGISTER_MODE);
+ o_rStyleBase.GetItemSet().Put(aReg);
+ OUString aString;
+ SwStyleNameMapper::FillUIName(sName, aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true);
+ o_rStyleBase.GetItemSet().Put(SfxStringItem(SID_SWREGISTER_COLLECTION, 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)
{
@@ -1807,15 +1820,7 @@ void SwXStyle::SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, const
}
case SID_SWREGISTER_COLLECTION:
{
- OUString sName;
- aValue >>= sName;
- SwRegisterItem aReg( !sName.isEmpty() );
- aReg.SetWhich(SID_SWREGISTER_MODE);
- rBase.GetItemSet().Put(aReg);
- OUString aString;
- SwStyleNameMapper::FillUIName(sName, aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true);
-
- rBase.GetItemSet().Put(SfxStringItem(SID_SWREGISTER_COLLECTION, aString ) );
+ SetPropertyValue<SID_SWREGISTER_COLLECTION>(rEntry, rPropSet, rValue, rBase);
bDone = true;
break;
}