summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-10-19 10:30:21 +0200
committerStephan Bergmann <sbergman@redhat.com>2023-10-20 07:58:45 +0200
commit44bd87fd784e64205030067bf91e67ac3cecfa2d (patch)
treefb7ccfd6674e7a0b57f8c251bbb7c9b9ce363bc5 /oox
parentcbe3899ed9b0fb226bf84c19e6f312e587ce2c03 (diff)
Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: oox
Change-Id: Ic5bcb44fbe56804e23bcdfd039a77c010858ca02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158206 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/qa/unit/export.cxx2
-rw-r--r--oox/qa/unit/mcgr.cxx8
-rw-r--r--oox/source/core/filterbase.cxx6
-rw-r--r--oox/source/core/xmlfilterbase.cxx4
-rw-r--r--oox/source/crypto/Standard2007Engine.cxx2
-rw-r--r--oox/source/drawingml/customshapeproperties.cxx2
-rw-r--r--oox/source/drawingml/fontworkhelpers.cxx6
-rw-r--r--oox/source/drawingml/hyperlinkcontext.cxx4
-rw-r--r--oox/source/drawingml/shape.cxx2
-rw-r--r--oox/source/export/vmlexport.cxx2
-rw-r--r--oox/source/helper/modelobjecthelper.cxx4
-rw-r--r--oox/source/ole/oleobjecthelper.cxx2
-rw-r--r--oox/source/ppt/pptshape.cxx2
-rw-r--r--oox/source/ppt/presentationfragmenthandler.cxx4
-rw-r--r--oox/source/ppt/slidepersist.cxx2
-rw-r--r--oox/source/vml/vmlinputstream.cxx2
-rw-r--r--oox/source/vml/vmlshape.cxx2
-rw-r--r--oox/source/vml/vmlshapecontext.cxx2
18 files changed, 29 insertions, 29 deletions
diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx
index f3221d7e9f18..75d89a07e970 100644
--- a/oox/qa/unit/export.cxx
+++ b/oox/qa/unit/export.cxx
@@ -920,7 +920,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkDirectColor)
// Examine the saved markup.
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- static constexpr OStringLiteral sElement = "//w:txbxContent/w:p/w:r/w:rPr/";
+ static constexpr OString sElement = "//w:txbxContent/w:p/w:r/w:rPr/"_ostr;
// Make sure the fallback in <w:color> has correct value.
assertXPath(pXmlDoc, sElement + "w:color", "val", "2E8B57");
diff --git a/oox/qa/unit/mcgr.cxx b/oox/qa/unit/mcgr.cxx
index 1158da7fc35e..841951cd93f2 100644
--- a/oox/qa/unit/mcgr.cxx
+++ b/oox/qa/unit/mcgr.cxx
@@ -34,7 +34,7 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testFontworkColorGradient)
// linear gradient with 30deg angle
assertXPath(pXmlDoc, "//a:r/a:rPr/a:gradFill/a:lin", "ang", "3600000");
// three color stops, no transparency
- static constexpr OStringLiteral sPath = "//a:r/a:rPr/a:gradFill/a:gsLst/";
+ static constexpr OString sPath = "//a:r/a:rPr/a:gradFill/a:gsLst/"_ostr;
assertXPath(pXmlDoc, sPath + "a:gs", 3);
assertXPath(pXmlDoc, sPath + "a:gs[1]", "pos", "0");
assertXPath(pXmlDoc, sPath + "a:gs[1]/a:srgbClr", "val", "ff1493");
@@ -57,7 +57,7 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testFontworkColorGradientWord)
// linear gradient with 30deg angle
assertXPath(pXmlDoc, "//w14:lin", "ang", "3600000");
// three color stops, no transparency
- static constexpr OStringLiteral sPath = "//w14:gradFill/w14:gsLst/";
+ static constexpr OString sPath = "//w14:gradFill/w14:gsLst/"_ostr;
assertXPath(pXmlDoc, sPath + "w14:gs", 3);
assertXPath(pXmlDoc, sPath + "w14:gs[1]", "pos", "0");
assertXPath(pXmlDoc, sPath + "w14:gs[1]/w14:srgbClr", "val", "ff1493");
@@ -88,7 +88,7 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testStepCount)
// Without the fix the colors in the sections were wrong. And when opening a file with StepCount
// and saving it immediately to pptx, a continuous gradient might be produced.
- static constexpr OStringLiteral sPath = "//a:gradFill/a:gsLst/";
+ static constexpr OString sPath = "//a:gradFill/a:gsLst/"_ostr;
// The default way of load and save would have produced 2 stops, but we need start stop, end stop
// and 3*2 inner stops.
assertXPath(pXmlDoc, sPath + "a:gs", 8);
@@ -115,7 +115,7 @@ CPPUNIT_TEST_FIXTURE(TestMCGR, testAxialColorLinearTrans)
// method will be changed, the test needs to be adjusted.
xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
- static constexpr OStringLiteral sPath = "//a:gradFill/a:gsLst/";
+ static constexpr OString sPath = "//a:gradFill/a:gsLst/"_ostr;
assertXPath(pXmlDoc, sPath + "a:gs", 3);
assertXPath(pXmlDoc, sPath + "a:gs[1]", "pos", "0");
assertXPath(pXmlDoc, sPath + "a:gs[1]/a:srgbClr", "val", "00ffff");
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index 105cb0660b7b..ac2c1f5c7e0a 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -269,10 +269,10 @@ OUString FilterBase::getAbsoluteUrl( const OUString& rUrl ) const
{
// handle some special cases before calling ::rtl::Uri::convertRelToAbs()
- static constexpr OUStringLiteral aFileSchema = u"file:";
- static constexpr OUStringLiteral aFilePrefix = u"file:///";
+ static constexpr OUString aFileSchema = u"file:"_ustr;
+ static constexpr OUString aFilePrefix = u"file:///"_ustr;
const sal_Int32 nFilePrefixLen = aFilePrefix.getLength();
- static constexpr OUStringLiteral aUncPrefix = u"//";
+ static constexpr OUString aUncPrefix = u"//"_ustr;
/* (1) convert all backslashes to slashes, and check that passed URL is
not empty. */
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 0c95980accd4..d197440133da 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -183,7 +183,7 @@ struct XmlFilterBaseImpl
explicit XmlFilterBaseImpl();
};
-constexpr OUStringLiteral gaBinSuffix( u".bin" );
+constexpr OUString gaBinSuffix( u".bin"_ustr );
XmlFilterBaseImpl::XmlFilterBaseImpl() :
mrNamespaceMap(StaticNamespaceMap())
@@ -258,7 +258,7 @@ void XmlFilterBase::putPropertiesToDocumentGrabBag(const css::uno::Reference<css
{
uno::Reference<beans::XPropertySetInfo> xPropsInfo = xDocProps->getPropertySetInfo();
- static constexpr OUStringLiteral aGrabBagPropName = u"InteropGrabBag";
+ static constexpr OUString aGrabBagPropName = u"InteropGrabBag"_ustr;
if (xPropsInfo.is() && xPropsInfo->hasPropertyByName(aGrabBagPropName))
{
// get existing grab bag
diff --git a/oox/source/crypto/Standard2007Engine.cxx b/oox/source/crypto/Standard2007Engine.cxx
index a045046c3bc4..b588fc5c8fd0 100644
--- a/oox/source/crypto/Standard2007Engine.cxx
+++ b/oox/source/crypto/Standard2007Engine.cxx
@@ -32,7 +32,7 @@ void lclRandomGenerateValues(sal_uInt8* aArray, sal_uInt32 aSize)
rtl_random_destroyPool(aRandomPool);
}
-constexpr OUStringLiteral lclCspName = u"Microsoft Enhanced RSA and AES Cryptographic Provider";
+constexpr OUString lclCspName = u"Microsoft Enhanced RSA and AES Cryptographic Provider"_ustr;
constexpr const sal_uInt32 AES128Size = 16;
} // end anonymous namespace
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index 766876385c64..0ff24fce1789 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -134,7 +134,7 @@ void CustomShapeProperties::pushToPropSet(
if ( !maAdjustmentGuideList.empty() )
{
- static constexpr OUStringLiteral sCustomShapeGeometry(u"CustomShapeGeometry");
+ static constexpr OUString sCustomShapeGeometry(u"CustomShapeGeometry"_ustr);
static constexpr OUStringLiteral sAdjustmentValues(u"AdjustmentValues");
uno::Any aGeoPropSet = xPropSet->getPropertyValue( sCustomShapeGeometry );
uno::Sequence< beans::PropertyValue > aGeoPropSeq;
diff --git a/oox/source/drawingml/fontworkhelpers.cxx b/oox/source/drawingml/fontworkhelpers.cxx
index d58c513bedb6..a72534fd53b2 100644
--- a/oox/source/drawingml/fontworkhelpers.cxx
+++ b/oox/source/drawingml/fontworkhelpers.cxx
@@ -156,9 +156,9 @@ void FontworkHelpers::putCustomShapeIntoTextPathMode(
= comphelper::sequenceToContainer<std::vector<beans::PropertyValue>>(aGeomPropSeq);
// Reset old properties
- static constexpr OUStringLiteral sTextPath(u"TextPath");
- static constexpr OUStringLiteral sAdjustmentValues(u"AdjustmentValues");
- static constexpr OUStringLiteral sPresetTextWarp(u"PresetTextWarp");
+ static constexpr OUString sTextPath(u"TextPath"_ustr);
+ static constexpr OUString sAdjustmentValues(u"AdjustmentValues"_ustr);
+ static constexpr OUString sPresetTextWarp(u"PresetTextWarp"_ustr);
resetPropertyValueInVec(aGeomPropVec, u"CoordinateSize"_ustr);
resetPropertyValueInVec(aGeomPropVec, u"Equations"_ustr);
diff --git a/oox/source/drawingml/hyperlinkcontext.cxx b/oox/source/drawingml/hyperlinkcontext.cxx
index c4bc08b40c13..48a7465bd146 100644
--- a/oox/source/drawingml/hyperlinkcontext.cxx
+++ b/oox/source/drawingml/hyperlinkcontext.cxx
@@ -81,7 +81,7 @@ HyperLinkContext::HyperLinkContext( ContextHandler2Helper const & rParent,
// ppaction://macro?name=MACRO_NAME
// ppaction://program
- static constexpr OUStringLiteral sPPAction( u"ppaction://" );
+ static constexpr OUString sPPAction( u"ppaction://"_ustr );
if ( aAction.matchIgnoreAsciiCase( sPPAction ) )
{
OUString aPPAct( aAction.copy( sPPAction.getLength() ) );
@@ -90,7 +90,7 @@ HyperLinkContext::HyperLinkContext( ContextHandler2Helper const & rParent,
if ( aPPAction.match( "hlinkshowjump" ) )
{
- static constexpr OUStringLiteral sJump( u"jump=" );
+ static constexpr OUString sJump( u"jump="_ustr );
if ( aPPAct.match( sJump, nIndex + 1 ) )
{
std::u16string_view aDestination( aPPAct.subView( nIndex + 1 + sJump.getLength() ) );
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index f48b4d856a4a..c8149a087773 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1419,7 +1419,7 @@ Reference< XShape > const & Shape::createAndInsert(
if(mnRotation)
{
uno::Reference<beans::XPropertySet> xPropertySet(mxShape, uno::UNO_QUERY);
- static constexpr OUStringLiteral aGrabBagPropName = u"FrameInteropGrabBag";
+ static constexpr OUString aGrabBagPropName = u"FrameInteropGrabBag"_ustr;
uno::Sequence<beans::PropertyValue> aGrabBag;
xPropertySet->getPropertyValue(aGrabBagPropName) >>= aGrabBag;
beans::PropertyValue aPair(comphelper::makePropertyValue("mso-rotation-angle",
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index d0d4774d94fb..2ed2903bfe27 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -1134,7 +1134,7 @@ void VMLExport::AddLineDimensions( const tools::Rectangle& rRectangle )
if ( mnGroupLevel == 1 )
{
- static constexpr OStringLiteral aPt( "pt" );
+ static constexpr OString aPt( "pt"_ostr );
aLeft = OString::number( double( rRectangle.Left() ) / 20 ) + aPt;
aTop = OString::number( double( rRectangle.Top() ) / 20 ) + aPt;
aRight = OString::number( double( rRectangle.Right() ) / 20 ) + aPt;
diff --git a/oox/source/helper/modelobjecthelper.cxx b/oox/source/helper/modelobjecthelper.cxx
index e721d2ef3413..e38a6ee207e2 100644
--- a/oox/source/helper/modelobjecthelper.cxx
+++ b/oox/source/helper/modelobjecthelper.cxx
@@ -90,8 +90,8 @@ void ObjectContainer::createContainer() const
}
constexpr OUStringLiteral gaDashNameBase( u"msLineDash " ); ///< Base name for all named line dashes.
-constexpr OUStringLiteral gaGradientNameBase( u"msFillGradient " ); ///< Base name for all named fill gradients.
-constexpr OUStringLiteral gaTransGradNameBase( u"msTransGradient " ); ///< Base name for all named fill gradients.
+constexpr OUString gaGradientNameBase( u"msFillGradient "_ustr ); ///< Base name for all named fill gradients.
+constexpr OUString gaTransGradNameBase( u"msTransGradient "_ustr ); ///< Base name for all named fill gradients.
constexpr OUStringLiteral gaBitmapUrlNameBase( u"msFillBitmap " ); ///< Base name for all named fill bitmap URLs.
constexpr OUStringLiteral gaHatchNameBase( u"msFillHatch " ); ///< Base name for all named fill hatches.
diff --git a/oox/source/ole/oleobjecthelper.cxx b/oox/source/ole/oleobjecthelper.cxx
index b71f1ade194a..1816773db82d 100644
--- a/oox/source/ole/oleobjecthelper.cxx
+++ b/oox/source/ole/oleobjecthelper.cxx
@@ -92,7 +92,7 @@ void SaveInteropProperties(uno::Reference<frame::XModel> const& xModel,
OUString const& rObjectName, OUString const*const pOldObjectName,
OUString const& rProgId)
{
- static constexpr OUStringLiteral sEmbeddingsPropName = u"EmbeddedObjects";
+ static constexpr OUString sEmbeddingsPropName = u"EmbeddedObjects"_ustr;
// get interop grab bag from document
uno::Reference<beans::XPropertySet> const xDocProps(xModel, uno::UNO_QUERY);
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 7b5b46546e3d..dc8d16ae6d37 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -182,7 +182,7 @@ void PPTShape::addShape(
if (sServiceName != "com.sun.star.drawing.GraphicObjectShape" &&
sServiceName != "com.sun.star.drawing.OLE2Shape")
{
- static constexpr OUStringLiteral sOutlinerShapeService(u"com.sun.star.presentation.OutlinerShape");
+ static constexpr OUString sOutlinerShapeService(u"com.sun.star.presentation.OutlinerShape"_ustr);
SAL_INFO("oox.ppt","has master: " << std::hex << rSlidePersist.getMasterPersist().get());
switch (mnSubType)
{
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index 5dd00957b8b8..8c5fbf261414 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -194,7 +194,7 @@ void PresentationFragmentHandler::importCustomSlideShow(std::vector<CustomShow>&
UNO_QUERY);
if (xShow.is())
{
- static constexpr OUStringLiteral sSlide = u"slides/slide";
+ static constexpr OUString sSlide = u"slides/slide"_ustr;
for (size_t j = 0; j < rCustomShowList[i].maSldLst.size(); ++j)
{
OUString sCustomSlide = rCustomShowList[i].maSldLst[j];
@@ -314,7 +314,7 @@ void PresentationFragmentHandler::saveThemeToGrabBag(const oox::drawingml::Theme
{
uno::Reference<beans::XPropertySetInfo> xPropsInfo = xDocProps->getPropertySetInfo();
- static constexpr OUStringLiteral aGrabBagPropName = u"InteropGrabBag";
+ static constexpr OUString aGrabBagPropName = u"InteropGrabBag"_ustr;
if (xPropsInfo.is() && xPropsInfo->hasPropertyByName(aGrabBagPropName))
{
// get existing grab bag
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 7ea55ced1b96..cd42ef6bcdb6 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -242,7 +242,7 @@ void SlidePersist::applyTextStyles( const XmlFilterBase& rFilterBase )
OUString aFamily;
static constexpr OUStringLiteral sOutline( u"outline1" );
- static constexpr OUStringLiteral sTitle( u"title" );
+ static constexpr OUString sTitle( u"title"_ustr );
static constexpr OUStringLiteral sStandard( u"standard" );
static constexpr OUStringLiteral sSubtitle( u"subtitle" );
diff --git a/oox/source/vml/vmlinputstream.cxx b/oox/source/vml/vmlinputstream.cxx
index 53cc6b455a14..26371748ee99 100644
--- a/oox/source/vml/vmlinputstream.cxx
+++ b/oox/source/vml/vmlinputstream.cxx
@@ -264,7 +264,7 @@ bool lclProcessCharacters( OStringBuffer& rBuffer, const OString& rChars )
} // namespace
constexpr OStringLiteral gaOpeningCData( "<![CDATA[" );
-constexpr OStringLiteral gaClosingCData( "]]>" );
+constexpr OString gaClosingCData( "]]>"_ostr );
InputStream::InputStream( const Reference< XComponentContext >& rxContext, const Reference< XInputStream >& rxInStrm ) :
// use single-byte ISO-8859-1 encoding which maps all byte characters to the first 256 Unicode characters
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 81ba42ba0a48..5284de176839 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -312,7 +312,7 @@ void ShapeBase::finalizeFragmentImport()
else {
// Temporary fix, shapetype not found if referenced from different substream
// FIXME: extend scope of ShapeContainer to store all shapetypes from the document
- static constexpr OUStringLiteral sShapeTypePrefix = u"shapetype_";
+ static constexpr OUString sShapeTypePrefix = u"shapetype_"_ustr;
OUString tmp;
if (aType.startsWith(sShapeTypePrefix)) {
maTypeModel.moShapeType = o3tl::toInt32(aType.subView(sShapeTypePrefix.getLength()));
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index 2e3b1ef9fd72..e3242368a334 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -295,7 +295,7 @@ ShapeTypeContext::ShapeTypeContext(ContextHandler2Helper const & rParent,
{
mrTypeModel.maShapeName = rAttribs.getXString( XML_id, OUString() );
// get ShapeType and ShapeId from name for compatibility
- static constexpr OUStringLiteral sShapeTypePrefix = u"shapetype_";
+ static constexpr OUString sShapeTypePrefix = u"shapetype_"_ustr;
OUString tmp;
if( mrTypeModel.maShapeName.startsWith( sShapeTypePrefix ) )
{