summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-10-11 10:23:28 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-10-11 12:46:01 +0200
commit3d236177be255b2027a997bfc12fe0833ca9a2f7 (patch)
treed67582e355bccb43cf133c1857f5dd6136be2f35 /oox
parent6c65c62c26a8aa4d04466545f8f04ec86b797012 (diff)
Deduplicate O(U)StringConcatenation
And use an overloaded helper function with a better (?) unified name to show that the result is not an O(U)String. Change-Id: I8956338b05d02bf46a6185828130ea8ef145d46b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141203 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/xmlfilterbase.cxx4
-rw-r--r--oox/source/export/drawingml.cxx12
-rw-r--r--oox/source/export/shapes.cxx2
-rw-r--r--oox/source/ole/vbaexport.cxx12
4 files changed, 15 insertions, 15 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index fe6ce6dc24fb..e0e8b099ea5e 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -1179,7 +1179,7 @@ void XmlFilterBase::exportCustomFragments()
const OUString fragmentPath = "customXml/item" + OUString::number(j+1) + ".xml";
if (customXmlDom.is())
{
- addRelation(oox::getRelationship(Relationship::CUSTOMXML), OUStringConcatenation("../" + fragmentPath));
+ addRelation(oox::getRelationship(Relationship::CUSTOMXML), Concat2View("../" + fragmentPath));
uno::Reference<xml::sax::XSAXSerializable> serializer(customXmlDom, uno::UNO_QUERY);
uno::Reference<xml::sax::XWriter> writer = xml::sax::Writer::create(comphelper::getProcessComponentContext());
@@ -1200,7 +1200,7 @@ void XmlFilterBase::exportCustomFragments()
// Adding itemprops's relationship entry to item.xml.rels file
addRelation(openFragmentStream(fragmentPath, "application/xml"),
oox::getRelationship(Relationship::CUSTOMXMLPROPS),
- OUStringConcatenation("itemProps"+OUString::number(j+1)+".xml"));
+ Concat2View("itemProps"+OUString::number(j+1)+".xml"));
}
}
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 387bbf5c8d6d..e0766d0e7a7a 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -5855,25 +5855,25 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX
OUString dataFileName = "diagrams/data" + OUString::number(nDiagramId) + ".xml";
OUString dataRelId =
mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMDATA),
- OUStringConcatenation(sRelationCompPrefix + dataFileName));
+ Concat2View(sRelationCompPrefix + dataFileName));
// add layout relation
OUString layoutFileName = "diagrams/layout" + OUString::number(nDiagramId) + ".xml";
OUString layoutRelId = mpFB->addRelation(mpFS->getOutputStream(),
oox::getRelationship(Relationship::DIAGRAMLAYOUT),
- OUStringConcatenation(sRelationCompPrefix + layoutFileName));
+ Concat2View(sRelationCompPrefix + layoutFileName));
// add style relation
OUString styleFileName = "diagrams/quickStyle" + OUString::number(nDiagramId) + ".xml";
OUString styleRelId = mpFB->addRelation(mpFS->getOutputStream(),
oox::getRelationship(Relationship::DIAGRAMQUICKSTYLE),
- OUStringConcatenation(sRelationCompPrefix + styleFileName));
+ Concat2View(sRelationCompPrefix + styleFileName));
// add color relation
OUString colorFileName = "diagrams/colors" + OUString::number(nDiagramId) + ".xml";
OUString colorRelId = mpFB->addRelation(mpFS->getOutputStream(),
oox::getRelationship(Relationship::DIAGRAMCOLORS),
- OUStringConcatenation(sRelationCompPrefix + colorFileName));
+ Concat2View(sRelationCompPrefix + colorFileName));
OUString drawingFileName;
if (drawingDom.is())
@@ -5882,7 +5882,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),
- OUStringConcatenation(sRelationCompPrefix + drawingFileName));
+ Concat2View(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
@@ -6013,7 +6013,7 @@ void DrawingML::writeDiagramRels(const uno::Sequence<uno::Sequence<uno::Any>>& x
PropertySet aProps(xOutStream);
aProps.setAnyProperty(PROP_RelId, uno::Any(sRelId.toInt32()));
- mpFB->addRelation(xOutStream, sType, OUStringConcatenation("../" + sFragment));
+ mpFB->addRelation(xOutStream, sType, Concat2View("../" + 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 74dadd5da473..c7b5699993f4 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -2594,7 +2594,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape )
OUString const sRelId = mpFB->addRelation(
mpFS->getOutputStream(), sRelationType,
- OUStringConcatenation(OUString::createFromAscii(GetRelationCompPrefix()) + sFileName));
+ Concat2View(OUString::createFromAscii(GetRelationCompPrefix()) + sFileName));
mpFS->startElementNS(mnXmlNamespace, XML_graphicFrame);
diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index 6d8f47e88c52..5e0fc8ae2a71 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -789,7 +789,7 @@ void exportModuleStream(SvStream& rStrm, const OUString& rSourceCode, const OUSt
{
SvMemoryStream aModuleStream(4096, 4096);
- exportString(aModuleStream, OUStringConcatenation("Attribute VB_Name = \"" + aElementName + "\"\r\n"), eTextEncoding);
+ exportString(aModuleStream, Concat2View("Attribute VB_Name = \"" + aElementName + "\"\r\n"), eTextEncoding);
if (rInfo.ModuleType == 4)
{
if (isWorkbook(rInfo.ModuleObject))
@@ -859,19 +859,19 @@ void exportPROJECTStream(SvStream& rStrm,
css::script::ModuleInfo aModuleInfo = xModuleInfo->getModuleInfo(rModuleName);
if(aModuleInfo.ModuleType == 1)
{
- exportString(rStrm, OUStringConcatenation("Module=" + rModuleName + "\r\n"),
+ exportString(rStrm, Concat2View("Module=" + rModuleName + "\r\n"),
eTextEncoding);
}
else if(aModuleInfo.ModuleType == 4)
{
exportString(rStrm,
- OUStringConcatenation("Document=" + rModuleName + "/&H00000000\r\n"),
+ Concat2View("Document=" + rModuleName + "/&H00000000\r\n"),
eTextEncoding);
}
}
// section 2.3.1.11 ProjectName
- exportString(rStrm, OUStringConcatenation("Name=\"" + projectName + "\"\r\n"), eTextEncoding);
+ exportString(rStrm, Concat2View("Name=\"" + projectName + "\"\r\n"), eTextEncoding);
// section 2.3.1.12 ProjectHelpId
exportString(rStrm, u"HelpContextID=\"0\"\r\n", eTextEncoding);
@@ -933,12 +933,12 @@ void exportPROJECTStream(SvStream& rStrm,
css::script::ModuleInfo aModuleInfo = xModuleInfo->getModuleInfo(rModuleName);
if(aModuleInfo.ModuleType == 1)
{
- exportString(rStrm, OUStringConcatenation(rModuleName + "=25, 25, 1439, 639, \r\n"),
+ exportString(rStrm, Concat2View(rModuleName + "=25, 25, 1439, 639, \r\n"),
eTextEncoding);
}
else
{
- exportString(rStrm, OUStringConcatenation(rModuleName + "=0, 0, 0, 0, C\r\n"),
+ exportString(rStrm, Concat2View(rModuleName + "=0, 0, 0, 0, C\r\n"),
eTextEncoding);
}
}