Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/4254

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/54/4254/1

String=>OUString another daily wack at it

Change-Id: I49f0aeb4e97718428ab0b87c659da14fe30dab2e
---
M include/sfx2/frmhtmlw.hxx
M include/svtools/htmlout.hxx
M include/svtools/rtfout.hxx
M sc/inc/filter.hxx
M sc/source/filter/html/htmlexp.cxx
M sc/source/filter/inc/ftools.hxx
M sc/source/filter/inc/htmlexp.hxx
M sc/source/ui/docshell/docsh.cxx
M sc/source/ui/docshell/impex.cxx
M sc/source/ui/inc/impex.hxx
M sfx2/source/bastyp/frmhtmlw.cxx
M svtools/source/svhtml/htmlout.cxx
M svtools/source/svrtf/rtfout.cxx
M sw/source/filter/html/htmlbas.cxx
M sw/source/filter/html/htmlfly.cxx
M sw/source/filter/html/htmlforw.cxx
M sw/source/filter/html/wrthtml.cxx
M sw/source/filter/html/wrthtml.hxx
18 files changed, 154 insertions(+), 151 deletions(-)



diff --git a/include/sfx2/frmhtmlw.hxx b/include/sfx2/frmhtmlw.hxx
index 3abdfbe..dcea90a 100644
--- a/include/sfx2/frmhtmlw.hxx
+++ b/include/sfx2/frmhtmlw.hxx
@@ -43,35 +43,35 @@
 {
     SAL_DLLPRIVATE static const sal_Char sNewLine[];
     SAL_DLLPRIVATE static void OutMeta( SvStream& rStrm,
-                                const sal_Char *pIndent, const String& rName,
-                                const String& rContent, sal_Bool bHTTPEquiv,
-                                rtl_TextEncoding eDestEnc,
-                            String *pNonConvertableChars = 0 );
+                                        const sal_Char *pIndent, const String& rName,
+                                        const String& rContent, sal_Bool bHTTPEquiv,
+                                        rtl_TextEncoding eDestEnc,
+                                        OUStringBuffer* pNonConvertableChars = 0 );
     SAL_DLLPRIVATE inline static void OutMeta( SvStream& rStrm,
-                                const sal_Char *pIndent, const sal_Char *pName,
-                                const String& rContent, sal_Bool bHTTPEquiv,
-                                rtl_TextEncoding eDestEnc,
-                            String *pNonConvertableChars = 0 );
+                                               const sal_Char *pIndent, const sal_Char *pName,
+                                               const String& rContent, sal_Bool bHTTPEquiv,
+                                               rtl_TextEncoding eDestEnc,
+                                               OUStringBuffer* pNonConvertableChars = 0 );
 
 public:
     static void Out_DocInfo( SvStream& rStrm, const String& rBaseURL,
-            const ::com::sun::star::uno::Reference<
-                ::com::sun::star::document::XDocumentProperties>&,
-            const sal_Char *pIndent,
-            rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
-            String *pNonConvertableChars = 0 );
+                             const ::com::sun::star::uno::Reference<
+                             ::com::sun::star::document::XDocumentProperties>&,
+                             const sal_Char *pIndent,
+                             rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+                             OUStringBuffer* pNonConvertableChars = 0 );
 
     static void Out_FrameDescriptor(
-        SvStream&, const String& rBaseURL, const com::sun::star::uno::Reference < 
com::sun::star::beans::XPropertySet >& xSet,
-        rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
-        String *pNonConvertableChars = 0 );
+            SvStream&, const String& rBaseURL, const com::sun::star::uno::Reference < 
com::sun::star::beans::XPropertySet >& xSet,
+            rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+            OUStringBuffer* pNonConvertableChars = 0 );
 };
 
 inline void SfxFrameHTMLWriter::OutMeta( SvStream& rStrm,
-                            const sal_Char *pIndent, const sal_Char *pName,
-                            const String& rContent, sal_Bool bHTTPEquiv,
-                            rtl_TextEncoding eDestEnc,
-                            String *pNonConvertableChars )
+                                         const sal_Char *pIndent, const sal_Char *pName,
+                                         const String& rContent, sal_Bool bHTTPEquiv,
+                                         rtl_TextEncoding eDestEnc,
+                                         OUStringBuffer* pNonConvertableChars )
 {
     String sTmp = OUString::createFromAscii(pName);
     OutMeta( rStrm, pIndent, sTmp, rContent, bHTTPEquiv, eDestEnc, pNonConvertableChars );
diff --git a/include/svtools/htmlout.hxx b/include/svtools/htmlout.hxx
index 33c76fe..cee90cb 100644
--- a/include/svtools/htmlout.hxx
+++ b/include/svtools/htmlout.hxx
@@ -24,11 +24,11 @@
 #include <tools/solar.h>
 #include <rtl/textenc.h>
 #include <rtl/string.hxx>
+#include <rtl/ustrbuf.hxx>
 #include <svl/macitem.hxx>
 
 class Color;
 class ImageMap;
-class String;
 class SvStream;
 class SvxMacroTableDtor;
 class SvNumberFormatter;
@@ -58,59 +58,59 @@
     static const sal_Char sNewLine[];   // \015\012
 #endif
 
-    SVT_DLLPUBLIC static OString ConvertStringToHTML( const String& sSrc,
-                        rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
-                        String *pNonConvertableChars = 0 );
+    SVT_DLLPUBLIC static OString ConvertStringToHTML( const OUString& sSrc,
+                                                      rtl_TextEncoding eDestEnc = 
RTL_TEXTENCODING_MS_1252,
+                                                      OUStringBuffer* pNonConvertableChars = 0 );
 
     SVT_DLLPUBLIC static SvStream& Out_AsciiTag( SvStream&, const sal_Char* pStr,
-                                   sal_Bool bOn = sal_True,
-                        rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252);
+                                                 sal_Bool bOn = sal_True,
+                                                 rtl_TextEncoding eDestEnc = 
RTL_TEXTENCODING_MS_1252);
     SVT_DLLPUBLIC static SvStream& Out_Char( SvStream&, sal_Unicode cChar,
-                        HTMLOutContext& rContext,
-                        String *pNonConvertableChars = 0 );
-    SVT_DLLPUBLIC static SvStream& Out_String( SvStream&, const String&,
-                        rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
-                        String *pNonConvertableChars = 0 );
+                                             HTMLOutContext& rContext,
+                                             OUStringBuffer* pNonConvertableChars = 0 );
+    SVT_DLLPUBLIC static SvStream& Out_String( SvStream&, const OUString&,
+                                               rtl_TextEncoding eDestEnc = 
RTL_TEXTENCODING_MS_1252,
+                                               OUStringBuffer* pNonConvertableChars = 0 );
     SVT_DLLPUBLIC static SvStream& Out_Hex( SvStream&, sal_uLong nHex, sal_uInt8 nLen,
-                        rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 );
+                                            rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 );
     SVT_DLLPUBLIC static SvStream& Out_Color( SvStream&, const Color&,
-                        rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 );
-    SVT_DLLPUBLIC static SvStream& Out_ImageMap( SvStream&, const String&, const ImageMap&, const 
String&,
-                                   const HTMLOutEvent *pEventTable,
-                                   sal_Bool bOutStarBasic,
-                                   const sal_Char *pDelim = 0,
-                                   const sal_Char *pIndentArea = 0,
-                                   const sal_Char *pIndentMap = 0,
-                        rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
-                        String *pNonConvertableChars = 0 );
+                                              rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 
);
+    SVT_DLLPUBLIC static SvStream& Out_ImageMap( SvStream&, const OUString&, const ImageMap&, 
const OUString&,
+                                                 const HTMLOutEvent *pEventTable,
+                                                 sal_Bool bOutStarBasic,
+                                                 const sal_Char *pDelim = 0,
+                                                 const sal_Char *pIndentArea = 0,
+                                                 const sal_Char *pIndentMap = 0,
+                                                 rtl_TextEncoding eDestEnc = 
RTL_TEXTENCODING_MS_1252,
+                                                 OUStringBuffer* pNonConvertableChars = 0 );
     SVT_DLLPUBLIC static SvStream& FlushToAscii( SvStream&, HTMLOutContext& rContext );
 
     SVT_DLLPUBLIC static SvStream& OutScript( SvStream& rStrm,
-                                const String& rBaseURL,
-                                const String& rSource,
-                                const String& rLanguage,
-                                ScriptType eScriptType,
-                                const String& rSrc,
-                                const String *pSBLibrary = 0,
-                                const String *pSBModule = 0,
-                        rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
-                        String *pNonConvertableChars = 0 );
+                                              const OUString& rBaseURL,
+                                              const OUString& rSource,
+                                              const OUString& rLanguage,
+                                              ScriptType eScriptType,
+                                              const OUString& rSrc,
+                                              const OUString *pSBLibrary = 0,
+                                              const OUString *pSBModule = 0,
+                                              rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+                                              OUStringBuffer* pNonConvertableChars = 0 );
 
     // der 3. Parameter ist ein Array von HTMLOutEvents, das mit einem
     // nur aus 0 bestehen Eintrag terminiert ist.
     SVT_DLLPUBLIC static SvStream& Out_Events( SvStream&, const SvxMacroTableDtor&,
-                                 const HTMLOutEvent*, sal_Bool bOutStarBasic,
-                        rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
-                        String *pNonConvertableChars = 0 );
+                                               const HTMLOutEvent*, sal_Bool bOutStarBasic,
+                                               rtl_TextEncoding eDestEnc = 
RTL_TEXTENCODING_MS_1252,
+                                               OUStringBuffer* pNonConvertableChars = 0 );
 
     // <TD SDVAL="..." SDNUM="...">
     SVT_DLLPUBLIC static OString CreateTableDataOptionsValNum(
-                sal_Bool bValue, double fVal, sal_uLong nFormat,
-                SvNumberFormatter& rFormatter,
-                rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
-                String *pNonConvertableChars = 0);
+            sal_Bool bValue, double fVal, sal_uLong nFormat,
+            SvNumberFormatter& rFormatter,
+            rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+            OUStringBuffer* pNonConvertableChars = 0);
 
