[Libreoffice-commits] .: sd/source sfx2/inc sfx2/source sw/source vbahelper/inc

Takeshi Abe tabe at kemper.freedesktop.org
Tue Nov 15 07:48:05 PST 2011


 sd/source/ui/func/fuinsfil.cxx              |    6 ++--
 sd/source/ui/inc/fuinsfil.hxx               |    2 -
 sd/source/ui/view/sdview4.cxx               |    2 -
 sfx2/inc/sfx2/docfilt.hxx                   |    4 +--
 sfx2/inc/sfx2/fcontnr.hxx                   |    2 -
 sfx2/source/appl/sfxpicklist.cxx            |   36 ++++++++++++++--------------
 sfx2/source/bastyp/fltfnc.cxx               |    4 +--
 sfx2/source/doc/objstor.cxx                 |    2 -
 sfx2/source/inc/sfxpicklist.hxx             |   13 ++++------
 sw/source/ui/dbui/mmoutputpage.cxx          |    2 -
 vbahelper/inc/vbahelper/vbaaccesshelper.hxx |    2 -
 11 files changed, 37 insertions(+), 38 deletions(-)

New commits:
commit dfd08cdf16e5b46b05dadb5fb3a2b32349ec5df5
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Tue Nov 15 23:53:00 2011 +0900

    replaced String in SfxPickList with rtl::OUString
    
    this consists of 12df49396e6bcb07bafc95255a8526caac96e60a and related changes

diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index 5a976b8..b98f14f 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -111,7 +111,7 @@ FunctionReference FuInsertFile::Create( ViewShell* pViewSh, ::sd::Window* pWin,
 void FuInsertFile::DoExecute( SfxRequest& rReq )
 {
     SfxFilterMatcher&       rMatcher = SFX_APP()->GetFilterMatcher();
-    ::std::vector< String > aFilterVector;
+    ::std::vector< OUString > aFilterVector;
     const SfxItemSet*       pArgs = rReq.GetArgs ();
 
     FuInsertFile::GetSupportedFilterVector( aFilterVector );
@@ -229,7 +229,7 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
                     xFilterManager->appendFilter( pFilter->GetUIName(), pFilter->GetDefaultExtension() );
 
                 // add additional supported filters
-                ::std::vector< String >::const_iterator aIter( aFilterVector.begin() );
+                ::std::vector< OUString >::const_iterator aIter( aFilterVector.begin() );
 
                 while( aIter != aFilterVector.end() )
                 {
@@ -796,7 +796,7 @@ sal_Bool FuInsertFile::InsSDDinOlMode(SfxMedium* pMedium)
 
 // -----------------------------------------------------------------------------
 
-void FuInsertFile::GetSupportedFilterVector( ::std::vector< String >& rFilterVector )
+void FuInsertFile::GetSupportedFilterVector( ::std::vector< OUString >& rFilterVector )
 {
     SfxFilterMatcher&   rMatcher = SFX_APP()->GetFilterMatcher();
     const SfxFilter*    pSearchFilter = NULL;
diff --git a/sd/source/ui/inc/fuinsfil.hxx b/sd/source/ui/inc/fuinsfil.hxx
index bad7d3a..fba3dc8 100644
--- a/sd/source/ui/inc/fuinsfil.hxx
+++ b/sd/source/ui/inc/fuinsfil.hxx
@@ -46,7 +46,7 @@ public:
     static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
     virtual void DoExecute( SfxRequest& rReq );
 
-    static void     GetSupportedFilterVector( ::std::vector< String >& rFilterVector );
+    static void     GetSupportedFilterVector( ::std::vector< ::rtl::OUString >& rFilterVector );
 
 private:
     FuInsertFile (
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 0874071..92d0b70 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -412,7 +412,7 @@ IMPL_LINK( View, DropInsertFileHdl, Timer*, EMPTYARG )
 
                 if( pFoundFilter && !nErr )
                 {
-                    ::std::vector< String > aFilterVector;
+                    ::std::vector< ::rtl::OUString > aFilterVector;
                     const String            aFilterName( pFoundFilter->GetFilterName() );
                     String                  aLowerAsciiFileName( aCurrentDropFile );
                     aLowerAsciiFileName.ToLowerAscii();
diff --git a/sfx2/inc/sfx2/docfilt.hxx b/sfx2/inc/sfx2/docfilt.hxx
index a951239..1da1dea 100644
--- a/sfx2/inc/sfx2/docfilt.hxx
+++ b/sfx2/inc/sfx2/docfilt.hxx
@@ -57,7 +57,7 @@ friend class SfxFilterContainer;
     SfxFilterFlags  nFormatType;
     sal_uInt16          nDocIcon;
     String          aServiceName;
-    String          aMimeType;
+    ::rtl::OUString aMimeType;
     String          aFilterName;
     String          aPattern;
     sal_uIntPtr           nVersion;
@@ -85,7 +85,7 @@ public:
     bool IsInternal() const { return nFormatType & SFX_FILTER_INTERNAL; }
     SfxFilterFlags  GetFilterFlags() const  { return nFormatType; }
     const String&   GetFilterName() const { return aFilterName; }
-    const String&   GetMimeType() const { return aMimeType; }
+    const ::rtl::OUString& GetMimeType() const { return aMimeType; }
     const String&   GetName() const { return  aFilterName; }
     const WildCard& GetWildcard() const { return aWildCard; }
     const String&   GetRealTypeName() const { return aTypeName; }
diff --git a/sfx2/inc/sfx2/fcontnr.hxx b/sfx2/inc/sfx2/fcontnr.hxx
index a6187a6..f6c1d01 100644
--- a/sfx2/inc/sfx2/fcontnr.hxx
+++ b/sfx2/inc/sfx2/fcontnr.hxx
@@ -140,7 +140,7 @@ public:
     sal_uInt32               GuessFilterControlDefaultUI( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED, sal_Bool bDefUI = sal_True ) const;
     sal_uInt32               DetectFilter( SfxMedium& rMedium, const SfxFilter **, sal_Bool bPlugIn, sal_Bool bAPI = sal_False ) const;
 
-    const SfxFilter*    GetFilter4Mime( const String& rMime, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED) const;
+    const SfxFilter*    GetFilter4Mime( const ::rtl::OUString& rMime, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED) const;
     const SfxFilter*    GetFilter4ClipBoardId( sal_uInt32 nId, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
     const SfxFilter*    GetFilter4EA( const String& rEA, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
     const SfxFilter*    GetFilter4Extension( const String& rExt, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index c3332d9..d80a80c 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -84,30 +84,30 @@ class StringLength : public ::cppu::WeakImplHelper1< XStringWidth >
         }
 };
 
-void SfxPickList::CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, const String& aURLString, sal_uInt32 nNo )
+void SfxPickList::CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, const ::rtl::OUString& aURLString, sal_uInt32 nNo )
 {
-    String aPickEntry;
+    ::rtl::OUStringBuffer aPickEntry;
 
     if ( nNo < 9 )
     {
-        aPickEntry += '~';
-        aPickEntry += String::CreateFromInt32( nNo + 1 );
+        aPickEntry.append('~');
+        aPickEntry.append(::rtl::OUString::valueOf(static_cast<sal_Int32>(nNo + 1)));
     }
     else if ( nNo == 9 )
-        aPickEntry += DEFINE_CONST_UNICODE("1~0");
+        aPickEntry.appendAscii("1~0");
     else
-        aPickEntry += String::CreateFromInt32( nNo + 1 );
-    aPickEntry += DEFINE_CONST_UNICODE(": ");
+        aPickEntry.append(::rtl::OUString::valueOf(static_cast<sal_Int32>(nNo + 1)));
+    aPickEntry.appendAscii(": ");
 
     INetURLObject   aURL( aURLString );
     rtl::OUString   aTipHelpText;
-    rtl::OUString   aAccessibleName( aPickEntry );
+    rtl::OUString   aAccessibleName = aPickEntry.toString();
 
     if ( aURL.GetProtocol() == INET_PROT_FILE )
     {
         // Do handle file URL differently => convert it to a system
         // path and abbreviate it with a special function:
-        String aFileSystemPath( aURL.getFSysPath( INetURLObject::FSYS_DETECT ) );
+        ::rtl::OUString aFileSystemPath( aURL.getFSysPath( INetURLObject::FSYS_DETECT ) );
 
         ::rtl::OUString aSystemPath( aFileSystemPath );
         ::rtl::OUString aCompactedSystemPath;
@@ -116,28 +116,28 @@ void SfxPickList::CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, cons
         aAccessibleName += aSystemPath;
         oslFileError nError = osl_abbreviateSystemPath( aSystemPath.pData, &aCompactedSystemPath.pData, 46, NULL );
         if ( !nError )
-            aPickEntry += String( aCompactedSystemPath );
+            aPickEntry.append( aCompactedSystemPath );
         else
-            aPickEntry += aFileSystemPath;
+            aPickEntry.append( aFileSystemPath );
 
-        if ( aPickEntry.Len() > 50 )
+        if ( aPickEntry.getLength() > 50 )
         {
-            aPickEntry.Erase( 47 );
-            aPickEntry += DEFINE_CONST_UNICODE("...");
+            aPickEntry.setLength( 47 );
+            aPickEntry.appendAscii("...");
         }
     }
     else
     {
         // Use INetURLObject to abbreviate all other URLs
-        String  aShortURL;
+        ::rtl::OUString aShortURL;
         aShortURL = aURL.getAbbreviated( m_xStringLength, 46, INetURLObject::DECODE_UNAMBIGUOUS );
-        aPickEntry += aShortURL;
+        aPickEntry.append(aShortURL);
         aTipHelpText = aURLString;
         aAccessibleName += aURLString;
     }
 
     // Set menu item text, tip help and accessible name
-    pMenu->SetItemText( nItemId, aPickEntry );
+    pMenu->SetItemText( nItemId, aPickEntry.toString() );
     pMenu->SetTipHelpText( nItemId, aTipHelpText );
     pMenu->SetAccessibleName( nItemId, aAccessibleName );
 }
@@ -425,7 +425,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
                 pDocSh->Get_Impl()->bWaitingForPicklist = sal_False;
 
                 if ( aURL.GetProtocol() == INET_PROT_FILE )
-                    Application::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::NO_DECODE ), (pFilter) ? pFilter->GetMimeType() : String() );
+                    Application::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::NO_DECODE ), (pFilter) ? pFilter->GetMimeType() : ::rtl::OUString() );
             }
             break;
         }
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 2d34778..36c4b13 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -649,7 +649,7 @@ const SfxFilter* SfxFilterMatcher::GetFilterForProps( const com::sun::star::uno:
     return 0;
 }
 
