diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-03-10 23:36:43 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-03-17 23:54:43 +0100 |
commit | 682d8cd9d33b843d7b76293de0816729b801e25d (patch) | |
tree | f55441d443260b556e0b19bfaa2f6078c62bbf47 | |
parent | 631f7c410495a7a07d11f0bb727b5d9d2bc4b9e4 (diff) |
refactor out to limit scope: GetStyleProperty<FN_UNO_HIDDEN>
Change-Id: I8efd3ae69eb3c7cd059907e05e6884194459034c
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index bb2c5b9b4cca..15d5086810d4 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1973,6 +1973,16 @@ uno::Any SwXStyle::GetStyleProperty<FN_UNO_IS_PHYSICAL>(const SfxItemPropertySim bPhys = false; return uno::makeAny<bool>(bPhys); } +template<> +uno::Any SwXStyle::GetStyleProperty<FN_UNO_HIDDEN>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, SwStyleBase_Impl&) + throw(uno::RuntimeException, std::exception) +{ + SfxStyleSheetBase* pBase(GetStyleSheetBase()); + if(!pBase) + return uno::makeAny(false); + rtl::Reference<SwDocStyleSheet> xBase(new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(pBase))); + return uno::makeAny(xBase->IsHidden()); +} uno::Any SwXStyle::lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, SwStyleBase_Impl& rBase) throw(uno::RuntimeException, std::exception) { @@ -1987,13 +1997,7 @@ uno::Any SwXStyle::lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry } else if (FN_UNO_HIDDEN == rEntry.nWID) { - bool bHidden = false; - if(pBase) - { - rtl::Reference< SwDocStyleSheet > xBase( new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(pBase)) ); - bHidden = xBase->IsHidden(); - } - aRet <<= bHidden; + return GetStyleProperty<FN_UNO_HIDDEN>(rEntry, rPropSet, rBase); } else if (FN_UNO_STYLE_INTEROP_GRAB_BAG == rEntry.nWID) { |