diff options
194 files changed, 598 insertions, 595 deletions
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index 7d931a70bad4..8942d87f4ae0 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -1209,11 +1209,11 @@ void Shell::SetCurWindow( BaseWindow* pNewWin, bool bUpdateTabBar, bool bRemembe void Shell::ManageToolbars() { - static const OUStringLiteral aMacroBarResName = u"private:resource/toolbar/macrobar"; - static const OUStringLiteral aDialogBarResName = u"private:resource/toolbar/dialogbar"; - static const OUStringLiteral aInsertControlsBarResName + static constexpr OUStringLiteral aMacroBarResName = u"private:resource/toolbar/macrobar"; + static constexpr OUStringLiteral aDialogBarResName = u"private:resource/toolbar/dialogbar"; + static constexpr OUStringLiteral aInsertControlsBarResName = u"private:resource/toolbar/insertcontrolsbar"; - static const OUStringLiteral aFormControlsBarResName + static constexpr OUStringLiteral aFormControlsBarResName = u"private:resource/toolbar/formcontrolsbar"; if( !pCurWin ) diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx index 806b3d8aacae..6dd07a021d32 100644 --- a/basctl/source/basicide/localizationmgr.cxx +++ b/basctl/source/basicide/localizationmgr.cxx @@ -78,7 +78,7 @@ bool LocalizationMgr::isLibraryLocalized () void LocalizationMgr::handleTranslationbar () { - static const OUStringLiteral aToolBarResName = u"private:resource/toolbar/translationbar"; + static constexpr OUStringLiteral aToolBarResName = u"private:resource/toolbar/translationbar"; Reference< beans::XPropertySet > xFrameProps ( m_pShell->GetViewFrame()->GetFrame().GetFrameInterface(), uno::UNO_QUERY ); diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index ced23c5474bc..f99dab40d4c3 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -57,8 +57,8 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::io; -const OUStringLiteral aResourceResolverPropName = u"ResourceResolver"; -const OUStringLiteral aDecorationPropName = u"Decoration"; +constexpr OUStringLiteral aResourceResolverPropName = u"ResourceResolver"; +constexpr OUStringLiteral aDecorationPropName = u"Decoration"; // DlgEdHint diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx index 73e90e2827ac..084395ad2536 100644 --- a/basctl/source/dlged/propbrw.cxx +++ b/basctl/source/dlged/propbrw.cxx @@ -141,7 +141,7 @@ void PropBrw::ImplReCreateController() // create a property browser controller Reference< XMultiComponentFactory > xFactory( xInspectorContext->getServiceManager(), UNO_SET_THROW ); - static const OUStringLiteral s_sControllerServiceName = u"com.sun.star.awt.PropertyBrowserController"; + static constexpr OUStringLiteral s_sControllerServiceName = u"com.sun.star.awt.PropertyBrowserController"; m_xBrowserController.set( xFactory->createInstanceWithContext( s_sControllerServiceName, xInspectorContext ), UNO_QUERY ); if ( !m_xBrowserController.is() ) { diff --git a/basegfx/test/SvgPathImportExport.cxx b/basegfx/test/SvgPathImportExport.cxx index 7fa0468e7042..955c47b239f2 100644 --- a/basegfx/test/SvgPathImportExport.cxx +++ b/basegfx/test/SvgPathImportExport.cxx @@ -116,7 +116,7 @@ public: CPPUNIT_ASSERT_MESSAGE("importing simple rectangle from SVG-D", utils::importFromSvgD( aPoly, aPath0, false, nullptr )); aExport = utils::exportToSvgD( aPoly, true, true, false ); - static const OUStringLiteral sExportString = u"m10 10h-20v-20h20z"; + static constexpr OUStringLiteral sExportString = u"m10 10h-20v-20h20z"; CPPUNIT_ASSERT_EQUAL_MESSAGE("exporting rectangle to SVG-D", OUString(sExportString), aExport ); CPPUNIT_ASSERT_MESSAGE("importing simple rectangle from SVG-D (round-trip", @@ -143,7 +143,7 @@ public: // so for correct unit test i add the new exported string here as sExportStringSimpleBezier // and compare to it. - static const OUStringLiteral sExportStringSimpleBezier = + static constexpr OUStringLiteral sExportStringSimpleBezier = u"m11430 0c-8890 3810 5715 6985 5715 6985" "l-17145-1905c0 0 22860-10160 16510 6350" "s-3810-11430-3810-11430z"; @@ -164,7 +164,7 @@ public: // same here, the corrected export with the corrected B2DPolygon is simply more efficient, // so i needed to change the compare string. Also adding the re-import comparison below. - static const OUStringLiteral sExportString1 = + static constexpr OUStringLiteral sExportString1 = u"m1917 1114c-89-189-233-284-430-284-167 0-306 91-419 273s-170 370-17" "0 564c0 145 33 259 98 342 65 84 150 126 257 126q115.5 0 231-57s147-97 210-176 99-143 109-190c38-199 76-398 114" "-598zm840 1646c-133 73-312 139-537 197-225 57-440 86-644 87-483-1-866-132-1150-392-284-261-426-619-426-1076 0-" @@ -187,7 +187,7 @@ public: CPPUNIT_ASSERT_MESSAGE("importing complex polygon from SVG-D", utils::importFromSvgD( aPoly, aPath3, false, nullptr )); aExport = utils::exportToSvgD( aPoly, true, true, false ); - static const OUStringLiteral sExportString2 = + static constexpr OUStringLiteral sExportString2 = u"m1598 125h306v2334h-306v-1105h-1293v1105h-305v-2334h305v973h1293" "zm2159 1015 78-44 85 235-91 47-91 40-90 34-90 29-89 21-88 16-88 10-88 3-102-4-97" "-12-91-19-85-26-40-16-39-18-38-20-36-22-34-24-33-26-32-27-30-30-29-31-27-33-25-3" @@ -220,7 +220,7 @@ public: utils::createPolygonFromRect( B2DRange(0.0,0.0,4000.0,4000.0) )); aExport = utils::exportToSvgD( B2DPolyPolygon(aRect), false, false, false ); - static const OUStringLiteral sExportStringRect = u"M0 0H4000V4000H0Z"; + static constexpr OUStringLiteral sExportStringRect = u"M0 0H4000V4000H0Z"; CPPUNIT_ASSERT_EQUAL_MESSAGE("exporting to rectangle svg-d string", OUString(sExportStringRect), aExport); } diff --git a/basegfx/test/boxclipper.cxx b/basegfx/test/boxclipper.cxx index cca5cabf3766..8aaa45be9fbc 100644 --- a/basegfx/test/boxclipper.cxx +++ b/basegfx/test/boxclipper.cxx @@ -155,7 +155,7 @@ public: aRandomIntersections.appendElement( aRandomRange, B2VectorOrientation::Negative ); } #else - static const OUStringLiteral randomSvg=u"m394 783h404v57h-404zm-197-505h571v576h-571zm356-634h75v200h-75zm-40-113h403v588h-403zm93-811h111v494h-111zm-364-619h562v121h-562zm-134-8h292v27h-292zm110 356h621v486h-621zm78-386h228v25h-228zm475-345h201v201h-201zm-2-93h122v126h-122zm-417-243h567v524h-567zm-266-738h863v456h-863zm262-333h315v698h-315zm-328-826h43v393h-43zm830-219h120v664h-120zm-311-636h221v109h-221zm-500 137h628v19h-628zm681-94h211v493h-211zm-366-646h384v355h-384zm-189-199h715v247h-715zm165-459h563v601h-563zm258-479h98v606h-98zm270-517h65v218h-65zm-44-259h96v286h-96zm-599-202h705v468h-705zm216-803h450v494h-450zm-150-22h26v167h-26zm-55-599h50v260h-50zm190-278h490v387h-490zm-290-453h634v392h-634zm257 189h552v300h-552zm-151-690h136v455h-136zm12-597h488v432h-488zm501-459h48v39h-48zm-224-112h429v22h-429zm-281 102h492v621h-492zm519-158h208v17h-208zm-681-563h56v427h-56zm126-451h615v392h-615zm-47-410h598v522h-598zm-32 316h79v110h-79zm-71-129h18v127h-18zm126-993h743v589h-743zm211-430h428v750h-428zm61-554h100v220h-100zm-353-49h658v157h-658zm778-383h115v272h-115zm-249-541h119v712h-119zm203 86h94v40h-94z"; + static constexpr OUStringLiteral randomSvg=u"m394 783h404v57h-404zm-197-505h571v576h-571zm356-634h75v200h-75zm-40-113h403v588h-403zm93-811h111v494h-111zm-364-619h562v121h-562zm-134-8h292v27h-292zm110 356h621v486h-621zm78-386h228v25h-228zm475-345h201v201h-201zm-2-93h122v126h-122zm-417-243h567v524h-567zm-266-738h863v456h-863zm262-333h315v698h-315zm-328-826h43v393h-43zm830-219h120v664h-120zm-311-636h221v109h-221zm-500 137h628v19h-628zm681-94h211v493h-211zm-366-646h384v355h-384zm-189-199h715v247h-715zm165-459h563v601h-563zm258-479h98v606h-98zm270-517h65v218h-65zm-44-259h96v286h-96zm-599-202h705v468h-705zm216-803h450v494h-450zm-150-22h26v167h-26zm-55-599h50v260h-50zm190-278h490v387h-490zm-290-453h634v392h-634zm257 189h552v300h-552zm-151-690h136v455h-136zm12-597h488v432h-488zm501-459h48v39h-48zm-224-112h429v22h-429zm-281 102h492v621h-492zm519-158h208v17h-208zm-681-563h56v427h-56zm126-451h615v392h-615zm-47-410h598v522h-598zm-32 316h79v110h-79zm-71-129h18v127h-18zm126-993h743v589h-743zm211-430h428v750h-428zm61-554h100v220h-100zm-353-49h658v157h-658zm778-383h115v272h-115zm-249-541h119v712h-119zm203 86h94v40h-94z"; B2DPolyPolygon randomPoly; CPPUNIT_ASSERT(utils::importFromSvgD(randomPoly, randomSvg, false, nullptr)); for (auto const& aPolygon : randomPoly) diff --git a/basegfx/test/clipstate.cxx b/basegfx/test/clipstate.cxx index 94c0246d8312..94cb6b3a2920 100644 --- a/basegfx/test/clipstate.cxx +++ b/basegfx/test/clipstate.cxx @@ -127,7 +127,7 @@ public: { utils::B2DClipState aMixedClip; - static const OUStringLiteral unionSvg=u"m100 10v90h-90v10h-20v-10h-90v-90h-10v-20h10v-90h90v-10h20v10h90v90h10v20z"; + static constexpr OUStringLiteral unionSvg=u"m100 10v90h-90v10h-20v-10h-90v-90h-10v-20h10v-90h90v-10h20v10h90v90h10v20z"; B2DPolyPolygon aTmp1; CPPUNIT_ASSERT(utils::importFromSvgD(aTmp1, unionSvg, false, nullptr)); diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index a3cf5b9e3ccf..03b951ffc02d 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -84,12 +84,12 @@ typedef WeakImplHelper< script::XStarBasicAccess > StarBasicAccessHelper; // Version 2 // + bool bReference -const OUStringLiteral szStdLibName = u"Standard"; -const OUStringLiteral szBasicStorage = u"StarBASIC"; -const OUStringLiteral szOldManagerStream = u"BasicManager"; -const OUStringLiteral szManagerStream = u"BasicManager2"; -const OUStringLiteral szImbedded = u"LIBIMBEDDED"; -const OStringLiteral szCryptingKey = "CryptedBasic"; +constexpr OUStringLiteral szStdLibName = u"Standard"; +constexpr OUStringLiteral szBasicStorage = u"StarBASIC"; +constexpr OUStringLiteral szOldManagerStream = u"BasicManager"; +constexpr OUStringLiteral szManagerStream = u"BasicManager2"; +constexpr OUStringLiteral szImbedded = u"LIBIMBEDDED"; +constexpr OStringLiteral szCryptingKey = "CryptedBasic"; const StreamMode eStreamReadMode = StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYALL; diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index aecf2f7f9a3d..87cef46cffbe 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -1786,7 +1786,7 @@ void removeDimAsNewRecoverItem( SbxVariable* pVar ) // saving object variable // not-object variables will cause errors -const OUStringLiteral pCollectionStr = u"Collection"; +constexpr OUStringLiteral pCollectionStr = u"Collection"; void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, bool bHandleDefaultProp ) { diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index a8e124616910..13055cb130e1 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -342,8 +342,8 @@ SfxLibraryContainer* SfxDialogLibraryContainer::createInstanceImpl() return new SfxDialogLibraryContainer(); } -const OUStringLiteral aResourceFileNameBase = u"DialogStrings"; -const OUStringLiteral aResourceFileCommentBase = u"# Strings for Dialog Library "; +constexpr OUStringLiteral aResourceFileNameBase = u"DialogStrings"; +constexpr OUStringLiteral aResourceFileCommentBase = u"# Strings for Dialog Library "; // Resource handling Reference< css::resource::XStringResourcePersistence > diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx index 3b48c7907a4c..8551915d9c88 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx @@ -60,7 +60,7 @@ WrappedScaleTextProperty::WrappedScaleTextProperty(const std::shared_ptr<Chart2M void WrappedScaleTextProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const { - static const OUStringLiteral aRefSizeName = u"ReferencePageSize"; + static constexpr OUStringLiteral aRefSizeName = u"ReferencePageSize"; if( !xInnerPropertySet.is() ) return; diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx index 91e299d4906d..aea893a66ffa 100644 --- a/chart2/source/controller/main/ElementSelector.cxx +++ b/chart2/source/controller/main/ElementSelector.cxx @@ -48,7 +48,7 @@ using ::com::sun::star::uno::Sequence; namespace { -const OUStringLiteral lcl_aServiceName +constexpr OUStringLiteral lcl_aServiceName = u"com.sun.star.comp.chart.ElementSelectorToolbarController"; } diff --git a/chart2/source/model/main/CartesianCoordinateSystem.cxx b/chart2/source/model/main/CartesianCoordinateSystem.cxx index f8cc8f17ad88..c65adee25829 100644 --- a/chart2/source/model/main/CartesianCoordinateSystem.cxx +++ b/chart2/source/model/main/CartesianCoordinateSystem.cxx @@ -31,7 +31,7 @@ namespace com::sun::star::uno { class XComponentContext; } namespace { -const OUStringLiteral CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME = u"com.sun.star.chart2.CoordinateSystems.Cartesian"; +constexpr OUStringLiteral CHART2_COOSYSTEM_CARTESIAN_SERVICE_NAME = u"com.sun.star.chart2.CoordinateSystems.Cartesian"; } diff --git a/chart2/source/model/main/PolarCoordinateSystem.cxx b/chart2/source/model/main/PolarCoordinateSystem.cxx index 2d2497bc23c9..5c891989e37f 100644 --- a/chart2/source/model/main/PolarCoordinateSystem.cxx +++ b/chart2/source/model/main/PolarCoordinateSystem.cxx @@ -31,7 +31,7 @@ using ::com::sun::star::uno::Sequence; namespace { -const OUStringLiteral CHART2_COOSYSTEM_POLAR_SERVICE_NAME +constexpr OUStringLiteral CHART2_COOSYSTEM_POLAR_SERVICE_NAME = u"com.sun.star.chart2.CoordinateSystems.Polar"; } diff --git a/chart2/source/tools/CachedDataSequence.cxx b/chart2/source/tools/CachedDataSequence.cxx index dc44985589cc..6c8826701779 100644 --- a/chart2/source/tools/CachedDataSequence.cxx +++ b/chart2/source/tools/CachedDataSequence.cxx @@ -42,7 +42,7 @@ using ::chart::impl::CachedDataSequence_Base; namespace { -const OUStringLiteral lcl_aServiceName = u"com.sun.star.comp.chart.CachedDataSequence"; +constexpr OUStringLiteral lcl_aServiceName = u"com.sun.star.comp.chart.CachedDataSequence"; enum { diff --git a/chart2/source/tools/ConfigColorScheme.cxx b/chart2/source/tools/ConfigColorScheme.cxx index 466e26ae88b3..50d72a88207e 100644 --- a/chart2/source/tools/ConfigColorScheme.cxx +++ b/chart2/source/tools/ConfigColorScheme.cxx @@ -34,7 +34,7 @@ using ::com::sun::star::uno::Sequence; namespace { -const OUStringLiteral aSeriesPropName = u"Series"; +constexpr OUStringLiteral aSeriesPropName = u"Series"; } // anonymous namespace diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx index 6dd803093365..d894b16a3ff4 100644 --- a/chart2/source/tools/ErrorBar.cxx +++ b/chart2/source/tools/ErrorBar.cxx @@ -41,7 +41,7 @@ using namespace ::com::sun::star; namespace { -const OUStringLiteral lcl_aServiceName = u"com.sun.star.comp.chart2.ErrorBar"; +constexpr OUStringLiteral lcl_aServiceName = u"com.sun.star.comp.chart2.ErrorBar"; bool lcl_isInternalData( const uno::Reference< chart2::data::XLabeledDataSequence > & xLSeq ) { diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx index abc3aea59d8f..f1bf987fa2c6 100644 --- a/chart2/source/tools/InternalDataProvider.cxx +++ b/chart2/source/tools/InternalDataProvider.cxx @@ -57,12 +57,12 @@ namespace chart namespace { -const OUStringLiteral lcl_aCategoriesRangeName = u"categories"; +constexpr OUStringLiteral lcl_aCategoriesRangeName = u"categories"; const char lcl_aCategoriesLevelRangeNamePrefix[] = "categoriesL "; //L <-> level const char lcl_aCategoriesPointRangeNamePrefix[] = "categoriesP "; //P <-> point -const OUStringLiteral lcl_aCategoriesRoleName = u"categories"; +constexpr OUStringLiteral lcl_aCategoriesRoleName = u"categories"; const char lcl_aLabelRangePrefix[] = "label "; -const OUStringLiteral lcl_aCompleteRange = u"all"; +constexpr OUStringLiteral lcl_aCompleteRange = u"all"; typedef std::multimap< OUString, uno::WeakReference< chart2::data::XDataSequence > > lcl_tSequenceMap; diff --git a/chart2/source/tools/ReferenceSizeProvider.cxx b/chart2/source/tools/ReferenceSizeProvider.cxx index 8e254903929e..b5b928e9e843 100644 --- a/chart2/source/tools/ReferenceSizeProvider.cxx +++ b/chart2/source/tools/ReferenceSizeProvider.cxx @@ -131,7 +131,7 @@ void ReferenceSizeProvider::setValuesAtPropertySet( if( ! xProp.is()) return; - static const OUStringLiteral aRefSizeName = u"ReferencePageSize"; + static constexpr OUStringLiteral aRefSizeName = u"ReferencePageSize"; try { diff --git a/chart2/source/tools/Scaling.cxx b/chart2/source/tools/Scaling.cxx index b61886c643e8..e10757928a99 100644 --- a/chart2/source/tools/Scaling.cxx +++ b/chart2/source/tools/Scaling.cxx @@ -27,10 +27,10 @@ namespace com::sun::star::uno { class XComponentContext; } namespace { -const OUStringLiteral lcl_aServiceName_Logarithmic = u"com.sun.star.chart2.LogarithmicScaling"; -const OUStringLiteral lcl_aServiceName_Exponential = u"com.sun.star.chart2.ExponentialScaling"; -const OUStringLiteral lcl_aServiceName_Linear = u"com.sun.star.chart2.LinearScaling"; -const OUStringLiteral lcl_aServiceName_Power = u"com.sun.star.chart2.PowerScaling"; +constexpr OUStringLiteral lcl_aServiceName_Logarithmic = u"com.sun.star.chart2.LogarithmicScaling"; +constexpr OUStringLiteral lcl_aServiceName_Exponential = u"com.sun.star.chart2.ExponentialScaling"; +constexpr OUStringLiteral lcl_aServiceName_Linear = u"com.sun.star.chart2.LinearScaling"; +constexpr OUStringLiteral lcl_aServiceName_Power = u"com.sun.star.chart2.PowerScaling"; } diff --git a/chart2/source/tools/UncachedDataSequence.cxx b/chart2/source/tools/UncachedDataSequence.cxx index bdffa24a458d..fee4af622126 100644 --- a/chart2/source/tools/UncachedDataSequence.cxx +++ b/chart2/source/tools/UncachedDataSequence.cxx @@ -41,7 +41,7 @@ using ::chart::impl::UncachedDataSequence_Base; namespace { -const OUStringLiteral lcl_aServiceName = u"com.sun.star.comp.chart.UncachedDataSequence"; +constexpr OUStringLiteral lcl_aServiceName = u"com.sun.star.comp.chart.UncachedDataSequence"; enum { diff --git a/chart2/source/view/axes/DateScaling.cxx b/chart2/source/view/axes/DateScaling.cxx index b5a690e203aa..a926b5a43c51 100644 --- a/chart2/source/view/axes/DateScaling.cxx +++ b/chart2/source/view/axes/DateScaling.cxx @@ -25,8 +25,8 @@ namespace { -const OUStringLiteral lcl_aServiceName_DateScaling = u"com.sun.star.chart2.DateScaling"; -const OUStringLiteral lcl_aServiceName_InverseDateScaling +constexpr OUStringLiteral lcl_aServiceName_DateScaling = u"com.sun.star.chart2.DateScaling"; +constexpr OUStringLiteral lcl_aServiceName_InverseDateScaling = u"com.sun.star.chart2.InverseDateScaling"; const double lcl_fNumberOfMonths = 12.0;//todo: this needs to be offered by basic tools Date class if it should be more generic diff --git a/comphelper/source/misc/numberedcollection.cxx b/comphelper/source/misc/numberedcollection.cxx index 20ed2cc43d9d..9df6a878794b 100644 --- a/comphelper/source/misc/numberedcollection.cxx +++ b/comphelper/source/misc/numberedcollection.cxx @@ -24,7 +24,7 @@ namespace comphelper{ -const OUStringLiteral ERRMSG_INVALID_COMPONENT_PARAM = u"NULL as component reference not allowed."; +constexpr OUStringLiteral ERRMSG_INVALID_COMPONENT_PARAM = u"NULL as component reference not allowed."; NumberedCollection::NumberedCollection() diff --git a/connectivity/source/commontools/conncleanup.cxx b/connectivity/source/commontools/conncleanup.cxx index f1d80581ff5a..210c618d6a60 100644 --- a/connectivity/source/commontools/conncleanup.cxx +++ b/connectivity/source/commontools/conncleanup.cxx @@ -35,7 +35,7 @@ namespace dbtools using namespace css::sdbc; using namespace css::lang; - const OUStringLiteral ACTIVE_CONNECTION_PROPERTY_NAME = u"ActiveConnection"; + constexpr OUStringLiteral ACTIVE_CONNECTION_PROPERTY_NAME = u"ActiveConnection"; OAutoConnectionDisposer::OAutoConnectionDisposer(const Reference< XRowSet >& _rxRowSet, const Reference< XConnection >& _rxConnection) :m_xRowSet( _rxRowSet ) diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index f96e66e62c7e..cd9f2c9fc48f 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -917,7 +917,7 @@ Reference< XNumberFormatsSupplier> getNumberFormats( // ask the parent of the connection (should be a DatabaseAccess) Reference< XNumberFormatsSupplier> xReturn; Reference< XChild> xConnAsChild(_rxConn, UNO_QUERY); - static const OUStringLiteral sPropFormatsSupplier( u"NumberFormatsSupplier" ); + static constexpr OUStringLiteral sPropFormatsSupplier( u"NumberFormatsSupplier" ); if (xConnAsChild.is()) { Reference< XPropertySet> xConnParentProps(xConnAsChild->getParent(), UNO_QUERY); @@ -952,20 +952,20 @@ try Property* pNewProps = aNewProperties.getArray(); - static const OUStringLiteral sPropFormatsSupplier(u"FormatsSupplier"); - static const OUStringLiteral sPropCurrencySymbol(u"CurrencySymbol"); - static const OUStringLiteral sPropDecimals(u"Decimals"); - static const OUStringLiteral sPropEffectiveMin(u"EffectiveMin"); - static const OUStringLiteral sPropEffectiveMax(u"EffectiveMax"); - static const OUStringLiteral sPropEffectiveDefault(u"EffectiveDefault"); - static const OUStringLiteral sPropDefaultText(u"DefaultText"); - static const OUStringLiteral sPropDefaultDate(u"DefaultDate"); - static const OUStringLiteral sPropDefaultTime(u"DefaultTime"); - static const OUStringLiteral sPropValueMin(u"ValueMin"); - static const OUStringLiteral sPropValueMax(u"ValueMax"); - static const OUStringLiteral sPropDecimalAccuracy(u"DecimalAccuracy"); - static const OUStringLiteral sPropClassId(u"ClassId"); - static const OUStringLiteral sFormattedServiceName( u"com.sun.star.form.component.FormattedField" ); + static constexpr OUStringLiteral sPropFormatsSupplier(u"FormatsSupplier"); + static constexpr OUStringLiteral sPropCurrencySymbol(u"CurrencySymbol"); + static constexpr OUStringLiteral sPropDecimals(u"Decimals"); + static constexpr OUStringLiteral sPropEffectiveMin(u"EffectiveMin"); + static constexpr OUStringLiteral sPropEffectiveMax(u"EffectiveMax"); + static constexpr OUStringLiteral sPropEffectiveDefault(u"EffectiveDefault"); + static constexpr OUStringLiteral sPropDefaultText(u"DefaultText"); + static constexpr OUStringLiteral sPropDefaultDate(u"DefaultDate"); + static constexpr OUStringLiteral sPropDefaultTime(u"DefaultTime"); + static constexpr OUStringLiteral sPropValueMin(u"ValueMin"); + static constexpr OUStringLiteral sPropValueMax(u"ValueMax"); + static constexpr OUStringLiteral sPropDecimalAccuracy(u"DecimalAccuracy"); + static constexpr OUStringLiteral sPropClassId(u"ClassId"); + static constexpr OUStringLiteral sFormattedServiceName( u"com.sun.star.form.component.FormattedField" ); for (const Property& rOldProp : aOldProperties) { diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index a57ca9749770..01cdcc03aa76 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -1014,7 +1014,7 @@ bool isAggregateColumn( const Reference< XPropertySet > &_xColumn ) { bool bAgg(false); - static const OUStringLiteral sAgg = u"AggregateFunction"; + static constexpr OUStringLiteral sAgg = u"AggregateFunction"; if ( _xColumn->getPropertySetInfo()->hasPropertyByName(sAgg) ) _xColumn->getPropertyValue(sAgg) >>= bAgg; diff --git a/connectivity/source/cpool/ZConnectionPool.cxx b/connectivity/source/cpool/ZConnectionPool.cxx index c0b034814deb..2917ce019700 100644 --- a/connectivity/source/cpool/ZConnectionPool.cxx +++ b/connectivity/source/cpool/ZConnectionPool.cxx @@ -41,7 +41,7 @@ void SAL_CALL OPoolTimer::onShot() m_pPool->invalidatePooledConnections(); } -const OUStringLiteral TIMEOUT_NODENAME = u"Timeout"; +constexpr OUStringLiteral TIMEOUT_NODENAME = u"Timeout"; OConnectionPool::OConnectionPool(const Reference< XDriver >& _xDriver, const Reference< XInterface >& _xDriverNode, diff --git a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx index 4c9446348681..7f196bed35e7 100644 --- a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx +++ b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx @@ -40,7 +40,7 @@ OEvoabResultSetMetaData::~OEvoabResultSetMetaData() void OEvoabResultSetMetaData::setEvoabFields(const ::rtl::Reference<connectivity::OSQLColumns> &xColumns) { - static const OUStringLiteral aName = u"Name"; + static constexpr OUStringLiteral aName = u"Name"; for (const auto& rxColumn : *xColumns) { diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx index 6a247ee8f41e..2fffb76f78e3 100644 --- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx +++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx @@ -165,7 +165,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables( // check if any type is given // when no types are given then we have to return all tables e.g. TABLE - static const OUStringLiteral aTable = u"TABLE"; + static constexpr OUStringLiteral aTable = u"TABLE"; bool bTableFound = true; sal_Int32 nLength = types.getLength(); diff --git a/connectivity/source/drivers/firebird/Driver.cxx b/connectivity/source/drivers/firebird/Driver.cxx index 6adeb7207ecf..55e149e9de5c 100644 --- a/connectivity/source/drivers/firebird/Driver.cxx +++ b/connectivity/source/drivers/firebird/Driver.cxx @@ -45,11 +45,11 @@ using namespace connectivity::firebird; // Static const variables namespace { -const OUStringLiteral our_sFirebirdTmpVar = u"FIREBIRD_TMP"; -const OUStringLiteral our_sFirebirdLockVar = u"FIREBIRD_LOCK"; -const OUStringLiteral our_sFirebirdMsgVar = u"FIREBIRD_MSG"; +constexpr OUStringLiteral our_sFirebirdTmpVar = u"FIREBIRD_TMP"; +constexpr OUStringLiteral our_sFirebirdLockVar = u"FIREBIRD_LOCK"; +constexpr OUStringLiteral our_sFirebirdMsgVar = u"FIREBIRD_MSG"; #ifdef MACOSX -const OUStringLiteral our_sFirebirdLibVar = u"LIBREOFFICE_FIREBIRD_LIB"; +constexpr OUStringLiteral our_sFirebirdLibVar = u"LIBREOFFICE_FIREBIRD_LIB"; #endif }; diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx index cf0b549b11aa..e3cd11cabb90 100644 --- a/connectivity/source/drivers/jdbc/JConnection.cxx +++ b/connectivity/source/drivers/jdbc/JConnection.cxx @@ -699,7 +699,7 @@ void java_sql_Connection::loadDriverFromProperties( const OUString& _sDriverClas OUString java_sql_Connection::impl_getJavaDriverClassPath_nothrow(const OUString& _sDriverClass) { - static const OUStringLiteral s_sNodeName + static constexpr OUStringLiteral s_sNodeName = u"org.openoffice.Office.DataAccess/JDBC/DriverClassPaths"; ::utl::OConfigurationTreeRoot aNamesRoot = ::utl::OConfigurationTreeRoot::createWithComponentContext( m_pDriver->getContext(), s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY); diff --git a/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx b/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx index bc88b2360bd8..540e333aa639 100644 --- a/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx +++ b/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx @@ -739,7 +739,7 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTableTypes( ) static ODatabaseMetaDataResultSet::ORows aRows = [&] { - static const OUStringLiteral aTable = u"TABLE"; + static constexpr OUStringLiteral aTable = u"TABLE"; ODatabaseMetaDataResultSet::ORows tmp; ODatabaseMetaDataResultSet::ORow aRow(2); aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue(); @@ -925,7 +925,7 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTables( // check whether we have tables in the requested types // for the moment, we answer only the "TABLE" table type // when no types are given at all, we return all the tables - static const OUStringLiteral aTable = u"TABLE"; + static constexpr OUStringLiteral aTable = u"TABLE"; bool bTableFound = false; const OUString* p = types.getConstArray(), * pEnd = p + types.getLength(); diff --git a/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx b/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx index eed17c553a72..d0ed7298f92b 100644 --- a/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx +++ b/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx @@ -43,7 +43,7 @@ MacabResultSetMetaData::~MacabResultSetMetaData() void MacabResultSetMetaData::setMacabFields(const ::rtl::Reference<connectivity::OSQLColumns> &xColumns) { - static const OUStringLiteral aName = u"Name"; + static constexpr OUStringLiteral aName = u"Name"; MacabRecords *aRecords; MacabHeader *aHeader; diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx index 28cb14faa981..777f4712ce96 100644 --- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx +++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx @@ -1090,9 +1090,9 @@ void ODatabaseMetaDataResultSet::openSpecialColumns(bool _bRowVer,const Any& cat // E.g. psqlodbc up to at least version 09.01.0100 segfaults if (table.empty()) { - static const OUStringLiteral errMsg + static constexpr OUStringLiteral errMsg = u"ODBC: Trying to get special columns of empty table name"; - static const OUStringLiteral SQLState = u"HY009"; + static constexpr OUStringLiteral SQLState = u"HY009"; throw SQLException( errMsg, *this, SQLState, -1, Any() ); } diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index 9f860327757c..766dcf3b8198 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -264,7 +264,7 @@ namespace { OUString sComposedName; - static const OUStringLiteral s_sWildcard = u"%" ; + static constexpr OUStringLiteral s_sWildcard = u"%" ; // we want all catalogues, all schemas, all tables Sequence< OUString > sTableTypes(3); diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index e7aa9c83f29d..a8e780a6b008 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -65,9 +65,9 @@ using namespace css; -const OUStringLiteral FOLDERNAME_UICONFIG = u"Configurations2"; +constexpr OUStringLiteral FOLDERNAME_UICONFIG = u"Configurations2"; -const OUStringLiteral MEDIATYPE_PROPNAME = u"MediaType"; +constexpr OUStringLiteral MEDIATYPE_PROPNAME = u"MediaType"; const sal_uInt16 KEYCODE_ARRAY[] = { KEY_F1, KEY_F2, diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index 6c81c18fb573..4d17928b3b39 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -74,7 +74,7 @@ const char CMDURL_STYLEPROT_ONLY[] = ".uno:StyleApply?"; const char CMDURL_SPART_ONLY [] = "Style:string="; const char CMDURL_FPART_ONLY [] = "FamilyName:string="; -const OUStringLiteral STYLEPROP_UINAME = u"DisplayName"; +constexpr OUStringLiteral STYLEPROP_UINAME = u"DisplayName"; OUString SfxStylesInfo_Impl::generateCommand( std::u16string_view sFamily, std::u16string_view sStyle) diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index eae624c7e0db..aa2ccd0767c1 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -709,7 +709,7 @@ void TPGalleryThemeProperties::FillFilterList() #if HAVE_FEATURE_AVMEDIA // media filters - static const OUStringLiteral aWildcard = u"*."; + static constexpr OUStringLiteral aWildcard = u"*."; ::avmedia::FilterNameVector aFilters= ::avmedia::MediaWindow::getMediaFilters(); for(const std::pair<OUString,OUString> & aFilter : aFilters) diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx index 32e19e3bd774..ecefed6578d6 100644 --- a/cui/source/inc/cfg.hxx +++ b/cui/source/inc/cfg.hxx @@ -43,18 +43,18 @@ #define notebookbarTabScope "notebookbarTabScope" const char ITEM_DESCRIPTOR_COMMANDURL[] = "CommandURL"; -inline const OUStringLiteral ITEM_DESCRIPTOR_CONTAINER = u"ItemDescriptorContainer"; +inline constexpr OUStringLiteral ITEM_DESCRIPTOR_CONTAINER = u"ItemDescriptorContainer"; const char ITEM_DESCRIPTOR_LABEL[] = "Label"; const char ITEM_DESCRIPTOR_TYPE[] = "Type"; const char ITEM_DESCRIPTOR_STYLE[] = "Style"; const char ITEM_DESCRIPTOR_ISVISIBLE[] = "IsVisible"; const char ITEM_DESCRIPTOR_RESOURCEURL[] = "ResourceURL"; -inline const OUStringLiteral ITEM_DESCRIPTOR_UINAME = u"UIName"; +inline constexpr OUStringLiteral ITEM_DESCRIPTOR_UINAME = u"UIName"; -inline const OUStringLiteral ITEM_MENUBAR_URL = u"private:resource/menubar/menubar"; +inline constexpr OUStringLiteral ITEM_MENUBAR_URL = u"private:resource/menubar/menubar"; constexpr char16_t ITEM_TOOLBAR_URL[] = u"private:resource/toolbar/"; -inline const OUStringLiteral CUSTOM_TOOLBAR_STR = u"custom_toolbar_"; +inline constexpr OUStringLiteral CUSTOM_TOOLBAR_STR = u"custom_toolbar_"; const char aMenuSeparatorStr[] = " | "; diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx index c16a533bbf9e..962cf1fc2e0a 100644 --- a/cui/source/options/optasian.cxx +++ b/cui/source/options/optasian.cxx @@ -43,8 +43,8 @@ using namespace com::sun::star::i18n; using namespace com::sun::star::frame; using namespace com::sun::star::beans; -const OUStringLiteral cIsKernAsianPunctuation = u"IsKernAsianPunctuation"; -const OUStringLiteral cCharacterCompressionType = u"CharacterCompressionType"; +constexpr OUStringLiteral cIsKernAsianPunctuation = u"IsKernAsianPunctuation"; +constexpr OUStringLiteral cCharacterCompressionType = u"CharacterCompressionType"; namespace { diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 21d46a879e36..f15171e38103 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1019,11 +1019,11 @@ struct LanguageConfig_Impl static bool bLanguageCurrentDoc_Impl = false; // some things we'll need... -const OUStringLiteral sAccessSrvc = u"com.sun.star.configuration.ConfigurationAccess"; -const OUStringLiteral sAccessUpdSrvc = u"com.sun.star.configuration.ConfigurationUpdateAccess"; -const OUStringLiteral sInstalledLocalesPath = u"org.openoffice.Setup/Office/InstalledLocales"; -const OUStringLiteral sUserLocalePath = u"org.openoffice.Office.Linguistic/General"; -const OUStringLiteral sUserLocaleKey = u"UILocale"; +constexpr OUStringLiteral sAccessSrvc = u"com.sun.star.configuration.ConfigurationAccess"; +constexpr OUStringLiteral sAccessUpdSrvc = u"com.sun.star.configuration.ConfigurationUpdateAccess"; +constexpr OUStringLiteral sInstalledLocalesPath = u"org.openoffice.Setup/Office/InstalledLocales"; +constexpr OUStringLiteral sUserLocalePath = u"org.openoffice.Office.Linguistic/General"; +constexpr OUStringLiteral sUserLocaleKey = u"UILocale"; static Sequence< OUString > seqInstalledLanguages; static OUString lcl_getDatePatternsConfigString( const LocaleDataWrapper& rLocaleWrapper ) diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 5e2df9189d7a..f8648bac62a4 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -93,14 +93,14 @@ IMPL_LINK(SvxProxyTabPage, PortChangedHdl, weld::Entry&, rEdit, void) } } -const OUStringLiteral g_aProxyModePN = u"ooInetProxyType"; -const OUStringLiteral g_aHttpProxyPN = u"ooInetHTTPProxyName"; -const OUStringLiteral g_aHttpPortPN = u"ooInetHTTPProxyPort"; -const OUStringLiteral g_aHttpsProxyPN = u"ooInetHTTPSProxyName"; -const OUStringLiteral g_aHttpsPortPN = u"ooInetHTTPSProxyPort"; -const OUStringLiteral g_aFtpProxyPN = u"ooInetFTPProxyName"; -const OUStringLiteral g_aFtpPortPN = u"ooInetFTPProxyPort"; -const OUStringLiteral g_aNoProxyDescPN = u"ooInetNoProxy"; +constexpr OUStringLiteral g_aProxyModePN = u"ooInetProxyType"; +constexpr OUStringLiteral g_aHttpProxyPN = u"ooInetHTTPProxyName"; +constexpr OUStringLiteral g_aHttpPortPN = u"ooInetHTTPProxyPort"; +constexpr OUStringLiteral g_aHttpsProxyPN = u"ooInetHTTPSProxyName"; +constexpr OUStringLiteral g_aHttpsPortPN = u"ooInetHTTPSProxyPort"; +constexpr OUStringLiteral g_aFtpProxyPN = u"ooInetFTPProxyName"; +constexpr OUStringLiteral g_aFtpPortPN = u"ooInetFTPProxyPort"; +constexpr OUStringLiteral g_aNoProxyDescPN = u"ooInetNoProxy"; IMPL_STATIC_LINK(SvxProxyTabPage, NumberOnlyTextFilterHdl, OUString&, rTest, bool) { diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx index 74b522a4b459..1b08eb8fa7ca 100644 --- a/dbaccess/source/core/api/FilteredContainer.cxx +++ b/dbaccess/source/core/api/FilteredContainer.cxx @@ -343,7 +343,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std:: } } - static const OUStringLiteral sAll = u"%"; + static constexpr OUStringLiteral sAll = u"%"; Reference< XResultSet > xTables = m_xMetaData->getTables( Any(), sAll, sAll, aTableTypeFilter ); Reference< XRow > xCurrentRow( xTables, UNO_QUERY_THROW ); diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index b5a789fad212..21d0d3012077 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -311,7 +311,7 @@ namespace } } -const OUStringLiteral sPictures = u"Pictures"; +constexpr OUStringLiteral sPictures = u"Pictures"; // base documents seem to have a different behaviour to other documents, the // root storage contents at least seem to be re-used over different saves, thus if there is a diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index f317bd474c38..2098f513f343 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -266,7 +266,7 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL DatabaseDataProvider::cre osl::MutexGuard g(m_aMutex); uno::Reference< chart2::data::XDataSequence > xData = m_xInternal->createDataSequenceByRangeRepresentation(_sRangeRepresentation); uno::Reference<beans::XPropertySet> xProp(xData,uno::UNO_QUERY); - static const OUStringLiteral s_sNumberFormatKey = u"NumberFormatKey"; + static constexpr OUStringLiteral s_sNumberFormatKey = u"NumberFormatKey"; if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(s_sNumberFormatKey) ) { xProp->setPropertyValue(s_sNumberFormatKey,impl_getNumberFormatKey_nothrow(_sRangeRepresentation)); diff --git a/dbaccess/source/core/recovery/dbdocrecovery.cxx b/dbaccess/source/core/recovery/dbdocrecovery.cxx index d111aa86b6cf..db7bb53bd53c 100644 --- a/dbaccess/source/core/recovery/dbdocrecovery.cxx +++ b/dbaccess/source/core/recovery/dbdocrecovery.cxx @@ -86,9 +86,9 @@ namespace dbaccess return true; } - const OUStringLiteral sRecoveryDataSubStorageName = u"recovery"; + constexpr OUStringLiteral sRecoveryDataSubStorageName = u"recovery"; - const OUStringLiteral sObjectMapStreamName = u"storage-component-map.ini"; + constexpr OUStringLiteral sObjectMapStreamName = u"storage-component-map.ini"; void lcl_writeObjectMap_throw( const Reference<XComponentContext> & i_rContext, const Reference< XStorage >& i_rStorage, const MapStringToCompDesc& i_mapStorageToCompDesc ) diff --git a/dbaccess/source/core/recovery/storagetextstream.cxx b/dbaccess/source/core/recovery/storagetextstream.cxx index 1dd774bc8a31..32f68da9a087 100644 --- a/dbaccess/source/core/recovery/storagetextstream.cxx +++ b/dbaccess/source/core/recovery/storagetextstream.cxx @@ -36,7 +36,7 @@ namespace dbaccess Reference< XTextOutputStream2 > xTextOutput; }; - const OUStringLiteral sLineFeed = u"\n"; + constexpr OUStringLiteral sLineFeed = u"\n"; // StorageTextOutputStream StorageTextOutputStream::StorageTextOutputStream( const Reference<XComponentContext>& i_rContext, diff --git a/dbaccess/source/core/recovery/subcomponentrecovery.cxx b/dbaccess/source/core/recovery/subcomponentrecovery.cxx index 11dfa49d17ad..3549cd647fd8 100644 --- a/dbaccess/source/core/recovery/subcomponentrecovery.cxx +++ b/dbaccess/source/core/recovery/subcomponentrecovery.cxx @@ -160,8 +160,8 @@ namespace dbaccess return xCommandProcessor; } - const OUStringLiteral sSettingsStreamName = u"settings.xml"; - const OUStringLiteral sCurrentQueryDesignName = u"ooo:current-query-design"; + constexpr OUStringLiteral sSettingsStreamName = u"settings.xml"; + constexpr OUStringLiteral sCurrentQueryDesignName = u"ooo:current-query-design"; } namespace { diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index d75d557615a2..8905536c853d 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -674,7 +674,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const aReturn.bEnabled = xEnumAccess.is(); if ( aReturn.bEnabled ) { - static const OUStringLiteral s_sReportDesign = u"org.libreoffice.report.pentaho.SOReportJobFactory"; + static constexpr OUStringLiteral s_sReportDesign = u"org.libreoffice.report.pentaho.SOReportJobFactory"; Reference< XEnumeration > xEnumDrivers = xEnumAccess->createContentEnumeration(s_sReportDesign); aReturn.bEnabled = xEnumDrivers.is() && xEnumDrivers->hasMoreElements(); } diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index 0ce728d7fa2a..28b4c4053da3 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -639,7 +639,7 @@ void OApplicationController::onLoadedMenu(const Reference< css::frame::XLayoutMa if ( !_xLayoutManager.is() ) return; - static const OUStringLiteral s_sStatusbar = u"private:resource/statusbar/statusbar"; + static constexpr OUStringLiteral s_sStatusbar = u"private:resource/statusbar/statusbar"; _xLayoutManager->createElement( s_sStatusbar ); _xLayoutManager->requestElement( s_sStatusbar ); diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index da4d61641936..1b75869cf15e 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -304,10 +304,10 @@ bool DlgFilterCrit::getCondition(const weld::ComboBox& _rField,const weld::Combo } } xColumn->getPropertyValue(PROPERTY_REALNAME) >>= _rFilter.Name; - static const OUStringLiteral sAgg = u"AggregateFunction"; + static constexpr OUStringLiteral sAgg = u"AggregateFunction"; if ( xInfo->hasPropertyByName(sAgg) ) xColumn->getPropertyValue(sAgg) >>= bHaving; - static const OUStringLiteral sFunction = u"Function"; + static constexpr OUStringLiteral sFunction = u"Function"; if ( xInfo->hasPropertyByName(sFunction) ) xColumn->getPropertyValue(sFunction) >>= bFunction; } diff --git a/dbaccess/source/ui/misc/indexcollection.cxx b/dbaccess/source/ui/misc/indexcollection.cxx index 046a41a000ea..8a5448e623f9 100644 --- a/dbaccess/source/ui/misc/indexcollection.cxx +++ b/dbaccess/source/ui/misc/indexcollection.cxx @@ -122,7 +122,7 @@ namespace dbaui } // set the properties - static const OUStringLiteral s_sNamePropertyName = u"Name"; + static constexpr OUStringLiteral s_sNamePropertyName = u"Name"; // the index' own props xIndexDescriptor->setPropertyValue("IsUnique", css::uno::makeAny(_rPos->bUnique)); xIndexDescriptor->setPropertyValue(s_sNamePropertyName, makeAny(_rPos->sName)); diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 5bab3d26f30b..aa9145d5cb7a 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -149,8 +149,8 @@ namespace return; xLayoutManager->lock(); - static const OUStringLiteral s_sDesignToolbar = u"private:resource/toolbar/designobjectbar"; - static const OUStringLiteral s_sSqlToolbar = u"private:resource/toolbar/sqlobjectbar"; + static constexpr OUStringLiteral s_sDesignToolbar = u"private:resource/toolbar/designobjectbar"; + static constexpr OUStringLiteral s_sSqlToolbar = u"private:resource/toolbar/sqlobjectbar"; if ( _bDesign ) { xLayoutManager->destroyElement( s_sSqlToolbar ); diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 2f4fcdc6904b..b6bc634757e9 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -561,7 +561,7 @@ bool Desktop::QueryExit() { } - static const OUStringLiteral SUSPEND_QUICKSTARTVETO = u"SuspendQuickstartVeto"; + static constexpr OUStringLiteral SUSPEND_QUICKSTARTVETO = u"SuspendQuickstartVeto"; Reference< XDesktop2 > xDesktop = css::frame::Desktop::create( ::comphelper::getProcessComponentContext() ); Reference< XPropertySet > xPropertySet(xDesktop, UNO_QUERY_THROW); @@ -873,7 +873,7 @@ namespace { #if HAVE_FEATURE_BREAKPAD void handleCrashReport() { - static const OUStringLiteral SERVICENAME_CRASHREPORT = u"com.sun.star.comp.svx.CrashReportUI"; + static constexpr OUStringLiteral SERVICENAME_CRASHREPORT = u"com.sun.star.comp.svx.CrashReportUI"; css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx index 2e667e0ad64c..3080909b484c 100644 --- a/desktop/source/app/check_ext_deps.cxx +++ b/desktop/source/app/check_ext_deps.cxx @@ -207,7 +207,7 @@ void SilentCommandEnv::pop() } // end namespace -const OUStringLiteral aAccessSrvc = u"com.sun.star.configuration.ConfigurationUpdateAccess"; +constexpr OUStringLiteral aAccessSrvc = u"com.sun.star.configuration.ConfigurationUpdateAccess"; static sal_Int16 impl_showExtensionDialog( uno::Reference< uno::XComponentContext > const &xContext ) { diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx index 03e45b7278c0..419b03b3acda 100644 --- a/desktop/source/app/cmdlinehelp.cxx +++ b/desktop/source/app/cmdlinehelp.cxx @@ -35,10 +35,10 @@ namespace desktop { - const OUStringLiteral aCmdLineHelp_version = + constexpr OUStringLiteral aCmdLineHelp_version = u"%PRODUCTNAME %PRODUCTVERSION%PRODUCTEXTENSION %BUILDID\n" "\n"; - const OUStringLiteral aCmdLineHelp = + constexpr OUStringLiteral aCmdLineHelp = u"Usage: %CMDNAME [argument...]\n" " argument - switches, switch parameters and document URIs (filenames). \n\n" "Using without special arguments: \n" diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 4955c279ec32..ef4b6688d4c2 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -69,9 +69,9 @@ using namespace com::sun::star; namespace desktop { -const OUStringLiteral ITEM_DESCRIPTOR_COMMANDURL = u"CommandURL"; -const OUStringLiteral ITEM_DESCRIPTOR_CONTAINER = u"ItemDescriptorContainer"; -const OUStringLiteral ITEM_DESCRIPTOR_LABEL = u"Label"; +constexpr OUStringLiteral ITEM_DESCRIPTOR_COMMANDURL = u"CommandURL"; +constexpr OUStringLiteral ITEM_DESCRIPTOR_CONTAINER = u"ItemDescriptorContainer"; +constexpr OUStringLiteral ITEM_DESCRIPTOR_LABEL = u"Label"; static OUString mapModuleShortNameToIdentifier(std::u16string_view sShortName) { diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index e1a28403e40e..ae6dceb33adf 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -95,9 +95,9 @@ namespace o3tl { } const sal_Unicode cNonBreakingSpace = 0xA0; // UNICODE code for no break space -const OUStringLiteral pXMLImplWrdStt_ExcptLstStr = u"WordExceptList.xml"; -const OUStringLiteral pXMLImplCplStt_ExcptLstStr = u"SentenceExceptList.xml"; -const OUStringLiteral pXMLImplAutocorr_ListStr = u"DocumentList.xml"; +constexpr OUStringLiteral pXMLImplWrdStt_ExcptLstStr = u"WordExceptList.xml"; +constexpr OUStringLiteral pXMLImplCplStt_ExcptLstStr = u"SentenceExceptList.xml"; +constexpr OUStringLiteral pXMLImplAutocorr_ListStr = u"DocumentList.xml"; const char /* also at these beginnings - Brackets and all kinds of begin characters */ diff --git a/extensions/source/abpilot/admininvokationimpl.cxx b/extensions/source/abpilot/admininvokationimpl.cxx index 720ef26fb90c..c8ec00b681a7 100644 --- a/extensions/source/abpilot/admininvokationimpl.cxx +++ b/extensions/source/abpilot/admininvokationimpl.cxx @@ -62,7 +62,7 @@ namespace abp { // the service name of the administration dialog static const char16_t s_sAdministrationServiceName[] = u"com.sun.star.sdb.DatasourceAdministrationDialog"; - static const OUStringLiteral s_sDataSourceTypeChangeDialog = u"com.sun.star.sdb.DataSourceTypeChangeDialog"; + static constexpr OUStringLiteral s_sDataSourceTypeChangeDialog = u"com.sun.star.sdb.DataSourceTypeChangeDialog"; // the parameters for the call Sequence<Any> aArguments(comphelper::InitAnyPropertySequence( diff --git a/extensions/source/abpilot/fieldmappingimpl.cxx b/extensions/source/abpilot/fieldmappingimpl.cxx index 34d860cf3f49..8047053dc51d 100644 --- a/extensions/source/abpilot/fieldmappingimpl.cxx +++ b/extensions/source/abpilot/fieldmappingimpl.cxx @@ -50,7 +50,7 @@ namespace abp const char16_t sDriverSettingsNodeName[] = u"/org.openoffice.Office.DataAccess/DriverSettings/com.sun.star.comp.sdbc.MozabDriver"; - const OUStringLiteral sAddressBookNodeName = u"/org.openoffice.Office.DataAccess/AddressBook"; + constexpr OUStringLiteral sAddressBookNodeName = u"/org.openoffice.Office.DataAccess/AddressBook"; namespace fieldmapping { diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index 43d6054cdfa3..1c5f568795e0 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -93,8 +93,8 @@ namespace dbp if (!xColumnFactory.is() || !xColumnContainer.is()) return; - static const OUStringLiteral s_sMouseWheelBehavior = u"MouseWheelBehavior"; - static const OUStringLiteral s_sEmptyString = u""; + static constexpr OUStringLiteral s_sMouseWheelBehavior = u"MouseWheelBehavior"; + static constexpr OUStringLiteral s_sEmptyString = u""; // collect "descriptors" for the to-be-created (grid)columns std::vector< OUString > aColumnServiceNames; // service names to be used with the XGridColumnFactory diff --git a/extensions/source/dbpilots/optiongrouplayouter.cxx b/extensions/source/dbpilots/optiongrouplayouter.cxx index bfd14727cfb1..14a67ada98f7 100644 --- a/extensions/source/dbpilots/optiongrouplayouter.cxx +++ b/extensions/source/dbpilots/optiongrouplayouter.cxx @@ -189,7 +189,7 @@ namespace dbp void OOptionGroupLayouter::implAnchorShape(const Reference< XPropertySet >& _rxShapeProps) { - static const OUStringLiteral s_sAnchorPropertyName = u"AnchorType"; + static constexpr OUStringLiteral s_sAnchorPropertyName = u"AnchorType"; Reference< XPropertySetInfo > xPropertyInfo; if (_rxShapeProps.is()) xPropertyInfo = _rxShapeProps->getPropertySetInfo(); diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index cb80cfd7f643..eb5da674e6c3 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -94,13 +94,13 @@ const char aOOOAttrBackgroundVisibility[] = NSPREFIX "background-visibility"; const char aOOOAttrMasterObjectsVisibility[] = NSPREFIX "master-objects-visibility"; const char aOOOAttrSlideDuration[] = NSPREFIX "slide-duration"; const OUString aOOOAttrDateTimeField = NSPREFIX "date-time-field"; -const OUStringLiteral aOOOAttrFooterField = u"" NSPREFIX "footer-field"; +constexpr OUStringLiteral aOOOAttrFooterField = u"" NSPREFIX "footer-field"; const char aOOOAttrHasTransition[] = NSPREFIX "has-transition"; // ooo xml attributes for pages and shapes const char aOOOAttrName[] = NSPREFIX "name"; -const OUStringLiteral constSvgNamespace = u"http://www.w3.org/2000/svg"; +constexpr OUStringLiteral constSvgNamespace = u"http://www.w3.org/2000/svg"; /** Text Field Class Hierarchy diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx index a15dc12f53e6..473ff510adc3 100644 --- a/filter/source/svg/svgfilter.cxx +++ b/filter/source/svg/svgfilter.cxx @@ -63,8 +63,8 @@ using namespace ::com::sun::star; namespace { - const OUStringLiteral constFilterNameDraw = u"svg_Scalable_Vector_Graphics_Draw"; - const OUStringLiteral constFilterName = u"svg_Scalable_Vector_Graphics"; + constexpr OUStringLiteral constFilterNameDraw = u"svg_Scalable_Vector_Graphics_Draw"; + constexpr OUStringLiteral constFilterName = u"svg_Scalable_Vector_Graphics"; } SVGFilter::SVGFilter( const Reference< XComponentContext >& rxCtx ) : diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 0374c9fb956e..066eeb45e293 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -1943,7 +1943,7 @@ void ODatabaseForm::reset_impl(bool _bApproveByListeners) if ( xColProps.is() ) xPSI = xColProps->getPropertySetInfo( ); - static const OUStringLiteral PROPERTY_CONTROLDEFAULT = u"ControlDefault"; + static constexpr OUStringLiteral PROPERTY_CONTROLDEFAULT = u"ControlDefault"; if ( xPSI.is() && xPSI->hasPropertyByName( PROPERTY_CONTROLDEFAULT ) ) { Any aDefault = xColProps->getPropertyValue( PROPERTY_CONTROLDEFAULT ); diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index 1e201c7b3858..ed2f748fb7cd 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -649,7 +649,7 @@ void OFormattedModel::write(const Reference<XObjectOutputStream>& _rxOutStream) Reference<XNumberFormats> xFormats = xSupplier->getNumberFormats(); OUString sFormatDescription; LanguageType eFormatLanguage = LANGUAGE_DONTKNOW; - static const OUStringLiteral s_aLocaleProp = u"Locale"; + static constexpr OUStringLiteral s_aLocaleProp = u"Locale"; Reference<css::beans::XPropertySet> xFormat = xFormats->getByKey(nKey); if (hasProperty(s_aLocaleProp, xFormat)) { @@ -660,7 +660,7 @@ void OFormattedModel::write(const Reference<XObjectOutputStream>& _rxOutStream) eFormatLanguage = LanguageTag::convertToLanguageType( *pLocale, false); } } - static const OUStringLiteral s_aFormatStringProp = u"FormatString"; + static constexpr OUStringLiteral s_aFormatStringProp = u"FormatString"; if (hasProperty(s_aFormatStringProp, xFormat)) xFormat->getPropertyValue(s_aFormatStringProp) >>= sFormatDescription; _rxOutStream->writeUTF(sFormatDescription); diff --git a/framework/inc/taskcreatordefs.hxx b/framework/inc/taskcreatordefs.hxx index 02b85221c801..df56779d4699 100644 --- a/framework/inc/taskcreatordefs.hxx +++ b/framework/inc/taskcreatordefs.hxx @@ -21,38 +21,39 @@ #define INCLUDED_FRAMEWORK_INC_TASKCREATORDEFS_HXX /// [XFrame] if it's set, it will be used as parent frame for the new created frame. -const OUStringLiteral ARGUMENT_PARENTFRAME = u"ParentFrame"; // XFrame +constexpr OUStringLiteral ARGUMENT_PARENTFRAME = u"ParentFrame"; // XFrame /** [OUString] if it's not a special name (beginning with "_" ... which are not allowed here!) it will be set as the API name of the new created frame. */ -const OUStringLiteral ARGUMENT_FRAMENAME = u"FrameName"; // OUString +constexpr OUStringLiteral ARGUMENT_FRAMENAME = u"FrameName"; // OUString /// [sal_Bool] If it's set to sal_True we will make the new created frame visible. -const OUStringLiteral ARGUMENT_MAKEVISIBLE = u"MakeVisible"; // sal_Bool +constexpr OUStringLiteral ARGUMENT_MAKEVISIBLE = u"MakeVisible"; // sal_Bool /** [sal_Bool] If not "ContainerWindow" property is set it force creation of a top level window as new container window. */ -const OUStringLiteral ARGUMENT_CREATETOPWINDOW = u"CreateTopWindow"; // sal_Bool +constexpr OUStringLiteral ARGUMENT_CREATETOPWINDOW = u"CreateTopWindow"; // sal_Bool /// [Rectangle] Place the new created frame on this place and resize the container window. -inline const OUStringLiteral ARGUMENT_POSSIZE = u"PosSize"; // Rectangle +inline constexpr OUStringLiteral ARGUMENT_POSSIZE = u"PosSize"; // Rectangle /// [XWindow] an outside created window, used as container window of the new created frame. -inline const OUStringLiteral ARGUMENT_CONTAINERWINDOW = u"ContainerWindow"; // XWindow +inline constexpr OUStringLiteral ARGUMENT_CONTAINERWINDOW = u"ContainerWindow"; // XWindow /** [sal_Bool] enable/disable special mode, where this frame will be part of the persistent window state feature suitable for any office module window */ -const OUStringLiteral ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE +constexpr OUStringLiteral ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE = u"SupportPersistentWindowState"; // sal_Bool /** [sal_Bool] enable/disable special mode, where the title bar of our the new created frame will be updated automatically. Default = ON ! */ -inline const OUStringLiteral ARGUMENT_ENABLE_TITLEBARUPDATE = u"EnableTitleBarUpdate"; // sal_Bool +inline constexpr OUStringLiteral ARGUMENT_ENABLE_TITLEBARUPDATE + = u"EnableTitleBarUpdate"; // sal_Bool #endif // INCLUDED_FRAMEWORK_INC_TASKCREATORDEFS_HXX diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index eb01a00c5291..85edc3833025 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -57,8 +57,8 @@ namespace framework { - const OUStringLiteral CFG_ENTRY_SECONDARY = u"SecondaryKeys"; - const OUStringLiteral CFG_PROP_COMMAND = u"Command"; + constexpr OUStringLiteral CFG_ENTRY_SECONDARY = u"SecondaryKeys"; + constexpr OUStringLiteral CFG_PROP_COMMAND = u"Command"; static OUString lcl_getKeyString(const css::awt::KeyEvent& aKeyEvent) { diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx index ad55be6dd213..dbc6f7a22444 100644 --- a/framework/source/fwe/xml/menudocumenthandler.cxx +++ b/framework/source/fwe/xml/menudocumenthandler.cxx @@ -72,12 +72,12 @@ #define ATTRIBUTE_ITEMSTYLE_RADIO "radio" // Property names of a menu/menu item ItemDescriptor -const OUStringLiteral ITEM_DESCRIPTOR_COMMANDURL = u"CommandURL"; -const OUStringLiteral ITEM_DESCRIPTOR_HELPURL = u"HelpURL"; -const OUStringLiteral ITEM_DESCRIPTOR_CONTAINER = u"ItemDescriptorContainer"; -const OUStringLiteral ITEM_DESCRIPTOR_LABEL = u"Label"; -const OUStringLiteral ITEM_DESCRIPTOR_TYPE = u"Type"; -const OUStringLiteral ITEM_DESCRIPTOR_STYLE = u"Style"; +constexpr OUStringLiteral ITEM_DESCRIPTOR_COMMANDURL = u"CommandURL"; +constexpr OUStringLiteral ITEM_DESCRIPTOR_HELPURL = u"HelpURL"; +constexpr OUStringLiteral ITEM_DESCRIPTOR_CONTAINER = u"ItemDescriptorContainer"; +constexpr OUStringLiteral ITEM_DESCRIPTOR_LABEL = u"Label"; +constexpr OUStringLiteral ITEM_DESCRIPTOR_TYPE = u"Type"; +constexpr OUStringLiteral ITEM_DESCRIPTOR_STYLE = u"Style"; // using namespaces diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx index a829e03ad20d..8d7b9835c3f4 100644 --- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx +++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx @@ -48,11 +48,11 @@ namespace framework { // Property names of a menu/menu item ItemDescriptor -const OUStringLiteral ITEM_DESCRIPTOR_COMMANDURL = u"CommandURL"; -const OUStringLiteral ITEM_DESCRIPTOR_LABEL = u"Label"; -const OUStringLiteral ITEM_DESCRIPTOR_TYPE = u"Type"; -const OUStringLiteral ITEM_DESCRIPTOR_STYLE = u"Style"; -const OUStringLiteral ITEM_DESCRIPTOR_VISIBLE = u"IsVisible"; +constexpr OUStringLiteral ITEM_DESCRIPTOR_COMMANDURL = u"CommandURL"; +constexpr OUStringLiteral ITEM_DESCRIPTOR_LABEL = u"Label"; +constexpr OUStringLiteral ITEM_DESCRIPTOR_TYPE = u"Type"; +constexpr OUStringLiteral ITEM_DESCRIPTOR_STYLE = u"Style"; +constexpr OUStringLiteral ITEM_DESCRIPTOR_VISIBLE = u"IsVisible"; static void ExtractToolbarParameters( const Sequence< PropertyValue >& rProp, OUString& rCommandURL, diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx b/framework/source/fwi/uielement/constitemcontainer.cxx index 212f0a80e24b..e02fb7aa3d9a 100644 --- a/framework/source/fwi/uielement/constitemcontainer.cxx +++ b/framework/source/fwi/uielement/constitemcontainer.cxx @@ -33,7 +33,7 @@ using namespace com::sun::star::beans; using namespace com::sun::star::container; const int PROPHANDLE_UINAME = 1; -const OUStringLiteral PROPNAME_UINAME = u"UIName"; +constexpr OUStringLiteral PROPNAME_UINAME = u"UIName"; namespace framework { diff --git a/framework/source/fwi/uielement/itemcontainer.cxx b/framework/source/fwi/uielement/itemcontainer.cxx index 55f6ccecfd50..de2b047653ab 100644 --- a/framework/source/fwi/uielement/itemcontainer.cxx +++ b/framework/source/fwi/uielement/itemcontainer.cxx @@ -30,7 +30,7 @@ using namespace com::sun::star::lang; using namespace com::sun::star::beans; using namespace com::sun::star::container; -const OUStringLiteral WRONG_TYPE_EXCEPTION +constexpr OUStringLiteral WRONG_TYPE_EXCEPTION = u"Type must be css::uno::Sequence< css::beans::PropertyValue >"; namespace framework diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx index 0016789d2da6..b570154f2eb0 100644 --- a/framework/source/fwi/uielement/rootitemcontainer.cxx +++ b/framework/source/fwi/uielement/rootitemcontainer.cxx @@ -33,11 +33,11 @@ using namespace com::sun::star::lang; using namespace com::sun::star::beans; using namespace com::sun::star::container; -const OUStringLiteral WRONG_TYPE_EXCEPTION +constexpr OUStringLiteral WRONG_TYPE_EXCEPTION = u"Type must be css::uno::Sequence< css::beans::PropertyValue >"; const int PROPHANDLE_UINAME = 1; -const OUStringLiteral PROPNAME_UINAME = u"UIName"; +constexpr OUStringLiteral PROPNAME_UINAME = u"UIName"; namespace framework { diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx index ce923b2f9e55..62efba05933f 100644 --- a/framework/source/helper/statusindicatorfactory.cxx +++ b/framework/source/helper/statusindicatorfactory.cxx @@ -48,7 +48,7 @@ struct RescheduleLock: public rtl::Static<osl::Mutex, RescheduleLock> {}; ///< m } -const OUStringLiteral PROGRESS_RESOURCE = u"private:resource/progressbar/progressbar"; +constexpr OUStringLiteral PROGRESS_RESOURCE = u"private:resource/progressbar/progressbar"; StatusIndicatorFactory::StatusIndicatorFactory(const css::uno::Reference< css::uno::XComponentContext >& xContext) : m_xContext (xContext ) diff --git a/framework/source/helper/uiconfigelementwrapperbase.cxx b/framework/source/helper/uiconfigelementwrapperbase.cxx index f27c51186f30..399bf8bc9d8c 100644 --- a/framework/source/helper/uiconfigelementwrapperbase.cxx +++ b/framework/source/helper/uiconfigelementwrapperbase.cxx @@ -37,14 +37,14 @@ const int UIELEMENT_PROPHANDLE_TYPE = 5; const int UIELEMENT_PROPHANDLE_XMENUBAR = 6; const int UIELEMENT_PROPHANDLE_CONFIGLISTENER = 7; const int UIELEMENT_PROPHANDLE_NOCLOSE = 8; -const OUStringLiteral UIELEMENT_PROPNAME_CONFIGLISTENER = u"ConfigListener"; -const OUStringLiteral UIELEMENT_PROPNAME_CONFIGSOURCE = u"ConfigurationSource"; -const OUStringLiteral UIELEMENT_PROPNAME_FRAME = u"Frame"; -const OUStringLiteral UIELEMENT_PROPNAME_PERSISTENT = u"Persistent"; -const OUStringLiteral UIELEMENT_PROPNAME_RESOURCEURL = u"ResourceURL"; -const OUStringLiteral UIELEMENT_PROPNAME_TYPE = u"Type"; -const OUStringLiteral UIELEMENT_PROPNAME_XMENUBAR = u"XMenuBar"; -const OUStringLiteral UIELEMENT_PROPNAME_NOCLOSE = u"NoClose"; +constexpr OUStringLiteral UIELEMENT_PROPNAME_CONFIGLISTENER = u"ConfigListener"; +constexpr OUStringLiteral UIELEMENT_PROPNAME_CONFIGSOURCE = u"ConfigurationSource"; +constexpr OUStringLiteral UIELEMENT_PROPNAME_FRAME = u"Frame"; +constexpr OUStringLiteral UIELEMENT_PROPNAME_PERSISTENT = u"Persistent"; +constexpr OUStringLiteral UIELEMENT_PROPNAME_RESOURCEURL = u"ResourceURL"; +constexpr OUStringLiteral UIELEMENT_PROPNAME_TYPE = u"Type"; +constexpr OUStringLiteral UIELEMENT_PROPNAME_XMENUBAR = u"XMenuBar"; +constexpr OUStringLiteral UIELEMENT_PROPNAME_NOCLOSE = u"NoClose"; using namespace com::sun::star::beans; using namespace com::sun::star::uno; using namespace com::sun::star::frame; diff --git a/framework/source/helper/uielementwrapperbase.cxx b/framework/source/helper/uielementwrapperbase.cxx index 06db2788beac..829e4f9523eb 100644 --- a/framework/source/helper/uielementwrapperbase.cxx +++ b/framework/source/helper/uielementwrapperbase.cxx @@ -28,9 +28,9 @@ const int UIELEMENT_PROPHANDLE_RESOURCEURL = 1; const int UIELEMENT_PROPHANDLE_TYPE = 2; const int UIELEMENT_PROPHANDLE_FRAME = 3; -const OUStringLiteral UIELEMENT_PROPNAME_RESOURCEURL = u"ResourceURL"; -const OUStringLiteral UIELEMENT_PROPNAME_TYPE = u"Type"; -const OUStringLiteral UIELEMENT_PROPNAME_FRAME = u"Frame"; +constexpr OUStringLiteral UIELEMENT_PROPNAME_RESOURCEURL = u"ResourceURL"; +constexpr OUStringLiteral UIELEMENT_PROPNAME_TYPE = u"Type"; +constexpr OUStringLiteral UIELEMENT_PROPNAME_FRAME = u"Frame"; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; diff --git a/framework/source/inc/accelerators/acceleratorconfiguration.hxx b/framework/source/inc/accelerators/acceleratorconfiguration.hxx index 38d9eaff9e98..df7bed019ff2 100644 --- a/framework/source/inc/accelerators/acceleratorconfiguration.hxx +++ b/framework/source/inc/accelerators/acceleratorconfiguration.hxx @@ -44,9 +44,9 @@ namespace framework { -inline const OUStringLiteral CFG_ENTRY_PRIMARY = u"PrimaryKeys"; -inline const OUStringLiteral CFG_ENTRY_GLOBAL = u"Global"; -inline const OUStringLiteral CFG_ENTRY_MODULES = u"Modules"; +inline constexpr OUStringLiteral CFG_ENTRY_PRIMARY = u"PrimaryKeys"; +inline constexpr OUStringLiteral CFG_ENTRY_GLOBAL = u"Global"; +inline constexpr OUStringLiteral CFG_ENTRY_MODULES = u"Modules"; /** implements a read/write access to the accelerator configuration. diff --git a/framework/source/jobs/jobexecutor.cxx b/framework/source/jobs/jobexecutor.cxx index c90a8f56a1ed..30b90cca6ec4 100644 --- a/framework/source/jobs/jobexecutor.cxx +++ b/framework/source/jobs/jobexecutor.cxx @@ -241,8 +241,8 @@ void SAL_CALL JobExecutor::trigger( const OUString& sEvent ) void SAL_CALL JobExecutor::notifyEvent( const css::document::EventObject& aEvent ) { - static const OUStringLiteral EVENT_ON_DOCUMENT_OPENED(u"onDocumentOpened"); // Job UI event : OnNew or OnLoad - static const OUStringLiteral EVENT_ON_DOCUMENT_ADDED(u"onDocumentAdded"); // Job API event : OnCreate or OnLoadFinished + static constexpr OUStringLiteral EVENT_ON_DOCUMENT_OPENED(u"onDocumentOpened"); // Job UI event : OnNew or OnLoad + static constexpr OUStringLiteral EVENT_ON_DOCUMENT_ADDED(u"onDocumentAdded"); // Job API event : OnCreate or OnLoadFinished OUString aModuleIdentifier; ::std::vector< JobData::TJob2DocEventBinding > lJobs; diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 6090cb0f9646..e080497b066b 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -76,7 +76,7 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::ui; using namespace ::com::sun::star::frame; -const OUStringLiteral STATUS_BAR_ALIAS = u"private:resource/statusbar/statusbar"; +constexpr OUStringLiteral STATUS_BAR_ALIAS = u"private:resource/statusbar/statusbar"; namespace framework { diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index c24e65959cfb..159247cb2d29 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -91,8 +91,8 @@ #include <classes/taskcreator.hxx> #include <tools/fileutil.hxx> -const OUStringLiteral PROP_TYPES = u"Types"; -const OUStringLiteral PROP_NAME = u"Name"; +constexpr OUStringLiteral PROP_TYPES = u"Types"; +constexpr OUStringLiteral PROP_NAME = u"Name"; namespace framework { diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 10b8574d6155..76594a4ec5f3 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -995,30 +995,30 @@ private: }; // recovery.xcu -const OUStringLiteral CFG_PACKAGE_RECOVERY = u"org.openoffice.Office.Recovery/"; +constexpr OUStringLiteral CFG_PACKAGE_RECOVERY = u"org.openoffice.Office.Recovery/"; const char CFG_ENTRY_AUTOSAVE_ENABLED[] = "AutoSave/Enabled"; const char CFG_ENTRY_AUTOSAVE_TIMEINTERVALL[] = "AutoSave/TimeIntervall"; //sic! -const OUStringLiteral CFG_ENTRY_REALDEFAULTFILTER = u"ooSetupFactoryActualFilter"; +constexpr OUStringLiteral CFG_ENTRY_REALDEFAULTFILTER = u"ooSetupFactoryActualFilter"; -const OUStringLiteral CFG_ENTRY_PROP_TEMPURL = u"TempURL"; -const OUStringLiteral CFG_ENTRY_PROP_ORIGINALURL = u"OriginalURL"; -const OUStringLiteral CFG_ENTRY_PROP_TEMPLATEURL = u"TemplateURL"; -const OUStringLiteral CFG_ENTRY_PROP_FACTORYURL = u"FactoryURL"; -const OUStringLiteral CFG_ENTRY_PROP_MODULE = u"Module"; -const OUStringLiteral CFG_ENTRY_PROP_DOCUMENTSTATE = u"DocumentState"; -const OUStringLiteral CFG_ENTRY_PROP_FILTER = u"Filter"; -const OUStringLiteral CFG_ENTRY_PROP_TITLE = u"Title"; -const OUStringLiteral CFG_ENTRY_PROP_ID = u"ID"; -const OUStringLiteral CFG_ENTRY_PROP_VIEWNAMES = u"ViewNames"; +constexpr OUStringLiteral CFG_ENTRY_PROP_TEMPURL = u"TempURL"; +constexpr OUStringLiteral CFG_ENTRY_PROP_ORIGINALURL = u"OriginalURL"; +constexpr OUStringLiteral CFG_ENTRY_PROP_TEMPLATEURL = u"TemplateURL"; +constexpr OUStringLiteral CFG_ENTRY_PROP_FACTORYURL = u"FactoryURL"; +constexpr OUStringLiteral CFG_ENTRY_PROP_MODULE = u"Module"; +constexpr OUStringLiteral CFG_ENTRY_PROP_DOCUMENTSTATE = u"DocumentState"; +constexpr OUStringLiteral CFG_ENTRY_PROP_FILTER = u"Filter"; +constexpr OUStringLiteral CFG_ENTRY_PROP_TITLE = u"Title"; +constexpr OUStringLiteral CFG_ENTRY_PROP_ID = u"ID"; +constexpr OUStringLiteral CFG_ENTRY_PROP_VIEWNAMES = u"ViewNames"; -const OUStringLiteral FILTER_PROP_TYPE = u"Type"; -const OUStringLiteral TYPE_PROP_EXTENSIONS = u"Extensions"; +constexpr OUStringLiteral FILTER_PROP_TYPE = u"Type"; +constexpr OUStringLiteral TYPE_PROP_EXTENSIONS = u"Extensions"; // setup.xcu -const OUStringLiteral CFG_ENTRY_PROP_EMPTYDOCUMENTURL = u"ooSetupFactoryEmptyDocumentURL"; -const OUStringLiteral CFG_ENTRY_PROP_FACTORYSERVICE = u"ooSetupFactoryDocumentService"; +constexpr OUStringLiteral CFG_ENTRY_PROP_EMPTYDOCUMENTURL = u"ooSetupFactoryEmptyDocumentURL"; +constexpr OUStringLiteral CFG_ENTRY_PROP_FACTORYSERVICE = u"ooSetupFactoryDocumentService"; const char EVENT_ON_NEW[] = "OnNew"; const char EVENT_ON_LOAD[] = "OnLoad"; @@ -1034,7 +1034,7 @@ const char EVENT_ON_SAVEFAILED[] = "OnSaveFailed"; const char EVENT_ON_SAVEASFAILED[] = "OnSaveAsFailed"; const char EVENT_ON_SAVETOFAILED[] = "OnCopyToFailed"; -const OUStringLiteral RECOVERY_ITEM_BASE_IDENTIFIER = u"recovery_item_"; +constexpr OUStringLiteral RECOVERY_ITEM_BASE_IDENTIFIER = u"recovery_item_"; const char CMD_PROTOCOL[] = "vnd.sun.star.autorecovery:"; @@ -1050,17 +1050,17 @@ const char CMD_DO_SESSION_RESTORE[] = "/doSessionRestore"; // restore a saved const char CMD_DO_DISABLE_RECOVERY[] = "/disableRecovery"; // disable recovery and auto save (!) temp. for this office session const char CMD_DO_SET_AUTOSAVE_STATE[] = "/setAutoSaveState"; // disable/enable auto save (not crash save) for this office session -const OUStringLiteral REFERRER_USER = u"private:user"; +constexpr OUStringLiteral REFERRER_USER = u"private:user"; -const OUStringLiteral PROP_DISPATCH_ASYNCHRON = u"DispatchAsynchron"; -const OUStringLiteral PROP_PROGRESS = u"StatusIndicator"; -const OUStringLiteral PROP_SAVEPATH = u"SavePath"; -const OUStringLiteral PROP_ENTRY_ID = u"EntryID"; -const OUStringLiteral PROP_AUTOSAVE_STATE = u"AutoSaveState"; +constexpr OUStringLiteral PROP_DISPATCH_ASYNCHRON = u"DispatchAsynchron"; +constexpr OUStringLiteral PROP_PROGRESS = u"StatusIndicator"; +constexpr OUStringLiteral PROP_SAVEPATH = u"SavePath"; +constexpr OUStringLiteral PROP_ENTRY_ID = u"EntryID"; +constexpr OUStringLiteral PROP_AUTOSAVE_STATE = u"AutoSaveState"; -const OUStringLiteral OPERATION_START = u"start"; -const OUStringLiteral OPERATION_STOP = u"stop"; -const OUStringLiteral OPERATION_UPDATE = u"update"; +constexpr OUStringLiteral OPERATION_START = u"start"; +constexpr OUStringLiteral OPERATION_STOP = u"stop"; +constexpr OUStringLiteral OPERATION_UPDATE = u"update"; const sal_Int32 MIN_DISCSPACE_DOCSAVE = 5; // [MB] const sal_Int32 MIN_DISCSPACE_CONFIGSAVE = 1; // [MB] diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx index 6206aa3864f5..cfccf014f11c 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.cxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx @@ -64,8 +64,8 @@ using namespace ::cppu; const sal_Int16 MAX_IMAGETYPE_VALUE = css::ui::ImageType::SIZE_32; -const OUStringLiteral IMAGE_FOLDER = u"images"; -const OUStringLiteral BITMAPS_FOLDER = u"Bitmaps"; +constexpr OUStringLiteral IMAGE_FOLDER = u"images"; +constexpr OUStringLiteral BITMAPS_FOLDER = u"Bitmaps"; const o3tl::enumarray<vcl::ImageType, const char*> IMAGELIST_XML_FILE = { diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index e0fd3d07f4d2..9e1d9d84bfdb 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -40,9 +40,9 @@ using namespace com::sun::star::util; namespace { -const OUStringLiteral CMD_CLEAR_LIST = u".uno:ClearRecentFileList"; -const OUStringLiteral CMD_OPEN_AS_TEMPLATE = u".uno:OpenTemplate"; -const OUStringLiteral CMD_OPEN_REMOTE = u".uno:OpenRemote"; +constexpr OUStringLiteral CMD_CLEAR_LIST = u".uno:ClearRecentFileList"; +constexpr OUStringLiteral CMD_OPEN_AS_TEMPLATE = u".uno:OpenTemplate"; +constexpr OUStringLiteral CMD_OPEN_REMOTE = u".uno:OpenRemote"; class RecentFilesMenuController : public svt::PopupMenuControllerBase { diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 0689cd39aff2..8f08976528cf 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -68,9 +68,9 @@ using namespace ::com::sun::star::util; using namespace ::com::sun::star::container; using namespace ::com::sun::star::ui; -const OUStringLiteral CMD_RESTOREVISIBILITY = u".cmd:RestoreVisibility"; +constexpr OUStringLiteral CMD_RESTOREVISIBILITY = u".cmd:RestoreVisibility"; -const OUStringLiteral STATIC_CMD_PART = u".uno:AvailableToolbars?Toolbar:string="; +constexpr OUStringLiteral STATIC_CMD_PART = u".uno:AvailableToolbars?Toolbar:string="; const char STATIC_INTERNAL_CMD_PART[] = ".cmd:"; namespace framework diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx index 85a2a3e4ccc4..7fdef0eaf06d 100644 --- a/framework/source/uielement/uicommanddescription.cxx +++ b/framework/source/uielement/uicommanddescription.cxx @@ -54,7 +54,7 @@ using namespace ::com::sun::star::frame; const char CONFIGURATION_ROOT_ACCESS[] = "/org.openoffice.Office.UI."; // Special resource URLs to retrieve additional information -const OUStringLiteral PRIVATE_RESOURCE_URL = u"private:"; +constexpr OUStringLiteral PRIVATE_RESOURCE_URL = u"private:"; const sal_Int32 COMMAND_PROPERTY_IMAGE = 1; const sal_Int32 COMMAND_PROPERTY_ROTATE = 2; diff --git a/i18npool/source/collator/chaptercollator.cxx b/i18npool/source/collator/chaptercollator.cxx index 153f5ff3d38d..d5d9b48bd1ba 100644 --- a/i18npool/source/collator/chaptercollator.cxx +++ b/i18npool/source/collator/chaptercollator.cxx @@ -72,7 +72,7 @@ ChapterCollator::compareSubstring( const OUString& str1, sal_Int32 off1, sal_Int return res1.Value == res2.Value ? 0 : res1.Value > res2.Value ? 1 : -1; } -const OUStringLiteral cChapCollator = u"com.sun.star.i18n.ChapterCollator"; +constexpr OUStringLiteral cChapCollator = u"com.sun.star.i18n.ChapterCollator"; OUString SAL_CALL ChapterCollator::getImplementationName() diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx index f3ba3c062050..8c8255a18229 100644 --- a/i18npool/source/collator/collator_unicode.cxx +++ b/i18npool/source/collator/collator_unicode.cxx @@ -38,7 +38,7 @@ using namespace ::com::sun::star::uno; namespace i18npool { -const OUStringLiteral implementationName = u"com.sun.star.i18n.Collator_Unicode"; +constexpr OUStringLiteral implementationName = u"com.sun.star.i18n.Collator_Unicode"; Collator_Unicode::Collator_Unicode() { diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index fd98a6bc32e3..af020c207faf 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -419,7 +419,7 @@ static void lcl_formatPersianWord( sal_Int32 nNumber, OUString& rsResult ) { OUStringBuffer aTemp(64); - static const OUStringLiteral asPersianWord_conjunction_data = u" \u0648 "; + static constexpr OUStringLiteral asPersianWord_conjunction_data = u" \u0648 "; OUString asPersianWord_conjunction( asPersianWord_conjunction_data ); unsigned char nSection = 0; diff --git a/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx b/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx index b4a9f3e0cda6..2045f45f9050 100644 --- a/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx @@ -63,7 +63,7 @@ sal_Int16 SAL_CALL IndexEntrySupplier_ja_phonetic::compareIndexEntry( return result; } -const OUStringLiteral first = u"phonetic (alphanumeric first)"; +constexpr OUStringLiteral first = u"phonetic (alphanumeric first)"; sal_Bool SAL_CALL IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable::loadAlgorithm( const css::lang::Locale& rLocale, const OUString& /*SortAlgorithm*/, sal_Int32 collatorOptions ) @@ -77,7 +77,7 @@ sal_Bool SAL_CALL IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_consonant return collator->loadCollatorAlgorithm(first, rLocale, collatorOptions) == 0; } -const OUStringLiteral last = u"phonetic (alphanumeric last)"; +constexpr OUStringLiteral last = u"phonetic (alphanumeric last)"; sal_Bool SAL_CALL IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_syllable::loadAlgorithm( const css::lang::Locale& rLocale, const OUString& /*SortAlgorithm*/, sal_Int32 collatorOptions ) diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx index a854d279f7bf..fd487c7de0ea 100644 --- a/i18npool/source/nativenumber/nativenumbersupplier.cxx +++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx @@ -1220,7 +1220,7 @@ OUString getCyrillicNativeNumberString(const OUString& aNumberString) return aNumberString; } -const OUStringLiteral implementationName = u"com.sun.star.i18n.NativeNumberSupplier"; +constexpr OUStringLiteral implementationName = u"com.sun.star.i18n.NativeNumberSupplier"; OUString SAL_CALL NativeNumberSupplierService::getImplementationName() { diff --git a/i18npool/source/ordinalsuffix/ordinalsuffix.cxx b/i18npool/source/ordinalsuffix/ordinalsuffix.cxx index 38732564fd0c..76dd0440f76f 100644 --- a/i18npool/source/ordinalsuffix/ordinalsuffix.cxx +++ b/i18npool/source/ordinalsuffix/ordinalsuffix.cxx @@ -134,7 +134,7 @@ uno::Sequence< OUString > SAL_CALL OrdinalSuffixService::getOrdinalSuffix( sal_I return comphelper::containerToSequence(retVec); } -const OUStringLiteral cOrdinalSuffix = u"com.sun.star.i18n.OrdinalSuffix"; +constexpr OUStringLiteral cOrdinalSuffix = u"com.sun.star.i18n.OrdinalSuffix"; OUString SAL_CALL OrdinalSuffixService::getImplementationName() { diff --git a/include/editeng/itemtype.hxx b/include/editeng/itemtype.hxx index 4338d1ff9142..117e477c8621 100644 --- a/include/editeng/itemtype.hxx +++ b/include/editeng/itemtype.hxx @@ -29,7 +29,7 @@ class Color; class IntlWrapper; // static and prototypes ------------------------------------------------- -inline const OUStringLiteral cpDelim = u", "; +inline constexpr OUStringLiteral cpDelim = u", "; EDITENG_DLLPUBLIC OUString GetMetricText( tools::Long nVal, MapUnit eSrcUnit, MapUnit eDestUnit, const IntlWrapper * pIntl ); OUString GetColorString( const Color& rCol ); diff --git a/oox/source/ole/oleobjecthelper.cxx b/oox/source/ole/oleobjecthelper.cxx index 5cc2b789778a..534d8aff97ab 100644 --- a/oox/source/ole/oleobjecthelper.cxx +++ b/oox/source/ole/oleobjecthelper.cxx @@ -89,7 +89,7 @@ void SaveInteropProperties(uno::Reference<frame::XModel> const& xModel, OUString const& rObjectName, OUString const*const pOldObjectName, OUString const& rProgId) { - static const OUStringLiteral sEmbeddingsPropName = u"EmbeddedObjects"; + static constexpr OUStringLiteral sEmbeddingsPropName = u"EmbeddedObjects"; // get interop grab bag from document uno::Reference<beans::XPropertySet> const xDocProps(xModel, uno::UNO_QUERY); diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index e7f97aec9f83..378b8041cb04 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -1278,7 +1278,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS uno::Reference< beans::XPropertySet> xProp(_xStorageToSaveTo,uno::UNO_QUERY); if ( xProp.is() ) { - static const OUStringLiteral sPropName = u"MediaType"; + static constexpr OUStringLiteral sPropName = u"MediaType"; OUString sOldMediaType; xProp->getPropertyValue(sPropName) >>= sOldMediaType; if ( !xProp->getPropertyValue(sPropName).hasValue() || sOldMediaType.isEmpty() || MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII != sOldMediaType ) diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx index a60c59b20fa2..13e5dacb3c70 100644 --- a/reportdesign/source/core/api/ReportEngineJFree.cxx +++ b/reportdesign/source/core/api/ReportEngineJFree.cxx @@ -130,7 +130,7 @@ OUString OReportEngineJFree::getNewOutputName() if ( !m_xReport.is() || !m_xActiveConnection.is() ) throw lang::IllegalArgumentException(); - static const OUStringLiteral s_sMediaType = u"MediaType"; + static constexpr OUStringLiteral s_sMediaType = u"MediaType"; MimeConfigurationHelper aConfighelper(m_xContext); const OUString sMimeType = m_xReport->getMimeType(); diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index ed93930bebb7..b461787b08ae 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -345,7 +345,7 @@ void ExportDocumentHandler::exportTableRows() const OUString sRElement(lcl_createAttribute(XML_NP_RPT,XML_REPORT_ELEMENT) ); const OUString sRComponent( lcl_createAttribute(XML_NP_RPT,XML_REPORT_COMPONENT) ) ; const OUString sFormulaAttrib( lcl_createAttribute(XML_NP_RPT,XML_FORMULA) ); - static const OUStringLiteral s_sFloat = u"float"; + static constexpr OUStringLiteral s_sFloat = u"float"; SvXMLAttributeList* pCellAtt = new SvXMLAttributeList(); uno::Reference< xml::sax::XAttributeList > xCellAtt = pCellAtt; diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index 72da191b0710..d9e761c2466c 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -340,7 +340,7 @@ void SAL_CALL ImportDocumentHandler::initialize( const uno::Sequence< uno::Any > m_xDatabaseDataProvider.set(m_xModel->getDataProvider(),uno::UNO_QUERY); if ( !m_xDatabaseDataProvider.is() ) { - static const OUStringLiteral s_sDatabaseDataProvider = u"com.sun.star.chart2.data.DatabaseDataProvider"; + static constexpr OUStringLiteral s_sDatabaseDataProvider = u"com.sun.star.chart2.data.DatabaseDataProvider"; m_xDatabaseDataProvider.set(m_xContext->getServiceManager()->createInstanceWithContext(s_sDatabaseDataProvider ,m_xContext),uno::UNO_QUERY_THROW); m_xDatabaseDataProvider->setRowLimit(10); diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index cf9ff3c7bc02..2fbbb37992d6 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -417,7 +417,7 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) aArgs[0] <<= beans::NamedValue("Storage",uno::makeAny(xStorage)); xEmbeddedObjectResolver.set( xReportServiceFactory->createInstanceWithArguments("com.sun.star.document.ImportEmbeddedObjectResolver",aArgs) , uno::UNO_QUERY); - static const OUStringLiteral s_sOld = u"OldFormat"; + static constexpr OUStringLiteral s_sOld = u"OldFormat"; static comphelper::PropertyMapEntry const pMap[] = { { OUString("OldFormat") , 1, cppu::UnoType<sal_Bool>::get(), beans::PropertyAttribute::BOUND, 0 }, @@ -436,8 +436,8 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) xProp->setPropertyValue("StreamRelPath", uno::makeAny(sHierarchicalDocumentName)); uno::Reference<XComponent> xModel = GetModel(); - static const OUStringLiteral s_sMeta = u"meta.xml"; - static const OUStringLiteral s_sStreamName = u"StreamName"; + static constexpr OUStringLiteral s_sMeta = u"meta.xml"; + static constexpr OUStringLiteral s_sStreamName = u"StreamName"; xProp->setPropertyValue(s_sStreamName, uno::makeAny(OUString(s_sMeta))); ErrCode nRet = ReadThroughComponent( xStorage ,xModel @@ -758,7 +758,7 @@ bool ORptFilter::isOldFormat() const uno::Reference<beans::XPropertySet> xProp = getImportInfo(); if ( xProp.is() ) { - static const OUStringLiteral s_sOld = u"OldFormat"; + static constexpr OUStringLiteral s_sOld = u"OldFormat"; if ( xProp->getPropertySetInfo()->hasPropertyByName(s_sOld)) { xProp->getPropertyValue(s_sOld) >>= bOldFormat; diff --git a/sc/qa/unit/helper/shared_test_impl.hxx b/sc/qa/unit/helper/shared_test_impl.hxx index ae77d0ebf44e..d3a2cc86400d 100644 --- a/sc/qa/unit/helper/shared_test_impl.hxx +++ b/sc/qa/unit/helper/shared_test_impl.hxx @@ -278,7 +278,7 @@ void testCeilingFloor_Impl( ScDocument& rDoc ) { // Original test case document is ceiling-floor.xlsx // Sheet1.K1 has =AND(K3:K81) to evaluate all results. - static const OUStringLiteral pORef = u"Sheet1.K1"; + static constexpr OUStringLiteral pORef = u"Sheet1.K1"; ScAddress aPos; aPos.Parse(pORef, rDoc); ASSERT_FORMULA_EQUAL(rDoc, aPos, "AND(K3:K81)", "Wrong formula."); diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index c7d70f4ac82e..484236861152 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -64,7 +64,7 @@ * be synchronized with Writer's SwTableAutoFmtTbl sw/source/core/doc/tblafmt.cxx */ -const OUStringLiteral sAutoTblFmtName = u"autotbl.fmt"; +constexpr OUStringLiteral sAutoTblFmtName = u"autotbl.fmt"; // till SO5PF const sal_uInt16 AUTOFORMAT_ID_X = 9501; diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index f68cc4a62a1a..feeecf885fe6 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -140,10 +140,10 @@ using ::std::vector; // Filter names (like in sclib.cxx) -const OUStringLiteral pFilterSc50 = u"StarCalc 5.0"; +constexpr OUStringLiteral pFilterSc50 = u"StarCalc 5.0"; const char pFilterXML[] = "StarOffice XML (Calc)"; -const OUStringLiteral pFilterAscii = u"" SC_TEXT_CSV_FILTER_NAME; -const OUStringLiteral pFilterLotus = u"Lotus"; +constexpr OUStringLiteral pFilterAscii = u"" SC_TEXT_CSV_FILTER_NAME; +constexpr OUStringLiteral pFilterLotus = u"Lotus"; const char pFilterQPro6[] = "Quattro Pro 6.0"; const char16_t pFilterExcel4[] = u"MS Excel 4.0"; const char16_t pFilterEx4Temp[] = u"MS Excel 4.0 Vorlage/Template"; @@ -153,11 +153,11 @@ const char pFilterExcel95[] = "MS Excel 95"; const char pFilterEx95Temp[] = "MS Excel 95 Vorlage/Template"; const char pFilterExcel97[] = "MS Excel 97"; const char pFilterEx97Temp[] = "MS Excel 97 Vorlage/Template"; -const OUStringLiteral pFilterDBase = u"dBase"; -const OUStringLiteral pFilterDif = u"DIF"; +constexpr OUStringLiteral pFilterDBase = u"dBase"; +constexpr OUStringLiteral pFilterDif = u"DIF"; const char16_t pFilterSylk[] = u"SYLK"; -const OUStringLiteral pFilterHtml = u"HTML (StarCalc)"; -const OUStringLiteral pFilterHtmlWebQ = u"calc_HTML_WebQuery"; +constexpr OUStringLiteral pFilterHtml = u"HTML (StarCalc)"; +constexpr OUStringLiteral pFilterHtmlWebQ = u"calc_HTML_WebQuery"; const char16_t pFilterRtf[] = u"Rich Text Format (StarCalc)"; #define ShellClass_ScDocShell diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 4835a75edabe..1087b2bcec51 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1150,7 +1150,7 @@ static bool lcl_PutString( sal_Int16 nMonth = static_cast<sal_Int16>(aMStr.toInt32()); if (!nMonth) { - static const OUStringLiteral aSepShortened = u"SEP"; + static constexpr OUStringLiteral aSepShortened = u"SEP"; uno::Sequence< i18n::CalendarItem2 > xMonths; sal_Int32 i, nMonthCount; // first test all month names from local international diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx index 5de763f8b4f4..55cf60cb08c1 100644 --- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx +++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx @@ -36,8 +36,8 @@ using namespace css; using namespace css::uno; -const OStringLiteral SETBORDERSTYLE = "SetBorderStyle"; -const OStringLiteral LINESTYLE = "LineStyle"; +constexpr OStringLiteral SETBORDERSTYLE = "SetBorderStyle"; +constexpr OStringLiteral LINESTYLE = "LineStyle"; // namespace open diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx index be098444b670..34998adcbb16 100644 --- a/sc/source/ui/vba/vbaborders.cxx +++ b/sc/source/ui/vba/vbaborders.cxx @@ -42,7 +42,7 @@ typedef InheritedHelperInterfaceWeakImpl<excel::XBorder > ScVbaBorder_Base; // borders, the enumeration will match the order in this list const sal_Int16 supportedIndexTable[] = { XlBordersIndex::xlEdgeLeft, XlBordersIndex::xlEdgeTop, XlBordersIndex::xlEdgeBottom, XlBordersIndex::xlEdgeRight, XlBordersIndex::xlDiagonalDown, XlBordersIndex::xlDiagonalUp, XlBordersIndex::xlInsideVertical, XlBordersIndex::xlInsideHorizontal }; -const OUStringLiteral sTableBorder = u"TableBorder"; +constexpr OUStringLiteral sTableBorder = u"TableBorder"; // Equiv widths in 1/100 mm const sal_Int32 OOLineThin = 35; diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx index 6a38df7d8ba4..c4f83e972789 100644 --- a/sc/source/ui/vba/vbainterior.cxx +++ b/sc/source/ui/vba/vbainterior.cxx @@ -34,9 +34,9 @@ using namespace ::com::sun::star; using namespace ::ooo::vba; using namespace ::ooo::vba::excel::XlPattern; -const OUStringLiteral BACKCOLOR = u"CellBackColor"; -const OUStringLiteral PATTERN = u"Pattern"; -const OUStringLiteral PATTERNCOLOR = u"PatternColor"; +constexpr OUStringLiteral BACKCOLOR = u"CellBackColor"; +constexpr OUStringLiteral PATTERN = u"Pattern"; +constexpr OUStringLiteral PATTERNCOLOR = u"PatternColor"; static std::map< sal_Int32, sal_Int32 > aPatternMap { { xlPatternAutomatic, 0 }, diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index b67751245cc6..1dd212e61bb2 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -670,7 +670,7 @@ public: } -const OUStringLiteral ISVISIBLE = u"IsVisible"; +constexpr OUStringLiteral ISVISIBLE = u"IsVisible"; const char EQUALS[] = "="; const char NOTEQUALS[] = "<>"; const char GREATERTHAN[] = ">"; @@ -678,7 +678,7 @@ const char GREATERTHANEQUALS[] = ">="; const char LESSTHAN[] = "<"; const char LESSTHANEQUALS[] = "<="; constexpr OUStringLiteral STR_ERRORMESSAGE_APPLIESTOSINGLERANGEONLY(u"The command you chose cannot be performed with multiple selections.\nSelect a single range and click the command again"); -const OUStringLiteral CELLSTYLE = u"CellStyle"; +constexpr OUStringLiteral CELLSTYLE = u"CellStyle"; namespace { @@ -967,7 +967,7 @@ public: } -const OUStringLiteral sNA = u"#N/A"; +constexpr OUStringLiteral sNA = u"#N/A"; namespace { diff --git a/sc/source/ui/vba/vbastyle.cxx b/sc/source/ui/vba/vbastyle.cxx index 638ee7bdd734..da4e756cf7b6 100644 --- a/sc/source/ui/vba/vbastyle.cxx +++ b/sc/source/ui/vba/vbastyle.cxx @@ -25,7 +25,7 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -const OUStringLiteral DISPLAYNAME = u"DisplayName"; +constexpr OUStringLiteral DISPLAYNAME = u"DisplayName"; uno::Reference< container::XNameAccess > ScVbaStyle::getStylesNameContainer( const uno::Reference< frame::XModel >& xModel ) diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx index 62f612baa53b..d52660904471 100644 --- a/scripting/source/dlgprov/dlgprov.cxx +++ b/scripting/source/dlgprov/dlgprov.cxx @@ -555,7 +555,7 @@ namespace dlgprov // XDialogProvider - const OUStringLiteral aDecorationPropName = u"Decoration"; + constexpr OUStringLiteral aDecorationPropName = u"Decoration"; Reference < XControl > DialogProviderImpl::createDialogImpl( const OUString& URL, const Reference< XInterface >& xHandler, diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 88f2cd68220c..c7819eafa3a9 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -2222,7 +2222,7 @@ OUString const & HtmlExport::getDocumentTitle() return mDocTitle; } -const OUStringLiteral JS_NavigateAbs = +constexpr OUStringLiteral JS_NavigateAbs = u"function NavigateAbs( nPage )\r\n" "{\r\n" " frames[\"show\"].location.href = \"img\" + nPage + \".$EXT\";\r\n" diff --git a/sd/source/ui/framework/factories/PresentationFactory.cxx b/sd/source/ui/framework/factories/PresentationFactory.cxx index cb1bcf5b88a0..44d46ded8ab7 100644 --- a/sd/source/ui/framework/factories/PresentationFactory.cxx +++ b/sd/source/ui/framework/factories/PresentationFactory.cxx @@ -86,7 +86,7 @@ private: //===== PresentationFactory =================================================== -const OUStringLiteral gsPresentationViewURL = u"private:resource/view/Presentation"; +constexpr OUStringLiteral gsPresentationViewURL = u"private:resource/view/Presentation"; PresentationFactory::PresentationFactory ( const Reference<frame::XController>& rxController) diff --git a/sd/source/ui/inc/unokywds.hxx b/sd/source/ui/inc/unokywds.hxx index 07ba9cd3e3ec..63b5553abc9f 100644 --- a/sd/source/ui/inc/unokywds.hxx +++ b/sd/source/ui/inc/unokywds.hxx @@ -23,18 +23,20 @@ #include <sal/config.h> // SdUnoPseudoStyleFamily -inline const OUStringLiteral sUNO_PseudoSheet_Background = u"background"; +inline constexpr OUStringLiteral sUNO_PseudoSheet_Background = u"background"; // SdLayer -inline const OUStringLiteral sUNO_LayerName_background = u"background"; -inline const OUStringLiteral sUNO_LayerName_background_objects = u"backgroundobjects"; -inline const OUStringLiteral sUNO_LayerName_layout = u"layout"; -inline const OUStringLiteral sUNO_LayerName_controls = u"controls"; -inline const OUStringLiteral sUNO_LayerName_measurelines = u"measurelines"; +inline constexpr OUStringLiteral sUNO_LayerName_background = u"background"; +inline constexpr OUStringLiteral sUNO_LayerName_background_objects = u"backgroundobjects"; +inline constexpr OUStringLiteral sUNO_LayerName_layout = u"layout"; +inline constexpr OUStringLiteral sUNO_LayerName_controls = u"controls"; +inline constexpr OUStringLiteral sUNO_LayerName_measurelines = u"measurelines"; // services -inline const OUStringLiteral sUNO_Service_FillProperties = u"com.sun.star.drawing.FillProperties"; -inline const OUStringLiteral sUNO_Service_PageBackground = u"com.sun.star.drawing.PageBackground"; +inline constexpr OUStringLiteral sUNO_Service_FillProperties + = u"com.sun.star.drawing.FillProperties"; +inline constexpr OUStringLiteral sUNO_Service_PageBackground + = u"com.sun.star.drawing.PageBackground"; inline const char sUNO_Service_ImageMapRectangleObject[] = "com.sun.star.image.ImageMapRectangleObject"; inline const char sUNO_Service_ImageMapCircleObject[] = "com.sun.star.image.ImageMapCircleObject"; @@ -58,54 +60,55 @@ inline const char16_t sUNO_Prop_InteropGrabBag[] = u"InteropGrabBag"; // view settings inline const char sUNO_View_ViewId[] = "ViewId"; -inline const OUStringLiteral sUNO_View_SnapLinesDrawing = u"SnapLinesDrawing"; -inline const OUStringLiteral sUNO_View_SnapLinesNotes = u"SnapLinesNotes"; -inline const OUStringLiteral sUNO_View_SnapLinesHandout = u"SnapLinesHandout"; -inline const OUStringLiteral sUNO_View_RulerIsVisible = u"RulerIsVisible"; -inline const OUStringLiteral sUNO_View_PageKind = u"PageKind"; -inline const OUStringLiteral sUNO_View_SelectedPage = u"SelectedPage"; -inline const OUStringLiteral sUNO_View_IsLayerMode = u"IsLayerMode"; -inline const OUStringLiteral sUNO_View_IsDoubleClickTextEdit = u"IsDoubleClickTextEdit"; -inline const OUStringLiteral sUNO_View_IsClickChangeRotation = u"IsClickChangeRotation"; -inline const OUStringLiteral sUNO_View_SlidesPerRow = u"SlidesPerRow"; -inline const OUStringLiteral sUNO_View_EditMode = u"EditMode"; +inline constexpr OUStringLiteral sUNO_View_SnapLinesDrawing = u"SnapLinesDrawing"; +inline constexpr OUStringLiteral sUNO_View_SnapLinesNotes = u"SnapLinesNotes"; +inline constexpr OUStringLiteral sUNO_View_SnapLinesHandout = u"SnapLinesHandout"; +inline constexpr OUStringLiteral sUNO_View_RulerIsVisible = u"RulerIsVisible"; +inline constexpr OUStringLiteral sUNO_View_PageKind = u"PageKind"; +inline constexpr OUStringLiteral sUNO_View_SelectedPage = u"SelectedPage"; +inline constexpr OUStringLiteral sUNO_View_IsLayerMode = u"IsLayerMode"; +inline constexpr OUStringLiteral sUNO_View_IsDoubleClickTextEdit = u"IsDoubleClickTextEdit"; +inline constexpr OUStringLiteral sUNO_View_IsClickChangeRotation = u"IsClickChangeRotation"; +inline constexpr OUStringLiteral sUNO_View_SlidesPerRow = u"SlidesPerRow"; +inline constexpr OUStringLiteral sUNO_View_EditMode = u"EditMode"; inline const char sUNO_View_EditModeStandard[] = "EditModeStandard"; // To be deprecated // inline const char sUNO_View_EditModeNotes[] = "EditModeNotes"; // inline const char sUNO_View_EditModeHandout[] = "EditModeHandout"; -inline const OUStringLiteral sUNO_View_GridIsVisible = u"GridIsVisible"; -inline const OUStringLiteral sUNO_View_GridIsFront = u"GridIsFront"; -inline const OUStringLiteral sUNO_View_IsSnapToGrid = u"IsSnapToGrid"; -inline const OUStringLiteral sUNO_View_IsSnapToPageMargins = u"IsSnapToPageMargins"; -inline const OUStringLiteral sUNO_View_IsSnapToSnapLines = u"IsSnapToSnapLines"; -inline const OUStringLiteral sUNO_View_IsSnapToObjectFrame = u"IsSnapToObjectFrame"; -inline const OUStringLiteral sUNO_View_IsSnapToObjectPoints = u"IsSnapToObjectPoints"; -inline const OUStringLiteral sUNO_View_IsPlusHandlesAlwaysVisible = u"IsPlusHandlesAlwaysVisible"; -inline const OUStringLiteral sUNO_View_IsFrameDragSingles = u"IsFrameDragSingles"; -inline const OUStringLiteral sUNO_View_EliminatePolyPointLimitAngle +inline constexpr OUStringLiteral sUNO_View_GridIsVisible = u"GridIsVisible"; +inline constexpr OUStringLiteral sUNO_View_GridIsFront = u"GridIsFront"; +inline constexpr OUStringLiteral sUNO_View_IsSnapToGrid = u"IsSnapToGrid"; +inline constexpr OUStringLiteral sUNO_View_IsSnapToPageMargins = u"IsSnapToPageMargins"; +inline constexpr OUStringLiteral sUNO_View_IsSnapToSnapLines = u"IsSnapToSnapLines"; +inline constexpr OUStringLiteral sUNO_View_IsSnapToObjectFrame = u"IsSnapToObjectFrame"; +inline constexpr OUStringLiteral sUNO_View_IsSnapToObjectPoints = u"IsSnapToObjectPoints"; +inline constexpr OUStringLiteral sUNO_View_IsPlusHandlesAlwaysVisible + = u"IsPlusHandlesAlwaysVisible"; +inline constexpr OUStringLiteral sUNO_View_IsFrameDragSingles = u"IsFrameDragSingles"; +inline constexpr OUStringLiteral sUNO_View_EliminatePolyPointLimitAngle = u"EliminatePolyPointLimitAngle"; -inline const OUStringLiteral sUNO_View_IsEliminatePolyPoints = u"IsEliminatePolyPoints"; +inline constexpr OUStringLiteral sUNO_View_IsEliminatePolyPoints = u"IsEliminatePolyPoints"; inline const char sUNO_View_ActiveLayer[] = "ActiveLayer"; -inline const OUStringLiteral sUNO_View_NoAttribs = u"NoAttribs"; -inline const OUStringLiteral sUNO_View_NoColors = u"NoColors"; -inline const OUStringLiteral sUNO_View_GridCoarseWidth = u"GridCoarseWidth"; -inline const OUStringLiteral sUNO_View_GridCoarseHeight = u"GridCoarseHeight"; -inline const OUStringLiteral sUNO_View_GridFineWidth = u"GridFineWidth"; -inline const OUStringLiteral sUNO_View_GridFineHeight = u"GridFineHeight"; -inline const OUStringLiteral sUNO_View_IsAngleSnapEnabled = u"IsAngleSnapEnabled"; -inline const OUStringLiteral sUNO_View_SnapAngle = u"SnapAngle"; -inline const OUStringLiteral sUNO_View_GridSnapWidthXNumerator = u"GridSnapWidthXNumerator"; -inline const OUStringLiteral sUNO_View_GridSnapWidthXDenominator = u"GridSnapWidthXDenominator"; -inline const OUStringLiteral sUNO_View_GridSnapWidthYNumerator = u"GridSnapWidthYNumerator"; -inline const OUStringLiteral sUNO_View_GridSnapWidthYDenominator = u"GridSnapWidthYDenominator"; -inline const OUStringLiteral sUNO_View_VisibleLayers = u"VisibleLayers"; -inline const OUStringLiteral sUNO_View_PrintableLayers = u"PrintableLayers"; -inline const OUStringLiteral sUNO_View_LockedLayers = u"LockedLayers"; +inline constexpr OUStringLiteral sUNO_View_NoAttribs = u"NoAttribs"; +inline constexpr OUStringLiteral sUNO_View_NoColors = u"NoColors"; +inline constexpr OUStringLiteral sUNO_View_GridCoarseWidth = u"GridCoarseWidth"; +inline constexpr OUStringLiteral sUNO_View_GridCoarseHeight = u"GridCoarseHeight"; +inline constexpr OUStringLiteral sUNO_View_GridFineWidth = u"GridFineWidth"; +inline constexpr OUStringLiteral sUNO_View_GridFineHeight = u"GridFineHeight"; +inline constexpr OUStringLiteral sUNO_View_IsAngleSnapEnabled = u"IsAngleSnapEnabled"; +inline constexpr OUStringLiteral sUNO_View_SnapAngle = u"SnapAngle"; +inline constexpr OUStringLiteral sUNO_View_GridSnapWidthXNumerator = u"GridSnapWidthXNumerator"; +inline constexpr OUStringLiteral sUNO_View_GridSnapWidthXDenominator = u"GridSnapWidthXDenominator"; +inline constexpr OUStringLiteral sUNO_View_GridSnapWidthYNumerator = u"GridSnapWidthYNumerator"; +inline constexpr OUStringLiteral sUNO_View_GridSnapWidthYDenominator = u"GridSnapWidthYDenominator"; +inline constexpr OUStringLiteral sUNO_View_VisibleLayers = u"VisibleLayers"; +inline constexpr OUStringLiteral sUNO_View_PrintableLayers = u"PrintableLayers"; +inline constexpr OUStringLiteral sUNO_View_LockedLayers = u"LockedLayers"; -inline const OUStringLiteral sUNO_View_VisibleAreaTop = u"VisibleAreaTop"; -inline const OUStringLiteral sUNO_View_VisibleAreaLeft = u"VisibleAreaLeft"; -inline const OUStringLiteral sUNO_View_VisibleAreaWidth = u"VisibleAreaWidth"; -inline const OUStringLiteral sUNO_View_VisibleAreaHeight = u"VisibleAreaHeight"; +inline constexpr OUStringLiteral sUNO_View_VisibleAreaTop = u"VisibleAreaTop"; +inline constexpr OUStringLiteral sUNO_View_VisibleAreaLeft = u"VisibleAreaLeft"; +inline constexpr OUStringLiteral sUNO_View_VisibleAreaWidth = u"VisibleAreaWidth"; +inline constexpr OUStringLiteral sUNO_View_VisibleAreaHeight = u"VisibleAreaHeight"; inline const char sUNO_View_ZoomOnPage[] = "ZoomOnPage"; #endif diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx index ca0fd8ae490b..bbd1e862e1d5 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -50,7 +50,7 @@ namespace sd::sidebar { /** menu entry that is executed as default action when the left mouse button is clicked over a master page. */ -const OStringLiteral gsDefaultClickAction = "applyselect"; +constexpr OStringLiteral gsDefaultClickAction = "applyselect"; MasterPagesSelector::MasterPagesSelector ( vcl::Window* pParent, diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx index f3c881af253f..1c86d4c644c0 100644 --- a/sd/source/ui/tools/EventMultiplexer.cxx +++ b/sd/source/ui/tools/EventMultiplexer.cxx @@ -139,8 +139,8 @@ private: DECL_LINK(SlideSorterSelectionChangeListener, LinkParamNone*, void); }; -const OUStringLiteral aCurrentPagePropertyName = u"CurrentPage"; -const OUStringLiteral aEditModePropertyName = u"IsMasterPageMode"; +constexpr OUStringLiteral aCurrentPagePropertyName = u"CurrentPage"; +constexpr OUStringLiteral aEditModePropertyName = u"IsMasterPageMode"; //===== EventMultiplexer ====================================================== diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx index 697ea5d5910c..a82460b7fb7c 100644 --- a/sd/source/ui/unoidl/DrawController.cxx +++ b/sd/source/ui/unoidl/DrawController.cxx @@ -203,7 +203,7 @@ OUString SAL_CALL DrawController::getImplementationName( ) return "DrawController" ; } -const OUStringLiteral ssServiceName = u"com.sun.star.drawing.DrawingDocumentDrawView"; +constexpr OUStringLiteral ssServiceName = u"com.sun.star.drawing.DrawingDocumentDrawView"; sal_Bool SAL_CALL DrawController::supportsService (const OUString& rsServiceName) { diff --git a/sdext/source/pdfimport/test/tests.cxx b/sdext/source/pdfimport/test/tests.cxx index dd118cc3aea9..0865224a7684 100644 --- a/sdext/source/pdfimport/test/tests.cxx +++ b/sdext/source/pdfimport/test/tests.cxx @@ -226,7 +226,7 @@ namespace CPPUNIT_ASSERT_MESSAGE( "Line width is 0", rtl::math::approxEqual(rContext.LineWidth, 28.3) ); - static const OUStringLiteral sExportString = u"m53570 7650-35430 24100"; + static constexpr OUStringLiteral sExportString = u"m53570 7650-35430 24100"; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Stroke is m535.7 518.5-354.3-241", OUString(sExportString), basegfx::utils::exportToSvgD( aPath, true, true, false ) ); @@ -248,7 +248,7 @@ namespace CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Line width is 0", 0, rContext.LineWidth, 0.0000001 ); - static const OUStringLiteral sExportString = u"m49890 5670.00000000001-35430 24090"; + static constexpr OUStringLiteral sExportString = u"m49890 5670.00000000001-35430 24090"; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Stroke is m49890 5670.00000000001-35430 24090", OUString(sExportString), basegfx::utils::exportToSvgD( aPath, true, true, false ) ); @@ -305,7 +305,7 @@ namespace CPPUNIT_ASSERT_EQUAL_MESSAGE( "Font id is 0", sal_Int32(0), rContext.FontId ); - static const OUStringLiteral sExportString + static constexpr OUStringLiteral sExportString = u"m12050 49610c-4310 0-7800-3490-7800-7800 0-4300 " "3490-7790 7800-7790 4300 0 7790 3490 7790 7790 0 4310-3490 7800-7790 7800z"; CPPUNIT_ASSERT_EQUAL_MESSAGE( "Stroke is a 4-bezier circle", diff --git a/sfx2/source/control/emojicontrol.cxx b/sfx2/source/control/emojicontrol.cxx index 67d097584645..c3e9910ddacd 100644 --- a/sfx2/source/control/emojicontrol.cxx +++ b/sfx2/source/control/emojicontrol.cxx @@ -26,15 +26,15 @@ #include <comphelper/dispatchcommand.hxx> #include <officecfg/Office/Common.hxx> -const OStringLiteral FILTER_PEOPLE = "people"; -const OStringLiteral FILTER_NATURE = "nature"; -const OStringLiteral FILTER_FOOD = "food"; -const OStringLiteral FILTER_ACTIVITY = "activity"; -const OStringLiteral FILTER_TRAVEL = "travel"; -const OStringLiteral FILTER_OBJECTS = "objects"; -const OStringLiteral FILTER_SYMBOLS = "symbols"; -const OStringLiteral FILTER_FLAGS = "flags"; -const OStringLiteral FILTER_UNICODE9 = "unicode9"; +constexpr OStringLiteral FILTER_PEOPLE = "people"; +constexpr OStringLiteral FILTER_NATURE = "nature"; +constexpr OStringLiteral FILTER_FOOD = "food"; +constexpr OStringLiteral FILTER_ACTIVITY = "activity"; +constexpr OStringLiteral FILTER_TRAVEL = "travel"; +constexpr OStringLiteral FILTER_OBJECTS = "objects"; +constexpr OStringLiteral FILTER_SYMBOLS = "symbols"; +constexpr OStringLiteral FILTER_FLAGS = "flags"; +constexpr OStringLiteral FILTER_UNICODE9 = "unicode9"; using namespace com::sun::star; diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index e1ed8755103f..1386ad3a641b 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -57,7 +57,7 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::document; -const OUStringLiteral SERVICENAME_CFGREADACCESS = u"com.sun.star.configuration.ConfigurationAccess"; +constexpr OUStringLiteral SERVICENAME_CFGREADACCESS = u"com.sun.star.configuration.ConfigurationAccess"; // increase size of the text in the buttons on the left fMultiplier-times float const g_fMultiplier = 1.4f; diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 87ebec96b01a..69afa482fa10 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -126,9 +126,9 @@ namespace static std::optional<OUString> GetLastFilterConfigId( FileDialogHelper::Context _eContext ) { - static const OUStringLiteral aSD_EXPORT_IDENTIFIER(u"SdExportLastFilter"); - static const OUStringLiteral aSI_EXPORT_IDENTIFIER(u"SiExportLastFilter"); - static const OUStringLiteral aSW_EXPORT_IDENTIFIER(u"SwExportLastFilter"); + static constexpr OUStringLiteral aSD_EXPORT_IDENTIFIER(u"SdExportLastFilter"); + static constexpr OUStringLiteral aSI_EXPORT_IDENTIFIER(u"SiExportLastFilter"); + static constexpr OUStringLiteral aSW_EXPORT_IDENTIFIER(u"SwExportLastFilter"); switch( _eContext ) { diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 5f109cdf3f54..13e4d0bde45b 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -85,9 +85,9 @@ bool isValidNCName(std::u16string_view i_rIdref) } -const OUStringLiteral s_content = u"content.xml"; -const OUStringLiteral s_styles = u"styles.xml"; -const OUStringLiteral s_manifest = u"manifest.rdf"; +constexpr OUStringLiteral s_content = u"content.xml"; +constexpr OUStringLiteral s_styles = u"styles.xml"; +constexpr OUStringLiteral s_manifest = u"manifest.rdf"; const char s_odfmime [] = "application/vnd.oasis.opendocument."; diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx index e77546076df3..595adefd256b 100644 --- a/sfx2/source/doc/Metadatable.cxx +++ b/sfx2/source/doc/Metadatable.cxx @@ -112,8 +112,8 @@ using ::sfx2::isValidXmlId; namespace sfx2 { -const OUStringLiteral s_content = u"content.xml"; -const OUStringLiteral s_styles = u"styles.xml"; +constexpr OUStringLiteral s_content = u"content.xml"; +constexpr OUStringLiteral s_styles = u"styles.xml"; static bool isContentFile(std::u16string_view i_rPath) { diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index f26eae3b3add..0c406c76fe24 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -403,13 +403,13 @@ const char* s_stdMetaList[] = { nullptr }; -const OUStringLiteral s_nsXLink = u"http://www.w3.org/1999/xlink"; -const OUStringLiteral s_nsDC = u"http://purl.org/dc/elements/1.1/"; -const OUStringLiteral s_nsODF = u"urn:oasis:names:tc:opendocument:xmlns:office:1.0"; -const OUStringLiteral s_nsODFMeta = u"urn:oasis:names:tc:opendocument:xmlns:meta:1.0"; -// const char* s_nsOOo = "http://openoffice.org/2004/office"; // not used (yet?) +constexpr OUStringLiteral s_nsXLink = u"http://www.w3.org/1999/xlink"; +constexpr OUStringLiteral s_nsDC = u"http://purl.org/dc/elements/1.1/"; +constexpr OUStringLiteral s_nsODF = u"urn:oasis:names:tc:opendocument:xmlns:office:1.0"; +constexpr OUStringLiteral s_nsODFMeta = u"urn:oasis:names:tc:opendocument:xmlns:meta:1.0"; +// constexpr OUStringLiteral s_nsOOo = "http://openoffice.org/2004/office"; // not used (yet?) -const OUStringLiteral s_meta = u"meta.xml"; +constexpr OUStringLiteral s_meta = u"meta.xml"; bool isValidDate(const css::util::Date & i_rDate) { diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 3bc794343f8c..93c5ab52ab47 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -133,7 +133,7 @@ void SfxObjectFactory::SetSystemTemplate( const OUString& rServiceName, const OU static const int nMaxPathSize = 16000; const OUString sConfPath = "Office/Factories/" + rServiceName; - static const OUStringLiteral PROP_DEF_TEMPL_CHANGED + static constexpr OUStringLiteral PROP_DEF_TEMPL_CHANGED = u"ooSetupFactorySystemDefaultTemplateChanged"; static const char DEF_TPL_STR[] = "/soffice."; diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 18a3bd42b907..9def55f25e67 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -111,9 +111,9 @@ #define STATUS_SAVEAS 2 #define STATUS_SAVEAS_STANDARDNAME 3 -const OUStringLiteral aFilterNameString = u"FilterName"; -const OUStringLiteral aFilterOptionsString = u"FilterOptions"; -const OUStringLiteral aFilterDataString = u"FilterData"; +constexpr OUStringLiteral aFilterNameString = u"FilterName"; +constexpr OUStringLiteral aFilterOptionsString = u"FilterOptions"; +constexpr OUStringLiteral aFilterDataString = u"FilterData"; using namespace ::com::sun::star; using namespace css::system; diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 1f4bd0dccfb4..8456d4cd7e99 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -54,10 +54,10 @@ #include <sfx2/strings.hrc> -const OUStringLiteral TM_SETTING_MANAGER = u"TemplateManager"; -const OUStringLiteral TM_SETTING_LASTFOLDER = u"LastFolder"; -const OUStringLiteral TM_SETTING_LASTAPPLICATION = u"LastApplication"; -const OUStringLiteral TM_SETTING_VIEWMODE = u"ViewMode"; +constexpr OUStringLiteral TM_SETTING_MANAGER = u"TemplateManager"; +constexpr OUStringLiteral TM_SETTING_LASTFOLDER = u"LastFolder"; +constexpr OUStringLiteral TM_SETTING_LASTAPPLICATION = u"LastApplication"; +constexpr OUStringLiteral TM_SETTING_VIEWMODE = u"ViewMode"; #define MNI_ACTION_NEW_FOLDER "new" #define MNI_ACTION_RENAME_FOLDER "rename" diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index e6cf00fe376f..168719f84d23 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -65,7 +65,7 @@ using namespace css::uno; namespace { - const OUStringLiteral gsReadOnlyCommandName = u".uno:EditDoc"; + constexpr OUStringLiteral gsReadOnlyCommandName = u".uno:EditDoc"; const sal_Int32 gnWidthCloseThreshold (70); const sal_Int32 gnWidthOpenThreshold (40); diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx index 055c9e5563e3..485b3cf1512d 100644 --- a/stoc/source/security/access_controller.cxx +++ b/stoc/source/security/access_controller.cxx @@ -63,7 +63,7 @@ namespace { // static stuff initialized when loading lib OUString s_envType = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -const OUStringLiteral s_acRestriction = u"access-control.restriction"; +constexpr OUStringLiteral s_acRestriction = u"access-control.restriction"; /** ac context intersects permissions of two ac contexts diff --git a/svgio/source/svgreader/svgtoken.cxx b/svgio/source/svgreader/svgtoken.cxx index 590e85b0a96d..20ce65a53c49 100644 --- a/svgio/source/svgreader/svgtoken.cxx +++ b/svgio/source/svgreader/svgtoken.cxx @@ -91,8 +91,8 @@ namespace svgio::svgreader const char aSVGStrPatternTransform[] = "patternTransform"; const char aSVGStrOpacity[] = "opacity"; const char aSVGStrVisibility[] = "visibility"; - const OUStringLiteral aSVGStrTitle = u"title"; - const OUStringLiteral aSVGStrDesc = u"desc"; + constexpr OUStringLiteral aSVGStrTitle = u"title"; + constexpr OUStringLiteral aSVGStrDesc = u"desc"; const char aSVGStrPreserveAspectRatio[] = "preserveAspectRatio"; const char aSVGStrDefer[] = "defer"; diff --git a/svtools/source/config/fontsubstconfig.cxx b/svtools/source/config/fontsubstconfig.cxx index e3c156fbfb36..a77f2e59b775 100644 --- a/svtools/source/config/fontsubstconfig.cxx +++ b/svtools/source/config/fontsubstconfig.cxx @@ -32,13 +32,13 @@ using namespace com::sun::star::uno; using namespace com::sun::star::beans; -const OUStringLiteral cReplacement = u"Replacement"; -const OUStringLiteral cFontPairs = u"FontPairs"; +constexpr OUStringLiteral cReplacement = u"Replacement"; +constexpr OUStringLiteral cFontPairs = u"FontPairs"; -const OUStringLiteral cReplaceFont = u"ReplaceFont"; -const OUStringLiteral cSubstituteFont= u"SubstituteFont"; -const OUStringLiteral cOnScreenOnly = u"OnScreenOnly"; -const OUStringLiteral cAlways = u"Always"; +constexpr OUStringLiteral cReplaceFont = u"ReplaceFont"; +constexpr OUStringLiteral cSubstituteFont= u"SubstituteFont"; +constexpr OUStringLiteral cOnScreenOnly = u"OnScreenOnly"; +constexpr OUStringLiteral cAlways = u"Always"; typedef std::vector<SubstitutionStruct> SubstitutionStructArr; diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx index e96962254521..950193cce994 100644 --- a/svtools/source/misc/sampletext.cxx +++ b/svtools/source/misc/sampletext.cxx @@ -150,14 +150,14 @@ OUString makeShortRepresentativeSymbolTextForSelectedFont(OutputDevice const &rD { if (rDevice.GetFont().GetFamilyName() == "Symbol") { - static const OUStringLiteral aImplAppleSymbolText = + static constexpr OUStringLiteral aImplAppleSymbolText = u"\u03BC\u2202\u2211\u220F\u03C0\u222B\u03A9\u221A"; bool bHasSampleTextGlyphs = (-1 == rDevice.HasGlyphs(rDevice.GetFont(), aImplAppleSymbolText)); //It's the Apple version if (bHasSampleTextGlyphs) return aImplAppleSymbolText; - static const OUStringLiteral aImplAdobeSymbolText = + static constexpr OUStringLiteral aImplAdobeSymbolText = u"\uF06D\uF0B6\uF0E5\uF0D5\uF070\uF0F2\uF057\uF0D6"; return aImplAdobeSymbolText; } diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index e3da167c21bb..86476da1903c 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -33,7 +33,7 @@ #include <comphelper/processfactory.hxx> const int TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIBLE = 1; -const OUStringLiteral TOOLBARCONTROLLER_PROPNAME_SUPPORTSVISIBLE = u"SupportsVisible"; +constexpr OUStringLiteral TOOLBARCONTROLLER_PROPNAME_SUPPORTSVISIBLE = u"SupportsVisible"; using namespace ::cppu; diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx index 3094d9a297ee..3ec1408ebfe5 100644 --- a/svtools/source/uno/unoevent.cxx +++ b/svtools/source/uno/unoevent.cxx @@ -33,13 +33,13 @@ using css::lang::IllegalArgumentException; using css::beans::PropertyValue; -const OUStringLiteral sAPI_ServiceName = u"com.sun.star.container.XNameReplace"; +constexpr OUStringLiteral sAPI_ServiceName = u"com.sun.star.container.XNameReplace"; const char sEventType[] = "EventType"; const char sMacroName[] = "MacroName"; const char sLibrary[] = "Library"; -const OUStringLiteral sStarBasic = u"StarBasic"; -const OUStringLiteral sScript = u"Script"; -const OUStringLiteral sNone = u"None"; +constexpr OUStringLiteral sStarBasic = u"StarBasic"; +constexpr OUStringLiteral sScript = u"Script"; +constexpr OUStringLiteral sNone = u"None"; namespace { diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 47c9a5179e31..0780801cd3b0 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -493,8 +493,8 @@ awt::Rectangle SAL_CALL AccessibleShape::getBounds() if ( mxShape.is() ) { - static const OUStringLiteral sBoundRectName = u"BoundRect"; - static const OUStringLiteral sAnchorPositionName = u"AnchorPosition"; + static constexpr OUStringLiteral sBoundRectName = u"BoundRect"; + static constexpr OUStringLiteral sAnchorPositionName = u"AnchorPosition"; // Get the shape's bounding box in internal coordinates (in 100th of // mm). Use the property BoundRect. Only if that is not supported ask diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 479378b2fe5f..4db7c54d5623 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -1670,7 +1670,7 @@ void FmGridControl::InitColumnByField( } // the control type is determined by the ColumnServiceName - static const OUStringLiteral s_sPropColumnServiceName = u"ColumnServiceName"; + static constexpr OUStringLiteral s_sPropColumnServiceName = u"ColumnServiceName"; if ( !::comphelper::hasProperty( s_sPropColumnServiceName, _rxColumnModel ) ) return; diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 640457278dc2..299c5926df4e 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -82,8 +82,8 @@ using namespace ::dbtools; using ::com::sun::star::util::XNumberFormatter; -const OUStringLiteral INVALIDTEXT = u"###"; -const OUStringLiteral OBJECTTEXT = u"<OBJECT>"; +constexpr OUStringLiteral INVALIDTEXT = u"###"; +constexpr OUStringLiteral OBJECTTEXT = u"<OBJECT>"; //= helper diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index 0ea146643a62..1d7a70623f95 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -122,7 +122,7 @@ void FmFormObj::impl_checkRefDevice_nothrow( bool _force ) Reference< XPropertySet > xModelProps( GetUnoControlModel(), UNO_QUERY_THROW ); Reference< XPropertySetInfo > xPropertyInfo( xModelProps->getPropertySetInfo(), UNO_SET_THROW ); - static const OUStringLiteral sRefDevicePropName = u"ReferenceDevice"; + static constexpr OUStringLiteral sRefDevicePropName = u"ReferenceDevice"; if ( xPropertyInfo->hasPropertyByName( sRefDevicePropName ) ) { VCLXDevice* pUnoRefDevice = new VCLXDevice; diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index 6ce26d06d058..2cd568898a6c 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -677,7 +677,7 @@ void SAL_CALL FmXUndoEnvironment::propertyChange(const PropertyChangeEvent& evt) // TODO: we should cache all those things, else this might be too expensive. // However, this requires we're notified of changes in the value binding - static const OUStringLiteral s_sExternalData = u"ExternalData"; + static constexpr OUStringLiteral s_sExternalData = u"ExternalData"; if ( xBindingPropsPSI.is() && xBindingPropsPSI->hasPropertyByName( s_sExternalData ) ) { bool bExternalData = true; diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index a66e23ede35d..7799c76b7860 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -3552,7 +3552,7 @@ namespace { try { - static const OUStringLiteral s_sFormsCheckRequiredFields = u"FormsCheckRequiredFields"; + static constexpr OUStringLiteral s_sFormsCheckRequiredFields = u"FormsCheckRequiredFields"; // first, check whether the form has a property telling us the answer // this allows people to use the XPropertyContainer interface of a form to control diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index 9c8ef924390a..6b5ab0acfdf5 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -343,8 +343,8 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO if( xContentAccess.is() ) { - static const OUStringLiteral s_sTitle = u"Title"; - static const OUStringLiteral s_sIsReadOnly = u"IsReadOnly"; + static constexpr OUStringLiteral s_sTitle = u"Title"; + static constexpr OUStringLiteral s_sIsReadOnly = u"IsReadOnly"; while( xResultSet->next() ) { diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx index 15590fc5be55..43ee78a9f83a 100644 --- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx @@ -35,7 +35,7 @@ using namespace css; using namespace css::uno; -const OStringLiteral SIDEBARGRADIENT = "sidebargradient"; +constexpr OStringLiteral SIDEBARGRADIENT = "sidebargradient"; namespace svx::sidebar { diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx index 594d56924e5b..f5a8f4db487d 100644 --- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx +++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx @@ -31,7 +31,7 @@ using namespace css; using namespace css::uno; -const OStringLiteral SELECTWIDTH = "SelectWidth"; +constexpr OStringLiteral SELECTWIDTH = "SelectWidth"; namespace svx::sidebar { diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index 69e0d42f0808..39b1af2ea060 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -49,7 +49,7 @@ using namespace css; using namespace css::uno; -const OUStringLiteral USERITEM_NAME = u"FitItem"; +constexpr OUStringLiteral USERITEM_NAME = u"FitItem"; namespace svx::sidebar { diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 2c8602847fde..089d3aea9dca 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -407,7 +407,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::deactivatedUI() css::uno::Reference< css::frame::XLayoutManager > xLayoutManager(getLayoutManager()); if ( xLayoutManager.is() ) { - static const OUStringLiteral aMenuBarURL = u"private:resource/menubar/menubar"; + static constexpr OUStringLiteral aMenuBarURL = u"private:resource/menubar/menubar"; if ( !xLayoutManager->isElementVisible( aMenuBarURL ) ) xLayoutManager->createElement( aMenuBarURL ); } diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx index 5398663f1740..726d4a1cde78 100644 --- a/svx/source/tbxctrls/extrusioncontrols.cxx +++ b/svx/source/tbxctrls/extrusioncontrols.cxx @@ -44,8 +44,8 @@ namespace svx { const sal_Int32 gSkewList[] = { 135, 90, 45, 180, 0, -360, -135, -90, -45 }; -const OUStringLiteral g_sExtrusionDirection = u".uno:ExtrusionDirection"; -const OUStringLiteral g_sExtrusionProjection = u".uno:ExtrusionProjection"; +constexpr OUStringLiteral g_sExtrusionDirection = u".uno:ExtrusionDirection"; +constexpr OUStringLiteral g_sExtrusionProjection = u".uno:ExtrusionProjection"; const std::u16string_view aLightOffBmps[] = { @@ -563,8 +563,8 @@ com_sun_star_comp_svx_ExtrusionDepthController_get_implementation( } -const OUStringLiteral g_sExtrusionLightingDirection = u".uno:ExtrusionLightingDirection"; -const OUStringLiteral g_sExtrusionLightingIntensity = u".uno:ExtrusionLightingIntensity"; +constexpr OUStringLiteral g_sExtrusionLightingDirection = u".uno:ExtrusionLightingDirection"; +constexpr OUStringLiteral g_sExtrusionLightingIntensity = u".uno:ExtrusionLightingIntensity"; ExtrusionLightingWindow::ExtrusionLightingWindow(svt::PopupWindowController* pControl, weld::Widget* pParent) @@ -795,7 +795,7 @@ com_sun_star_comp_svx_ExtrusionLightingControl_get_implementation( } -const OUStringLiteral g_sExtrusionSurface = u".uno:ExtrusionSurface"; +constexpr OUStringLiteral g_sExtrusionSurface = u".uno:ExtrusionSurface"; ExtrusionSurfaceWindow::ExtrusionSurfaceWindow(svt::PopupWindowController* pControl, weld::Widget* pParent) : WeldToolbarPopup(pControl->getFrameInterface(), pParent, "svx/ui/surfacewindow.ui", "SurfaceWindow") diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index dc697903a51f..6158cdfdcf31 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -66,12 +66,12 @@ using namespace css; namespace { -const OUStringLiteral COMMAND_FINDTEXT = u".uno:FindText"; -const OUStringLiteral COMMAND_DOWNSEARCH = u".uno:DownSearch"; -const OUStringLiteral COMMAND_UPSEARCH = u".uno:UpSearch"; -const OUStringLiteral COMMAND_FINDALL = u".uno:FindAll"; -const OUStringLiteral COMMAND_MATCHCASE = u".uno:MatchCase"; -const OUStringLiteral COMMAND_SEARCHFORMATTED = u".uno:SearchFormattedDisplayString"; +constexpr OUStringLiteral COMMAND_FINDTEXT = u".uno:FindText"; +constexpr OUStringLiteral COMMAND_DOWNSEARCH = u".uno:DownSearch"; +constexpr OUStringLiteral COMMAND_UPSEARCH = u".uno:UpSearch"; +constexpr OUStringLiteral COMMAND_FINDALL = u".uno:FindAll"; +constexpr OUStringLiteral COMMAND_MATCHCASE = u".uno:MatchCase"; +constexpr OUStringLiteral COMMAND_SEARCHFORMATTED = u".uno:SearchFormattedDisplayString"; const sal_Int32 REMEMBER_SIZE = 10; diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx index 96d73abb5fd9..011da2175e93 100644 --- a/svx/source/toolbars/extrusionbar.cxx +++ b/svx/source/toolbars/extrusionbar.cxx @@ -115,8 +115,8 @@ static void getLightingDirectionDefaults( const Direction3D **pLighting1Defaults static void impl_execute( SfxRequest const & rReq, SdrCustomShapeGeometryItem& rGeometryItem, SdrObject* pObj ) { - static const OUStringLiteral sExtrusion = u"Extrusion"; - static const OUStringLiteral sRotateAngle = u"RotateAngle"; + static constexpr OUStringLiteral sExtrusion = u"Extrusion"; + static constexpr OUStringLiteral sRotateAngle = u"RotateAngle"; sal_uInt16 nSID = rReq.GetSlot(); switch( nSID ) @@ -615,7 +615,7 @@ static void getExtrusionDirectionState( SdrView const * pSdrView, SfxItemSet& rS const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); - static const OUStringLiteral sExtrusion = u"Extrusion"; + static constexpr OUStringLiteral sExtrusion = u"Extrusion"; const css::uno::Any* pAny; @@ -762,7 +762,7 @@ static void getExtrusionProjectionState( SdrView const * pSdrView, SfxItemSet& r const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); - static const OUStringLiteral sExtrusion = u"Extrusion"; + static constexpr OUStringLiteral sExtrusion = u"Extrusion"; const css::uno::Any* pAny; @@ -817,7 +817,7 @@ static void getExtrusionSurfaceState( SdrView const * pSdrView, SfxItemSet& rSet const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); - static const OUStringLiteral sExtrusion = u"Extrusion"; + static constexpr OUStringLiteral sExtrusion = u"Extrusion"; const css::uno::Any* pAny; @@ -902,7 +902,7 @@ static void getExtrusionDepthState( SdrView const * pSdrView, SfxItemSet& rSet ) const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); - static const OUStringLiteral sExtrusion = u"Extrusion"; + static constexpr OUStringLiteral sExtrusion = u"Extrusion"; const css::uno::Any* pAny; @@ -981,7 +981,7 @@ static void getExtrusionLightingDirectionState( SdrView const * pSdrView, SfxIte const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); - static const OUStringLiteral sExtrusion = u"Extrusion"; + static constexpr OUStringLiteral sExtrusion = u"Extrusion"; const Direction3D * pLighting1Defaults; const Direction3D * pLighting2Defaults; @@ -1060,7 +1060,7 @@ static void getExtrusionLightingIntensityState( SdrView const * pSdrView, SfxIte const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); - static const OUStringLiteral sExtrusion = u"Extrusion"; + static constexpr OUStringLiteral sExtrusion = u"Extrusion"; const css::uno::Any* pAny; @@ -1127,7 +1127,7 @@ static void getExtrusionColorState( SdrView const * pSdrView, SfxItemSet& rSet ) const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); - static const OUStringLiteral sExtrusion = u"Extrusion"; + static constexpr OUStringLiteral sExtrusion = u"Extrusion"; const css::uno::Any* pAny; @@ -1196,7 +1196,7 @@ static void getExtrusionColorState( SdrView const * pSdrView, SfxItemSet& rSet ) namespace svx { bool checkForSelectedCustomShapes( SdrView const * pSdrView, bool bOnlyExtruded ) { - static const OUStringLiteral sExtrusion = u"Extrusion"; + static constexpr OUStringLiteral sExtrusion = u"Extrusion"; const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx index cbdd9d5804f7..e29becb08be6 100644 --- a/svx/source/toolbars/fontworkbar.cxx +++ b/svx/source/toolbars/fontworkbar.cxx @@ -210,7 +210,7 @@ bool checkForSelectedFontWork( SdrView const * pSdrView, sal_uInt32& nCheckStatu if ( nCheckStatus & 2 ) return ( nCheckStatus & 1 ) != 0; - static const OUStringLiteral sTextPath = u"TextPath"; + static constexpr OUStringLiteral sTextPath = u"TextPath"; const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); const size_t nCount = rMarkList.GetMarkCount(); diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index aade016dcf2f..a545aaa6c44e 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -3123,49 +3123,49 @@ OUString SAL_CALL SvxShape::getImplementationName() return "SvxShape"; } -const OUStringLiteral sUNO_service_style_ParagraphProperties = u"com.sun.star.style.ParagraphProperties"; -const OUStringLiteral sUNO_service_style_ParagraphPropertiesComplex = u"com.sun.star.style.ParagraphPropertiesComplex"; -const OUStringLiteral sUNO_service_style_ParagraphPropertiesAsian = u"com.sun.star.style.ParagraphPropertiesAsian"; -const OUStringLiteral sUNO_service_style_CharacterProperties = u"com.sun.star.style.CharacterProperties"; -const OUStringLiteral sUNO_service_style_CharacterPropertiesComplex = u"com.sun.star.style.CharacterPropertiesComplex"; -const OUStringLiteral sUNO_service_style_CharacterPropertiesAsian = u"com.sun.star.style.CharacterPropertiesAsian"; - -const OUStringLiteral sUNO_service_drawing_FillProperties = u"com.sun.star.drawing.FillProperties"; -const OUStringLiteral sUNO_service_drawing_TextProperties = u"com.sun.star.drawing.TextProperties"; -const OUStringLiteral sUNO_service_drawing_LineProperties = u"com.sun.star.drawing.LineProperties"; -const OUStringLiteral sUNO_service_drawing_ConnectorProperties = u"com.sun.star.drawing.ConnectorProperties"; -const OUStringLiteral sUNO_service_drawing_MeasureProperties = u"com.sun.star.drawing.MeasureProperties"; -const OUStringLiteral sUNO_service_drawing_ShadowProperties = u"com.sun.star.drawing.ShadowProperties"; - -const OUStringLiteral sUNO_service_drawing_RotationDescriptor = u"com.sun.star.drawing.RotationDescriptor"; - -const OUStringLiteral sUNO_service_drawing_Text = u"com.sun.star.drawing.Text"; -const OUStringLiteral sUNO_service_drawing_GroupShape = u"com.sun.star.drawing.GroupShape"; - -const OUStringLiteral sUNO_service_drawing_CustomShapeProperties = u"com.sun.star.drawing.CustomShapeProperties"; -const OUStringLiteral sUNO_service_drawing_CustomShape = u"com.sun.star.drawing.CustomShape"; - -const OUStringLiteral sUNO_service_drawing_PolyPolygonDescriptor = u"com.sun.star.drawing.PolyPolygonDescriptor"; -const OUStringLiteral sUNO_service_drawing_PolyPolygonBezierDescriptor= u"com.sun.star.drawing.PolyPolygonBezierDescriptor"; - -const OUStringLiteral sUNO_service_drawing_LineShape = u"com.sun.star.drawing.LineShape"; -const OUStringLiteral sUNO_service_drawing_Shape = u"com.sun.star.drawing.Shape"; -const OUStringLiteral sUNO_service_drawing_RectangleShape = u"com.sun.star.drawing.RectangleShape"; -const OUStringLiteral sUNO_service_drawing_EllipseShape = u"com.sun.star.drawing.EllipseShape"; -const OUStringLiteral sUNO_service_drawing_PolyPolygonShape = u"com.sun.star.drawing.PolyPolygonShape"; -const OUStringLiteral sUNO_service_drawing_PolyLineShape = u"com.sun.star.drawing.PolyLineShape"; -const OUStringLiteral sUNO_service_drawing_OpenBezierShape = u"com.sun.star.drawing.OpenBezierShape"; -const OUStringLiteral sUNO_service_drawing_ClosedBezierShape = u"com.sun.star.drawing.ClosedBezierShape"; -const OUStringLiteral sUNO_service_drawing_TextShape = u"com.sun.star.drawing.TextShape"; -const OUStringLiteral sUNO_service_drawing_GraphicObjectShape = u"com.sun.star.drawing.GraphicObjectShape"; -const OUStringLiteral sUNO_service_drawing_OLE2Shape = u"com.sun.star.drawing.OLE2Shape"; -const OUStringLiteral sUNO_service_drawing_PageShape = u"com.sun.star.drawing.PageShape"; -const OUStringLiteral sUNO_service_drawing_CaptionShape = u"com.sun.star.drawing.CaptionShape"; -const OUStringLiteral sUNO_service_drawing_MeasureShape = u"com.sun.star.drawing.MeasureShape"; -const OUStringLiteral sUNO_service_drawing_FrameShape = u"com.sun.star.drawing.FrameShape"; -const OUStringLiteral sUNO_service_drawing_ControlShape = u"com.sun.star.drawing.ControlShape"; -const OUStringLiteral sUNO_service_drawing_ConnectorShape = u"com.sun.star.drawing.ConnectorShape"; -const OUStringLiteral sUNO_service_drawing_MediaShape = u"com.sun.star.drawing.MediaShape"; +constexpr OUStringLiteral sUNO_service_style_ParagraphProperties = u"com.sun.star.style.ParagraphProperties"; +constexpr OUStringLiteral sUNO_service_style_ParagraphPropertiesComplex = u"com.sun.star.style.ParagraphPropertiesComplex"; +constexpr OUStringLiteral sUNO_service_style_ParagraphPropertiesAsian = u"com.sun.star.style.ParagraphPropertiesAsian"; +constexpr OUStringLiteral sUNO_service_style_CharacterProperties = u"com.sun.star.style.CharacterProperties"; +constexpr OUStringLiteral sUNO_service_style_CharacterPropertiesComplex = u"com.sun.star.style.CharacterPropertiesComplex"; +constexpr OUStringLiteral sUNO_service_style_CharacterPropertiesAsian = u"com.sun.star.style.CharacterPropertiesAsian"; + +constexpr OUStringLiteral sUNO_service_drawing_FillProperties = u"com.sun.star.drawing.FillProperties"; +constexpr OUStringLiteral sUNO_service_drawing_TextProperties = u"com.sun.star.drawing.TextProperties"; +constexpr OUStringLiteral sUNO_service_drawing_LineProperties = u"com.sun.star.drawing.LineProperties"; +constexpr OUStringLiteral sUNO_service_drawing_ConnectorProperties = u"com.sun.star.drawing.ConnectorProperties"; +constexpr OUStringLiteral sUNO_service_drawing_MeasureProperties = u"com.sun.star.drawing.MeasureProperties"; +constexpr OUStringLiteral sUNO_service_drawing_ShadowProperties = u"com.sun.star.drawing.ShadowProperties"; + +constexpr OUStringLiteral sUNO_service_drawing_RotationDescriptor = u"com.sun.star.drawing.RotationDescriptor"; + +constexpr OUStringLiteral sUNO_service_drawing_Text = u"com.sun.star.drawing.Text"; +constexpr OUStringLiteral sUNO_service_drawing_GroupShape = u"com.sun.star.drawing.GroupShape"; + +constexpr OUStringLiteral sUNO_service_drawing_CustomShapeProperties = u"com.sun.star.drawing.CustomShapeProperties"; +constexpr OUStringLiteral sUNO_service_drawing_CustomShape = u"com.sun.star.drawing.CustomShape"; + +constexpr OUStringLiteral sUNO_service_drawing_PolyPolygonDescriptor = u"com.sun.star.drawing.PolyPolygonDescriptor"; +constexpr OUStringLiteral sUNO_service_drawing_PolyPolygonBezierDescriptor= u"com.sun.star.drawing.PolyPolygonBezierDescriptor"; + +constexpr OUStringLiteral sUNO_service_drawing_LineShape = u"com.sun.star.drawing.LineShape"; +constexpr OUStringLiteral sUNO_service_drawing_Shape = u"com.sun.star.drawing.Shape"; +constexpr OUStringLiteral sUNO_service_drawing_RectangleShape = u"com.sun.star.drawing.RectangleShape"; +constexpr OUStringLiteral sUNO_service_drawing_EllipseShape = u"com.sun.star.drawing.EllipseShape"; +constexpr OUStringLiteral sUNO_service_drawing_PolyPolygonShape = u"com.sun.star.drawing.PolyPolygonShape"; +constexpr OUStringLiteral sUNO_service_drawing_PolyLineShape = u"com.sun.star.drawing.PolyLineShape"; +constexpr OUStringLiteral sUNO_service_drawing_OpenBezierShape = u"com.sun.star.drawing.OpenBezierShape"; +constexpr OUStringLiteral sUNO_service_drawing_ClosedBezierShape = u"com.sun.star.drawing.ClosedBezierShape"; +constexpr OUStringLiteral sUNO_service_drawing_TextShape = u"com.sun.star.drawing.TextShape"; +constexpr OUStringLiteral sUNO_service_drawing_GraphicObjectShape = u"com.sun.star.drawing.GraphicObjectShape"; +constexpr OUStringLiteral sUNO_service_drawing_OLE2Shape = u"com.sun.star.drawing.OLE2Shape"; +constexpr OUStringLiteral sUNO_service_drawing_PageShape = u"com.sun.star.drawing.PageShape"; +constexpr OUStringLiteral sUNO_service_drawing_CaptionShape = u"com.sun.star.drawing.CaptionShape"; +constexpr OUStringLiteral sUNO_service_drawing_MeasureShape = u"com.sun.star.drawing.MeasureShape"; +constexpr OUStringLiteral sUNO_service_drawing_FrameShape = u"com.sun.star.drawing.FrameShape"; +constexpr OUStringLiteral sUNO_service_drawing_ControlShape = u"com.sun.star.drawing.ControlShape"; +constexpr OUStringLiteral sUNO_service_drawing_ConnectorShape = u"com.sun.star.drawing.ConnectorShape"; +constexpr OUStringLiteral sUNO_service_drawing_MediaShape = u"com.sun.star.drawing.MediaShape"; uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames() diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index db2422fed04b..02202d6fe8e2 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -760,7 +760,7 @@ void SwDocTest::testSwScanner() { SwDocStat aDocStat; - static const OUStringLiteral aString = u"Lorem ipsum"; + static constexpr OUStringLiteral aString = u"Lorem ipsum"; m_pDoc->getIDocumentContentOperations().AppendTextNode(*aPaM.GetPoint()); m_pDoc->getIDocumentContentOperations().InsertString(aPaM, aString); pTextNode = aPaM.GetNode().GetTextNode(); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 39f6cd39b3b0..33edc6f9ed85 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -1362,7 +1362,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf111964, "tdf111964.docx") { xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); // Unicode spaces that are not XML whitespace must not be trimmed - static const OUStringLiteral sWSReference = u"\u2002\u2002\u2002\u2002\u2002"; + static constexpr OUStringLiteral sWSReference = u"\u2002\u2002\u2002\u2002\u2002"; assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[6]/w:t", sWSReference); } diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 4776c4613503..3857cd895422 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -1325,7 +1325,7 @@ DECLARE_WW8EXPORT_TEST(testTdf92281, "tdf92281.doc") xCursor->goRight( 5 , false ); uno::Reference< beans::XPropertySet > xPropSet(xCursor, uno::UNO_QUERY); - static const OUStringLiteral aFontname = u"\u65B0\u7D30\u660E\u9AD4;PMingLiU"; + static constexpr OUStringLiteral aFontname = u"\u65B0\u7D30\u660E\u9AD4;PMingLiU"; CPPUNIT_ASSERT_EQUAL(OUString("Calibri"), getProperty<OUString>(xPropSet, "CharFontName")); CPPUNIT_ASSERT_EQUAL(OUString(aFontname), getProperty<OUString>(xPropSet, "CharFontNameAsian")); CPPUNIT_ASSERT_EQUAL(OUString("Times New Roman"), getProperty<OUString>(xPropSet, "CharFontNameComplex")); diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx index 154f4d0fe85f..9d2aa207cfc8 100644 --- a/sw/source/core/access/acccell.cxx +++ b/sw/source/core/access/acccell.cxx @@ -50,7 +50,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; using namespace sw::access; -const OUStringLiteral sImplementationName = u"com.sun.star.comp.Writer.SwAccessibleCellView"; +constexpr OUStringLiteral sImplementationName = u"com.sun.star.comp.Writer.SwAccessibleCellView"; bool SwAccessibleCell::IsSelected() { diff --git a/sw/source/core/access/acccontext.hxx b/sw/source/core/access/acccontext.hxx index 59c4df3962b3..137726a43ed0 100644 --- a/sw/source/core/access/acccontext.hxx +++ b/sw/source/core/access/acccontext.hxx @@ -40,7 +40,7 @@ namespace accessibility { class AccessibleShape; } -inline const OUStringLiteral sAccessibleServiceName = u"com.sun.star.accessibility.Accessible"; +inline constexpr OUStringLiteral sAccessibleServiceName = u"com.sun.star.accessibility.Accessible"; class SwAccessibleContext : public ::cppu::WeakImplHelper< diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx index 852e537da3ad..a1661bb468d5 100644 --- a/sw/source/core/access/accdoc.cxx +++ b/sw/source/core/access/accdoc.cxx @@ -52,8 +52,8 @@ #include <dview.hxx> #include <dcontact.hxx> #include <svx/svdmark.hxx> -const OUStringLiteral sServiceName = u"com.sun.star.text.AccessibleTextDocumentView"; -const OUStringLiteral sImplementationName = u"com.sun.star.comp.Writer.SwAccessibleDocumentView"; +constexpr OUStringLiteral sServiceName = u"com.sun.star.text.AccessibleTextDocumentView"; +constexpr OUStringLiteral sImplementationName = u"com.sun.star.comp.Writer.SwAccessibleDocumentView"; using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; diff --git a/sw/source/core/access/accembedded.cxx b/sw/source/core/access/accembedded.cxx index 6ec441bcef05..7f1b59ffc6c6 100644 --- a/sw/source/core/access/accembedded.cxx +++ b/sw/source/core/access/accembedded.cxx @@ -31,7 +31,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::accessibility; -const OUStringLiteral sImplementationName = u"com.sun.star.comp.Writer.SwAccessibleEmbeddedObject"; +constexpr OUStringLiteral sImplementationName = u"com.sun.star.comp.Writer.SwAccessibleEmbeddedObject"; SwAccessibleEmbeddedObject::SwAccessibleEmbeddedObject( std::shared_ptr<SwAccessibleMap> const& pInitMap, diff --git a/sw/source/core/access/accfootnote.cxx b/sw/source/core/access/accfootnote.cxx index 815f26899140..43d8a2b6e10c 100644 --- a/sw/source/core/access/accfootnote.cxx +++ b/sw/source/core/access/accfootnote.cxx @@ -33,9 +33,9 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::accessibility; -const OUStringLiteral sImplementationNameFootnote +constexpr OUStringLiteral sImplementationNameFootnote = u"com.sun.star.comp.Writer.SwAccessibleFootnoteView"; -const OUStringLiteral sImplementationNameEndnote +constexpr OUStringLiteral sImplementationNameEndnote = u"com.sun.star.comp.Writer.SwAccessibleEndnoteView"; SwAccessibleFootnote::SwAccessibleFootnote( diff --git a/sw/source/core/access/accheaderfooter.cxx b/sw/source/core/access/accheaderfooter.cxx index aa41ac4bd795..bf1f8bf6d2ad 100644 --- a/sw/source/core/access/accheaderfooter.cxx +++ b/sw/source/core/access/accheaderfooter.cxx @@ -29,9 +29,9 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::accessibility; -const OUStringLiteral sImplementationNameHeader +constexpr OUStringLiteral sImplementationNameHeader = u"com.sun.star.comp.Writer.SwAccessibleHeaderView"; -const OUStringLiteral sImplementationNameFooter +constexpr OUStringLiteral sImplementationNameFooter = u"com.sun.star.comp.Writer.SwAccessibleFooterView"; SwAccessibleHeaderFooter::SwAccessibleHeaderFooter( diff --git a/sw/source/core/access/accpage.cxx b/sw/source/core/access/accpage.cxx index a01f44ec4f60..2c5d1513a05d 100644 --- a/sw/source/core/access/accpage.cxx +++ b/sw/source/core/access/accpage.cxx @@ -32,7 +32,7 @@ using namespace ::com::sun::star::accessibility; using uno::Sequence; -const OUStringLiteral sImplementationName = u"com.sun.star.comp.Writer.SwAccessiblePageView"; +constexpr OUStringLiteral sImplementationName = u"com.sun.star.comp.Writer.SwAccessiblePageView"; bool SwAccessiblePage::IsSelected() { diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 49291ed0c44a..29bd4be8a1e0 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -111,8 +111,8 @@ namespace com::sun::star::text { class XText; } -const OUStringLiteral sServiceName = u"com.sun.star.text.AccessibleParagraphView"; -const OUStringLiteral sImplementationName = u"com.sun.star.comp.Writer.SwAccessibleParagraphView"; +constexpr OUStringLiteral sServiceName = u"com.sun.star.text.AccessibleParagraphView"; +constexpr OUStringLiteral sImplementationName = u"com.sun.star.comp.Writer.SwAccessibleParagraphView"; OUString const & SwAccessibleParagraph::GetString() { diff --git a/sw/source/core/access/accpreview.cxx b/sw/source/core/access/accpreview.cxx index 75ad890d590a..503cc543ece9 100644 --- a/sw/source/core/access/accpreview.cxx +++ b/sw/source/core/access/accpreview.cxx @@ -22,7 +22,7 @@ #include <strings.hrc> #include "accpreview.hxx" -const OUStringLiteral sImplementationName +constexpr OUStringLiteral sImplementationName = u"com.sun.star.comp.Writer.SwAccessibleDocumentPageView"; using ::com::sun::star::uno::Sequence; diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx index 1c731d684b29..c9de6594f484 100644 --- a/sw/source/core/access/acctable.cxx +++ b/sw/source/core/access/acctable.cxx @@ -1731,7 +1731,7 @@ uno::Reference< XAccessibleTable > OUString SAL_CALL SwAccessibleTableColHeaders::getImplementationName() { - static const OUStringLiteral sImplName + static constexpr OUStringLiteral sImplName = u"com.sun.star.comp.Writer.SwAccessibleTableColumnHeadersView"; return sImplName; } diff --git a/sw/source/core/crsr/crossrefbookmark.cxx b/sw/source/core/crsr/crossrefbookmark.cxx index 5090f2024d0a..55b77bf4ccb3 100644 --- a/sw/source/core/crsr/crossrefbookmark.cxx +++ b/sw/source/core/crsr/crossrefbookmark.cxx @@ -27,7 +27,7 @@ namespace { - const OUStringLiteral CrossRefNumItemBookmark_NamePrefix = u"__RefNumPara__"; + constexpr OUStringLiteral CrossRefNumItemBookmark_NamePrefix = u"__RefNumPara__"; } namespace sw::mark diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx index be9f13410419..75786448d64b 100644 --- a/sw/source/core/swg/SwXMLTextBlocks1.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx @@ -44,7 +44,7 @@ #include <sfx2/event.hxx> #include <swerror.h> -const OUStringLiteral XMLN_BLOCKLIST = u"BlockList.xml"; +constexpr OUStringLiteral XMLN_BLOCKLIST = u"BlockList.xml"; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 048fcd0e8e37..a908e63326d5 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -145,14 +145,14 @@ const char aH3String[] = "H3"; const char aH4String[] = "H4"; const char aH5String[] = "H5"; const char aH6String[] = "H6"; -const OUStringLiteral aListString = u"L"; -const OUStringLiteral aListItemString = u"LI"; -const OUStringLiteral aListBodyString = u"LBody"; +constexpr OUStringLiteral aListString = u"L"; +constexpr OUStringLiteral aListItemString = u"LI"; +constexpr OUStringLiteral aListBodyString = u"LBody"; const char aBlockQuoteString[] = "BlockQuote"; const char aCaptionString[] = "Caption"; const char aIndexString[] = "Index"; const char aTOCString[] = "TOC"; -const OUStringLiteral aTOCIString = u"TOCI"; +constexpr OUStringLiteral aTOCIString = u"TOCI"; const char aTableString[] = "Table"; const char aTRString[] = "TR"; const char aTDString[] = "TD"; diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 7165aa9749f2..187bd0b513f3 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -41,14 +41,14 @@ class SvStream; //Commonly used string literals for stream and storage names in word docs namespace SL { - inline const OUStringLiteral aObjectPool = u"ObjectPool"; - inline const OUStringLiteral a1Table = u"1Table"; - inline const OUStringLiteral a0Table = u"0Table"; - inline const OUStringLiteral aData = u"Data"; - inline const OUStringLiteral aCheckBox = u"CheckBox"; - inline const OUStringLiteral aListBox = u"ListBox"; - inline const OUStringLiteral aTextField = u"TextField"; - inline const OUStringLiteral aMSMacroCmds = u"MSMacroCmds"; + inline constexpr OUStringLiteral aObjectPool = u"ObjectPool"; + inline constexpr OUStringLiteral a1Table = u"1Table"; + inline constexpr OUStringLiteral a0Table = u"0Table"; + inline constexpr OUStringLiteral aData = u"Data"; + inline constexpr OUStringLiteral aCheckBox = u"CheckBox"; + inline constexpr OUStringLiteral aListBox = u"ListBox"; + inline constexpr OUStringLiteral aTextField = u"TextField"; + inline constexpr OUStringLiteral aMSMacroCmds = u"MSMacroCmds"; } struct SprmInfo diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index 9568b1b681a1..34cf4ac4b6d0 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -231,9 +231,9 @@ RedlineInfo::~RedlineInfo() delete pNextRedline; } -const OUStringLiteral g_sShowChanges = u"ShowChanges"; -const OUStringLiteral g_sRecordChanges = u"RecordChanges"; -const OUStringLiteral g_sRedlineProtectionKey = u"RedlineProtectionKey"; +constexpr OUStringLiteral g_sShowChanges = u"ShowChanges"; +constexpr OUStringLiteral g_sRecordChanges = u"RecordChanges"; +constexpr OUStringLiteral g_sRedlineProtectionKey = u"RedlineProtectionKey"; XMLRedlineImportHelper::XMLRedlineImportHelper( SvXMLImport & rImport, diff --git a/sw/source/ui/vba/vbalisthelper.cxx b/sw/source/ui/vba/vbalisthelper.cxx index 4e863236931f..a6597a539145 100644 --- a/sw/source/ui/vba/vbalisthelper.cxx +++ b/sw/source/ui/vba/vbalisthelper.cxx @@ -31,12 +31,12 @@ using namespace ::com::sun::star; const sal_Int32 LIST_LEVEL_COUNT = 9; -const OUStringLiteral UNO_NAME_PARENT_NUMBERING = u"ParentNumbering"; -const OUStringLiteral UNO_NAME_PREFIX = u"Prefix"; -const OUStringLiteral UNO_NAME_SUFFIX = u"Suffix"; -const OUStringLiteral UNO_NAME_CHAR_STYLE_NAME = u"CharStyleName"; -const OUStringLiteral UNO_NAME_NUMBERING_TYPE = u"NumberingType"; -const OUStringLiteral UNO_NAME_BULLET_CHAR = u"BulletChar"; +constexpr OUStringLiteral UNO_NAME_PARENT_NUMBERING = u"ParentNumbering"; +constexpr OUStringLiteral UNO_NAME_PREFIX = u"Prefix"; +constexpr OUStringLiteral UNO_NAME_SUFFIX = u"Suffix"; +constexpr OUStringLiteral UNO_NAME_CHAR_STYLE_NAME = u"CharStyleName"; +constexpr OUStringLiteral UNO_NAME_NUMBERING_TYPE = u"NumberingType"; +constexpr OUStringLiteral UNO_NAME_BULLET_CHAR = u"BulletChar"; const sal_Unicode CHAR_CLOSED_DOT[] = u"\u2022"; const char CHAR_EMPTY_DOT[] = "o"; diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx index 4c3a8c1a4b56..1bd34c590ede 100644 --- a/sw/source/uibase/app/applab.cxx +++ b/sw/source/uibase/app/applab.cxx @@ -61,7 +61,7 @@ using namespace ::com::sun::star; -const OUStringLiteral MASTER_LABEL = u"MasterLabel"; +constexpr OUStringLiteral MASTER_LABEL = u"MasterLabel"; static const SwFrameFormat *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& rItem, SwFrameFormat &rFormat, diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx index f1f41ecb4bd2..166ec51aaadb 100644 --- a/sw/source/uibase/utlui/unotools.cxx +++ b/sw/source/uibase/utlui/unotools.cxx @@ -52,7 +52,7 @@ using namespace ::com::sun::star; -const OUStringLiteral cFactory = u"private:factory/swriter"; +constexpr OUStringLiteral cFactory = u"private:factory/swriter"; static void disableScrollBars(uno::Reference< beans::XPropertySet > const & xViewProps, bool bEnableOnlineMode) diff --git a/testtools/source/bridgetest/currentcontextchecker.cxx b/testtools/source/bridgetest/currentcontextchecker.cxx index 801fe5d55229..96d2b05f0084 100644 --- a/testtools/source/bridgetest/currentcontextchecker.cxx +++ b/testtools/source/bridgetest/currentcontextchecker.cxx @@ -38,8 +38,8 @@ namespace { -OUStringLiteral const KEY = u"testtools.bridgetest.Key"; -OUStringLiteral const VALUE = u"good"; +constexpr OUStringLiteral KEY = u"testtools.bridgetest.Key"; +constexpr OUStringLiteral VALUE = u"good"; class CurrentContext: public ::osl::DebugBase< CurrentContext >, diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx index 32c2e6e63c82..f762ff805c0d 100644 --- a/toolkit/source/controls/stdtabcontroller.cxx +++ b/toolkit/source/controls/stdtabcontroller.cxx @@ -111,7 +111,7 @@ bool StdTabController::ImplCreateComponentSequence( if ( pTabs ) { // opt: Constant String for TabStop name - static const OUStringLiteral aTabStopName = u"Tabstop"; + static constexpr OUStringLiteral aTabStopName = u"Tabstop"; Reference< XPropertySet > xPSet( xCtrl->getModel(), UNO_QUERY ); Reference< XPropertySetInfo > xInfo = xPSet->getPropertySetInfo(); diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx index 498e8329ffdf..aa0f1badef0c 100644 --- a/toolkit/source/controls/tabpagemodel.cxx +++ b/toolkit/source/controls/tabpagemodel.cxx @@ -141,7 +141,7 @@ void SAL_CALL UnoControlTabPageModel::initialize (const Sequence<Any>& rArgument Reference<XPropertySet> xDialogProp(xDialogModel,UNO_QUERY); if ( xDialogProp.is() ) { - static const OUStringLiteral s_sResourceResolver = u"ResourceResolver"; + static constexpr OUStringLiteral s_sResourceResolver = u"ResourceResolver"; Reference<XPropertySet> xThis(*this,UNO_QUERY); xThis->setPropertyValue(s_sResourceResolver,xDialogProp->getPropertyValue(s_sResourceResolver)); xThis->setPropertyValue(GetPropertyName(BASEPROPERTY_TITLE),xDialogProp->getPropertyValue(GetPropertyName(BASEPROPERTY_TITLE))); diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx index 188410af86d4..39c9915f77ac 100644 --- a/toolkit/source/helper/formpdfexport.cxx +++ b/toolkit/source/helper/formpdfexport.cxx @@ -58,7 +58,7 @@ namespace toolkitform using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; - const OUStringLiteral FM_PROP_NAME = u"Name"; + constexpr OUStringLiteral FM_PROP_NAME = u"Name"; namespace { @@ -67,7 +67,7 @@ namespace toolkitform */ sal_Int16 classifyFormControl( const Reference< XPropertySet >& _rxModel ) { - static const OUStringLiteral FM_PROP_CLASSID = u"ClassId"; + static constexpr OUStringLiteral FM_PROP_CLASSID = u"ClassId"; sal_Int16 nControlType = FormComponentType::CONTROL; Reference< XPropertySetInfo > xPSI; @@ -312,8 +312,8 @@ namespace toolkitform SAL_INFO("toolkit.helper", "describePDFControl: unable to get property HelpText"); } Any aText; - static const OUStringLiteral FM_PROP_TEXT = u"Text"; - static const OUStringLiteral FM_PROP_LABEL = u"Label"; + static constexpr OUStringLiteral FM_PROP_TEXT = u"Text"; + static constexpr OUStringLiteral FM_PROP_LABEL = u"Label"; if ( xPSI->hasPropertyByName( FM_PROP_TEXT ) ) aText = xModelProps->getPropertyValue( FM_PROP_TEXT ); else if ( xPSI->hasPropertyByName( FM_PROP_LABEL ) ) @@ -326,7 +326,7 @@ namespace toolkitform // readonly - static const OUStringLiteral FM_PROP_READONLY = u"ReadOnly"; + static constexpr OUStringLiteral FM_PROP_READONLY = u"ReadOnly"; if ( xPSI->hasPropertyByName( FM_PROP_READONLY ) ) if( ! (xModelProps->getPropertyValue( FM_PROP_READONLY ) >>= Descriptor->ReadOnly) ) SAL_WARN("toolkit.helper", "describePDFControl: unable to get property " << FM_PROP_READONLY); @@ -334,7 +334,7 @@ namespace toolkitform // border { - static const OUStringLiteral FM_PROP_BORDER = u"Border"; + static constexpr OUStringLiteral FM_PROP_BORDER = u"Border"; if ( xPSI->hasPropertyByName( FM_PROP_BORDER ) ) { sal_Int16 nBorderType = 0; @@ -356,7 +356,7 @@ namespace toolkitform // background color - static const OUStringLiteral FM_PROP_BACKGROUNDCOLOR = u"BackgroundColor"; + static constexpr OUStringLiteral FM_PROP_BACKGROUNDCOLOR = u"BackgroundColor"; if ( xPSI->hasPropertyByName( FM_PROP_BACKGROUNDCOLOR ) ) { Color nBackColor = COL_TRANSPARENT; @@ -367,7 +367,7 @@ namespace toolkitform // text color - static const OUStringLiteral FM_PROP_TEXTCOLOR = u"TextColor"; + static constexpr OUStringLiteral FM_PROP_TEXTCOLOR = u"TextColor"; if ( xPSI->hasPropertyByName( FM_PROP_TEXTCOLOR ) ) { Color nTextColor = COL_TRANSPARENT; @@ -382,7 +382,7 @@ namespace toolkitform // multi line and word break // The MultiLine property of the control is mapped to both the "MULTILINE" and // "WORDBREAK" style flags - static const OUStringLiteral FM_PROP_MULTILINE = u"MultiLine"; + static constexpr OUStringLiteral FM_PROP_MULTILINE = u"MultiLine"; if ( xPSI->hasPropertyByName( FM_PROP_MULTILINE ) ) { bool bMultiLine = false; @@ -393,7 +393,7 @@ namespace toolkitform } // horizontal alignment - static const OUStringLiteral FM_PROP_ALIGN = u"Align"; + static constexpr OUStringLiteral FM_PROP_ALIGN = u"Align"; if ( xPSI->hasPropertyByName( FM_PROP_ALIGN ) ) { sal_Int16 nAlign = awt::TextAlign::LEFT; @@ -429,7 +429,7 @@ namespace toolkitform } // font - static const OUStringLiteral FM_PROP_FONT = u"FontDescriptor"; + static constexpr OUStringLiteral FM_PROP_FONT = u"FontDescriptor"; if ( xPSI->hasPropertyByName( FM_PROP_FONT ) ) { FontDescriptor aUNOFont; @@ -473,7 +473,7 @@ namespace toolkitform pEditWidget->FileSelect = true; // maximum text length - static const OUStringLiteral FM_PROP_MAXTEXTLEN = u"MaxTextLen"; + static constexpr OUStringLiteral FM_PROP_MAXTEXTLEN = u"MaxTextLen"; if ( xPSI->hasPropertyByName( FM_PROP_MAXTEXTLEN ) ) { sal_Int16 nMaxTextLength = 0; @@ -494,7 +494,7 @@ namespace toolkitform FormButtonType eButtonType = FormButtonType_PUSH; if( ! (xModelProps->getPropertyValue("ButtonType") >>= eButtonType) ) SAL_WARN("toolkit.helper", "describePDFControl: unable to get property ButtonType"); - static const OUStringLiteral FM_PROP_TARGET_URL = u"TargetURL"; + static constexpr OUStringLiteral FM_PROP_TARGET_URL = u"TargetURL"; if ( eButtonType == FormButtonType_SUBMIT ) { // if a button is a submit button, then it uses the URL at its parent form @@ -556,7 +556,7 @@ namespace toolkitform // check boxes - static const OUStringLiteral FM_PROP_STATE = u"State"; + static constexpr OUStringLiteral FM_PROP_STATE = u"State"; if ( Descriptor->getType() == vcl::PDFWriter::CheckBox ) { vcl::PDFWriter::CheckBoxWidget* pCheckBoxWidget = static_cast< vcl::PDFWriter::CheckBoxWidget* >( Descriptor.get() ); diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index 91c8861b2f52..2d95036d54c8 100644 --- a/unotools/source/config/historyoptions.cxx +++ b/unotools/source/config/historyoptions.cxx @@ -50,13 +50,13 @@ namespace { const ::sal_Int32 s_nOffsetPassword = 3; const ::sal_Int32 s_nOffsetThumbnail = 4; - const OUStringLiteral s_sItemList = u"ItemList"; - const OUStringLiteral s_sOrderList = u"OrderList"; - const OUStringLiteral s_sHistoryItemRef = u"HistoryItemRef"; - const OUStringLiteral s_sFilter = u"Filter"; - const OUStringLiteral s_sTitle = u"Title"; - const OUStringLiteral s_sPassword = u"Password"; - const OUStringLiteral s_sThumbnail = u"Thumbnail"; + constexpr OUStringLiteral s_sItemList = u"ItemList"; + constexpr OUStringLiteral s_sOrderList = u"OrderList"; + constexpr OUStringLiteral s_sHistoryItemRef = u"HistoryItemRef"; + constexpr OUStringLiteral s_sFilter = u"Filter"; + constexpr OUStringLiteral s_sTitle = u"Title"; + constexpr OUStringLiteral s_sPassword = u"Password"; + constexpr OUStringLiteral s_sThumbnail = u"Thumbnail"; class theHistoryOptionsMutex : public rtl::Static<osl::Mutex, theHistoryOptionsMutex>{}; } diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index c0a8438792fd..dbfb4c208e6e 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -803,7 +803,7 @@ bool SvtLinguConfigItem::IsReadOnly( sal_Int32 nPropertyHandle ) const static SvtLinguConfigItem *pCfgItem = nullptr; static sal_Int32 nCfgItemRefCount = 0; -const OUStringLiteral aG_Dictionaries = u"Dictionaries"; +constexpr OUStringLiteral aG_Dictionaries = u"Dictionaries"; SvtLinguConfig::SvtLinguConfig() { diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx index e8bb2aade654..1fad334ddbca 100644 --- a/unotools/source/config/saveopt.cxx +++ b/unotools/source/config/saveopt.cxx @@ -714,7 +714,7 @@ public: } -const OUStringLiteral cUserDefinedSettings = u"UserDefinedSettings"; +constexpr OUStringLiteral cUserDefinedSettings = u"UserDefinedSettings"; SvtLoadOptions_Impl::SvtLoadOptions_Impl() : ConfigItem( "Office.Common/Load" ) diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx index ff515561b23f..cdd44c6ca09c 100644 --- a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx +++ b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx @@ -29,13 +29,13 @@ const char ITEM_DESCRIPTOR_COMMANDURL[] = "CommandURL"; const char ITEM_DESCRIPTOR_HELPURL[] = "HelpURL"; -inline const OUStringLiteral ITEM_DESCRIPTOR_CONTAINER = u"ItemDescriptorContainer"; -inline const OUStringLiteral ITEM_DESCRIPTOR_LABEL = u"Label"; +inline constexpr OUStringLiteral ITEM_DESCRIPTOR_CONTAINER = u"ItemDescriptorContainer"; +inline constexpr OUStringLiteral ITEM_DESCRIPTOR_LABEL = u"Label"; const char ITEM_DESCRIPTOR_TYPE[] = "Type"; const char ITEM_DESCRIPTOR_STYLE[] = "Style"; -inline const OUStringLiteral ITEM_DESCRIPTOR_ISVISIBLE = u"IsVisible"; -inline const OUStringLiteral ITEM_DESCRIPTOR_UINAME = u"UIName"; -inline const OUStringLiteral ITEM_DESCRIPTOR_ENABLED = u"Enabled"; +inline constexpr OUStringLiteral ITEM_DESCRIPTOR_ISVISIBLE = u"IsVisible"; +inline constexpr OUStringLiteral ITEM_DESCRIPTOR_UINAME = u"UIName"; +inline constexpr OUStringLiteral ITEM_DESCRIPTOR_ENABLED = u"Enabled"; const char ITEM_MENUBAR_URL[] = "private:resource/menubar/menubar"; constexpr char16_t ITEM_TOOLBAR_URL[] = u"private:resource/toolbar/"; diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 8b0c206058a4..bfa345c7f3bc 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -850,11 +850,10 @@ double UserFormGeometryHelper::getOffsetY() const return mfOffsetY; } - -const OUStringLiteral saPosXName = u"PositionX"; -const OUStringLiteral saPosYName = u"PositionY"; -const OUStringLiteral saWidthName = u"Width"; -const OUStringLiteral saHeightName = u"Height"; +constexpr OUStringLiteral saPosXName = u"PositionX"; +constexpr OUStringLiteral saPosYName = u"PositionY"; +constexpr OUStringLiteral saWidthName = u"Width"; +constexpr OUStringLiteral saHeightName = u"Height"; double UserFormGeometryHelper::implGetPos( bool bPosY ) const { diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index b4a99cda55a2..d3efe0da4dee 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -1489,7 +1489,7 @@ tools::Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, tools::R { MetaTextLineAction* pAct = static_cast<MetaTextLineAction*>(pAction); // measure a test string to get ascend and descent right - static const OUStringLiteral pStr = u"\u00c4g"; + static constexpr OUStringLiteral pStr = u"\u00c4g"; OUString aStr( pStr ); tools::Rectangle aRect; diff --git a/writerfilter/source/dmapper/FormControlHelper.cxx b/writerfilter/source/dmapper/FormControlHelper.cxx index 599faebf535b..f2313bdef0a6 100644 --- a/writerfilter/source/dmapper/FormControlHelper.cxx +++ b/writerfilter/source/dmapper/FormControlHelper.cxx @@ -89,7 +89,7 @@ uno::Reference<form::XForm> const & FormControlHelper::FormControlHelper_Impl::g if (xFormsSupplier.is()) { uno::Reference<container::XNameContainer> xFormsNamedContainer(xFormsSupplier->getForms()); - static const OUStringLiteral sDOCXForm = u"DOCX-Standard"; + static constexpr OUStringLiteral sDOCXForm = u"DOCX-Standard"; OUString sFormName(sDOCXForm); sal_uInt16 nUnique = 0; diff --git a/writerfilter/source/dmapper/TextEffectsHandler.cxx b/writerfilter/source/dmapper/TextEffectsHandler.cxx index 7f707fbb845b..3288556c8979 100644 --- a/writerfilter/source/dmapper/TextEffectsHandler.cxx +++ b/writerfilter/source/dmapper/TextEffectsHandler.cxx @@ -70,7 +70,7 @@ OUString lclGetNameForElementId(sal_uInt32 aId) return aIdMap[aId]; } -const OUStringLiteral constAttributesSequenceName = u"attributes"; +constexpr OUStringLiteral constAttributesSequenceName = u"attributes"; } diff --git a/writerperfect/qa/unit/DirectoryStreamTest.cxx b/writerperfect/qa/unit/DirectoryStreamTest.cxx index cbb55a91126b..fd75805f5899 100644 --- a/writerperfect/qa/unit/DirectoryStreamTest.cxx +++ b/writerperfect/qa/unit/DirectoryStreamTest.cxx @@ -56,9 +56,9 @@ private: uno::Reference<ucb::XContent> m_xNonexistent; }; -const OUStringLiteral g_aDirPath = u"/writerperfect/qa/unit/data/stream/test.dir"; -const OUStringLiteral g_aNondirPath = u"/writerperfect/qa/unit/data/stream/test.dir/mimetype"; -const OUStringLiteral g_aNonexistentPath = u"/writerperfect/qa/unit/data/stream/foo/bar"; +constexpr OUStringLiteral g_aDirPath = u"/writerperfect/qa/unit/data/stream/test.dir"; +constexpr OUStringLiteral g_aNondirPath = u"/writerperfect/qa/unit/data/stream/test.dir/mimetype"; +constexpr OUStringLiteral g_aNonexistentPath = u"/writerperfect/qa/unit/data/stream/foo/bar"; DirectoryStreamTest::DirectoryStreamTest() { diff --git a/writerperfect/qa/unit/WPXSvStreamTest.cxx b/writerperfect/qa/unit/WPXSvStreamTest.cxx index 8a41aeedbced..0bd7b7b159fa 100644 --- a/writerperfect/qa/unit/WPXSvStreamTest.cxx +++ b/writerperfect/qa/unit/WPXSvStreamTest.cxx @@ -64,8 +64,8 @@ private: }; const char aText[] = "hello world"; -const OUStringLiteral aOLEFile = u"/writerperfect/qa/unit/data/stream/fdo40686-1.doc"; -const OUStringLiteral aZipFile = u"/writerperfect/qa/unit/data/stream/test.odt"; +constexpr OUStringLiteral aOLEFile = u"/writerperfect/qa/unit/data/stream/fdo40686-1.doc"; +constexpr OUStringLiteral aZipFile = u"/writerperfect/qa/unit/data/stream/test.odt"; shared_ptr<RVNGInputStream> lcl_createStream() { diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index 15de497408aa..01ebb74b84bd 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -55,7 +55,7 @@ using ::com::sun::star::uno::Reference; namespace { -const OUStringLiteral aCategoriesRange = u"categories"; +constexpr OUStringLiteral aCategoriesRange = u"categories"; typedef ::std::multimap< OUString, OUString > lcl_tOriginalRangeToInternalRangeMap; diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index dac4db9eb464..fad6a7e484e0 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -1358,9 +1358,9 @@ static OUString findOrAppendImpl( std::vector< DateTimeDeclImpl >& rVector, cons return pPrefix + OUString::number( nIndex ); } -const OUStringLiteral gpStrHeaderTextPrefix = u"hdr"; -const OUStringLiteral gpStrFooterTextPrefix = u"ftr"; -const OUStringLiteral gpStrDateTimeTextPrefix = u"dtd"; +constexpr OUStringLiteral gpStrHeaderTextPrefix = u"hdr"; +constexpr OUStringLiteral gpStrFooterTextPrefix = u"ftr"; +constexpr OUStringLiteral gpStrDateTimeTextPrefix = u"dtd"; HeaderFooterPageSettingsImpl SdXMLExport::ImpPrepDrawPageHeaderFooterDecls( const Reference<XDrawPage>& xDrawPage ) { diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index 2ac15ae78ed5..c2fb5999fdea 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -112,10 +112,10 @@ struct XMLShapeImportHelperImpl bool mbIsPresentationShapesSupported; }; -const OUStringLiteral gsStartShape(u"StartShape"); -const OUStringLiteral gsEndShape(u"EndShape"); -const OUStringLiteral gsStartGluePointIndex(u"StartGluePointIndex"); -const OUStringLiteral gsEndGluePointIndex(u"EndGluePointIndex"); +constexpr OUStringLiteral gsStartShape(u"StartShape"); +constexpr OUStringLiteral gsEndShape(u"EndShape"); +constexpr OUStringLiteral gsStartGluePointIndex(u"StartGluePointIndex"); +constexpr OUStringLiteral gsEndGluePointIndex(u"EndGluePointIndex"); XMLShapeImportHelper::XMLShapeImportHelper( SvXMLImport& rImporter, diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 79bc77a71e89..bb2e371f6c79 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -442,7 +442,7 @@ namespace xmloff { // no optimization here. If this method gets called, the XML stream did not contain a name for the // element, which is a heavy error. So in this case we don't care for performance - static const OUStringLiteral sUnnamedName = u"unnamed"; + static constexpr OUStringLiteral sUnnamedName = u"unnamed"; OSL_ENSURE(m_xParentContainer.is(), "OElementImport::implGetDefaultName: no parent container!"); if (!m_xParentContainer.is()) return sUnnamedName; diff --git a/xmloff/source/meta/xmlversion.cxx b/xmloff/source/meta/xmlversion.cxx index 2aa1100e5b21..7776ea876427 100644 --- a/xmloff/source/meta/xmlversion.cxx +++ b/xmloff/source/meta/xmlversion.cxx @@ -40,7 +40,7 @@ using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::uno; using namespace ::com::sun::star; -const OUStringLiteral XMLN_VERSIONSLIST = u"VersionList.xml"; +constexpr OUStringLiteral XMLN_VERSIONSLIST = u"VersionList.xml"; XMLVersionListExport::XMLVersionListExport( const css::uno::Reference< css::uno::XComponentContext >& rContext, diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index fdad9672c099..de19b3d56e15 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -1227,10 +1227,10 @@ void XMLTextFrameContext_Impl::SetHyperlink( const OUString& rHRef, const OUString& rTargetFrameName, bool bMap ) { - static const OUStringLiteral s_HyperLinkURL = u"HyperLinkURL"; - static const OUStringLiteral s_HyperLinkName = u"HyperLinkName"; - static const OUStringLiteral s_HyperLinkTarget = u"HyperLinkTarget"; - static const OUStringLiteral s_ServerMap = u"ServerMap"; + static constexpr OUStringLiteral s_HyperLinkURL = u"HyperLinkURL"; + static constexpr OUStringLiteral s_HyperLinkName = u"HyperLinkName"; + static constexpr OUStringLiteral s_HyperLinkTarget = u"HyperLinkTarget"; + static constexpr OUStringLiteral s_ServerMap = u"ServerMap"; if( !xPropSet.is() ) return; diff --git a/xmloff/source/text/XMLTextListBlockContext.cxx b/xmloff/source/text/XMLTextListBlockContext.cxx index b7a55c2ac80b..58f0aa5e8909 100644 --- a/xmloff/source/text/XMLTextListBlockContext.cxx +++ b/xmloff/source/text/XMLTextListBlockContext.cxx @@ -55,7 +55,7 @@ XMLTextListBlockContext::XMLTextListBlockContext( , msListId() , msContinueListId() { - static const OUStringLiteral s_PropNameDefaultListId = u"DefaultListId"; + static constexpr OUStringLiteral s_PropNameDefaultListId = u"DefaultListId"; { // get the parent list block context (if any); this is a bit ugly... XMLTextListBlockContext * pLB(nullptr); diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx index e48159449f02..65fcd19d9625 100644 --- a/xmloff/source/text/XMLTextMarkImportContext.cxx +++ b/xmloff/source/text/XMLTextMarkImportContext.cxx @@ -241,7 +241,7 @@ static auto PopFieldmark(XMLTextImportHelper & rHelper) -> void void XMLTextMarkImportContext::endFastElement(sal_Int32 nElement) { - static const OUStringLiteral sAPI_bookmark = u"com.sun.star.text.Bookmark"; + static constexpr OUStringLiteral sAPI_bookmark = u"com.sun.star.text.Bookmark"; lcl_MarkType nTmp{}; if (!SvXMLUnitConverter::convertEnum(nTmp, SvXMLImport::getNameFromToken(nElement), lcl_aMarkTypeMap)) diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index e813d4a725f7..fc1e00d18347 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -90,35 +90,35 @@ constexpr OUStringLiteral sAPI_textfield_prefix = u"com.sun.star.text.TextField. constexpr char16_t sAPI_fieldmaster_prefix[] = u"com.sun.star.text.FieldMaster."; const char sAPI_presentation_prefix[] = "com.sun.star.presentation.TextField."; -const OUStringLiteral sAPI_date_time = u"DateTime"; -const OUStringLiteral sAPI_page_number = u"PageNumber"; -const OUStringLiteral sAPI_docinfo_change_date_time = u"DocInfo.ChangeDateTime"; -const OUStringLiteral sAPI_docinfo_create_date_time = u"DocInfo.CreateDateTime"; -const OUStringLiteral sAPI_docinfo_custom = u"DocInfo.Custom"; -const OUStringLiteral sAPI_docinfo_print_date_time = u"DocInfo.PrintDateTime"; -const OUStringLiteral sAPI_dde = u"DDE"; -const OUStringLiteral sAPI_url = u"URL"; +constexpr OUStringLiteral sAPI_date_time = u"DateTime"; +constexpr OUStringLiteral sAPI_page_number = u"PageNumber"; +constexpr OUStringLiteral sAPI_docinfo_change_date_time = u"DocInfo.ChangeDateTime"; +constexpr OUStringLiteral sAPI_docinfo_create_date_time = u"DocInfo.CreateDateTime"; +constexpr OUStringLiteral sAPI_docinfo_custom = u"DocInfo.Custom"; +constexpr OUStringLiteral sAPI_docinfo_print_date_time = u"DocInfo.PrintDateTime"; +constexpr OUStringLiteral sAPI_dde = u"DDE"; +constexpr OUStringLiteral sAPI_url = u"URL"; // property names -const OUStringLiteral sAPI_is_fixed = u"IsFixed"; -const OUStringLiteral sAPI_content = u"Content"; -const OUStringLiteral sAPI_author = u"Author"; -const OUStringLiteral sAPI_hint = u"Hint"; -const OUStringLiteral sAPI_name = u"Name"; -const OUStringLiteral sAPI_sub_type = u"SubType"; -const OUStringLiteral sAPI_date_time_value = u"DateTimeValue"; -const OUStringLiteral sAPI_number_format = u"NumberFormat"; -const OUStringLiteral sAPI_numbering_type = u"NumberingType"; -const OUStringLiteral sAPI_offset = u"Offset"; -const OUStringLiteral sAPI_condition = u"Condition"; -const OUStringLiteral sAPI_set_number = u"SetNumber"; -const OUStringLiteral sAPI_file_format = u"FileFormat"; -const OUStringLiteral sAPI_is_date = u"IsDate"; -const OUStringLiteral sAPI_current_presentation = u"CurrentPresentation"; -const OUStringLiteral sAPI_is_hidden = u"IsHidden"; -const OUStringLiteral sAPI_is_fixed_language = u"IsFixedLanguage"; - -const OUStringLiteral sAPI_true = u"TRUE"; +constexpr OUStringLiteral sAPI_is_fixed = u"IsFixed"; +constexpr OUStringLiteral sAPI_content = u"Content"; +constexpr OUStringLiteral sAPI_author = u"Author"; +constexpr OUStringLiteral sAPI_hint = u"Hint"; +constexpr OUStringLiteral sAPI_name = u"Name"; +constexpr OUStringLiteral sAPI_sub_type = u"SubType"; +constexpr OUStringLiteral sAPI_date_time_value = u"DateTimeValue"; +constexpr OUStringLiteral sAPI_number_format = u"NumberFormat"; +constexpr OUStringLiteral sAPI_numbering_type = u"NumberingType"; +constexpr OUStringLiteral sAPI_offset = u"Offset"; +constexpr OUStringLiteral sAPI_condition = u"Condition"; +constexpr OUStringLiteral sAPI_set_number = u"SetNumber"; +constexpr OUStringLiteral sAPI_file_format = u"FileFormat"; +constexpr OUStringLiteral sAPI_is_date = u"IsDate"; +constexpr OUStringLiteral sAPI_current_presentation = u"CurrentPresentation"; +constexpr OUStringLiteral sAPI_is_hidden = u"IsHidden"; +constexpr OUStringLiteral sAPI_is_fixed_language = u"IsFixedLanguage"; + +constexpr OUStringLiteral sAPI_true = u"TRUE"; XMLTextFieldImportContext::XMLTextFieldImportContext( diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index e32c02d8ca1b..9642eb83d6da 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -405,7 +405,7 @@ XMLTextImportHelper::XMLTextImportHelper( bProgress, bBlockMode, bOrganizerMode) ) , m_xBackpatcherImpl( MakeBackpatcherImpl() ) { - static const OUStringLiteral s_PropNameDefaultListId = u"DefaultListId"; + static constexpr OUStringLiteral s_PropNameDefaultListId = u"DefaultListId"; Reference< XChapterNumberingSupplier > xCNSupplier( rModel, UNO_QUERY ); @@ -1013,14 +1013,14 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( bool bSetListAttrs, bool bOutlineContentVisible) { - static const OUStringLiteral s_NumberingRules = u"NumberingRules"; - static const OUStringLiteral s_NumberingIsNumber = u"NumberingIsNumber"; - static const OUStringLiteral s_NumberingLevel = u"NumberingLevel"; - static const OUStringLiteral s_ParaIsNumberingRestart = u"ParaIsNumberingRestart"; - static const OUStringLiteral s_NumberingStartValue = u"NumberingStartValue"; - static const OUStringLiteral s_PropNameListId = u"ListId"; - static const OUStringLiteral s_PageDescName = u"PageDescName"; - static const OUStringLiteral s_OutlineLevel = u"OutlineLevel"; + static constexpr OUStringLiteral s_NumberingRules = u"NumberingRules"; + static constexpr OUStringLiteral s_NumberingIsNumber = u"NumberingIsNumber"; + static constexpr OUStringLiteral s_NumberingLevel = u"NumberingLevel"; + static constexpr OUStringLiteral s_ParaIsNumberingRestart = u"ParaIsNumberingRestart"; + static constexpr OUStringLiteral s_NumberingStartValue = u"NumberingStartValue"; + static constexpr OUStringLiteral s_PropNameListId = u"ListId"; + static constexpr OUStringLiteral s_PageDescName = u"PageDescName"; + static constexpr OUStringLiteral s_OutlineLevel = u"OutlineLevel"; const XmlStyleFamily nFamily = bPara ? XmlStyleFamily::TEXT_PARAGRAPH : XmlStyleFamily::TEXT_TEXT; @@ -1619,12 +1619,12 @@ void XMLTextImportHelper::SetHyperlink( const OUString& rVisitedStyleName, XMLEventsImportContext* pEvents) { - static const OUStringLiteral s_HyperLinkURL = u"HyperLinkURL"; - static const OUStringLiteral s_HyperLinkName = u"HyperLinkName"; - static const OUStringLiteral s_HyperLinkTarget = u"HyperLinkTarget"; - static const OUStringLiteral s_UnvisitedCharStyleName = u"UnvisitedCharStyleName"; - static const OUStringLiteral s_VisitedCharStyleName = u"VisitedCharStyleName"; - static const OUStringLiteral s_HyperLinkEvents = u"HyperLinkEvents"; + static constexpr OUStringLiteral s_HyperLinkURL = u"HyperLinkURL"; + static constexpr OUStringLiteral s_HyperLinkName = u"HyperLinkName"; + static constexpr OUStringLiteral s_HyperLinkTarget = u"HyperLinkTarget"; + static constexpr OUStringLiteral s_UnvisitedCharStyleName = u"UnvisitedCharStyleName"; + static constexpr OUStringLiteral s_VisitedCharStyleName = u"VisitedCharStyleName"; + static constexpr OUStringLiteral s_HyperLinkEvents = u"HyperLinkEvents"; Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY ); Reference < XPropertySetInfo > xPropSetInfo( @@ -2212,7 +2212,7 @@ void XMLTextImportHelper::ConnectFrameChains( bool XMLTextImportHelper::IsInFrame() const { - static const OUStringLiteral s_TextFrame = u"TextFrame"; + static constexpr OUStringLiteral s_TextFrame = u"TextFrame"; bool bIsInFrame = false; diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx index f6fdcaee02c4..e43039e8202a 100644 --- a/xmloff/source/text/txtvfldi.cxx +++ b/xmloff/source/text/txtvfldi.cxx @@ -54,17 +54,17 @@ // service names constexpr char16_t sAPI_fieldmaster_prefix[] = u"com.sun.star.text.FieldMaster."; -const OUStringLiteral sAPI_get_expression = u"GetExpression"; -const OUStringLiteral sAPI_set_expression = u"SetExpression"; -const OUStringLiteral sAPI_user = u"User"; -const OUStringLiteral sAPI_database = u"com.sun.star.text.TextField.Database"; +constexpr OUStringLiteral sAPI_get_expression = u"GetExpression"; +constexpr OUStringLiteral sAPI_set_expression = u"SetExpression"; +constexpr OUStringLiteral sAPI_user = u"User"; +constexpr OUStringLiteral sAPI_database = u"com.sun.star.text.TextField.Database"; // property names -const OUStringLiteral sAPI_content = u"Content"; -const OUStringLiteral sAPI_sub_type = u"SubType"; -const OUStringLiteral sAPI_number_format = u"NumberFormat"; -const OUStringLiteral sAPI_is_visible = u"IsVisible"; -const OUStringLiteral sAPI_current_presentation = u"CurrentPresentation"; +constexpr OUStringLiteral sAPI_content = u"Content"; +constexpr OUStringLiteral sAPI_sub_type = u"SubType"; +constexpr OUStringLiteral sAPI_number_format = u"NumberFormat"; +constexpr OUStringLiteral sAPI_is_visible = u"IsVisible"; +constexpr OUStringLiteral sAPI_current_presentation = u"CurrentPresentation"; using namespace ::com::sun::star; diff --git a/xmlscript/source/xmllib_imexp/xmllib_export.cxx b/xmlscript/source/xmllib_imexp/xmllib_export.cxx index fa74273205fb..828db4ee2e64 100644 --- a/xmlscript/source/xmllib_imexp/xmllib_export.cxx +++ b/xmlscript/source/xmllib_imexp/xmllib_export.cxx @@ -29,8 +29,8 @@ using namespace com::sun::star; namespace xmlscript { -const OUStringLiteral aTrueStr = u"true"; -const OUStringLiteral aFalseStr = u"false"; +constexpr OUStringLiteral aTrueStr = u"true"; +constexpr OUStringLiteral aFalseStr = u"false"; void exportLibraryContainer( |