-const SfxFilter* SfxFilterMatcher::GetFilter4Mime( const String& rMediaType,SfxFilterFlags nMust, SfxFilterFlags nDont ) const
+const SfxFilter* SfxFilterMatcher::GetFilter4Mime( const ::rtl::OUString& rMediaType, SfxFilterFlags nMust, SfxFilterFlags nDont ) const
 {
     if ( m_rImpl.pList )
     {
@@ -666,7 +666,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Mime( const String& rMediaType,SfxF
 
     com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1);
     aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType"));
-    aSeq[0].Value <<= ::rtl::OUString( rMediaType );
+    aSeq[0].Value <<= rMediaType;
     return GetFilterForProps( aSeq, nMust, nDont );
 }
 
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 49f4b21..abbb343 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2091,7 +2091,7 @@ void SfxObjectShell::AddToRecentlyUsedList()
     {
         const SfxFilter* pOrgFilter = pMedium->GetOrigFilter();
         Application::AddToRecentDocumentList( aUrl.GetURLNoPass( INetURLObject::NO_DECODE ),
-                                              (pOrgFilter) ? pOrgFilter->GetMimeType() : String() );
+                                              (pOrgFilter) ? pOrgFilter->GetMimeType() : ::rtl::OUString() );
     }
 }
 
