diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-10-06 09:42:38 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-10-07 00:47:20 +0200 |
commit | e0c33ec15f53a01fa3ee07489871bbe09bb5c9c3 (patch) | |
tree | 1afe391a2b4bf9eda13de043658941060cb401c2 /xmloff | |
parent | 9e3da252c361b3e2b04a2df7a3ae2a5177b37713 (diff) |
loplugin:ostr: automatic rewrite
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/qa/unit/style.cxx | 4 | ||||
-rw-r--r-- | xmloff/qa/unit/text.cxx | 16 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/style/GradientStyle.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 2 |
5 files changed, 14 insertions, 14 deletions
diff --git a/xmloff/qa/unit/style.cxx b/xmloff/qa/unit/style.cxx index 132caa08c346..4d24f31a1fbb 100644 --- a/xmloff/qa/unit/style.cxx +++ b/xmloff/qa/unit/style.cxx @@ -367,7 +367,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testMCGR_OldToNew) // The old properties need to be still available, as they might be used in macros. OUString sGradientName; xShapeProperties->getPropertyValue("FillGradientName") >>= sGradientName; - CPPUNIT_ASSERT_EQUAL(OUString(u"red2yellow"), sGradientName); + CPPUNIT_ASSERT_EQUAL(u"red2yellow"_ustr, sGradientName); awt::Gradient2 aGradient; xShapeProperties->getPropertyValue("FillGradient") >>= aGradient; CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF0000), aGradient.StartColor); @@ -488,7 +488,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testMCGR_threeStops) // The old properties need to be still available, as they might be used in macros. OUString sGradientName; xShapeProperties->getPropertyValue("FillGradientName") >>= sGradientName; - CPPUNIT_ASSERT_EQUAL(OUString(u"threeStops"), sGradientName); + CPPUNIT_ASSERT_EQUAL(u"threeStops"_ustr, sGradientName); awt::Gradient2 aGradient; xShapeProperties->getPropertyValue("FillGradient") >>= aGradient; CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF0000), aGradient.StartColor); diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx index 47bd6d969fb5..5188770a32ba 100644 --- a/xmloff/qa/unit/text.cxx +++ b/xmloff/qa/unit/text.cxx @@ -608,7 +608,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCheckboxContentControlExport) uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<text::XText> xText = xTextDocument->getText(); uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor(); - xText->insertString(xCursor, OUString(u"☐"), /*bAbsorb=*/false); + xText->insertString(xCursor, u"☐"_ustr, /*bAbsorb=*/false); xCursor->gotoStart(/*bExpand=*/false); xCursor->gotoEnd(/*bExpand=*/true); uno::Reference<text::XTextContent> xContentControl( @@ -616,8 +616,8 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCheckboxContentControlExport) uno::Reference<beans::XPropertySet> xContentControlProps(xContentControl, uno::UNO_QUERY); xContentControlProps->setPropertyValue("Checkbox", uno::Any(true)); xContentControlProps->setPropertyValue("Checked", uno::Any(true)); - xContentControlProps->setPropertyValue("CheckedState", uno::Any(OUString(u"☒"))); - xContentControlProps->setPropertyValue("UncheckedState", uno::Any(OUString(u"☐"))); + xContentControlProps->setPropertyValue("CheckedState", uno::Any(u"☒"_ustr)); + xContentControlProps->setPropertyValue("UncheckedState", uno::Any(u"☐"_ustr)); xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); // When exporting to ODT: @@ -627,8 +627,8 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCheckboxContentControlExport) xmlDocUniquePtr pXmlDoc = parseExport("content.xml"); assertXPath(pXmlDoc, "//loext:content-control", "checkbox", "true"); assertXPath(pXmlDoc, "//loext:content-control", "checked", "true"); - assertXPath(pXmlDoc, "//loext:content-control", "checked-state", u"☒"); - assertXPath(pXmlDoc, "//loext:content-control", "unchecked-state", u"☐"); + assertXPath(pXmlDoc, "//loext:content-control", "checked-state", u"☒"_ustr); + assertXPath(pXmlDoc, "//loext:content-control", "unchecked-state", u"☐"_ustr); } CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCheckboxContentControlImport) @@ -661,16 +661,16 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCheckboxContentControlImport) CPPUNIT_ASSERT(bChecked); OUString aCheckedState; xContentControlProps->getPropertyValue("CheckedState") >>= aCheckedState; - CPPUNIT_ASSERT_EQUAL(OUString(u"☒"), aCheckedState); + CPPUNIT_ASSERT_EQUAL(u"☒"_ustr, aCheckedState); OUString aUncheckedState; xContentControlProps->getPropertyValue("UncheckedState") >>= aUncheckedState; - CPPUNIT_ASSERT_EQUAL(OUString(u"☐"), aUncheckedState); + CPPUNIT_ASSERT_EQUAL(u"☐"_ustr, aUncheckedState); uno::Reference<text::XTextRange> xContentControlRange(xContentControl, uno::UNO_QUERY); uno::Reference<text::XText> xText = xContentControlRange->getText(); uno::Reference<container::XEnumerationAccess> xContentEnumAccess(xText, uno::UNO_QUERY); uno::Reference<container::XEnumeration> xContentEnum = xContentEnumAccess->createEnumeration(); uno::Reference<text::XTextRange> xContent(xContentEnum->nextElement(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString(u"☒"), xContent->getString()); + CPPUNIT_ASSERT_EQUAL(u"☒"_ustr, xContent->getString()); } CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testDropdownContentControlExport) diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 70c95e31c055..30b251cbda01 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -5004,10 +5004,10 @@ static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Referenc // otherwise loext:writing-mode is used in style export. if (!(rExport.getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED)) { - if (xPropSetInfo->hasPropertyByName(u"WritingMode")) + if (xPropSetInfo->hasPropertyByName(u"WritingMode"_ustr)) { sal_Int16 nDirection = -1; - xPropSet->getPropertyValue(u"WritingMode") >>= nDirection; + xPropSet->getPropertyValue(u"WritingMode"_ustr) >>= nDirection; if (nDirection == text::WritingMode2::TB_RL90) fTextRotateAngle -= 90; else if (nDirection == text::WritingMode2::BT_LR) diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx index 29a277a79bef..67b749f79f0b 100644 --- a/xmloff/source/style/GradientStyle.cxx +++ b/xmloff/source/style/GradientStyle.cxx @@ -342,7 +342,7 @@ void XMLGradientStyleExport::exportXML( fPreviousOffset = fOffset; // As of LO 7.6.0 only color-type="rgb" is implemented. - m_rExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_COLOR_TYPE, u"rgb"); + m_rExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_COLOR_TYPE, u"rgb"_ustr); // Attribute loext:color-value, data type color, that is #rrggbb. const basegfx::BColor aDecimalColor(aCandidate.getStopColor()); diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 647d6943a856..811dbf97e47d 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -1490,7 +1490,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( { if ( !lcl_HasListStyle( sStyleName, m_xImpl->m_xParaStyles, GetXMLImport(), - u"NumberingStyleName", + u"NumberingStyleName"_ustr, u"" ) ) { // heading not in a list --> apply outline style |