Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: writerfilter

Change-Id: I6d566f7d7d2ef3d7d5efdd3cc94f129c6b4dbbb3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158292
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2023-10-19 10:30:41 +02:00
parent c184f93863
commit de087da924
6 changed files with 19 additions and 19 deletions

View file

@ -74,7 +74,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNumberingRestartStyleParent)
uno::UNO_QUERY);
uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
uno::Reference<beans::XPropertySet> xPara;
static constexpr OUStringLiteral aProp(u"ListLabelString");
static constexpr OUString aProp(u"ListLabelString"_ustr);
xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("A."), xPara->getPropertyValue(aProp).get<OUString>());
xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY);

View file

@ -799,7 +799,7 @@ void DomainMapper_Impl::RemoveLastParagraph( )
return;
uno::Reference<beans::XPropertySet> xDocProps(GetTextDocument(), uno::UNO_QUERY_THROW);
static constexpr OUStringLiteral RecordChanges(u"RecordChanges");
static constexpr OUString RecordChanges(u"RecordChanges"_ustr);
comphelper::ScopeGuard redlineRestore(
[xDocProps, aPreviousValue = xDocProps->getPropertyValue(RecordChanges)]()
@ -4713,7 +4713,7 @@ static sal_Int16 lcl_ParseNumberingType( std::u16string_view rCommand )
// The command looks like: " PAGE \* Arabic "
// tdf#132185: but may as well be "PAGE \* Arabic"
OUString sNumber;
constexpr OUStringLiteral rSeparator(u"\\* ");
constexpr OUString rSeparator(u"\\* "_ustr);
if (size_t nStartIndex = rCommand.find(rSeparator); nStartIndex != std::u16string_view::npos)
{
sal_Int32 nStartIndex2 = nStartIndex + rSeparator.getLength();
@ -6299,9 +6299,9 @@ static uno::Sequence< beans::PropertyValues > lcl_createTOXLevelHyperlinks( bool
std::vector<css::beans::PropertyValues> aNewLevel;
aNewLevel.reserve(aLevel.getLength() + 5); // at most 5 added items
static constexpr OUStringLiteral tokType(u"TokenType");
static constexpr OUStringLiteral tokHStart(u"TokenHyperlinkStart");
static constexpr OUStringLiteral tokHEnd(u"TokenHyperlinkEnd");
static constexpr OUString tokType(u"TokenType"_ustr);
static constexpr OUString tokHStart(u"TokenHyperlinkStart"_ustr);
static constexpr OUString tokHEnd(u"TokenHyperlinkEnd"_ustr);
static constexpr OUStringLiteral tokPNum(u"TokenPageNumber");
static constexpr OUStringLiteral tokENum(u"TokenEntryNumber");

View file

@ -92,7 +92,7 @@ uno::Reference<form::XForm> const & FormControlHelper::FormControlHelper_Impl::g
if (xFormsSupplier.is())
{
uno::Reference<container::XNameContainer> xFormsNamedContainer(xFormsSupplier->getForms());
static constexpr OUStringLiteral sDOCXForm = u"DOCX-Standard";
static constexpr OUString sDOCXForm = u"DOCX-Standard"_ustr;
OUString sFormName(sDOCXForm);
sal_uInt16 nUnique = 0;

View file

@ -71,7 +71,7 @@ OUString lclGetNameForElementId(sal_uInt32 aId)
return aIdMap[aId];
}
constexpr OUStringLiteral constAttributesSequenceName = u"attributes";
constexpr OUString constAttributesSequenceName = u"attributes"_ustr;
}

View file

@ -619,11 +619,11 @@ const char sStylesTypeStrict[] = "http://purl.oclc.org/ooxml/officeDocument/rela
const char sFonttableTypeStrict[] = "http://purl.oclc.org/ooxml/officeDocument/relationships/fontTable";
const char sWebSettingsStrict[] = "http://purl.oclc.org/ooxml/officeDocument/relationships/webSettings";
constexpr OUStringLiteral sId = u"Id";
constexpr OUString sId = u"Id"_ustr;
constexpr OUStringLiteral sType = u"Type";
constexpr OUStringLiteral sTarget = u"Target";
constexpr OUString sTarget = u"Target"_ustr;
constexpr OUStringLiteral sTargetMode = u"TargetMode";
constexpr OUStringLiteral sContentType = u"_contentType";
constexpr OUString sContentType = u"_contentType"_ustr;
constexpr OUStringLiteral sRelDom = u"_relDom";
constexpr OUStringLiteral sSettingsContentType = u"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml";
constexpr OUStringLiteral sStylesContentType = u"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";

View file

@ -136,17 +136,17 @@ bool OOXMLStreamImpl::lcl_getTarget(const uno::Reference<embed::XRelationshipAcc
static constexpr OUStringLiteral sEndnotesType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes";
static constexpr OUStringLiteral sCommentsType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
static constexpr OUStringLiteral sThemeType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
static constexpr OUStringLiteral sCustomType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml";
static constexpr OUString sCustomType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml"_ustr;
static constexpr OUStringLiteral sCustomPropsType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps";
static constexpr OUStringLiteral sGlossaryType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument";
static constexpr OUStringLiteral sWebSettings = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings";
static constexpr OUStringLiteral sSettingsType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings";
static constexpr OUStringLiteral sChartType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart";
static constexpr OUStringLiteral sEmbeddingsType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
static constexpr OUStringLiteral sFooterType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";
static constexpr OUStringLiteral sHeaderType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header";
static constexpr OUString sChartType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"_ustr;
static constexpr OUString sEmbeddingsType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"_ustr;
static constexpr OUString sFooterType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer"_ustr;
static constexpr OUString sHeaderType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header"_ustr;
static constexpr OUStringLiteral sOleObjectType = u"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
static constexpr OUStringLiteral sCommentsExtendedType = u"http://schemas.microsoft.com/office/2011/relationships/commentsExtended";
static constexpr OUString sCommentsExtendedType = u"http://schemas.microsoft.com/office/2011/relationships/commentsExtended"_ustr;
// OOXML strict
static constexpr OUStringLiteral sDocumentTypeStrict = u"http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument";
static constexpr OUStringLiteral sStylesTypeStrict = u"http://purl.oclc.org/ooxml/officeDocument/relationships/styles";
@ -166,8 +166,8 @@ bool OOXMLStreamImpl::lcl_getTarget(const uno::Reference<embed::XRelationshipAcc
static constexpr OUStringLiteral sFootersTypeStrict = u"http://purl.oclc.org/ooxml/officeDocument/relationships/footer";
static constexpr OUStringLiteral sHeaderTypeStrict = u"http://purl.oclc.org/ooxml/officeDocument/relationships/header";
static constexpr OUStringLiteral sOleObjectTypeStrict = u"http://purl.oclc.org/ooxml/officeDocument/relationships/oleObject";
static constexpr OUStringLiteral sVBAProjectType = u"http://schemas.microsoft.com/office/2006/relationships/vbaProject";
static constexpr OUStringLiteral sVBADataType = u"http://schemas.microsoft.com/office/2006/relationships/wordVbaData";
static constexpr OUString sVBAProjectType = u"http://schemas.microsoft.com/office/2006/relationships/vbaProject"_ustr;
static constexpr OUString sVBADataType = u"http://schemas.microsoft.com/office/2006/relationships/wordVbaData"_ustr;
OUString sStreamType;
OUString sStreamTypeStrict;