-    SVT_DLLPUBLIC static sal_Bool PrivateURLToInternalImg( String& rURL );
+    SVT_DLLPUBLIC static sal_Bool PrivateURLToInternalImg( OUString& rURL );
 };
 
 #endif
diff --git a/include/svtools/rtfout.hxx b/include/svtools/rtfout.hxx
index 9910d8e..7d417f9 100644
--- a/include/svtools/rtfout.hxx
+++ b/include/svtools/rtfout.hxx
@@ -25,7 +25,6 @@
 
 #include <rtl/textenc.h>
 
-class String;
 class SvStream;
 
 class SVT_DLLPUBLIC RTFOutFuncs
@@ -41,10 +40,10 @@
                     int *pUCMode,
                     rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
                     sal_Bool bWriteHelpFile = sal_False );
-    static SvStream& Out_String( SvStream&, const String&,
+    static SvStream& Out_String( SvStream&, const OUString&,
                     rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
                     sal_Bool bWriteHelpFile = sal_False );
-    static SvStream& Out_Fontname( SvStream&, const String&,
+    static SvStream& Out_Fontname( SvStream&, const OUString&,
                     rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
                     sal_Bool bWriteHelpFile = sal_False );
 
diff --git a/sc/inc/filter.hxx b/sc/inc/filter.hxx
index 9c28498..6ea10bb 100644
--- a/sc/inc/filter.hxx
+++ b/sc/inc/filter.hxx
@@ -22,7 +22,7 @@
 
 #include <tools/string.hxx>
 #include <rtl/textenc.h>
-
+#include <rtl/ustrbuf.hxx>
 #include "scdllapi.h"
 
 class SfxMedium;
@@ -110,7 +110,7 @@
     virtual FltError ScExportDif( SvStream&, ScDocument*, const ScRange& rRange, const CharSet 
eDest,
                  sal_uInt32 nDifOption = SC_DIFOPT_EXCEL ) = 0;
     virtual FltError ScExportHTML( SvStream&, const String& rBaseURL, ScDocument*, const ScRange& 
rRange, const CharSet eDest, bool bAll,
-                  const String& rStreamPath, String& rNonConvertibleChars ) = 0;
+                                   const String& rStreamPath, OUStringBuffer& rNonConvertibleChars 
) = 0;
     virtual FltError ScExportRTF( SvStream&, ScDocument*, const ScRange& rRange, const CharSet 
eDest ) = 0;
 
     virtual ScOrcusFilters* GetOrcusFilters() = 0;
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 603dfee..c0b6691 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -135,7 +135,7 @@
 
 FltError ScFormatFilterPluginImpl::ScExportHTML( SvStream& rStrm, const String& rBaseURL, 
ScDocument* pDoc,
         const ScRange& rRange, const CharSet /*eNach*/, bool bAll,
-        const String& rStreamPath, String& rNonConvertibleChars )
+        const String& rStreamPath, OUStringBuffer& rNonConvertibleChars )
 {
     ScHTMLExport aEx( rStrm, rBaseURL, pDoc, rRange, bAll, rStreamPath );
     FltError nErr = aEx.Write();
diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx
index e89685c..c7cfd06 100644
--- a/sc/source/filter/inc/ftools.hxx
+++ b/sc/source/filter/inc/ftools.hxx
@@ -306,7 +306,7 @@
     virtual FltError ScExportDif( SvStream&, ScDocument*, const ScRange& rRange, const CharSet 
eDest,
                  sal_uInt32 nDifOption = SC_DIFOPT_EXCEL );
     virtual FltError ScExportHTML( SvStream&, const String& rBaseURL, ScDocument*, const ScRange& 
rRange, const CharSet eDest, bool bAll,
-                  const String& rStreamPath, String& rNonConvertibleChars );
+                  const String& rStreamPath, OUStringBuffer& rNonConvertibleChars );
     virtual FltError ScExportRTF( SvStream&, ScDocument*, const ScRange& rRange, const CharSet 
eDest );
 
     virtual ScOrcusFilters* GetOrcusFilters();
