oox/qa/unit/export.cxx            |    4 
 oox/source/export/ThemeExport.cxx |  156 +++++++++++++++++++-------------------
 oox/source/export/drawingml.cxx   |   24 ++---
 oox/source/export/vmlexport.cxx   |    2 
 oox/source/mathml/importutils.cxx |    8 -
 5 files changed, 97 insertions(+), 97 deletions(-)

New commits:
commit f20425e6de89411ec1d63d04d8d51e1710a6f375
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Wed Nov 29 16:41:18 2023 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Thu Nov 30 09:53:07 2023 +0100

    Extended loplugin:ostr: oox
    
    Change-Id: Ie6db1edbad5305e4935a9fdc03dab36861bf2c8a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160112
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx
index 91954daa7db7..4df8aaa8f587 100644
--- a/oox/qa/unit/export.cxx
+++ b/oox/qa/unit/export.cxx
@@ -980,7 +980,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontworkThemeColor)
 
     // shape with 'lighter'
     sElement = 
"/w:document/w:body/w:p[2]/w:r/mc:AlternateContent[2]/mc:Choice/w:drawing/wp:anchor/"
-               
"a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/";
+               
"a:graphic/a:graphicData/wps:wsp/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/"_ostr;
 
     // Make sure the fallback in <w:color> has correct values
     assertXPath(pXmlDoc, sElement + "w:color", "val"_ostr, "558ED5");
@@ -1310,7 +1310,7 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeColorTransparency)
     assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr/a:alpha", 
"val"_ostr, "35000");
 
     // Make sure a:alpha is written for characters and fill color is a 
schemeClr.
-    sElement = "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:r/a:rPr/";
+    sElement = "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:p/a:r/a:rPr/"_ostr;
     assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr", "val"_ostr, 
"accent4");
     assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr/a:lumMod", 
