diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-22 20:01:28 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-23 07:34:10 +0100 |
commit | ca7d0835008b2333eaebe88030f94b5e072d0eb6 (patch) | |
tree | 0f976a8641349417f478cf89c641b1b78bb6760d | |
parent | bbf65fd839a757b0f446c1cffb7938f82a6a1e67 (diff) |
Fix dubious OUStringLiteral with automatic storage duration
Change-Id: I0c80ce6efbbc950ce975e55663a5643ea8fb37f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108215
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/style/xmlstyle.cxx | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx b/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx index 77bd616f37d6..355b61898cf8 100644 --- a/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx @@ -90,7 +90,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNumberingRestartStyleParent) uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); uno::Reference<beans::XPropertySet> xPara; - OUStringLiteral aProp(u"ListLabelString"); + static OUStringLiteral aProp(u"ListLabelString"); xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("A."), xPara->getPropertyValue(aProp).get<OUString>()); xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index ced74c90aab5..9453e1963729 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -51,6 +51,7 @@ #include <memory> #include <set> +#include <string_view> #include <vector> using namespace ::com::sun::star; @@ -598,7 +599,7 @@ Reference < XAutoStyleFamily > SvXMLStylesContext::GetAutoStyles( XmlStyleFamily xAutoStyles = mxParaAutoStyles; else { - OUStringLiteral sName = bPara ? OUStringLiteral( u"ParagraphStyles" ): OUStringLiteral( u"CharacterStyles" ); + OUString sName(bPara ? std::u16string_view( u"ParagraphStyles" ): std::u16string_view( u"CharacterStyles" )); Reference< XAutoStylesSupplier > xAutoStylesSupp( GetImport().GetModel(), UNO_QUERY ); Reference< XAutoStyles > xAutoStyleFamilies = xAutoStylesSupp->getAutoStyles(); if (xAutoStyleFamilies->hasByName(sName)) |