diff options
Diffstat (limited to 'sw/source/core/inc/txmsrt.hxx')
-rw-r--r-- | sw/source/core/inc/txmsrt.hxx | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx index 548852698309..887d987da85c 100644 --- a/sw/source/core/inc/txmsrt.hxx +++ b/sw/source/core/inc/txmsrt.hxx @@ -30,6 +30,7 @@ class SwTextNode; class SwTextTOXMark; class SwIndex; class SwFormatField; +class SwRootFrame; class IndexEntrySupplierWrapper; enum TOXSortType @@ -141,32 +142,40 @@ struct SwTOXSortTabBase sal_uInt16 GetType() const { return nType; } static SwTOIOptions GetOptions() { return nOpt; } - virtual void FillText( SwTextNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField ) const; + virtual void FillText(SwTextNode& rNd, const SwIndex& rInsPos, + sal_uInt16 nAuthField, SwRootFrame const* pLayout) const; virtual sal_uInt16 GetLevel() const = 0; virtual bool equivalent( const SwTOXSortTabBase& ); virtual bool sort_lt( const SwTOXSortTabBase& ); virtual OUString GetURL() const; + virtual bool IsFullPara() const; + + // must be called + inline void InitText(SwRootFrame const*const pLayout); inline TextAndReading const & GetText() const; inline const css::lang::Locale& GetLocale() const; private: - mutable bool bValidText; - mutable TextAndReading m_aSort; + bool m_bValidText; + TextAndReading m_aSort; - virtual TextAndReading GetText_Impl() const = 0; + virtual TextAndReading GetText_Impl(SwRootFrame const* pLayout) const = 0; }; -inline TextAndReading const & SwTOXSortTabBase::GetText() const +inline void SwTOXSortTabBase::InitText(SwRootFrame const*const pLayout) { - if( !bValidText ) - { // 'this' is 'SwTOXSortTabBase const*', so the virtual // mechanism will call the derived class' GetText_Impl - m_aSort = GetText_Impl(); - bValidText = true; - } + assert(!m_bValidText); + m_aSort = GetText_Impl(pLayout); + m_bValidText = true; +} + +inline TextAndReading const & SwTOXSortTabBase::GetText() const +{ + assert(m_bValidText); return m_aSort; } @@ -184,13 +193,14 @@ struct SwTOXIndex : public SwTOXSortTabBase const SwTOXInternational& rIntl, const css::lang::Locale& rLocale ); - virtual void FillText( SwTextNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField ) const override; + virtual void FillText(SwTextNode& rNd, const SwIndex& rInsPos, + sal_uInt16 nAuthField, SwRootFrame const* pLayout) const override; virtual sal_uInt16 GetLevel() const override; virtual bool equivalent( const SwTOXSortTabBase& ) override; virtual bool sort_lt( const SwTOXSortTabBase& ) override; private: - virtual TextAndReading GetText_Impl() const override; + virtual TextAndReading GetText_Impl(SwRootFrame const* pLayout) const override; sal_uInt8 const nKeyLevel; }; @@ -206,7 +216,7 @@ struct SwTOXCustom : public SwTOXSortTabBase virtual bool sort_lt( const SwTOXSortTabBase& ) override; private: - virtual TextAndReading GetText_Impl() const override; + virtual TextAndReading GetText_Impl(SwRootFrame const* pLayout) const override; TextAndReading const m_aKey; sal_uInt16 const nLev; @@ -220,10 +230,11 @@ struct SwTOXContent : public SwTOXSortTabBase SwTOXContent( const SwTextNode&, const SwTextTOXMark*, const SwTOXInternational& rIntl ); - virtual void FillText( SwTextNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField ) const override; + virtual void FillText(SwTextNode& rNd, const SwIndex& rInsPos, + sal_uInt16 nAuthField, SwRootFrame const* pLayout) const override; virtual sal_uInt16 GetLevel() const override; private: - virtual TextAndReading GetText_Impl() const override; + virtual TextAndReading GetText_Impl(SwRootFrame const* pLayout) const override; }; @@ -234,12 +245,14 @@ struct SwTOXPara : public SwTOXSortTabBase void SetStartIndex(sal_Int32 nSet) { nStartIndex = nSet; } void SetEndIndex(sal_Int32 nSet) { nEndIndex = nSet; } - virtual void FillText( SwTextNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField ) const override; + virtual void FillText(SwTextNode& rNd, const SwIndex& rInsPos, + sal_uInt16 nAuthField, SwRootFrame const* pLayout) const override; virtual sal_uInt16 GetLevel() const override; virtual OUString GetURL() const override; + virtual bool IsFullPara() const override; private: - virtual TextAndReading GetText_Impl() const override; + virtual TextAndReading GetText_Impl(SwRootFrame const* pLayout) const override; SwTOXElement const eType; sal_uInt16 const m_nLevel; @@ -258,7 +271,7 @@ struct SwTOXTable : public SwTOXSortTabBase virtual OUString GetURL() const override; private: - virtual TextAndReading GetText_Impl() const override; + virtual TextAndReading GetText_Impl(SwRootFrame const* pLayout) const override; sal_uInt16 nLevel; }; @@ -267,8 +280,9 @@ struct SwTOXAuthority : public SwTOXSortTabBase { private: SwFormatField& m_rField; - virtual void FillText( SwTextNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField ) const override; - virtual TextAndReading GetText_Impl() const override; + virtual void FillText(SwTextNode& rNd, const SwIndex& rInsPos, + sal_uInt16 nAuthField, SwRootFrame const* pLayout) const override; + virtual TextAndReading GetText_Impl(SwRootFrame const* pLayout) const override; public: SwTOXAuthority( const SwContentNode& rNd, SwFormatField& rField, const SwTOXInternational& rIntl ); |