diff --git a/sc/source/filter/inc/htmlexp.hxx b/sc/source/filter/inc/htmlexp.hxx
index 585f7a2..4941030 100644
--- a/sc/source/filter/inc/htmlexp.hxx
+++ b/sc/source/filter/inc/htmlexp.hxx
@@ -101,7 +101,7 @@
     String              aCId;           // Content-Id fuer Mail-Export
     OutputDevice*       pAppWin;        // fuer Pixelei
     boost::scoped_ptr< std::map<String, String> >  pFileNameMap;        // fuer CopyLocalFileToINet
-    String              aNonConvertibleChars;   // collect nonconvertible characters
+    OUStringBuffer      aNonConvertibleChars;   // collect nonconvertible characters
     rtl_TextEncoding    eDestEnc;
     SCTAB               nUsedTables;
     short               nIndent;
@@ -158,7 +158,7 @@
                                         sal_Bool bAll, const String& aStreamPath );
     virtual             ~ScHTMLExport();
     sal_uLong               Write();
-    const String&       GetNonConvertibleChars() const
+    const OUStringBuffer& GetNonConvertibleChars() const
                             { return aNonConvertibleChars; }
 };
 
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 11c5439..27fc8f1 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2392,10 +2392,10 @@
             ScImportExport aImExport( &aDocument );
             aImExport.SetStreamPath( rMed.GetName() );
             bRet = aImExport.ExportStream( *pStream, rMed.GetBaseURL( true ), 
SOT_FORMATSTR_ID_HTML );
-            if ( bRet && aImExport.GetNonConvertibleChars().Len() )
+            if ( bRet && !aImExport.GetNonConvertibleChars().isEmpty() )
                 SetError( *new StringErrorInfo(
                     SCWARN_EXPORT_NONCONVERTIBLE_CHARS,
-                    aImExport.GetNonConvertibleChars(),
+                    aImExport.GetNonConvertibleChars().toString(),
                     ERRCODE_BUTTON_OK | ERRCODE_MSG_INFO ), OUString( OSL_LOG_PREFIX ) );
         }
     }
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 4a74487..f8d1c72 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2094,7 +2094,7 @@
 {
     // CharSet is ignored in ScExportHTML, read from Load/Save HTML options
     ScFormatFilter::Get().ScExportHTML( rStrm, rBaseURL, pDoc, aRange, RTL_TEXTENCODING_DONTKNOW, 
bAll,
-        aStreamPath, aNonConvertibleChars );
+                                        aStreamPath, aNonConvertibleChars );
     return rStrm.GetError() == SVSTREAM_OK;
 }
 