diff --git a/sfx2/source/inc/sfxpicklist.hxx b/sfx2/source/inc/sfxpicklist.hxx
index 80a7f87..987e78a 100644
--- a/sfx2/source/inc/sfxpicklist.hxx
+++ b/sfx2/source/inc/sfxpicklist.hxx
@@ -30,7 +30,6 @@
 #define _SFX_PICKLIST_HXX_
 
 #include <osl/mutex.hxx>
-#include <tools/string.hxx>
 #include <vcl/menu.hxx>
 #include <svl/lstner.hxx>
 #include <com/sun/star/util/XStringWidth.hpp>
@@ -43,13 +42,13 @@ class SfxPickList : public SfxListener
 {
     struct PickListEntry
     {
-        PickListEntry( const String& _aName, const String& _aFilter, const String& _aTitle ) :
+        PickListEntry( const ::rtl::OUString& _aName, const ::rtl::OUString& _aFilter, const ::rtl::OUString& _aTitle ) :
             aName( _aName ), aFilter( _aFilter ), aTitle( _aTitle ) {}
 
-        String      aName;
-        String      aFilter;
-        String      aTitle;
-        String      aOptions;
+        ::rtl::OUString aName;
+        ::rtl::OUString aFilter;
+        ::rtl::OUString aTitle;
+        ::rtl::OUString aOptions;
     };
 
     std::vector< PickListEntry* >   m_aPicklistVector;
@@ -59,7 +58,7 @@ class SfxPickList : public SfxListener
                             SfxPickList( sal_uInt32 nMenuSize );
                             ~SfxPickList();
 
-    void                    CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, const String& aURL, sal_uInt32 nNo );
+    void                    CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, const ::rtl::OUString& aURL, sal_uInt32 nNo );
     PickListEntry*          GetPickListEntry( sal_uInt32 nIndex );
     void                    CreatePickListEntries();
     void                    RemovePickListEntries();
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index 6e2e509..c7d7fd4 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -1103,7 +1103,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
 
     if(!pSfxFlt)
         return 0;
-    String sMimeType = pSfxFlt->GetMimeType();
+    ::rtl::OUString sMimeType = pSfxFlt->GetMimeType();
 
     if(!m_aSubjectED.GetText().Len())
     {
diff --git a/vbahelper/inc/vbahelper/vbaaccesshelper.hxx b/vbahelper/inc/vbahelper/vbaaccesshelper.hxx
index 85a109b..01a520c 100644
--- a/vbahelper/inc/vbahelper/vbaaccesshelper.hxx
+++ b/vbahelper/inc/vbahelper/vbaaccesshelper.hxx
@@ -65,7 +65,7 @@ namespace ooo
             bool bRes( false );
             const SfxFilter *pFilt = rDocShell.GetMedium()->GetFilter();
             if ( pFilt && pFilt->IsAlienFormat() )
-                bRes = ( pFilt->GetMimeType().CompareToAscii( pMimeType ) == 0 );
+                bRes = ( pFilt->GetMimeType().compareToAscii( pMimeType ) == 0 );
             return bRes;
         }
         VBAHELPER_DLLPRIVATE inline bool isAlienExcelDoc( SfxObjectShell& rDocShell ) { return isAlienDoc( rDocShell, "application/vnd.ms-excel" ); }


More information about the Libreoffice-commits mailing list