diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-03-01 18:56:12 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-03-02 20:17:59 +0100 |
commit | 0ea119318a9102e145ad007811759281afbe7305 (patch) | |
tree | 4d4334b1d695026feac549f07dcdb86561fc1117 /sw | |
parent | 778e65cc2a35c0aa1dee73f23007709b89703bb9 (diff) |
Use mutable instead of casting this
Change-Id: Ifdf6334af72637b1c18a9ea2bd2be317d5ae8b20
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 5a718895d243..e3ee2210be03 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -96,9 +96,9 @@ class SwAutoFormat SwDoc* m_pDoc; SwTxtNode* m_pCurTxtNd; // the current TextNode SwTxtFrm* m_pCurTxtFrm; // frame of the current TextNode - boost::scoped_ptr<CharClass> m_pCharClass; // Character classification sal_uLong m_nEndNdIdx; // for the percentage-display - LanguageType m_eCharClassLang; + mutable boost::scoped_ptr<CharClass> m_pCharClass; // Character classification + mutable LanguageType m_eCharClassLang; sal_uInt16 m_nLastHeadLvl, m_nLastCalcHeadLvl; sal_uInt16 m_nRedlAutoFmtSeqId; @@ -136,13 +136,12 @@ class SwAutoFormat bool m_bMoreLines : 1; // ------------- private methods ----------------------------- - void _GetCharClass( LanguageType eLang ); CharClass& GetCharClass( LanguageType eLang ) const { if( !m_pCharClass || eLang != m_eCharClassLang ) { - SwAutoFormat* pThis = (SwAutoFormat*)this; - pThis->_GetCharClass( eLang ); + m_pCharClass.reset( new CharClass( LanguageTag( eLang ) ) ); + m_eCharClassLang = eLang; } return *m_pCharClass; } @@ -254,12 +253,6 @@ SwTxtFrm* SwAutoFormat::GetFrm( const SwTxtNode& rTxtNd ) const return ((SwTxtFrm*)pFrm)->GetFormatted(); } -void SwAutoFormat::_GetCharClass( LanguageType eLang ) -{ - m_pCharClass.reset( new CharClass( LanguageTag( eLang ) ) ); - m_eCharClassLang = eLang; -} - void SwAutoFormat::_SetRedlineTxt( sal_uInt16 nActionId ) { OUString sTxt; |