[Libreoffice-commits] core.git: avmedia/source basctl/source basic/source chart2/source comphelper/source compilerplugins/clang cui/source dbaccess/source desktop/qa desktop/source extensions/source filter/source framework/inc framework/source idlc/source include/rtl include/xmloff oox/source package/source sal/qa sax/qa sax/source sc/source sdext/source sd/inc sd/source sfx2/source solenv/CompilerTest_compilerplugins_clang.mk svgio/inc svgio/source svl/source svx/qa svx/source sw/inc sw/qa sw/source test/source ucb/source vbahelper/source vcl/qa vcl/unx xmloff/source xmlscript/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 13 06:16:53 UTC 2020


 avmedia/source/vlc/vlcframegrabber.cxx                            |    4 
 avmedia/source/vlc/vlcplayer.cxx                                  |    4 
 avmedia/source/vlc/vlcwindow.cxx                                  |    4 
 basctl/source/basicide/basidectrlr.cxx                            |    2 
 basctl/source/basicide/localizationmgr.cxx                        |    6 
 basic/source/sbx/sbxvar.cxx                                       |    2 
 chart2/source/controller/dialogs/DialogModel.cxx                  |    4 
 chart2/source/controller/dialogs/tp_DataSource.cxx                |    4 
 chart2/source/model/main/ChartModel.cxx                           |    4 
 chart2/source/view/main/ChartView.cxx                             |    4 
 comphelper/source/officeinstdir/officeinstallationdirectories.cxx |    4 
 comphelper/source/xml/ofopxmlhelper.cxx                           |   36 ++--
 compilerplugins/clang/stringstatic.cxx                            |   60 +++++---
 compilerplugins/clang/test/stringstatic.cxx                       |   24 +++
 cui/source/options/treeopt.cxx                                    |    2 
 dbaccess/source/ui/dlg/dbfindex.cxx                               |    2 
 desktop/qa/desktop_lib/test_desktop_lib.cxx                       |    6 
 desktop/source/lib/init.cxx                                       |   22 +-
 extensions/source/bibliography/bibmod.cxx                         |   21 +-
 extensions/source/bibliography/bibprop.hxx                        |   20 +-
 extensions/source/bibliography/datman.cxx                         |    6 
 extensions/source/logging/csvformatter.cxx                        |    2 
 filter/source/msfilter/msocximex.cxx                              |    2 
 filter/source/msfilter/msvbahelper.cxx                            |    4 
 framework/inc/jobs/jobconst.hxx                                   |    6 
 framework/source/fwi/jobs/jobconst.cxx                            |    6 
 idlc/source/astdeclaration.cxx                                    |    2 
 include/rtl/string.hxx                                            |   75 +++++++---
 include/xmloff/xmlimp.hxx                                         |    4 
 oox/source/core/xmlfilterbase.cxx                                 |    4 
 oox/source/crypto/Standard2007Engine.cxx                          |    2 
 oox/source/vml/vmlinputstream.cxx                                 |    4 
 oox/source/vml/vmlshapecontext.cxx                                |    2 
 package/source/zippackage/ZipPackage.cxx                          |   10 -
 sal/qa/osl/pipe/osl_Pipe.cxx                                      |    9 -
 sal/qa/rtl/digest/rtl_digest.cxx                                  |   20 +-
 sax/qa/cppunit/xmlimport.cxx                                      |   29 ++-
 sax/source/fastparser/legacyfastparser.cxx                        |    8 -
 sc/source/core/tool/compiler.cxx                                  |    6 
 sc/source/filter/excel/xiescher.cxx                               |    4 
 sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx          |    2 
 sc/source/ui/dbgui/scuiasciiopt.cxx                               |    6 
 sc/source/ui/unoobj/PivotTableDataProvider.cxx                    |    6 
 sc/source/ui/vba/excelvbahelper.cxx                               |    2 
 sc/source/ui/vba/vbaaxis.cxx                                      |    8 -
 sc/source/ui/vba/vbachart.cxx                                     |   32 ++--
 sc/source/ui/vba/vbachartobject.cxx                               |    2 
 sc/source/ui/view/formatsh.cxx                                    |    2 
 sd/inc/strmname.h                                                 |    8 -
 sd/source/ui/dlg/sdabstdlg.cxx                                    |    2 
 sd/source/ui/framework/tools/FrameworkHelper.cxx                  |   26 +--
 sd/source/ui/inc/ToolBarManager.hxx                               |   30 ++--
 sd/source/ui/inc/framework/FrameworkHelper.hxx                    |   26 +--
 sd/source/ui/remotecontrol/ImagePreparer.cxx                      |    4 
 sd/source/ui/view/ToolBarManager.cxx                              |   30 ++--
 sdext/source/presenter/PresenterConfigurationAccess.cxx           |    2 
 sdext/source/presenter/PresenterConfigurationAccess.hxx           |    2 
 sdext/source/presenter/PresenterHelper.cxx                        |   12 -
 sdext/source/presenter/PresenterHelper.hxx                        |   12 -
 sdext/source/presenter/PresenterNotesView.cxx                     |    4 
 sdext/source/presenter/PresenterPaneFactory.cxx                   |   14 -
 sdext/source/presenter/PresenterPaneFactory.hxx                   |   14 -
 sdext/source/presenter/PresenterViewFactory.cxx                   |   12 -
 sdext/source/presenter/PresenterViewFactory.hxx                   |   12 -
 sfx2/source/appl/sfxhelp.cxx                                      |    2 
 sfx2/source/dialog/filedlghelper.cxx                              |   14 -
 sfx2/source/doc/objstor.cxx                                       |    2 
 solenv/CompilerTest_compilerplugins_clang.mk                      |    1 
 svgio/inc/svgtools.hxx                                            |    8 -
 svgio/source/svgreader/svgtools.cxx                               |    8 -
 svl/source/numbers/zforscan.cxx                                   |    2 
 svl/source/numbers/zforscan.hxx                                   |    4 
 svx/qa/unit/classicshapes.cxx                                     |    2 
 svx/qa/unit/customshapes.cxx                                      |    2 
 svx/source/dialog/ClassificationDialog.cxx                        |    2 
 svx/source/form/fmshimp.cxx                                       |    4 
 sw/inc/tox.hxx                                                    |    2 
 sw/qa/core/test_ToxLinkProcessor.cxx                              |   32 ++--
 sw/qa/extras/uiwriter/uiwriter.cxx                                |   12 -
 sw/source/core/edit/edfcol.cxx                                    |   30 ++--
 sw/source/core/tox/tox.cxx                                        |    2 
 sw/source/core/txtnode/thints.cxx                                 |    2 
 sw/source/filter/ww8/docxexport.cxx                               |    2 
 sw/source/ui/misc/bookmark.cxx                                    |    6 
 sw/source/uibase/dialog/swabstdlg.cxx                             |    2 
 sw/source/uibase/inc/bookmark.hxx                                 |    2 
 test/source/sheet/xsheetoutline.cxx                               |   22 +-
 ucb/source/ucp/webdav-neon/DAVProperties.cxx                      |   49 +++---
 ucb/source/ucp/webdav-neon/DAVProperties.hxx                      |   24 +--
 vbahelper/source/msforms/vbamultipage.cxx                         |    2 
 vbahelper/source/msforms/vbaprogressbar.cxx                       |    2 
 vcl/qa/api/XGraphicTest.cxx                                       |    2 
 vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx                  |    2 
 vcl/qa/cppunit/jpeg/JpegReaderTest.cxx                            |    2 
 vcl/qa/cppunit/jpeg/JpegWriterTest.cxx                            |    2 
 vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx          |    2 
 vcl/unx/generic/printer/ppdparser.cxx                             |    2 
 xmloff/source/core/xmlimp.cxx                                     |    4 
 xmlscript/source/xml_helper/xml_impctx.cxx                        |    4 
 99 files changed, 527 insertions(+), 445 deletions(-)

