diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-12 12:43:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-13 08:38:53 +0200 |
commit | fdfd517a6f75e394ddcb1e195decbfed33ba56b9 (patch) | |
tree | e3bff14e5531affcd908415b4e85d7ceac4aa1fd /framework | |
parent | e568c9dca8b93b96a8a130a8fb6f1bba1a33d6ea (diff) |
loplugin:stringviewparam whitelist some more functions
for which we have o3tl:: equivalents
Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
19 files changed, 73 insertions, 66 deletions
diff --git a/framework/inc/dispatch/closedispatcher.hxx b/framework/inc/dispatch/closedispatcher.hxx index 8ee08ed194f3..1ceb256498f9 100644 --- a/framework/inc/dispatch/closedispatcher.hxx +++ b/framework/inc/dispatch/closedispatcher.hxx @@ -117,7 +117,7 @@ class CloseDispatcher final : public ::cppu::WeakImplHelper< */ CloseDispatcher(const css::uno::Reference< css::uno::XComponentContext >& rxContext , const css::uno::Reference< css::frame::XFrame >& xFrame , - const OUString& sTarget); + std::u16string_view sTarget); /** @short does nothing real. */ virtual ~CloseDispatcher() override; @@ -252,7 +252,7 @@ class CloseDispatcher final : public ::cppu::WeakImplHelper< */ static css::uno::Reference< css::frame::XFrame > static_impl_searchRightTargetFrame(const css::uno::Reference< css::frame::XFrame >& xFrame , - const OUString& sTarget); + std::u16string_view sTarget); }; // class CloseDispatcher diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx index 189be410bfc9..28f78d5bdc0f 100644 --- a/framework/inc/services/layoutmanager.hxx +++ b/framework/inc/services/layoutmanager.hxx @@ -175,7 +175,7 @@ namespace framework // query - css::uno::Reference< css::ui::XUIElement > implts_findElement( const OUString& aName ); + css::uno::Reference< css::ui::XUIElement > implts_findElement( std::u16string_view aName ); bool implts_readWindowStateData( const OUString& rName, UIElement& rElementData ); void implts_writeWindowStateData( const OUString& rName, const UIElement& rElementData ); diff --git a/framework/inc/uielement/menubarmerger.hxx b/framework/inc/uielement/menubarmerger.hxx index 3e2d4addd408..16bb8ec67610 100644 --- a/framework/inc/uielement/menubarmerger.hxx +++ b/framework/inc/uielement/menubarmerger.hxx @@ -62,7 +62,7 @@ namespace MenuBarMerger bool IsCorrectContext( std::u16string_view aContext, std::u16string_view aModuleIdentifier ); - void RetrieveReferencePath( const OUString&, + void RetrieveReferencePath( std::u16string_view, std::vector< OUString >& aReferencePath ); ReferencePathInfo FindReferencePath( const std::vector< OUString >& aReferencePath, Menu* pMenu ); sal_uInt16 FindMenuItem( std::u16string_view rCmd, @@ -75,7 +75,7 @@ namespace MenuBarMerger sal_uInt16 nPos, sal_uInt16& rItemId, std::u16string_view rMergeCommand, - const OUString& rMergeCommandParameter, + std::u16string_view rMergeCommandParameter, const OUString& rModuleIdentifier, const AddonMenuContainer& rAddonMenuItems ); bool ProcessFallbackOperation( const ReferencePathInfo& aRefPathInfo, @@ -98,7 +98,7 @@ namespace MenuBarMerger const AddonMenuContainer& rAddonMenuItems ); bool RemoveMenuItems( Menu* pMenu, sal_uInt16 nPos, - const OUString& rMergeCommandParameter ); + std::u16string_view rMergeCommandParameter ); bool CreateSubMenu( Menu* pSubMenu, sal_uInt16& nItemId, const OUString& rModuleIdentifier, diff --git a/framework/inc/uielement/statusbarmerger.hxx b/framework/inc/uielement/statusbarmerger.hxx index 350bae4bf2f8..1eaec5a88f81 100644 --- a/framework/inc/uielement/statusbarmerger.hxx +++ b/framework/inc/uielement/statusbarmerger.hxx @@ -60,7 +60,7 @@ namespace StatusbarMerger sal_uInt16 nPos, sal_uInt16& rItemId, std::u16string_view rMergeCommand, - const OUString& rMergeCommandParameter, + std::u16string_view rMergeCommandParameter, const AddonStatusbarItemContainer& rItems ); bool ProcessMergeFallback( StatusBar* pStatusbar, diff --git a/framework/inc/uielement/toolbarmerger.hxx b/framework/inc/uielement/toolbarmerger.hxx index 157e02170340..837507baa386 100644 --- a/framework/inc/uielement/toolbarmerger.hxx +++ b/framework/inc/uielement/toolbarmerger.hxx @@ -84,7 +84,7 @@ class ToolBarMerger CommandToInfoMap& rCommandMap, std::u16string_view rModuleIdentifier, std::u16string_view rMergeCommand, - const OUString& rMergeCommandParameter, + std::u16string_view rMergeCommandParameter, const AddonToolbarItemContainer& rItems ); static bool ProcessMergeFallback( ToolBox* pToolbar, @@ -112,7 +112,7 @@ class ToolBarMerger static void RemoveItems( ToolBox* pToolbar, ToolBox::ImplToolItems::size_type nPos, - const OUString& rMergeCommandParameter ); + std::u16string_view rMergeCommandParameter ); static rtl::Reference<::cppu::OWeakObject> CreateController( const css::uno::Reference< css::uno::XComponentContext > & rxContext, diff --git a/framework/source/accelerators/keymapping.cxx b/framework/source/accelerators/keymapping.cxx index 1a5648c8d43a..a0d33e7b4e23 100644 --- a/framework/source/accelerators/keymapping.cxx +++ b/framework/source/accelerators/keymapping.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/awt/Key.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <o3tl/string_view.hxx> namespace framework { @@ -186,10 +187,10 @@ OUString KeyMapping::mapCodeToIdentifier(sal_uInt16 nCode) return OUString::number(nCode); } -bool KeyMapping::impl_st_interpretIdentifierAsPureKeyCode(const OUString& sIdentifier, +bool KeyMapping::impl_st_interpretIdentifierAsPureKeyCode(std::u16string_view sIdentifier, sal_uInt16& rCode ) { - sal_Int32 nCode = sIdentifier.toInt32(); + sal_Int32 nCode = o3tl::toInt32(sIdentifier); if (nCode > 0) { rCode = static_cast<sal_uInt16>(nCode); @@ -199,7 +200,7 @@ bool KeyMapping::impl_st_interpretIdentifierAsPureKeyCode(const OUString& sIdent // 0 is normally an error of the called method toInt32() ... // But we must be aware, that the identifier is "0"! rCode = 0; - return sIdentifier == "0"; + return sIdentifier == u"0"; } } // namespace framework diff --git a/framework/source/accelerators/storageholder.cxx b/framework/source/accelerators/storageholder.cxx index e870ec0b71b8..c0a6106d7202 100644 --- a/framework/source/accelerators/storageholder.cxx +++ b/framework/source/accelerators/storageholder.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/embed/XTransactedObject.hpp> #include <rtl/ustrbuf.hxx> +#include <o3tl/string_view.hxx> #include <algorithm> @@ -427,13 +428,13 @@ OUString StorageHolder::impl_st_normPath(const OUString& sPath) return sNormedPath; } -std::vector<OUString> StorageHolder::impl_st_parsePath(const OUString& sPath) +std::vector<OUString> StorageHolder::impl_st_parsePath(std::u16string_view sPath) { std::vector<OUString> lToken; sal_Int32 i = 0; while (true) { - OUString sToken = sPath.getToken(0, PATH_SEPARATOR_UNICODE, i); + OUString sToken( o3tl::getToken(sPath, 0, PATH_SEPARATOR_UNICODE, i) ); if (i < 0) break; lToken.push_back(sToken); diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx index 6b2a13cb4eb7..d36a14c6461a 100644 --- a/framework/source/dispatch/closedispatcher.cxx +++ b/framework/source/dispatch/closedispatcher.cxx @@ -40,6 +40,7 @@ #include <vcl/svapp.hxx> #include <vcl/syswin.hxx> #include <unotools/moduleoptions.hxx> +#include <o3tl/string_view.hxx> using namespace com::sun::star; @@ -56,7 +57,7 @@ const char URL_CLOSEFRAME[] = ".uno:CloseFrame"; CloseDispatcher::CloseDispatcher(const css::uno::Reference< css::uno::XComponentContext >& rxContext , const css::uno::Reference< css::frame::XFrame >& xFrame , - const OUString& sTarget) + std::u16string_view sTarget) : m_xContext (rxContext ) , m_aAsyncCallback( new vcl::EventPoster(LINK(this, CloseDispatcher, impl_asyncCallback))) @@ -558,12 +559,12 @@ void CloseDispatcher::implts_notifyResultListener(const css::uno::Reference< css } css::uno::Reference< css::frame::XFrame > CloseDispatcher::static_impl_searchRightTargetFrame(const css::uno::Reference< css::frame::XFrame >& xFrame , - const OUString& sTarget) + std::u16string_view sTarget) { - if (sTarget.equalsIgnoreAsciiCase("_self")) + if (o3tl::equalsIgnoreAsciiCase(sTarget, u"_self")) return xFrame; - OSL_ENSURE(sTarget.isEmpty(), "CloseDispatch used for unexpected target. Magic things will happen now .-)"); + OSL_ENSURE(sTarget.empty(), "CloseDispatch used for unexpected target. Magic things will happen now .-)"); css::uno::Reference< css::frame::XFrame > xTarget = xFrame; while(true) diff --git a/framework/source/dispatch/dispatchinformationprovider.cxx b/framework/source/dispatch/dispatchinformationprovider.cxx index 0f4b488a19a9..8c9cd6d7c0d9 100644 --- a/framework/source/dispatch/dispatchinformationprovider.cxx +++ b/framework/source/dispatch/dispatchinformationprovider.cxx @@ -113,7 +113,7 @@ css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvide if (!xFrame.is()) return css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > >(); - rtl::Reference<CloseDispatcher> xCloser = new CloseDispatcher(m_xContext, xFrame, "_self"); // explicit "_self" ... not "" ... see implementation of close dispatcher itself! + rtl::Reference<CloseDispatcher> xCloser = new CloseDispatcher(m_xContext, xFrame, u"_self"); // explicit "_self" ... not "" ... see implementation of close dispatcher itself! css::uno::Reference< css::frame::XDispatchInformationProvider > xController (xFrame->getController() , css::uno::UNO_QUERY); css::uno::Reference< css::frame::XDispatchInformationProvider > xAppDispatcher = css::frame::AppDispatchProvider::create(m_xContext); diff --git a/framework/source/fwe/classes/sfxhelperfunctions.cxx b/framework/source/fwe/classes/sfxhelperfunctions.cxx index 06f48f1fe695..170f3e7156bb 100644 --- a/framework/source/fwe/classes/sfxhelperfunctions.cxx +++ b/framework/source/fwe/classes/sfxhelperfunctions.cxx @@ -132,7 +132,7 @@ pfunc_createDockingWindow SetDockingWindowCreator( pfunc_createDockingWindow pNe return pOldFunc; } -void CreateDockingWindow( const css::uno::Reference< css::frame::XFrame >& rFrame, const OUString& rResourceURL ) +void CreateDockingWindow( const css::uno::Reference< css::frame::XFrame >& rFrame, std::u16string_view rResourceURL ) { pfunc_createDockingWindow pFactory = nullptr; { @@ -153,7 +153,7 @@ pfunc_isDockingWindowVisible SetIsDockingWindowVisible( pfunc_isDockingWindowVis return pOldFunc; } -bool IsDockingWindowVisible( const css::uno::Reference< css::frame::XFrame >& rFrame, const OUString& rResourceURL ) +bool IsDockingWindowVisible( const css::uno::Reference< css::frame::XFrame >& rFrame, std::u16string_view rResourceURL ) { pfunc_isDockingWindowVisible pCall = nullptr; { diff --git a/framework/source/inc/accelerators/keymapping.hxx b/framework/source/inc/accelerators/keymapping.hxx index 75715efc7e3a..88429a0122f1 100644 --- a/framework/source/inc/accelerators/keymapping.hxx +++ b/framework/source/inc/accelerators/keymapping.hxx @@ -117,7 +117,7 @@ class KeyMapping @return [boolean] sal_True if conversion was successful. */ - bool impl_st_interpretIdentifierAsPureKeyCode(const OUString& sIdentifier, + bool impl_st_interpretIdentifierAsPureKeyCode(std::u16string_view sIdentifier, sal_uInt16& rCode ); }; diff --git a/framework/source/inc/accelerators/storageholder.hxx b/framework/source/inc/accelerators/storageholder.hxx index d2e17ee1a550..355bedeaa662 100644 --- a/framework/source/inc/accelerators/storageholder.hxx +++ b/framework/source/inc/accelerators/storageholder.hxx @@ -174,7 +174,7 @@ class StorageHolder final /** @short TODO */ - static std::vector<OUString> impl_st_parsePath(const OUString& sPath); + static std::vector<OUString> impl_st_parsePath(std::u16string_view sPath); }; } // namespace framework diff --git a/framework/source/layoutmanager/helpers.cxx b/framework/source/layoutmanager/helpers.cxx index d3b58351d95c..7508d58cbd44 100644 --- a/framework/source/layoutmanager/helpers.cxx +++ b/framework/source/layoutmanager/helpers.cxx @@ -32,6 +32,7 @@ #include <comphelper/propertyvalue.hxx> #include <unotools/mediadescriptor.hxx> #include <vcl/svapp.hxx> +#include <o3tl/string_view.hxx> #include <toolkit/helper/vclunohelper.hxx> using namespace com::sun::star; @@ -185,26 +186,24 @@ WindowAlign ImplConvertAlignment( ui::DockingArea aAlignment ) return WindowAlign::Bottom; } -OUString getElementTypeFromResourceURL( const OUString& aResourceURL ) +std::u16string_view getElementTypeFromResourceURL( std::u16string_view aResourceURL ) { - OUString aUIResourceURL( UIRESOURCE_URL ); - if ( aResourceURL.startsWith( aUIResourceURL ) ) + if ( o3tl::starts_with(aResourceURL, UIRESOURCE_URL ) ) { - sal_Int32 nIndex{ aUIResourceURL.getLength() }; - return aResourceURL.getToken( 1, '/', nIndex ); + sal_Int32 nIndex{ UIRESOURCE_URL.getLength() }; + return o3tl::getToken(aResourceURL, 1, '/', nIndex ); } - return OUString(); + return std::u16string_view(); } -void parseResourceURL( const OUString& aResourceURL, OUString& aElementType, OUString& aElementName ) +void parseResourceURL( std::u16string_view aResourceURL, OUString& aElementType, OUString& aElementName ) { - OUString aUIResourceURL( UIRESOURCE_URL ); - if ( aResourceURL.startsWith( aUIResourceURL ) ) + if ( o3tl::starts_with(aResourceURL, UIRESOURCE_URL) ) { - sal_Int32 nIndex{ aUIResourceURL.getLength() }; - aElementType = aResourceURL.getToken( 1, '/', nIndex ); - aElementName = aResourceURL.getToken( 0, '/', nIndex ); + sal_Int32 nIndex{ UIRESOURCE_URL.getLength() }; + aElementType = o3tl::getToken(aResourceURL, 1, '/', nIndex ); + aElementName = o3tl::getToken(aResourceURL, 0, '/', nIndex ); } } @@ -287,9 +286,9 @@ bool implts_isFrameOrWindowTop( const uno::Reference< frame::XFrame >& xFrame ) return false; } -void impl_setDockingWindowVisibility( const css::uno::Reference< css::uno::XComponentContext>& rxContext, const css::uno::Reference< css::frame::XFrame >& rFrame, const OUString& rDockingWindowName, bool bVisible ) +void impl_setDockingWindowVisibility( const css::uno::Reference< css::uno::XComponentContext>& rxContext, const css::uno::Reference< css::frame::XFrame >& rFrame, std::u16string_view rDockingWindowName, bool bVisible ) { - sal_Int32 nID = rDockingWindowName.toInt32(); + sal_Int32 nID = o3tl::toInt32(rDockingWindowName); sal_Int32 nIndex = nID - DOCKWIN_ID_BASE; css::uno::Reference< css::frame::XDispatchProvider > xProvider(rFrame, css::uno::UNO_QUERY); diff --git a/framework/source/layoutmanager/helpers.hxx b/framework/source/layoutmanager/helpers.hxx index e3df8fa6f0e9..14f9642a39d6 100644 --- a/framework/source/layoutmanager/helpers.hxx +++ b/framework/source/layoutmanager/helpers.hxx @@ -52,14 +52,14 @@ bool equalRectangles( const css::awt::Rectangle& rRect1, const css::awt::Rectang bool lcl_checkUIElement(const css::uno::Reference< css::ui::XUIElement >& xUIElement,css::awt::Rectangle& _rPosSize, css::uno::Reference< css::awt::XWindow >& _xWindow); css::uno::Reference< css::awt::XWindowPeer > createToolkitWindow( const css::uno::Reference< css::uno::XComponentContext >& rxContext, const css::uno::Reference< css::awt::XWindowPeer >& rParent, const char* pService ); WindowAlign ImplConvertAlignment( css::ui::DockingArea aAlignment ); -OUString getElementTypeFromResourceURL( const OUString& aResourceURL ); -void parseResourceURL( const OUString& aResourceURL, OUString& aElementType, OUString& aElementName ); +std::u16string_view getElementTypeFromResourceURL( std::u16string_view aResourceURL ); +void parseResourceURL( std::u16string_view aResourceURL, OUString& aElementType, OUString& aElementName ); ::tools::Rectangle putAWTToRectangle( const css::awt::Rectangle& rRect ); css::awt::Rectangle putRectangleValueToAWT( const ::tools::Rectangle& rRect ); css::uno::Reference< css::frame::XModel > impl_getModelFromFrame( const css::uno::Reference< css::frame::XFrame >& rFrame ); bool implts_isPreviewModel( const css::uno::Reference< css::frame::XModel >& xModel ); bool implts_isFrameOrWindowTop( const css::uno::Reference< css::frame::XFrame >& xFrame ); -void impl_setDockingWindowVisibility( const css::uno::Reference< css::uno::XComponentContext>& rxContext, const css::uno::Reference< css::frame::XFrame >& rFrame, const OUString& rDockingWindowName, bool bVisible ); +void impl_setDockingWindowVisibility( const css::uno::Reference< css::uno::XComponentContext>& rxContext, const css::uno::Reference< css::frame::XFrame >& rFrame, std::u16string_view rDockingWindowName, bool bVisible ); void impl_addWindowListeners( const css::uno::Reference< css::uno::XInterface >& xThis, const css::uno::Reference< css::ui::XUIElement >& xUIElement ); } diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 0d1cc619da89..9397e7643a28 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -63,6 +63,7 @@ #include <rtl/ref.hxx> #include <sal/log.hxx> +#include <o3tl/string_view.hxx> #include <algorithm> @@ -482,7 +483,7 @@ void LayoutManager::implts_toggleFloatingUIElementsVisibility( bool bActive ) pToolbarManager->setFloatingToolbarsVisibility( bActive ); } -uno::Reference< ui::XUIElement > LayoutManager::implts_findElement( const OUString& aName ) +uno::Reference< ui::XUIElement > LayoutManager::implts_findElement( std::u16string_view aName ) { OUString aElementType; OUString aElementName; @@ -1880,7 +1881,7 @@ sal_Bool SAL_CALL LayoutManager::dockAllWindows( ::sal_Int16 /*nElementType*/ ) sal_Bool SAL_CALL LayoutManager::floatWindow( const OUString& aName ) { bool bResult( false ); - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -1899,7 +1900,7 @@ sal_Bool SAL_CALL LayoutManager::floatWindow( const OUString& aName ) sal_Bool SAL_CALL LayoutManager::lockWindow( const OUString& aName ) { bool bResult( false ); - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -1918,7 +1919,7 @@ sal_Bool SAL_CALL LayoutManager::lockWindow( const OUString& aName ) sal_Bool SAL_CALL LayoutManager::unlockWindow( const OUString& aName ) { bool bResult( false ); - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -1936,7 +1937,7 @@ sal_Bool SAL_CALL LayoutManager::unlockWindow( const OUString& aName ) void SAL_CALL LayoutManager::setElementSize( const OUString& aName, const awt::Size& aSize ) { - if ( !getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( !o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) return; SolarMutexClearableGuard aReadLock; @@ -1953,7 +1954,7 @@ void SAL_CALL LayoutManager::setElementSize( const OUString& aName, const awt::S void SAL_CALL LayoutManager::setElementPos( const OUString& aName, const awt::Point& aPos ) { - if ( !getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( !o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) return; SolarMutexClearableGuard aReadLock; @@ -1970,7 +1971,7 @@ void SAL_CALL LayoutManager::setElementPos( const OUString& aName, const awt::Po void SAL_CALL LayoutManager::setElementPosSize( const OUString& aName, const awt::Point& aPos, const awt::Size& aSize ) { - if ( !getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( !o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) return; SolarMutexClearableGuard aReadLock; @@ -2061,7 +2062,7 @@ sal_Bool SAL_CALL LayoutManager::isElementVisible( const OUString& aName ) sal_Bool SAL_CALL LayoutManager::isElementFloating( const OUString& aName ) { - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -2076,7 +2077,7 @@ sal_Bool SAL_CALL LayoutManager::isElementFloating( const OUString& aName ) sal_Bool SAL_CALL LayoutManager::isElementDocked( const OUString& aName ) { - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -2091,7 +2092,7 @@ sal_Bool SAL_CALL LayoutManager::isElementDocked( const OUString& aName ) sal_Bool SAL_CALL LayoutManager::isElementLocked( const OUString& aName ) { - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -2106,7 +2107,7 @@ sal_Bool SAL_CALL LayoutManager::isElementLocked( const OUString& aName ) awt::Size SAL_CALL LayoutManager::getElementSize( const OUString& aName ) { - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); @@ -2121,7 +2122,7 @@ awt::Size SAL_CALL LayoutManager::getElementSize( const OUString& aName ) awt::Point SAL_CALL LayoutManager::getElementPos( const OUString& aName ) { - if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) + if ( o3tl::equalsIgnoreAsciiCase(getElementTypeFromResourceURL( aName ), UIRESOURCETYPE_TOOLBAR )) { SolarMutexClearableGuard aReadLock; ToolbarLayoutManager* pToolbarManager = m_xToolbarManager.get(); diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx index fc74b81d55f1..bdffa86b1cea 100644 --- a/framework/source/services/pathsettings.cxx +++ b/framework/source/services/pathsettings.cxx @@ -50,6 +50,7 @@ #include <comphelper/sequence.hxx> #include <comphelper/configurationhelper.hxx> #include <unotools/configpaths.hxx> +#include <o3tl/string_view.hxx> using namespace framework; @@ -369,7 +370,7 @@ private: /** converts our new string list schema to the old ";" separated schema ... */ OUString impl_convertPath2OldStyle(const PathSettings::PathInfo& rPath ) const; - std::vector<OUString> impl_convertOldStyle2Path(const OUString& sOldStylePath) const; + std::vector<OUString> impl_convertOldStyle2Path(std::u16string_view sOldStylePath) const; /** remove still known paths from the given lList argument. So real user defined paths can be extracted from the list of @@ -970,13 +971,13 @@ OUString PathSettings::impl_convertPath2OldStyle(const PathSettings::PathInfo& r return sPathVal.makeStringAndClear(); } -std::vector<OUString> PathSettings::impl_convertOldStyle2Path(const OUString& sOldStylePath) const +std::vector<OUString> PathSettings::impl_convertOldStyle2Path(std::u16string_view sOldStylePath) const { std::vector<OUString> lList; sal_Int32 nToken = 0; do { - OUString sToken = sOldStylePath.getToken(0, ';', nToken); + OUString sToken( o3tl::getToken(sOldStylePath, 0, ';', nToken) ); if (!sToken.isEmpty()) lList.push_back(sToken); } diff --git a/framework/source/uielement/menubarmerger.cxx b/framework/source/uielement/menubarmerger.cxx index 175cbe8bcde0..c5730d2ef3e9 100644 --- a/framework/source/uielement/menubarmerger.cxx +++ b/framework/source/uielement/menubarmerger.cxx @@ -20,6 +20,7 @@ #include <uielement/menubarmerger.hxx> #include <framework/addonsoptions.hxx> #include <com/sun/star/uno/Sequence.hxx> +#include <o3tl/string_view.hxx> using namespace ::com::sun::star; @@ -62,7 +63,7 @@ bool MenuBarMerger::IsCorrectContext( } void MenuBarMerger::RetrieveReferencePath( - const OUString& rReferencePathString, + std::u16string_view rReferencePathString, ::std::vector< OUString >& rReferencePath ) { const char aDelimiter = '\\'; @@ -71,7 +72,7 @@ void MenuBarMerger::RetrieveReferencePath( sal_Int32 nIndex( 0 ); do { - OUString aToken = rReferencePathString.getToken( 0, aDelimiter, nIndex ); + OUString aToken( o3tl::getToken(rReferencePathString, 0, aDelimiter, nIndex ) ); if ( !aToken.isEmpty() ) rReferencePath.push_back( aToken ); } @@ -256,9 +257,9 @@ bool MenuBarMerger::ReplaceMenuItem( bool MenuBarMerger::RemoveMenuItems( Menu* pMenu, sal_uInt16 nPos, - const OUString& rMergeCommandParameter ) + std::u16string_view rMergeCommandParameter ) { - const sal_uInt16 nParam( sal_uInt16( rMergeCommandParameter.toInt32() )); + const sal_uInt16 nParam( sal_uInt16( o3tl::toInt32(rMergeCommandParameter) )); sal_uInt16 nCount = std::max( nParam, sal_uInt16(1) ); sal_uInt16 i = 0; @@ -276,7 +277,7 @@ bool MenuBarMerger::ProcessMergeOperation( sal_uInt16 nPos, sal_uInt16& nItemId, std::u16string_view rMergeCommand, - const OUString& rMergeCommandParameter, + std::u16string_view rMergeCommandParameter, const OUString& rModuleIdentifier, const AddonMenuContainer& rAddonMenuItems ) { diff --git a/framework/source/uielement/statusbarmerger.cxx b/framework/source/uielement/statusbarmerger.cxx index 38e266009aca..c8e6633be9f0 100644 --- a/framework/source/uielement/statusbarmerger.cxx +++ b/framework/source/uielement/statusbarmerger.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include <uielement/statusbarmerger.hxx> +#include <o3tl/string_view.hxx> using com::sun::star::beans::PropertyValue; using com::sun::star::uno::Sequence; @@ -135,9 +136,9 @@ bool lcl_ReplaceItem( StatusBar* pStatusbar, bool lcl_RemoveItems( StatusBar* pStatusbar, sal_uInt16 nPos, - const OUString& rMergeCommandParameter ) + std::u16string_view rMergeCommandParameter ) { - sal_Int32 nCount = rMergeCommandParameter.toInt32(); + sal_Int32 nCount = o3tl::toInt32(rMergeCommandParameter); if ( nCount > 0 ) { for ( sal_Int32 i = 0; i < nCount; i++ ) @@ -190,7 +191,7 @@ bool StatusbarMerger::ProcessMergeOperation( sal_uInt16 nPos, sal_uInt16& rItemId, std::u16string_view rMergeCommand, - const OUString& rMergeCommandParameter, + std::u16string_view rMergeCommandParameter, const AddonStatusbarItemContainer& rItems ) { if ( rMergeCommand == MERGECOMMAND_ADDAFTER ) diff --git a/framework/source/uielement/toolbarmerger.cxx b/framework/source/uielement/toolbarmerger.cxx index 9e434f672c2d..2657873c3b22 100644 --- a/framework/source/uielement/toolbarmerger.cxx +++ b/framework/source/uielement/toolbarmerger.cxx @@ -33,6 +33,7 @@ #include <uielement/togglebuttontoolbarcontroller.hxx> #include <uielement/FixedTextToolbarController.hxx> #include <uielement/FixedImageToolbarController.hxx> +#include <o3tl/string_view.hxx> namespace framework { @@ -307,7 +308,7 @@ bool ToolBarMerger::ProcessMergeOperation( CommandToInfoMap& rCommandMap, std::u16string_view rModuleIdentifier, std::u16string_view rMergeCommand, - const OUString& rMergeCommandParameter, + std::u16string_view rMergeCommandParameter, const AddonToolbarItemContainer& rItems ) { if ( rMergeCommand == MERGECOMMAND_ADDAFTER ) @@ -544,9 +545,9 @@ void ToolBarMerger::ReplaceItem( void ToolBarMerger::RemoveItems( ToolBox* pToolbar, ToolBox::ImplToolItems::size_type nPos, - const OUString& rMergeCommandParameter ) + std::u16string_view rMergeCommandParameter ) { - sal_Int32 nCount = rMergeCommandParameter.toInt32(); + sal_Int32 nCount = o3tl::toInt32(rMergeCommandParameter); if ( nCount > 0 ) { for ( sal_Int32 i = 0; i < nCount; i++ ) |