diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-08-09 10:21:17 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-08-09 10:24:25 +0200 |
commit | d64ecf4e94a81d9c1fd4be74c098eb0e58345c60 (patch) | |
tree | 4764088d8f452368631f6d67d20df0a0322bcdf3 | |
parent | 3adeac41a0efe960baa488ec3e49cba931165029 (diff) |
SwFltShell::QuoteStr: UniString -> OUString
Change-Id: I64daedac350d5e897fa8acb79c4c2683a669725b
-rw-r--r-- | sw/source/filter/inc/fltshell.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww1/fltshell.cxx | 15 |
2 files changed, 10 insertions, 7 deletions
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index 0533799c410d..975fef494ad4 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -652,7 +652,7 @@ public: sal_Bool IsFlagSet(SwFltControlStack::Flags no) const { return aStack.IsFlagSet(no); } void ConvertUStr( String& rInOut ); - String QuoteStr( const String& rIn ); + OUString QuoteStr( const OUString& rIn ); // folgende status kann die shell verwalten: const SfxPoolItem& GetNodeOrStyAttr(sal_uInt16 nWhich); diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx index a1e6d011104a..0464d67090a1 100644 --- a/sw/source/filter/ww1/fltshell.cxx +++ b/sw/source/filter/ww1/fltshell.cxx @@ -1047,24 +1047,27 @@ void SwFltShell::ConvertUStr( String& rInOut ) } // QuoteString() wandelt CRs abhaengig von nFieldIniFlags in '\n' oder "\0x0d" -String SwFltShell::QuoteStr( const String& rIn ) +OUString SwFltShell::QuoteStr( const OUString& rIn ) { - String sOut( rIn ); + OUString sOut( rIn ); sal_Bool bAllowCr = aStack.IsFlagSet( SwFltControlStack::ALLOW_FLD_CR ); - for( xub_StrLen n = 0; n < sOut.Len(); ++n ) + for( sal_Int32 n = 0; n < sOut.getLength(); ++n ) { - switch( sOut.GetChar( n ) ) + switch( sOut[ n ] ) { case 0x0a: - sOut.Erase( n, 1 ); // 0xd 0xa wird zu \n + sOut = sOut.replaceAt( n, 1, OUString() ); // 0xd 0xa wird zu \n break; case 0x0b: case 0x0c: case 0x0d: if( bAllowCr ) - sOut.SetChar( n, '\n' ); + { + sal_Unicode* pStr = (sal_Unicode*)sOut.getStr(); + pStr[n] = (sal_Unicode)'\n'; + } break; } } |