[PATCH] fdo#38838, replacement of String with OUString

Ádám Király (via_Code_Review) gerrit at gerrit.libreoffice.org
Tue Mar 5 01:59:55 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2554

To pull it, you can do:

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

fdo#38838, replacement of String with OUString

Replaced String with OUString in mediawindow.cxx, basdoc.cxx,
basdoc.hxx and bastype3.cxx. In other files I only replaced,
what was necessary for the changes in basdoc to work.

Change-Id: I1ad0e7e262f8becdf57f182853aaa914a88895a4
---
M avmedia/source/viewer/mediawindow.cxx
M basctl/source/basicide/basdoc.cxx
M basctl/source/basicide/basdoc.hxx
M basctl/source/basicide/bastype3.cxx
M sc/source/ui/docshell/docsh.cxx
M sc/source/ui/inc/docsh.hxx
M sd/source/ui/docshell/docshel4.cxx
M sd/source/ui/inc/DrawDocShell.hxx
M sfx2/inc/sfx2/objsh.hxx
M sfx2/source/doc/objembed.cxx
M sfx2/source/doc/objstor.cxx
M starmath/inc/document.hxx
M starmath/source/document.cxx
M svtools/inc/svtools/transfer.hxx
M svtools/source/misc/transfer.cxx
M sw/inc/docsh.hxx
M sw/inc/globdoc.hxx
M sw/inc/wdocsh.hxx
M sw/source/ui/app/docsh2.cxx
M sw/source/ui/globdoc/globdoc.cxx
M sw/source/ui/web/wdocsh.cxx
21 files changed, 63 insertions(+), 63 deletions(-)



diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx
index 574fa76..a60dd5c 100644
--- a/avmedia/source/viewer/mediawindow.cxx
+++ b/avmedia/source/viewer/mediawindow.cxx
@@ -288,7 +288,7 @@
     }
 
     // add filter for all types
-    aDlg.AddFilter( AVMEDIA_RESID( AVMEDIA_STR_ALL_FILES ), String( "*.*"  ) );
+    aDlg.AddFilter( AVMEDIA_RESID( AVMEDIA_STR_ALL_FILES ), OUString( "*.*"  ) );
 
     uno::Reference<ui::dialogs::XFilePicker> const xFP(aDlg.GetFilePicker());
     uno::Reference<ui::dialogs::XFilePickerControlAccess> const xCtrlAcc(xFP,
diff --git a/basctl/source/basicide/basdoc.cxx b/basctl/source/basicide/basdoc.cxx
index 119657c..d682f4e 100644
--- a/basctl/source/basicide/basdoc.cxx
+++ b/basctl/source/basicide/basdoc.cxx
@@ -70,7 +70,7 @@
         pPrinter.reset(pPr);
 }
 
-void DocShell::FillClass( SvGlobalName*, sal_uInt32*, String*, String*, String*, sal_Int32, sal_Bool bTemplate) const
+void DocShell::FillClass( SvGlobalName*, sal_uInt32*, OUString*, OUString*, OUString*, sal_Int32, sal_Bool bTemplate) const
 {
     (void)bTemplate;
     DBG_ASSERT( !bTemplate, "No template for Basic" );
diff --git a/basctl/source/basicide/basdoc.hxx b/basctl/source/basicide/basdoc.hxx
index 19a0ae6..e471545 100644
--- a/basctl/source/basicide/basdoc.hxx
+++ b/basctl/source/basicide/basdoc.hxx
@@ -41,9 +41,9 @@
                           sal_uInt16 nAspect = ASPECT_CONTENT );
     virtual void    FillClass( SvGlobalName * pClassName,
                                sal_uInt32 * pFormat,
-                               String * pAppName,
-                               String * pFullTypeName,
-                               String * pShortTypeName,
+                               OUString * pAppName,
+                               OUString * pFullTypeName,
+                               OUString * pShortTypeName,
                                sal_Int32 nVersion,
                                sal_Bool bTemplate = false ) const;
 
diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx
index c734642..54c5507 100644
--- a/basctl/source/basicide/bastype3.cxx
+++ b/basctl/source/basicide/bastype3.cxx
@@ -204,7 +204,7 @@
             DBG_ASSERT( pLE, "Can not find entry in array" );
             Entry* pBE = static_cast<Entry*>(pLE->GetUserData());
             DBG_ASSERT( pBE, "The data in the entry not found!" );
