diff options
author | Noel Grandin <noel@peralex.com> | 2013-08-29 15:34:37 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-09-05 08:54:10 +0200 |
commit | 447b92760d097eeb658b2302d5ddcdd95e006a1d (patch) | |
tree | c695905c4507207162d876a5e34eda14e899e63d | |
parent | dfbb4009f895a876041c8848100a3bada1ba44fc (diff) |
convert include/svx/xmlgrhlp.hxx from String to OUString
also fix the string comparison in
SvXMLGraphicHelper::ImplGetGraphicMimeType
which was previously comparing pointers.
Change-Id: Icd1e76bcf60ec3af5b10cb48adfc97548a2bf4f1
-rw-r--r-- | include/svx/xmlgrhlp.hxx | 10 | ||||
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 14 |
2 files changed, 13 insertions, 11 deletions
diff --git a/include/svx/xmlgrhlp.hxx b/include/svx/xmlgrhlp.hxx index d14c9dc5cd23..29884f6f32fe 100644 --- a/include/svx/xmlgrhlp.hxx +++ b/include/svx/xmlgrhlp.hxx @@ -74,12 +74,14 @@ private: SVX_DLLPRIVATE sal_Bool ImplGetStreamNames( const OUString& rURLStr, OUString& rPictureStorageName, OUString& rPictureStreamName ); - SVX_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::embed::XStorage > ImplGetGraphicStorage( const OUString& rPictureStorageName ); - SVX_DLLPRIVATE SvxGraphicHelperStream_Impl ImplGetGraphicStream( const OUString& rPictureStorageName, + SVX_DLLPRIVATE css::uno::Reference < css::embed::XStorage > + ImplGetGraphicStorage( const OUString& rPictureStorageName ); + SVX_DLLPRIVATE SvxGraphicHelperStream_Impl + ImplGetGraphicStream( const OUString& rPictureStorageName, const OUString& rPictureStreamName, sal_Bool bTruncate ); - SVX_DLLPRIVATE String ImplGetGraphicMimeType( const String& rFileName ) const; - SVX_DLLPRIVATE Graphic ImplReadGraphic( const OUString& rPictureStorageName, + SVX_DLLPRIVATE OUString ImplGetGraphicMimeType( const OUString& rFileName ) const; + SVX_DLLPRIVATE Graphic ImplReadGraphic( const OUString& rPictureStorageName, const OUString& rPictureStreamName ); SVX_DLLPRIVATE sal_Bool ImplWriteGraphic( const OUString& rPictureStorageName, const OUString& rPictureStreamName, diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 99d5548b1c0a..312091614d81 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -455,7 +455,7 @@ SvxGraphicHelperStream_Impl SvXMLGraphicHelper::ImplGetGraphicStream( const OUSt return aRet; } -String SvXMLGraphicHelper::ImplGetGraphicMimeType( const String& rFileName ) const +OUString SvXMLGraphicHelper::ImplGetGraphicMimeType( const OUString& rFileName ) const { struct XMLGraphicMimeTypeMapper { @@ -472,16 +472,16 @@ String SvXMLGraphicHelper::ImplGetGraphicMimeType( const String& rFileName ) con { "svg", "image/svg+xml" } }; - String aMimeType; + OUString aMimeType; - if( ( rFileName.Len() >= 4 ) && ( rFileName.GetChar( rFileName.Len() - 4 ) == '.' ) ) + if( ( rFileName.getLength() >= 4 ) && ( rFileName[ rFileName.getLength() - 4 ] == '.' ) ) { - const OString aExt(OUStringToOString(rFileName.Copy(rFileName.Len() - 3), + const OString aExt(OUStringToOString(rFileName.copy(rFileName.getLength() - 3), RTL_TEXTENCODING_ASCII_US)); - for( long i = 0, nCount = sizeof (aMapper) / sizeof (aMapper[0]); ( i < nCount ) && !aMimeType.Len(); i++ ) - if( aExt.getStr() == aMapper[ i ].pExt ) - aMimeType = String( aMapper[ i ].pMimeType, RTL_TEXTENCODING_ASCII_US ); + for( long i = 0, nCount = sizeof (aMapper) / sizeof (aMapper[0]); ( i < nCount ) && aMimeType.isEmpty(); i++ ) + if( strcmp(aExt.getStr(), aMapper[ i ].pExt) == 0 ) + aMimeType = OUString( aMapper[ i ].pMimeType, strlen( aMapper[ i ].pMimeType ), RTL_TEXTENCODING_ASCII_US ); } return aMimeType; |