diff options
37 files changed, 150 insertions, 187 deletions
diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx index 58d4db27da8c..bd94d52c564b 100644 --- a/dbaccess/source/ui/app/AppIconControl.cxx +++ b/dbaccess/source/ui/app/AppIconControl.cxx @@ -73,7 +73,7 @@ void OApplicationIconControl::Fill() { TranslateId pLabelResId; ElementType eType; - rtl::OUStringConstExpr aImageResId; + OUString aImageResId; } aCategories[] = { { RID_STR_TABLES_CONTAINER, E_TABLE, BMP_TABLEFOLDER_TREE_L }, { RID_STR_QUERIES_CONTAINER, E_QUERY, BMP_QUERYFOLDER_TREE_L }, { RID_STR_FORMS_CONTAINER, E_FORM, BMP_FORMFOLDER_TREE_L }, diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx index f2dfd2a497f9..0eeba92634a5 100644 --- a/dbaccess/source/ui/browser/dbloader.cxx +++ b/dbaccess/source/ui/browser/dbloader.cxx @@ -116,7 +116,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU static constexpr struct ServiceNameToImplName { - rtl::OUStringConstExpr sServiceName; + OUString sServiceName; const char* pAsciiImplementationName; } aImplementations[] = { { URL_COMPONENT_FORMGRIDVIEW, "org.openoffice.comp.dbu.OFormGridView" }, diff --git a/extensions/source/propctrlr/defaultforminspection.cxx b/extensions/source/propctrlr/defaultforminspection.cxx index 16371b302868..3fa7fa5658a5 100644 --- a/extensions/source/propctrlr/defaultforminspection.cxx +++ b/extensions/source/propctrlr/defaultforminspection.cxx @@ -130,8 +130,8 @@ namespace pcr { const char* programmaticName; TranslateId uiNameResId; - rtl::OUStringConstExpr helpId; - } const aCategories[] = { + OUString helpId; + } constexpr aCategories[] = { { "General", RID_STR_PROPPAGE_DEFAULT, HID_FM_PROPDLG_TAB_GENERAL }, { "Data", RID_STR_PROPPAGE_DATA, HID_FM_PROPDLG_TAB_DATA }, { "Events", RID_STR_EVENTS, HID_FM_PROPDLG_TAB_EVT } @@ -144,7 +144,7 @@ namespace pcr { pReturn->ProgrammaticName = OUString::createFromAscii( aCategories[i].programmaticName ); pReturn->UIName = PcrRes( aCategories[i].uiNameResId ); - pReturn->HelpURL = HelpIdUrl::getHelpURL( aCategories[i].helpId.asView() ); + pReturn->HelpURL = HelpIdUrl::getHelpURL( aCategories[i].helpId ); } return aReturn; diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx index 714d051458c1..186eadd1a317 100644 --- a/filter/source/config/cache/filtercache.cxx +++ b/filter/source/config/cache/filtercache.cxx @@ -1812,7 +1812,7 @@ void FilterCache::impl_saveItem(const css::uno::Reference< css::container::XName namespace { constexpr struct { SfxFilterFlags eFlag; - rtl::OUStringConstExpr aName; + OUString aName; } flagFilterSwitcher[] = { { SfxFilterFlags::STARONEFILTER, FLAGNAME_3RDPARTYFILTER }, { SfxFilterFlags::ALIEN, FLAGNAME_ALIEN }, diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx index 67d67ed308a9..26b28a04f348 100644 --- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx +++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx @@ -82,7 +82,7 @@ namespace { struct ToolboxStyleItem { sal_Int16 nBit; - rtl::OUStringConstExpr attrName; + OUString attrName; }; } @@ -671,7 +671,7 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxItem( { if ( !aValue.isEmpty() ) aValue.append(" "); - aValue.append( OUString(pStyle->attrName) ); + aValue.append( pStyle->attrName ); } } pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_ITEMSTYLE, diff --git a/framework/source/uiconfiguration/windowstateconfiguration.cxx b/framework/source/uiconfiguration/windowstateconfiguration.cxx index 97a1402c9f2e..be600fae3c46 100644 --- a/framework/source/uiconfiguration/windowstateconfiguration.cxx +++ b/framework/source/uiconfiguration/windowstateconfiguration.cxx @@ -81,7 +81,7 @@ const sal_Int16 PROPERTY_DOCKPOS = 14; const sal_Int16 PROPERTY_DOCKSIZE = 15; // Order must be the same as WindowStateMask!! -rtl::OUStringConstExpr CONFIGURATION_PROPERTIES[] +constexpr OUString CONFIGURATION_PROPERTIES[] { WINDOWSTATE_PROPERTY_LOCKED, WINDOWSTATE_PROPERTY_DOCKED, @@ -224,7 +224,7 @@ ConfigurationAccess_WindowState::ConfigurationAccess_WindowState( std::u16string m_bModified( false ) { // Initialize access array with property names. - for (const rtl::OUStringConstExpr & s : CONFIGURATION_PROPERTIES ) + for (const OUString & s : CONFIGURATION_PROPERTIES ) m_aPropArray.push_back(s); } diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx index b6dd84e069ce..83f80d242ac7 100644 --- a/framework/source/uielement/controlmenucontroller.cxx +++ b/framework/source/uielement/controlmenucontroller.cxx @@ -87,7 +87,7 @@ static TranslateId aLabels[] = RID_STR_PROPTITLE_NAVBAR }; -const rtl::OUStringConstExpr aImgIds[] +constexpr OUString aImgIds[] { RID_SVXBMP_EDITBOX, RID_SVXBMP_BUTTON, @@ -193,7 +193,7 @@ void ControlMenuController::updateImagesPopupMenu(Reference<awt::XPopupMenu> con sal_Int16 nItemId = i + 1; if (m_bShowMenuImages) { - Image aImage(StockImage::Yes, OUString(aImgIds[i])); + Image aImage(StockImage::Yes, aImgIds[i]); Graphic aGraphic(aImage); rPopupMenu->setItemImage(nItemId, aGraphic.GetXGraphic(), false); } diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index fa63ac0dc5c8..809129ab5d50 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -267,7 +267,7 @@ void LCInfoNode::generateCode (const OFileWriter &of) const } else of.writeOUStringLiteralParameter("Variant", std::u16string_view()); - of.writeAsciiString("\nstatic constexpr rtl::OUStringConstExpr LCInfoArray[] = {\n"); + of.writeAsciiString("\nstatic constexpr OUString LCInfoArray[] = {\n"); of.writeAsciiString("\tlangID,\n"); of.writeAsciiString("\tlangDefaultName,\n"); of.writeAsciiString("\tcountryID,\n"); @@ -482,7 +482,7 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const sepNode = findNode("MeasurementSystem"); of.writeOUStringLiteralParameter("measurementSystem", sepNode->getValue()); - of.writeAsciiString("\nstatic constexpr rtl::OUStringConstExpr LCType[] = {\n"); + of.writeAsciiString("\nstatic constexpr OUString LCType[] = {\n"); of.writeAsciiString("\tLC_CTYPE_Unoid,\n"); of.writeAsciiString("\tdateSeparator,\n"); of.writeAsciiString("\tthousandSeparator,\n"); @@ -917,7 +917,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const of.writeAsciiString(" = "); of.writeInt( formatCount - mnFormats); of.writeAsciiString(";\n"); - of.writeAsciiString("static constexpr rtl::OUStringConstExpr "); + of.writeAsciiString("static constexpr OUString "); of.writeAsciiString("FormatElementsArray"); of.writeInt(mnSection); of.writeAsciiString("[] = {\n"); @@ -1239,7 +1239,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const of.writeInt( nbOfDateAcceptancePatterns); of.writeAsciiString(";\n"); - of.writeAsciiString("static constexpr rtl::OUStringConstExpr DateAcceptancePatternsArray[] = {\n"); + of.writeAsciiString("static constexpr OUString DateAcceptancePatternsArray[] = {\n"); for (sal_Int16 i = 0; i < nbOfDateAcceptancePatterns; ++i) { of.writeAsciiString("\t"); @@ -1300,7 +1300,7 @@ void LCCollationNode::generateCode (const OFileWriter &of) const of.writeInt(nbOfCollations); of.writeAsciiString(";\n\n"); - of.writeAsciiString("\nstatic constexpr rtl::OUStringConstExpr LCCollatorArray[] = {\n"); + of.writeAsciiString("\nstatic constexpr OUString LCCollatorArray[] = {\n"); for(sal_Int16 j = 0; j < nbOfCollations; j++) { of.writeAsciiString("\tCollatorID"); of.writeInt(j); @@ -1316,7 +1316,7 @@ void LCCollationNode::generateCode (const OFileWriter &of) const } of.writeAsciiString("};\n\n"); - of.writeAsciiString("static constexpr rtl::OUStringConstExpr collationOptions[] = {"); + of.writeAsciiString("static constexpr OUString collationOptions[] = {"); for( sal_Int16 j=0; j<nbOfCollationOptions; j++ ) { if (j) @@ -1357,7 +1357,7 @@ void LCSearchNode::generateCode (const OFileWriter &of) const of.writeInt( sal::static_int_cast<sal_Int16>( nSearchOptions ) ); of.writeAsciiString(";\n\n"); - of.writeAsciiString("static constexpr rtl::OUStringConstExpr searchOptions[] = {"); + of.writeAsciiString("static constexpr OUString searchOptions[] = {"); for( i=0; i<nSearchOptions; i++ ) { if (i) @@ -1417,7 +1417,7 @@ void LCIndexNode::generateCode (const OFileWriter &of) const of.writeInt(nbOfIndexs); of.writeAsciiString(";\n\n"); - of.writeAsciiString("\nstatic constexpr rtl::OUStringConstExpr IndexArray[] = {\n"); + of.writeAsciiString("\nstatic constexpr OUString IndexArray[] = {\n"); for(sal_Int16 i = 0; i < nbOfIndexs; i++) { of.writeAsciiString("\tIndexID"); of.writeInt(i); @@ -1445,7 +1445,7 @@ void LCIndexNode::generateCode (const OFileWriter &of) const of.writeInt( nbOfUnicodeScripts ); of.writeAsciiString(";\n\n"); - of.writeAsciiString("static constexpr rtl::OUStringConstExpr UnicodeScriptArray[] = {"); + of.writeAsciiString("static constexpr OUString UnicodeScriptArray[] = {"); for( sal_Int16 i=0; i<nbOfUnicodeScripts; i++ ) { if (i) @@ -1464,11 +1464,11 @@ void LCIndexNode::generateCode (const OFileWriter &of) const { // generate dummy array, reuse unicodeScript0 for dummy entry of.writeAsciiString("//dummy array, we have zero entries\n"); - of.writeAsciiString("static constexpr rtl::OUStringConstExpr FollowPageWordArray[] = { unicodeScript0 };\n\n"); + of.writeAsciiString("static constexpr OUString FollowPageWordArray[] = { unicodeScript0 };\n\n"); } else { - of.writeAsciiString("static constexpr rtl::OUStringConstExpr FollowPageWordArray[] = {\n"); + of.writeAsciiString("static constexpr OUString FollowPageWordArray[] = {\n"); for(sal_Int16 i = 0; i < nbOfPageWords; i++) { if (i) of.writeAsciiString(",\n"); @@ -1873,7 +1873,7 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const of.writeAsciiString("\";\n"); - of.writeAsciiString("static constexpr rtl::OUStringConstExpr calendars[] = {\n"); + of.writeAsciiString("static constexpr OUString calendars[] = {\n"); of.writeAsciiString("\tnbOfDays,\n"); of.writeAsciiString("\tnbOfMonths,\n"); of.writeAsciiString("\tnbOfGenitiveMonths,\n"); @@ -1979,7 +1979,7 @@ void LCCurrencyNode::generateCode (const OFileWriter &of) const of.writeAsciiString("static const sal_Int16 currencyCount = "); of.writeInt(nbOfCurrencies); of.writeAsciiString(";\n\n"); - of.writeAsciiString("static constexpr rtl::OUStringConstExpr currencies[] = {\n"); + of.writeAsciiString("static constexpr OUString currencies[] = {\n"); for(sal_Int16 i = 0; i < nbOfCurrencies; i++) { of.writeAsciiString("\tcurrencyID"); of.writeInt(i); @@ -2030,7 +2030,7 @@ void LCTransliterationNode::generateCode (const OFileWriter &of) const of.writeInt(nbOfModules); of.writeAsciiString(";\n\n"); - of.writeAsciiString("\nstatic constexpr rtl::OUStringConstExpr LCTransliterationsArray[] = {\n"); + of.writeAsciiString("\nstatic constexpr OUString LCTransliterationsArray[] = {\n"); for( sal_Int16 i = 0; i < nbOfModules; i++) { of.writeAsciiString("\tTransliteration"); of.writeInt(i); @@ -2112,7 +2112,7 @@ void LCMiscNode::generateCode (const OFileWriter &of) const of.writeAsciiString("static const sal_Int16 nbOfReservedWords = "); of.writeInt(nbOfWords); of.writeAsciiString(";\n\n"); - of.writeAsciiString("\nstatic constexpr rtl::OUStringConstExpr LCReservedWordsArray[] = {\n"); + of.writeAsciiString("\nstatic constexpr OUString LCReservedWordsArray[] = {\n"); for( i = 0; i < nbOfWords; i++) { of.writeAsciiString("\tReservedWord"); of.writeInt(i); @@ -2130,7 +2130,7 @@ void LCMiscNode::generateCode (const OFileWriter &of) const of.writeOUStringLiteralParameter( "forbiddenEnd", std::u16string_view()); of.writeOUStringLiteralParameter( "hangingChars", std::u16string_view()); } - of.writeAsciiString("\nstatic constexpr rtl::OUStringConstExpr LCForbiddenCharactersArray[] = {\n"); + of.writeAsciiString("\nstatic constexpr OUString LCForbiddenCharactersArray[] = {\n"); of.writeAsciiString("\tforbiddenBegin,\n"); of.writeAsciiString("\tforbiddenEnd,\n"); of.writeAsciiString("\thangingChars\n"); @@ -2150,7 +2150,7 @@ void LCMiscNode::generateCode (const OFileWriter &of) const of.writeOUStringLiteralParameter( "CharacterMode", std::u16string_view()); of.writeOUStringLiteralParameter( "LineMode", std::u16string_view()); } - of.writeAsciiString("\nstatic constexpr rtl::OUStringConstExpr LCBreakIteratorRulesArray[] = {\n"); + of.writeAsciiString("\nstatic constexpr OUString LCBreakIteratorRulesArray[] = {\n"); of.writeAsciiString("\tEditMode,\n"); of.writeAsciiString("\tDictionaryMode,\n"); of.writeAsciiString("\tWordCountMode,\n"); @@ -2202,7 +2202,7 @@ void LCNumberingLevelNode::generateCode (const OFileWriter &of) const // generate code. (intermediate arrays) for( i=0; i<nStyles; i++ ) { - of.writeAsciiString("\nstatic constexpr rtl::OUStringConstExpr continuousStyle" ); + of.writeAsciiString("\nstatic constexpr OUString continuousStyle" ); of.writeInt( sal::static_int_cast<sal_Int16>(i) ); of.writeAsciiString("[] = {\n"); for( sal_Int32 j=0; j<nAttributes; j++) @@ -2218,7 +2218,7 @@ void LCNumberingLevelNode::generateCode (const OFileWriter &of) const // generate code. (top-level array) of.writeAsciiString("\n"); - of.writeAsciiString("static const rtl::OUStringConstExpr* LCContinuousNumberingLevelsArray[] = {\n" ); + of.writeAsciiString("static const OUString* LCContinuousNumberingLevelsArray[] = {\n" ); for( i=0; i<nStyles; i++ ) { of.writeAsciiString( "\t" ); @@ -2316,7 +2316,7 @@ void LCOutlineNumberingLevelNode::generateCode (const OFileWriter &of) const { for( sal_Int32 j=0; j<nLevels.back(); j++ ) { - of.writeAsciiString("static constexpr rtl::OUStringConstExpr outline"); + of.writeAsciiString("static constexpr OUString outline"); of.writeAsciiString("Style"); of.writeInt( sal::static_int_cast<sal_Int16>(i) ); of.writeAsciiString("Level"); @@ -2340,7 +2340,7 @@ void LCOutlineNumberingLevelNode::generateCode (const OFileWriter &of) const for( sal_Int32 i=0; i<nStyles; i++ ) { - of.writeAsciiString("static constexpr rtl::OUStringConstExpr const * outlineStyle" ); + of.writeAsciiString("static constexpr OUString const * outlineStyle" ); of.writeInt( sal::static_int_cast<sal_Int16>(i) ); of.writeAsciiString("[] = { "); @@ -2356,7 +2356,7 @@ void LCOutlineNumberingLevelNode::generateCode (const OFileWriter &of) const } of.writeAsciiString("\n"); - of.writeAsciiString("static constexpr rtl::OUStringConstExpr const * const * LCOutlineNumberingLevelsArray[] = {\n" ); + of.writeAsciiString("static constexpr OUString const * const * LCOutlineNumberingLevelsArray[] = {\n" ); for( sal_Int32 i=0; i<nStyles; i++ ) { of.writeAsciiString( "\t" ); diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index a88c2a303194..cd23f121e2ac 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -142,39 +142,6 @@ template<std::size_t N> struct ExceptCharArrayDetector<OUStringLiteral<N>> {}; } #endif -/** - This is intended to be used when declaring compile-time-constant structs or arrays - that can be initialised from named OUStringLiteral e.g. - - constexpr OUStringLiteral AAA = u"aaa"; - constexpr OUStringLiteral BBB = u"bbb"; - constexpr OUStringConstExpr FOO[] { AAA, BBB }; -*/ -class OUString; -class OUStringConstExpr -{ -public: - template<std::size_t N> constexpr OUStringConstExpr(OUStringLiteral<N> const & literal): - pData(const_cast<rtl_uString *>(&literal.str)) {} - - // prevent mis-use - template<std::size_t N> constexpr OUStringConstExpr(OUStringLiteral<N> && literal) - = delete; - - // no destructor necessary because we know we are pointing at a compile-time - // constant OUStringLiteral, which bypasses ref-counting. - - /** - make it easier to pass to OUStringBuffer and similar without casting/converting - */ - constexpr std::u16string_view asView() const { return std::u16string_view(pData->buffer, pData->length); } - - inline operator const OUString&() const; - -private: - rtl_uString* pData; -}; - /// @endcond #endif @@ -3408,11 +3375,6 @@ private: }; #if defined LIBO_INTERNAL_ONLY -// Can only define this after we define OUString -inline OUStringConstExpr::operator const OUString &() const { return OUString::unacquired(&pData); } -#endif - -#if defined LIBO_INTERNAL_ONLY // Prevent the operator ==/!= overloads with 'sal_Unicode const *' parameter from // being selected for nonsensical code like // diff --git a/include/xmloff/maptype.hxx b/include/xmloff/maptype.hxx index 5102b899b11e..9271027cb6c8 100644 --- a/include/xmloff/maptype.hxx +++ b/include/xmloff/maptype.hxx @@ -31,7 +31,7 @@ */ struct XMLPropertyMapEntry { - rtl::OUStringConstExpr msApiName; /// Property-Name + OUString msApiName; /// Property-Name enum ::xmloff::token::XMLTokenEnum meXMLName; /// XML-Name sal_uInt16 mnNameSpace; /** declares the Namespace in which this property exists */ diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index ed415ca1e13a..017d4b5e8c30 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -615,7 +615,7 @@ void LngSvcMgr::UpdateAll() SvtLinguConfig aCfg; const int nNumServices = 4; - static constexpr rtl::OUStringConstExpr apServices[nNumServices] = { SN_SPELLCHECKER, SN_GRAMMARCHECKER, SN_HYPHENATOR, SN_THESAURUS }; + static constexpr OUString apServices[nNumServices] = { SN_SPELLCHECKER, SN_GRAMMARCHECKER, SN_HYPHENATOR, SN_THESAURUS }; const char * const apCurLists[nNumServices] = { "ServiceManager/SpellCheckerList", "ServiceManager/GrammarCheckerList", "ServiceManager/HyphenatorList", "ServiceManager/ThesaurusList" }; const char * const apLastFoundLists[nNumServices] = { "ServiceManager/LastFoundSpellCheckers", "ServiceManager/LastFoundGrammarCheckers", "ServiceManager/LastFoundHyphenators", "ServiceManager/LastFoundThesauri" }; @@ -625,7 +625,7 @@ void LngSvcMgr::UpdateAll() for (int k = 0; k < nNumServices; ++k) { - OUString aService( apServices[k] ); + OUString const & aService = apServices[k]; OUString aActiveList( OUString::createFromAscii( apCurLists[k] ) ); OUString aLastFoundList( OUString::createFromAscii( apLastFoundLists[k] ) ); diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx index c55f472b78cc..d00a82a3d895 100644 --- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx +++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx @@ -348,7 +348,7 @@ uno::Sequence< beans::Property > SAL_CALL DataProviderHandler::getSupportedPrope { rptui::OPropertyInfoService::getExcludeProperties( aNewProps, m_xFormComponentHandler ); beans::Property aValue; - static const rtl::OUStringConstExpr s_pProperties[] = + static constexpr OUString s_pProperties[] = { PROPERTY_CHARTTYPE ,PROPERTY_MASTERFIELDS diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 20ea2b5186f6..b205d35adb6e 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -1316,102 +1316,102 @@ size_t ScIconSetFormat::size() const namespace { -constexpr rtl::OUStringConstExpr a3TrafficLights1[] = { +constexpr OUString a3TrafficLights1[] = { BMP_ICON_SET_CIRCLES1_RED, BMP_ICON_SET_CIRCLES1_YELLOW, BMP_ICON_SET_CIRCLES1_GREEN }; -constexpr rtl::OUStringConstExpr a3TrafficLights2[] = { +constexpr OUString a3TrafficLights2[] = { BMP_ICON_SET_TRAFFICLIGHTS_RED, BMP_ICON_SET_TRAFFICLIGHTS_YELLOW, BMP_ICON_SET_TRAFFICLIGHTS_GREEN }; -constexpr rtl::OUStringConstExpr a3Arrows[] = { +constexpr OUString a3Arrows[] = { BMP_ICON_SET_COLORARROWS_DOWN, BMP_ICON_SET_COLORARROWS_SAME, BMP_ICON_SET_COLORARROWS_UP }; -constexpr rtl::OUStringConstExpr a3ArrowsGray[] = { +constexpr OUString a3ArrowsGray[] = { BMP_ICON_SET_GRAYARROWS_DOWN, BMP_ICON_SET_GRAYARROWS_SAME, BMP_ICON_SET_GRAYARROWS_UP }; -constexpr rtl::OUStringConstExpr a3Flags[] = { +constexpr OUString a3Flags[] = { BMP_ICON_SET_FLAGS_RED, BMP_ICON_SET_FLAGS_YELLOW, BMP_ICON_SET_FLAGS_GREEN }; -constexpr rtl::OUStringConstExpr a3Smilies[] = { +constexpr OUString a3Smilies[] = { BMP_ICON_SET_POSITIVE_YELLOW_SMILIE, BMP_ICON_SET_NEUTRAL_YELLOW_SMILIE, BMP_ICON_SET_NEGATIVE_YELLOW_SMILIE }; -constexpr rtl::OUStringConstExpr a3ColorSmilies[] = { +constexpr OUString a3ColorSmilies[] = { BMP_ICON_SET_POSITIVE_GREEN_SMILIE, BMP_ICON_SET_NEUTRAL_YELLOW_SMILIE, BMP_ICON_SET_NEGATIVE_RED_SMILIE }; -constexpr rtl::OUStringConstExpr a3Stars[] = { +constexpr OUString a3Stars[] = { BMP_ICON_SET_STARS_EMPTY, BMP_ICON_SET_STARS_HALF, BMP_ICON_SET_STARS_FULL }; -constexpr rtl::OUStringConstExpr a3Triangles[] = { +constexpr OUString a3Triangles[] = { BMP_ICON_SET_TRIANGLES_DOWN, BMP_ICON_SET_TRIANGLES_SAME, BMP_ICON_SET_TRIANGLES_UP }; -constexpr rtl::OUStringConstExpr a4Arrows[] = { +constexpr OUString a4Arrows[] = { BMP_ICON_SET_COLORARROWS_DOWN, BMP_ICON_SET_COLORARROWS_SLIGHTLY_DOWN, BMP_ICON_SET_COLORARROWS_SLIGHTLY_UP, BMP_ICON_SET_COLORARROWS_UP }; -constexpr rtl::OUStringConstExpr a4ArrowsGray[] = { +constexpr OUString a4ArrowsGray[] = { BMP_ICON_SET_GRAYARROWS_DOWN, BMP_ICON_SET_GRAYARROWS_SLIGHTLY_DOWN, BMP_ICON_SET_GRAYARROWS_SLIGHTLY_UP, BMP_ICON_SET_GRAYARROWS_UP }; -constexpr rtl::OUStringConstExpr a5Arrows[] = { +constexpr OUString a5Arrows[] = { BMP_ICON_SET_COLORARROWS_DOWN, BMP_ICON_SET_COLORARROWS_SLIGHTLY_DOWN, BMP_ICON_SET_COLORARROWS_SAME, BMP_ICON_SET_COLORARROWS_SLIGHTLY_UP, BMP_ICON_SET_COLORARROWS_UP }; -constexpr rtl::OUStringConstExpr a5ArrowsGray[] = { +constexpr OUString a5ArrowsGray[] = { BMP_ICON_SET_GRAYARROWS_DOWN, BMP_ICON_SET_GRAYARROWS_SLIGHTLY_DOWN, BMP_ICON_SET_GRAYARROWS_SAME, BMP_ICON_SET_GRAYARROWS_SLIGHTLY_UP, BMP_ICON_SET_GRAYARROWS_UP }; -constexpr rtl::OUStringConstExpr a4TrafficLights[] = { +constexpr OUString a4TrafficLights[] = { BMP_ICON_SET_CIRCLES1_GRAY, BMP_ICON_SET_CIRCLES1_RED, BMP_ICON_SET_CIRCLES1_YELLOW, BMP_ICON_SET_CIRCLES1_GREEN }; -constexpr rtl::OUStringConstExpr a5Quarters[] = { +constexpr OUString a5Quarters[] = { BMP_ICON_SET_PIES_EMPTY, BMP_ICON_SET_PIES_ONE_QUARTER, BMP_ICON_SET_PIES_HALF, BMP_ICON_SET_PIES_THREE_QUARTER, BMP_ICON_SET_PIES_FULL, }; -constexpr rtl::OUStringConstExpr a5Boxes[] = { +constexpr OUString a5Boxes[] = { BMP_ICON_SET_SQUARES_EMPTY, BMP_ICON_SET_SQUARES_ONE_QUARTER, BMP_ICON_SET_SQUARES_HALF, BMP_ICON_SET_SQUARES_THREE_QUARTER, BMP_ICON_SET_SQUARES_FULL }; -constexpr rtl::OUStringConstExpr a3Symbols1[] = { +constexpr OUString a3Symbols1[] = { BMP_ICON_SET_SYMBOLS1_CROSS, BMP_ICON_SET_SYMBOLS1_EXCLAMATION_MARK, BMP_ICON_SET_SYMBOLS1_CHECK }; -constexpr rtl::OUStringConstExpr a3Signs[] = { +constexpr OUString a3Signs[] = { BMP_ICON_SET_SHAPES_DIAMOND, BMP_ICON_SET_SHAPES_TRIANGLE, BMP_ICON_SET_SHAPES_CIRCLE }; -constexpr rtl::OUStringConstExpr a4RedToBlack[] = { +constexpr OUString a4RedToBlack[] = { BMP_ICON_SET_CIRCLES2_DARK_GRAY, BMP_ICON_SET_CIRCLES2_LIGHT_GRAY, BMP_ICON_SET_CIRCLES2_LIGHT_RED, BMP_ICON_SET_CIRCLES2_DARK_RED }; -constexpr rtl::OUStringConstExpr a4Ratings[] = { +constexpr OUString a4Ratings[] = { BMP_ICON_SET_BARS_ONE_QUARTER, BMP_ICON_SET_BARS_HALF, BMP_ICON_SET_BARS_THREE_QUARTER, BMP_ICON_SET_BARS_FULL }; -constexpr rtl::OUStringConstExpr a5Ratings[] = { +constexpr OUString a5Ratings[] = { BMP_ICON_SET_BARS_EMPTY, BMP_ICON_SET_BARS_ONE_QUARTER, BMP_ICON_SET_BARS_HALF, BMP_ICON_SET_BARS_THREE_QUARTER, BMP_ICON_SET_BARS_FULL }; struct ScIconSetBitmapMap { ScIconSetType eType; - const rtl::OUStringConstExpr* pBitmaps; + const OUString* pBitmaps; }; const ScIconSetBitmapMap aBitmapMap[] = { diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 58bb28668b4d..89d77642558a 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -75,7 +75,7 @@ const ScContentId pTypeList[int(ScContentId::LAST) + 1] = ScContentId::DRAWING }; -constexpr rtl::OUStringConstExpr aContentBmps[]= +constexpr OUString aContentBmps[]= { RID_BMP_CONTENT_TABLE, RID_BMP_CONTENT_RANGENAME, @@ -185,13 +185,13 @@ void ScContentTree::InitRoot( ScContentId nType ) return; } - auto const aImage(aContentBmps[static_cast<int>(nType) - 1]); + auto const & aImage = aContentBmps[static_cast<int>(nType) - 1]; OUString aName(ScResId(SCSTR_CONTENT_ARY[static_cast<int>(nType)])); // back to the correct position: sal_uInt16 nPos = nRootType != ScContentId::ROOT ? 0 : pPosList[nType]-1; m_aRootNodes[nType] = m_xTreeView->make_iterator(); m_xTreeView->insert(nullptr, nPos, &aName, nullptr, nullptr, nullptr, false, m_aRootNodes[nType].get()); - m_xTreeView->set_image(*m_aRootNodes[nType], OUString(aImage)); + m_xTreeView->set_image(*m_aRootNodes[nType], aImage); } void ScContentTree::ClearAll() diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx index f3b4888ae535..635c918f3673 100644 --- a/sc/source/ui/unoobj/targuno.cxx +++ b/sc/source/ui/unoobj/targuno.cxx @@ -200,7 +200,7 @@ void SAL_CALL ScLinkTargetTypeObj::setPropertyValue(const OUString& /* aProperty //! exception? } -constexpr rtl::OUStringConstExpr aContentBmps[]= +constexpr OUString aContentBmps[]= { RID_BMP_CONTENT_TABLE, RID_BMP_CONTENT_RANGENAME, @@ -229,7 +229,7 @@ void ScLinkTargetTypeObj::SetLinkTargetBitmap( uno::Any& rRet, sal_uInt16 nType } if (nImgId != ScContentId::ROOT) { - BitmapEx aBitmapEx { OUString(aContentBmps[static_cast<int>(nImgId) -1 ]) }; + BitmapEx aBitmapEx { aContentBmps[static_cast<int>(nImgId) -1 ] }; rRet <<= VCLUnoHelper::CreateBitmap(aBitmapEx); } } diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx index dcfbccb6c1fa..f85803dabc23 100644 --- a/sc/source/ui/view/olinewin.cxx +++ b/sc/source/ui/view/olinewin.cxx @@ -602,7 +602,7 @@ void ScOutlineWindow::HideFocus() } } -constexpr rtl::OUStringConstExpr aLevelBmps[]= +constexpr OUString aLevelBmps[]= { RID_BMP_LEVEL1, RID_BMP_LEVEL2, @@ -638,7 +638,7 @@ void ScOutlineWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const tools { tools::Long nEntryPos = GetHeaderEntryPos(); for ( size_t nLevel = 0; nLevel < nLevelCount; ++nLevel ) - DrawImageRel(GetLevelPos(nLevel), nEntryPos, OUString(aLevelBmps[nLevel])); + DrawImageRel(GetLevelPos(nLevel), nEntryPos, aLevelBmps[nLevel]); GetOutDev()->SetLineColor( maLineColor ); tools::Long nLinePos = mnHeaderPos + (mbMirrorEntries ? 0 : (mnHeaderSize - 1)); diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx index 251548a22353..e0953de3b0e2 100644 --- a/sd/source/ui/controller/slidelayoutcontroller.cxx +++ b/sd/source/ui/controller/slidelayoutcontroller.cxx @@ -78,7 +78,7 @@ private: struct snew_slide_value_info_layout { - rtl::OUStringConstExpr msBmpResId; + OUString msBmpResId; TranslateId mpStrResId; AutoLayout maAutoLayout; }; @@ -87,13 +87,13 @@ struct snew_slide_value_info_layout constexpr OUStringLiteral EMPTY = u""; -const snew_slide_value_info_layout notes[] = +constexpr snew_slide_value_info_layout notes[] = { {BMP_SLIDEN_01, STR_AUTOLAYOUT_NOTES, AUTOLAYOUT_NOTES}, {EMPTY, {}, AUTOLAYOUT_NONE}, }; -const snew_slide_value_info_layout handout[] = +constexpr snew_slide_value_info_layout handout[] = { {BMP_SLIDEH_01, STR_AUTOLAYOUT_HANDOUT1, AUTOLAYOUT_HANDOUT1}, {BMP_SLIDEH_02, STR_AUTOLAYOUT_HANDOUT2, AUTOLAYOUT_HANDOUT2}, @@ -104,7 +104,7 @@ const snew_slide_value_info_layout handout[] = {EMPTY, {}, AUTOLAYOUT_NONE}, }; -const snew_slide_value_info_layout standard[] = +constexpr snew_slide_value_info_layout standard[] = { {BMP_LAYOUT_EMPTY, STR_AUTOLAYOUT_NONE, AUTOLAYOUT_NONE }, {BMP_LAYOUT_HEAD03, STR_AUTOLAYOUT_TITLE, AUTOLAYOUT_TITLE }, @@ -121,7 +121,7 @@ const snew_slide_value_info_layout standard[] = {EMPTY, {}, AUTOLAYOUT_NONE} }; -const snew_slide_value_info_layout v_standard[] = +constexpr snew_slide_value_info_layout v_standard[] = { // vertical {BMP_LAYOUT_VERTICAL02, STR_AL_VERT_TITLE_TEXT_CHART, AUTOLAYOUT_VTITLE_VCONTENT_OVER_VCONTENT }, diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx index 197afd5f404f..ec22beeedc37 100644 --- a/sd/source/ui/presenter/PresenterHelper.cxx +++ b/sd/source/ui/presenter/PresenterHelper.cxx @@ -185,7 +185,7 @@ namespace { struct IdMapEntry { char const * sid; - rtl::OUStringConstExpr bmpid; + OUString bmpid; }; } @@ -197,7 +197,7 @@ Reference<rendering::XBitmap> SAL_CALL PresenterHelper::loadBitmap ( if ( ! rxCanvas.is()) return nullptr; - static IdMapEntry const map[] = { + static IdMapEntry constexpr map[] = { { "bitmaps/Background.png", BMP_PRESENTERSCREEN_BACKGROUND }, { "bitmaps/Animation.png", BMP_PRESENTERSCREEN_ANIMATION }, diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index 7826f079b699..6cc93b71c781 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -62,7 +62,7 @@ class ImageButtonHdl; const sal_uInt16 gButtonSlots[] = { SID_INSERT_TABLE, SID_INSERT_DIAGRAM, SID_INSERT_GRAPHIC, SID_INSERT_AVMEDIA }; const TranslateId gButtonToolTips[] = { STR_INSERT_TABLE, STR_INSERT_CHART, STR_INSERT_PICTURE, STR_INSERT_MOVIE }; -constexpr rtl::OUStringConstExpr aSmallPlaceHolders[] = +constexpr OUString aSmallPlaceHolders[] = { BMP_PLACEHOLDER_TABLE_SMALL, BMP_PLACEHOLDER_CHART_SMALL, @@ -74,7 +74,7 @@ constexpr rtl::OUStringConstExpr aSmallPlaceHolders[] = BMP_PLACEHOLDER_MOVIE_SMALL_HOVER }; -constexpr rtl::OUStringConstExpr aBigPlaceHolders[] = +constexpr OUString aBigPlaceHolders[] = { BMP_PLACEHOLDER_TABLE_LARGE, BMP_PLACEHOLDER_CHART_LARGE, @@ -97,8 +97,8 @@ static BitmapEx* getButtonImage( int index, bool large ) { for (size_t i = 0; i < SAL_N_ELEMENTS(aSmallPlaceHolders); i++ ) { - gSmallButtonImages[i].set(OUString(aSmallPlaceHolders[i])); - gLargeButtonImages[i].set(OUString(aBigPlaceHolders[i])); + gSmallButtonImages[i].set(aSmallPlaceHolders[i]); + gLargeButtonImages[i].set(aBigPlaceHolders[i]); } } diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm index f5d9e2d5db8d..8cb9b6d8061c 100644 --- a/sfx2/source/appl/shutdowniconaqua.mm +++ b/sfx2/source/appl/shutdowniconaqua.mm @@ -391,8 +391,8 @@ void aqua_init_systray() { SvtModuleOptions::EModule eModuleIdentifier; int nMenuTag; - rtl::OUStringConstExpr sURLDescription; - } static const aMenuItems[] = + OUString sURLDescription; + } static constexpr aMenuItems[] = { { SvtModuleOptions::EModule::WRITER, MI_WRITER, WRITER_URL }, { SvtModuleOptions::EModule::CALC, MI_CALC, CALC_URL }, diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index df603851231b..2fb7cd2b7875 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -157,8 +157,8 @@ static HMENU createSystrayMenu( ) SvtModuleOptions::EModule eModuleIdentifier; UINT nMenuItemID; UINT nMenuIconID; - rtl::OUStringConstExpr sURLDescription; - } static const aMenuItems[] = + OUString sURLDescription; + } static constexpr aMenuItems[] = { { SvtModuleOptions::EModule::WRITER, IDM_WRITER, ICON_TEXT_DOCUMENT, WRITER_URL }, { SvtModuleOptions::EModule::CALC, IDM_CALC, ICON_SPREADSHEET_DOCUMENT, CALC_URL }, @@ -181,7 +181,7 @@ static HMENU createSystrayMenu( ) continue; addMenuItem( hMenu, nMenuItemID, nMenuIconID, - ShutdownIcon::GetUrlDescription( sURL.asView() ), pos, true, "" ); + ShutdownIcon::GetUrlDescription( sURL ), pos, true, "" ); } diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index c38e6bfd22cf..37f1fc16aa8e 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -373,7 +373,7 @@ constexpr OUStringLiteral sMetaNonWhitespaceCharacterCount = u"meta:non-whitespa constexpr OUStringLiteral sMetaCellCount = u"meta:cell-count"; // NB: keep these two arrays in sync! -constexpr rtl::OUStringConstExpr s_stdStatAttrs[] = { +constexpr OUString s_stdStatAttrs[] = { sMetaPageCount, sMetaTableCount, sMetaDrawCount, @@ -442,7 +442,7 @@ constexpr OUStringLiteral sMetaUserDefined = u"meta:user-defined"; constexpr OUStringLiteral sDCContributor = u"dc:contributor"; constexpr OUStringLiteral sDCPublisher = u"dc:publisher"; constexpr OUStringLiteral sDCRelation = u"dc:relation"; -constexpr rtl::OUStringConstExpr s_stdMetaList[] { +constexpr OUString s_stdMetaList[] { sMetaKeyword, // string* sMetaUserDefined, // ...* sDCContributor, // string* @@ -1226,7 +1226,7 @@ void SfxDocumentMetaData::init( // select nodes for elements of which we handle all occurrences for (const auto & name : s_stdMetaList) { std::vector<css::uno::Reference<css::xml::dom::XNode> > nodes = - getChildNodeListByName(m_xParent, OUString(name)); + getChildNodeListByName(m_xParent, name); m_metaList[name] = nodes; } diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index 3625e5aa3f8d..1934c6acaf3e 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -462,7 +462,7 @@ OUString SfxDocumentTemplates::GetTemplateTargetURLFromComponent( std::u16string */ OUString SfxDocumentTemplates::ConvertResourceString(const OUString& rString) { - static constexpr rtl::OUStringConstExpr aTemplateNames[] = + static constexpr OUString aTemplateNames[] = { STR_TEMPLATE_NAME1_DEF, STR_TEMPLATE_NAME2_DEF, diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index bacc84fcba87..cea78036d59a 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -734,7 +734,7 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory) // 0 is used in case of unused combinations. assert(NOCATEGORIES == 10 && "Sm : array doesn't fit into the number of categories"); static constexpr OUStringLiteral EMPTY(u""); - static constexpr rtl::OUStringConstExpr aCatMf2Hid[10][4] = + static constexpr OUString aCatMf2Hid[10][4] = { { HID_SMA_DEFAULT_DIST, HID_SMA_LINE_DIST, HID_SMA_ROOT_DIST, EMPTY }, { HID_SMA_SUP_DIST, HID_SMA_SUB_DIST , EMPTY, EMPTY }, @@ -784,7 +784,7 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory) // To determine which Controls should be active, the existence // of an associated HelpID is checked - bActive = !aCatMf2Hid[nCategory][i].asView().empty(); + bActive = !aCatMf2Hid[nCategory][i].isEmpty(); pFT->set_visible(bActive); pFT->set_sensitive(bActive); diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index 1fde68ed7c0d..337013e55d34 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -313,7 +313,7 @@ void FrameSelectorImpl::InitColors() maHCLineCol = COL_BLACK; } -constexpr rtl::OUStringConstExpr aImageIds[] = +constexpr OUString aImageIds[] = { RID_SVXBMP_FRMSEL_ARROW1, RID_SVXBMP_FRMSEL_ARROW2, @@ -350,7 +350,7 @@ void FrameSelectorImpl::InitArrowImageList() assert(SAL_N_ELEMENTS(aImageIds) == 16); for (size_t i = 0; i < SAL_N_ELEMENTS(aImageIds); ++i) { - BitmapEx aBmpEx { OUString(aImageIds[i]) }; + BitmapEx aBmpEx { aImageIds[i] }; aBmpEx.Replace(pColorAry1, pColorAry2, 3); maArrows.emplace_back(aBmpEx); } diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index d7fe7c9c23dd..7f367a2d99a3 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -1551,7 +1551,7 @@ Reference< XIndexContainer > FmXGridPeer::getColumns() void FmXGridPeer::addColumnListeners(const Reference< XPropertySet >& xCol) { - static const rtl::OUStringConstExpr aPropsListenedTo[] = + static constexpr OUString aPropsListenedTo[] = { FM_PROP_LABEL, FM_PROP_WIDTH, FM_PROP_HIDDEN, FM_PROP_ALIGN, FM_PROP_FORMATKEY @@ -1576,7 +1576,7 @@ void FmXGridPeer::removeColumnListeners(const Reference< XPropertySet >& xCol) { // the same props as in addColumnListeners... linux has problems with global static UStrings, so // we have to do it this way... - static const rtl::OUStringConstExpr aPropsListenedTo[] = + static constexpr OUString aPropsListenedTo[] = { FM_PROP_LABEL, FM_PROP_WIDTH, FM_PROP_HIDDEN, FM_PROP_ALIGN, FM_PROP_FORMATKEY @@ -2648,7 +2648,7 @@ Sequence< css::util::URL>& FmXGridPeer::getSupportedURLs() { static Sequence< css::util::URL> aSupported = []() { - static const rtl::OUStringConstExpr sSupported[] = { + static constexpr OUString sSupported[] = { FMURL_RECORD_MOVEFIRST, FMURL_RECORD_MOVEPREV, FMURL_RECORD_MOVENEXT, diff --git a/svx/source/form/fmdmod.cxx b/svx/source/form/fmdmod.cxx index 56aa46447a20..87c13e44e608 100644 --- a/svx/source/form/fmdmod.cxx +++ b/svx/source/form/fmdmod.cxx @@ -58,7 +58,7 @@ using namespace ::svxform; ::com::sun::star::uno::Sequence< OUString > SAL_CALL SvxFmMSFactory::getAvailableServiceNames() { - static const rtl::OUStringConstExpr aSvxComponentServiceNameList[] = + static constexpr OUString aSvxComponentServiceNameList[] = { FM_SUN_COMPONENT_TEXTFIELD, FM_SUN_COMPONENT_FORM, diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 8e7278f7e3fe..dd71f6999ade 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -204,7 +204,7 @@ static std::u16string_view aConvertSlots[] = u"ConvertToNavigationBar" }; -constexpr rtl::OUStringConstExpr aImgIds[] = +constexpr OUString aImgIds[] = { RID_SVXBMP_EDITBOX, RID_SVXBMP_BUTTON, diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index ba693fb02a92..e4a50a7ef275 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <map> +#include <string_view> #include <sal/macros.h> #include <fmundo.hxx> @@ -536,11 +537,11 @@ void SAL_CALL FmXUndoEnvironment::propertyChange(const PropertyChangeEvent& evt) return; // if it's a "default value" property of a control model, set the according "value" property - static constexpr rtl::OUStringConstExpr pDefaultValueProperties[] = { + static constexpr std::u16string_view pDefaultValueProperties[] = { FM_PROP_DEFAULT_TEXT, FM_PROP_DEFAULTCHECKED, FM_PROP_DEFAULT_DATE, FM_PROP_DEFAULT_TIME, FM_PROP_DEFAULT_VALUE, FM_PROP_DEFAULT_SELECT_SEQ, FM_PROP_EFFECTIVE_DEFAULT }; - static constexpr rtl::OUStringConstExpr aValueProperties[] = { + static constexpr OUString aValueProperties[] = { FM_PROP_TEXT, FM_PROP_STATE, FM_PROP_DATE, FM_PROP_TIME, FM_PROP_VALUE, FM_PROP_SELECT_SEQ, FM_PROP_EFFECTIVE_VALUE }; diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index 17bc19a8990a..8a3d23f3042f 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -53,7 +53,7 @@ using namespace ::com::sun::star; -const std::pair<sal_uInt16, rtl::OUStringConstExpr> aUnlocalized[] = +constexpr std::pair<sal_uInt16, OUString> aUnlocalized[] = { { GALLERY_THEME_HOMEPAGE, RID_GALLERYSTR_THEME_HTMLBUTTONS }, { GALLERY_THEME_POWERPOINT, RID_GALLERYSTR_THEME_POWERPOINT }, diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx index 9affab6d7988..80258b61df65 100644 --- a/svx/source/tbxctrls/extrusioncontrols.cxx +++ b/svx/source/tbxctrls/extrusioncontrols.cxx @@ -47,7 +47,7 @@ constexpr OUStringLiteral g_sExtrusionDirection = u".uno:ExtrusionDirection"; constexpr OUStringLiteral g_sExtrusionProjection = u".uno:ExtrusionProjection"; constexpr OUStringLiteral EMPTY = u""; -constexpr rtl::OUStringConstExpr aLightOffBmps[] = +constexpr OUString aLightOffBmps[] = { RID_SVXBMP_LIGHT_OFF_FROM_TOP_LEFT, RID_SVXBMP_LIGHT_OFF_FROM_TOP, @@ -60,7 +60,7 @@ constexpr rtl::OUStringConstExpr aLightOffBmps[] = RID_SVXBMP_LIGHT_OFF_FROM_BOTTOM_RIGHT }; -constexpr rtl::OUStringConstExpr aLightOnBmps[] = +constexpr OUString aLightOnBmps[] = { RID_SVXBMP_LIGHT_ON_FROM_TOP_LEFT, RID_SVXBMP_LIGHT_ON_FROM_TOP, @@ -73,7 +73,7 @@ constexpr rtl::OUStringConstExpr aLightOnBmps[] = RID_SVXBMP_LIGHT_ON_FROM_BOTTOM_RIGHT }; -constexpr rtl::OUStringConstExpr aLightPreviewBmps[] = +constexpr OUString aLightPreviewBmps[] = { RID_SVXBMP_LIGHT_PREVIEW_FROM_TOP_LEFT, RID_SVXBMP_LIGHT_PREVIEW_FROM_TOP, @@ -86,7 +86,7 @@ constexpr rtl::OUStringConstExpr aLightPreviewBmps[] = RID_SVXBMP_LIGHT_PREVIEW_FROM_BOTTOM_RIGHT }; -constexpr rtl::OUStringConstExpr aDirectionBmps[] = +constexpr OUString aDirectionBmps[] = { RID_SVXBMP_DIRECTION_DIRECTION_NW, RID_SVXBMP_DIRECTION_DIRECTION_N, @@ -126,7 +126,7 @@ ExtrusionDirectionWindow::ExtrusionDirectionWindow( for (sal_uInt16 i = DIRECTION_NW; i <= DIRECTION_SE; ++i) { - maImgDirection[i] = Image(StockImage::Yes, OUString(aDirectionBmps[i])); + maImgDirection[i] = Image(StockImage::Yes, aDirectionBmps[i]); } mxDirectionSet->SetSelectHdl( LINK( this, ExtrusionDirectionWindow, SelectValueSetHdl ) ); @@ -604,10 +604,10 @@ ExtrusionLightingWindow::ExtrusionLightingWindow(svt::PopupWindowController* pCo { if( i != FROM_FRONT ) { - maImgLightingOff[i] = Image(StockImage::Yes, OUString(aLightOffBmps[i])); - maImgLightingOn[i] = Image(StockImage::Yes, OUString(aLightOnBmps[i])); + maImgLightingOff[i] = Image(StockImage::Yes, aLightOffBmps[i]); + maImgLightingOn[i] = Image(StockImage::Yes, aLightOnBmps[i]); } - maImgLightingPreview[i] = Image(StockImage::Yes, OUString(aLightPreviewBmps[i])); + maImgLightingPreview[i] = Image(StockImage::Yes, aLightPreviewBmps[i]); } mxLightingSet->SetHelpId( HID_VALUESET_EXTRUSION_LIGHTING ); diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index cd2533538466..4a1cd448900e 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -156,7 +156,7 @@ namespace { struct CommandToRID { const char* pCommand; - rtl::OUStringConstExpr sResId; + OUString sResId; }; } @@ -164,7 +164,7 @@ struct CommandToRID static OUString ImplGetRID( std::u16string_view aCommand ) { static constexpr OUStringLiteral EMPTY = u""; - static const CommandToRID aImplCommandToResMap[] = + static constexpr CommandToRID aImplCommandToResMap[] = { { ".uno:GrafRed", RID_SVXBMP_GRAF_RED }, { ".uno:GrafGreen", RID_SVXBMP_GRAF_GREEN }, diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index d43b8241cc66..13bd99fa4561 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -1006,7 +1006,7 @@ bool SvxFieldUnitToMeasureUnit( const FieldUnit eVcl, short& eApi ) noexcept return true; } -constexpr rtl::OUStringConstExpr RID_SVXSTR_BMP_DEF[] = +constexpr OUString RID_SVXSTR_BMP_DEF[] = { RID_SVXSTR_BMP0_DEF, RID_SVXSTR_BMP1_DEF, @@ -1200,7 +1200,7 @@ const TranslateId RID_SVXSTR_BMP[] = RID_SVXSTR_BMP92 }; -constexpr rtl::OUStringConstExpr RID_SVXSTR_DASH_DEF[] = +constexpr OUString RID_SVXSTR_DASH_DEF[] = { RID_SVXSTR_DASH0_DEF, RID_SVXSTR_DASH1_DEF, @@ -1271,7 +1271,7 @@ const TranslateId RID_SVXSTR_DASH[] = RID_SVXSTR_DASH30 }; -constexpr rtl::OUStringConstExpr RID_SVXSTR_LEND_DEF[] = +constexpr OUString RID_SVXSTR_LEND_DEF[] = { RID_SVXSTR_LEND0_DEF, RID_SVXSTR_LEND1_DEF, @@ -1343,7 +1343,7 @@ const TranslateId RID_SVXSTR_LEND[] = RID_SVXSTR_LEND31 }; -constexpr rtl::OUStringConstExpr RID_SVXSTR_GRDT_DEF[] = +constexpr OUString RID_SVXSTR_GRDT_DEF[] = { RID_SVXSTR_GRDT0_DEF, RID_SVXSTR_GRDT1_DEF, @@ -1521,7 +1521,7 @@ const TranslateId RID_SVXSTR_GRDT[] = RID_SVXSTR_GRDT84 }; -constexpr rtl::OUStringConstExpr RID_SVXSTR_HATCHS_DEF[] = +constexpr OUString RID_SVXSTR_HATCHS_DEF[] = { RID_SVXSTR_HATCH0_DEF, RID_SVXSTR_HATCH1_DEF, @@ -1561,7 +1561,7 @@ const TranslateId RID_SVXSTR_HATCHS[] = RID_SVXSTR_HATCH15 }; -constexpr rtl::OUStringConstExpr RID_SVXSTR_TRASNGR_DEF[] = +constexpr OUString RID_SVXSTR_TRASNGR_DEF[] = { RID_SVXSTR_TRASNGR0_DEF }; @@ -1571,7 +1571,7 @@ const TranslateId RID_SVXSTR_TRASNGR[] = RID_SVXSTR_TRASNGR0 }; -static bool SvxUnoGetResourceRanges( const sal_uInt16 nWhich, const rtl::OUStringConstExpr*& pApiResIds, const TranslateId*& pIntResIds, int& nCount ) noexcept +static bool SvxUnoGetResourceRanges( const sal_uInt16 nWhich, const OUString*& pApiResIds, const TranslateId*& pIntResIds, int& nCount ) noexcept { switch( nWhich ) { @@ -1618,7 +1618,7 @@ static bool SvxUnoGetResourceRanges( const sal_uInt16 nWhich, const rtl::OUStrin } /// @throws std::exception -static bool SvxUnoConvertResourceStringToApi(const TranslateId* pSourceResIds, const rtl::OUStringConstExpr* pDestResIds, int nCount, OUString& rString) +static bool SvxUnoConvertResourceStringToApi(const TranslateId* pSourceResIds, const OUString* pDestResIds, int nCount, OUString& rString) { // first, calculate the search string length without an optional number after the name sal_Int32 nLength = rString.getLength(); @@ -1651,7 +1651,7 @@ static bool SvxUnoConvertResourceStringToApi(const TranslateId* pSourceResIds, c const OUString & aCompare = SvxResId(pSourceResIds[i]); if( aShortString == aCompare ) { - rString = rString.replaceAt( 0, aShortString.size(), OUString(pDestResIds[i]) ); + rString = rString.replaceAt( 0, aShortString.size(), pDestResIds[i] ); return true; } else if( rString == aCompare ) @@ -1664,7 +1664,7 @@ static bool SvxUnoConvertResourceStringToApi(const TranslateId* pSourceResIds, c return false; } -static bool SvxUnoConvertResourceStringFromApi(const rtl::OUStringConstExpr* pSourceResIds, const TranslateId* pDestResIds, int nCount, OUString& rString) +static bool SvxUnoConvertResourceStringFromApi(const OUString* pSourceResIds, const TranslateId* pDestResIds, int nCount, OUString& rString) { // first, calculate the search string length without an optional number after the name sal_Int32 nLength = rString.getLength(); @@ -1694,8 +1694,8 @@ static bool SvxUnoConvertResourceStringFromApi(const rtl::OUStringConstExpr* pSo for (int i = 0; i < nCount; ++i) { - auto pCompare = pSourceResIds[i]; - if( aShortString == pCompare.asView() ) + auto const & pCompare = pSourceResIds[i]; + if( aShortString == pCompare ) { rString = rString.replaceAt( 0, aShortString.size(), SvxResId(pDestResIds[i]) ); return true; @@ -1721,7 +1721,7 @@ static bool SvxUnoConvertResourceStringFromApi(const rtl::OUStringConstExpr* pSo // the possibility to define it wrong // - change the compare to also work when a shorter name is in front of a longer one -constexpr rtl::OUStringConstExpr SvxUnoColorNameDefResId[] = +constexpr OUString SvxUnoColorNameDefResId[] = { RID_SVXSTR_COLOR_BLUEGREY_DEF, RID_SVXSTR_COLOR_BLACK_DEF, @@ -1930,7 +1930,7 @@ const TranslateId SvxUnoColorNameResId[] = }; /// @throws std::exception -static bool SvxUnoConvertResourceStringBuiltInToApi(const TranslateId* pSourceResIds, rtl::OUStringConstExpr const *pDestResIds, int nCount, OUString& rString) +static bool SvxUnoConvertResourceStringBuiltInToApi(const TranslateId* pSourceResIds, OUString const *pDestResIds, int nCount, OUString& rString) { //We replace e.g. "Gray 10%" with the translation of Gray, but we shouldn't //replace "Red Hat 1" with the translation of Red :-) @@ -1949,7 +1949,7 @@ static bool SvxUnoConvertResourceStringBuiltInToApi(const TranslateId* pSourceRe OUString aStrDefName = SvxResId(pSourceResIds[i]); if( sStr == aStrDefName ) { - OUString aReplace = pDestResIds[i]; + OUString const & aReplace = pDestResIds[i]; rString = rString.replaceAt( 0, aStrDefName.getLength(), aReplace ); return true; } @@ -1958,7 +1958,7 @@ static bool SvxUnoConvertResourceStringBuiltInToApi(const TranslateId* pSourceRe return false; } -static bool SvxUnoConvertResourceStringBuiltInFromApi(rtl::OUStringConstExpr const *pSourceResIds, const TranslateId* pDestResIds, int nCount, OUString& rString) +static bool SvxUnoConvertResourceStringBuiltInFromApi(OUString const *pSourceResIds, const TranslateId* pDestResIds, int nCount, OUString& rString) { //We replace e.g. "Gray 10%" with the translation of Gray, but we shouldn't //replace "Red Hat 1" with the translation of Red :-) @@ -1974,10 +1974,10 @@ static bool SvxUnoConvertResourceStringBuiltInFromApi(rtl::OUStringConstExpr con for(int i = 0; i < nCount; ++i ) { - if( sStr == pSourceResIds[i].asView() ) + if( sStr == pSourceResIds[i] ) { OUString aReplace = SvxResId(pDestResIds[i]); - rString = aReplace + rString.subView( pSourceResIds[i].asView().size() ); + rString = aReplace + rString.subView( pSourceResIds[i].getLength() ); return true; } } @@ -2001,7 +2001,7 @@ OUString SvxUnogetApiNameForItem(const sal_uInt16 nWhich, const OUString& rInter } else { - const rtl::OUStringConstExpr* pApiResIds; + const OUString* pApiResIds; const TranslateId* pIntResIds; int nCount; @@ -2034,7 +2034,7 @@ OUString SvxUnogetInternalNameForItem(const sal_uInt16 nWhich, const OUString& r } else { - const rtl::OUStringConstExpr* pApiResIds; + const OUString* pApiResIds; const TranslateId* pIntResIds; int nCount; diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index be1315e59de0..9a9b288e142f 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -185,7 +185,7 @@ static sal_uInt16 aNavigationInsertIds[ NAVI_ENTRIES ] = NID_FIELD_BYTYPE }; -rtl::OUStringConstExpr constexpr aNavigationImgIds[ NAVI_ENTRIES ] = +OUString constexpr aNavigationImgIds[ NAVI_ENTRIES ] = { RID_BMP_RIBBAR_TBL, RID_BMP_RIBBAR_FRM, @@ -604,7 +604,7 @@ NavElementBox_Base::NavElementBox_Base(std::unique_ptr<weld::ComboBox> xComboBox m_xComboBox->freeze(); for (sal_uInt16 i = 0; i < NID_COUNT; i++) m_xComboBox->append(OUString::number(aNavigationInsertIds[i]), - SwResId(aNavigationStrIds[i]), OUString(aNavigationImgIds[i])); + SwResId(aNavigationStrIds[i]), aNavigationImgIds[i]); m_xComboBox->thaw(); m_xComboBox->connect_changed(LINK(this, NavElementBox_Base, SelectHdl)); diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index ca5a014ecc56..897d1c47ebd1 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -292,7 +292,7 @@ int INetURLObject::SubString::compare(SubString const & rOther, struct INetURLObject::SchemeInfo { - rtl::OUStringConstExpr m_sScheme; + OUString m_sScheme; char const * m_pPrefix; bool m_bAuthority; bool m_bUser; @@ -347,7 +347,7 @@ INetURLObject::getSchemeInfo(INetProtocol eTheScheme) static constexpr OUStringLiteral SFTP = u"sftp"; static constexpr OUStringLiteral VND_CMIS = u"vnd.libreoffice.cmis"; - static o3tl::enumarray<INetProtocol, SchemeInfo> const map = { + static o3tl::enumarray<INetProtocol, SchemeInfo> constexpr map = { // [-loplugin:redundantfcast]: SchemeInfo{ EMPTY, "", false, false, false, false, false, false, false, false}, @@ -916,7 +916,7 @@ bool INetURLObject::setAbsURIRef(std::u16string_view rTheAbsURIRef, } if (m_eScheme != INetProtocol::Generic) { - aSynScheme = static_cast<const OUString&>(getSchemeInfo().m_sScheme); + aSynScheme = getSchemeInfo().m_sScheme; } m_aScheme.set(m_aAbsURIRef, aSynScheme, m_aAbsURIRef.getLength()); m_aAbsURIRef.append(':'); @@ -1669,7 +1669,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef, // is empty ("") in that case, so take the scheme from m_aAbsURIRef if (m_eScheme != INetProtocol::Generic) { - aSynAbsURIRef.append(getSchemeInfo().m_sScheme.asView()); + aSynAbsURIRef.append(getSchemeInfo().m_sScheme); } else { @@ -3546,7 +3546,7 @@ INetURLObject::getAbbreviated( // is empty ("") in that case, so take the scheme from m_aAbsURIRef if (m_eScheme != INetProtocol::Generic) { - aBuffer.append(getSchemeInfo().m_sScheme.asView()); + aBuffer.append(getSchemeInfo().m_sScheme); } else { @@ -3775,7 +3775,7 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme, if (HasError() || m_eScheme == INetProtocol::Generic) return false; m_aAbsURIRef.setLength(0); - m_aAbsURIRef.append(getSchemeInfo().m_sScheme.asView()); + m_aAbsURIRef.append(getSchemeInfo().m_sScheme); m_aAbsURIRef.append(':'); if (getSchemeInfo().m_bAuthority) { diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 7b7e946c4e47..d634bddb1eab 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -193,7 +193,7 @@ typedef std::vector< unsigned long > NetWmIconData; namespace { - constexpr rtl::OUStringConstExpr SV_ICON_SIZE48[] = + constexpr OUString SV_ICON_SIZE48[] = { MAINAPP_48_8, MAINAPP_48_8, @@ -211,7 +211,7 @@ namespace ODF_48_8 }; - constexpr rtl::OUStringConstExpr SV_ICON_SIZE32[] = + constexpr OUString SV_ICON_SIZE32[] = { MAINAPP_32_8, MAINAPP_32_8, @@ -229,7 +229,7 @@ namespace ODF_32_8 }; - constexpr rtl::OUStringConstExpr SV_ICON_SIZE16[] = + constexpr OUString SV_ICON_SIZE16[] = { MAINAPP_16_8, MAINAPP_16_8, diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index d474adcdad5c..1217a7b7f8a2 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -505,7 +505,7 @@ namespace xmloff CCAFlags::Label, CCAFlags::Title }; // the names of all properties which are expected to be of type string - static const rtl::OUStringConstExpr aStringPropertyNames[] = + static constexpr OUString aStringPropertyNames[] = { PROPERTY_LABEL, PROPERTY_TITLE }; @@ -534,7 +534,7 @@ namespace xmloff { // attribute flags CCAFlags::CurrentSelected, CCAFlags::Disabled, CCAFlags::Dropdown, CCAFlags::Printable, CCAFlags::ReadOnly, CCAFlags::Selected, CCAFlags::TabStop, CCAFlags::EnableVisible }; - static const rtl::OUStringConstExpr pBooleanPropertyNames[] = + static constexpr OUString pBooleanPropertyNames[] = { // property names PROPERTY_STATE, PROPERTY_ENABLED, PROPERTY_DROPDOWN, PROPERTY_PRINTABLE, @@ -574,7 +574,7 @@ namespace xmloff { // attribute flags CCAFlags::Size, CCAFlags::TabIndex }; - static const rtl::OUStringConstExpr pIntegerPropertyNames[] = + static constexpr OUString pIntegerPropertyNames[] = { // property names PROPERTY_LINECOUNT, PROPERTY_TABINDEX }; @@ -934,7 +934,7 @@ namespace xmloff SCAFlags::Validation, SCAFlags::MultiLine, SCAFlags::AutoCompletion, SCAFlags::Multiple, SCAFlags::DefaultButton, SCAFlags::IsTristate, SCAFlags::Toggle, SCAFlags::FocusOnClick }; - static const rtl::OUStringConstExpr pBooleanPropertyNames[] = + static constexpr OUString pBooleanPropertyNames[] = { // property names PROPERTY_STRICTFORMAT, PROPERTY_MULTILINE, PROPERTY_AUTOCOMPLETE, @@ -973,7 +973,7 @@ namespace xmloff { // attribute flags SCAFlags::PageStepSize }; - static const rtl::OUStringConstExpr pIntegerPropertyNames[] = + static constexpr OUString pIntegerPropertyNames[] = { // property names PROPERTY_BLOCK_INCREMENT }; @@ -1124,7 +1124,7 @@ namespace xmloff { // attribute flags SCAFlags::GroupName }; - static const rtl::OUStringConstExpr pStringPropertyNames[] = + static constexpr OUString pStringPropertyNames[] = { // property names PROPERTY_GROUP_NAME }; @@ -1141,7 +1141,7 @@ namespace xmloff exportStringPropertyAttribute( OAttributeMetaData::getSpecialAttributeNamespace( nStringPropertyAttributeIds[i] ), OAttributeMetaData::getSpecialAttributeName( nStringPropertyAttributeIds[i] ), - OUString(pStringPropertyNames[i]) + pStringPropertyNames[i] ); #if OSL_DEBUG_LEVEL > 0 // reset the bit for later checking @@ -2046,7 +2046,7 @@ namespace xmloff { faName, /*faAction,*/ faCommand, faFilter, faOrder }; - static const rtl::OUStringConstExpr aStringPropertyNames[] = + static constexpr OUString aStringPropertyNames[] = { PROPERTY_NAME, /*PROPERTY_TARGETURL,*/ PROPERTY_COMMAND, PROPERTY_FILTER, PROPERTY_ORDER }; @@ -2090,7 +2090,7 @@ namespace xmloff { faAllowDeletes, faAllowInserts, faAllowUpdates, faApplyFilter, faEscapeProcessing, faIgnoreResult }; - static const rtl::OUStringConstExpr pBooleanPropertyNames[] = + static constexpr OUString pBooleanPropertyNames[] = { PROPERTY_ALLOWDELETES, PROPERTY_ALLOWINSERTS, |