diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-11-27 13:46:31 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-11-27 17:44:31 +0100 |
commit | 0168313e95c7c00fb92e30088c8a12353e82c2c2 (patch) | |
tree | 0f78080dc4be3ab7ca166b0b9791568eef13041c /sw/source | |
parent | fe151f719d33128139f01bed89271c02849336a4 (diff) |
reorder as we are touching this already
Change-Id: Ie00f27203a28a139de073102428fe9b99db507ea
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 62 |
1 files changed, 28 insertions, 34 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 23dad41d4585..9aca6e14c752 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -114,15 +114,6 @@ namespace }; } -// Already implemented autostyle families: 3 -#define AUTOSTYLE_FAMILY_COUNT 3 -const IStyleAccess::SwAutoStyleFamily aAutoStyleByIndex[] = -{ - IStyleAccess::AUTO_STYLE_CHAR, - IStyleAccess::AUTO_STYLE_RUBY, - IStyleAccess::AUTO_STYLE_PARA -}; - using namespace ::com::sun::star; static SwGetPoolIdFromName lcl_GetSwEnumFromSfxEnum(SfxStyleFamily eFamily) @@ -135,20 +126,6 @@ static SwGetPoolIdFromName lcl_GetSwEnumFromSfxEnum(SfxStyleFamily eFamily) return nsSwGetPoolIdFromName::GET_POOLID_CHRFMT; } -class SwAutoStylesEnumImpl -{ - std::vector<SfxItemSet_Pointer_t> mAutoStyles; - std::vector<SfxItemSet_Pointer_t>::iterator aIter; - SwDoc* pDoc; - IStyleAccess::SwAutoStyleFamily eFamily; -public: - SwAutoStylesEnumImpl( SwDoc* pInitDoc, IStyleAccess::SwAutoStyleFamily eFam ); - bool hasMoreElements() { return aIter != mAutoStyles.end(); } - SfxItemSet_Pointer_t nextElement() { return *(aIter++); } - IStyleAccess::SwAutoStyleFamily getFamily() const { return eFamily; } - SwDoc* getDoc() const { return pDoc; } -}; - OUString SwXStyleFamilies::getImplementationName() throw( uno::RuntimeException, std::exception ) { return {"SwXStyleFamilies"}; } @@ -161,15 +138,12 @@ uno::Sequence< OUString > SwXStyleFamilies::getSupportedServiceNames() throw( un { return { "com.sun.star.style.StyleFamilies" }; } SwXStyleFamilies::SwXStyleFamilies(SwDocShell& rDocShell) : - SwUnoCollection(rDocShell.GetDoc()), - m_pDocShell(&rDocShell) -{ - -} + SwUnoCollection(rDocShell.GetDoc()), + m_pDocShell(&rDocShell) + { } SwXStyleFamilies::~SwXStyleFamilies() -{ -} + { } uno::Any SAL_CALL SwXStyleFamilies::getByName(const OUString& Name) throw( @@ -227,13 +201,10 @@ uno::Type SwXStyleFamilies::getElementType() throw( uno::RuntimeException, std::exception ) { return cppu::UnoType<container::XNameContainer>::get(); - } sal_Bool SwXStyleFamilies::hasElements() throw( uno::RuntimeException, std::exception ) -{ - return sal_True; -} + { return true; } void SwXStyleFamilies::loadStylesFromURL(const OUString& rURL, const uno::Sequence< beans::PropertyValue >& aOptions) @@ -312,6 +283,29 @@ sal_Bool SwXStyleFamily::supportsService(const OUString& rServiceName) throw( un uno::Sequence< OUString > SwXStyleFamily::getSupportedServiceNames() throw( uno::RuntimeException, std::exception ) { return { "com.sun.star.style.StyleFamily" }; } +// Already implemented autostyle families: 3 +#define AUTOSTYLE_FAMILY_COUNT 3 +const IStyleAccess::SwAutoStyleFamily aAutoStyleByIndex[] = +{ + IStyleAccess::AUTO_STYLE_CHAR, + IStyleAccess::AUTO_STYLE_RUBY, + IStyleAccess::AUTO_STYLE_PARA +}; + +class SwAutoStylesEnumImpl +{ + std::vector<SfxItemSet_Pointer_t> mAutoStyles; + std::vector<SfxItemSet_Pointer_t>::iterator aIter; + SwDoc* pDoc; + IStyleAccess::SwAutoStyleFamily eFamily; +public: + SwAutoStylesEnumImpl( SwDoc* pInitDoc, IStyleAccess::SwAutoStyleFamily eFam ); + bool hasMoreElements() { return aIter != mAutoStyles.end(); } + SfxItemSet_Pointer_t nextElement() { return *(aIter++); } + IStyleAccess::SwAutoStyleFamily getFamily() const { return eFamily; } + SwDoc* getDoc() const { return pDoc; } +}; + SwXStyleFamily::SwXStyleFamily(SwDocShell* pDocSh, sal_uInt16 nFamily) : m_eFamily((SfxStyleFamily)nFamily), m_pBasePool(pDocSh->GetStyleSheetPool()), |