[Libreoffice-commits] core.git: cui/source fpicker/source sd/source sfx2/source svtools/source svx/source unotools/inc unotools/source uui/source

Chr. Rossmanith ChrRossmanith at gmx.de
Wed Mar 20 05:10:28 PDT 2013


 cui/source/dialogs/hldocntp.cxx               |   16 ++++++++--------
 cui/source/dialogs/hldoctp.cxx                |    6 +++---
 cui/source/dialogs/hltpbase.cxx               |    4 ++--
 cui/source/dialogs/multipat.cxx               |    6 +++---
 fpicker/source/office/iodlg.cxx               |   14 +++++++-------
 sd/source/filter/ppt/pptin.cxx                |    4 ++--
 sfx2/source/appl/linkmgr2.cxx                 |    8 ++++----
 sfx2/source/doc/printhelper.cxx               |    8 ++++----
 sfx2/source/inet/inettbc.cxx                  |    4 ++--
 svtools/source/control/inettbc.cxx            |    6 ++++--
 svx/source/dialog/docrecovery.cxx             |    4 ++--
 unotools/inc/unotools/localfilehelper.hxx     |    4 ++--
 unotools/source/ucbhelper/localfilehelper.cxx |   18 +++++++++---------
 uui/source/fltdlg.cxx                         |    2 +-
 14 files changed, 53 insertions(+), 51 deletions(-)

New commits:
commit 9d548d56cf19b01273f719b52a45f48ab13ed45a
Author: Chr. Rossmanith <ChrRossmanith at gmx.de>
Date:   Tue Mar 19 23:07:53 2013 +0100

    Replace String with OUString (unotools)
    
    Change-Id: I9a0677cb36805d0a27514824c937901f73fee1c8
    Reviewed-on: https://gerrit.libreoffice.org/2864
    Reviewed-by: Noel Power <noel.power at suse.com>
    Tested-by: Noel Power <noel.power at suse.com>

diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 6e1a971..2032577 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -402,13 +402,13 @@ IMPL_LINK_NOARG(SvxHyperlinkNewDocTp, ClickNewHdl_Impl)
     uno::Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
     uno::Reference < XFolderPicker2 >  xFolderPicker = FolderPicker::create(xContext);
 
-    String              aStrURL;
-    String              aTempStrURL( maCbbPath.GetText() );
+    OUString            aStrURL;
+    OUString            aTempStrURL( maCbbPath.GetText() );
     utl::LocalFileHelper::ConvertSystemPathToURL( aTempStrURL, maCbbPath.GetBaseURL(), aStrURL );
 
     String              aStrPath = aStrURL;
-    sal_Bool                bZeroPath = ( aStrPath.Len() == 0 );
-    sal_Bool                bHandleFileName = bZeroPath;    // when path has length of 0, then the rest should always be handled
+    sal_Bool            bZeroPath = ( aStrPath.Len() == 0 );
+    sal_Bool            bHandleFileName = bZeroPath;    // when path has length of 0, then the rest should always be handled
                                                         //  as file name, otherwise we do not yet know
 
     if( bZeroPath )
@@ -427,13 +427,13 @@ IMPL_LINK_NOARG(SvxHyperlinkNewDocTp, ClickNewHdl_Impl)
         INetURLObject   aURL( aStrURL, INET_PROT_FILE );
         String          aStrName;
         if( bHandleFileName )
-            aStrName = bZeroPath? aTempStrURL : String(aURL.getName());
+            aStrName = bZeroPath? aTempStrURL : OUString(aURL.getName());
 
         maCbbPath.SetBaseURL( xFolderPicker->getDirectory() );
-        String          aStrTmp( xFolderPicker->getDirectory() );
+        OUString          aStrTmp( xFolderPicker->getDirectory() );
 
-        if( aStrTmp.GetChar( aStrTmp.Len() - 1 ) != sSlash[0] )
-            aStrTmp.AppendAscii( sSlash );
+        if( aStrTmp[ aStrTmp.getLength() - 1 ] != sSlash[0] )
+            aStrTmp += OUString( sSlash );
 
         // append old file name
         if( bHandleFileName )
diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx
index 21fcce5..a7db3c3 100644
--- a/cui/source/dialogs/hldoctp.cxx
+++ b/cui/source/dialogs/hldoctp.cxx
@@ -120,7 +120,7 @@ void SvxHyperlinkDocTp::FillDlgFields ( String& aStrURL )
 String SvxHyperlinkDocTp::GetCurrentURL ()
 {
     // get data from dialog-controls
-    String aStrURL;
+    OUString aStrURL;
     String aStrPath ( maCbbPath.GetText() );
     const String aBaseURL ( maCbbPath.GetBaseURL() );
     String aStrMark( maEdTarget.GetText() );
@@ -140,7 +140,7 @@ String SvxHyperlinkDocTp::GetCurrentURL ()
 
     if( aStrMark != aEmptyStr )
     {
-        aStrURL.AppendAscii( sHash );
+        aStrURL += OUString( sHash );
         aStrURL += aStrMark;
     }
 
@@ -213,7 +213,7 @@ IMPL_LINK_NOARG(SvxHyperlinkDocTp, ClickFileopenHdl_Impl)
     if ( ERRCODE_NONE == nError )
     {
         String aURL( aDlg.GetPath() );
-        String aPath;
+        OUString aPath;
 
         utl::LocalFileHelper::ConvertURLToSystemPath( aURL, aPath );
 
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index dfb0037..9df36a8 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -515,7 +515,7 @@ sal_Bool SvxHyperlinkTabPageBase::FillItemSet( SfxItemSet& rOut)
 
 String SvxHyperlinkTabPageBase::CreateUiNameFromURL( const String& aStrURL )
 {
-    String          aStrUiURL;
+    OUString          aStrUiURL;
     INetURLObject   aURLObj( aStrURL );
 
     switch(aURLObj.GetProtocol())
@@ -536,7 +536,7 @@ String SvxHyperlinkTabPageBase::CreateUiNameFromURL( const String& aStrURL )
                 aStrUiURL = aURLObj.GetMainURL(INetURLObject::DECODE_UNAMBIGUOUS);
             }
     }
-    if(!aStrUiURL.Len())
+    if(aStrUiURL.isEmpty())
         return aStrURL;
     return aStrUiURL;
 }
diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx
index 1b2f139..3dad748 100644
--- a/cui/source/dialogs/multipat.cxx
+++ b/cui/source/dialogs/multipat.cxx
@@ -88,7 +88,7 @@ IMPL_LINK_NOARG(SvxMultiPathDialog, AddHdl_Impl)
         INetURLObject aPath( xFolderPicker->getDirectory() );
         aPath.removeFinalSlash();
         String aURL = aPath.GetMainURL( INetURLObject::NO_DECODE );
-        String sInsPath;
+        OUString sInsPath;
         ::utl::LocalFileHelper::ConvertURLToSystemPath( aURL, sInsPath );
 
         if ( pImpl->bIsRadioButtonMode )
@@ -278,14 +278,14 @@ void SvxMultiPathDialog::SetPath( const String& rPath )
     for ( sal_uInt16 i = 0; i < nCount; ++i )
     {
         String sPath = rPath.GetToken( i, cDelim );
-        String sSystemPath;
+        OUString sSystemPath;
         sal_Bool bIsSystemPath =
             ::utl::LocalFileHelper::ConvertURLToSystemPath( sPath, sSystemPath );
 
         if ( pImpl->bIsRadioButtonMode )
         {
             rtl::OUString sEntry( '\t' );
-            sEntry += (bIsSystemPath ? sSystemPath : sPath);
+            sEntry += (bIsSystemPath ? sSystemPath : OUString(sPath));
             SvTreeListEntry* pEntry = aRadioLB.InsertEntry( sEntry );
             String* pURL = new String( sPath );
             pEntry->SetUserData( pURL );
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 592005c..51b05ec 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -1202,7 +1202,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid )
             }
             else
             {
-                String aCurPath;
+                OUString aCurPath;
                 if ( ::utl::LocalFileHelper::ConvertURLToSystemPath( aFileName, aCurPath ) )
                 {
                     // if content does not exist: at least its path must exist
@@ -1545,13 +1545,13 @@ void SvtFileDialog::UpdateControls( const String& rURL )
 
     //=========================================================================
     {
-        String sText;
+        OUString sText;
         DBG_ASSERT( INET_PROT_NOT_VALID != aObj.GetProtocol(), "SvtFileDialog::UpdateControls: Invalid URL!" );
 
         if ( aObj.getSegmentCount() )
         {
             ::utl::LocalFileHelper::ConvertURLToSystemPath( rURL, sText );
-            if ( sText.Len() )
+            if ( !sText.isEmpty() )
             {
                 // no Fsys path for server file system ( only UCB has mountpoints! )
                 if ( INET_PROT_FILE != aObj.GetProtocol() )
@@ -1559,7 +1559,7 @@ void SvtFileDialog::UpdateControls( const String& rURL )
                         INetURLObject::GetScheme( aObj.GetProtocol() ).getLength() ) );
             }
 
-            if ( !sText.Len() && aObj.getSegmentCount() )
+            if ( sText.isEmpty() && aObj.getSegmentCount() )
                 sText = rURL;
         }
 
@@ -1577,7 +1577,7 @@ void SvtFileDialog::UpdateControls( const String& rURL )
                 sText = sURL;
         }
 
