diff options
author | Noel Grandin <noel@peralex.com> | 2013-09-27 10:08:35 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-10-01 10:08:43 +0200 |
commit | 2e767575c41fd1a237f86e96bf29a5ddb645cb58 (patch) | |
tree | 7cf9c21037e730b07db0d9c698017a3b90ffef52 | |
parent | d11ed5a57e23fcc8d59ec40e7f52c7f54f7241a4 (diff) |
convert remnants of String to OUString in filter module
Change-Id: I83cea804b73d9219019354223bd2c966f52c5688
-rw-r--r-- | filter/source/msfilter/util.cxx | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx index 93241928cde9..192ba41703c0 100644 --- a/filter/source/msfilter/util.cxx +++ b/filter/source/msfilter/util.cxx @@ -629,7 +629,7 @@ EquationResult Read_SubF_Combined(WW8ReadFieldParams& rReadParam) { EquationResult aResult; - String sCombinedCharacters; + OUString sCombinedCharacters; WW8ReadFieldParams aOriFldParam = rReadParam; const sal_Int32 cGetChar = rReadParam.SkipToNextToken(); switch( cGetChar ) @@ -659,43 +659,42 @@ EquationResult Read_SubF_Combined(WW8ReadFieldParams& rReadParam) { if (-2 == rReadParam.SkipToNextToken()) { - String sPart = rReadParam.GetResult(); - xub_StrLen nBegin = sPart.Search('('); + OUString sPart = rReadParam.GetResult(); + sal_Int32 nBegin = sPart.indexOf('('); //Word disallows brackets in this field, which //aids figuring out the case of an end of )) vs ) - xub_StrLen nEnd = sPart.Search(')'); + sal_Int32 nEnd = sPart.indexOf(')'); - if ((nBegin != STRING_NOTFOUND) && - (nEnd != STRING_NOTFOUND)) + if (nBegin != -1 && nEnd != -1) { sCombinedCharacters += - sPart.Copy(nBegin+1,nEnd-nBegin-1); + sPart.copy(nBegin+1,nEnd-nBegin-1); } } } } } - if (sCombinedCharacters.Len()) + if (!sCombinedCharacters.isEmpty()) { aResult.sType = "CombinedCharacters"; aResult.sResult = sCombinedCharacters; } else { - const String sPart = aOriFldParam.GetResult(); - xub_StrLen nBegin = sPart.Search('('); - xub_StrLen nEnd = sPart.Search(','); - if ( nEnd == STRING_NOTFOUND ) + const OUString sPart = aOriFldParam.GetResult(); + sal_Int32 nBegin = sPart.indexOf('('); + sal_Int32 nEnd = sPart.indexOf(','); + if ( nEnd == -1 ) { - nEnd = sPart.Search(')'); + nEnd = sPart.indexOf(')'); } - if ( (nBegin != STRING_NOTFOUND) && (nEnd != STRING_NOTFOUND) ) + if ( nBegin != -1 && nEnd != -1 ) { // skip certain leading characters for (int i = nBegin;i < nEnd-1;i++) { - const sal_Unicode cC = sPart.GetChar(nBegin+1); + const sal_Unicode cC = sPart[nBegin+1]; if ( cC < 32 ) { nBegin++; @@ -703,8 +702,8 @@ EquationResult Read_SubF_Combined(WW8ReadFieldParams& rReadParam) else break; } - sCombinedCharacters = sPart.Copy( nBegin+1, nEnd-nBegin-1 ); - if ( sCombinedCharacters.Len() ) + sCombinedCharacters = sPart.copy( nBegin+1, nEnd-nBegin-1 ); + if ( !sCombinedCharacters.isEmpty() ) { aResult.sType = "Input"; aResult.sResult = sCombinedCharacters; |