diff options
author | Chr. Rossmanith <ChrRossmanith@gmx.de> | 2013-03-22 18:06:02 +0100 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-03-26 12:43:22 +0000 |
commit | 4e907bc366d8691a33ec0be389f211e22c6e87d3 (patch) | |
tree | 540e80e60537893b62ccc6710c03fdec3ee7175f /unotools/source | |
parent | 269b72069746578dd0d89de6b44adb715c39173b (diff) |
Replace String with OUString in RecodeString
Change-Id: I987f738d1cd7d640a253f3cd31864290b6d763bf
Reviewed-on: https://gerrit.libreoffice.org/2919
Reviewed-by: Eike Rathke <erack@redhat.com>
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'unotools/source')
-rw-r--r-- | unotools/source/misc/fontcvt.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx index fe870ed48d1f..99e07ee538cf 100644 --- a/unotools/source/misc/fontcvt.cxx +++ b/unotools/source/misc/fontcvt.cxx @@ -1372,15 +1372,17 @@ sal_Unicode ConvertChar::RecodeChar( sal_Unicode cChar ) const // recode the string assuming the character codes are symbol codes // from an traditional symbol font (i.e. U+F020..U+F0FF) -void ConvertChar::RecodeString( String& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const +void ConvertChar::RecodeString( OUString& rStr, sal_Int32 nIndex, sal_Int32 nLen ) const { - sal_uLong nLastIndex = (sal_uLong)nIndex + nLen; - if( nLastIndex > rStr.Len() ) - nLastIndex = rStr.Len(); + sal_Int32 nLastIndex = nIndex + nLen; + OUStringBuffer aTmpStr(rStr); + + if( nLastIndex > aTmpStr.getLength() ) + nLastIndex = aTmpStr.getLength(); for(; nIndex < nLastIndex; ++nIndex ) { - sal_Unicode cOrig = rStr.GetChar( nIndex ); + sal_Unicode cOrig = rStr[ nIndex ]; // only recode symbols and their U+00xx aliases if( ((cOrig < 0x0020) || (cOrig > 0x00FF)) && ((cOrig < 0xF020) || (cOrig > 0xF0FF)) ) @@ -1389,8 +1391,9 @@ void ConvertChar::RecodeString( String& rStr, xub_StrLen nIndex, xub_StrLen nLen // recode a symbol sal_Unicode cNew = RecodeChar( cOrig ); if( cOrig != cNew ) - rStr.SetChar( nIndex, cNew ); + aTmpStr[ nIndex ] = cNew; } + rStr = aTmpStr.makeStringAndClear(); } //======================================================================= |