-        if ( !sText.Len() && rURL.Len() )
+        if ( sText.isEmpty() && rURL.Len() )
             // happens, for instance, for URLs which the INetURLObject does not know to belong to a hierarchical scheme
             sText = rURL;
         _pImp->_pEdCurrentPath->SetText( sText );
@@ -1973,13 +1973,13 @@ void SvtFileDialog::displayIOException( const String& _rURL, IOErrorCode _eCode
     try
     {
         // create make a human-readable string from the URL
-        String sDisplayPath( _rURL );
+        OUString sDisplayPath( _rURL );
         ::utl::LocalFileHelper::ConvertURLToSystemPath( _rURL, sDisplayPath );
 
         // build an own exception which tells "access denied"
         InteractiveAugmentedIOException aException;
         aException.Arguments.realloc( 2 );
-        aException.Arguments[ 0 ] <<= OUString( sDisplayPath );
+        aException.Arguments[ 0 ] <<= sDisplayPath;
         aException.Arguments[ 1 ] <<= PropertyValue(
             OUString( "Uri" ),
             -1, aException.Arguments[ 0 ], PropertyState_DIRECT_VALUE
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 5ffeb01..5764f3e 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2092,11 +2092,11 @@ void ImplSdPPTImport::FillSdAnimationInfo( SdAnimationInfo* pInfo, PptInteractiv
                             if ( pDocShell )
                             {
                                 String aBaseURL = pDocShell->GetMedium()->GetBaseURL();
-                                String aBookmarkURL( pInfo->GetBookmark() );
+                                OUString aBookmarkURL( pInfo->GetBookmark() );
                                 INetURLObject aURL( pPtr->aTarget );
                                 if( INET_PROT_NOT_VALID == aURL.GetProtocol() )
                                     utl::LocalFileHelper::ConvertSystemPathToURL( pPtr->aTarget, aBaseURL, aBookmarkURL );
-                                if( !aBookmarkURL.Len() )
+                                if( aBookmarkURL.isEmpty() )
                                     aBookmarkURL = URIHelper::SmartRel2Abs( INetURLObject(aBaseURL), pPtr->aTarget, URIHelper::GetMaybeFileHdl(), true );
                                 pInfo->SetBookmark( aBookmarkURL );
                                 pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_PROGRAM;
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index 32d3919..b1ccfaf 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -585,15 +585,15 @@ sal_Bool LinkManager::GetGraphicFromAny( const String& rMimeType,
 
 
 // ----------------------------------------------------------------------
-String lcl_DDE_RelToAbs( const String& rTopic, const String& rBaseURL )
+String lcl_DDE_RelToAbs( const OUString& rTopic, const OUString& rBaseURL )
 {
-    String sRet;
+    OUString sRet;
     INetURLObject aURL( rTopic );
     if( INET_PROT_NOT_VALID == aURL.GetProtocol() )
         utl::LocalFileHelper::ConvertSystemPathToURL( rTopic, rBaseURL, sRet );
-    if( !sRet.Len() )
+    if( sRet.isEmpty() )
         sRet = URIHelper::SmartRel2Abs( INetURLObject(rBaseURL), rTopic, URIHelper::GetMaybeFileHdl(), true );
-    return sRet;
+    return String(sRet);
 }
 
 sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink )
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 8cc782e..8b78c9b 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -627,8 +627,8 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
                 throw ::com::sun::star::lang::IllegalArgumentException();
             }
 
-            String        sPath        ;
-            String        sURL  (sTemp);
+            OUString      sPath        ;
+            OUString      sURL  (sTemp);
             INetURLObject aCheck(sURL );
             if (aCheck.GetProtocol()==INET_PROT_NOT_VALID)
             {
@@ -665,7 +665,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
                 // and append the local filename
                 aCheckedArgs.realloc( aCheckedArgs.getLength()+1 );
                 aCheckedArgs[nProps].Name = rtl::OUString("LocalFileName");
-                aCheckedArgs[nProps++].Value <<= ::rtl::OUString( sPath );
+                aCheckedArgs[nProps++].Value <<= sPath;
             }
             else
             {
@@ -682,7 +682,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
                 pUCBPrintTempFile->EnableKillingFile();
 
                 //FIXME: does it work?
-                aCheckedArgs[nProps].Name = rtl::OUString("LocalFileName");
+                aCheckedArgs[nProps].Name = "LocalFileName";
                 aCheckedArgs[nProps++].Value <<= ::rtl::OUString( pUCBPrintTempFile->GetFileName() );
                 sUcbUrl = sURL;
             }
diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx
index 1a70998f..14737d7 100644
--- a/sfx2/source/inet/inettbc.cxx
+++ b/sfx2/source/inet/inettbc.cxx
@@ -240,8 +240,8 @@ void SfxURLToolBoxControl_Impl::StateChanged
                         continue;
 
                     INetURLObject aURL    ( sURL );
-                    String        sMainURL( aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET ) );
-                    String        sFile;
+                    OUString      sMainURL( aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET ) );
+                    OUString      sFile;
 
                     if (::utl::LocalFileHelper::ConvertURLToSystemPath(sMainURL,sFile))
                         pURLBox->InsertEntry(sFile);
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index 983e4ca..603e5ee 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -555,7 +555,9 @@ String SvtURLBox::ParseSmart( String aText, String aBaseURL, String aWorkDir )
     }
     else
     {
-        ::utl::LocalFileHelper::ConvertSystemPathToURL( aText, aWorkDir, aMatch );
+        OUString aTmpMatch;
+        ::utl::LocalFileHelper::ConvertSystemPathToURL( OUString(aText), OUString(aWorkDir), aTmpMatch );
+        aMatch = aTmpMatch;
     }
 
     return aMatch;
@@ -988,7 +990,7 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl()
                         }
                         if ( bFound )
                         {
-                            String aFile;
+                            OUString aFile;
                             if (::utl::LocalFileHelper::ConvertURLToSystemPath(aURL,aFile))
                                 InsertEntry(aFile);
                             else
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index 103599d..ae21036 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -1398,7 +1398,7 @@ BrokenRecoveryDialog::BrokenRecoveryDialog(Window*       pParent        ,
 
     m_sSavePath = SvtPathOptions().GetWorkPath();
     INetURLObject aObj( m_sSavePath );
-    String sPath;
+    OUString sPath;
     ::utl::LocalFileHelper::ConvertURLToSystemPath( aObj.GetMainURL( INetURLObject::NO_DECODE ), sPath );
     m_aSaveDirED.SetText( sPath );
 
@@ -1498,7 +1498,7 @@ void BrokenRecoveryDialog::impl_askForSavePath()
     if (nRet == css::ui::dialogs::ExecutableDialogResults::OK)
     {
         m_sSavePath = xFolderPicker->getDirectory();
-        String sPath;
+        OUString sPath;
         ::utl::LocalFileHelper::ConvertURLToSystemPath( m_sSavePath, sPath );
         m_aSaveDirED.SetText( sPath );
     }
diff --git a/unotools/inc/unotools/localfilehelper.hxx b/unotools/inc/unotools/localfilehelper.hxx
index 99831f7..963b6ca 100644
--- a/unotools/inc/unotools/localfilehelper.hxx
+++ b/unotools/inc/unotools/localfilehelper.hxx
@@ -36,7 +36,7 @@ namespace utl
         Returning sal_True and an empty URL means that the URL doesn't point to a local file.
         */
         static bool ConvertPhysicalNameToURL(const rtl::OUString& rName, rtl::OUString& rReturn);
-        static sal_Bool ConvertSystemPathToURL( const String& rName, const String& rBaseURL, String& rReturn );
+        static sal_Bool ConvertSystemPathToURL( const OUString& rName, const OUString& rBaseURL, OUString& rReturn );
 
         /**
         Converts a "UCB compatible" URL into a "physical" file name.
@@ -45,7 +45,7 @@ namespace utl
         file system is present ( watch: this doesn't mean that this file really exists! )
         */
         static bool ConvertURLToPhysicalName( const rtl::OUString& rName, rtl::OUString& rReturn );
-        static sal_Bool ConvertURLToSystemPath( const String& rName, String& rReturn );
+        static sal_Bool ConvertURLToSystemPath( const OUString& rName, OUString& rReturn );
 
         static sal_Bool IsLocalFile(const rtl::OUString& rName);
         static sal_Bool IsFileContent(const rtl::OUString& rName);
diff --git a/unotools/source/ucbhelper/localfilehelper.cxx b/unotools/source/ucbhelper/localfilehelper.cxx
index ef0acbe..e02da35 100644
--- a/unotools/source/ucbhelper/localfilehelper.cxx
+++ b/unotools/source/ucbhelper/localfilehelper.cxx
@@ -37,9 +37,9 @@ using namespace ::com::sun::star::ucb;
 namespace utl
 {
 
-sal_Bool LocalFileHelper::ConvertSystemPathToURL( const String& rName, const String& rBaseURL, String& rReturn )
+sal_Bool LocalFileHelper::ConvertSystemPathToURL( const OUString& rName, const OUString& rBaseURL, OUString& rReturn )
 {
-    rReturn = ::rtl::OUString();
+    rReturn = "";
 
     Reference< XUniversalContentBroker > pBroker(
         UniversalContentBroker::create(
@@ -53,12 +53,12 @@ sal_Bool LocalFileHelper::ConvertSystemPathToURL( const String& rName, const Str
         return sal_False;
     }
 
-    return ( rReturn.Len() != 0 );
+    return !rReturn.isEmpty();
 }
 
-sal_Bool LocalFileHelper::ConvertURLToSystemPath( const String& rName, String& rReturn )
+sal_Bool LocalFileHelper::ConvertURLToSystemPath( const OUString& rName, OUString& rReturn )
 {
-    rReturn = ::rtl::OUString();
+    rReturn = "";
     Reference< XUniversalContentBroker > pBroker(
         UniversalContentBroker::create(
             comphelper::getProcessComponentContext() ) );
@@ -70,7 +70,7 @@ sal_Bool LocalFileHelper::ConvertURLToSystemPath( const String& rName, String& r
     {
     }
 
-    return ( rReturn.Len() != 0 );
+    return !rReturn.isEmpty();
 }
 
 bool LocalFileHelper::ConvertPhysicalNameToURL(const rtl::OUString& rName, rtl::OUString& rReturn)
@@ -93,7 +93,7 @@ bool LocalFileHelper::ConvertPhysicalNameToURL(const rtl::OUString& rName, rtl::
 
 bool LocalFileHelper::ConvertURLToPhysicalName(const rtl::OUString& rName, rtl::OUString& rReturn)
 {
-    rReturn = ::rtl::OUString();
+    rReturn = "";
     Reference< XUniversalContentBroker > pBroker(
         UniversalContentBroker::create(
             comphelper::getProcessComponentContext() ) );
@@ -119,7 +119,7 @@ sal_Bool LocalFileHelper::IsLocalFile(const rtl::OUString& rName)
 
 sal_Bool LocalFileHelper::IsFileContent(const rtl::OUString& rName)
 {
-    String aTmp;
+    OUString aTmp;
     return ConvertURLToSystemPath(rName, aTmp);
 }
 
@@ -136,7 +136,7 @@ typedef ::std::vector< ::rtl::OUString* > StringList_Impl;
         Reference< ::com::sun::star::sdbc::XResultSet > xResultSet;
         ::com::sun::star::uno::Sequence< ::rtl::OUString > aProps(1);
         ::rtl::OUString* pProps = aProps.getArray();
-        pProps[0] = ::rtl::OUString("Url");
+        pProps[0] = "Url";
 
         try
         {
diff --git a/uui/source/fltdlg.cxx b/uui/source/fltdlg.cxx
index 3571b2e..adab1d9 100644
--- a/uui/source/fltdlg.cxx
+++ b/uui/source/fltdlg.cxx
@@ -206,7 +206,7 @@ class StringCalculator : public ::cppu::WeakImplHelper1< ::com::sun::star::util:
 *//*-*************************************************************************************************************/
 String FilterDialog::impl_buildUIFileName( const String& sName )
 {
-    String sShortName( sName );
+    OUString sShortName( sName );
 
     if( ::utl::LocalFileHelper::ConvertURLToSystemPath( sName, sShortName ) == sal_True )
     {


More information about the Libreoffice-commits mailing list