[PATCH] fdo#38838: Replaced some String with OUString

Prashant Pandey (via Code Review) gerrit at gerrit.libreoffice.org
Mon Mar 11 17:15:40 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2672

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/72/2672/1

fdo#38838: Replaced some String with OUString

Change-Id: If913d363229707a60aa1232a0ddaea56403510b3
---
M padmin/source/adddlg.cxx
M padmin/source/adddlg.hxx
M padmin/source/cmddlg.cxx
M padmin/source/helper.cxx
M padmin/source/helper.hxx
M padmin/source/newppdlg.cxx
M svx/source/dialog/checklbx.cxx
7 files changed, 97 insertions(+), 100 deletions(-)



diff --git a/padmin/source/adddlg.cxx b/padmin/source/adddlg.cxx
index f1db9e1..48a9826 100644
--- a/padmin/source/adddlg.cxx
+++ b/padmin/source/adddlg.cxx
@@ -36,7 +36,6 @@
 using namespace padmin;
 using namespace std;
 
-using ::rtl::OUString;
 using ::rtl::OUStringBuffer;
 using ::rtl::OUStringHash;
 using ::rtl::OUStringToOString;
@@ -93,7 +92,7 @@
         rInfo.m_aFeatures = OUString("fax");
     }
     else
-        rInfo.m_aFeatures = OUString();
+        rInfo.m_aFeatures = "";
 }
 
 //--------------------------------------------------------------------
