[Libreoffice-commits] .: sfx2/inc sfx2/source
Takeshi Abe
tabe at kemper.freedesktop.org
Mon Nov 14 18:02:42 PST 2011
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 +++++++------
6 files changed, 31 insertions(+), 30 deletions(-)
New commits:
commit f7319622f63c9dae0eed9e60404d290580fce9fe
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Tue Nov 15 10:57:42 2011 +0900
Revert "replaced String in SfxPickList with rtl::OUString"
This reverts commit 12df49396e6bcb07bafc95255a8526caac96e60a.
diff --git a/sfx2/inc/sfx2/docfilt.hxx b/sfx2/inc/sfx2/docfilt.hxx
index 1da1dea..a951239 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;
- ::rtl::OUString aMimeType;
+ String 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 ::rtl::OUString& GetMimeType() const { return aMimeType; }
+ const String& 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 f6c1d01..a6187a6 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 ::rtl::OUString& rMime, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED) const;
+ const SfxFilter* GetFilter4Mime( const String& 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 d80a80c..c3332d9 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 ::rtl::OUString& aURLString, sal_uInt32 nNo )
+void SfxPickList::CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, const String& aURLString, sal_uInt32 nNo )
{
- ::rtl::OUStringBuffer aPickEntry;
+ String aPickEntry;
if ( nNo < 9 )
{
- aPickEntry.append('~');
- aPickEntry.append(::rtl::OUString::valueOf(static_cast<sal_Int32>(nNo + 1)));
+ aPickEntry += '~';
+ aPickEntry += String::CreateFromInt32( nNo + 1 );
}
else if ( nNo == 9 )
- aPickEntry.appendAscii("1~0");
+ aPickEntry += DEFINE_CONST_UNICODE("1~0");
else
- aPickEntry.append(::rtl::OUString::valueOf(static_cast<sal_Int32>(nNo + 1)));
- aPickEntry.appendAscii(": ");
+ aPickEntry += String::CreateFromInt32( nNo + 1 );
+ aPickEntry += DEFINE_CONST_UNICODE(": ");
INetURLObject aURL( aURLString );
rtl::OUString aTipHelpText;
- rtl::OUString aAccessibleName = aPickEntry.toString();
+ rtl::OUString aAccessibleName( aPickEntry );
if ( aURL.GetProtocol() == INET_PROT_FILE )
{
// Do handle file URL differently => convert it to a system
// path and abbreviate it with a special function:
- ::rtl::OUString aFileSystemPath( aURL.getFSysPath( INetURLObject::FSYS_DETECT ) );
+ String 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.append( aCompactedSystemPath );
+ aPickEntry += String( aCompactedSystemPath );
else
- aPickEntry.append( aFileSystemPath );
+ aPickEntry += aFileSystemPath;
- if ( aPickEntry.getLength() > 50 )
+ if ( aPickEntry.Len() > 50 )
{
- aPickEntry.setLength( 47 );
- aPickEntry.appendAscii("...");
+ aPickEntry.Erase( 47 );
+ aPickEntry += DEFINE_CONST_UNICODE("...");
}
}
else
{
// Use INetURLObject to abbreviate all other URLs
- ::rtl::OUString aShortURL;
+ String aShortURL;
aShortURL = aURL.getAbbreviated( m_xStringLength, 46, INetURLObject::DECODE_UNAMBIGUOUS );
- aPickEntry.append(aShortURL);
+ aPickEntry += aShortURL;
aTipHelpText = aURLString;
aAccessibleName += aURLString;
}
// Set menu item text, tip help and accessible name
- pMenu->SetItemText( nItemId, aPickEntry.toString() );
+ pMenu->SetItemText( nItemId, aPickEntry );
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() : ::rtl::OUString() );
+ Application::AddToRecentDocumentList( aURL.GetURLNoPass( INetURLObject::NO_DECODE ), (pFilter) ? pFilter->GetMimeType() : String() );
}
break;
}
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 36c4b13..2d34778 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 ::rtl::OUString& rMediaType, SfxFilterFlags nMust, SfxFilterFlags nDont ) const
+const SfxFilter* SfxFilterMatcher::GetFilter4Mime( const String& rMediaType,SfxFilterFlags nMust, SfxFilterFlags nDont ) const
{
if ( m_rImpl.pList )
{
@@ -666,7 +666,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Mime( const ::rtl::OUString& rMedia
com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1);
aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType"));
- aSeq[0].Value <<= rMediaType;
+ aSeq[0].Value <<= ::rtl::OUString( rMediaType );
return GetFilterForProps( aSeq, nMust, nDont );
}
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index abbb343..49f4b21 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() : ::rtl::OUString() );
+ (pOrgFilter) ? pOrgFilter->GetMimeType() : String() );
}
}
diff --git a/sfx2/source/inc/sfxpicklist.hxx b/sfx2/source/inc/sfxpicklist.hxx
index 987e78a..80a7f87 100644
--- a/sfx2/source/inc/sfxpicklist.hxx
+++ b/sfx2/source/inc/sfxpicklist.hxx
@@ -30,6 +30,7 @@
#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>
@@ -42,13 +43,13 @@ class SfxPickList : public SfxListener
{
struct PickListEntry
{
- PickListEntry( const ::rtl::OUString& _aName, const ::rtl::OUString& _aFilter, const ::rtl::OUString& _aTitle ) :
+ PickListEntry( const String& _aName, const String& _aFilter, const String& _aTitle ) :
aName( _aName ), aFilter( _aFilter ), aTitle( _aTitle ) {}
- ::rtl::OUString aName;
- ::rtl::OUString aFilter;
- ::rtl::OUString aTitle;
- ::rtl::OUString aOptions;
+ String aName;
+ String aFilter;
+ String aTitle;
+ String aOptions;
};
std::vector< PickListEntry* > m_aPicklistVector;
@@ -58,7 +59,7 @@ class SfxPickList : public SfxListener
SfxPickList( sal_uInt32 nMenuSize );
~SfxPickList();
- void CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, const ::rtl::OUString& aURL, sal_uInt32 nNo );
+ void CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, const String& aURL, sal_uInt32 nNo );
PickListEntry* GetPickListEntry( sal_uInt32 nIndex );
void CreatePickListEntries();
void RemovePickListEntries();
More information about the Libreoffice-commits
mailing list