summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-02-04 19:14:23 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-02-04 19:53:51 -0500
commit4deddf208436f4b76b228045c0c9dccaa44f0618 (patch)
treeb16c1fa5bf3416dcbd29583ea7ea50a67a3561b2 /sfx2
parent66f8bbc1b2e7397557d0d6434b90bc5af561acbd (diff)
String to OUString.
Change-Id: I3a0eff8ca0c8b654a38ee2df1022ca162bcb67aa
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/docfilt.hxx14
-rw-r--r--sfx2/source/doc/docfile.cxx2
-rw-r--r--sfx2/source/doc/docfilt.cxx24
3 files changed, 19 insertions, 21 deletions
diff --git a/sfx2/inc/sfx2/docfilt.hxx b/sfx2/inc/sfx2/docfilt.hxx
index c4ecb97e1e7e..c017f849be8e 100644
--- a/sfx2/inc/sfx2/docfilt.hxx
+++ b/sfx2/inc/sfx2/docfilt.hxx
@@ -101,13 +101,13 @@ public:
static const SfxFilter* GetFilterByName( const String& rName );
static const SfxFilter* GetDefaultFilterFromFactory( const String& rServiceName );
- static String GetTypeFromStorage( const SotStorage& rStg );
- static String GetTypeFromStorage( const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xStorage,
- sal_Bool bTemplate = sal_False,
- String* pName=0 )
- throw ( ::com::sun::star::beans::UnknownPropertyException,
- ::com::sun::star::lang::WrappedTargetException,
- ::com::sun::star::uno::RuntimeException );
+ static OUString GetTypeFromStorage( const SotStorage& rStg );
+ static OUString GetTypeFromStorage(
+ const com::sun::star::uno::Reference<com::sun::star::embed::XStorage>& xStorage,
+ bool bTemplate = false, OUString* pName = NULL )
+ throw ( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException );
};
#endif
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 3ce8ab77b360..b6d1f85ac34a 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2933,7 +2933,7 @@ SfxMedium::SfxMedium( const ::com::sun::star::uno::Sequence< ::com::sun::star::b
SfxMedium::SfxMedium( const uno::Reference < embed::XStorage >& rStor, const String& rBaseURL, const SfxItemSet* p ) :
pImp(new SfxMedium_Impl(this))
{
- String aType = SfxFilter::GetTypeFromStorage( rStor );
+ OUString aType = SfxFilter::GetTypeFromStorage(rStor);
pImp->m_pFilter = SFX_APP()->GetFilterMatcher().GetFilter4EA( aType );
DBG_ASSERT( pImp->m_pFilter, "No Filter for storage found!" );
diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx
index 097074bd8df0..f7d47e839573 100644
--- a/sfx2/source/doc/docfilt.cxx
+++ b/sfx2/source/doc/docfilt.cxx
@@ -124,7 +124,7 @@ const SfxFilter* SfxFilter::GetFilterByName( const String& rName )
return aMatch.GetFilter4FilterName( rName, 0, 0 );
}
-String SfxFilter::GetTypeFromStorage( const SotStorage& rStg )
+OUString SfxFilter::GetTypeFromStorage( const SotStorage& rStg )
{
const char* pType=0;
if ( rStg.IsStream( rtl::OUString("WordDocument") ) )
@@ -164,26 +164,24 @@ String SfxFilter::GetTypeFromStorage( const SotStorage& rStg )
return pType ? rtl::OUString::createFromAscii(pType) : rtl::OUString();
}
-String SfxFilter::GetTypeFromStorage( const com::sun::star::uno::Reference< com::sun::star::embed::XStorage >& xStorage, sal_Bool bTemplate,
- String* pFilterName )
- throw ( beans::UnknownPropertyException,
- lang::WrappedTargetException,
- uno::RuntimeException )
+OUString SfxFilter::GetTypeFromStorage(
+ const uno::Reference<embed::XStorage>& xStorage, bool bTemplate, OUString* pFilterName )
+ throw ( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
SfxFilterMatcher aMatcher;
const char* pType=0;
- String aName;
+ OUString aName;
if ( pFilterName )
{
aName = *pFilterName;
- pFilterName->Erase();
+ *pFilterName = OUString();
}
com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xProps( xStorage, com::sun::star::uno::UNO_QUERY );
if ( xProps.is() )
{
- ::rtl::OUString aMediaType;
- xProps->getPropertyValue( ::rtl::OUString("MediaType") ) >>= aMediaType;
+ OUString aMediaType;
+ xProps->getPropertyValue("MediaType") >>= aMediaType;
if ( !aMediaType.isEmpty() )
{
::com::sun::star::datatransfer::DataFlavor aDataFlavor;
@@ -200,7 +198,7 @@ String SfxFilter::GetTypeFromStorage( const com::sun::star::uno::Reference< com:
nDont |= SFX_FILTER_TEMPLATEPATH;
const SfxFilter* pFilter = 0;
- if ( aName.Len() )
+ if (!aName.isEmpty())
// get preselected Filter if it matches the desired filter flags
pFilter = aMatcher.GetFilter4FilterName( aName, nMust, nDont );
@@ -226,10 +224,10 @@ String SfxFilter::GetTypeFromStorage( const com::sun::star::uno::Reference< com:
//TODO: do it without SfxFilter
//TODO/LATER: don't yield FilterName, should be done in FWK!
- String aRet;
+ OUString aRet;
if ( pType )
{
- aRet = rtl::OUString::createFromAscii(pType);
+ aRet = OUString::createFromAscii(pType);
if ( pFilterName )
*pFilterName = aMatcher.GetFilter4EA( aRet )->GetName();
}