diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-26 14:03:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-27 20:31:14 +0200 |
commit | 48e279c6748bf023fba12fdc3f4cee402f611c6e (patch) | |
tree | 2e1b3a20ccd71f47a66938f882c1fe9d5e947bb4 /oox | |
parent | f3665d2a42b39814764f3eb9e20498b8a4be1d00 (diff) |
use string_view in INetURLObject::decode
Change-Id: I10e04970ceac33c9c3fbfd0182dd2140e06cb80b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114658
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 16 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 14 | ||||
-rw-r--r-- | oox/source/export/shapes.cxx | 2 |
3 files changed, 16 insertions, 16 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index b46392d1a246..a61d80e6cc6b 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -507,7 +507,7 @@ TextFieldStack& XmlFilterBase::getTextFieldStack() const namespace { -OUString lclAddRelation( const Reference< XRelationshipAccess >& rRelations, sal_Int32 nId, const OUString& rType, const OUString& rTarget, bool bExternal ) +OUString lclAddRelation( const Reference< XRelationshipAccess >& rRelations, sal_Int32 nId, const OUString& rType, std::u16string_view rTarget, bool bExternal ) { OUString sId = "rId" + OUString::number( nId ); @@ -528,7 +528,7 @@ OUString lclAddRelation( const Reference< XRelationshipAccess >& rRelations, sal } // namespace -OUString XmlFilterBase::addRelation( const OUString& rType, const OUString& rTarget ) +OUString XmlFilterBase::addRelation( const OUString& rType, std::u16string_view rTarget ) { Reference< XRelationshipAccess > xRelations( getStorage()->getXStorage(), UNO_QUERY ); if( xRelations.is() ) @@ -537,7 +537,7 @@ OUString XmlFilterBase::addRelation( const OUString& rType, const OUString& rTar return OUString(); } -OUString XmlFilterBase::addRelation( const Reference< XOutputStream >& rOutputStream, const OUString& rType, const OUString& rTarget, bool bExternal ) +OUString XmlFilterBase::addRelation( const Reference< XOutputStream >& rOutputStream, const OUString& rType, std::u16string_view rTarget, bool bExternal ) { sal_Int32 nId = 0; @@ -631,7 +631,7 @@ writeCoreProperties( XmlFilterBase& rSelf, const Reference< XDocumentProperties else sValue = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"; - rSelf.addRelation( sValue, "docProps/core.xml" ); + rSelf.addRelation( sValue, u"docProps/core.xml" ); FSHelperPtr pCoreProps = rSelf.openFragmentStreamWithSerializer( "docProps/core.xml", "application/vnd.openxmlformats-package.core-properties+xml" ); @@ -705,7 +705,7 @@ writeAppProperties( XmlFilterBase& rSelf, const Reference< XDocumentProperties > { rSelf.addRelation( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties", - "docProps/app.xml" ); + u"docProps/app.xml" ); FSHelperPtr pAppProps = rSelf.openFragmentStreamWithSerializer( "docProps/app.xml", "application/vnd.openxmlformats-officedocument.extended-properties+xml" ); @@ -845,7 +845,7 @@ writeCustomProperties( XmlFilterBase& rSelf, const Reference< XDocumentPropertie rSelf.addRelation( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties", - "docProps/custom.xml" ); + u"docProps/custom.xml" ); FSHelperPtr pAppProps = rSelf.openFragmentStreamWithSerializer( "docProps/custom.xml", "application/vnd.openxmlformats-officedocument.custom-properties+xml" ); @@ -1177,7 +1177,7 @@ void XmlFilterBase::exportCustomFragments() const OUString fragmentPath = "customXml/item" + OUString::number((j+1)) + ".xml"; if (customXmlDom.is()) { - addRelation(oox::getRelationship(Relationship::CUSTOMXML), "../" + fragmentPath); + addRelation(oox::getRelationship(Relationship::CUSTOMXML), OUString("../" + fragmentPath)); uno::Reference<xml::sax::XSAXSerializable> serializer(customXmlDom, uno::UNO_QUERY); uno::Reference<xml::sax::XWriter> writer = xml::sax::Writer::create(comphelper::getProcessComponentContext()); @@ -1198,7 +1198,7 @@ void XmlFilterBase::exportCustomFragments() // Adding itemprops's relationship entry to item.xml.rels file addRelation(openFragmentStream(fragmentPath, "application/xml"), oox::getRelationship(Relationship::CUSTOMXMLPROPS), - "itemProps"+OUString::number((j+1))+".xml"); + OUString("itemProps"+OUString::number((j+1))+".xml")); } } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index dfb81a27e713..07dad1fb8b75 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -3821,7 +3821,7 @@ sal_Unicode DrawingML::SubstituteBullet( sal_Unicode cBulletId, css::awt::FontDe sax_fastparser::FSHelperPtr DrawingML::CreateOutputStream ( const OUString& sFullStream, - const OUString& sRelativeStream, + std::u16string_view sRelativeStream, const Reference< XOutputStream >& xParentRelation, const char* sContentType, const char* sRelationshipType, @@ -4856,7 +4856,7 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX OUString dataFileName = "diagrams/data" + OUString::number(nDiagramId) + ".xml"; OString dataRelId = OUStringToOString( mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMDATA), - sRelationCompPrefix + dataFileName), + OUString(sRelationCompPrefix + dataFileName)), RTL_TEXTENCODING_UTF8); // add layout relation @@ -4864,7 +4864,7 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX OString layoutRelId = OUStringToOString(mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMLAYOUT), - sRelationCompPrefix + layoutFileName), + OUString(sRelationCompPrefix + layoutFileName)), RTL_TEXTENCODING_UTF8); // add style relation @@ -4872,7 +4872,7 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX OString styleRelId = OUStringToOString(mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMQUICKSTYLE), - sRelationCompPrefix + styleFileName), + OUString(sRelationCompPrefix + styleFileName)), RTL_TEXTENCODING_UTF8); // add color relation @@ -4880,7 +4880,7 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX OString colorRelId = OUStringToOString(mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMCOLORS), - sRelationCompPrefix + colorFileName), + OUString(sRelationCompPrefix + colorFileName)), RTL_TEXTENCODING_UTF8); OUString drawingFileName; @@ -4890,7 +4890,7 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX drawingFileName = "diagrams/drawing" + OUString::number(nDiagramId) + ".xml"; OUString drawingRelId = mpFB->addRelation( mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMDRAWING), - sRelationCompPrefix + drawingFileName); + OUString(sRelationCompPrefix + drawingFileName)); // the data dom contains a reference to the drawing relation. We need to update it with the new generated // relation value before writing the dom to a file @@ -5021,7 +5021,7 @@ void DrawingML::writeDiagramRels(const uno::Sequence<uno::Sequence<uno::Any>>& x PropertySet aProps(xOutStream); aProps.setAnyProperty(PROP_RelId, uno::makeAny(sRelId.toInt32())); - mpFB->addRelation(xOutStream, sType, "../" + sFragment); + mpFB->addRelation(xOutStream, sType, OUString("../" + sFragment)); OUString sDir = OUString::createFromAscii(GetComponentDir()); uno::Reference<io::XOutputStream> xBinOutStream diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 81aae66df134..f45b0aabc61d 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -2114,7 +2114,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape ) OUString const sRelId = mpFB->addRelation( mpFS->getOutputStream(), sRelationType, - OUString::createFromAscii(GetRelationCompPrefix()) + sFileName); + OUString(OUString::createFromAscii(GetRelationCompPrefix()) + sFileName)); mpFS->startElementNS(mnXmlNamespace, XML_graphicFrame); |