summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-13 12:12:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-14 17:30:46 +0200
commit216c21050ed90a3c80c4d59abbec800e495f2a79 (patch)
treec51665ed994544ed47c63422934398a80b89a96d /starmath
parentce214d56727ecf8fb212910a711b4e3ef38e4b63 (diff)
elid some OUString construction in SmXMLExportWrapper::Export
Change-Id: Icc091a7fab3c9ce368bd45536de1e75d29431c56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134314 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/mathml/mathmlexport.cxx33
1 files changed, 20 insertions, 13 deletions
diff --git a/starmath/source/mathml/mathmlexport.cxx b/starmath/source/mathml/mathmlexport.cxx
index 0fb2573b5b80..64640ae0d96a 100644
--- a/starmath/source/mathml/mathmlexport.cxx
+++ b/starmath/source/mathml/mathmlexport.cxx
@@ -128,27 +128,31 @@ bool SmXMLExportWrapper::Export(SfxMedium& rMedium)
}
}
+ static constexpr OUStringLiteral sUsePrettyPrinting(u"UsePrettyPrinting");
+ static constexpr OUStringLiteral sBaseURI(u"BaseURI");
+ static constexpr OUStringLiteral sStreamRelPath(u"StreamRelPath");
+ static constexpr OUStringLiteral sStreamName(u"StreamName");
+
// create XPropertySet with three properties for status indicator
comphelper::PropertyMapEntry aInfoMap[]
- = { { OUString("UsePrettyPrinting"), 0, cppu::UnoType<bool>::get(),
- beans::PropertyAttribute::MAYBEVOID, 0 },
- { OUString("BaseURI"), 0, ::cppu::UnoType<OUString>::get(),
- beans::PropertyAttribute::MAYBEVOID, 0 },
- { OUString("StreamRelPath"), 0, ::cppu::UnoType<OUString>::get(),
+ = { { sUsePrettyPrinting, 0, cppu::UnoType<bool>::get(),
beans::PropertyAttribute::MAYBEVOID, 0 },
- { OUString("StreamName"), 0, ::cppu::UnoType<OUString>::get(),
+ { sBaseURI, 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID,
+ 0 },
+ { sStreamRelPath, 0, ::cppu::UnoType<OUString>::get(),
beans::PropertyAttribute::MAYBEVOID, 0 },
+ { sStreamName, 0, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID,
+ 0 },
{ OUString(), 0, css::uno::Type(), 0, 0 } };
uno::Reference<beans::XPropertySet> xInfoSet(
comphelper::GenericPropertySet_CreateInstance(new comphelper::PropertySetInfo(aInfoMap)));
bool bUsePrettyPrinting
= bFlat || officecfg::Office::Common::Save::Document::PrettyPrinting::get();
- xInfoSet->setPropertyValue("UsePrettyPrinting", Any(bUsePrettyPrinting));
+ xInfoSet->setPropertyValue(sUsePrettyPrinting, Any(bUsePrettyPrinting));
// Set base URI
- OUString sPropName("BaseURI");
- xInfoSet->setPropertyValue(sPropName, Any(rMedium.GetBaseURL(true)));
+ xInfoSet->setPropertyValue(sBaseURI, Any(rMedium.GetBaseURL(true)));
sal_Int32 nSteps = 0;
if (xStatusIndicator.is())
@@ -172,8 +176,7 @@ bool SmXMLExportWrapper::Export(SfxMedium& rMedium)
if (!aName.isEmpty())
{
- sPropName = "StreamRelPath";
- xInfoSet->setPropertyValue(sPropName, Any(aName));
+ xInfoSet->setPropertyValue(sStreamRelPath, Any(aName));
}
}
@@ -292,10 +295,14 @@ bool SmXMLExportWrapper::WriteThroughComponent(const Reference<embed::XStorage>&
}
uno::Reference<beans::XPropertySet> xSet(xStream, uno::UNO_QUERY);
- xSet->setPropertyValue("MediaType", Any(OUString("text/xml")));
+ static const OUStringLiteral sMediaType = u"MediaType";
+ static const OUStringLiteral sTextXml = u"text/xml";
+ xSet->setPropertyValue(sMediaType, Any(OUString(sTextXml)));
// all streams must be encrypted in encrypted document
- xSet->setPropertyValue("UseCommonStoragePasswordEncryption", Any(true));
+ static const OUStringLiteral sUseCommonStoragePasswordEncryption
+ = u"UseCommonStoragePasswordEncryption";
+ xSet->setPropertyValue(sUseCommonStoragePasswordEncryption, Any(true));
// set Base URL
if (rPropSet.is())