[Libreoffice-commits] core.git: sw/source

Michael Stahl Michael.Stahl at cib.de
Tue May 15 08:09:44 UTC 2018


 sw/source/core/text/redlnitr.cxx |   18 +++++++++---------
 sw/source/core/text/redlnitr.hxx |    6 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 5193d7fc00bd9d2ac2f77989e861c819d994c19c
Author: Michael Stahl <Michael.Stahl at cib.de>
Date:   Mon May 14 12:25:36 2018 +0200

    sw: these SwRedlineItr members index into the SwRedlineTable, not the node
    
    Change-Id: Idb04fcb46a72d63d4f35b61eb0333ebd6abaaf0c
    Reviewed-on: https://gerrit.libreoffice.org/54309
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index 89f981bf9734..762361af52f0 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -160,7 +160,7 @@ void SwAttrIter::CtorInitAttrIter( SwTextNode& rTextNode, SwScriptInfo& rScrInf,
 //
 // If m_bOn is set, the font has been manipulated according to it.
 //
-// If m_nAct is set to COMPLETE_STRING (via Reset()), then currently no
+// If m_nAct is set to SwRedlineTable::npos (via Reset()), then currently no
 // Redline is active, m_nStart and m_nEnd are invalid.
 SwRedlineItr::SwRedlineItr( const SwTextNode& rTextNd, SwFont& rFnt,
                             SwAttrHandler& rAH, sal_Int32 nRed, bool bShow,
@@ -170,7 +170,7 @@ SwRedlineItr::SwRedlineItr( const SwTextNode& rTextNd, SwFont& rFnt,
     , m_rAttrHandler( rAH )
     , m_nNdIdx( rTextNd.GetIndex() )
     , m_nFirst( nRed )
-    , m_nAct( COMPLETE_STRING )
+    , m_nAct( SwRedlineTable::npos )
     , m_bOn( false )
     , m_bShow( bShow )
 {
@@ -217,13 +217,13 @@ short SwRedlineItr::Seek_(SwFont& rFnt, sal_Int32 nNew, sal_Int32 nOld)
             else
                 return nRet + EnterExtend( rFnt, nNew ); // We stayed in the same section
         }
-        if (COMPLETE_STRING == m_nAct || nOld > nNew)
+        if (SwRedlineTable::npos == m_nAct || nOld > nNew)
             m_nAct = m_nFirst;
 
         m_nStart = COMPLETE_STRING;
         m_nEnd = COMPLETE_STRING;
 
-        for ( ; m_nAct < static_cast<sal_Int32>(m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size()) ; ++m_nAct)
+        for ( ; m_nAct < m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size() ; ++m_nAct)
         {
             m_rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ m_nAct ]->CalcStartEnd(m_nNdIdx, m_nStart, m_nEnd);
 
@@ -334,9 +334,9 @@ void SwRedlineItr::Clear_( SwFont* pFnt )
 sal_Int32 SwRedlineItr::GetNextRedln_( sal_Int32 nNext )
 {
     nNext = NextExtend( nNext );
-    if (!m_bShow || COMPLETE_STRING == m_nFirst)
+    if (!m_bShow || SwRedlineTable::npos == m_nFirst)
         return nNext;
-    if (COMPLETE_STRING == m_nAct)
+    if (SwRedlineTable::npos == m_nAct)
     {
         m_nAct = m_nFirst;
         m_rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ m_nAct ]->CalcStartEnd(m_nNdIdx, m_nStart, m_nEnd);
@@ -368,16 +368,16 @@ bool SwRedlineItr::ChkSpecialUnderline_() const
 
 bool SwRedlineItr::CheckLine( sal_Int32 nChkStart, sal_Int32 nChkEnd )
 {
-    if (m_nFirst == COMPLETE_STRING)
+    if (m_nFirst == SwRedlineTable::npos)
         return false;
     if( nChkEnd == nChkStart ) // empty lines look one char further
         ++nChkEnd;
     sal_Int32 nOldStart = m_nStart;
     sal_Int32 nOldEnd = m_nEnd;
-    sal_Int32 nOldAct = m_nAct;
+    SwRedlineTable::size_type const nOldAct = m_nAct;
     bool bRet = false;
 
-    for (m_nAct = m_nFirst; m_nAct < static_cast<sal_Int32>(m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size()) ; ++m_nAct)
+    for (m_nAct = m_nFirst; m_nAct < m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(); ++m_nAct)
     {
         m_rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ m_nAct ]->CalcStartEnd( m_nNdIdx, m_nStart, m_nEnd );
         if (nChkEnd < m_nStart)
diff --git a/sw/source/core/text/redlnitr.hxx b/sw/source/core/text/redlnitr.hxx
index bdb719fb4cc5..8961e4eb9af3 100644
--- a/sw/source/core/text/redlnitr.hxx
+++ b/sw/source/core/text/redlnitr.hxx
@@ -69,8 +69,8 @@ class SwRedlineItr
     std::unique_ptr<SfxItemSet> m_pSet;
     SwExtend *m_pExt;
     sal_uLong m_nNdIdx;
-    sal_Int32 m_nFirst;
-    sal_Int32 m_nAct;
+    SwRedlineTable::size_type const m_nFirst;
+    SwRedlineTable::size_type m_nAct;
     sal_Int32 m_nStart;
     sal_Int32 m_nEnd;
     bool m_bOn;
@@ -102,7 +102,7 @@ public:
         return 0;
     }
     void Reset() {
-        if (m_nAct != m_nFirst) m_nAct = COMPLETE_STRING;
+        if (m_nAct != m_nFirst) m_nAct = SwRedlineTable::npos;
         if (m_pExt) m_pExt->Reset();
     }
     sal_Int32 GetNextRedln( sal_Int32 nNext ) {


More information about the Libreoffice-commits mailing list