[Libreoffice-commits] core.git: writerfilter/qa xmloff/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 23 06:34:47 UTC 2020


 writerfilter/qa/cppunittests/dmapper/DomainMapper_Impl.cxx |    2 +-
 xmloff/source/style/xmlstyle.cxx                           |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit ca7d0835008b2333eaebe88030f94b5e072d0eb6
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 22 20:01:28 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Dec 23 07:34:10 2020 +0100

    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 at redhat.com>

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))


More information about the Libreoffice-commits mailing list