diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-08-09 10:06:44 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-08-09 10:06:44 +0100 |
commit | 3a1c8eeb694e26835f6f9c010b5d305b57ddd0d5 (patch) | |
tree | 9026057c5f5e321c1a928c0949b1c223d06569ab | |
parent | b61dd408981b4dc8a3e97edd806694e43da882e4 (diff) |
rtl::OUStrings are supposed to be immutable
The cast away of constness in d64ecf4e94a81d9c1fd4be74c098eb0e58345c60 makes me
feel icky
Change-Id: Ib977fd6bf34f11407a5957332789e1e48d98819e
-rw-r--r-- | sw/source/filter/ww1/fltshell.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx index 0464d67090a1..b3e129a96a91 100644 --- a/sw/source/filter/ww1/fltshell.cxx +++ b/sw/source/filter/ww1/fltshell.cxx @@ -1049,7 +1049,7 @@ void SwFltShell::ConvertUStr( String& rInOut ) // QuoteString() wandelt CRs abhaengig von nFieldIniFlags in '\n' oder "\0x0d" OUString SwFltShell::QuoteStr( const OUString& rIn ) { - OUString sOut( rIn ); + OUStringBuffer sOut( rIn ); sal_Bool bAllowCr = aStack.IsFlagSet( SwFltControlStack::ALLOW_FLD_CR ); for( sal_Int32 n = 0; n < sOut.getLength(); ++n ) @@ -1057,21 +1057,18 @@ OUString SwFltShell::QuoteStr( const OUString& rIn ) switch( sOut[ n ] ) { case 0x0a: - sOut = sOut.replaceAt( n, 1, OUString() ); // 0xd 0xa wird zu \n + sOut.remove( n, 1 ); // 0xd 0xa wird zu \n break; case 0x0b: case 0x0c: case 0x0d: if( bAllowCr ) - { - sal_Unicode* pStr = (sal_Unicode*)sOut.getStr(); - pStr[n] = (sal_Unicode)'\n'; - } + sOut[n] = '\n'; break; } } - return sOut; + return sOut.makeStringAndClear(); } SwFltShell& SwFltShell::operator << ( const sal_Unicode c ) |