-            String aName( GetEntryText( pLE ) );
+            OUString aName( GetEntryText( pLE ) );
 
             switch ( pBE->GetType() )
             {
@@ -221,8 +221,8 @@
                 // extract the module name from the string like "Sheet1 (Example1)"
                 if( bDocumentObjects )
                 {
-                    sal_uInt16 nIndex = 0;
-                    aName = aName.GetToken( 0, ' ', nIndex );
+                    sal_Int32 nIndex = 0;
+                    aName = aName.getToken( 0, ' ', nIndex );
                 }
                 pVar = static_cast<StarBASIC*>(pVar)->FindModule( aName );
                 break;
@@ -261,10 +261,10 @@
 {
     ScriptDocument aDocument( ScriptDocument::getApplicationScriptDocument() );
     LibraryLocation eLocation = LIBRARY_LOCATION_UNKNOWN;
-    String aLibName;
-    String aLibSubName;
-    String aName;
-    String aMethodName;
+    OUString aLibName;
+    OUString aLibSubName;
+    OUString aName;
+    OUString aMethodName;
     EntryType eType = OBJ_TYPE_UNKNOWN;
 
     if ( !pEntry )
@@ -380,9 +380,9 @@
     EntryDescriptor aDesc( GetEntryDescriptor( pEntry ) );
     ScriptDocument aDocument( aDesc.GetDocument() );
     LibraryLocation eLocation( aDesc.GetLocation() );
-    String aLibName( aDesc.GetLibName() );
-    String aName( aDesc.GetName() );
-    String aMethodName( aDesc.GetMethodName() );
+    OUString aLibName( aDesc.GetLibName() );
+    OUString aName( aDesc.GetName() );
+    OUString aMethodName( aDesc.GetMethodName() );
     EntryType eType( aDesc.GetType() );
 
     switch ( eType )
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 0c585a9..a9707de 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -171,9 +171,9 @@
 
 void ScDocShell::FillClass( SvGlobalName* pClassName,
                                         sal_uInt32* pFormat,
-                                        String* /* pAppName */,
-                                        String* pFullTypeName,
-                                        String* pShortTypeName,
+                                        OUString* /* pAppName */,
+                                        OUString* pFullTypeName,
+                                        OUString* pShortTypeName,
                                         sal_Int32 nFileFormat,
                                         sal_Bool bTemplate /* = sal_False */) const
 {
@@ -181,8 +181,8 @@
     {
         *pClassName     = SvGlobalName( SO3_SC_CLASSID_60 );
         *pFormat        = SOT_FORMATSTR_ID_STARCALC_60;
-        *pFullTypeName  = String( ScResId( SCSTR_LONG_SCDOC_NAME ) );
-        *pShortTypeName = String( ScResId( SCSTR_SHORT_SCDOC_NAME ) );
+        *pFullTypeName  = OUString( ScResId( SCSTR_LONG_SCDOC_NAME ) );
+        *pShortTypeName = OUString( ScResId( SCSTR_SHORT_SCDOC_NAME ) );
     }
     else if ( nFileFormat == SOFFICE_FILEFORMAT_8 )
     {
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index b49bbe4..ade8dfb 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -189,9 +189,9 @@
 
     virtual void    FillClass( SvGlobalName * pClassName,
                                sal_uInt32 * pFormat,
-                               String * pAppName,
-                               String * pFullTypeName,
-                               String * pShortTypeName,
+                               OUString * pAppName,
+                               OUString * pFullTypeName,
+                               OUString * pShortTypeName,
                                sal_Int32 nFileFormat,
                                sal_Bool bTemplate = false ) const;
 
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 195ca1c..dda95b1 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -937,9 +937,9 @@
 
 void DrawDocShell::FillClass(SvGlobalName* pClassName,
                                         sal_uInt32*  pFormat,
-                                        String* ,
-                                        String* pFullTypeName,
-                                        String* pShortTypeName,
+                                        OUString* ,
+                                        OUString* pFullTypeName,
+                                        OUString* pShortTypeName,
                                         sal_Int32 nFileFormat,
                                         sal_Bool bTemplate /* = sal_False */) const
 {
@@ -949,13 +949,13 @@
         {
                 *pClassName = SvGlobalName(SO3_SDRAW_CLASSID_60);
                 *pFormat = SOT_FORMATSTR_ID_STARDRAW_60;
-                *pFullTypeName = String(SdResId(STR_GRAPHIC_DOCUMENT_FULLTYPE_60));
+                *pFullTypeName = OUString(SdResId(STR_GRAPHIC_DOCUMENT_FULLTYPE_60));
         }
         else
         {
                 *pClassName = SvGlobalName(SO3_SIMPRESS_CLASSID_60);
                 *pFormat = SOT_FORMATSTR_ID_STARIMPRESS_60;
-                *pFullTypeName = String(SdResId(STR_IMPRESS_DOCUMENT_FULLTYPE_60));
+                *pFullTypeName = OUString(SdResId(STR_IMPRESS_DOCUMENT_FULLTYPE_60));
         }
     }
     else if (nFileFormat == SOFFICE_FILEFORMAT_8)
@@ -974,7 +974,7 @@
         }
     }
 
-    *pShortTypeName = String(SdResId( (meDocType == DOCUMENT_TYPE_DRAW) ?
+    *pShortTypeName = OUString(SdResId( (meDocType == DOCUMENT_TYPE_DRAW) ?
                                       STR_GRAPHIC_DOCUMENT : STR_IMPRESS_DOCUMENT ));
 }
 
diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx
index eb75a3c..46afc63 100644
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -96,7 +96,7 @@
     virtual SfxStyleSheetBasePool* GetStyleSheetPool();
     virtual void            SetOrganizerSearchMask(SfxStyleSheetBasePool* pBasePool) const;
     virtual Size            GetFirstPageSize();
-    virtual void            FillClass(SvGlobalName* pClassName, sal_uInt32*  pFormat, String* pAppName, String* pFullTypeName, String* pShortTypeName, sal_Int32 nFileFormat, sal_Bool bTemplate = sal_False ) const;
+    virtual void            FillClass(SvGlobalName* pClassName, sal_uInt32*  pFormat, OUString* pAppName, OUString* pFullTypeName, OUString* pShortTypeName, sal_Int32 nFileFormat, sal_Bool bTemplate = sal_False ) const;
     virtual void            SetModified( sal_Bool = sal_True );
     virtual SfxDocumentInfoDialog*  CreateDocumentInfoDialog( ::Window *pParent,
                                                               const SfxItemSet &rSet );
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index 5d597a8..73a1934 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -619,9 +619,9 @@
 
     virtual void    FillClass( SvGlobalName * pClassName,
                                sal_uInt32 * pFormat,
-                               String * pAppName,
-                               String * pFullTypeName,
-                               String * pShortTypeName,
+                               OUString * pAppName,
+                               OUString * pFullTypeName,
+                               OUString * pShortTypeName,
                                sal_Int32 nVersion,
                                sal_Bool bTemplate = sal_False) const = 0;
 
diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx
index ede1a20..f613e2b 100644
--- a/sfx2/source/doc/objembed.cxx
+++ b/sfx2/source/doc/objembed.cxx
@@ -156,7 +156,7 @@
 void SfxObjectShell::FillTransferableObjectDescriptor( TransferableObjectDescriptor& rDesc ) const
 {
     sal_uInt32 nClipFormat;
-    String aAppName, aShortName;
+    OUString aAppName, aShortName;
     FillClass( &rDesc.maClassName, &nClipFormat, &aAppName, &rDesc.maTypeName, &aShortName, SOFFICE_FILEFORMAT_CURRENT );
 
     rDesc.mnViewAspect = ASPECT_CONTENT;
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index bd862c6..e352b5a 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -315,7 +315,7 @@
     if ( xProps.is() )
     {
         SvGlobalName aName;
-        String aFullTypeName, aShortTypeName, aAppName;
+        OUString aFullTypeName, aShortTypeName, aAppName;
         sal_uInt32 nClipFormat=0;
 
         FillClass( &aName, &nClipFormat, &aAppName, &aFullTypeName, &aShortTypeName, nVersion, bTemplate );
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index 08c8050..b08a59a 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -124,9 +124,9 @@
 
     virtual void        FillClass(SvGlobalName* pClassName,
                                   sal_uInt32*  pFormat,
-                                  String* pAppName,
-                                  String* pFullTypeName,
-                                  String* pShortTypeName,
+                                  OUString* pAppName,
+                                  OUString* pFullTypeName,
+                                  OUString* pShortTypeName,
                                   sal_Int32 nFileFormat,
                                   sal_Bool bTemplate = sal_False ) const;
 
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 7d258e9..6f62221 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -1398,9 +1398,9 @@
 
 void SmDocShell::FillClass(SvGlobalName* pClassName,
                            sal_uInt32*  pFormat,
-                           String* /*pAppName*/,
-                           String* pFullTypeName,
-                           String* pShortTypeName,
+                           OUString* /*pAppName*/,
+                           OUString* pFullTypeName,
+                           OUString* pShortTypeName,
                            sal_Int32 nFileFormat,
                            sal_Bool bTemplate /* = sal_False */) const
 {
diff --git a/svtools/inc/svtools/transfer.hxx b/svtools/inc/svtools/transfer.hxx
index 93dab75..d7f2a35 100644
--- a/svtools/inc/svtools/transfer.hxx
+++ b/svtools/inc/svtools/transfer.hxx
@@ -79,8 +79,8 @@
     Point               maDragStartPos;
     Size                maSize;
     sal_uInt32          mnOle2Misc;
-    String              maTypeName;
-    String              maDisplayName;
+    OUString            maTypeName;
+    OUString            maDisplayName;
     sal_Bool            mbCanLink;
 
     TransferableObjectDescriptor()
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index 55e72da..e702089 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -155,14 +155,14 @@
         aParams += aChar;
     }
 
-    if( rObjDesc.maTypeName.Len() )
+    if( !rObjDesc.maTypeName.isEmpty() )
     {
         aParams += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ";typename=\"" ));
         aParams += rObjDesc.maTypeName;
         aParams += aChar;
     }
 
-    if( rObjDesc.maDisplayName.Len() )
+    if( !rObjDesc.maDisplayName.isEmpty() )
     {
         // the display name might contain unacceptable characters, encode all of them
         // this seems to be the only parameter currently that might contain such characters
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 4d660e5..59e83a3 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -234,9 +234,9 @@
 
     virtual void FillClass( SvGlobalName * pClassName,
                                    sal_uInt32 * pClipFormat,
-                                   String * pAppName,
-                                   String * pLongUserName,
-                                   String * pUserName,
+                                   OUString * pAppName,
+                                   OUString * pLongUserName,
+                                   OUString * pUserName,
                                    sal_Int32 nFileFormat,
                                    sal_Bool bTemplate = sal_False ) const;
 
diff --git a/sw/inc/globdoc.hxx b/sw/inc/globdoc.hxx
index 7e303a2..d454129 100644
--- a/sw/inc/globdoc.hxx
+++ b/sw/inc/globdoc.hxx
@@ -34,9 +34,9 @@
 
     virtual void    FillClass( SvGlobalName * pClassName,
                                    sal_uInt32 * pClipFormat,
-                                   String * pAppName,
-                                   String * pLongUserName,
-                                   String * pUserName,
+                                   OUString * pAppName,
+                                   OUString * pLongUserName,
+                                   OUString * pUserName,
                                    sal_Int32 nFileFormat,
                                    sal_Bool bTemplate = sal_False ) const;
 };
diff --git a/sw/inc/wdocsh.hxx b/sw/inc/wdocsh.hxx
index 8c7894b..eca34a6 100644
--- a/sw/inc/wdocsh.hxx
+++ b/sw/inc/wdocsh.hxx
@@ -40,9 +40,9 @@
 
     virtual void        FillClass( SvGlobalName * pClassName,
                                    sal_uInt32 * pClipFormat,
-                                   String * pAppName,
-                                   String * pLongUserName,
-                                   String * pUserName,
+                                   OUString * pAppName,
+                                   OUString * pLongUserName,
+                                   OUString * pUserName,
                                    sal_Int32 nFileFormat,
                                    sal_Bool bTemplate = sal_False ) const;
     sal_uInt16      GetSourcePara()const
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 253d958..fda720c 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -1491,9 +1491,9 @@
 
 void SwDocShell::FillClass( SvGlobalName * pClassName,
                                    sal_uInt32 * pClipFormat,
-                                   String * /*pAppName*/,
-                                   String * pLongUserName,
-                                   String * pUserName,
+                                   OUString * /*pAppName*/,
+                                   OUString * pLongUserName,
+                                   OUString * pUserName,
                                    sal_Int32 nVersion,
                                    sal_Bool bTemplate /* = sal_False */) const
 {
diff --git a/sw/source/ui/globdoc/globdoc.cxx b/sw/source/ui/globdoc/globdoc.cxx
index 89ef733..679babc 100644
--- a/sw/source/ui/globdoc/globdoc.cxx
+++ b/sw/source/ui/globdoc/globdoc.cxx
@@ -47,9 +47,9 @@
 
 void SwGlobalDocShell::FillClass( SvGlobalName * pClassName,
                                    sal_uInt32 * pClipFormat,
-                                   String * /*pAppName*/,
-                                   String * pLongUserName,
-                                   String * pUserName,
+                                   OUString * /*pAppName*/,
+                                   OUString * pLongUserName,
+                                   OUString * pUserName,
                                    sal_Int32 nVersion,
                                    sal_Bool bTemplate /* = sal_False */) const
 {
diff --git a/sw/source/ui/web/wdocsh.cxx b/sw/source/ui/web/wdocsh.cxx
index 5d02794..fd5622c 100644
--- a/sw/source/ui/web/wdocsh.cxx
+++ b/sw/source/ui/web/wdocsh.cxx
@@ -62,9 +62,9 @@
 
 void SwWebDocShell::FillClass( SvGlobalName * pClassName,
                                    sal_uInt32 * pClipFormat,
-                                   String * /*pAppName*/,
-                                   String * pLongUserName,
-                                   String * pUserName,
+                                   OUString * /*pAppName*/,
+                                   OUString * pLongUserName,
+                                   OUString * pUserName,
                                    sal_Int32 nVersion,
                                    sal_Bool bTemplate /* = sal_False */) const
 {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ad0e7e262f8becdf57f182853aaa914a88895a4
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Ádám Király <kiraly.adam.csaba at gmail.com>



More information about the LibreOffice mailing list