@@ -2233,7 +2233,7 @@
     virtual FltError ScExportDif( SvStream&, ScDocument*, const ScAddress&, const CharSet, 
sal_uInt32 ) RETURN_ERROR
     virtual FltError ScExportDif( SvStream&, ScDocument*, const ScRange&, const CharSet, 
sal_uInt32 ) RETURN_ERROR
     virtual FltError ScExportHTML( SvStream&, const String&, ScDocument*, const ScRange&, const 
CharSet, bool,
-                  const String&, String& ) RETURN_ERROR
+                                   const String&, OUStringBuffer& ) RETURN_ERROR
     virtual FltError ScExportRTF( SvStream&, ScDocument*, const ScRange&, const CharSet ) 
RETURN_ERROR
 
     virtual ScOrcusFilters* GetOrcusFilters() { return NULL; }
diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx
index 2691b11..6ffab31 100644
--- a/sc/source/ui/inc/impex.hxx
+++ b/sc/source/ui/inc/impex.hxx
@@ -52,7 +52,7 @@
     ScDocument* pUndoDoc;
     ScRange     aRange;
     String      aStreamPath;
-    String      aNonConvertibleChars;
+    OUStringBuffer aNonConvertibleChars;
     sal_uLong   nSizeLimit;
     sal_Unicode cSep;                   // Separator
     sal_Unicode cStr;                   // String Delimiter
@@ -147,7 +147,7 @@
     bool IsOverflowCell() const { return bOverflowCell; }
     bool IsOverflow() const { return bOverflowRow || bOverflowCol || bOverflowCell; }
 
-    const String& GetNonConvertibleChars() const { return aNonConvertibleChars; }
+    const OUStringBuffer& GetNonConvertibleChars() const { return aNonConvertibleChars; }
 
     bool IsApi() const { return mbApi; }
     void SetApi( bool bApi ) { mbApi = bApi; }
diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx
index e822d9d..43983c6 100644
--- a/sfx2/source/bastyp/frmhtmlw.cxx
+++ b/sfx2/source/bastyp/frmhtmlw.cxx
@@ -65,8 +65,8 @@
                                   const sal_Char *pIndent,
                                   const String& rName,
                                   const String& rContent, sal_Bool bHTTPEquiv,
