diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-02 13:10:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-03 14:03:57 +0200 |
commit | 23d5c8ed000adc4d66f24ddd67b73a8e5c8a0511 (patch) | |
tree | a55cf8a7d9d6736b22372914b3914165abb65c5f | |
parent | 0f410680461d7ba5f70dd65b2a8263dec15ac357 (diff) |
replace createFromAscii with OUString literals in framework
Change-Id: I925d79877d477e6273e0ca8d8de7af391d72bb78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167038
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | framework/source/uielement/controlmenucontroller.cxx | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx index abb4a5762eb5..a4d69afee1fb 100644 --- a/framework/source/uielement/controlmenucontroller.cxx +++ b/framework/source/uielement/controlmenucontroller.cxx @@ -39,28 +39,28 @@ #include <bitmaps.hlst> #include <strings.hrc> -static const char* aCommands[] = +constexpr OUString aCommands[] { - ".uno:ConvertToEdit", - ".uno:ConvertToButton", - ".uno:ConvertToFixed", - ".uno:ConvertToList", - ".uno:ConvertToCheckBox", - ".uno:ConvertToRadio", - ".uno:ConvertToGroup", - ".uno:ConvertToCombo", - ".uno:ConvertToImageBtn", - ".uno:ConvertToFileControl", - ".uno:ConvertToDate", - ".uno:ConvertToTime", - ".uno:ConvertToNumeric", - ".uno:ConvertToCurrency", - ".uno:ConvertToPattern", - ".uno:ConvertToImageControl", - ".uno:ConvertToFormatted", - ".uno:ConvertToScrollBar", - ".uno:ConvertToSpinButton", - ".uno:ConvertToNavigationBar" + u".uno:ConvertToEdit"_ustr, + u".uno:ConvertToButton"_ustr, + u".uno:ConvertToFixed"_ustr, + u".uno:ConvertToList"_ustr, + u".uno:ConvertToCheckBox"_ustr, + u".uno:ConvertToRadio"_ustr, + u".uno:ConvertToGroup"_ustr, + u".uno:ConvertToCombo"_ustr, + u".uno:ConvertToImageBtn"_ustr, + u".uno:ConvertToFileControl"_ustr, + u".uno:ConvertToDate"_ustr, + u".uno:ConvertToTime"_ustr, + u".uno:ConvertToNumeric"_ustr, + u".uno:ConvertToCurrency"_ustr, + u".uno:ConvertToPattern"_ustr, + u".uno:ConvertToImageControl"_ustr, + u".uno:ConvertToFormatted"_ustr, + u".uno:ConvertToScrollBar"_ustr, + u".uno:ConvertToSpinButton"_ustr, + u".uno:ConvertToNavigationBar"_ustr }; static TranslateId aLabels[] = @@ -209,7 +209,7 @@ void ControlMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > con for (size_t i=0; i < SAL_N_ELEMENTS(aCommands); ++i) { sal_Int16 nItemId = i + 1; - OUString sCommand(OUString::createFromAscii(aCommands[i])); + OUString sCommand(aCommands[i]); rPopupMenu->insertItem(nItemId, FwkResId(aLabels[i]), 0, i); rPopupMenu->setCommand(nItemId, sCommand); rPopupMenu->enableItem(nItemId, false); @@ -247,7 +247,7 @@ void SAL_CALL ControlMenuController::statusChanged( const FeatureStateEvent& Eve sal_Int16 nItemId = 0; for (size_t i=0; i < SAL_N_ELEMENTS(aCommands); ++i) { - if ( Event.FeatureURL.Complete.equalsAscii( aCommands[i] )) + if ( Event.FeatureURL.Complete == aCommands[i] ) { nItemId = i + 1; break; @@ -293,9 +293,9 @@ void SAL_CALL ControlMenuController::updatePopupMenu() fillPopupMenu( m_xPopupMenu ); m_aURLToDispatchMap.free(); - for (const char* aCommand : aCommands) + for (const OUString& aCommand : aCommands) { - aTargetURL.Complete = OUString::createFromAscii( aCommand ); + aTargetURL.Complete = aCommand; m_xURLTransformer->parseStrict( aTargetURL ); Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 ); |