diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-05-16 12:54:27 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-06-08 21:51:28 +0200 |
commit | 7c7937cf228d4148fbd4b48ac41191508ba3c568 (patch) | |
tree | 582a020f6374b4b14c51ac5d20e874f2fc6a2c68 /sw | |
parent | b1424a2d1382a78b56106a5185df4f6b88b05436 (diff) |
sw_redlinehide: remove "protected" SwAttrIter::m_pHints member
Just get it from the current node when needed; it's a trivially
inlinable function call.
Change-Id: Ic2ba291fb43da263300ddaedc9ae21cd86cb07ac
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/itratr.cxx | 23 | ||||
-rw-r--r-- | sw/source/core/text/itratr.hxx | 11 | ||||
-rw-r--r-- | sw/source/core/text/redlnitr.cxx | 3 |
3 files changed, 19 insertions, 18 deletions
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 1b655aa92e4d..de6acf854a4c 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -169,7 +169,6 @@ bool SwAttrIter::SeekStartAndChgAttrIter( OutputDevice* pOut, const bool bParaFo { assert(m_pMergedPara); m_pTextNode = m_pMergedPara->pFirstNode; - m_pHints = m_pTextNode->GetpSwpHints(); InitFontAndAttrHandler(*m_pTextNode, m_pMergedPara->mergedText, nullptr); } @@ -192,12 +191,13 @@ bool SwAttrIter::SeekStartAndChgAttrIter( OutputDevice* pOut, const bool bParaFo m_pRedline->Reset(); } - if ( m_pHints && !bParaFont ) + SwpHints const*const pHints(m_pTextNode->GetpSwpHints()); + if (pHints && !bParaFont) { SwTextAttr *pTextAttr; // While we've not reached the end of the StartArray && the TextAttribute starts at position 0... - while ( ( m_nStartIndex < m_pHints->Count() ) && - !((pTextAttr = m_pHints->Get(m_nStartIndex))->GetStart()) ) + while ((m_nStartIndex < pHints->Count()) && + !((pTextAttr = pHints->Get(m_nStartIndex))->GetStart())) { // open the TextAttributes Chg( pTextAttr ); @@ -226,6 +226,7 @@ bool SwAttrIter::SeekStartAndChgAttrIter( OutputDevice* pOut, const bool bParaFo // AMA: New AttrIter Nov 94 void SwAttrIter::SeekFwd( const sal_Int32 nNewPos ) { + SwpHints const*const pHints(m_pTextNode->GetpSwpHints()); SwTextAttr *pTextAttr; if ( m_nStartIndex ) // If attributes have been opened at all ... @@ -234,8 +235,8 @@ void SwAttrIter::SeekFwd( const sal_Int32 nNewPos ) // As long as we've not yet reached the end of EndArray and the // TextAttribute ends before or at the new position ... - while ( ( m_nEndIndex < m_pHints->Count() ) && - (*(pTextAttr=m_pHints->GetSortedByEnd(m_nEndIndex))->GetAnyEnd()<=nNewPos)) + while ((m_nEndIndex < pHints->Count()) && + (*(pTextAttr = pHints->GetSortedByEnd(m_nEndIndex))->GetAnyEnd() <= nNewPos)) { // Close the TextAttributes, whose StartPos were before or at // the old nPos and are currently open @@ -245,8 +246,8 @@ void SwAttrIter::SeekFwd( const sal_Int32 nNewPos ) } else // skip the not opened ends { - while ( (m_nEndIndex < m_pHints->Count()) && - (*m_pHints->GetSortedByEnd(m_nEndIndex)->GetAnyEnd() <= nNewPos) ) + while ((m_nEndIndex < pHints->Count()) && + (*pHints->GetSortedByEnd(m_nEndIndex)->GetAnyEnd() <= nNewPos)) { m_nEndIndex++; } @@ -254,8 +255,8 @@ void SwAttrIter::SeekFwd( const sal_Int32 nNewPos ) // As long as we've not yet reached the end of EndArray and the // TextAttribute ends before or at the new position... - while ( ( m_nStartIndex < m_pHints->Count() ) && - ((pTextAttr=m_pHints->Get(m_nStartIndex))->GetStart()<=nNewPos) ) + while ((m_nStartIndex < pHints->Count()) && + ((pTextAttr = pHints->Get(m_nStartIndex))->GetStart() <= nNewPos)) { // open the TextAttributes, whose ends lie behind the new position @@ -301,7 +302,6 @@ bool SwAttrIter::Seek(TextFrameIndex const nNewPos) InitFontAndAttrHandler(*newPos.first, m_pMergedPara->mergedText, nullptr); // reset to next m_pTextNode = newPos.first; - m_pHints = m_pTextNode->GetpSwpHints(); m_nStartIndex = 0; m_nEndIndex = 0; m_nPosition = 0; @@ -315,7 +315,6 @@ bool SwAttrIter::Seek(TextFrameIndex const nNewPos) if (m_pTextNode != m_pMergedPara->pFirstNode) { m_pTextNode = m_pMergedPara->pFirstNode; - m_pHints = m_pTextNode->GetpSwpHints(); // sw_redlinehide: hope it's okay to use the current text node // here; the AttrHandler shouldn't care about non-char items InitFontAndAttrHandler(*m_pTextNode, m_pMergedPara->mergedText, nullptr); diff --git a/sw/source/core/text/itratr.hxx b/sw/source/core/text/itratr.hxx index ec3243d0e48d..016f97c333bc 100644 --- a/sw/source/core/text/itratr.hxx +++ b/sw/source/core/text/itratr.hxx @@ -43,7 +43,6 @@ protected: SwAttrHandler m_aAttrHandler; SwViewShell *m_pViewShell; SwFont *m_pFont; - SwpHints const* m_pHints; SwScriptInfo* m_pScriptInfo; private: @@ -76,7 +75,6 @@ protected: explicit SwAttrIter(SwTextNode const * pTextNode) : m_pViewShell(nullptr) , m_pFont(nullptr) - , m_pHints(nullptr) , m_pScriptInfo(nullptr) , m_pLastOut(nullptr) , m_nChgCnt(0) @@ -96,7 +94,14 @@ public: /// constructor, but SwAttrIter itself may be created without a /// SwTextFrame in certain special cases via this ctor here SwAttrIter( SwTextNode& rTextNode, SwScriptInfo& rScrInf ) - : m_pViewShell(nullptr), m_pFont(nullptr), m_pHints(nullptr), m_pScriptInfo(nullptr), m_pLastOut(nullptr), m_nChgCnt(0), m_pRedline(nullptr),m_nPropFont(0), m_pTextNode(&rTextNode) + : m_pViewShell(nullptr) + , m_pFont(nullptr) + , m_pScriptInfo(nullptr) + , m_pLastOut(nullptr) + , m_nChgCnt(0) + , m_pRedline(nullptr) + , m_nPropFont(0) + , m_pTextNode(&rTextNode) , m_pMergedPara(nullptr) { CtorInitAttrIter( rTextNode, rScrInf ); } diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx index 38b277445a9d..9daf5444cc2b 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -180,9 +180,6 @@ void SwAttrIter::CtorInitAttrIter(SwTextNode & rTextNode, m_pScriptInfo = &rScriptInfo; - // attribute array - m_pHints = rTextNode.GetpSwpHints(); - // set font to vertical if frame layout is vertical bool bVertLayout = false; bool bRTL = false; |