-                                     rtl_TextEncoding eDestEnc,
-                                  String *pNonConvertableChars  )
+                                  rtl_TextEncoding eDestEnc,
+                                  OUStringBuffer *pNonConvertableChars)
 {
     rStrm << sNewLine;
     if( pIndent )
@@ -86,13 +86,12 @@
 }
 
 void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const String& rBaseURL,
-        const uno::Reference<document::XDocumentProperties> & i_xDocProps,
-        const sal_Char *pIndent,
-        rtl_TextEncoding eDestEnc,
-        String *pNonConvertableChars    )
+                                      const uno::Reference<document::XDocumentProperties> & 
i_xDocProps,
+                                      const sal_Char *pIndent,
+                                      rtl_TextEncoding eDestEnc,
+                                      OUStringBuffer *pNonConvertableChars)
 {
-    const sal_Char *pCharSet =
-                rtl_getBestMimeCharsetFromTextEncoding( eDestEnc );
+    const sal_Char *pCharSet = rtl_getBestMimeCharsetFromTextEncoding( eDestEnc );
 
     if( pCharSet )
     {
@@ -248,7 +247,7 @@
 
 void SfxFrameHTMLWriter::Out_FrameDescriptor(
     SvStream& rOut, const String& rBaseURL, const uno::Reference < beans::XPropertySet >& xSet,
-    rtl_TextEncoding eDestEnc, String *pNonConvertableChars )
+    rtl_TextEncoding eDestEnc, OUStringBuffer* pNonConvertableChars )
 {
     try
     {
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index a126e4e..88fb94d 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -393,7 +393,7 @@
 
 static OString lcl_ConvertCharToHTML( sal_Unicode c,
                             HTMLOutContext& rContext,
-                            String *pNonConvertableChars )
+                            OUStringBuffer* pNonConvertableChars )
 {
     OStringBuffer aDest;
     DBG_ASSERT( RTL_TEXTENCODING_DONTKNOW != rContext.m_eDestEnc,
@@ -471,8 +471,10 @@
             aDest.append('&').append('#').append(static_cast<sal_Int64>(c))
                  .append(';');
             if( pNonConvertableChars &&
-                STRING_NOTFOUND == pNonConvertableChars->Search( c ) )
-                pNonConvertableChars->Append( c );
+                pNonConvertableChars->indexOf( c ) < 0 )
+            {
+                pNonConvertableChars->append( c );
+            }
         }
     }
     return aDest.makeStringAndClear();
@@ -502,14 +504,15 @@
     return aDest.makeStringAndClear();
 }
 
-OString HTMLOutFuncs::ConvertStringToHTML( const String& rSrc,
-    rtl_TextEncoding eDestEnc, String *pNonConvertableChars )
+OString HTMLOutFuncs::ConvertStringToHTML( const OUString& rSrc,
+                                           rtl_TextEncoding eDestEnc,
+                                           OUStringBuffer* pNonConvertableChars )
 {
     HTMLOutContext aContext( eDestEnc );
     OStringBuffer aDest;
-    for( sal_uInt32 i=0UL, nLen = rSrc.Len(); i < nLen; i++ )
+    for( sal_uInt32 i=0UL, nLen = rSrc.getLength(); i < nLen; i++ )
         aDest.append(lcl_ConvertCharToHTML(
-            rSrc.GetChar( (xub_StrLen)i ), aContext, pNonConvertableChars));
+            rSrc[ i ], aContext, pNonConvertableChars));
     aDest.append(lcl_FlushToAscii(aContext));
     return aDest.makeStringAndClear();
 }
@@ -525,28 +528,28 @@
 
 SvStream& HTMLOutFuncs::Out_Char( SvStream& rStream, sal_Unicode c,
                                   HTMLOutContext& rContext,
-                                  String *pNonConvertableChars )
+                                  OUStringBuffer* pNonConvertableChars )
 {
     OString sOut = lcl_ConvertCharToHTML( c, rContext, pNonConvertableChars );
     rStream << sOut.getStr();
     return rStream;
 }
 
-SvStream& HTMLOutFuncs::Out_String( SvStream& rStream, const String& rStr,
+SvStream& HTMLOutFuncs::Out_String( SvStream& rStream, const OUString& rStr,
                                     rtl_TextEncoding eDestEnc,
-                                    String *pNonConvertableChars )
+                                    OUStringBuffer* pNonConvertableChars )
 {
     HTMLOutContext aContext( eDestEnc );
-    xub_StrLen nLen = rStr.Len();
+    sal_Int32 nLen = rStr.getLength();
     for( xub_StrLen n = 0; n < nLen; n++ )
-        HTMLOutFuncs::Out_Char( rStream, rStr.GetChar( (xub_StrLen)n ),
+        HTMLOutFuncs::Out_Char( rStream, rStr[n],
                                 aContext, pNonConvertableChars );
     HTMLOutFuncs::FlushToAscii( rStream, aContext );
     return rStream;
 }
 
 SvStream& HTMLOutFuncs::FlushToAscii( SvStream& rStream,
-                                       HTMLOutContext& rContext )
+                                      HTMLOutContext& rContext )
 {
     OString sOut = lcl_FlushToAscii( rContext );
 
@@ -556,8 +559,9 @@
     return rStream;
 }
 
-SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 nLen,
-                                   rtl_TextEncoding )
+SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, sal_uLong nHex,
+                                 sal_uInt8 nLen,
+                                 rtl_TextEncoding )
 {                                                  // in einen Stream aus
     sal_Char aNToABuf[] = "0000000000000000";
 
@@ -598,31 +602,31 @@
 }
 
 SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
-                                      const String& rBaseURL,
+                                      const OUString& rBaseURL,
                                       const ImageMap& rIMap,
-                                      const String& rName,
+                                      const OUString& rName,
                                       const HTMLOutEvent *pEventTable,
                                       sal_Bool bOutStarBasic,
                                       const sal_Char *pDelim,
                                       const sal_Char *pIndentArea,
                                       const sal_Char *pIndentMap,
                                       rtl_TextEncoding eDestEnc,
-                                        String *pNonConvertableChars    )
+                                      OUStringBuffer* pNonConvertableChars )
 {
     if( RTL_TEXTENCODING_DONTKNOW == eDestEnc )
         eDestEnc = osl_getThreadTextEncoding();
 
-    const String& rOutName = rName.Len() ? rName : rIMap.GetName();
-    DBG_ASSERT( rOutName.Len(), "Kein ImageMap-Name" );
-    if( !rOutName.Len() )
+    const OUString& rOutName = !rName.isEmpty() ? rName : OUString(rIMap.GetName());
+    DBG_ASSERT( rOutName.getLength(), "Kein ImageMap-Name" );
+    if( rOutName.isEmpty() )
         return rStream;
 
     OStringBuffer sOut;
     sOut.append('<')
-        .append(RTL_CONSTASCII_STRINGPARAM(OOO_STRING_SVTOOLS_HTML_map))
+        .append(OOO_STRING_SVTOOLS_HTML_map)
         .append(' ')
-        .append(RTL_CONSTASCII_STRINGPARAM(OOO_STRING_SVTOOLS_HTML_O_name))
-        .append(RTL_CONSTASCII_STRINGPARAM("=\""));
+        .append(OOO_STRING_SVTOOLS_HTML_O_name)
+        .append("=\"");
     rStream << sOut.makeStringAndClear().getStr();
     Out_String( rStream, rOutName, eDestEnc, pNonConvertableChars );
     rStream << "\">";
@@ -718,8 +722,8 @@
                     .append(aCoords).append("\" ");
                 rStream << sOut.makeStringAndClear().getStr();
 
-                String aURL( pObj->GetURL() );
-                if( aURL.Len() && pObj->IsActive() )
+                OUString aURL( pObj->GetURL() );
+                if( !aURL.isEmpty() && pObj->IsActive() )
                 {
                     aURL = URIHelper::simpleNormalizedMakeRelative(
                         rBaseURL, aURL );
@@ -730,8 +734,8 @@
                 else
                     rStream << OOO_STRING_SVTOOLS_HTML_O_nohref;
 
-                const String& rObjName = pObj->GetName();
-                if( rObjName.Len() )
+                const OUString& rObjName = pObj->GetName();
+                if( !rObjName.isEmpty() )
                 {
                     sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_name)
                         .append("=\"");
@@ -739,8 +743,8 @@
                     Out_String( rStream, rObjName, eDestEnc, pNonConvertableChars ) << '\"';
                 }
 
-                const String& rTarget = pObj->GetTarget();
-                if( rTarget.Len() && pObj->IsActive() )
+                const OUString& rTarget = pObj->GetTarget();
+                if( !rTarget.isEmpty() && pObj->IsActive() )
                 {
                     sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_target)
                         .append("=\"");
@@ -748,11 +752,11 @@
                     Out_String( rStream, rTarget, eDestEnc, pNonConvertableChars ) << '\"';
                 }
 
-                String rDesc( pObj->GetAltText() );
-                if( rDesc.Len() == 0 )
+                OUString rDesc( pObj->GetAltText() );
+                if( !rDesc.isEmpty() == 0 )
                     rDesc = pObj->GetDesc();
 
-                if( rDesc.Len() )
+                if( !rDesc.isEmpty() )
                 {
                     sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_alt)
                         .append("=\"");
@@ -781,15 +785,15 @@
 }
 
 SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
