summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--avmedia/source/vlc/vlcframegrabber.cxx4
-rw-r--r--avmedia/source/vlc/vlcplayer.cxx4
-rw-r--r--avmedia/source/vlc/vlcwindow.cxx4
-rw-r--r--basctl/source/basicide/basidectrlr.cxx2
-rw-r--r--basctl/source/basicide/localizationmgr.cxx6
-rw-r--r--basic/source/sbx/sbxvar.cxx2
-rw-r--r--chart2/source/controller/dialogs/DialogModel.cxx4
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.cxx4
-rw-r--r--chart2/source/model/main/ChartModel.cxx4
-rw-r--r--chart2/source/view/main/ChartView.cxx4
-rw-r--r--comphelper/source/officeinstdir/officeinstallationdirectories.cxx4
-rw-r--r--comphelper/source/xml/ofopxmlhelper.cxx36
-rw-r--r--compilerplugins/clang/stringstatic.cxx60
-rw-r--r--compilerplugins/clang/test/stringstatic.cxx24
-rw-r--r--cui/source/options/treeopt.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dbfindex.cxx2
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx6
-rw-r--r--desktop/source/lib/init.cxx22
-rw-r--r--extensions/source/bibliography/bibmod.cxx21
-rw-r--r--extensions/source/bibliography/bibprop.hxx20
-rw-r--r--extensions/source/bibliography/datman.cxx6
-rw-r--r--extensions/source/logging/csvformatter.cxx2
-rw-r--r--filter/source/msfilter/msocximex.cxx2
-rw-r--r--filter/source/msfilter/msvbahelper.cxx4
-rw-r--r--framework/inc/jobs/jobconst.hxx6
-rw-r--r--framework/source/fwi/jobs/jobconst.cxx6
-rw-r--r--idlc/source/astdeclaration.cxx2
-rw-r--r--include/rtl/string.hxx75
-rw-r--r--include/xmloff/xmlimp.hxx4
-rw-r--r--oox/source/core/xmlfilterbase.cxx4
-rw-r--r--oox/source/crypto/Standard2007Engine.cxx2
-rw-r--r--oox/source/vml/vmlinputstream.cxx4
-rw-r--r--oox/source/vml/vmlshapecontext.cxx2
-rw-r--r--package/source/zippackage/ZipPackage.cxx10
-rw-r--r--sal/qa/osl/pipe/osl_Pipe.cxx9
-rw-r--r--sal/qa/rtl/digest/rtl_digest.cxx20
-rw-r--r--sax/qa/cppunit/xmlimport.cxx29
-rw-r--r--sax/source/fastparser/legacyfastparser.cxx8
-rw-r--r--sc/source/core/tool/compiler.cxx6
-rw-r--r--sc/source/filter/excel/xiescher.cxx4
-rw-r--r--sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx2
-rw-r--r--sc/source/ui/dbgui/scuiasciiopt.cxx6
-rw-r--r--sc/source/ui/unoobj/PivotTableDataProvider.cxx6
-rw-r--r--sc/source/ui/vba/excelvbahelper.cxx2
-rw-r--r--sc/source/ui/vba/vbaaxis.cxx8
-rw-r--r--sc/source/ui/vba/vbachart.cxx32
-rw-r--r--sc/source/ui/vba/vbachartobject.cxx2
-rw-r--r--sc/source/ui/view/formatsh.cxx2
-rw-r--r--sd/inc/strmname.h8
-rw-r--r--sd/source/ui/dlg/sdabstdlg.cxx2
-rw-r--r--sd/source/ui/framework/tools/FrameworkHelper.cxx26
-rw-r--r--sd/source/ui/inc/ToolBarManager.hxx30
-rw-r--r--sd/source/ui/inc/framework/FrameworkHelper.hxx26
-rw-r--r--sd/source/ui/remotecontrol/ImagePreparer.cxx4
-rw-r--r--sd/source/ui/view/ToolBarManager.cxx30
-rw-r--r--sdext/source/presenter/PresenterConfigurationAccess.cxx2
-rw-r--r--sdext/source/presenter/PresenterConfigurationAccess.hxx2
-rw-r--r--sdext/source/presenter/PresenterHelper.cxx12
-rw-r--r--sdext/source/presenter/PresenterHelper.hxx12
-rw-r--r--sdext/source/presenter/PresenterNotesView.cxx4
-rw-r--r--sdext/source/presenter/PresenterPaneFactory.cxx14
-rw-r--r--sdext/source/presenter/PresenterPaneFactory.hxx14
-rw-r--r--sdext/source/presenter/PresenterViewFactory.cxx12
-rw-r--r--sdext/source/presenter/PresenterViewFactory.hxx12
-rw-r--r--sfx2/source/appl/sfxhelp.cxx2
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx14
-rw-r--r--sfx2/source/doc/objstor.cxx2
-rw-r--r--solenv/CompilerTest_compilerplugins_clang.mk1
-rw-r--r--svgio/inc/svgtools.hxx8
-rw-r--r--svgio/source/svgreader/svgtools.cxx8
-rw-r--r--svl/source/numbers/zforscan.cxx2
-rw-r--r--svl/source/numbers/zforscan.hxx4
-rw-r--r--svx/qa/unit/classicshapes.cxx2
-rw-r--r--svx/qa/unit/customshapes.cxx2
-rw-r--r--svx/source/dialog/ClassificationDialog.cxx2
-rw-r--r--svx/source/form/fmshimp.cxx4
-rw-r--r--sw/inc/tox.hxx2
-rw-r--r--sw/qa/core/test_ToxLinkProcessor.cxx32
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx12
-rw-r--r--sw/source/core/edit/edfcol.cxx30
-rw-r--r--sw/source/core/tox/tox.cxx2
-rw-r--r--sw/source/core/txtnode/thints.cxx2
-rw-r--r--sw/source/filter/ww8/docxexport.cxx2
-rw-r--r--sw/source/ui/misc/bookmark.cxx6
-rw-r--r--sw/source/uibase/dialog/swabstdlg.cxx2
-rw-r--r--sw/source/uibase/inc/bookmark.hxx2
-rw-r--r--test/source/sheet/xsheetoutline.cxx22
-rw-r--r--ucb/source/ucp/webdav-neon/DAVProperties.cxx49
-rw-r--r--ucb/source/ucp/webdav-neon/DAVProperties.hxx24
-rw-r--r--vbahelper/source/msforms/vbamultipage.cxx2
-rw-r--r--vbahelper/source/msforms/vbaprogressbar.cxx2
-rw-r--r--vcl/qa/api/XGraphicTest.cxx2
-rw-r--r--vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx2
-rw-r--r--vcl/qa/cppunit/jpeg/JpegReaderTest.cxx2
-rw-r--r--vcl/qa/cppunit/jpeg/JpegWriterTest.cxx2
-rw-r--r--vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx2
-rw-r--r--vcl/unx/generic/printer/ppdparser.cxx2
-rw-r--r--xmloff/source/core/xmlimp.cxx4
-rw-r--r--xmlscript/source/xml_helper/xml_impctx.cxx4
99 files changed, 527 insertions, 445 deletions
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@+1 {{rather declare this using OUStringLiteral/OStringLiteral/char[] [loplugin:stringstatic]}}
+static const OUString TEST1 = "xxx";
+
+void test2()
+{
+ // expected-error@+1 {{rather declare this using OUStringLiteral/OStringLiteral/char[] [loplugin:stringstatic]}}
+ static const OUString XXX = "xxx";
+ // expected-error@+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.
+@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.
-@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()
uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), 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/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 14c3714d3e48..c72470ab471d 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -38,7 +38,7 @@
using namespace ::com::sun::star;
-const OUString BookmarkTable::aForbiddenChars("/\\@*?\",#");
+const OUStringLiteral BookmarkTable::aForbiddenChars("/\\@*?\",#");
const char BookmarkTable::cSeparator(';');
// callback to modify EditBox
@@ -55,9 +55,9 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, ModifyHdl, weld::Entry&, void)
for (sal_Int32 i = 0; i < BookmarkTable::aForbiddenChars.getLength(); i++)
{
const sal_Int32 nTmpLen = sTmp.getLength();
- sTmp = sTmp.replaceAll(OUStringChar(BookmarkTable::aForbiddenChars[i]), "");
+ sTmp = sTmp.replaceAll(OUStringChar(BookmarkTable::aForbiddenChars.data[i]), "");
if (sTmp.getLength() != nTmpLen)
- sMsg += OUStringChar(BookmarkTable::aForbiddenChars[i]);
+ sMsg += OUStringChar(BookmarkTable::aForbiddenChars.data[i]);
}
const bool bHasForbiddenChars = sTmp.getLength() != nLen;
m_xForbiddenChars->set_visible(bHasForbiddenChars);
diff --git a/sw/source/uibase/dialog/swabstdlg.cxx b/sw/source/uibase/dialog/swabstdlg.cxx
index f726a8274cb7..f9a75330c04b 100644
--- a/sw/source/uibase/dialog/swabstdlg.cxx
+++ b/sw/source/uibase/dialog/swabstdlg.cxx
@@ -38,7 +38,7 @@ SwAbstractDialogFactory* SwAbstractDialogFactory::Create()
SwFuncPtrCreateDialogFactory fp = nullptr;
#ifndef DISABLE_DYNLOADING
static ::osl::Module aDialogLibrary;
- static const OUString sLibName(SWUI_DLL_NAME);
+ static const OUStringLiteral sLibName(SWUI_DLL_NAME);
if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, sLibName,
SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) )
fp = reinterpret_cast<SwAbstractDialogFactory* (SAL_CALL*)()>(
diff --git a/sw/source/uibase/inc/bookmark.hxx b/sw/source/uibase/inc/bookmark.hxx
index a2000ce9a730..2708f771cf29 100644
--- a/sw/source/uibase/inc/bookmark.hxx
+++ b/sw/source/uibase/inc/bookmark.hxx
@@ -58,7 +58,7 @@ public:
int get_sort_column() const { return m_xControl->get_sort_column(); }
void set_sort_column(int nColumn) { m_xControl->set_sort_column(nColumn); }
- static const OUString aForbiddenChars;
+ static const OUStringLiteral aForbiddenChars;
static const char cSeparator;
};
diff --git a/test/source/sheet/xsheetoutline.cxx b/test/source/sheet/xsheetoutline.cxx
index 4ee517b09e52..82b690605b07 100644
--- a/test/source/sheet/xsheetoutline.cxx
+++ b/test/source/sheet/xsheetoutline.cxx
@@ -28,15 +28,13 @@ using namespace css::uno;
namespace apitest {
-const OUString colLevel1 = "OutlineSheet.A1:Z1";
-const OUString colLevel2 = "OutlineSheet.C1:W1";
-const OUString colLevel3 = "OutlineSheet.E1:U1";
-const OUString colLevel4 = "OutlineSheet.G1:S1";
+const OUStringLiteral colLevel1 = "OutlineSheet.A1:Z1";
+const OUStringLiteral colLevel2 = "OutlineSheet.C1:W1";
+const OUStringLiteral colLevel3 = "OutlineSheet.E1:U1";
+const OUStringLiteral colLevel4 = "OutlineSheet.G1:S1";
-const OUString rowLevel1 = "OutlineSheet.A1:A30";
-const OUString rowLevel2 = "OutlineSheet.A3:A27";
-const OUString rowLevel3 = "OutlineSheet.A5:A24";
-const OUString rowLevel4 = "OutlineSheet.A7:A21";
+const OUStringLiteral rowLevel1 = "OutlineSheet.A1:A30";
+const OUStringLiteral rowLevel2 = "OutlineSheet.A3:A27";
static OUString getVisibleAdress(
uno::Reference<sheet::XSpreadsheet> const& xSheet,
@@ -104,14 +102,14 @@ void XSheetOutline::testShowDetail()
aSheetOutline->showDetail(aLevelRangeAddress);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Row level 2 still hidden",
- getVisibleAdress(aSheet, rowLevel2), rowLevel2);
+ getVisibleAdress(aSheet, rowLevel2), OUString(rowLevel2));
// Column Level 2
aLevelRangeAddress = getAddressFromRangeString(aSheet, colLevel2);
aSheetOutline->showDetail(aLevelRangeAddress);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Column level 2 still hidden",
- getVisibleAdress(aSheet, colLevel2), colLevel2);
+ getVisibleAdress(aSheet, colLevel2), OUString(colLevel2));
}
@@ -256,8 +254,8 @@ void XSheetOutline::testClearOutline()
aLevelRangeAddress = getAddressFromRangeString(aSheet, rowLevel1);
aSheetOutline->hideDetail(aLevelRangeAddress);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("testClearOutline Columns are hidden after clear", getVisibleAdress(aSheet, colLevel1), colLevel1);
- CPPUNIT_ASSERT_EQUAL_MESSAGE("testClearOutline Rows are hidden after clear", getVisibleAdress(aSheet, rowLevel1), rowLevel1);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("testClearOutline Columns are hidden after clear", getVisibleAdress(aSheet, colLevel1), OUString(colLevel1));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("testClearOutline Rows are hidden after clear", getVisibleAdress(aSheet, rowLevel1), OUString(rowLevel1));
}
diff --git a/ucb/source/ucp/webdav-neon/DAVProperties.cxx b/ucb/source/ucp/webdav-neon/DAVProperties.cxx
index 5d5634936dca..3d6bb94dc115 100644
--- a/ucb/source/ucp/webdav-neon/DAVProperties.cxx
+++ b/ucb/source/ucp/webdav-neon/DAVProperties.cxx
@@ -32,19 +32,18 @@
using namespace webdav_ucp;
-const OUString DAVProperties::CREATIONDATE("DAV:creationdate");
-const OUString DAVProperties::DISPLAYNAME("DAV:displayname");
-const OUString DAVProperties::GETCONTENTLANGUAGE("DAV:getcontentlanguage");
-const OUString DAVProperties::GETCONTENTLENGTH("DAV:getcontentlength");
-const OUString DAVProperties::GETCONTENTTYPE("DAV:getcontenttype");
-const OUString DAVProperties::GETETAG("DAV:getetag");
-const OUString DAVProperties::GETLASTMODIFIED("DAV:getlastmodified");
-const OUString DAVProperties::LOCKDISCOVERY("DAV:lockdiscovery");
-const OUString DAVProperties::RESOURCETYPE("DAV:resourcetype");
-const OUString DAVProperties::SOURCE("DAV:source");
-const OUString DAVProperties::SUPPORTEDLOCK("DAV:supportedlock");
-
-const OUString DAVProperties::EXECUTABLE("http://apache.org/dav/props/executable");
+const OUStringLiteral DAVProperties::CREATIONDATE("DAV:creationdate");
+const OUStringLiteral DAVProperties::DISPLAYNAME("DAV:displayname");
+const OUStringLiteral DAVProperties::GETCONTENTLANGUAGE("DAV:getcontentlanguage");
+const OUStringLiteral DAVProperties::GETCONTENTLENGTH("DAV:getcontentlength");
+const OUStringLiteral DAVProperties::GETCONTENTTYPE("DAV:getcontenttype");
+const OUStringLiteral DAVProperties::GETETAG("DAV:getetag");
+const OUStringLiteral DAVProperties::GETLASTMODIFIED("DAV:getlastmodified");
+const OUStringLiteral DAVProperties::LOCKDISCOVERY("DAV:lockdiscovery");
+const OUStringLiteral DAVProperties::RESOURCETYPE("DAV:resourcetype");
+const OUStringLiteral DAVProperties::SOURCE("DAV:source");
+const OUStringLiteral DAVProperties::SUPPORTEDLOCK("DAV:supportedlock");
+const OUStringLiteral DAVProperties::EXECUTABLE("http://apache.org/dav/props/executable");
void DAVProperties::createNeonPropName( const OUString & rFullName,
NeonPropName & rName )
@@ -118,18 +117,18 @@ void DAVProperties::createUCBPropName( const char * nspace,
// Some servers send XML without proper namespaces. Assume "DAV:"
// in this case, if name is a well-known dav property name.
// Although this is not 100% correct, it solves many problems.
-
- if ( DAVProperties::RESOURCETYPE.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::SUPPORTEDLOCK.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::LOCKDISCOVERY.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::CREATIONDATE.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::DISPLAYNAME.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::GETCONTENTLANGUAGE.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::GETCONTENTLENGTH.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::GETCONTENTTYPE.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::GETETAG.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::GETLASTMODIFIED.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::SOURCE.matchIgnoreAsciiCase( aName, 4 ) )
+ if ( aName.equalsIgnoreAsciiCaseAscii(DAVProperties::RESOURCETYPE.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::RESOURCETYPE.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::SUPPORTEDLOCK.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::LOCKDISCOVERY.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::CREATIONDATE.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::DISPLAYNAME.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::GETCONTENTLANGUAGE.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::GETCONTENTLENGTH.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::GETCONTENTTYPE.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::GETETAG.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::GETLASTMODIFIED.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::SOURCE.data + 4) )
aNameSpace = "DAV:";
}
diff --git a/ucb/source/ucp/webdav-neon/DAVProperties.hxx b/ucb/source/ucp/webdav-neon/DAVProperties.hxx
index 2064a83b4726..06780e3dbf82 100644
--- a/ucb/source/ucp/webdav-neon/DAVProperties.hxx
+++ b/ucb/source/ucp/webdav-neon/DAVProperties.hxx
@@ -37,18 +37,18 @@ namespace webdav_ucp
struct DAVProperties
{
- static const OUString CREATIONDATE;
- static const OUString DISPLAYNAME;
- static const OUString GETCONTENTLANGUAGE;
- static const OUString GETCONTENTLENGTH;
- static const OUString GETCONTENTTYPE;
- static const OUString GETETAG;
- static const OUString GETLASTMODIFIED;
- static const OUString LOCKDISCOVERY;
- static const OUString RESOURCETYPE;
- static const OUString SOURCE;
- static const OUString SUPPORTEDLOCK;
- static const OUString EXECUTABLE;
+ static const OUStringLiteral CREATIONDATE;
+ static const OUStringLiteral DISPLAYNAME;
+ static const OUStringLiteral GETCONTENTLANGUAGE;
+ static const OUStringLiteral GETCONTENTLENGTH;
+ static const OUStringLiteral GETCONTENTTYPE;
+ static const OUStringLiteral GETETAG;
+ static const OUStringLiteral GETLASTMODIFIED;
+ static const OUStringLiteral LOCKDISCOVERY;
+ static const OUStringLiteral RESOURCETYPE;
+ static const OUStringLiteral SOURCE;
+ static const OUStringLiteral SUPPORTEDLOCK;
+ static const OUStringLiteral EXECUTABLE;
static void createNeonPropName( const OUString & rFullName,
NeonPropName & rName );
diff --git a/vbahelper/source/msforms/vbamultipage.cxx b/vbahelper/source/msforms/vbamultipage.cxx
index a23949ad9dc0..a33840120aff 100644
--- a/vbahelper/source/msforms/vbamultipage.cxx
+++ b/vbahelper/source/msforms/vbamultipage.cxx
@@ -25,7 +25,7 @@
using namespace com::sun::star;
using namespace ooo::vba;
-const OUString SVALUE( "MultiPageValue" );
+const OUStringLiteral SVALUE( "MultiPageValue" );
namespace {
diff --git a/vbahelper/source/msforms/vbaprogressbar.cxx b/vbahelper/source/msforms/vbaprogressbar.cxx
index b6c3513ab7d3..7cf197b808d0 100644
--- a/vbahelper/source/msforms/vbaprogressbar.cxx
+++ b/vbahelper/source/msforms/vbaprogressbar.cxx
@@ -22,7 +22,7 @@ using namespace com::sun::star;
using namespace ooo::vba;
// uno servicename com.sun.star.awt.UnoControlProgressBarMode
-const OUString SVALUE( "ProgressValue" );
+const OUStringLiteral SVALUE( "ProgressValue" );
ScVbaProgressBar::ScVbaProgressBar( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, std::unique_ptr<ov::AbstractGeometryAttributes> pGeomHelper )
: ProgressBarImpl_BASE( xParent, xContext, xControl, xModel, std::move(pGeomHelper) )
diff --git a/vcl/qa/api/XGraphicTest.cxx b/vcl/qa/api/XGraphicTest.cxx
index 4c2a66caf29f..cc4af576e8c8 100644
--- a/vcl/qa/api/XGraphicTest.cxx
+++ b/vcl/qa/api/XGraphicTest.cxx
@@ -22,7 +22,7 @@ namespace
{
using namespace css;
-OUString const gaDataUrl = "/vcl/qa/api/data/";
+OUStringLiteral const gaDataUrl = "/vcl/qa/api/data/";
class XGraphicTest : public test::BootstrapFixture
{
diff --git a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx
index 009a385a7a02..a26fcbcd7291 100644
--- a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx
+++ b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx
@@ -21,7 +21,7 @@
#include <svdata.hxx>
#include <salinst.hxx>
-OUString const gaDataUrl = "/vcl/qa/cppunit/bitmaprender/data/";
+OUStringLiteral const gaDataUrl = "/vcl/qa/cppunit/bitmaprender/data/";
class BitmapRenderTest : public test::BootstrapFixture
{
diff --git a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx
index 8fb4fea50faa..59774337b573 100644
--- a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx
+++ b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx
@@ -13,7 +13,7 @@
#include <bitmapwriteaccess.hxx>
#include <tools/stream.hxx>
-OUString const gaDataUrl("/vcl/qa/cppunit/jpeg/data/");
+OUStringLiteral const gaDataUrl("/vcl/qa/cppunit/jpeg/data/");
class JpegReaderTest : public test::BootstrapFixtureBase
{
diff --git a/vcl/qa/cppunit/jpeg/JpegWriterTest.cxx b/vcl/qa/cppunit/jpeg/JpegWriterTest.cxx
index 1d39fea51488..13b0bbd4373d 100644
--- a/vcl/qa/cppunit/jpeg/JpegWriterTest.cxx
+++ b/vcl/qa/cppunit/jpeg/JpegWriterTest.cxx
@@ -13,7 +13,7 @@
#include <vcl/bitmapaccess.hxx>
#include <tools/stream.hxx>
-OUString const gaDataUrl("/vcl/qa/cppunit/jpeg/data/");
+OUStringLiteral const gaDataUrl("/vcl/qa/cppunit/jpeg/data/");
class JpegWriterTest : public test::BootstrapFixtureBase
{
diff --git a/vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx b/vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx
index 402a0d3db28f..d87b129a7155 100644
--- a/vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx
+++ b/vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx
@@ -16,7 +16,7 @@
namespace
{
-OUString const gaDataUrl("/vcl/qa/cppunit/widgetdraw/data/");
+OUStringLiteral const gaDataUrl("/vcl/qa/cppunit/widgetdraw/data/");
class WidgetDefinitionReaderTest : public test::BootstrapFixtureBase
{
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index 35d0c960cf07..88338abb9cb9 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -962,7 +962,7 @@ void PPDParser::parse( ::std::vector< OString >& rLines )
// ppd_group_t structure. Groups can be specified in the PPD file; if an
// option is not associated with a group, it is put in a "General" or
// "Extra" group depending on the option.
- static const OString aDefaultPPDGroupName("General");
+ static const OStringLiteral aDefaultPPDGroupName("General");
std::vector< OString >::iterator line = rLines.begin();
PPDParser::hash_type::const_iterator keyit;
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 6d44d2db58cf..1da507dfda76 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -85,8 +85,8 @@ using namespace ::xmloff::token;
rtl::Reference< FastTokenHandler > SvXMLImport::xTokenHandler( new FastTokenHandler() );
std::unordered_map< sal_Int32, std::pair< OUString, OUString > > SvXMLImport::aNamespaceMap;
std::unordered_map< OUString, OUString > SvXMLImport::aNamespaceURIPrefixMap;
-const OUString SvXMLImport::aDefaultNamespace = OUString("");
-const OUString SvXMLImport::aNamespaceSeparator = OUString(":");
+const OUStringLiteral SvXMLImport::aDefaultNamespace = "";
+const OUStringLiteral SvXMLImport::aNamespaceSeparator = ":";
bool SvXMLImport::bIsNSMapsInitialized = false;
namespace {
diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx b/xmlscript/source/xml_helper/xml_impctx.cxx
index 53a24429c0de..2d452f09159b 100644
--- a/xmlscript/source/xml_helper/xml_impctx.cxx
+++ b/xmlscript/source/xml_helper/xml_impctx.cxx
@@ -160,8 +160,8 @@ public:
}
-OUString const g_sXMLNS_PREFIX_UNKNOWN( "<<< unknown prefix >>>" );
-OUString const g_sXMLNS( "xmlns" );
+OUStringLiteral const g_sXMLNS_PREFIX_UNKNOWN( "<<< unknown prefix >>>" );
+OUStringLiteral const g_sXMLNS( "xmlns" );
DocumentHandlerImpl::DocumentHandlerImpl(