summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-11-13 15:17:43 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-11-13 15:29:22 +0000
commitfbe0a4a12c44901a203a011c9498a67ee6eda411 (patch)
treeb18be7eeec24a5a1de2c98103334e22125341761 /sw
parent08a52b17cb2e8c4c2a8c1ad7b95d2cfc5a9e844e (diff)
longparas: safe STRING_NOTFOUND -> -1
Change-Id: Ib8e2dea41293822cb49ebfc7b398acc20b6c37be
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/inc/txmsrt.hxx8
-rw-r--r--sw/source/core/tox/txmsrt.cxx6
2 files changed, 7 insertions, 7 deletions
diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx
index 5d0b3d9385f1..53d90bdd5f22 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 37d239f679e5..7e08f1d6ffa8 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