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 /sd/source/ui | |
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 'sd/source/ui')
-rw-r--r-- | sd/source/ui/app/sdmod1.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/tpoption.cxx | 13 | ||||
-rw-r--r-- | sd/source/ui/inc/tpoption.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.hxx | 2 |
5 files changed, 14 insertions, 12 deletions
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 66a211bfe125..927b37ae830e 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -462,7 +462,7 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest const & rReq ) //we start without wizard //check whether we should load a template document - OUString aStandardTemplate( SfxObjectFactory::GetStandardTemplate( "com.sun.star.presentation.PresentationDocument" ) ); + OUString aStandardTemplate( SfxObjectFactory::GetStandardTemplate( u"com.sun.star.presentation.PresentationDocument" ) ); if( !aStandardTemplate.isEmpty() ) { diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index 28f7fff49bb8..a612163f9493 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -37,6 +37,7 @@ #include <strings.hrc> #include <app.hrc> #include <svl/intitem.hxx> +#include <o3tl/string_view.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -524,32 +525,32 @@ OUString SdTpOptionsMisc::GetScale( sal_Int32 nX, sal_Int32 nY ) return OUString::number(nX) + OUStringChar(TOKEN) + OUString::number(nY); } -bool SdTpOptionsMisc::SetScale( const OUString& aScale, sal_Int32& rX, sal_Int32& rY ) +bool SdTpOptionsMisc::SetScale( std::u16string_view aScale, sal_Int32& rX, sal_Int32& rY ) { - if (aScale.isEmpty()) + if (aScale.empty()) return false; sal_Int32 nIdx {0}; - OUString aTmp(aScale.getToken(0, TOKEN, nIdx)); + std::u16string_view aTmp(o3tl::getToken(aScale, 0, TOKEN, nIdx)); if (nIdx<0) return false; // we expect another token! if (!comphelper::string::isdigitAsciiString(aTmp)) return false; - rX = static_cast<tools::Long>(aTmp.toInt32()); + rX = static_cast<tools::Long>(o3tl::toInt32(aTmp)); if( rX == 0 ) return false; - aTmp = aScale.getToken(0, TOKEN, nIdx); + aTmp = o3tl::getToken(aScale, 0, TOKEN, nIdx); if (nIdx>=0) return false; // we require just 2 tokens! if (!comphelper::string::isdigitAsciiString(aTmp)) return false; - rY = static_cast<tools::Long>(aTmp.toInt32()); + rY = static_cast<tools::Long>(o3tl::toInt32(aTmp)); return rY != 0; } diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx index bc101dca3490..8657db27a243 100644 --- a/sd/source/ui/inc/tpoption.hxx +++ b/sd/source/ui/inc/tpoption.hxx @@ -106,7 +106,7 @@ private: std::unique_ptr<weld::MetricSpinButton> m_xMtrFldInfo2; static OUString GetScale( sal_Int32 nX, sal_Int32 nY ); - static bool SetScale( const OUString& aScale, sal_Int32& rX, sal_Int32& rY ); + static bool SetScale( std::u16string_view aScale, sal_Int32& rX, sal_Int32& rY ); DECL_LINK( SelectMetricHdl_Impl, weld::ComboBox&, void ); diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 51d3116bf70e..416f70ea6e46 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -78,6 +78,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/propertyvalue.hxx> #include <rtl/ref.hxx> +#include <o3tl/string_view.hxx> #include <avmedia/mediawindow.hxx> #include <svtools/colrdlg.hxx> #include <DrawDocShell.hxx> @@ -2049,7 +2050,7 @@ IMPL_LINK_NOARG(SlideshowImpl, ContextMenuHdl, void*, void) resume(); } -void SlideshowImpl::ContextMenuSelectHdl(const OString& rMenuId) +void SlideshowImpl::ContextMenuSelectHdl(std::string_view rMenuId) { if (rMenuId == "prev") { @@ -2169,9 +2170,9 @@ void SlideshowImpl::ContextMenuSelectHdl(const OString& rMenuId) } endPresentation(); } - else if (!rMenuId.isEmpty()) + else if (!rMenuId.empty()) { - sal_Int32 nPageNumber = rMenuId.toInt32() - CM_SLIDES; + sal_Int32 nPageNumber = o3tl::toInt32(rMenuId) - CM_SLIDES; const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); if( (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) ) { diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index 33d74d60c7cc..eeec8a3fd7c5 100644 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -242,7 +242,7 @@ private: DECL_LINK( updateHdl, Timer *, void ); DECL_LINK( ReadyForNextInputHdl, Timer *, void ); DECL_LINK( endPresentationHdl, void*, void ); - void ContextMenuSelectHdl(const OString& rIdent); + void ContextMenuSelectHdl(std::string_view rIdent); DECL_LINK( ContextMenuHdl, void*, void ); DECL_LINK( deactivateHdl, Timer *, void ); DECL_LINK( EventListenerHdl, VclSimpleEvent&, void ); |