[Libreoffice-commits] .: sw/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Thu Aug 9 01:24:35 PDT 2012


 sw/source/filter/inc/fltshell.hxx |    2 +-
 sw/source/filter/ww1/fltshell.cxx |   15 +++++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)

New commits:
commit d64ecf4e94a81d9c1fd4be74c098eb0e58345c60
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Aug 9 10:21:17 2012 +0200

    SwFltShell::QuoteStr: UniString -> OUString
    
    Change-Id: I64daedac350d5e897fa8acb79c4c2683a669725b

diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index 0533799..975fef4 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 a1e6d01..0464d67 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;
         }
     }


More information about the Libreoffice-commits mailing list