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 /svx/source | |
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
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
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; |