-                                   const String& rBaseURL,
-                                   const String& rSource,
-                                   const String& rLanguage,
+                                   const OUString& rBaseURL,
+                                   const OUString& rSource,
+                                   const OUString& rLanguage,
                                    ScriptType eScriptType,
-                                   const String& rSrc,
-                                   const String *pSBLibrary,
-                                   const String *pSBModule,
+                                   const OUString& rSrc,
+                                   const OUString *pSBLibrary,
+                                   const OUString *pSBModule,
                                    rtl_TextEncoding eDestEnc,
-                                   String *pNonConvertableChars )
+                                   OUStringBuffer* pNonConvertableChars )
 {
     if( RTL_TEXTENCODING_DONTKNOW == eDestEnc )
         eDestEnc = osl_getThreadTextEncoding();
@@ -797,19 +801,19 @@
     // Script wird komplett nicht eingerueckt!
     OStringBuffer sOut;
     sOut.append('<')
-        .append(RTL_CONSTASCII_STRINGPARAM(OOO_STRING_SVTOOLS_HTML_script));
+        .append(OOO_STRING_SVTOOLS_HTML_script);
 
-    if( rLanguage.Len() )
+    if( !rLanguage.isEmpty() )
     {
         sOut.append(' ')
-            .append(RTL_CONSTASCII_STRINGPARAM(OOO_STRING_SVTOOLS_HTML_O_language))
-            .append(RTL_CONSTASCII_STRINGPARAM("=\""));
+            .append(OOO_STRING_SVTOOLS_HTML_O_language)
+            .append("=\"");
         rStrm << sOut.makeStringAndClear().getStr();
         Out_String( rStrm, rLanguage, eDestEnc, pNonConvertableChars );
         sOut.append('\"');
     }
 
-    if( rSrc.Len() )
+    if( !rSrc.isEmpty() )
     {
         sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_src).append("=\"");
         rStrm << sOut.makeStringAndClear().getStr();
@@ -839,7 +843,7 @@
 
     rStrm << sOut.makeStringAndClear().getStr();
 
-    if( rSource.Len() || pSBLibrary || pSBModule )
+    if( !rSource.isEmpty() || pSBLibrary || pSBModule )
     {
         rStrm << sNewLine;
 
@@ -870,7 +874,7 @@
             }
         }
 
-        if( rSource.Len() )
+        if( !rSource.isEmpty() )
         {
             // Wir schreiben das Modul mm ANSI-Zeichensatz, aber mit
             // System-Zeilenumbruechen raus.
@@ -900,7 +904,7 @@
                                     const HTMLOutEvent *pEventTable,
                                     sal_Bool bOutStarBasic,
                                     rtl_TextEncoding eDestEnc,
-                                    String *pNonConvertableChars )
+                                    OUStringBuffer* pNonConvertableChars )
 {
     sal_uInt16 i=0;
     while( pEventTable[i].pBasicName || pEventTable[i].pJavaName )
@@ -933,14 +937,14 @@
 OString HTMLOutFuncs::CreateTableDataOptionsValNum(
             sal_Bool bValue,
             double fVal, sal_uLong nFormat, SvNumberFormatter& rFormatter,
-            rtl_TextEncoding eDestEnc, String* pNonConvertableChars)
+            rtl_TextEncoding eDestEnc, OUStringBuffer* pNonConvertableChars)
 {
     OStringBuffer aStrTD;
 
     if ( bValue )
     {
         // printf / scanf ist zu ungenau
-        String aValStr;
+        OUString aValStr;
         rFormatter.GetInputLineString( fVal, 0, aValStr );
         OString sTmp(OUStringToOString(aValStr, eDestEnc));
         aStrTD.append(' ').
@@ -977,12 +981,12 @@
     return aStrTD.makeStringAndClear();
 }
 
-sal_Bool HTMLOutFuncs::PrivateURLToInternalImg( String& rURL )
+sal_Bool HTMLOutFuncs::PrivateURLToInternalImg( OUString& rURL )
 {
-    if( rURL.Len() > 14UL &&
-        rURL.CompareToAscii( OOO_STRING_SVTOOLS_HTML_private_image, 14UL ) == COMPARE_EQUAL )
+    if( rURL.getLength() > 14 &&
+        rURL.startsWith( OOO_STRING_SVTOOLS_HTML_private_image))
     {
-        rURL.Erase( 0UL, 14UL );
+        rURL = rURL.copy(14);
         return sal_True;
     }
 
diff --git a/svtools/source/svrtf/rtfout.cxx b/svtools/source/svrtf/rtfout.cxx
index 64a9a8b..2410bf9 100644
--- a/svtools/source/svrtf/rtfout.cxx
+++ b/svtools/source/svrtf/rtfout.cxx
@@ -19,7 +19,6 @@
 
 #include <tools/debug.hxx>
 #include <tools/stream.hxx>
-#include <tools/string.hxx>
 #include <rtl/string.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <svtools/rtfkeywd.hxx>
@@ -156,12 +155,14 @@
     return rStream;
 }
 
-SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const String& rStr,
-    rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile)
+SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const OUString& rStr,
+                                   rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile)
 {
     int nUCMode = 1;
-    for (xub_StrLen n = 0; n < rStr.Len(); ++n)
-        Out_Char(rStream, rStr.GetChar(n), &nUCMode, eDestEnc, bWriteHelpFile);
+    for (sal_Int32 n = 0; n < rStr.getLength(); ++n)
+    {
+        Out_Char(rStream, rStr[n], &nUCMode, eDestEnc, bWriteHelpFile);
+    }
     if (nUCMode != 1)
       rStream << "\\uc1"<< " "; // #i47831# add an additional whitespace, so that "document 
whitespaces" are not ignored.;
     return rStream;
diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx
index 276e6b6..d32dbc8 100644
--- a/sw/source/filter/html/htmlbas.cxx
+++ b/sw/source/filter/html/htmlbas.cxx
@@ -271,7 +271,7 @@
     for( sal_uInt16 i=0; i<pBasicMan->GetLibCount(); i++ )
     {
         StarBASIC *pBasic = pBasicMan->GetLib( i  );
-        const String& rLibName = pBasic->GetName();
+        const OUString& rLibName = pBasic->GetName();
 
         SbxArray *pModules = pBasic->GetModules();
         for( sal_uInt16 j=0; j<pModules->Count(); j++ )
@@ -298,7 +298,7 @@
                     << "\">";
             }
 
-            const String& rModName = pModule->GetName();
+            const OUString& rModName = pModule->GetName();
             Strm() << SwHTMLWriter::sNewLine;   // nicht einruecken!
             HTMLOutFuncs::OutScript( Strm(), GetBaseURL(), pModule->GetSource(),
                                      sLang, eType, aEmptyStr,
diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx
index b7fdd6f..dc69e6d 100644
--- a/sw/source/filter/html/htmlfly.cxx
+++ b/sw/source/filter/html/htmlfly.cxx
@@ -829,7 +829,7 @@
         OutHTML_INetFmt( rWrt, *pINetFmt, sal_False );
     }
 
-    String aGrfNm( rGrfName );
+    OUString aGrfNm( rGrfName );
     if( !HTMLOutFuncs::PrivateURLToInternalImg(aGrfNm) )
         aGrfNm = URIHelper::simpleNormalizedMakeRelative( rWrt.GetBaseURL(), aGrfNm);
 
@@ -1258,7 +1258,7 @@
     if( pLink )
     {
         sOut.append(' ');
-        String s( *pLink );
+        OUString s( *pLink );
         if( !HTMLOutFuncs::PrivateURLToInternalImg(s) )
             s = URIHelper::simpleNormalizedMakeRelative( rWrt.GetBaseURL(), s);
         sOut.append(OOO_STRING_SVTOOLS_HTML_O_src).
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index c9b1695..4bf7506 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -81,10 +81,10 @@
 
 
 static void lcl_html_outEvents( SvStream& rStrm,
-                         const uno::Reference< form::XFormComponent > rFormComp,
-                         sal_Bool bCfgStarBasic,
-                         rtl_TextEncoding eDestEnc,
-                           String *pNonConvertableChars )
+                                const uno::Reference< form::XFormComponent > rFormComp,
+                                sal_Bool bCfgStarBasic,
+                                rtl_TextEncoding eDestEnc,
+                                OUStringBuffer* pNonConvertableChars )
 {
     uno::Reference< container::XChild > xChild( rFormComp, uno::UNO_QUERY );
     uno::Reference< uno::XInterface > xParentIfc = xChild->getParent();
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 58b7478..16a9f55 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -436,7 +436,7 @@
     for( i=0; i<MAXLEVEL; i++ )
         aBulletGrfs[i].Erase();
 
-    aNonConvertableCharacters.Erase();
+    aNonConvertableCharacters.truncate();
 
     if( bShowProgress )
         ::EndProgress( pDoc->GetDocShell() );
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index fa14c74..0f1133c 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -303,7 +303,7 @@
     SwHTMLTxtFtns *pFootEndNotes;
 
     String aCSS1Selector;           // der Selektor eines Styles
-    String aNonConvertableCharacters;
+    OUStringBuffer aNonConvertableCharacters;
     String aBulletGrfs[MAXLEVEL];   // die Grafiken fuer Listen
 
     ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >  
*pxFormComps; // die aktuelle Form

-- 
To view, visit https://gerrit.libreoffice.org/4254
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I49f0aeb4e97718428ab0b87c659da14fe30dab2e
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Norbert Thiebaud <nthiebaud@gmail.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.