diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-03-08 14:11:35 +0100 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-03-08 13:16:49 +0000 |
commit | 4bf95c4c31dd871065d4042028a4b3ae476dab70 (patch) | |
tree | 2935dfd660fc2ee2b914ca27a72077e51e5862f3 /xmloff/source/core | |
parent | 596334776ad45f7ab87937615fa1d4e7d2d0fd42 (diff) |
make use of startsWith()
Change-Id: Ie70097de550ddd1cddc6714f8f86f9723cb36679
Reviewed-on: https://gerrit.libreoffice.org/2599
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'xmloff/source/core')
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 18 | ||||
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 2 |
2 files changed, 7 insertions, 13 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 81afbf314543..c578286c0b7a 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1854,8 +1854,7 @@ sal_Int32 SvXMLExport::dataStyleForceSystemLanguage(sal_Int32 nFormat) const OUString SvXMLExport::AddEmbeddedGraphicObject( const OUString& rGraphicObjectURL ) { OUString sRet( rGraphicObjectURL ); - if( 0 == rGraphicObjectURL.compareTo( msGraphicObjectProtocol, - msGraphicObjectProtocol.getLength() ) && + if( rGraphicObjectURL.startsWith( msGraphicObjectProtocol ) && mxGraphicResolver.is() ) { if( (getExportFlags() & EXPORT_EMBEDDED) == 0 ) @@ -1874,8 +1873,7 @@ sal_Bool SvXMLExport::AddEmbeddedGraphicObjectAsBase64( const OUString& rGraphic sal_Bool bRet = sal_False; if( (getExportFlags() & EXPORT_EMBEDDED) != 0 && - 0 == rGraphicObjectURL.compareTo( msGraphicObjectProtocol, - msGraphicObjectProtocol.getLength() ) && + rGraphicObjectURL.startsWith( msGraphicObjectProtocol ) && mxGraphicResolver.is() ) { Reference< XBinaryStreamResolver > xStmResolver( mxGraphicResolver, UNO_QUERY ); @@ -1898,10 +1896,8 @@ sal_Bool SvXMLExport::AddEmbeddedGraphicObjectAsBase64( const OUString& rGraphic OUString SvXMLExport::AddEmbeddedObject( const OUString& rEmbeddedObjectURL ) { OUString sRet; - if( (0 == rEmbeddedObjectURL.compareTo( msEmbeddedObjectProtocol, - msEmbeddedObjectProtocol.getLength() ) || - 0 == rEmbeddedObjectURL.compareTo( msGraphicObjectProtocol, - msGraphicObjectProtocol.getLength() ) ) && + if( (rEmbeddedObjectURL.startsWith( msEmbeddedObjectProtocol ) || + rEmbeddedObjectURL.startsWith( msGraphicObjectProtocol ) ) && mxEmbeddedResolver.is() ) { sRet = @@ -1916,10 +1912,8 @@ OUString SvXMLExport::AddEmbeddedObject( const OUString& rEmbeddedObjectURL ) sal_Bool SvXMLExport::AddEmbeddedObjectAsBase64( const OUString& rEmbeddedObjectURL ) { sal_Bool bRet = sal_False; - if( (0 == rEmbeddedObjectURL.compareTo( msEmbeddedObjectProtocol, - msEmbeddedObjectProtocol.getLength() ) || - 0 == rEmbeddedObjectURL.compareTo( msGraphicObjectProtocol, - msGraphicObjectProtocol.getLength() ) ) && + if( (rEmbeddedObjectURL.startsWith( msEmbeddedObjectProtocol ) || + rEmbeddedObjectURL.startsWith( msGraphicObjectProtocol ) ) && mxEmbeddedResolver.is() ) { Reference < XNameAccess > xNA( mxEmbeddedResolver, UNO_QUERY ); diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 2edbac4ad084..04f7a51081af 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -639,7 +639,7 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName, } } else if( ( rAttrName.getLength() >= 5 ) && - ( rAttrName.compareTo( GetXMLToken(XML_XMLNS), 5 ) == 0 ) && + ( rAttrName.startsWith( GetXMLToken(XML_XMLNS) ) ) && ( rAttrName.getLength() == 5 || ':' == rAttrName[5] ) ) { if( !pRewindMap ) |