"val"_ostr, "75000");
     assertXPath(pXmlDoc, sElement + "a:solidFill/a:schemeClr/a:alpha", 
"val"_ostr, "20000");
diff --git a/oox/source/export/ThemeExport.cxx 
b/oox/source/export/ThemeExport.cxx
index fc1c1387d462..6e0efb341ae2 100644
--- a/oox/source/export/ThemeExport.cxx
+++ b/oox/source/export/ThemeExport.cxx
@@ -356,13 +356,13 @@ void ThemeExport::writeGradientFill(model::GradientFill 
const& rGradientFill)
         switch (rGradientFill.meGradientType)
         {
             case model::GradientType::Circle:
-                sPathType = "circle";
+                sPathType = "circle"_ostr;
                 break;
             case model::GradientType::Rectangle:
-                sPathType = "rect";
+                sPathType = "rect"_ostr;
                 break;
             case model::GradientType::Shape:
-                sPathType = "shape";
+                sPathType = "shape"_ostr;
                 break;
             default:
                 break;
@@ -385,166 +385,166 @@ void ThemeExport::writePatternFill(model::PatternFill 
const& rPatternFill)
     switch (rPatternFill.mePatternPreset)
     {
         case model::PatternPreset::Percent_5:
-            sPresetType = "pct5";
+            sPresetType = "pct5"_ostr;
             break;
         case model::PatternPreset::Percent_10:
-            sPresetType = "pct10";
+            sPresetType = "pct10"_ostr;
             break;
         case model::PatternPreset::Percent_20:
-            sPresetType = "pct20";
+            sPresetType = "pct20"_ostr;
             break;
         case model::PatternPreset::Percent_25:
-            sPresetType = "pct25";
+            sPresetType = "pct25"_ostr;
             break;
         case model::PatternPreset::Percent_30:
-            sPresetType = "pct30";
+            sPresetType = "pct30"_ostr;
             break;
         case model::PatternPreset::Percent_40:
-            sPresetType = "pct40";
+            sPresetType = "pct40"_ostr;
             break;
         case model::PatternPreset::Percent_50:
-            sPresetType = "pct50";
+            sPresetType = "pct50"_ostr;
             break;
         case model::PatternPreset::Percent_60:
-            sPresetType = "pct60";
+            sPresetType = "pct60"_ostr;
             break;
         case model::PatternPreset::Percent_70:
-            sPresetType = "pct70";
+            sPresetType = "pct70"_ostr;
             break;
         case model::PatternPreset::Percent_75:
-            sPresetType = "pct75";
+            sPresetType = "pct75"_ostr;
             break;
         case model::PatternPreset::Percent_80:
-            sPresetType = "pct80";
+            sPresetType = "pct80"_ostr;
             break;
         case model::PatternPreset::Percent_90:
-            sPresetType = "pct90";
+            sPresetType = "pct90"_ostr;
             break;
         case model::PatternPreset::Horizontal:
-            sPresetType = "horz";
+            sPresetType = "horz"_ostr;
             break;
         case model::PatternPreset::Vertical:
-            sPresetType = "vert";
+            sPresetType = "vert"_ostr;
             break;
         case model::PatternPreset::LightHorizontal:
-            sPresetType = "ltHorz";
+            sPresetType = "ltHorz"_ostr;
             break;
         case model::PatternPreset::LightVertical:
-            sPresetType = "ltVert";
+            sPresetType = "ltVert"_ostr;
             break;
         case model::PatternPreset::DarkHorizontal:
-            sPresetType = "dkHorz";
+            sPresetType = "dkHorz"_ostr;
             break;
         case model::PatternPreset::DarkVertical:
-            sPresetType = "dkVert";
+            sPresetType = "dkVert"_ostr;
             break;
         case model::PatternPreset::NarrowHorizontal:
-            sPresetType = "narHorz";
+            sPresetType = "narHorz"_ostr;
             break;
         case model::PatternPreset::NarrowVertical:
-            sPresetType = "narVert";
+            sPresetType = "narVert"_ostr;
             break;
         case model::PatternPreset::DashedHorizontal:
-            sPresetType = "dashHorz";
+            sPresetType = "dashHorz"_ostr;
             break;
         case model::PatternPreset::DashedVertical:
-            sPresetType = "dashVert";
+            sPresetType = "dashVert"_ostr;
             break;
         case model::PatternPreset::Cross:
-            sPresetType = "cross";
+            sPresetType = "cross"_ostr;
             break;
         case model::PatternPreset::DownwardDiagonal:
-            sPresetType = "dnDiag";
+            sPresetType = "dnDiag"_ostr;
             break;
         case model::PatternPreset::UpwardDiagonal:
-            sPresetType = "upDiag";
+            sPresetType = "upDiag"_ostr;
             break;
         case model::PatternPreset::LightDownwardDiagonal:
-            sPresetType = "ltDnDiag";
+            sPresetType = "ltDnDiag"_ostr;
             break;
         case model::PatternPreset::LightUpwardDiagonal:
-            sPresetType = "ltUpDiag";
+            sPresetType = "ltUpDiag"_ostr;
             break;
         case model::PatternPreset::DarkDownwardDiagonal:
-            sPresetType = "dkDnDiag";
+            sPresetType = "dkDnDiag"_ostr;
             break;
         case model::PatternPreset::DarkUpwardDiagonal:
-            sPresetType = "dkUpDiag";
+            sPresetType = "dkUpDiag"_ostr;
             break;
         case model::PatternPreset::WideDownwardDiagonal:
-            sPresetType = "wdDnDiag";
+            sPresetType = "wdDnDiag"_ostr;
             break;
         case model::PatternPreset::WideUpwardDiagonal:
-            sPresetType = "wdUpDiag";
+            sPresetType = "wdUpDiag"_ostr;
             break;
         case model::PatternPreset::DashedDownwardDiagonal:
-            sPresetType = "dashDnDiag";
+            sPresetType = "dashDnDiag"_ostr;
             break;
         case model::PatternPreset::DashedUpwardDiagonal:
-            sPresetType = "dashUpDiag";
+            sPresetType = "dashUpDiag"_ostr;
             break;
         case model::PatternPreset::DiagonalCross:
-            sPresetType = "diagCross";
+            sPresetType = "diagCross"_ostr;
             break;
         case model::PatternPreset::SmallCheckerBoard:
-            sPresetType = "smCheck";
+            sPresetType = "smCheck"_ostr;
             break;
         case model::PatternPreset::LargeCheckerBoard:
-            sPresetType = "lgCheck";
+            sPresetType = "lgCheck"_ostr;
             break;
         case model::PatternPreset::SmallGrid:
-            sPresetType = "smGrid";
+            sPresetType = "smGrid"_ostr;
             break;
         case model::PatternPreset::LargeGrid:
-            sPresetType = "lgGrid";
+            sPresetType = "lgGrid"_ostr;
             break;
         case model::PatternPreset::DottedGrid:
-            sPresetType = "dotGrid";
+            sPresetType = "dotGrid"_ostr;
             break;
         case model::PatternPreset::SmallConfetti:
-            sPresetType = "smConfetti";
+            sPresetType = "smConfetti"_ostr;
             break;
         case model::PatternPreset::LargeConfetti:
-            sPresetType = "lgConfetti";
+            sPresetType = "lgConfetti"_ostr;
             break;
         case model::PatternPreset::HorizontalBrick:
-            sPresetType = "horzBrick";
+            sPresetType = "horzBrick"_ostr;
             break;
         case model::PatternPreset::DiagonalBrick:
-            sPresetType = "diagBrick";
+            sPresetType = "diagBrick"_ostr;
             break;
         case model::PatternPreset::SolidDiamond:
-            sPresetType = "solidDmnd";
+            sPresetType = "solidDmnd"_ostr;
             break;
         case model::PatternPreset::OpenDiamond:
-            sPresetType = "openDmnd";
+            sPresetType = "openDmnd"_ostr;
             break;
         case model::PatternPreset::DottedDiamond:
-            sPresetType = "dotDmnd";
+            sPresetType = "dotDmnd"_ostr;
             break;
         case model::PatternPreset::Plaid:
-            sPresetType = "plaid";
+            sPresetType = "plaid"_ostr;
             break;
         case model::PatternPreset::Sphere:
-            sPresetType = "sphere";
+            sPresetType = "sphere"_ostr;
             break;
         case model::PatternPreset::Weave:
-            sPresetType = "weave";
+            sPresetType = "weave"_ostr;
             break;
         case model::PatternPreset::Divot:
-            sPresetType = "divot";
+            sPresetType = "divot"_ostr;
             break;
         case model::PatternPreset::Shingle:
-            sPresetType = "shingle";
+            sPresetType = "shingle"_ostr;
             break;
         case model::PatternPreset::Wave:
-            sPresetType = "wave";
+            sPresetType = "wave"_ostr;
             break;
         case model::PatternPreset::Trellis:
-            sPresetType = "trellis";
+            sPresetType = "trellis"_ostr;
             break;
         case model::PatternPreset::ZigZag:
-            sPresetType = "zigZag";
+            sPresetType = "zigZag"_ostr;
             break;
         default:
             break;
@@ -697,13 +697,13 @@ void ThemeExport::writeLineStyle(model::LineStyle const& 
rLineStyle)
     switch (rLineStyle.meCapType)
     {
         case model::CapType::Flat:
-            sCap = "flat";
+            sCap = "flat"_ostr;
             break;
         case model::CapType::Round:
-            sCap = "rnd";
+            sCap = "rnd"_ostr;
             break;
         case model::CapType::Square:
-            sCap = "sq";
+            sCap = "sq"_ostr;
             break;
         case model::CapType::Unset:
             break;
@@ -713,10 +713,10 @@ void ThemeExport::writeLineStyle(model::LineStyle const& 
rLineStyle)
     switch (rLineStyle.mePenAlignment)
     {
         case model::PenAlignmentType::Center:
-            sPenAlign = "ctr";
+            sPenAlign = "ctr"_ostr;
             break;
         case model::PenAlignmentType::Inset:
-            sPenAlign = "in";
+            sPenAlign = "in"_ostr;
             break;
         case model::PenAlignmentType::Unset:
             break;
@@ -726,19 +726,19 @@ void ThemeExport::writeLineStyle(model::LineStyle const& 
rLineStyle)
     switch (rLineStyle.meCompoundLineType)
     {
         case model::CompoundLineType::Single:
-            sCompoundLine = "sng";
+            sCompoundLine = "sng"_ostr;
             break;
         case model::CompoundLineType::Double:
-            sCompoundLine = "dbl";
+            sCompoundLine = "dbl"_ostr;
             break;
         case model::CompoundLineType::ThickThin_Double:
-            sCompoundLine = "thickThin";
+            sCompoundLine = "thickThin"_ostr;
             break;
         case model::CompoundLineType::ThinThick_Double:
-            sCompoundLine = "thinThick";
+            sCompoundLine = "thinThick"_ostr;
             break;
         case model::CompoundLineType::Triple:
-            sCompoundLine = "tri";
+            sCompoundLine = "tri"_ostr;
             break;
         case model::CompoundLineType::Unset:
             break;
@@ -755,37 +755,37 @@ void ThemeExport::writeLineStyle(model::LineStyle const& 
rLineStyle)
         switch (rLineStyle.maLineDash.mePresetType)
         {
             case model::PresetDashType::Dot:
-                sPresetType = "dot";
+                sPresetType = "dot"_ostr;
                 break;
             case model::PresetDashType::Dash:
-                sPresetType = "dash";
+                sPresetType = "dash"_ostr;
                 break;
             case model::PresetDashType::LargeDash:
-                sPresetType = "lgDash";
+                sPresetType = "lgDash"_ostr;
                 break;
             case model::PresetDashType::DashDot:
-                sPresetType = "dashDot";
+                sPresetType = "dashDot"_ostr;
                 break;
             case model::PresetDashType::LargeDashDot:
-                sPresetType = "lgDashDot";
+                sPresetType = "lgDashDot"_ostr;
                 break;
             case model::PresetDashType::LargeDashDotDot:
-                sPresetType = "lgDashDotDot";
+                sPresetType = "lgDashDotDot"_ostr;
                 break;
             case model::PresetDashType::Solid:
-                sPresetType = "solid";
+                sPresetType = "solid"_ostr;
                 break;
             case model::PresetDashType::SystemDash:
-                sPresetType = "sysDash";
+                sPresetType = "sysDash"_ostr;
                 break;
             case model::PresetDashType::SystemDot:
-                sPresetType = "sysDot";
+                sPresetType = "sysDot"_ostr;
                 break;
             case model::PresetDashType::SystemDashDot:
-                sPresetType = "sysDashDot";
+                sPresetType = "sysDashDot"_ostr;
                 break;
             case model::PresetDashType::SystemDashDotDot:
-                sPresetType = "sysDashDotDot";
+                sPresetType = "sysDashDotDot"_ostr;
                 break;
             case model::PresetDashType::Unset:
                 break;
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 4bce89943ba3..8c2abb6b07cc 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -3239,17 +3239,17 @@ void DrawingML::WriteParagraphTabStops(const 
Reference<XPropertySet>& rXPropSet)
         switch (rTabStop.Alignment)
         {
             case css::style::TabAlign_DECIMAL:
-                sAlignment = "dec";
+                sAlignment = "dec"_ostr;
                 break;
             case css::style::TabAlign_RIGHT:
-                sAlignment = "r";
+                sAlignment = "r"_ostr;
                 break;
             case css::style::TabAlign_CENTER:
-                sAlignment = "ctr";
+                sAlignment = "ctr"_ostr;
                 break;
             case css::style::TabAlign_LEFT:
             default:
-                sAlignment = "l";
+                sAlignment = "l"_ostr;
         }
         mpFS->singleElementNS(XML_a, XML_tab, XML_algn, sAlignment, XML_pos, 
sPosition);
     }
@@ -4466,10 +4466,10 @@ void prepareTextArea(const EnhancedCustomShape2d& 
rEnhancedCustomShape2d,
     tools::Rectangle aLogicRectLO(rEnhancedCustomShape2d.GetLogicRect());
     if (aTextAreaLO == aLogicRectLO)
     {
-        rTextAreaRect.left = "l";
-        rTextAreaRect.top = "t";
-        rTextAreaRect.right = "r";
-        rTextAreaRect.bottom = "b";
+        rTextAreaRect.left = "l"_ostr;
+        rTextAreaRect.top = "t"_ostr;
+        rTextAreaRect.right = "r"_ostr;
+        rTextAreaRect.bottom = "b"_ostr;
         return;
     }
     // Flip aTextAreaLO if shape is flipped
@@ -4484,7 +4484,7 @@ void prepareTextArea(const EnhancedCustomShape2d& 
rEnhancedCustomShape2d,
     const OString sWidth = 
OString::number(oox::drawingml::convertHmmToEmu(nWidth));
 
     // left
-    aGuide.sName = "textAreaLeft";
+    aGuide.sName = "textAreaLeft"_ostr;
     sal_Int32 nHelp = aTextAreaLO.Left() - aLogicRectLO.Left();
     const OString sLeft = 
OString::number(oox::drawingml::convertHmmToEmu(nHelp));
     aGuide.sFormula = "*/ " + sLeft + " w " + sWidth;
@@ -4492,7 +4492,7 @@ void prepareTextArea(const EnhancedCustomShape2d& 
rEnhancedCustomShape2d,
     rGuideList.push_back(aGuide);
 
     // right
-    aGuide.sName = "textAreaRight";
+    aGuide.sName = "textAreaRight"_ostr;
     nHelp = aTextAreaLO.Right() - aLogicRectLO.Left();
     const OString sRight = 
OString::number(oox::drawingml::convertHmmToEmu(nHelp));
     aGuide.sFormula = "*/ " + sRight + " w " + sWidth;
@@ -4504,7 +4504,7 @@ void prepareTextArea(const EnhancedCustomShape2d& 
rEnhancedCustomShape2d,
     const OString sHeight = 
OString::number(oox::drawingml::convertHmmToEmu(nHeight));
 
     // top
-    aGuide.sName = "textAreaTop";
+    aGuide.sName = "textAreaTop"_ostr;
     nHelp = aTextAreaLO.Top() - aLogicRectLO.Top();
     const OString sTop = 
OString::number(oox::drawingml::convertHmmToEmu(nHelp));
     aGuide.sFormula = "*/ " + sTop + " h " + sHeight;
@@ -4512,7 +4512,7 @@ void prepareTextArea(const EnhancedCustomShape2d& 
rEnhancedCustomShape2d,
     rGuideList.push_back(aGuide);
 
     // bottom
-    aGuide.sName = "textAreaBottom";
+    aGuide.sName = "textAreaBottom"_ostr;
     nHelp = aTextAreaLO.Bottom() - aLogicRectLO.Top();
     const OString sBottom = 
OString::number(oox::drawingml::convertHmmToEmu(nHelp));
     aGuide.sFormula = "*/ " + sBottom + " h " + sHeight;
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index cfaa815aa964..1090b0857f5c 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -1462,7 +1462,7 @@ sal_Int32 VMLExport::StartShape()
     {
         OString sType;
         if (m_bUseHashMarkForType)
-            sType = "#";
+            sType = "#"_ostr;
         m_pShapeAttrList->add( XML_type, sType +
                 "_x0000_t" + OString::number( m_nShapeType ) );
     }
diff --git a/oox/source/mathml/importutils.cxx 
b/oox/source/mathml/importutils.cxx
index 123ae0072915..7aa8a1a924e5 100644
--- a/oox/source/mathml/importutils.cxx
+++ b/oox/source/mathml/importutils.cxx
@@ -55,7 +55,7 @@ OString tokenToString( int token )
     uno::Sequence< sal_Int8 > const & aTokenNameSeq = 
StaticTokenMap().getUtf8TokenName( token & TOKEN_MASK );
     OString tokenname( reinterpret_cast< const char* >( 
aTokenNameSeq.getConstArray() ), aTokenNameSeq.getLength() );
     if( tokenname.isEmpty())
-        tokenname = "???";
+        tokenname = "???"_ostr;
     int nmsp = ( token & NMSP_MASK & ~( TAG_OPENING | TAG_CLOSING ));
 #if 0 // this is awfully long
     OString namespacename = StaticNamespaceMap::get().count( nmsp ) != 0
@@ -66,13 +66,13 @@ OString tokenToString( int token )
     switch( nmsp )
     {
         case NMSP_officeMath:
-            namespacename = "m";
+            namespacename = "m"_ostr;
             break;
         case NMSP_doc:
-            namespacename = "w";
+            namespacename = "w"_ostr;
             break;
         default:
-            namespacename = "?";
+            namespacename = "?"_ostr;
             break;
     }
 #endif

Reply via email to