diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-11-07 17:08:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-11-07 17:08:59 +0000 |
commit | 6f2daecc5453cea0fa930d178e11328313961d08 (patch) | |
tree | 5a11fa3509c2cc165e1c5e9ac76fe240a0678cca | |
parent | 9307b65407c1c50f3be8bbe5a664700e945a7efb (diff) |
safe STRING_NOTFOUND -> -1 conversion
Change-Id: I1afd5f4ef3b0001e28a6c0ce86f2fe927515fcf4
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 837bf7b958e5..666a0e924325 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -262,8 +262,8 @@ static void lcl_ConvertSequenceName(OUString& rSequenceName) } // FindParaStart() finds 1st Parameter that follows '\' and cToken -// and returns start of this parameter or STRING_NOT_FOUND. -xub_StrLen FindParaStart( const OUString& rStr, sal_Unicode cToken, sal_Unicode cToken2 ) +// and returns start of this parameter or -1 +sal_Int32 FindParaStart( const OUString& rStr, sal_Unicode cToken, sal_Unicode cToken2 ) { bool bStr = false; // ignore inside a string @@ -283,10 +283,10 @@ xub_StrLen FindParaStart( const OUString& rStr, sal_Unicode cToken, sal_Unicode && rStr[ nBuf ] == ' ' ) nBuf++; // return start of parameters - return nBuf < rStr.getLength() ? nBuf : STRING_NOTFOUND; + return nBuf < rStr.getLength() ? nBuf : -1; } } - return STRING_NOTFOUND; + return -1; } // FindPara() findet den ersten Parameter mit '\' und cToken. Es wird @@ -294,10 +294,10 @@ xub_StrLen FindParaStart( const OUString& rStr, sal_Unicode cToken, sal_Unicode // und alles, was zum Parameter gehoert, wird in ihm zurueckgeliefert. OUString FindPara( const OUString& rStr, sal_Unicode cToken, sal_Unicode cToken2 ) { - xub_StrLen n2; // end - xub_StrLen n = FindParaStart( rStr, cToken, cToken2 ); // start - if( STRING_NOTFOUND == n ) - return aEmptyOUStr; + sal_Int32 n2; // end + sal_Int32 n = FindParaStart( rStr, cToken, cToken2 ); // start + if( n == -1) + return OUString(); if( rStr[ n ] == '"' || rStr[ n ] == 132 ) |