Kaydet (Commit) 447b9276 authored tarafından Noel Grandin's avatar Noel Grandin

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
üst dfbb4009
......@@ -74,11 +74,13 @@ 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 OUString ImplGetGraphicMimeType( const OUString& rFileName ) const;
SVX_DLLPRIVATE Graphic ImplReadGraphic( const OUString& rPictureStorageName,
const OUString& rPictureStreamName );
SVX_DLLPRIVATE sal_Bool ImplWriteGraphic( const OUString& rPictureStorageName,
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment