summaryrefslogtreecommitdiff
path: root/xmloff/source/transform
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff/source/transform')
-rw-r--r--xmloff/source/transform/DocumentTContext.cxx12
-rw-r--r--xmloff/source/transform/TransformerBase.cxx4
2 files changed, 6 insertions, 10 deletions
diff --git a/xmloff/source/transform/DocumentTContext.cxx b/xmloff/source/transform/DocumentTContext.cxx
index 894146897af7..14ad377a68fc 100644
--- a/xmloff/source/transform/DocumentTContext.cxx
+++ b/xmloff/source/transform/DocumentTContext.cxx
@@ -64,20 +64,18 @@ void XMLDocumentTransformerContext::StartElement( const Reference< XAttributeLis
IsXMLToken( aLocalName, XML_MIMETYPE ) )
{
const OUString& rValue = xAttrList->getValueByIndex( i );
- static const char * aTmp[] =
+ static constexpr std::string_view aTmp[]
{
"application/vnd.oasis.openoffice.",
"application/x-vnd.oasis.openoffice.",
"application/vnd.oasis.opendocument.",
- "application/x-vnd.oasis.document.",
- nullptr
+ "application/x-vnd.oasis.document."
};
- for (int k=0; aTmp[k]; k++)
+ for (const auto & rPrefix : aTmp)
{
- OUString sTmpString = OUString::createFromAscii(aTmp[k]);
- if( rValue.matchAsciiL( aTmp[k], sTmpString.getLength() ) )
+ if( rValue.matchAsciiL( rPrefix.data(), rPrefix.size() ) )
{
- aClass = rValue.copy( sTmpString.getLength() );
+ aClass = rValue.copy( rPrefix.size() );
break;
}
}
diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx
index 90f8b198862a..87a6ae23836e 100644
--- a/xmloff/source/transform/TransformerBase.cxx
+++ b/xmloff/source/transform/TransformerBase.cxx
@@ -1332,11 +1332,9 @@ bool XMLTransformerBase::ConvertURIToOOo( OUString& rURI,
if( bPackage && bSupportPackage )
{
- OUString sTmp( '#' );
if( rURI.startsWith( "./" ) )
rURI = rURI.copy( 2 );
- sTmp += rURI;
- rURI = sTmp;
+ rURI = "#" + rURI;
bRet = true;
}
}