diff options
author | Tobias Lippert <drtl@fastmail.fm> | 2014-03-05 20:06:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-11 08:54:37 -0500 |
commit | 0c17ccc493d0c7a80f37600dae76a09a119bef78 (patch) | |
tree | 70fd1963d59bbb8dba95ed4d92053f2c9f3115cb /include/svl/style.hxx | |
parent | e3e1f9f30d80961fd282f9ce765ffb1111201344 (diff) |
fdo#30770 - Speed up xslx import
Conflicts:
include/svl/style.hxx
Change-Id: Ie3d855923c651b6e05c0054c8e30155218279045
Reviewed-on: https://gerrit.libreoffice.org/8485
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/svl/style.hxx')
-rw-r--r-- | include/svl/style.hxx | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/include/svl/style.hxx b/include/svl/style.hxx index 7a558e4f94b9..da6931b63e37 100644 --- a/include/svl/style.hxx +++ b/include/svl/style.hxx @@ -43,6 +43,7 @@ class SfxItemPool; class SfxStyleSheetBasePool; class SvStream; +namespace svl { class IndexedStyleSheets; } /* Everyone changing instances of SfxStyleSheetBasePool or SfxStyleSheetBase must broadcast this using <SfxStyleSheetBasePool::GetBroadcaster()> broadcasts. @@ -144,12 +145,6 @@ public: virtual sal_uInt16 GetVersion() const; }; - - -typedef std::vector< rtl::Reference< SfxStyleSheetBase > > SfxStyles; - - - class SVL_DLLPUBLIC SfxStyleSheetIterator /* [Beschreibung] @@ -174,18 +169,18 @@ public: virtual SfxStyleSheetBase* Find(const OUString& rStr); virtual ~SfxStyleSheetIterator(); + bool SearchUsed() const { return bSearchUsed; } + protected: SfxStyleSheetBasePool* pBasePool; SfxStyleFamily nSearchFamily; sal_uInt16 nMask; - bool SearchUsed() const { return bSearchUsed; } private: sal_uInt16 GetPos() { return nAktPosition; } SVL_DLLPRIVATE bool IsTrivialSearch(); - SVL_DLLPRIVATE bool DoesStyleMatch(SfxStyleSheetBase *pStyle); SfxStyleSheetBase* pAktStyle; sal_uInt16 nAktPosition; @@ -211,17 +206,24 @@ protected: OUString aAppName; SfxItemPool& rPool; - SfxStyles aStyles; SfxStyleFamily nSearchFamily; sal_uInt16 nMask; - SfxStyleSheetBase& Add( SfxStyleSheetBase& ); void ChangeParent( const OUString&, const OUString&, bool bVirtual = true ); virtual SfxStyleSheetBase* Create( const OUString&, SfxStyleFamily, sal_uInt16 ); virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& ); virtual ~SfxStyleSheetBasePool(); + void StoreStyleSheet(rtl::Reference< SfxStyleSheetBase >); + + /** Obtain the indexed style sheets. + */ + const svl::IndexedStyleSheets& + GetIndexedStyleSheets() const; + rtl::Reference<SfxStyleSheetBase> + GetStyleSheetByPositionInIndex(unsigned pos); + public: SfxStyleSheetBasePool( SfxItemPool& ); SfxStyleSheetBasePool( const SfxStyleSheetBasePool& ); @@ -250,6 +252,8 @@ public: SfxStyleSheetBasePool& operator=( const SfxStyleSheetBasePool& ); SfxStyleSheetBasePool& operator+=( const SfxStyleSheetBasePool& ); + unsigned GetNumberOfStyles(); + virtual SfxStyleSheetBase* First(); virtual SfxStyleSheetBase* Next(); virtual SfxStyleSheetBase* Find( const OUString&, SfxStyleFamily eFam, sal_uInt16 n=SFXSTYLEBIT_ALL ); @@ -264,6 +268,21 @@ public: void SetSearchMask(SfxStyleFamily eFam, sal_uInt16 n=SFXSTYLEBIT_ALL ); sal_uInt16 GetSearchMask() const; SfxStyleFamily GetSearchFamily() const { return nSearchFamily; } + + void Reindex(); + /** Add a style sheet. + * Not an actual public function. Do not call it from non-subclasses. + */ + SfxStyleSheetBase& Add( const SfxStyleSheetBase& ); + +private: + /** This member holds the indexed style sheets. + * + * @internal + * This member is private and not protected in order to have more control which style sheets are added + * where. Ideally, all calls which add/remove/change style sheets are done in the base class. + */ + boost::shared_ptr<svl::IndexedStyleSheets> mIndexedStyleSheets; }; |