@@ -126,8 +125,8 @@
 
 void APChooseDriverPage::fill( PrinterInfo& rInfo )
 {
-    sal_uInt16 nPos = m_aDriverBox.GetSelectEntryPos();
-    String* pDriver = (String*)m_aDriverBox.GetEntryData( nPos );
+    sal_uInt32 nPos = m_aDriverBox.GetSelectEntryPos();
+    OUString* pDriver = (OUString*)m_aDriverBox.GetEntryData( nPos );
     rInfo.m_aDriverName = *pDriver;
 #if OSL_DEBUG_LEVEL > 1
     fprintf( stderr, "m_aLastPrinterName = \"%s\", rInfo.m_aPrinterName = \"%s\"\n",
@@ -136,30 +135,30 @@
 #endif
     if( rInfo.m_aPrinterName.equals( m_aLastPrinterName ) )
     {
-        String aPrinter( AddPrinterDialog::uniquePrinterName( m_aDriverBox.GetEntry( nPos ) ) );
+        OUString aPrinter( AddPrinterDialog::uniquePrinterName( m_aDriverBox.GetEntry( nPos ) ) );
         rInfo.m_aPrinterName = m_aLastPrinterName = aPrinter;
     }
 }
 
-void APChooseDriverPage::updateDrivers( bool bRefresh, const rtl::OUString& rSelectDriver )
+void APChooseDriverPage::updateDrivers( bool bRefresh, const OUString& rSelectDriver )
 {
     for( int k = 0; k < m_aDriverBox.GetEntryCount(); k++ )
         delete (String*)m_aDriverBox.GetEntryData( k );
     m_aDriverBox.Clear();
 
-    std::list< rtl::OUString > aDrivers;
+    std::list< OUString > aDrivers;
     psp::PPDParser::getKnownPPDDrivers( aDrivers, bRefresh );
 
-    rtl::OUString aSelectDriver( psp::PPDParser::getPPDPrinterName( rSelectDriver ) );
+    OUString aSelectDriver( psp::PPDParser::getPPDPrinterName( rSelectDriver ) );
 
-    rtl::OUString aSelectedEntry;
-    for( std::list< rtl::OUString >::const_iterator it = aDrivers.begin(); it != aDrivers.end(); ++it )
+    OUString aSelectedEntry;
+    for( std::list< OUString >::const_iterator it = aDrivers.begin(); it != aDrivers.end(); ++it )
     {
-        rtl::OUString aDriver( psp::PPDParser::getPPDPrinterName( *it ) );
+        OUString aDriver( psp::PPDParser::getPPDPrinterName( *it ) );
         if( !aDriver.isEmpty() )
         {
             int nPos = m_aDriverBox.InsertEntry( aDriver );
-            m_aDriverBox.SetEntryData( nPos, new String( *it ) );
+            m_aDriverBox.SetEntryData( nPos, new OUString( *it ) );
             if( aDriver == aSelectDriver )
                 aSelectedEntry = aDriver;
         }
@@ -184,7 +183,7 @@
         PPDImportDialog aDlg( this );
         if( aDlg.Execute() )
         {
-            const std::list< rtl::OUString >& rImported( aDlg.getImportedFiles() );
+            const std::list< OUString >& rImported( aDlg.getImportedFiles() );
             if( rImported.empty() )
                 updateDrivers( true );
             else
@@ -199,14 +198,14 @@
         for( int i = 0; i < m_aDriverBox.GetSelectEntryCount(); i++ )
         {
             int nSelect = m_aDriverBox.GetSelectEntryPos(i);
-            String aDriver( *(String*)m_aDriverBox.GetEntryData( nSelect ) );
-            if( aDriver.Len() )
+            OUString aDriver( *(String*)m_aDriverBox.GetEntryData( nSelect ) );
+            if( aDriver.getLength() )
             {
                 // never delete the default driver
-                if( aDriver.EqualsIgnoreCaseAscii( "SGENPRT" ) )
+                if( aDriver.equalsIgnoreAsciiCase( "SGENPRT" ) )
                 {
-                    String aText( PaResId( RID_ERR_REMOVESGENPRT ) );
-                    aText.SearchAndReplace( rtl::OUString( "%s" ), m_aDriverBox.GetSelectEntry( i ) );
+                    OUString aText( PaResId( RID_ERR_REMOVESGENPRT ) );
+                    aText.replaceFirst( OUString( "%s" ), m_aDriverBox.GetSelectEntry( i ) );
                     ErrorBox aErrorBox( this, WB_OK | WB_DEF_OK, aText );
                     aErrorBox.SetText( m_aRemStr );
                     aErrorBox.Execute();
@@ -218,8 +217,8 @@
                 OUString aPPD( aDriver );
                 if( aDefInfo.m_aDriverName == aPPD )
                 {
-                    String aText( PaResId( RID_ERR_REMOVEDEFAULTDRIVER ) );
-                    aText.SearchAndReplace( rtl::OUString( "%s" ), m_aDriverBox.GetSelectEntry( i ) );
+                    OUString aText( PaResId( RID_ERR_REMOVEDEFAULTDRIVER ) );
+                    aText.replaceFirst( OUString( "%s" ), m_aDriverBox.GetSelectEntry( i ) );
                     ErrorBox aErrorBox( this, WB_OK | WB_DEF_OK, aText );
                     aErrorBox.SetText( m_aRemStr );
                     aErrorBox.Execute();
@@ -238,8 +237,8 @@
 
                 if( it != aPrinters.end() )
                 {
-                    String aText( PaResId( RID_QUERY_DRIVERUSED ) );
-                    aText.SearchAndReplace( rtl::OUString( "%s" ), m_aDriverBox.GetSelectEntry( i ) );
+                    OUString aText( PaResId( RID_QUERY_DRIVERUSED ) );
+                    aText.replaceFirst( OUString( "%s" ), m_aDriverBox.GetSelectEntry( i ) );
                     QueryBox aBox( this, WB_YES_NO | WB_DEF_NO, aText );
                     aBox.SetText( m_aRemStr );
                     if( aBox.Execute() == RET_NO )
@@ -247,8 +246,8 @@
                 }
                 else
                 {
-                    String aText( PaResId( RID_QUERY_REMOVEDRIVER ) );
-                    aText.SearchAndReplace( rtl::OUString( "%s" ), m_aDriverBox.GetSelectEntry( i ) );
+                    OUString aText( PaResId( RID_QUERY_REMOVEDRIVER ) );
+                    aText.replaceFirst( OUString( "%s" ), m_aDriverBox.GetSelectEntry( i ) );
                     QueryBox aBox( this, WB_YES_NO | WB_DEF_NO, aText );
                     aBox.SetText( m_aRemStr );
                     if( aBox.Execute() == RET_NO )
@@ -263,10 +262,10 @@
                         rPIManager.removePrinter( *it );
                 }
 
-                std::list< rtl::OUString > aDirs;
+                std::list< OUString > aDirs;
                 // get only psprint's directories, not eventual system dirs
                 psp::getPrinterPathList( aDirs, NULL );
-                std::list< rtl::OUString >::iterator dir;
+                std::list< OUString >::iterator dir;
                 for( dir = aDirs.begin(); dir != aDirs.end(); ++dir )
                 {
                     ::std::list< String > aFiles;
@@ -274,8 +273,8 @@
                     OUStringBuffer aDir( *dir );
                     aDir.append( sal_Unicode( '/' ) );
                     aDir.appendAscii( PRINTER_PPDDIR );
-                    rtl::OUString aPPDDir( aDir.makeStringAndClear() );
-                    FindFiles( aPPDDir, aFiles, String(  "PS;PPD;PS.GZ;PPD.GZ"  ), true );
+                    OUString aPPDDir( aDir.makeStringAndClear() );
+                    FindFiles( aPPDDir, aFiles, OUString(  "PS;PPD;PS.GZ;PPD.GZ"  ), true );
                     for( file = aFiles.begin(); file != aFiles.end(); ++file )
                     {
                         String aFile( aPPDDir );
@@ -286,12 +285,12 @@
                         int nPos = file->SearchBackward( '.' );
                         if( file->Copy( 0, nPos ) == String( aPPD ) )
                         {
-                            rtl::OString aSysPath(rtl::OUStringToOString(aFile, aEncoding));
+                            rtl::OString aSysPath(OUStringToOString(aFile, aEncoding));
                             if (unlink(aSysPath.getStr()))
                             {
-                                String aText( PaResId( RID_ERR_REMOVEDRIVERFAILED ) );
-                                aText.SearchAndReplace( rtl::OUString( "%s1" ), m_aDriverBox.GetSelectEntry( i ) );
-                                aText.SearchAndReplace( rtl::OUString( "%s2" ), aFile );
+                                OUString aText( PaResId( RID_ERR_REMOVEDRIVERFAILED ) );
+                                aText.replaceFirst( OUString( "%s1" ), m_aDriverBox.GetSelectEntry( i ) );
+                                aText.replaceFirst( OUString( "%s2" ), aFile );
                                 ErrorBox aErrorBox( this, WB_OK | WB_DEF_OK, aText );
                                 aErrorBox.SetText( m_aRemStr );
                                 aErrorBox.Execute();
@@ -419,10 +418,10 @@
 APCommandPage::~APCommandPage()
 {
     ::std::list< String > aCommands;
-    String aLastCommand( m_aCommandBox.GetText() );
+    OUString aLastCommand( m_aCommandBox.GetText() );
     for( int i = 0; i < m_aCommandBox.GetEntryCount(); i++ )
     {
-        String aCommand( m_aCommandBox.GetEntry( i ) );
+        OUString aCommand( m_aCommandBox.GetEntry( i ) );
         if( aCommand != aLastCommand )
             aCommands.push_back( aCommand );
     }
@@ -444,7 +443,7 @@
     }
     else if( pButton == &m_aPdfDirBtn )
     {
-        String aPath( m_aPdfDirEdt.GetText() );
+        OUString aPath( m_aPdfDirEdt.GetText() );
         if( chooseDirectory( aPath ) )
             m_aPdfDirEdt.SetText( aPath );
     }
@@ -483,7 +482,7 @@
     m_aSelectAllBtn.SetClickHdl( LINK( this, APOldPrinterPage, ClickBtnHdl ) );
     rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
 
-    String aFileName( AddPrinterDialog::getOldPrinterLocation() );
+    OUString aFileName( AddPrinterDialog::getOldPrinterLocation() );
     Config aConfig( aFileName );
 
     // read defaults
@@ -516,9 +515,9 @@
         const PPDParser* pParser = PPDParser::getParser(rtl::OStringToOUString(aNewDriver, aEncoding));
         if( pParser == NULL )
         {
-            String aText( PaResId( RID_TXT_DRIVERDOESNOTEXIST ) );
-            aText.SearchAndReplace( String(  "%s1"  ), rtl::OStringToOUString(aPrinter, aEncoding) );
-            aText.SearchAndReplace( String(  "%s2"  ), rtl::OStringToOUString(aDriver, aEncoding) );
+            OUString aText( PaResId( RID_TXT_DRIVERDOESNOTEXIST ) );
+            aText.replaceFirst( OUString(  "%s1"  ), rtl::OStringToOUString(aPrinter, aEncoding) );
+            aText.replaceFirst( OUString(  "%s2"  ), rtl::OStringToOUString(aDriver, aEncoding) );
             InfoBox aBox( this, aText );
             aBox.Execute();
             continue;
@@ -529,8 +528,8 @@
         rtl::OString aCommand( aConfig.ReadKey( aPort ) );
         if (aCommand.isEmpty())
         {
-            String aText( PaResId( RID_TXT_PRINTERWITHOUTCOMMAND ) );
-            aText.SearchAndReplace( String(  "%s"  ), rtl::OStringToOUString(aPrinter, aEncoding) );
+            OUString aText( PaResId( RID_TXT_PRINTERWITHOUTCOMMAND ) );
+            aText.replaceFirst( OUString(  "%s"  ), rtl::OStringToOUString(aPrinter, aEncoding) );
             InfoBox aBox( this, aText );
             aBox.Execute();
             continue;
@@ -640,8 +639,8 @@
         pInfo->m_aPrinterName = AddPrinterDialog::uniquePrinterName( pInfo->m_aPrinterName );
         if( ! rManager.addPrinter( pInfo->m_aPrinterName, pInfo->m_aDriverName ) )
         {
-            String aText( PaResId( RID_TXT_PRINTERADDFAILED ) );
-            aText.SearchAndReplace( String(  "%s"  ), pInfo->m_aPrinterName );
+            OUString aText( PaResId( RID_TXT_PRINTERADDFAILED ) );
+            aText.replaceFirst( OUString(  "%s"  ), pInfo->m_aPrinterName );
                 ErrorBox aBox( this, WB_OK | WB_DEF_OK, aText );
                 aBox.Execute();
                 continue;
@@ -887,7 +886,7 @@
     else if( m_pCurrentPage == m_pFaxCommandPage )
     {
         if( ! m_pFaxNamePage )
-            m_pFaxNamePage = new APNamePage( this, String(), DeviceKind::Fax );
+            m_pFaxNamePage = new APNamePage( this, OUString(), DeviceKind::Fax );
         m_pCurrentPage = m_pFaxNamePage;
         m_aNextPB.Enable( sal_False );
         m_aFinishPB.Enable( sal_True );
@@ -916,7 +915,7 @@
     else if( m_pCurrentPage == m_pPdfCommandPage )
     {
         if( ! m_pPdfNamePage )
-            m_pPdfNamePage = new APNamePage( this, String(), DeviceKind::Pdf );
+            m_pPdfNamePage = new APNamePage( this, OUString(), DeviceKind::Pdf );
         m_pCurrentPage = m_pPdfNamePage;
         m_aNextPB.Enable( sal_False );
         m_aFinishPB.Enable( sal_True );
@@ -1057,9 +1056,9 @@
     return 0;
 }
 
-String AddPrinterDialog::uniquePrinterName( const String& rBase )
+OUString AddPrinterDialog::uniquePrinterName( const OUString& rBase )
 {
-    String aResult( rBase );
+    OUString aResult( rBase );
 
     PrinterInfoManager& rManager( PrinterInfoManager::get() );
 
@@ -1072,8 +1071,8 @@
     while( aPrinters.find( aResult ) != aPrinters.end() )
     {
         aResult = rBase;
-        aResult.AppendAscii( "_" );
-        aResult += rtl::OUString::valueOf(nVersion++);
+        aResult +=  "_"  ;
+        aResult += OUString::valueOf(nVersion++);
     }
 
     return aResult;
@@ -1115,7 +1114,7 @@
         }
     }
 
-    return !aFileName.isEmpty() ? rtl::OStringToOUString(aFileName, aEncoding) : rtl::OUString();
+    return !aFileName.isEmpty() ? rtl::OStringToOUString(aFileName, aEncoding) : OUString();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/padmin/source/adddlg.hxx b/padmin/source/adddlg.hxx
index ab55bb1..0ceb8fc 100644
--- a/padmin/source/adddlg.hxx
+++ b/padmin/source/adddlg.hxx
@@ -229,7 +229,7 @@
     AddPrinterDialog( Window* pParent );
     ~AddPrinterDialog();
 
-    static String uniquePrinterName( const String& rString );
+    static OUString uniquePrinterName( const OUString& rString );
     static String getOldPrinterLocation();
 
     void enableNext( bool bEnable ) { m_aNextPB.Enable( bEnable ); }
diff --git a/padmin/source/cmddlg.cxx b/padmin/source/cmddlg.cxx
index 5cad04d..f281ffe 100644
--- a/padmin/source/cmddlg.cxx
+++ b/padmin/source/cmddlg.cxx
@@ -30,7 +30,6 @@
 using namespace psp;
 using namespace padmin;
 
-using ::rtl::OUString;
 
 #define PRINTER_PERSISTENCE_GROUP "KnownPrinterCommands"
 #define FAX_PERSISTENCE_GROUP "KnownFaxCommands"
@@ -62,7 +61,7 @@
         bOnce = true;
         char pBuffer[1024];
         FILE* pPipe;
-        String aCommand;
+        OUString aCommand;
         rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
 
         pPipe = popen( "which gs 2>/dev/null", "r" );
@@ -73,15 +72,15 @@
                 int nLen = strlen( pBuffer );
                 if( pBuffer[nLen-1] == '\n' ) // strip newline
                     pBuffer[--nLen] = 0;
-                aCommand = rtl::OUString(pBuffer, nLen, aEncoding);
-                if( ( ( aCommand.GetChar( 0 ) == '/' )
-                      || ( aCommand.GetChar( 0 ) == '.' && aCommand.GetChar( 1 ) == '/' )
-                      || ( aCommand.GetChar( 0 ) == '.' && aCommand.GetChar( 1 ) == '.' && aCommand.GetChar( 2 ) == '/' ) )
+                aCommand = OUString(pBuffer, nLen, aEncoding);
+                if( ( ( aCommand[ 0 ] == '/' )
+                      || ( aCommand[ 0 ] == '.' && aCommand[ 1 ] == '/' )
+                      || ( aCommand[ 0 ] == '.' && aCommand[ 1 ] == '.' && aCommand[ 2 ] == '/' ) )
                     && nLen > 2
-                    && aCommand.GetChar( nLen-2 ) == 'g'
-                    && aCommand.GetChar( nLen-1 ) == 's' )
+                    && aCommand[ nLen-2 ] == 'g'
+                    && aCommand[ nLen-1 ] == 's' )
                 {
-                    aCommand.AppendAscii( " -q -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=\"(OUTFILE)\" -" );
+                    aCommand += " -q -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=\"(OUTFILE)\" -" ;
                     aSysCommands.push_back( aCommand );
                 }
             }
@@ -96,14 +95,14 @@
                 int nLen = strlen( pBuffer );
                 if( pBuffer[nLen-1] == '\n' ) // strip newline
                     pBuffer[--nLen] = 0;
-                aCommand = rtl::OUString(pBuffer, nLen, aEncoding);
-                if( ( ( aCommand.GetChar( 0 ) == '/' )
-                      || ( aCommand.GetChar( 0 ) == '.' && aCommand.GetChar( 1 ) == '/' )
-                      || ( aCommand.GetChar( 0 ) == '.' && aCommand.GetChar( 1 ) == '.' && aCommand.GetChar( 2 ) == '/' ) )
+                aCommand = OUString(pBuffer, nLen, aEncoding);
+                if( ( ( aCommand[ 0 ] == '/' )
+                      || ( aCommand[ 0 ] == '.' && aCommand[ 1 ] == '/' )
+                      || ( aCommand[ 0 ] == '.' && aCommand[ 1 ] == '.' && aCommand[ 2 ] == '/' ) )
                     && nLen > 7
-                    && aCommand.Copy( nLen - 8 ).EqualsAscii( "/distill" ) )
+                    && aCommand.copy( nLen - 8 ).equalsAscii( "/distill" ) )
                 {
-                    aCommand.AppendAscii( " (TMP) ; mv `echo (TMP) | sed s/\\.ps\\$/.pdf/` \"(OUTFILE)\"" );
+                    aCommand += " (TMP) ; mv `echo (TMP) | sed s/\\.ps\\$/.pdf/` \"(OUTFILE)\"" ;
                     aSysCommands.push_back( aCommand );
                 }
             }
@@ -125,8 +124,8 @@
     ::std::list< String >::const_iterator it;
     while( nKeys-- )
     {
-        String aCommand( rConfig.ReadKey(rtl::OString::valueOf(nKeys), RTL_TEXTENCODING_UTF8 ) );
-        if( aCommand.Len() )
+        OUString aCommand( rConfig.ReadKey(rtl::OString::valueOf(nKeys), RTL_TEXTENCODING_UTF8 ) );
+        if( aCommand.getLength() )
         {
             for( it = rCommands.begin(); it != rCommands.end() && *it != aCommand; ++it )
                 ;
@@ -168,7 +167,7 @@
         nWritten--;
     }
     for( nWritten = 0, it = aWriteList.begin(); it != aWriteList.end(); ++it, ++nWritten )
-        rConfig.WriteKey( rtl::OString::valueOf(nWritten), rtl::OUStringToOString(*it, RTL_TEXTENCODING_UTF8) );
+        rConfig.WriteKey( rtl::OString::valueOf(nWritten), OUStringToOString(*it, RTL_TEXTENCODING_UTF8) );
 }
 
 
@@ -321,7 +320,7 @@
     bool bHavePdf = m_aConfigureBox.GetSelectEntryPos() == m_nPdfEntry ? true : false;
     ::std::list< String >::iterator it;
 
-    String aFeatures;
+    OUString aFeatures;
     sal_Int32 nIndex = 0;
     OUString aOldPdfPath;
     bool bOldFaxSwallow = false;
@@ -338,9 +337,9 @@
         {
             if( !aToken.isEmpty() )
             {
-                if( aFeatures.Len() )
-                    aFeatures += ',';
-                aFeatures += String( aToken );
+                if( aFeatures.getLength() )
+                    aFeatures += ",";
+                aFeatures += OUString( aToken );
             }
         }
         else if( aToken.startsWith( "pdf=" ) )
@@ -357,25 +356,25 @@
     ::std::list< String >* pList = &m_aPrinterCommands;
     if( bExternalDialog )
     {
-        if( aFeatures.Len() )
-            aFeatures += ',';
-        aFeatures.AppendAscii( "external_dialog" );
+        if( aFeatures.getLength() )
+            aFeatures += ",";
+        aFeatures += "external_dialog" ;
     }
     if( bHaveFax )
     {
-        if( aFeatures.Len() )
-            aFeatures += ',';
-        aFeatures.AppendAscii( "fax=" );
+        if( aFeatures.getLength() )
+            aFeatures += ",";
+        aFeatures += "fax=" ;
         if( bFaxSwallow )
-            aFeatures.AppendAscii( "swallow" );
+            aFeatures += "swallow" ;
         pList = &m_aFaxCommands;
     }
     if( bHavePdf )
     {
-        if( aFeatures.Len() )
-            aFeatures += ',';
-        aFeatures.AppendAscii( "pdf=" );
-        aFeatures.Append( m_aPdfDirectoryEdit.GetText() );
+        if( aFeatures.getLength() )
+            aFeatures += ",";
+        aFeatures += "pdf=" ;
+        aFeatures += m_aPdfDirectoryEdit.GetText() ;
         pList = &m_aPdfCommands;
     }
     aCommand = m_aCommandsCB.GetText();
@@ -433,7 +432,7 @@
 {
     if( pButton == & m_aPdfDirectoryButton )
     {
-        String aPath( m_aPdfDirectoryEdit.GetText() );
+        OUString aPath( m_aPdfDirectoryEdit.GetText() );
         if( chooseDirectory( aPath ) )
             m_aPdfDirectoryEdit.SetText( aPath );
     }
diff --git a/padmin/source/helper.cxx b/padmin/source/helper.cxx
index 1f260ac..5b2e5b5 100644
--- a/padmin/source/helper.cxx
+++ b/padmin/source/helper.cxx
@@ -87,7 +87,7 @@
  *  FindFiles
  */
 
-void padmin::FindFiles( const String& rDirectory, ::std::list< String >& rResult, const String& rSuffixes, bool bRecursive )
+void padmin::FindFiles( const OUString& rDirectory, ::std::list< String >& rResult, const OUString& rSuffixes, bool bRecursive )
 {
     rResult.clear();
 
@@ -111,11 +111,11 @@
                 int nToken = comphelper::string::getTokenCount(rSuffixes, ';');
                 while( nToken-- )
                 {
-                    String aSuffix = rSuffixes.GetToken( nToken, ';' );
-                    if( aFileName.Len() > aSuffix.Len()+1 )
+                    OUString aSuffix = rSuffixes.getToken( nToken, ';' );
+                    if( aFileName.Len() > aSuffix.getLength()+1 )
                     {
-                        String aExtension = aFileName.Copy( aFileName.Len()-aSuffix.Len() );
-                        if( aFileName.GetChar( aFileName.Len()-aSuffix.Len()-1 ) == '.' &&
+                        String aExtension = aFileName.Copy( aFileName.Len()-aSuffix.getLength() );
+                        if( aFileName.GetChar( aFileName.Len()-aSuffix.getLength()-1 ) == '.' &&
                             aExtension.EqualsIgnoreCaseAscii( aSuffix ) )
                         {
                             rResult.push_back( aFileName );
@@ -271,7 +271,7 @@
         delete pRC, pRC = NULL;
 }
 
-bool padmin::chooseDirectory( String& rInOutPath )
+bool padmin::chooseDirectory( OUString& rInOutPath )
 {
     bool bRet = false;
     Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
diff --git a/padmin/source/helper.hxx b/padmin/source/helper.hxx
index d252c17..558f106 100644
--- a/padmin/source/helper.hxx
+++ b/padmin/source/helper.hxx
@@ -103,12 +103,12 @@
 
 ResId PaResId( sal_uInt32 nId );
 
-void FindFiles( const String& rDirectory, ::std::list< String >& rResult, const String& rSuffixes, bool bRecursive = false );
+void FindFiles( const OUString& rDirectory, ::std::list< String >& rResult, const OUString& rSuffixes, bool bRecursive = false );
 
 Config& getPadminRC();
 void freePadminRC();
 
-bool chooseDirectory( String& rInOutPath );
+bool chooseDirectory( OUString& rInOutPath );
 
 } // namespace padmin
 
diff --git a/padmin/source/newppdlg.cxx b/padmin/source/newppdlg.cxx
index e99eaeb..18c0b8e 100644
--- a/padmin/source/newppdlg.cxx
+++ b/padmin/source/newppdlg.cxx
@@ -44,7 +44,6 @@
 using namespace psp;
 using namespace osl;
 
-using ::rtl::OUString;
 using ::rtl::OUStringToOString;
 
 PPDImportDialog::PPDImportDialog( Window* pParent ) :
@@ -97,7 +96,7 @@
 
 void PPDImportDialog::Import()
 {
-    String aImportPath( m_aPathBox.GetText() );
+    OUString aImportPath( m_aPathBox.GetText() );
 
     Config& rConfig = getPadminRC();
     rConfig.SetGroup( PPDIMPORT_GROUP );
@@ -125,7 +124,7 @@
     aProgress.startOperation( m_aLoadingPPD );
 
     ::std::list< String > aFiles;
-    FindFiles( aImportPath, aFiles, String( RTL_CONSTASCII_USTRINGPARAM( "PS;PPD;PS.GZ;PPD.GZ" ) ), true );
+    FindFiles( aImportPath, aFiles, OUString( "PS;PPD;PS.GZ;PPD.GZ" ), true );
 
     int i = 0;
     aProgress.setRange( 0, aFiles.size() );
@@ -161,9 +160,9 @@
     else if( pButton == &m_aOKBtn )
     {
         // copy the files
-        ::std::list< rtl::OUString > aToDirs;
+        ::std::list< OUString > aToDirs;
         psp::getPrinterPathList( aToDirs, PRINTER_PPDDIR );
-        ::std::list< rtl::OUString >::iterator writeDir = aToDirs.begin();
+        ::std::list< OUString >::iterator writeDir = aToDirs.begin();
         m_aImportedFiles.clear();
 
         for( int i = 0; i < m_aDriverLB.GetSelectEntryCount(); i++ )
@@ -190,7 +189,7 @@
     }
     else if( pButton == &m_aSearchBtn )
     {
-        String aPath( m_aPathBox.GetText() );
+        OUString aPath( m_aPathBox.GetText() );
         if( chooseDirectory( aPath ) )
         {
             m_aPathBox.SetText( aPath );
diff --git a/svx/source/dialog/checklbx.cxx b/svx/source/dialog/checklbx.cxx
index 1a9e019..829b65b 100644
--- a/svx/source/dialog/checklbx.cxx
+++ b/svx/source/dialog/checklbx.cxx
@@ -173,7 +173,7 @@
 
 // -----------------------------------------------------------------------
 
-void* SvxCheckListBox::GetEntryData( sal_uInt16 nPos ) const
+void* SvxCheckListBox::GetEntryData( sal_Int32 nPos ) const
 {
     if ( nPos < GetEntryCount() )
         return GetEntry( nPos )->GetUserData();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If913d363229707a60aa1232a0ddaea56403510b3
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Prashant Pandey <prashant3.yishu at gmail.com>



More information about the LibreOffice mailing list