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

Caolán McNamara caolanm at redhat.com
Wed Nov 13 07:29:47 PST 2013


 sw/source/core/edit/edattr.cxx   |    2 +-
 sw/source/core/fields/expfld.cxx |    2 +-
 sw/source/core/inc/txmsrt.hxx    |    8 ++++----
 sw/source/core/tox/txmsrt.cxx    |    6 +++---
 4 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit b17601a4cbedb5e05e22443459366e604194bb77
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 13 15:20:38 2013 +0000

    longparas: these USHRT_MAX are really STRING_LEN
    
    Change-Id: I5b55204c262e9fd0c14a9562351a9a1f8b080cec

diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 50b6364..2920919 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -357,7 +357,7 @@ sal_uInt16 SwEditShell::GetSeqFtnList( SwSeqFldList& rList, bool bEndNotes )
                 OUString sTxt( rFtn.GetViewNumStr( *mpDoc ));
                 if( !sTxt.isEmpty() )
                     sTxt += " ";
-                sTxt += pTxtNd->GetExpandTxt( 0, USHRT_MAX );
+                sTxt += pTxtNd->GetExpandTxt( 0, STRING_LEN );
 
                 _SeqFldLstElem* pNew = new _SeqFldLstElem( sTxt,
                                             pTxtFtn->GetSeqRefNo() );
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 21dc62a..a35d96b 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -586,7 +586,7 @@ sal_uInt16 SwSetExpFieldType::GetSeqFldList( SwSeqFldList& rList )
             pNd->GetNodes().IsDocNodes() )
         {
             _SeqFldLstElem* pNew = new _SeqFldLstElem(
-                    pNd->GetExpandTxt( 0, USHRT_MAX ),
+                    pNd->GetExpandTxt( 0, STRING_LEN ),
                     ((SwSetExpField*)pF->GetField())->GetSeqNumber() );
             rList.InsertSort( pNew );
         }
commit fbe0a4a12c44901a203a011c9498a67ee6eda411
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 13 15:17:43 2013 +0000

    longparas: safe STRING_NOTFOUND -> -1
    
    Change-Id: Ib8e2dea41293822cb49ebfc7b398acc20b6c37be

diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx
index 5d0b3d9..53d90bd 100644
--- a/sw/source/core/inc/txmsrt.hxx
+++ b/sw/source/core/inc/txmsrt.hxx
@@ -240,8 +240,8 @@ struct SwTOXPara : public SwTOXSortTabBase
     SwTOXPara( const SwCntntNode&, SwTOXElement, sal_uInt16 nLevel = FORM_ALPHA_DELIMITTER, OUString sSeqName = OUString() );
     virtual ~SwTOXPara() {}
 
-    void    SetStartIndex( xub_StrLen nSet)     { nStartIndex = nSet;}
-    void    SetEndIndex( xub_StrLen nSet )      { nEndIndex = nSet;}
+    void    SetStartIndex(sal_Int32 nSet)    { nStartIndex = nSet; }
+    void    SetEndIndex(sal_Int32 nSet)      { nEndIndex = nSet; }
 
     virtual void    FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField = 0 ) const;
     virtual sal_uInt16  GetLevel() const;
@@ -252,8 +252,8 @@ private:
 
     SwTOXElement eType;
     sal_uInt16 m_nLevel;
-    xub_StrLen nStartIndex;
-    xub_StrLen nEndIndex;
+    sal_Int32 nStartIndex;
+    sal_Int32 nEndIndex;
     OUString m_sSequenceName;
 };
 
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 37d239f..7e08f1d 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -525,7 +525,7 @@ SwTOXPara::SwTOXPara( const SwCntntNode& rNd, SwTOXElement eT, sal_uInt16 nLevel
     eType( eT ),
     m_nLevel(nLevel),
     nStartIndex(0),
-    nEndIndex(STRING_LEN),
+    nEndIndex(-1),
     m_sSequenceName( sSeqName )
 {
 }
@@ -543,7 +543,7 @@ TextAndReading SwTOXPara::GetText_Impl() const
             xub_StrLen nStt = nStartIndex;
             return TextAndReading(((SwTxtNode*)pNd)->GetExpandTxt(
                     nStt,
-                    STRING_NOTFOUND == nEndIndex ? STRING_LEN : nEndIndex - nStt),
+                    nEndIndex == -1 ? STRING_LEN : nEndIndex - nStt),
                     OUString());
         }
         break;
@@ -578,7 +578,7 @@ void SwTOXPara::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 ) c
         SwTxtNode* pSrc = (SwTxtNode*)aTOXSources[0].pNd;
         xub_StrLen nStt = nStartIndex;
         pSrc->GetExpandTxt( rNd, &rInsPos, nStt,
-                nEndIndex == STRING_LEN ? STRING_LEN : nEndIndex - nStt,
+                nEndIndex == -1 ? STRING_LEN : nEndIndex - nStt,
                 sal_False, sal_False, sal_True );
     }
     else


More information about the Libreoffice-commits mailing list