New commits:
commit 3457da6abe0fd03efd19442e9790fbd1aa04c160
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Aug 6 10:55:58 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 13 08:16:03 2020 +0200

    loplugin:stringstatic also look for local statics
    
    Add some API to O*StringLiteral, to make it easier
    to use in some places that were using O*String
    
    Change-Id: I1fb93bd47ac2065c9220d509aad3f4320326d99e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100270
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
index 034de45118d7..34dfe00eb53e 100644
--- a/avmedia/source/vlc/vlcframegrabber.cxx
+++ b/avmedia/source/vlc/vlcframegrabber.cxx
@@ -42,8 +42,8 @@ namespace avmedia::vlc {
 
 namespace
 {
-    const OUString AVMEDIA_VLC_GRABBER_IMPLEMENTATIONNAME = "com.sun.star.comp.avmedia.VLCFrameGrabber_VLC";
-    const OUString AVMEDIA_VLC_GRABBER_SERVICENAME = "com.sun.star.media.VLCFrameGrabber_VLC";
+    const OUStringLiteral AVMEDIA_VLC_GRABBER_IMPLEMENTATIONNAME = "com.sun.star.comp.avmedia.VLCFrameGrabber_VLC";
+    const OUStringLiteral AVMEDIA_VLC_GRABBER_SERVICENAME = "com.sun.star.media.VLCFrameGrabber_VLC";
     const int MSEC_IN_SEC = 1000;
 
     const char * const VLC_ARGS[] = {
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index bd2cc92baeec..c68b6ddd43fb 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -32,8 +32,8 @@ namespace avmedia::vlc {
 
 namespace
 {
-    const OUString AVMEDIA_VLC_PLAYER_IMPLEMENTATIONNAME = "com.sun.star.comp.avmedia.Player_VLC";
-    const OUString AVMEDIA_VLC_PLAYER_SERVICENAME = "com.sun.star.media.Player_VLC";
+    const OUStringLiteral AVMEDIA_VLC_PLAYER_IMPLEMENTATIONNAME = "com.sun.star.comp.avmedia.Player_VLC";
+    const OUStringLiteral AVMEDIA_VLC_PLAYER_SERVICENAME = "com.sun.star.media.Player_VLC";
 
     const int MS_IN_SEC = 1000; // Millisec in sec
 }
diff --git a/avmedia/source/vlc/vlcwindow.cxx b/avmedia/source/vlc/vlcwindow.cxx
index 1cd0e1306a21..b12239c55519 100644
--- a/avmedia/source/vlc/vlcwindow.cxx
+++ b/avmedia/source/vlc/vlcwindow.cxx
@@ -28,8 +28,8 @@ namespace avmedia::vlc {
 
 namespace
 {
-    const OUString AVMEDIA_VLC_WINDOW_IMPLEMENTATIONNAME = "com.sun.star.comp.avmedia.Window_VLC";
-    const OUString AVMEDIA_VLC_WINDOW_SERVICENAME = "com.sun.star.media.Window_VLC";
+    const OUStringLiteral AVMEDIA_VLC_WINDOW_IMPLEMENTATIONNAME = "com.sun.star.comp.avmedia.Window_VLC";
+    const OUStringLiteral AVMEDIA_VLC_WINDOW_SERVICENAME = "com.sun.star.media.Window_VLC";
 }
 
 VLCWindow::VLCWindow( VLCPlayer& player, const intptr_t prevWinID )
diff --git a/basctl/source/basicide/basidectrlr.cxx b/basctl/source/basicide/basidectrlr.cxx
index 1d4a7dc7664a..c17a3bf60932 100644
--- a/basctl/source/basicide/basidectrlr.cxx
+++ b/basctl/source/basicide/basidectrlr.cxx
@@ -32,7 +32,7 @@ namespace
 {
 
 int const nPropertyIconId = 1;
-OUString const sPropertyIconId("IconId");
+OUStringLiteral const sPropertyIconId("IconId");
 
 }
 
diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx
index 5825e59f0b87..4c38dba9e8c8 100644
--- a/basctl/source/basicide/localizationmgr.cxx
+++ b/basctl/source/basicide/localizationmgr.cxx
@@ -47,9 +47,9 @@ using namespace ::com::sun::star::resource;
 namespace
 {
 
-OUString const aDot(".");
-OUString const aEsc("&");
-OUString const aSemi(";");
+OUStringLiteral const aDot(".");
+OUStringLiteral const aEsc("&");
+OUStringLiteral const aSemi(";");
 
 } // namespace
 
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 5f892417825b..571c3cf1a69b 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -218,7 +218,7 @@ void SbxVariable::SetName( const OUString& rName )
 
 const OUString& SbxVariable::GetName( SbxNameType t ) const
 {
-    static const OUString cSuffixes { "  %&!#@ $" };
+    static const char cSuffixes[] = "  %&!#@ $";
     if( t == SbxNameType::NONE )
     {
         return maName;
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index b4bdbae6501e..b8485a8b4c5b 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -54,7 +54,7 @@ using ::com::sun::star::uno::Sequence;
 
 namespace
 {
-const OUString lcl_aLabelRole( "label" );
+const OUStringLiteral lcl_aLabelRole( "label" );
 
 struct lcl_ChartTypeToSeriesCnt
 {
@@ -70,7 +70,7 @@ OUString lcl_ConvertRole( const OUString & rRoleString )
     OUString aResult( rRoleString );
 
     typedef std::map< OUString, OUString > tTranslationMap;
-    static tTranslationMap aTranslationMap =
+    static const tTranslationMap aTranslationMap =
     {
         { "categories", ::chart::SchResId( STR_DATA_ROLE_CATEGORIES ) },
         { "error-bars-x", ::chart::SchResId( STR_DATA_ROLE_X_ERROR ) },
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index b6ebe98d08d8..4ef2c21483b3 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -46,7 +46,7 @@ using ::com::sun::star::uno::Sequence;
 namespace
 {
 
-const OUString lcl_aLabelRole( "label" );
+const OUStringLiteral lcl_aLabelRole( "label" );
 
 void lcl_UpdateCurrentRange(weld::TreeView& rOutListBox, const OUString & rRole,
                             const OUString& rRange)
@@ -840,7 +840,7 @@ bool DataSourceTabPage::updateModelFromControl(const weld::Entry* pField)
                                     // "$Sheet1.$A$1"
                                     aRange = xNewSeq->getSourceRangeRepresentation();
                                     Reference< beans::XPropertySet > xProp( xNewSeq, uno::UNO_QUERY_THROW );
-                                    xProp->setPropertyValue( "Role" , uno::Any( lcl_aLabelRole ));
+                                    xProp->setPropertyValue( "Role" , uno::Any( OUString(lcl_aLabelRole) ));
                                     xLabeledSeq->setLabel( xNewSeq );
                                 }
                             }
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 4f1d055f6a13..520115092833 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -69,9 +69,9 @@ using namespace ::chart::CloneHelper;
 
 namespace
 {
-const OUString lcl_aGDIMetaFileMIMEType(
+const OUStringLiteral lcl_aGDIMetaFileMIMEType(
     "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"");
-const OUString lcl_aGDIMetaFileMIMETypeHighContrast(
+const OUStringLiteral lcl_aGDIMetaFileMIMETypeHighContrast(
     "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"");
 
 } // anonymous namespace
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index a70738adb906..a66bd266634b 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -1108,9 +1108,9 @@ void ChartView::impl_deleteCoordinateSystems()
 // datatransfer::XTransferable
 namespace
 {
-const OUString lcl_aGDIMetaFileMIMEType(
+const OUStringLiteral lcl_aGDIMetaFileMIMEType(
     "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" );
-const OUString lcl_aGDIMetaFileMIMETypeHighContrast(
+const OUStringLiteral lcl_aGDIMetaFileMIMETypeHighContrast(
     "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" );
 } // anonymous namespace
 
diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
index 4090fda37ada..2a8bb326e6ae 100644
--- a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
+++ b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
@@ -75,8 +75,8 @@ static bool makeCanonicalFileURL( OUString & rURL )
 
 namespace comphelper {
 
-OUString const g_aOfficeBrandDirMacro("$(brandbaseurl)");
-OUString const g_aUserDirMacro("$(userdataurl)");
+OUStringLiteral const g_aOfficeBrandDirMacro("$(brandbaseurl)");
+OUStringLiteral const g_aUserDirMacro("$(userdataurl)");
 
 OfficeInstallationDirectories::OfficeInstallationDirectories(
         const uno::Reference< uno::XComponentContext > & xCtx )
diff --git a/comphelper/source/xml/ofopxmlhelper.cxx b/comphelper/source/xml/ofopxmlhelper.cxx
index 8045f9b767b6..325b2c85b147 100644
--- a/comphelper/source/xml/ofopxmlhelper.cxx
+++ b/comphelper/source/xml/ofopxmlhelper.cxx
@@ -196,12 +196,12 @@ void WriteContentSequence(
 
     xWriter->setOutputStream( xOutStream );
 
-    static const OUString aTypesElement("Types");
-    static const OUString aDefaultElement("Default");
-    static const OUString aOverrideElement("Override");
-    static const OUString aContentTypeAttr("ContentType");
-    static const OUString aCDATAString("CDATA");
-    static const OUString aWhiteSpace(" ");
+    static const OUStringLiteral aTypesElement("Types");
+    static const OUStringLiteral aDefaultElement("Default");
+    static const OUStringLiteral aOverrideElement("Override");
+    static const OUStringLiteral aContentTypeAttr("ContentType");
+    static const OUStringLiteral aCDATAString("CDATA");
+    static const OUStringLiteral aWhiteSpace(" ");
 
     // write the namespace
     AttributeList* pRootAttrList = new AttributeList;
@@ -269,20 +269,20 @@ uno::Sequence< uno::Sequence< beans::StringPair > > ReadSequence_Impl(
 } // namespace OFOPXMLHelper
 
 // Relations info related strings
-OUString const g_aRelListElement("Relationships");
-OUString const g_aRelElement( "Relationship" );
-OUString const g_aIDAttr( "Id" );
-OUString const g_aTypeAttr( "Type" );
-OUString const g_aTargetModeAttr( "TargetMode" );
-OUString const g_aTargetAttr( "Target" );
+OUStringLiteral const g_aRelListElement("Relationships");
+OUStringLiteral const g_aRelElement( "Relationship" );
+OUStringLiteral const g_aIDAttr( "Id" );
+OUStringLiteral const g_aTypeAttr( "Type" );
+OUStringLiteral const g_aTargetModeAttr( "TargetMode" );
+OUStringLiteral const g_aTargetAttr( "Target" );
 
 // ContentType related strings
-OUString const g_aTypesElement( "Types" );
-OUString const g_aDefaultElement( "Default" );
-OUString const g_aOverrideElement( "Override" );
-OUString const g_aExtensionAttr( "Extension" );
-OUString const g_aPartNameAttr( "PartName" );
-OUString const g_aContentTypeAttr( "ContentType" );
+OUStringLiteral const g_aTypesElement( "Types" );
+OUStringLiteral const g_aDefaultElement( "Default" );
+OUStringLiteral const g_aOverrideElement( "Override" );
+OUStringLiteral const g_aExtensionAttr( "Extension" );
+OUStringLiteral const g_aPartNameAttr( "PartName" );
+OUStringLiteral const g_aContentTypeAttr( "ContentType" );
 
 OFOPXMLHelper_Impl::OFOPXMLHelper_Impl( sal_uInt16 nFormat )
 : m_nFormat( nFormat )
diff --git a/compilerplugins/clang/stringstatic.cxx b/compilerplugins/clang/stringstatic.cxx
index 69e6c427f90e..282144042f4e 100644
--- a/compilerplugins/clang/stringstatic.cxx
+++ b/compilerplugins/clang/stringstatic.cxx
@@ -9,13 +9,13 @@
 
 #ifndef LO_CLANG_SHARED_PLUGINS
 
-#include <set>
-
 #include "check.hxx"
 #include "compat.hxx"
 #include "plugin.hxx"
 
-/** Look for static OUString and OUString[], they can be more efficiently declared as:
+#include <unordered_set>
+
+/** Look for static O*String and O*String[], they can be more efficiently declared as:
 
         static const OUStringLiteral our_aLBEntryMap[] = {" ", ", "};
         static const OUStringLiteral sName("name");
@@ -37,9 +37,11 @@ public:
     void postRun() override;
     bool VisitVarDecl(VarDecl const*);
     bool VisitReturnStmt(ReturnStmt const*);
+    bool VisitDeclRefExpr(DeclRefExpr const*);
+
 private:
-    std::set<VarDecl const *> potentialVars;
-    std::set<VarDecl const *> excludeVars;
+    std::unordered_set<VarDecl const *> potentialVars;
+    std::unordered_set<VarDecl const *> excludeVars;
 };
 
 void StringStatic::run()
@@ -68,7 +70,7 @@ void StringStatic::postRun()
     }
     for (auto const & varDecl : potentialVars) {
         report(DiagnosticsEngine::Warning,
-                "rather declare this using OUStringLiteral or char[]",
+                "rather declare this using OUStringLiteral/OStringLiteral/char[]",
                 varDecl->getLocation())
             << varDecl->getSourceRange();
     }
@@ -76,22 +78,23 @@ void StringStatic::postRun()
 
 bool StringStatic::VisitVarDecl(VarDecl const* varDecl)
 {
-    if (ignoreLocation(varDecl)) {
+    if (ignoreLocation(varDecl))
         return true;
-    }
     QualType qt = varDecl->getType();
-    if (!varDecl->hasGlobalStorage()
-        || !varDecl->isThisDeclarationADefinition()
-        || !qt.isConstQualified()) {
+    if (!varDecl->hasGlobalStorage() && !varDecl->isStaticLocal())
         return true;
-    }
-    if (qt->isArrayType()) {
+    if (!varDecl->isThisDeclarationADefinition()
+        || !qt.isConstQualified())
+        return true;
+    if (qt->isArrayType())
         qt = qt->getAsArrayTypeUnsafe()->getElementType();
-    }
-    if (!loplugin::TypeCheck(qt).Class("OUString").Namespace("rtl").GlobalNamespace()) {
+
+    auto tc = loplugin::TypeCheck(qt);
+    if (!tc.Class("OUString").Namespace("rtl").GlobalNamespace()
+        && !tc.Class("OString").Namespace("rtl").GlobalNamespace())
         return true;
-    }
-    if (varDecl->hasInit()) {
+    if (varDecl->hasInit())
+    {
         Expr const * expr = varDecl->getInit();
         while (true) {
             if (ExprWithCleanups const * exprWithCleanups = dyn_cast<ExprWithCleanups>(expr)) {
@@ -107,7 +110,7 @@ bool StringStatic::VisitVarDecl(VarDecl const* varDecl)
                 expr = bindExpr->getSubExpr();
             }
             else if (CXXConstructExpr const * constructExpr = dyn_cast<CXXConstructExpr>(expr)) {
-                if (constructExpr->getNumArgs() != 1) {
+                if (constructExpr->getNumArgs() == 0) {
                     return true;
                 }
                 expr = constructExpr->getArg(0);
@@ -142,6 +145,27 @@ bool StringStatic::VisitReturnStmt(ReturnStmt const * returnStmt)
     return true;
 }
 
+bool StringStatic::VisitDeclRefExpr(DeclRefExpr const * declRef)
+{
+    if (ignoreLocation(declRef))
+        return true;
+    VarDecl const * varDecl = dyn_cast<VarDecl>(declRef->getDecl());
+    if (!varDecl)
+        return true;
+    if (potentialVars.count(varDecl) == 0)
+        return true;
+    // ignore globals that are used in CPPUNIT_ASSERT expressions, otherwise we can end up
+    // trying to compare an OUStringLiteral and an OUString, and CPPUNIT can't handle that
+    auto loc = compat::getBeginLoc(declRef);
+    if (compiler.getSourceManager().isMacroArgExpansion(loc))
+    {
+        StringRef name { Lexer::getImmediateMacroName(loc, compiler.getSourceManager(), compiler.getLangOpts()) };
+        if (name.startswith("CPPUNIT_ASSERT"))
+            excludeVars.insert(varDecl);
+    }
+    return true;
+}
+
 loplugin::Plugin::Registration<StringStatic> stringstatic("stringstatic");
 
 } // namespace
diff --git a/compilerplugins/clang/test/stringstatic.cxx b/compilerplugins/clang/test/stringstatic.cxx
new file mode 100644
index 000000000000..73fd38ec629a
--- /dev/null
+++ b/compilerplugins/clang/test/stringstatic.cxx
@@ -0,0 +1,24 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <rtl/string.hxx>
+#include <rtl/ustring.hxx>
+
+// expected-error at +1 {{rather declare this using OUStringLiteral/OStringLiteral/char[] [loplugin:stringstatic]}}
+static const OUString TEST1 = "xxx";
+
+void test2()
+{
+    // expected-error at +1 {{rather declare this using OUStringLiteral/OStringLiteral/char[] [loplugin:stringstatic]}}
+    static const OUString XXX = "xxx";
+    // expected-error at +1 {{rather declare this using OUStringLiteral/OStringLiteral/char[] [loplugin:stringstatic]}}
+    static const OUString XXX2 = "xxx";
+    (void)XXX;
+    (void)XXX2;
+}
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 426e5c0e0a65..b0fb03d27cb5 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -115,7 +115,7 @@ using namespace ::com::sun::star::util;
 LastPageSaver* OfaTreeOptionsDialog::pLastPageSaver = nullptr;
 
 // some stuff for easier changes for SvtViewOptions
-const OUString VIEWOPT_DATANAME = "page data";
+const OUStringLiteral VIEWOPT_DATANAME = "page data";
 
 static void SetViewOptUserItem( SvtViewOptions& rOpt, const OUString& rData )
 {
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx
index 84635980b983..5cd2f85f20c3 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -36,7 +36,7 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::ucb;
 using namespace ::svt;
 
-const OString aGroupIdent("dBase III");
+const OStringLiteral aGroupIdent("dBase III");
 
 
 ODbaseIndexDialog::ODbaseIndexDialog(weld::Window * pParent, const OUString& aDataSrcName)
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 68ce00bdfe84..8a1d1c927c20 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -2739,7 +2739,7 @@ void DesktopLOKTest::testComplexSelection()
 {
     // Start with a blank text file and add contents.
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
-    static const OString aText("hello world");
+    static const OStringLiteral aText("hello world");
 
     // Certainly not complex.
     CPPUNIT_ASSERT_EQUAL(static_cast<int>(LOK_SELTYPE_NONE), pDocument->pClass->getSelectionType(pDocument));
@@ -2764,7 +2764,7 @@ void DesktopLOKTest::testComplexSelection()
     // Export as plain text, we should get only the text part "hello".
     char* pText = pDocument->pClass->getTextSelection(pDocument, "text/plain;charset=utf-8", nullptr);
     CPPUNIT_ASSERT(pText != nullptr);
-    CPPUNIT_ASSERT_EQUAL(aText, OString(pText));
+    CPPUNIT_ASSERT_EQUAL(OString(aText), OString(pText));
     free(pText);
 
     // Export as rtf, we should also get the image.
@@ -2821,7 +2821,7 @@ void DesktopLOKTest::testCalcSaveAs()
 
 void DesktopLOKTest::testSpellcheckerMultiView()
 {
-    static const OUString aLangISO("en-US");
+    static const OUStringLiteral aLangISO("en-US");
     SvtSysLocaleOptions aSysLocaleOptions;
     aSysLocaleOptions.SetLocaleConfigString(aLangISO);
     aSysLocaleOptions.SetUILocaleConfigString(aLangISO);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 51a5e4bf28fe..30116199123c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3699,13 +3699,13 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned long
     if (aMap.find("id") == aMap.end())
         return;
 
-    static const OUString sClickAction("CLICK");
-    static const OUString sSelectAction("SELECT");
-    static const OUString sClearAction("CLEAR");
-    static const OUString sTypeAction("TYPE");
-    static const OUString sUpAction("UP");
-    static const OUString sDownAction("DOWN");
-    static const OUString sValue("VALUE");
+    static const OUStringLiteral sClickAction("CLICK");
+    static const OUStringLiteral sSelectAction("SELECT");
+    static const OUStringLiteral sClearAction("CLEAR");
+    static const OUStringLiteral sTypeAction("TYPE");
+    static const OUStringLiteral sUpAction("UP");
+    static const OUStringLiteral sDownAction("DOWN");
+    static const OUStringLiteral sValue("VALUE");
 
     bool bIsWeldedDialog = false;
 
@@ -4880,10 +4880,10 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
     SetLastExceptionMsg();
 
     OString aCommand(pCommand);
-    static const OString aViewRowColumnHeaders(".uno:ViewRowColumnHeaders");
-    static const OString aSheetGeometryData(".uno:SheetGeometryData");
-    static const OString aCellCursor(".uno:CellCursor");
-    static const OString aFontSubset(".uno:FontSubset&name=");
+    static const OStringLiteral aViewRowColumnHeaders(".uno:ViewRowColumnHeaders");
+    static const OStringLiteral aSheetGeometryData(".uno:SheetGeometryData");
+    static const OStringLiteral aCellCursor(".uno:CellCursor");
+    static const OStringLiteral aFontSubset(".uno:FontSubset&name=");
 
     if (!strcmp(pCommand, ".uno:LanguageStatus"))
     {
diff --git a/extensions/source/bibliography/bibmod.cxx b/extensions/source/bibliography/bibmod.cxx
index 3e2cd829c32e..91db4921f957 100644
--- a/extensions/source/bibliography/bibmod.cxx
+++ b/extensions/source/bibliography/bibmod.cxx
@@ -89,16 +89,15 @@ BibConfig*  BibModul::GetConfig()
 
 
 // PropertyNames
-#define STATIC_USTRING(a,b) const OUString a(b)
-STATIC_USTRING(FM_PROP_LABEL,"Label");
-STATIC_USTRING(FM_PROP_CONTROLSOURCE,"DataField");
-STATIC_USTRING(FM_PROP_NAME,"Name");
-STATIC_USTRING(FM_PROP_FORMATKEY,"FormatKey");
-STATIC_USTRING(FM_PROP_EDITMODE,"RecordMode");
-STATIC_USTRING(FM_PROP_CURSORSOURCETYPE,"DataSelectionType");
-STATIC_USTRING(FM_PROP_CURSORSOURCE,"DataSelection");
-STATIC_USTRING(FM_PROP_DATASOURCE, "DataSource");
-STATIC_USTRING(FM_PROP_VALUE,"Value");
-STATIC_USTRING(FM_PROP_TEXT,"Text");
+const OUStringLiteral FM_PROP_LABEL = "Label";
+const OUStringLiteral FM_PROP_CONTROLSOURCE = "DataField";
+const OUStringLiteral FM_PROP_NAME = "Name";
+const OUStringLiteral FM_PROP_FORMATKEY = "FormatKey";
+const OUStringLiteral FM_PROP_EDITMODE = "RecordMode";
+const OUStringLiteral FM_PROP_CURSORSOURCETYPE = "DataSelectionType";
+const OUStringLiteral FM_PROP_CURSORSOURCE = "DataSelection";
+const OUStringLiteral FM_PROP_DATASOURCE = "DataSource";
+const OUStringLiteral FM_PROP_VALUE = "Value";
+const OUStringLiteral FM_PROP_TEXT = "Text";
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/bibliography/bibprop.hxx b/extensions/source/bibliography/bibprop.hxx
index 85ba484d6ac9..327ae8ddc7f2 100644
--- a/extensions/source/bibliography/bibprop.hxx
+++ b/extensions/source/bibliography/bibprop.hxx
@@ -21,16 +21,16 @@
 
 #include <rtl/ustring.hxx>
 
-extern const OUString FM_PROP_LABEL;
-extern const OUString FM_PROP_NAME;
-extern const OUString FM_PROP_CONTROLSOURCE;
-extern const OUString FM_PROP_FORMATKEY;
-extern const OUString FM_PROP_VALUE;
-extern const OUString FM_PROP_EDITMODE;
-extern const OUString FM_PROP_DATASOURCE;
-extern const OUString FM_PROP_CURSORSOURCE;
-extern const OUString FM_PROP_CURSORSOURCETYPE;
-extern const OUString FM_PROP_TEXT;
+extern const OUStringLiteral FM_PROP_LABEL;
+extern const OUStringLiteral FM_PROP_NAME;
+extern const OUStringLiteral FM_PROP_CONTROLSOURCE;
+extern const OUStringLiteral FM_PROP_FORMATKEY;
+extern const OUStringLiteral FM_PROP_VALUE;
+extern const OUStringLiteral FM_PROP_EDITMODE;
+extern const OUStringLiteral FM_PROP_DATASOURCE;
+extern const OUStringLiteral FM_PROP_CURSORSOURCE;
+extern const OUStringLiteral FM_PROP_CURSORSOURCETYPE;
+extern const OUStringLiteral FM_PROP_TEXT;
 
 #endif
 
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index 99aeabe4de7d..c5115703dbf9 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -520,11 +520,7 @@ void SAL_CALL BibInterceptorHelper::setMasterDispatchProvider( const css::uno::R
 }
 
 
-OUString const gGridName("theGrid");
-OUString const gViewName("theView");
-OUString const gGlobalName("theGlobals");
-OUString const gBeamerSize("theBeamerSize");
-OUString const gViewSize("theViewSize");
+OUStringLiteral const gGridName("theGrid");
 
 BibDataManager::BibDataManager()
     :BibDataManager_Base( GetMutex() )
diff --git a/extensions/source/logging/csvformatter.cxx b/extensions/source/logging/csvformatter.cxx
index 9ab747ad504d..0805d68b43fe 100644
--- a/extensions/source/logging/csvformatter.cxx
+++ b/extensions/source/logging/csvformatter.cxx
@@ -88,7 +88,7 @@ namespace
 {
     const sal_Unicode quote_char = '"';
     const sal_Unicode comma_char = ',';
-    const OUString dos_newline = "\r\n";
+    const OUStringLiteral dos_newline = "\r\n";
 
     bool needsQuoting(const OUString& str)
     {
diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx
index fbe3282d6788..f353b4830307 100644
--- a/filter/source/msfilter/msocximex.cxx
+++ b/filter/source/msfilter/msocximex.cxx
@@ -31,7 +31,7 @@
 
 using namespace ::com::sun::star;
 
-OUString const sWW8_form( "WW-Standard" );
+OUStringLiteral const sWW8_form( "WW-Standard" );
 
 SvxMSConvertOCXControls::SvxMSConvertOCXControls( const uno::Reference< frame::XModel >& rxModel) : mxModel(rxModel)
 {
diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx
index 0a3b27204299..3f03c7f6ed53 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -48,8 +48,8 @@ using namespace ::com::sun::star;
 
 namespace ooo::vba {
 
-const OUString sUrlPart0( "vnd.sun.star.script:" );
-const OUString sUrlPart1( "?language=Basic&location=document" );
+const OUStringLiteral sUrlPart0( "vnd.sun.star.script:" );
+const OUStringLiteral sUrlPart1( "?language=Basic&location=document" );
 
 OUString makeMacroURL( const OUString& sMacroName )
 {
diff --git a/framework/inc/jobs/jobconst.hxx b/framework/inc/jobs/jobconst.hxx
index 0c2705011a5b..1420f80eef07 100644
--- a/framework/inc/jobs/jobconst.hxx
+++ b/framework/inc/jobs/jobconst.hxx
@@ -35,9 +35,9 @@ namespace framework{
 class JobConst
 {
     public:
-        static const OUString ANSWER_DEACTIVATE_JOB;
-        static const OUString ANSWER_SAVE_ARGUMENTS;
-        static const OUString ANSWER_SEND_DISPATCHRESULT;
+        static const OUStringLiteral ANSWER_DEACTIVATE_JOB;
+        static const OUStringLiteral ANSWER_SAVE_ARGUMENTS;
+        static const OUStringLiteral ANSWER_SEND_DISPATCHRESULT;
 };
 
 } // namespace framework
diff --git a/framework/source/fwi/jobs/jobconst.cxx b/framework/source/fwi/jobs/jobconst.cxx
index d19c6db66910..9a2858de6a84 100644
--- a/framework/source/fwi/jobs/jobconst.cxx
+++ b/framework/source/fwi/jobs/jobconst.cxx
@@ -21,11 +21,11 @@
 
 namespace framework {
 
-const OUString JobConst::ANSWER_DEACTIVATE_JOB = "Deactivate";
+const OUStringLiteral JobConst::ANSWER_DEACTIVATE_JOB = "Deactivate";
 
-const OUString JobConst::ANSWER_SAVE_ARGUMENTS = "SaveArguments";
+const OUStringLiteral JobConst::ANSWER_SAVE_ARGUMENTS = "SaveArguments";
 
-const OUString JobConst::ANSWER_SEND_DISPATCHRESULT = "SendDispatchResult";
+const OUStringLiteral JobConst::ANSWER_SEND_DISPATCHRESULT = "SendDispatchResult";
 
 } // namespace framework
 
diff --git a/idlc/source/astdeclaration.cxx b/idlc/source/astdeclaration.cxx
index dfc70c12b81b..e3c5dff52682 100644
--- a/idlc/source/astdeclaration.cxx
+++ b/idlc/source/astdeclaration.cxx
@@ -22,7 +22,7 @@
 #include <rtl/strbuf.hxx>
 #include <osl/diagnose.h>
 
-const OString sGlobal("::");
+const OStringLiteral sGlobal("::");
 
 static OString convertName(const OString& name)
 {
diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx
index 809b0a11bcd5..35eccfc073c3 100644
--- a/include/rtl/string.hxx
+++ b/include/rtl/string.hxx
@@ -68,6 +68,39 @@ namespace rtl
 #endif
 /// @endcond
 
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
+/**
+A simple wrapper around string literal. It is usually not necessary to use, can
+be mostly used to force OString operator+ working with operands that otherwise would
+not trigger it.
+
+This class is not part of public API and is meant to be used only in LibreOffice code.
+ at since LibreOffice 4.0
+*/
+struct SAL_WARN_UNUSED OStringLiteral
+{
+    template< int N >
+    explicit OStringLiteral( const char (&str)[ N ] ) : size( N - 1 ), data( str ) { assert( strlen( str ) == N - 1 ); }
+#if defined __cpp_char8_t
+    template< int N >
+    explicit OStringLiteral( const char8_t (&str)[ N ] ) : size( N - 1 ), data( reinterpret_cast<char const *>(str) ) { assert( strlen( data ) == N - 1 ); }
+#endif
+
+    int size;
+    const char* data;
+
+    /** So we can use this in some places interchangeably with OUString.
+     * @since LibreOffice 7.1
+     */
+    constexpr sal_Int32 getLength() const { return size; }
+
+    /** So we can use this in some places interchangeably with OString.
+     * @since LibreOffice 7.1
+     */
+    constexpr const char* getStr() const { return data; }
+};
+#endif
+
 /* ======================================================================= */
 
 /**
@@ -236,6 +269,29 @@ public:
         rtl_string_newFromStr_WithLength( &pData, value, length );
     }
 
+#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
+    /// @cond INTERNAL
+    /**
+      New string from an 8-Bit string literal.
+
+      This constructor is similar to the "direct template" one, but can be
+      useful in cases where the latter does not work, like in
+
+        OString(flag ? "a" : "bb")
+
+      written as
+
+        OString(flag ? OStringLiteral("a") : OStringLiteral("bb"))
+
+      @since LibreOffice 7.1
+    */
+    OString(OStringLiteral literal): pData(NULL) {
+        rtl_string_newFromLiteral(&pData, literal.data, literal.size, 0);
+    }
+    /// @endcond
+#endif
+
+
     /**
       New string from a Unicode character buffer array.
 
@@ -1849,25 +1905,6 @@ public:
 /* ======================================================================= */
 
 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
-/**
-A simple wrapper around string literal. It is usually not necessary to use, can
-be mostly used to force OString operator+ working with operands that otherwise would
-not trigger it.
-
-This class is not part of public API and is meant to be used only in LibreOffice code.
- at since LibreOffice 4.0
-*/
-struct SAL_WARN_UNUSED OStringLiteral
-{
-    template< int N >
-    explicit OStringLiteral( const char (&str)[ N ] ) : size( N - 1 ), data( str ) { assert( strlen( str ) == N - 1 ); }
-#if defined __cpp_char8_t
-    template< int N >
-    explicit OStringLiteral( const char8_t (&str)[ N ] ) : size( N - 1 ), data( reinterpret_cast<char const *>(str) ) { assert( strlen( data ) == N - 1 ); }
-#endif
-    int size;
-    const char* data;
-};
 
 /**
  @internal
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
index 3742c7b79acf..3b4cc7969be9 100644
--- a/include/xmloff/xmlimp.hxx
+++ b/include/xmloff/xmlimp.hxx
@@ -534,8 +534,8 @@ public:
     **/
     bool getBuildIds( sal_Int32& rUPD, sal_Int32& rBuild ) const;
 
-    static const OUString aDefaultNamespace;
-    static const OUString aNamespaceSeparator;
+    static const OUStringLiteral aDefaultNamespace;
+    static const OUStringLiteral aNamespaceSeparator;
 
     static const sal_uInt16 OOo_1x = 10;
     static const sal_uInt16 OOo_2x = 20;
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index b3aec333967e..467758091ae7 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -247,7 +247,7 @@ void XmlFilterBase::putPropertiesToDocumentGrabBag(const css::uno::Reference<css
         {
             uno::Reference<beans::XPropertySetInfo> xPropsInfo = xDocProps->getPropertySetInfo();
 
-            static const OUString aGrabBagPropName = "InteropGrabBag";
+            static const OUStringLiteral aGrabBagPropName = "InteropGrabBag";
             if (xPropsInfo.is() && xPropsInfo->hasPropertyByName(aGrabBagPropName))
             {
                 // get existing grab bag
@@ -1033,7 +1033,7 @@ void XmlFilterBase::exportCustomFragments()
     uno::Reference<beans::XPropertySet> xPropSet(xModel, uno::UNO_QUERY_THROW);
 
     uno::Reference<beans::XPropertySetInfo> xPropSetInfo = xPropSet->getPropertySetInfo();
-    static const OUString aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
+    static const OUStringLiteral aName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG;
     if (!xPropSetInfo->hasPropertyByName(aName))
         return;
 
diff --git a/oox/source/crypto/Standard2007Engine.cxx b/oox/source/crypto/Standard2007Engine.cxx
index 0a367874d2c4..cf8796e119d6 100644
--- a/oox/source/crypto/Standard2007Engine.cxx
+++ b/oox/source/crypto/Standard2007Engine.cxx
@@ -32,7 +32,7 @@ void lclRandomGenerateValues(sal_uInt8* aArray, sal_uInt32 aSize)
     rtl_random_destroyPool(aRandomPool);
 }
 
-const OUString lclCspName = "Microsoft Enhanced RSA and AES Cryptographic Provider";
+const OUStringLiteral lclCspName = "Microsoft Enhanced RSA and AES Cryptographic Provider";
 constexpr const sal_uInt32 AES128Size = 16;
 
 } // end anonymous namespace
diff --git a/oox/source/vml/vmlinputstream.cxx b/oox/source/vml/vmlinputstream.cxx
index 5bc5b92db95b..72bceb6e4016 100644
--- a/oox/source/vml/vmlinputstream.cxx
+++ b/oox/source/vml/vmlinputstream.cxx
@@ -263,8 +263,8 @@ bool lclProcessCharacters( OStringBuffer& rBuffer, const OString& rChars )
 
 } // namespace
 
-const OString gaOpeningCData( "<![CDATA[" );
-const OString gaClosingCData( "]]>" );
+const OStringLiteral gaOpeningCData( "<![CDATA[" );
+const OStringLiteral gaClosingCData( "]]>" );
 
 InputStream::InputStream( const Reference< XComponentContext >& rxContext, const Reference< XInputStream >& rxInStrm ) :
     // use single-byte ISO-8859-1 encoding which maps all byte characters to the first 256 Unicode characters
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index 178d7c21f26a..f9ce59b8e431 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -290,7 +290,7 @@ ShapeTypeContext::ShapeTypeContext(ContextHandler2Helper const & rParent,
     {
         mrTypeModel.maShapeName = rAttribs.getXString( XML_id, OUString() );
         // get ShapeType and ShapeId from name for compatibility
-        static const OUString sShapeTypePrefix = "shapetype_";
+        static const OUStringLiteral sShapeTypePrefix = "shapetype_";
         if( mrTypeModel.maShapeName.startsWith( sShapeTypePrefix ) )
         {
             mrTypeModel.maShapeId = mrTypeModel.maShapeName;
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 4e113e91d3bb..08de1692a3a7 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1225,7 +1225,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile()
             // Remove the old manifest.xml file as the
             // manifest will be re-generated and the
             // META-INF directory implicitly created if does not exist
-            static const OUString sMeta ("META-INF");
+            static const OUStringLiteral sMeta ("META-INF");
 
             if ( m_xRootFolder->hasByName( sMeta ) )
             {
@@ -1247,7 +1247,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile()
             // Remove the old [Content_Types].xml file as the
             // file will be re-generated
 
-            static const OUString aContentTypes("[Content_Types].xml");
+            static const OUStringLiteral aContentTypes("[Content_Types].xml");
 
             if ( m_xRootFolder->hasByName( aContentTypes ) )
                 m_xRootFolder->removeByName( aContentTypes );
@@ -1256,9 +1256,9 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile()
         // Create a vector to store data for the manifest.xml file
         vector < uno::Sequence < PropertyValue > > aManList;
 
-        static const OUString sMediaType("MediaType");
-        static const OUString sVersion("Version");
-        static const OUString sFullPath("FullPath");
+        static const OUStringLiteral sMediaType("MediaType");
+        static const OUStringLiteral sVersion("Version");
+        static const OUStringLiteral sFullPath("FullPath");
         const bool bIsGpgEncrypt = m_aGpgProps.hasElements();
 
         if ( m_nFormat == embed::StorageFormats::PACKAGE )
diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx
index 0237fa57a411..bf55bc1e975b 100644
--- a/sal/qa/osl/pipe/osl_Pipe.cxx
+++ b/sal/qa/osl/pipe/osl_Pipe.cxx
@@ -87,12 +87,11 @@ static void printPipeError( ::osl::Pipe const & aPipe )
 
 // pipe name and transfer contents
 
-const OUString aTestPipeName("testpipe2");
-const OUString aTestPipe1("testpipe1");
-const OUString aTestString("Sun Microsystems");
+const OUStringLiteral aTestPipeName("testpipe2");
+const OUStringLiteral aTestPipe1("testpipe1");
 
-const OString m_pTestString1("Sun Microsystems");
-const OString m_pTestString2("test pipe PASS/OK");
+const OStringLiteral m_pTestString1("Sun Microsystems");
+const OStringLiteral m_pTestString2("test pipe PASS/OK");
 
 // test code start here
 
diff --git a/sal/qa/rtl/digest/rtl_digest.cxx b/sal/qa/rtl/digest/rtl_digest.cxx
index 6bc9070be05c..e2392eaadcc8 100644
--- a/sal/qa/rtl/digest/rtl_digest.cxx
+++ b/sal/qa/rtl/digest/rtl_digest.cxx
@@ -38,8 +38,8 @@ using namespace rtl;
 namespace
 {
 
-const OString sSampleString               = "This is a sample sentence, which we use to check some crypto functions in sal.";
-const OString sSampleString_only_one_diff = "This is a sample sentence. which we use to check some crypto functions in sal.";
+const OStringLiteral sSampleString               ("This is a sample sentence, which we use to check some crypto functions in sal.");
+const OStringLiteral sSampleString_only_one_diff ("This is a sample sentence. which we use to check some crypto functions in sal.");
 
 const rtlDigestAlgorithm constDigestAlgorithms[] =
 {
@@ -61,14 +61,14 @@ const sal_uInt32 constDigestAlgorithmLengths[] =
     RTL_DIGEST_LENGTH_HMAC_SHA1,
 };
 
-const OString constSampleStringSums[] =
+const OStringLiteral constSampleStringSums[] =
 {
-    "647ee6c9d4aa5fdd374ed9d7a156acbf",
-    "b16b903e6fc0b62ae389013ed93fe531",
-    "eab2814429b2613301c8a077b806af3680548914",
-    "2bc5bdb7506a2cdc2fd27fc8b9889343012d5008",
-    "0b1b0e1a6f2e4420326354b031063605",
-    "1998c6a556915be76451bfb587fa7c34d849936e"
+    OStringLiteral("647ee6c9d4aa5fdd374ed9d7a156acbf"),
+    OStringLiteral("b16b903e6fc0b62ae389013ed93fe531"),
+    OStringLiteral("eab2814429b2613301c8a077b806af3680548914"),
+    OStringLiteral("2bc5bdb7506a2cdc2fd27fc8b9889343012d5008"),
+    OStringLiteral("0b1b0e1a6f2e4420326354b031063605"),
+    OStringLiteral("1998c6a556915be76451bfb587fa7c34d849936e")
 };
 
 // Create hex-value string from the digest value to keep the string size minimal
@@ -220,7 +220,7 @@ public:
         for (size_t i = 0; i < SAL_N_ELEMENTS(constDigestAlgorithms); i++)
         {
             OString aSum = getDigest(sSampleString, constDigestAlgorithms[i]);
-            CPPUNIT_ASSERT_EQUAL_MESSAGE("Checksum of sample string is wrong.", constSampleStringSums[i], aSum);
+            CPPUNIT_ASSERT_EQUAL_MESSAGE("Checksum of sample string is wrong.", OString(constSampleStringSums[i]), aSum);
         }
     }
 
diff --git a/sax/qa/cppunit/xmlimport.cxx b/sax/qa/cppunit/xmlimport.cxx
index 449c9ef3b38c..076caefd8740 100644
--- a/sax/qa/cppunit/xmlimport.cxx
+++ b/sax/qa/cppunit/xmlimport.cxx
@@ -254,9 +254,9 @@ void SAL_CALL NSDocumentHandler::startElement( const OUString& aName, const Refe
 class DummyTokenHandler : public sax_fastparser::FastTokenHandlerBase
 {
 public:
-    const static OString tokens[];
+    const static OStringLiteral tokens[];
     const static OUStringLiteral namespaceURIs[];
-    const static OString namespacePrefixes[];
+    const static OStringLiteral namespacePrefixes[];
 
     // XFastTokenHandler
     virtual Sequence< sal_Int8 > SAL_CALL getUTF8Identifier( sal_Int32 nToken ) override;
@@ -265,15 +265,22 @@ public:
     virtual sal_Int32 getTokenDirect( const char *pToken, sal_Int32 nLength ) const override;
 };
 
-const OString DummyTokenHandler::tokens[] = { "Signature", "CanonicalizationMethod", "Algorithm", "Type",
-                                              "DigestMethod", "Reference", "document",
-                                              "spacing", "Player", "Height" };
-
-const OUStringLiteral DummyTokenHandler::namespaceURIs[] = { "http://www.w3.org/2000/09/xmldsig#",
-                                                  "http://schemas.openxmlformats.org/wordprocessingml/2006/main/",
-                                                  "xyzsports.com/players/football/" };
-
-const OString DummyTokenHandler::namespacePrefixes[] = { "", "w", "Player" };
+const OStringLiteral DummyTokenHandler::tokens[] = {
+    OStringLiteral("Signature"), OStringLiteral("CanonicalizationMethod"),
+    OStringLiteral("Algorithm"), OStringLiteral("Type"),
+    OStringLiteral("DigestMethod"), OStringLiteral("Reference"),
+    OStringLiteral("document"), OStringLiteral("spacing"),
+    OStringLiteral("Player"), OStringLiteral("Height") };
+
+const OUStringLiteral DummyTokenHandler::namespaceURIs[] = {
+    "http://www.w3.org/2000/09/xmldsig#",
+    "http://schemas.openxmlformats.org/wordprocessingml/2006/main/",
+    "xyzsports.com/players/football/" };
+
+const OStringLiteral DummyTokenHandler::namespacePrefixes[] = {
+    OStringLiteral(""),
+    OStringLiteral("w"),
+    OStringLiteral("Player") };
 
 Sequence< sal_Int8 > DummyTokenHandler::getUTF8Identifier( sal_Int32 nToken )
 {
diff --git a/sax/source/fastparser/legacyfastparser.cxx b/sax/source/fastparser/legacyfastparser.cxx
index bb1045970e73..8f57d04a1034 100644
--- a/sax/source/fastparser/legacyfastparser.cxx
+++ b/sax/source/fastparser/legacyfastparser.cxx
@@ -131,8 +131,8 @@ private:
     OUString getNamespacePrefixFromToken( sal_Int32 nToken );
     OUString getNameFromToken( sal_Int32 nToken );
 
-    static const OUString aDefaultNamespace;
-    static const OUString aNamespaceSeparator;
+    static const OUStringLiteral aDefaultNamespace;
+    static const OUStringLiteral aNamespaceSeparator;
 
 public:
     CallbackDocumentHandler( Reference< XDocumentHandler > const & xDocumentHandler,
@@ -156,8 +156,8 @@ public:
 
 };
 
-const OUString CallbackDocumentHandler::aDefaultNamespace = OUString("");
-const OUString CallbackDocumentHandler::aNamespaceSeparator = OUString(":");
+const OUStringLiteral CallbackDocumentHandler::aDefaultNamespace = "";
+const OUStringLiteral CallbackDocumentHandler::aNamespaceSeparator = ":";
 
 OUString CallbackDocumentHandler::getNamespacePrefixFromToken( sal_Int32 nToken )
 {
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 4eb3012b04ad..7a79eb75131c 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -727,7 +727,7 @@ struct Convention_A1 : public ScCompiler::Convention
             KParseTokens::ASC_UNDERSCORE | KParseTokens::ASC_DOLLAR;
         constexpr sal_Int32 nContFlags = nStartFlags | KParseTokens::ASC_DOT;
         // '?' allowed in range names because of Xcl :-/
-        static const OUString aAddAllowed("?#");
+        static const OUStringLiteral aAddAllowed("?#");
         return pCharClass->parseAnyToken( rFormula,
                 nSrcPos, nStartFlags, aAddAllowed,
                 (bGroupSeparator ? nContFlags | KParseTokens::GROUP_SEPARATOR_IN_NUMBER : nContFlags),
@@ -1358,7 +1358,7 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL
             KParseTokens::ASC_UNDERSCORE | KParseTokens::ASC_DOLLAR;
         constexpr sal_Int32 nContFlags = nStartFlags | KParseTokens::ASC_DOT;
         // '?' allowed in range names
-        static const OUString aAddAllowed("?!");
+        static const OUStringLiteral aAddAllowed("?!");
         return pCharClass->parseAnyToken( rFormula,
                 nSrcPos, nStartFlags, aAddAllowed,
                 (bGroupSeparator ? nContFlags | KParseTokens::GROUP_SEPARATOR_IN_NUMBER : nContFlags),
@@ -1681,7 +1681,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL
             KParseTokens::ASC_UNDERSCORE ;
         constexpr sal_Int32 nContFlags = nStartFlags | KParseTokens::ASC_DOT;
         // '?' allowed in range names
-        static const OUString aAddAllowed("?-[]!");
+        static const OUStringLiteral aAddAllowed("?-[]!");
 
         return pCharClass->parseAnyToken( rFormula,
                 nSrcPos, nStartFlags, aAddAllowed,
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index b3e1c10ac424..70f30c693bb3 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -468,7 +468,7 @@ SdrObjectUniquePtr XclImpDrawObjBase::CreateSdrObject( XclImpDffConverter& rDffC
             {
                 const Reference< XControlModel >& xCtrlModel = pSdrUnoObj->GetUnoControlModel();
                 Reference< XPropertySet > xPropSet(xCtrlModel,UNO_QUERY);
-                const static OUString sPropertyName("ControlTypeinMSO");
+                const static OUStringLiteral sPropertyName("ControlTypeinMSO");
 
                 enum { eCreateFromOffice = 0, eCreateFromMSTBXControl, eCreateFromMSOCXControl };
 
@@ -488,7 +488,7 @@ SdrObjectUniquePtr XclImpDrawObjBase::CreateSdrObject( XclImpDffConverter& rDffC
                 if( mnObjType == 8 )//OCX
                 {
                     //Need summary type for export
-                    const static OUString sObjIdPropertyName("ObjIDinMSO");
+                    const static OUStringLiteral sObjIdPropertyName("ObjIDinMSO");
                     const XclImpPictureObj* const pObj = dynamic_cast< const XclImpPictureObj* const >(this);
                     if( pObj != nullptr && pObj->IsOcxControl() )
                     {
diff --git a/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx b/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx
index 70116e059077..b7093cc39ff1 100644
--- a/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx
@@ -219,7 +219,7 @@ void ScFourierAnalysisDialog::getDataLabel(OUString& rLabel)
 
 void ScFourierAnalysisDialog::genFormula(OUString& rFormula)
 {
-    static const OUString aSep(";");
+    static const OUStringLiteral aSep(";");
 
     if (!mbPolar)
     {
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index a270332ddf2c..9665ac78c642 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -77,9 +77,9 @@ const ::std::vector<OUString> CSVImportOptionNames =
     "Language",
     "SkipEmptyCells"
 };
-const OUString aSep_Path =           "Office.Calc/Dialogs/CSVImport";
-const OUString aSep_Path_Clpbrd =    "Office.Calc/Dialogs/ClipboardTextImport";
-const OUString aSep_Path_Text2Col =  "Office.Calc/Dialogs/TextToColumnsImport";
+const OUStringLiteral aSep_Path =           "Office.Calc/Dialogs/CSVImport";
+const OUStringLiteral aSep_Path_Clpbrd =    "Office.Calc/Dialogs/ClipboardTextImport";
+const OUStringLiteral aSep_Path_Text2Col =  "Office.Calc/Dialogs/TextToColumnsImport";
 
 namespace {
 CSVImportOptionsIndex getSkipEmptyCellsIndex( ScImportAsciiCall eCall )
diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
index dafac1918735..c8b98bde29da 100644
--- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
@@ -55,9 +55,9 @@ namespace sc
 {
 namespace
 {
-const OUString constIdCategories("categories");
-const OUString constIdLabel("label");
-const OUString constIdData("data");
+const OUStringLiteral constIdCategories("categories");
+const OUStringLiteral constIdLabel("label");
+const OUStringLiteral constIdData("data");
 
 const SfxItemPropertyMapEntry* lcl_GetDataProviderPropertyMap()
 {
diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx
index db12c6bab9ca..aa2c16378700 100644
--- a/sc/source/ui/vba/excelvbahelper.cxx
+++ b/sc/source/ui/vba/excelvbahelper.cxx
@@ -106,8 +106,6 @@ void implSetZoom( const uno::Reference< frame::XModel >& xModel, sal_Int16 nZoom
     pViewSh->RefreshZoom();
 }
 
-const OUString REPLACE_CELLS_WARNING( "ReplaceCellsWarning");
-
 namespace {
 
 class PasteCellsWarningReseter
diff --git a/sc/source/ui/vba/vbaaxis.cxx b/sc/source/ui/vba/vbaaxis.cxx
index f50b04a57e7e..876b6bff0111 100644
--- a/sc/source/ui/vba/vbaaxis.cxx
+++ b/sc/source/ui/vba/vbaaxis.cxx
@@ -29,10 +29,10 @@ using namespace ::ooo::vba::excel::XlAxisCrosses;
 using namespace ::ooo::vba::excel::XlAxisType;
 using namespace ::ooo::vba::excel::XlScaleType;
 
-const OUString ORIGIN("Origin");
-const OUString AUTOORIGIN("AutoOrigin");
-const OUString VBA_MIN("Max");
-const OUString VBA_MAX("Min");
+const OUStringLiteral ORIGIN("Origin");
+const OUStringLiteral AUTOORIGIN("AutoOrigin");
+const OUStringLiteral VBA_MIN("Max");
+const OUStringLiteral VBA_MAX("Min");
 ScVbaChart*
 ScVbaAxis::getChartPtr()
 {
diff --git a/sc/source/ui/vba/vbachart.cxx b/sc/source/ui/vba/vbachart.cxx
index d83cee30b002..cd96b0a9312f 100644
--- a/sc/source/ui/vba/vbachart.cxx
+++ b/sc/source/ui/vba/vbachart.cxx
@@ -48,23 +48,23 @@ using namespace ::ooo::vba::excel::XlRowCol;
 using namespace ::ooo::vba::excel::XlAxisType;
 using namespace ::ooo::vba::excel::XlAxisGroup;
 
-const OUString CHART_NAME("Name");
+const OUStringLiteral CHART_NAME("Name");
 // #TODO move this constant to vbaseries.[ch]xx ( when it exists )
-const OUString DEFAULTSERIESPREFIX("Series");
-const OUString DATAROWSOURCE("DataRowSource");
-const OUString UPDOWN("UpDown");
-const OUString VOLUME("Volume");
-const OUString LINES("Lines");
-const OUString SPLINETYPE("SplineType");
-const OUString SYMBOLTYPE("SymbolType");
-const OUString DEEP("Deep");
-const OUString SOLIDTYPE("SolidType");
-const OUString VERTICAL("Vertical");
-const OUString PERCENT("Percent");
-const OUString STACKED("Stacked");
-const OUString DIM3D("Dim3D");
-const OUString HASMAINTITLE("HasMainTitle");
-const OUString HASLEGEND("HasLegend");
+const OUStringLiteral DEFAULTSERIESPREFIX("Series");
+const OUStringLiteral DATAROWSOURCE("DataRowSource");
+const OUStringLiteral UPDOWN("UpDown");
+const OUStringLiteral VOLUME("Volume");
+const OUStringLiteral LINES("Lines");
+const OUStringLiteral SPLINETYPE("SplineType");
+const OUStringLiteral SYMBOLTYPE("SymbolType");
+const OUStringLiteral DEEP("Deep");
+const OUStringLiteral SOLIDTYPE("SolidType");
+const OUStringLiteral VERTICAL("Vertical");
+const OUStringLiteral PERCENT("Percent");
+const OUStringLiteral STACKED("Stacked");
+const OUStringLiteral DIM3D("Dim3D");
+const OUStringLiteral HASMAINTITLE("HasMainTitle");
+const OUStringLiteral HASLEGEND("HasLegend");
 
 ScVbaChart::ScVbaChart( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::lang::XComponent >& _xChartComponent, const css::uno::Reference< css::table::XTableChart >& _xTableChart ) : ChartImpl_BASE( _xParent, _xContext ), mxTableChart( _xTableChart )
 {
diff --git a/sc/source/ui/vba/vbachartobject.cxx b/sc/source/ui/vba/vbachartobject.cxx
index 424143b27e07..e64df679560a 100644
--- a/sc/source/ui/vba/vbachartobject.cxx
+++ b/sc/source/ui/vba/vbachartobject.cxx
@@ -29,7 +29,7 @@
 using namespace ::com::sun::star;
 using namespace ::ooo::vba;
 
-const OUString PERSIST_NAME("PersistName");
+const OUStringLiteral PERSIST_NAME("PersistName");
 
 ScVbaChartObject::ScVbaChartObject( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::table::XTableChart >& _xTableChart, const css::uno::Reference< css::drawing::XDrawPageSupplier >& _xDrawPageSupplier ) : ChartObjectImpl_BASE( _xParent, _xContext ), xTableChart( _xTableChart ), xDrawPageSupplier( _xDrawPageSupplier )
 {
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 5f4f407d2485..5303666e91be 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2575,7 +2575,7 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet )
                             bThousand = nIntegerDigits > 0 && ((nIntegerDigits % 3) == 0);
                         }
                         OUString aFormat;
-                        static const OUString sBreak = ",";
+                        static const OUStringLiteral sBreak = ",";
                         const OUString sThousand = OUString::number(static_cast<sal_Int32>(bThousand));
                         const OUString sNegRed = OUString::number(static_cast<sal_Int32>(bNegRed));
                         const OUString sPrecision = OUString::number(nPrecision);
diff --git a/sd/inc/strmname.h b/sd/inc/strmname.h
index 5af7cdd1fd36..13a9fb045f30 100644
--- a/sd/inc/strmname.h
+++ b/sd/inc/strmname.h
@@ -23,12 +23,12 @@
 #include <rtl/ustring.hxx>
 
 // PowerPoint-Filter
-const OUString pFilterPowerPoint97( "MS PowerPoint 97" );
-const OUString pFilterPowerPoint97Template( "MS PowerPoint 97 Vorlage" );
-const OUString pFilterPowerPoint97AutoPlay( "MS PowerPoint 97 AutoPlay" );
+const OUStringLiteral pFilterPowerPoint97( "MS PowerPoint 97" );
+const OUStringLiteral pFilterPowerPoint97Template( "MS PowerPoint 97 Vorlage" );
+const OUStringLiteral pFilterPowerPoint97AutoPlay( "MS PowerPoint 97 AutoPlay" );
 
 // XML content stream
-const OUString pStarDrawXMLContent( "content.xml" );
+const OUStringLiteral pStarDrawXMLContent( "content.xml" );
 
 #endif // INCLUDED_SD_INC_STRMNAME_H
 
diff --git a/sd/source/ui/dlg/sdabstdlg.cxx b/sd/source/ui/dlg/sdabstdlg.cxx
index 796f9c083bef..cb0852345e45 100644
--- a/sd/source/ui/dlg/sdabstdlg.cxx
+++ b/sd/source/ui/dlg/sdabstdlg.cxx
@@ -39,7 +39,7 @@ SdAbstractDialogFactory* SdAbstractDialogFactory::Create()
     SdFuncPtrCreateDialogFactory fp = nullptr;
 #ifndef DISABLE_DYNLOADING
     static ::osl::Module aDialogLibrary;
-    static const OUString sLibName(SDUI_DLL_NAME);
+    static const OUStringLiteral sLibName(SDUI_DLL_NAME);
     if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, sLibName ) )
         fp = reinterpret_cast<SdAbstractDialogFactory* (SAL_CALL*)()>(
             aDialogLibrary.getFunctionSymbol( "SdCreateDialogFactory" ));
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index d969d60a1465..d1c5efd829de 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -175,7 +175,7 @@ namespace {
 
 // Pane URLS.
 
-const OUString FrameworkHelper::msPaneURLPrefix("private:resource/pane/");
+const OUStringLiteral FrameworkHelper::msPaneURLPrefix("private:resource/pane/");
 const OUString FrameworkHelper::msCenterPaneURL( msPaneURLPrefix + "CenterPane");
 const OUString FrameworkHelper::msFullScreenPaneURL( msPaneURLPrefix + "FullScreenPane");
 const OUString FrameworkHelper::msLeftImpressPaneURL( msPaneURLPrefix + "LeftImpressPane");
@@ -184,7 +184,7 @@ const OUString FrameworkHelper::msSidebarPaneURL( msPaneURLPrefix + "SidebarPane
 
 // View URLs.
 
-const OUString FrameworkHelper::msViewURLPrefix("private:resource/view/");
+const OUStringLiteral FrameworkHelper::msViewURLPrefix("private:resource/view/");
 const OUString FrameworkHelper::msImpressViewURL( msViewURLPrefix + "ImpressView");
 const OUString FrameworkHelper::msDrawViewURL( msViewURLPrefix + "GraphicView");
 const OUString FrameworkHelper::msOutlineViewURL( msViewURLPrefix + "OutlineView");
@@ -196,11 +196,11 @@ const OUString FrameworkHelper::msSidebarViewURL( msViewURLPrefix + "SidebarView
 
 // Tool bar URLs.
 
-const OUString FrameworkHelper::msToolBarURLPrefix("private:resource/toolbar/");
+const OUStringLiteral FrameworkHelper::msToolBarURLPrefix("private:resource/toolbar/");
 const OUString FrameworkHelper::msViewTabBarURL( msToolBarURLPrefix + "ViewTabBar");
 
 // Task panel URLs.
-const OUString FrameworkHelper::msTaskPanelURLPrefix( "private:resource/toolpanel/" );
+const OUStringLiteral FrameworkHelper::msTaskPanelURLPrefix( "private:resource/toolpanel/" );
 const OUString FrameworkHelper::msAllMasterPagesTaskPanelURL( msTaskPanelURLPrefix + "AllMasterPages" );
 const OUString FrameworkHelper::msRecentMasterPagesTaskPanelURL( msTaskPanelURLPrefix + "RecentMasterPages" );
 const OUString FrameworkHelper::msUsedMasterPagesTaskPanelURL( msTaskPanelURLPrefix + "UsedMasterPages" );
@@ -210,17 +210,17 @@ const OUString FrameworkHelper::msCustomAnimationTaskPanelURL( msTaskPanelURLPre
 const OUString FrameworkHelper::msSlideTransitionTaskPanelURL( msTaskPanelURLPrefix + "SlideTransitions" );
 
 // Event URLs.
-const OUString FrameworkHelper::msResourceActivationRequestEvent( "ResourceActivationRequested" );
-const OUString FrameworkHelper::msResourceDeactivationRequestEvent( "ResourceDeactivationRequest" );
-const OUString FrameworkHelper::msResourceActivationEvent( "ResourceActivation" );
-const OUString FrameworkHelper::msResourceDeactivationEvent( "ResourceDeactivation" );
-const OUString FrameworkHelper::msResourceDeactivationEndEvent( "ResourceDeactivationEnd" );
-const OUString FrameworkHelper::msConfigurationUpdateStartEvent( "ConfigurationUpdateStart" );
-const OUString FrameworkHelper::msConfigurationUpdateEndEvent( "ConfigurationUpdateEnd" );
+const OUStringLiteral FrameworkHelper::msResourceActivationRequestEvent( "ResourceActivationRequested" );
+const OUStringLiteral FrameworkHelper::msResourceDeactivationRequestEvent( "ResourceDeactivationRequest" );
+const OUStringLiteral FrameworkHelper::msResourceActivationEvent( "ResourceActivation" );
+const OUStringLiteral FrameworkHelper::msResourceDeactivationEvent( "ResourceDeactivation" );
+const OUStringLiteral FrameworkHelper::msResourceDeactivationEndEvent( "ResourceDeactivationEnd" );
+const OUStringLiteral FrameworkHelper::msConfigurationUpdateStartEvent( "ConfigurationUpdateStart" );
+const OUStringLiteral FrameworkHelper::msConfigurationUpdateEndEvent( "ConfigurationUpdateEnd" );
 
 // Service names of controllers.
-const OUString FrameworkHelper::msModuleControllerService("com.sun.star.drawing.framework.ModuleController");
-const OUString FrameworkHelper::msConfigurationControllerService("com.sun.star.drawing.framework.ConfigurationController");
+const OUStringLiteral FrameworkHelper::msModuleControllerService("com.sun.star.drawing.framework.ModuleController");
+const OUStringLiteral FrameworkHelper::msConfigurationControllerService("com.sun.star.drawing.framework.ConfigurationController");
 
 //----- helper ----------------------------------------------------------------
 namespace
diff --git a/sd/source/ui/inc/ToolBarManager.hxx b/sd/source/ui/inc/ToolBarManager.hxx
index b6e8dc7d2b92..a7577b444870 100644
--- a/sd/source/ui/inc/ToolBarManager.hxx
+++ b/sd/source/ui/inc/ToolBarManager.hxx
@@ -97,21 +97,21 @@ public:
 
     /** The set of tool bars that are handled by this manager class.
     */
-    const static OUString msToolBar;                  // Draw_Toolbox_Sd, 23011
-    const static OUString msOptionsToolBar;           // Draw_Options_Toolbox, 23020
-    const static OUString msCommonTaskToolBar;        // Draw_CommonTask_Toolbox, 23021
-    const static OUString msViewerToolBar;            // Draw_Viewer_Toolbox, 23023
-    const static OUString msSlideSorterToolBar;       // Slide_Toolbox, 23012
-    const static OUString msSlideSorterObjectBar;     // Slide_Obj_Toolbox, 23014
-    const static OUString msOutlineToolBar;           // Outline_Toolbox, 23017
-    const static OUString msMasterViewToolBar;        // SID_MASTERPAGE, 27053
-    const static OUString msDrawingObjectToolBar;     // Draw_Obj_Toolbox, 23013
-    const static OUString msGluePointsToolBar;        // Gluepoints_Toolbox, 23019
-    const static OUString msTextObjectBar;            // Draw_Text_Toolbox_Sd, 23016
-    const static OUString msBezierObjectBar;          // Bezier_Toolbox_Sd, 23015
-    const static OUString msGraphicObjectBar;         // Draw_Graf_Toolbox, 23030
-    const static OUString msMediaObjectBar;           // Draw_Media_Toolbox, 23031
-    const static OUString msTableObjectBar;           // Draw_Table_Toolbox, 23018
+    const static OUStringLiteral msToolBar;                  // Draw_Toolbox_Sd, 23011
+    const static OUStringLiteral msOptionsToolBar;           // Draw_Options_Toolbox, 23020
+    const static OUStringLiteral msCommonTaskToolBar;        // Draw_CommonTask_Toolbox, 23021
+    const static OUStringLiteral msViewerToolBar;            // Draw_Viewer_Toolbox, 23023
+    const static OUStringLiteral msSlideSorterToolBar;       // Slide_Toolbox, 23012
+    const static OUStringLiteral msSlideSorterObjectBar;     // Slide_Obj_Toolbox, 23014
+    const static OUStringLiteral msOutlineToolBar;           // Outline_Toolbox, 23017
+    const static OUStringLiteral msMasterViewToolBar;        // SID_MASTERPAGE, 27053
+    const static OUStringLiteral msDrawingObjectToolBar;     // Draw_Obj_Toolbox, 23013
+    const static OUStringLiteral msGluePointsToolBar;        // Gluepoints_Toolbox, 23019
+    const static OUStringLiteral msTextObjectBar;            // Draw_Text_Toolbox_Sd, 23016
+    const static OUStringLiteral msBezierObjectBar;          // Bezier_Toolbox_Sd, 23015
+    const static OUStringLiteral msGraphicObjectBar;         // Draw_Graf_Toolbox, 23030
+    const static OUStringLiteral msMediaObjectBar;           // Draw_Media_Toolbox, 23031
+    const static OUStringLiteral msTableObjectBar;           // Draw_Table_Toolbox, 23018
 
     /** The set of tool bar groups.
     */
diff --git a/sd/source/ui/inc/framework/FrameworkHelper.hxx b/sd/source/ui/inc/framework/FrameworkHelper.hxx
index fe964e2eb015..a144cc243166 100644
--- a/sd/source/ui/inc/framework/FrameworkHelper.hxx
+++ b/sd/source/ui/inc/framework/FrameworkHelper.hxx
@@ -56,7 +56,7 @@ class FrameworkHelper
 {
 public:
     // URLs of frequently used panes.
-    static const OUString msPaneURLPrefix;
+    static const OUStringLiteral msPaneURLPrefix;
     static const OUString msCenterPaneURL;
     static const OUString msFullScreenPaneURL;
     static const OUString msLeftImpressPaneURL;
@@ -64,7 +64,7 @@ public:
     static const OUString msSidebarPaneURL;
 
     // URLs of frequently used views.
-    static const OUString msViewURLPrefix;
+    static const OUStringLiteral msViewURLPrefix;
     static const OUString msImpressViewURL;
     static const OUString msDrawViewURL;
     static const OUString msOutlineViewURL;
@@ -75,11 +75,11 @@ public:
     static const OUString msSidebarViewURL;
 
     // URLs of frequently used tool bars.
-    static const OUString msToolBarURLPrefix;
+    static const OUStringLiteral msToolBarURLPrefix;
     static const OUString msViewTabBarURL;
 
     // URLs of task panels.
-    static const OUString msTaskPanelURLPrefix;
+    static const OUStringLiteral msTaskPanelURLPrefix;
     static const OUString msAllMasterPagesTaskPanelURL;
     static const OUString msRecentMasterPagesTaskPanelURL;
     static const OUString msUsedMasterPagesTaskPanelURL;
@@ -89,17 +89,17 @@ public:
     static const OUString msSlideTransitionTaskPanelURL;
 
     // Names of frequently used events.
-    static const OUString msResourceActivationRequestEvent;
-    static const OUString msResourceDeactivationRequestEvent;
-    static const OUString msResourceActivationEvent;
-    static const OUString msResourceDeactivationEvent;
-    static const OUString msResourceDeactivationEndEvent;
-    static const OUString msConfigurationUpdateStartEvent;
-    static const OUString msConfigurationUpdateEndEvent;
+    static const OUStringLiteral msResourceActivationRequestEvent;
+    static const OUStringLiteral msResourceDeactivationRequestEvent;
+    static const OUStringLiteral msResourceActivationEvent;
+    static const OUStringLiteral msResourceDeactivationEvent;
+    static const OUStringLiteral msResourceDeactivationEndEvent;
+    static const OUStringLiteral msConfigurationUpdateStartEvent;
+    static const OUStringLiteral msConfigurationUpdateEndEvent;
 
     // Service names of the common controllers.
-    static const OUString msModuleControllerService;
-    static const OUString msConfigurationControllerService;
+    static const OUStringLiteral msModuleControllerService;
+    static const OUStringLiteral msConfigurationControllerService;
 
     /** Return the FrameworkHelper object that is associated with the given
         ViewShellBase.  If such an object does not yet exist, a new one is
diff --git a/sd/source/ui/remotecontrol/ImagePreparer.cxx b/sd/source/ui/remotecontrol/ImagePreparer.cxx
index 786effb8b8eb..274c3c1a8daa 100644
--- a/sd/source/ui/remotecontrol/ImagePreparer.cxx
+++ b/sd/source/ui/remotecontrol/ImagePreparer.cxx
@@ -208,9 +208,9 @@ OString ImagePreparer::prepareNotes( sal_uInt32 aSlideNumber )
     else
         return "";
 
-    static const OUString sNotesShapeName (
+    static const OUStringLiteral sNotesShapeName (
         "com.sun.star.presentation.NotesShape" );
-    static const OUString sTextShapeName (
+    static const OUStringLiteral sTextShapeName (
         "com.sun.star.drawing.TextShape" );
 
     if (aNotesPage.is())
diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx
index e540c2cc83a7..7f084e3952e7 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -328,21 +328,21 @@ private:
 
 //===== ToolBarManager ========================================================
 
-const OUString ToolBarManager::msToolBar("toolbar");
-const OUString ToolBarManager::msOptionsToolBar("optionsbar");
-const OUString ToolBarManager::msCommonTaskToolBar("commontaskbar");
-const OUString ToolBarManager::msViewerToolBar("viewerbar");
-const OUString ToolBarManager::msSlideSorterToolBar("slideviewtoolbar");
-const OUString ToolBarManager::msSlideSorterObjectBar("slideviewobjectbar");
-const OUString ToolBarManager::msOutlineToolBar("outlinetoolbar");
-const OUString ToolBarManager::msMasterViewToolBar("masterviewtoolbar");
-const OUString ToolBarManager::msDrawingObjectToolBar("drawingobjectbar");
-const OUString ToolBarManager::msGluePointsToolBar("gluepointsobjectbar");
-const OUString ToolBarManager::msTextObjectBar("textobjectbar");
-const OUString ToolBarManager::msBezierObjectBar("bezierobjectbar");
-const OUString ToolBarManager::msGraphicObjectBar("graphicobjectbar");
-const OUString ToolBarManager::msMediaObjectBar("mediaobjectbar");
-const OUString ToolBarManager::msTableObjectBar("tableobjectbar");
+const OUStringLiteral ToolBarManager::msToolBar("toolbar");
+const OUStringLiteral ToolBarManager::msOptionsToolBar("optionsbar");
+const OUStringLiteral ToolBarManager::msCommonTaskToolBar("commontaskbar");
+const OUStringLiteral ToolBarManager::msViewerToolBar("viewerbar");
+const OUStringLiteral ToolBarManager::msSlideSorterToolBar("slideviewtoolbar");
+const OUStringLiteral ToolBarManager::msSlideSorterObjectBar("slideviewobjectbar");
+const OUStringLiteral ToolBarManager::msOutlineToolBar("outlinetoolbar");
+const OUStringLiteral ToolBarManager::msMasterViewToolBar("masterviewtoolbar");
+const OUStringLiteral ToolBarManager::msDrawingObjectToolBar("drawingobjectbar");
+const OUStringLiteral ToolBarManager::msGluePointsToolBar("gluepointsobjectbar");
+const OUStringLiteral ToolBarManager::msTextObjectBar("textobjectbar");
+const OUStringLiteral ToolBarManager::msBezierObjectBar("bezierobjectbar");
+const OUStringLiteral ToolBarManager::msGraphicObjectBar("graphicobjectbar");
+const OUStringLiteral ToolBarManager::msMediaObjectBar("mediaobjectbar");
+const OUStringLiteral ToolBarManager::msTableObjectBar("tableobjectbar");
 
 std::shared_ptr<ToolBarManager> ToolBarManager::Create (
     ViewShellBase& rBase,
diff --git a/sdext/source/presenter/PresenterConfigurationAccess.cxx b/sdext/source/presenter/PresenterConfigurationAccess.cxx
index b5f063eb7778..a583429ca96c 100644
--- a/sdext/source/presenter/PresenterConfigurationAccess.cxx
+++ b/sdext/source/presenter/PresenterConfigurationAccess.cxx
@@ -33,7 +33,7 @@ using namespace ::com::sun::star::uno;
 
 namespace sdext::presenter {
 
-const OUString PresenterConfigurationAccess::msPresenterScreenRootName =
+const OUStringLiteral PresenterConfigurationAccess::msPresenterScreenRootName =
     "/org.openoffice.Office.PresenterScreen/";
 
 PresenterConfigurationAccess::PresenterConfigurationAccess (
diff --git a/sdext/source/presenter/PresenterConfigurationAccess.hxx b/sdext/source/presenter/PresenterConfigurationAccess.hxx
index 5b6517e1fe01..13b276fbfb92 100644
--- a/sdext/source/presenter/PresenterConfigurationAccess.hxx
+++ b/sdext/source/presenter/PresenterConfigurationAccess.hxx
@@ -52,7 +52,7 @@ public:
     typedef ::std::function<bool (
         const OUString&,
         const css::uno::Reference<css::beans::XPropertySet>&)> Predicate;
-    static const OUString msPresenterScreenRootName;
+    static const OUStringLiteral msPresenterScreenRootName;
 
     /** Create a new object to access the configuration entries below the
         given root.
diff --git a/sdext/source/presenter/PresenterHelper.cxx b/sdext/source/presenter/PresenterHelper.cxx
index 889739da0ac6..747e168660de 100644
--- a/sdext/source/presenter/PresenterHelper.cxx
+++ b/sdext/source/presenter/PresenterHelper.cxx
@@ -28,19 +28,19 @@ using namespace ::com::sun::star::presentation;
 
 namespace sdext::presenter {
 
-const OUString PresenterHelper::msPaneURLPrefix( "private:resource/pane/");
+const OUStringLiteral PresenterHelper::msPaneURLPrefix( "private:resource/pane/");
 const OUString PresenterHelper::msCenterPaneURL( msPaneURLPrefix + "CenterPane");
 const OUString PresenterHelper::msFullScreenPaneURL( msPaneURLPrefix + "FullScreenPane");
 
-const OUString PresenterHelper::msViewURLPrefix( "private:resource/view/");
+const OUStringLiteral PresenterHelper::msViewURLPrefix( "private:resource/view/");
 const OUString PresenterHelper::msPresenterScreenURL( msViewURLPrefix + "PresenterScreen");
 const OUString PresenterHelper::msSlideSorterURL( msViewURLPrefix + "SlideSorter");
 
-const OUString PresenterHelper::msResourceActivationEvent( "ResourceActivation");
-const OUString PresenterHelper::msResourceDeactivationEvent( "ResourceDeactivation");
+const OUStringLiteral PresenterHelper::msResourceActivationEvent( "ResourceActivation");
+const OUStringLiteral PresenterHelper::msResourceDeactivationEvent( "ResourceDeactivation");
 
-const OUString PresenterHelper::msDefaultPaneStyle ( "DefaultPaneStyle");
-const OUString PresenterHelper::msDefaultViewStyle ( "DefaultViewStyle");
+const OUStringLiteral PresenterHelper::msDefaultPaneStyle ( "DefaultPaneStyle");
+const OUStringLiteral PresenterHelper::msDefaultViewStyle ( "DefaultViewStyle");
 
 Reference<presentation::XSlideShowController> PresenterHelper::GetSlideShowController (
     const Reference<frame::XController>& rxController)
diff --git a/sdext/source/presenter/PresenterHelper.hxx b/sdext/source/presenter/PresenterHelper.hxx
index 2df240010964..6f8a9721c037 100644
--- a/sdext/source/presenter/PresenterHelper.hxx
+++ b/sdext/source/presenter/PresenterHelper.hxx
@@ -30,19 +30,19 @@ namespace sdext::presenter {
 */
 namespace PresenterHelper
 {
-    extern const OUString msPaneURLPrefix;
+    extern const OUStringLiteral msPaneURLPrefix;
     extern const OUString msCenterPaneURL;
     extern const OUString msFullScreenPaneURL;
 
-    extern const OUString msViewURLPrefix;
+    extern const OUStringLiteral msViewURLPrefix;
     extern const OUString msPresenterScreenURL;
     extern const OUString msSlideSorterURL;
 
-    extern const OUString msResourceActivationEvent;
-    extern const OUString msResourceDeactivationEvent;
+    extern const OUStringLiteral msResourceActivationEvent;
+    extern const OUStringLiteral msResourceDeactivationEvent;
 
-    extern const OUString msDefaultPaneStyle;
-    extern const OUString msDefaultViewStyle;
+    extern const OUStringLiteral msDefaultPaneStyle;
+    extern const OUStringLiteral msDefaultViewStyle;
 
     /** Return the slide show controller of a running presentation that has
         the same document as the given framework controller.
diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx
index e042ae8f8965..a7006066d6f0 100644
--- a/sdext/source/presenter/PresenterNotesView.cxx
+++ b/sdext/source/presenter/PresenterNotesView.cxx
@@ -217,9 +217,9 @@ void PresenterNotesView::CreateToolBar (
 
 void PresenterNotesView::SetSlide (const Reference<drawing::XDrawPage>& rxNotesPage)
 {
-    static const OUString sNotesShapeName (
+    static const OUStringLiteral sNotesShapeName (
         "com.sun.star.presentation.NotesShape");
-    static const OUString sTextShapeName (
+    static const OUStringLiteral sTextShapeName (
         "com.sun.star.drawing.TextShape");
 
     if (!rxNotesPage.is())
diff --git a/sdext/source/presenter/PresenterPaneFactory.cxx b/sdext/source/presenter/PresenterPaneFactory.cxx
index 067243cf4836..afb5a2825cae 100644
--- a/sdext/source/presenter/PresenterPaneFactory.cxx
+++ b/sdext/source/presenter/PresenterPaneFactory.cxx
@@ -33,20 +33,20 @@ using namespace ::com::sun::star::drawing::framework;
 
 namespace sdext::presenter {
 
-const OUString PresenterPaneFactory::msCurrentSlidePreviewPaneURL(
+const OUStringLiteral PresenterPaneFactory::msCurrentSlidePreviewPaneURL(
     "private:resource/pane/Presenter/Pane1");
-const OUString PresenterPaneFactory::msNextSlidePreviewPaneURL(
+const OUStringLiteral PresenterPaneFactory::msNextSlidePreviewPaneURL(
     "private:resource/pane/Presenter/Pane2");
-const OUString PresenterPaneFactory::msNotesPaneURL(
+const OUStringLiteral PresenterPaneFactory::msNotesPaneURL(
     "private:resource/pane/Presenter/Pane3");
-const OUString PresenterPaneFactory::msToolBarPaneURL(
+const OUStringLiteral PresenterPaneFactory::msToolBarPaneURL(
     "private:resource/pane/Presenter/Pane4");
-const OUString PresenterPaneFactory::msSlideSorterPaneURL(
+const OUStringLiteral PresenterPaneFactory::msSlideSorterPaneURL(
     "private:resource/pane/Presenter/Pane5");
-const OUString PresenterPaneFactory::msHelpPaneURL(
+const OUStringLiteral PresenterPaneFactory::msHelpPaneURL(
     "private:resource/pane/Presenter/Pane6");
 
-const OUString PresenterPaneFactory::msOverlayPaneURL(
+const OUStringLiteral PresenterPaneFactory::msOverlayPaneURL(
     "private:resource/pane/Presenter/Overlay");
 
 //===== PresenterPaneFactory ==================================================
diff --git a/sdext/source/presenter/PresenterPaneFactory.hxx b/sdext/source/presenter/PresenterPaneFactory.hxx
index 1ae3c0696c3b..495aa9ad74d0 100644
--- a/sdext/source/presenter/PresenterPaneFactory.hxx
+++ b/sdext/source/presenter/PresenterPaneFactory.hxx
@@ -49,13 +49,13 @@ class PresenterPaneFactory
       public PresenterPaneFactoryInterfaceBase
 {
 public:
-    static const OUString msCurrentSlidePreviewPaneURL;
-    static const OUString msNextSlidePreviewPaneURL;
-    static const OUString msNotesPaneURL;
-    static const OUString msToolBarPaneURL;
-    static const OUString msSlideSorterPaneURL;
-    static const OUString msHelpPaneURL;
-    static const OUString msOverlayPaneURL;
+    static const OUStringLiteral msCurrentSlidePreviewPaneURL;
+    static const OUStringLiteral msNextSlidePreviewPaneURL;
+    static const OUStringLiteral msNotesPaneURL;
+    static const OUStringLiteral msToolBarPaneURL;
+    static const OUStringLiteral msSlideSorterPaneURL;
+    static const OUStringLiteral msHelpPaneURL;
+    static const OUStringLiteral msOverlayPaneURL;
 
     /** Create a new instance of this class and register it as resource
         factory in the drawing framework of the given controller.
diff --git a/sdext/source/presenter/PresenterViewFactory.cxx b/sdext/source/presenter/PresenterViewFactory.cxx
index c141b920d91e..837e12e64604 100644
--- a/sdext/source/presenter/PresenterViewFactory.cxx
+++ b/sdext/source/presenter/PresenterViewFactory.cxx
@@ -33,17 +33,17 @@ using namespace ::com::sun::star::drawing::framework;
 
 namespace sdext::presenter {
 
-const OUString PresenterViewFactory::msCurrentSlidePreviewViewURL(
+const OUStringLiteral PresenterViewFactory::msCurrentSlidePreviewViewURL(
     "private:resource/view/Presenter/CurrentSlidePreview");
-const OUString PresenterViewFactory::msNextSlidePreviewViewURL(
+const OUStringLiteral PresenterViewFactory::msNextSlidePreviewViewURL(
     "private:resource/view/Presenter/NextSlidePreview");
-const OUString PresenterViewFactory::msNotesViewURL(
+const OUStringLiteral PresenterViewFactory::msNotesViewURL(
     "private:resource/view/Presenter/Notes");
-const OUString PresenterViewFactory::msToolBarViewURL(
+const OUStringLiteral PresenterViewFactory::msToolBarViewURL(
     "private:resource/view/Presenter/ToolBar");
-const OUString PresenterViewFactory::msSlideSorterURL(
+const OUStringLiteral PresenterViewFactory::msSlideSorterURL(
     "private:resource/view/Presenter/SlideSorter");
-const OUString PresenterViewFactory::msHelpViewURL(
+const OUStringLiteral PresenterViewFactory::msHelpViewURL(
     "private:resource/view/Presenter/Help");
 
 namespace {
diff --git a/sdext/source/presenter/PresenterViewFactory.hxx b/sdext/source/presenter/PresenterViewFactory.hxx
index 46b854c4bd85..cc6aaea94ea7 100644
--- a/sdext/source/presenter/PresenterViewFactory.hxx
+++ b/sdext/source/presenter/PresenterViewFactory.hxx
@@ -75,12 +75,12 @@ class PresenterViewFactory
       public PresenterViewFactoryInterfaceBase
 {
 public:
-    static const OUString msCurrentSlidePreviewViewURL;
-    static const OUString msNextSlidePreviewViewURL;
-    static const OUString msNotesViewURL;
-    static const OUString msToolBarViewURL;
-    static const OUString msSlideSorterURL;
-    static const OUString msHelpViewURL;
+    static const OUStringLiteral msCurrentSlidePreviewViewURL;
+    static const OUStringLiteral msNextSlidePreviewViewURL;
+    static const OUStringLiteral msNotesViewURL;
+    static const OUStringLiteral msToolBarViewURL;
+    static const OUStringLiteral msSlideSorterURL;
+    static const OUStringLiteral msHelpViewURL;
 
     /** Create a new instance of this class and register it as resource
         factory in the drawing framework of the given controller.
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 1c4152fb9936..bd559af59fde 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -703,7 +703,7 @@ bool SfxHelp::Start(const OUString& rURL, weld::Widget* pWidget)
 /// Redirect the vnd.sun.star.help:// urls to http://help.libreoffice.org
 static bool impl_showOnlineHelp( const OUString& rURL )
 {
-    static const OUString aInternal("vnd.sun.star.help://");
+    static const OUStringLiteral aInternal("vnd.sun.star.help://");
     if ( rURL.getLength() <= aInternal.getLength() || !rURL.startsWith(aInternal) )
         return false;
 
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index a747959699e8..f05a33f1e2c2 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -121,13 +121,13 @@ namespace
     }
 }
 
-static const OUString* GetLastFilterConfigId( FileDialogHelper::Context _eContext )
+static const OUStringLiteral* GetLastFilterConfigId( FileDialogHelper::Context _eContext )
 {
-    static const OUString aSD_EXPORT_IDENTIFIER("SdExportLastFilter");
-    static const OUString aSI_EXPORT_IDENTIFIER("SiExportLastFilter");
-    static const OUString aSW_EXPORT_IDENTIFIER("SwExportLastFilter");
+    static const OUStringLiteral aSD_EXPORT_IDENTIFIER("SdExportLastFilter");
+    static const OUStringLiteral aSI_EXPORT_IDENTIFIER("SiExportLastFilter");
+    static const OUStringLiteral aSW_EXPORT_IDENTIFIER("SwExportLastFilter");
 
-    const OUString* pRet = nullptr;
+    const OUStringLiteral* pRet = nullptr;
 
     switch( _eContext )
     {
@@ -344,7 +344,7 @@ void FileDialogHelper_Impl::LoadLastUsedFilter( const OUString& _rContextIdentif
 
 void FileDialogHelper_Impl::SaveLastUsedFilter()
 {
-    const OUString* pConfigId = GetLastFilterConfigId( meContext );
+    const OUStringLiteral* pConfigId = GetLastFilterConfigId( meContext );
     if( pConfigId )
         SvtViewOptions( EViewType::Dialog, IODLG_CONFIGNAME ).SetUserItem( *pConfigId,
                             makeAny( getFilterWithExtension( getFilter() ) ) );
@@ -2255,7 +2255,7 @@ void FileDialogHelper_Impl::SetContext( FileDialogHelper::Context _eNewContext )
 {
     meContext = _eNewContext;
 
-    const OUString* pConfigId = GetLastFilterConfigId( _eNewContext );
+    const OUStringLiteral* pConfigId = GetLastFilterConfigId( _eNewContext );
     if( pConfigId )
         LoadLastUsedFilter( *pConfigId );
 }
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 0d4f04702d3c..76c929e1ee76 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1106,7 +1106,7 @@ private:
 
 static OUString lcl_strip_template(const OUString &aString)
 {
-    static const OUString sPostfix("_template");
+    static const OUStringLiteral sPostfix("_template");
     OUString sRes(aString);
     if (sRes.endsWith(sPostfix))
         sRes = sRes.copy(0, sRes.getLength() - sPostfix.getLength());
diff --git a/solenv/CompilerTest_compilerplugins_clang.mk b/solenv/CompilerTest_compilerplugins_clang.mk
index d4612b628838..453bf43af9ac 100644
--- a/solenv/CompilerTest_compilerplugins_clang.mk
+++ b/solenv/CompilerTest_compilerplugins_clang.mk
@@ -87,6 +87,7 @@ $(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang, \
     compilerplugins/clang/test/stringconcatliterals \
     compilerplugins/clang/test/stringconstant \
     compilerplugins/clang/test/stringloop \
+    compilerplugins/clang/test/stringstatic \
     compilerplugins/clang/test/typedefparam \
     compilerplugins/clang/test/unnecessarycatchthrow \
     compilerplugins/clang/test/unnecessaryoverride \
diff --git a/svgio/inc/svgtools.hxx b/svgio/inc/svgtools.hxx
index 2fdef95bd81e..d5df009f8ab6 100644
--- a/svgio/inc/svgtools.hxx
+++ b/svgio/inc/svgtools.hxx
@@ -36,10 +36,10 @@ namespace svgio::svgreader
         // common non-token strings
         struct commonStrings
         {
-            static const OUString aStrUserSpaceOnUse;
-            static const OUString aStrObjectBoundingBox;
-            static const OUString aStrNonzero;
-            static const OUString aStrEvenOdd;
+            static const OUStringLiteral aStrUserSpaceOnUse;
+            static const OUStringLiteral aStrObjectBoundingBox;
+            static const OUStringLiteral aStrNonzero;
+            static const OUStringLiteral aStrEvenOdd;
         };
 
         enum SvgUnits
diff --git a/svgio/source/svgreader/svgtools.cxx b/svgio/source/svgreader/svgtools.cxx
index 0c628511ddbd..8c66e3db8974 100644
--- a/svgio/source/svgreader/svgtools.cxx
+++ b/svgio/source/svgreader/svgtools.cxx
@@ -30,10 +30,10 @@
 namespace svgio::svgreader
 {
         // common non-token strings
-        const OUString commonStrings::aStrUserSpaceOnUse("userSpaceOnUse");
-        const OUString commonStrings::aStrObjectBoundingBox("objectBoundingBox");
-        const OUString commonStrings::aStrNonzero("nonzero");
-        const OUString commonStrings::aStrEvenOdd("evenodd");
+        const OUStringLiteral commonStrings::aStrUserSpaceOnUse("userSpaceOnUse");
+        const OUStringLiteral commonStrings::aStrObjectBoundingBox("objectBoundingBox");
+        const OUStringLiteral commonStrings::aStrNonzero("nonzero");
+        const OUStringLiteral commonStrings::aStrEvenOdd("evenodd");
 
         basegfx::B2DHomMatrix SvgAspectRatio::createLinearMapping(const basegfx::B2DRange& rTarget, const basegfx::B2DRange& rSource)
         {
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 200095d3ac82..2cc56a9410c4 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -112,7 +112,7 @@ bool ImpSvNumberformatScan::bStandardColorNeedInitialization = true;
 // This vector will hold *only* the color names in German language.
 ::std::vector<OUString> ImpSvNumberformatScan::sGermanColorNames;
 
-const OUString ImpSvNumberformatScan::sErrStr =  "#FMT";
+const OUStringLiteral ImpSvNumberformatScan::sErrStr =  "#FMT";
 
 ImpSvNumberformatScan::ImpSvNumberformatScan( SvNumberFormatter* pFormatterP )
     : maNullDate( 30, 12, 1899)
diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx
index a5e7ecaa8b3e..235b690f25a4 100644
--- a/svl/source/numbers/zforscan.hxx
+++ b/svl/source/numbers/zforscan.hxx
@@ -91,7 +91,7 @@ public:
     const OUString& GetFalseString() const    { return GetSpecialKeyword( NF_KEY_FALSE ); }
     const OUString& GetRedString() const      { return GetKeywords()[NF_KEY_RED]; }
     const OUString& GetBooleanString() const  { return GetKeywords()[NF_KEY_BOOLEAN]; }
-    static const OUString& GetErrorString()   { return sErrStr; }
+    static const OUStringLiteral& GetErrorString()   { return sErrStr; }
     static const ::std::vector<Color> & GetStandardColors()
         {
             return StandardColor;
@@ -211,7 +211,7 @@ private: // Private section
     OUString sCurAbbrev;                        // Currency abbreviation
     OUString sBooleanEquivalent1;               // "TRUE";"TRUE";"FALSE"
     OUString sBooleanEquivalent2;               // [>0]"TRUE";[<0]"TRUE";"FALSE"
-    static const OUString sErrStr;              // String for error output
+    static const OUStringLiteral sErrStr;       // String for error output
 
     bool bConvertMode;                          // Set in the convert mode
     bool mbConvertDateOrder;                    // Set in the convert mode whether to convert date particles order
diff --git a/svx/qa/unit/classicshapes.cxx b/svx/qa/unit/classicshapes.cxx
index 3e519418ed84..2a9ba13acc67 100644
--- a/svx/qa/unit/classicshapes.cxx
+++ b/svx/qa/unit/classicshapes.cxx
@@ -24,7 +24,7 @@ using namespace ::com::sun::star;
 
 namespace
 {
-const OUString sDataDirectory("svx/qa/unit/data/");
+const OUStringLiteral sDataDirectory("svx/qa/unit/data/");
 
 /// Tests not about special features of custom shapes, but about shapes in general.
 class ClassicshapesTest : public test::BootstrapFixture, public unotest::MacrosTest
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx
index 79cd6de65410..02a3ac2366e5 100644
--- a/svx/qa/unit/customshapes.cxx
+++ b/svx/qa/unit/customshapes.cxx
@@ -29,7 +29,7 @@ using namespace ::com::sun::star;
 
 namespace
 {
-const OUString sDataDirectory("svx/qa/unit/data/");
+const OUStringLiteral sDataDirectory("svx/qa/unit/data/");
 
 /// Tests for svx/source/customshapes/ code.
 class CustomshapesTest : public test::BootstrapFixture, public unotest::MacrosTest
diff --git a/svx/source/dialog/ClassificationDialog.cxx b/svx/source/dialog/ClassificationDialog.cxx
index a23e56029bf8..ef376a8aa082 100644
--- a/svx/source/dialog/ClassificationDialog.cxx
+++ b/svx/source/dialog/ClassificationDialog.cxx
@@ -71,7 +71,7 @@ namespace {
 
 constexpr size_t RECENTLY_USED_LIMIT = 5;
 
-const OUString constRecentlyUsedFileName("recentlyUsed.xml");
+const OUStringLiteral constRecentlyUsedFileName("recentlyUsed.xml");
 
 OUString lcl_getClassificationUserPath()
 {
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index d3db9a653f1d..19682a1d44f4 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -3668,8 +3668,8 @@ void FmXFormShell::smartControlReset( const Reference< XIndexAccess >& _rxModels
         return;
     }
 
-    static const OUString sClassIdPropertyName = FM_PROP_CLASSID;
-    static const OUString sBoundFieldPropertyName = FM_PROP_BOUNDFIELD;
+    static const OUStringLiteral sClassIdPropertyName = FM_PROP_CLASSID;
+    static const OUStringLiteral sBoundFieldPropertyName = FM_PROP_BOUNDFIELD;
     sal_Int32 nCount = _rxModels->getCount();
     Reference< XPropertySet > xCurrent;
     Reference< XPropertySetInfo > xCurrentInfo;
diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx
index 232ca6f47acc..bbb4a8e373f0 100644
--- a/sw/inc/tox.hxx
+++ b/sw/inc/tox.hxx
@@ -75,7 +75,7 @@ namespace sw {
 
 extern const sal_Unicode C_NUM_REPL;
 extern const sal_Unicode C_END_PAGE_NUM;
-extern const OUString S_PAGE_DELI;
+extern const OUStringLiteral S_PAGE_DELI;
 
 class SW_DLLPUBLIC SwTOXMark final
     : public SfxPoolItem
diff --git a/sw/qa/core/test_ToxLinkProcessor.cxx b/sw/qa/core/test_ToxLinkProcessor.cxx
index 2e65c2ff6c28..d4b2f350c7c2 100644
--- a/sw/qa/core/test_ToxLinkProcessor.cxx
+++ b/sw/qa/core/test_ToxLinkProcessor.cxx
@@ -40,18 +40,18 @@ public:
         SwGlobals::ensure();
     }
 
-    static const OUString STYLE_NAME_1;
-    static const OUString STYLE_NAME_2;
+    static const OUStringLiteral STYLE_NAME_1;
+    static const OUStringLiteral STYLE_NAME_2;
     static const sal_uInt16 POOL_ID_1;
     static const sal_uInt16 POOL_ID_2;
-    static const OUString URL_1;
-    static const OUString URL_2;
+    static const OUStringLiteral URL_1;
+    static const OUStringLiteral URL_2;
 };
 
-const OUString ToxLinkProcessorTest::STYLE_NAME_1 = "anyStyle1";
-const OUString ToxLinkProcessorTest::STYLE_NAME_2 = "anyStyle2";
-const OUString ToxLinkProcessorTest::URL_1 = "anyUrl1";
-const OUString ToxLinkProcessorTest::URL_2 = "anyUrl2";
+const OUStringLiteral ToxLinkProcessorTest::STYLE_NAME_1 = "anyStyle1";
+const OUStringLiteral ToxLinkProcessorTest::STYLE_NAME_2 = "anyStyle2";
+const OUStringLiteral ToxLinkProcessorTest::URL_1 = "anyUrl1";
+const OUStringLiteral ToxLinkProcessorTest::URL_2 = "anyUrl2";
 const sal_uInt16 ToxLinkProcessorTest::POOL_ID_1 = 42;
 const sal_uInt16 ToxLinkProcessorTest::POOL_ID_2 = 43;
 
@@ -83,8 +83,8 @@ ToxLinkProcessorTest::AddingAndClosingTwoOverlappingLinksResultsInOneClosedLink(
     CPPUNIT_ASSERT_EQUAL(1u, static_cast<unsigned>(sut.m_ClosedLinks.size()));
     CPPUNIT_ASSERT_MESSAGE("no links are open", !sut.m_pStartedLink);
     // backward compatibility: the last start is closed by the first end
-    CPPUNIT_ASSERT_EQUAL(STYLE_NAME_2, sut.m_ClosedLinks[0]->mINetFormat.GetINetFormat());
-    CPPUNIT_ASSERT_EQUAL(URL_1, sut.m_ClosedLinks[0]->mINetFormat.GetValue());
+    CPPUNIT_ASSERT_EQUAL(OUString(STYLE_NAME_2), sut.m_ClosedLinks[0]->mINetFormat.GetINetFormat());
+    CPPUNIT_ASSERT_EQUAL(OUString(URL_1), sut.m_ClosedLinks[0]->mINetFormat.GetValue());
 }
 
 namespace {
@@ -114,8 +114,8 @@ ToxLinkProcessorTest::LinkIsCreatedCorrectly()
     sut.StartNewLink(0, STYLE_NAME_1);
     sut.CloseLink(1, URL_1);
 
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("Style is stored correctly in link", STYLE_NAME_1, sut.m_ClosedLinks.at(0)->mINetFormat.GetVisitedFormat());
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("Url is stored correctly in link", URL_1, sut.m_ClosedLinks.at(0)->mINetFormat.GetValue());
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Style is stored correctly in link", OUString(STYLE_NAME_1), sut.m_ClosedLinks.at(0)->mINetFormat.GetVisitedFormat());
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Url is stored correctly in link", OUString(URL_1), sut.m_ClosedLinks.at(0)->mINetFormat.GetValue());
 }
 
 void
@@ -132,18 +132,18 @@ ToxLinkProcessorTest::LinkSequenceIsPreserved()
 
     // check first closed element
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Style is stored correctly in link",
-            STYLE_NAME_2, sut.m_ClosedLinks.at(0)->mINetFormat.GetVisitedFormat());
+            OUString(STYLE_NAME_2), sut.m_ClosedLinks.at(0)->mINetFormat.GetVisitedFormat());
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Pool id is stored correctly in link",
             POOL_ID_2, sut.m_ClosedLinks.at(0)->mINetFormat.GetINetFormatId());
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Url is stored correctly in link",
-            URL_2, sut.m_ClosedLinks.at(0)->mINetFormat.GetValue());
+            OUString(URL_2), sut.m_ClosedLinks.at(0)->mINetFormat.GetValue());
     // check second closed element
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Style is stored correctly in link",
-            STYLE_NAME_1, sut.m_ClosedLinks.at(1)->mINetFormat.GetVisitedFormat());
+            OUString(STYLE_NAME_1), sut.m_ClosedLinks.at(1)->mINetFormat.GetVisitedFormat());
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Pool id is stored correctly in link",
             POOL_ID_1, sut.m_ClosedLinks.at(1)->mINetFormat.GetINetFormatId());
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Url is stored correctly in link",
-            URL_1, sut.m_ClosedLinks.at(1)->mINetFormat.GetValue());
+            OUString(URL_1), sut.m_ClosedLinks.at(1)->mINetFormat.GetValue());
 }
 
 // Put the test suite in the registry
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 1aa6461188f6..781ba3b3de8c 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -653,8 +653,8 @@ static void lcl_selectCharacters(SwPaM& rPaM, sal_Int32 first, sal_Int32 end)
     rPaM.GetPoint()->nContent.Assign(rPaM.GetContentNode(), end);
 }
 
-const OUString ORIGINAL_REPLACE_CONTENT("toto titi tutu");
-const OUString EXPECTED_REPLACE_CONTENT("toto toto tutu");
+const OUStringLiteral ORIGINAL_REPLACE_CONTENT("toto titi tutu");
+const OUStringLiteral EXPECTED_REPLACE_CONTENT("toto toto tutu");
 
 void SwUiWriterTest::testReplaceForward()
 {
@@ -671,11 +671,11 @@ void SwUiWriterTest::testReplaceForward()
     lcl_selectCharacters(aPaM, 5, 9);
     pDoc->getIDocumentContentOperations().ReplaceRange(aPaM, "toto", false);
 
-    CPPUNIT_ASSERT_EQUAL(EXPECTED_REPLACE_CONTENT, pTextNode->GetText());
+    CPPUNIT_ASSERT_EQUAL(OUString(EXPECTED_REPLACE_CONTENT), pTextNode->GetText());
 
     rUndoManager.Undo();
 
-    CPPUNIT_ASSERT_EQUAL(ORIGINAL_REPLACE_CONTENT, pTextNode->GetText());
+    CPPUNIT_ASSERT_EQUAL(OUString(ORIGINAL_REPLACE_CONTENT), pTextNode->GetText());
 }
 
 void SwUiWriterTest::testRedlineFrame(char const*const file)
@@ -941,11 +941,11 @@ void SwUiWriterTest::testReplaceBackward()
 
     pDoc->getIDocumentContentOperations().ReplaceRange(aPaM, "toto", false);
 
-    CPPUNIT_ASSERT_EQUAL(EXPECTED_REPLACE_CONTENT, pTextNode->GetText());
+    CPPUNIT_ASSERT_EQUAL(OUString(EXPECTED_REPLACE_CONTENT), pTextNode->GetText());
 
     rUndoManager.Undo();
 
-    CPPUNIT_ASSERT_EQUAL(ORIGINAL_REPLACE_CONTENT, pTextNode->GetText());
+    CPPUNIT_ASSERT_EQUAL(OUString(ORIGINAL_REPLACE_CONTENT), pTextNode->GetText());
 }
 
 void SwUiWriterTest::testFdo69893()
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 2f192ab8953d..ce8448611595 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -97,20 +97,20 @@
 
 namespace
 {
-const OUString MetaFilename("tscp/bails.rdf");
-const OUString MetaNS("urn:bails");
-const OUString ParagraphSignatureRDFNamespace = "urn:bails:loext:paragraph:signature:";
-const OUString ParagraphSignatureIdRDFName = "urn:bails:loext:paragraph:signature:id";
-const OUString ParagraphSignatureDigestRDFName = ":digest";
-const OUString ParagraphSignatureDateRDFName = ":date";
-const OUString ParagraphSignatureUsageRDFName = ":usage";
-const OUString ParagraphSignatureLastIdRDFName = "urn:bails:loext:paragraph:signature:lastid";
-const OUString ParagraphClassificationNameRDFName = "urn:bails:loext:paragraph:classification:name";
-const OUString ParagraphClassificationValueRDFName = "urn:bails:loext:paragraph:classification:value";
-const OUString ParagraphClassificationAbbrRDFName = "urn:bails:loext:paragraph:classification:abbreviation";
-const OUString ParagraphClassificationFieldNamesRDFName = "urn:bails:loext:paragraph:classification:fields";
-const OUString MetadataFieldServiceName = "com.sun.star.text.textfield.MetadataField";
-const OUString DocInfoServiceName = "com.sun.star.text.TextField.DocInfo.Custom";
+const OUStringLiteral MetaFilename("tscp/bails.rdf");
+const OUStringLiteral MetaNS("urn:bails");
+const OUStringLiteral ParagraphSignatureRDFNamespace = "urn:bails:loext:paragraph:signature:";
+const OUStringLiteral ParagraphSignatureIdRDFName = "urn:bails:loext:paragraph:signature:id";
+const OUStringLiteral ParagraphSignatureDigestRDFName = ":digest";
+const OUStringLiteral ParagraphSignatureDateRDFName = ":date";
+const OUStringLiteral ParagraphSignatureUsageRDFName = ":usage";
+const OUStringLiteral ParagraphSignatureLastIdRDFName = "urn:bails:loext:paragraph:signature:lastid";
+const OUStringLiteral ParagraphClassificationNameRDFName = "urn:bails:loext:paragraph:classification:name";
+const OUStringLiteral ParagraphClassificationValueRDFName = "urn:bails:loext:paragraph:classification:value";
+const OUStringLiteral ParagraphClassificationAbbrRDFName = "urn:bails:loext:paragraph:classification:abbreviation";
+const OUStringLiteral ParagraphClassificationFieldNamesRDFName = "urn:bails:loext:paragraph:classification:fields";
+const OUStringLiteral MetadataFieldServiceName = "com.sun.star.text.textfield.MetadataField";
+const OUStringLiteral DocInfoServiceName = "com.sun.star.text.TextField.DocInfo.Custom";
 
 /// Find all page styles which are currently used in the document.
 std::vector<OUString> lcl_getUsedPageStyles(SwViewShell const * pShell)
@@ -1920,7 +1920,7 @@ void SwEditShell::RestoreMetadataFieldsAndValidateParagraphSignatures()
     if (!xParagraphs.is())
         return;
 
-    static const OUString sBlank("");
+    static const OUStringLiteral sBlank("");
     const sfx::ClassificationKeyCreator aKeyCreator(SfxClassificationHelper::getPolicyType());
     const css::uno::Sequence<css::uno::Reference<rdf::XURI>> aGraphNames = SwRDFHelper::getGraphNames(xModel, MetaNS);
 
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index b9203a5c630e..25d2d7906588 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -45,7 +45,7 @@ using namespace std;
 
 const sal_Unicode C_NUM_REPL      = '@';
 const sal_Unicode C_END_PAGE_NUM   = '~';
-const OUString S_PAGE_DELI(", ");
+const OUStringLiteral S_PAGE_DELI(", ");
 
 
 namespace
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 48df59b19b3d..ea529355bc03 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1234,7 +1234,7 @@ void SwTextNode::DestroyAttr( SwTextAttr* pAttr )
         {
             if (SwDocShell* pDocSh = pDoc->GetDocShell())
             {
-                static const OUString metaNS("urn:bails");
+                static const OUStringLiteral metaNS("urn:bails");
                 const css::uno::Reference<css::rdf::XResource> xSubject = pMeta->MakeUnoObject();
                 uno::Reference<frame::XModel> xModel = pDocSh->GetBaseModel();
                 SwRDFHelper::clearStatements(xModel, metaNS, xSubject);
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index e603d2deb3a2..4f95d2e29671 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1447,7 +1447,7 @@ void DocxExport::WriteCustomXml()

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list