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 /sfx2 | |
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 'sfx2')
-rw-r--r-- | sfx2/source/bastyp/fltfnc.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/dockwin.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlgimpl.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/filtergrouping.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/filtergrouping.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/DocumentMetadataAccess.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/doc/docfac.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/docfilt.cxx | 2 |
9 files changed, 17 insertions, 15 deletions
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index fd2e7c2df31d..d554d8e9652d 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -137,7 +137,7 @@ OUString const & SfxFilterContainer::GetName() const return pImpl->aName; } -std::shared_ptr<const SfxFilter> SfxFilterContainer::GetDefaultFilter_Impl( const OUString& rName ) +std::shared_ptr<const SfxFilter> SfxFilterContainer::GetDefaultFilter_Impl( std::u16string_view rName ) { // Try to find out the type of factory. // Interpret given name as Service- and ShortName! diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index e19949b279f8..4329b2d908a4 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -26,6 +26,7 @@ #include <vcl/timer.hxx> #include <vcl/idle.hxx> #include <o3tl/safeint.hxx> +#include <o3tl/string_view.hxx> #include <osl/diagnose.h> #include <toolkit/helper/vclunohelper.hxx> #include <tools/debug.hxx> @@ -320,10 +321,10 @@ static SfxWorkWindow* lcl_getWorkWindowFromXFrame( const uno::Reference< frame:: The string rDockingWindowName MUST BE a valid ID! The ID is pre-defined by a certain slot range located in sfxsids.hrc (currently SID_DOCKWIN_START = 9800). */ -void SfxDockingWindowFactory( const uno::Reference< frame::XFrame >& rFrame, const OUString& rDockingWindowName ) +void SfxDockingWindowFactory( const uno::Reference< frame::XFrame >& rFrame, std::u16string_view rDockingWindowName ) { SolarMutexGuard aGuard; - sal_uInt16 nID = sal_uInt16(rDockingWindowName.toInt32()); + sal_uInt16 nID = sal_uInt16(o3tl::toInt32(rDockingWindowName)); // Check the range of the provided ID otherwise nothing will happen if ( !lcl_checkDockingWindowID( nID )) @@ -345,11 +346,11 @@ void SfxDockingWindowFactory( const uno::Reference< frame::XFrame >& rFrame, con a special name. The string rDockingWindowName MUST BE a valid ID! The ID is pre-defined by a certain slot range located in sfxsids.hrc (currently SID_DOCKWIN_START = 9800). */ -bool IsDockingWindowVisible( const uno::Reference< frame::XFrame >& rFrame, const OUString& rDockingWindowName ) +bool IsDockingWindowVisible( const uno::Reference< frame::XFrame >& rFrame, std::u16string_view rDockingWindowName ) { SolarMutexGuard aGuard; - sal_uInt16 nID = sal_uInt16(rDockingWindowName.toInt32()); + sal_uInt16 nID = sal_uInt16(o3tl::toInt32(rDockingWindowName)); // Check the range of the provided ID otherwise nothing will happen if ( lcl_checkDockingWindowID( nID )) diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 364943f832b3..6718ccd721d9 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -2125,7 +2125,7 @@ void FileDialogHelper_Impl::saveConfig() } } -OUString FileDialogHelper_Impl::getInitPath(const OUString& _rFallback, +OUString FileDialogHelper_Impl::getInitPath(std::u16string_view _rFallback, const sal_Int32 _nFallbackToken) { OUString sPath; @@ -2152,7 +2152,7 @@ OUString FileDialogHelper_Impl::getInitPath(const OUString& _rFallback, } if ( sPath.isEmpty() ) - sPath = _rFallback.getToken( _nFallbackToken, ' ' ); + sPath = o3tl::getToken(_rFallback, _nFallbackToken, ' ' ); // check if the path points to a valid (accessible) directory bool bValid = false; diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index 01411f23e9e4..e5910790cc01 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -205,7 +205,7 @@ namespace sfx2 OUString getFilterWithExtension( std::u16string_view rFilter ) const; void SetContext( FileDialogHelper::Context _eNewContext ); - OUString getInitPath( const OUString& _rFallback, const sal_Int32 _nFallbackToken ); + OUString getInitPath( std::u16string_view _rFallback, const sal_Int32 _nFallbackToken ); bool isAsyncFilePicker() const { return mbAsyncPicker; } bool isPasswordEnabled() const { return mbIsPwdEnabled; } diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index 195fa09dd9bc..59388eece485 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -894,7 +894,7 @@ namespace sfx2 void appendFiltersForSave( TSortedFilterList& _rFilterMatcher, const Reference< XFilterManager >& _rxFilterManager, OUString& _rFirstNonEmpty, FileDialogHelper_Impl& _rFileDlgImpl, - const OUString& _rFactory ) + std::u16string_view _rFactory ) { DBG_ASSERT( _rxFilterManager.is(), "sfx2::appendFiltersForSave: invalid manager!" ); if ( !_rxFilterManager.is() ) diff --git a/sfx2/source/dialog/filtergrouping.hxx b/sfx2/source/dialog/filtergrouping.hxx index bba379f344c7..1d8a444738c1 100644 --- a/sfx2/source/dialog/filtergrouping.hxx +++ b/sfx2/source/dialog/filtergrouping.hxx @@ -54,7 +54,7 @@ namespace sfx2 const css::uno::Reference< css::ui::dialogs::XFilterManager >& _rFilterManager, OUString& /* [out] */ _rFirstNonEmpty, FileDialogHelper_Impl& _rFileDlgImpl, - const OUString& _rFactory + std::u16string_view _rFactory ); void appendExportFilters( diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 160dfce000f5..59c164501325 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -46,6 +46,7 @@ #include <comphelper/sequence.hxx> #include <comphelper/storagehelper.hxx> #include <cppuhelper/exc_hlp.hxx> +#include <o3tl/string_view.hxx> #include <sfx2/docfile.hxx> #include <sfx2/XmlIdRegistry.hxx> @@ -241,14 +242,14 @@ getURI(uno::Reference< uno::XComponentContext > const & i_xContext) /** would storing the file to a XStorage succeed? */ -static bool isFileNameValid(const OUString & i_rFileName) +static bool isFileNameValid(std::u16string_view i_rFileName) { - if (i_rFileName.isEmpty()) return false; + if (i_rFileName.empty()) return false; if (i_rFileName[0] == '/') return false; // no absolute paths! sal_Int32 idx(0); do { const OUString segment( - i_rFileName.getToken(0, u'/', idx) ); + o3tl::getToken(i_rFileName, 0, u'/', idx) ); if (segment.isEmpty() || // no empty segments segment == "." || // no . segments segment == ".." || // no .. segments diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index cc041670f997..481dd5a683e3 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -247,7 +247,7 @@ void SfxObjectFactory::SetStandardTemplate( const OUString& rServiceName, const } } -OUString SfxObjectFactory::GetStandardTemplate( const OUString& rServiceName ) +OUString SfxObjectFactory::GetStandardTemplate( std::u16string_view rServiceName ) { SvtModuleOptions::EFactory eFac = SvtModuleOptions::ClassifyFactoryByServiceName(rServiceName); if (eFac == SvtModuleOptions::EFactory::UNKNOWN_FACTORY) diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx index 696792ff8ece..7a23a2842346 100644 --- a/sfx2/source/doc/docfilt.cxx +++ b/sfx2/source/doc/docfilt.cxx @@ -101,7 +101,7 @@ OUString SfxFilter::GetSuffixes() const return aRet; } -std::shared_ptr<const SfxFilter> SfxFilter::GetDefaultFilter( const OUString& rName ) +std::shared_ptr<const SfxFilter> SfxFilter::GetDefaultFilter( std::u16string_view rName ) { return SfxFilterContainer::GetDefaultFilter_Impl( rName ); } |