summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-09-21 11:07:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-21 14:21:28 +0200
commitda730a3df0dd8a8b1ac0eca09ccc9bba04830802 (patch)
treea1181a2d9f70a43568919ba8e97f897977c64ce7 /svtools
parentbdf346830b735aa484fba0df94be71fd1ea5cdfd (diff)
use more string_view in svtools
Change-Id: Id0317c400d7bc868916b97cd1c7abae04c4a9e30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140335 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/control/inettbc.cxx11
-rw-r--r--svtools/source/svrtf/rtfout.cxx4
-rw-r--r--svtools/source/uno/popupmenucontrollerbase.cxx19
3 files changed, 17 insertions, 17 deletions
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index cfecf910f94b..0ffad5414c08 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -40,6 +40,7 @@
#include <comphelper/string.hxx>
#include <salhelper/thread.hxx>
#include <tools/debug.hxx>
+#include <o3tl/string_view.hxx>
#include <osl/file.hxx>
#include <osl/mutex.hxx>
#include <unotools/historyoptions.hxx>
@@ -76,7 +77,7 @@ public:
SvtURLBox_Impl( )
{
- FilterMatch::createWildCardFilterList(OUString(),m_aFilters);
+ FilterMatch::createWildCardFilterList(u"",m_aFilters);
}
};
@@ -1079,22 +1080,22 @@ void SvtURLBox::DisableHistory()
UpdatePicklistForSmartProtocol_Impl();
}
-void SvtURLBox::SetFilter(const OUString& _sFilter)
+void SvtURLBox::SetFilter(std::u16string_view _sFilter)
{
pImpl->m_aFilters.clear();
FilterMatch::createWildCardFilterList(_sFilter,pImpl->m_aFilters);
}
-void FilterMatch::createWildCardFilterList(const OUString& _rFilterList,::std::vector< WildCard >& _rFilters)
+void FilterMatch::createWildCardFilterList(std::u16string_view _rFilterList,::std::vector< WildCard >& _rFilters)
{
- if( _rFilterList.getLength() )
+ if( !_rFilterList.empty() )
{
// filter is given
sal_Int32 nIndex = 0;
OUString sToken;
do
{
- sToken = _rFilterList.getToken( 0, ';', nIndex );
+ sToken = o3tl::getToken(_rFilterList, 0, ';', nIndex );
if ( !sToken.isEmpty() )
{
_rFilters.emplace_back( sToken.toAsciiUpperCase() );
diff --git a/svtools/source/svrtf/rtfout.cxx b/svtools/source/svrtf/rtfout.cxx
index b06a04eedfa0..7a8f0e252002 100644
--- a/svtools/source/svrtf/rtfout.cxx
+++ b/svtools/source/svrtf/rtfout.cxx
@@ -178,11 +178,11 @@ SvStream& Out_Char(SvStream& rStream, sal_Unicode c,
}
-SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const OUString& rStr,
+SvStream& RTFOutFuncs::Out_String( SvStream& rStream, std::u16string_view rStr,
rtl_TextEncoding eDestEnc)
{
int nUCMode = 1;
- for (sal_Int32 n = 0; n < rStr.getLength(); ++n)
+ for (size_t n = 0; n < rStr.size(); ++n)
Out_Char(rStream, rStr[n], &nUCMode, eDestEnc);
if (nUCMode != 1)
rStream.WriteCharPtr( "\\uc1" ).WriteCharPtr( " " ); // #i47831# add an additional whitespace, so that "document whitespaces" are not ignored.;
diff --git a/svtools/source/uno/popupmenucontrollerbase.cxx b/svtools/source/uno/popupmenucontrollerbase.cxx
index 167548d0407c..b4a4cbdc8bda 100644
--- a/svtools/source/uno/popupmenucontrollerbase.cxx
+++ b/svtools/source/uno/popupmenucontrollerbase.cxx
@@ -276,21 +276,20 @@ void SAL_CALL PopupMenuControllerBase::removeStatusListener(
rBHelper.removeListener( cppu::UnoType<decltype(xControl)>::get(), xControl );
}
-OUString PopupMenuControllerBase::determineBaseURL( const OUString& aURL )
+OUString PopupMenuControllerBase::determineBaseURL( std::u16string_view aURL )
{
// Just use the main part of the URL for popup menu controllers
- sal_Int32 nSchemePart( 0 );
OUString aMainURL( "vnd.sun.star.popup:" );
- nSchemePart = aURL.indexOf( ':' );
- if (( nSchemePart > 0 ) &&
- ( aURL.getLength() > ( nSchemePart+1 )))
+ size_t nSchemePart = aURL.find( ':' );
+ if (( nSchemePart != std::u16string_view::npos && nSchemePart > 0 ) &&
+ ( aURL.size() > ( nSchemePart+1 )))
{
- sal_Int32 nQueryPart = aURL.indexOf( '?', nSchemePart );
- if ( nQueryPart > 0 )
- aMainURL += aURL.subView( nSchemePart, nQueryPart-nSchemePart );
- else if ( nQueryPart == -1 )
- aMainURL += aURL.subView( nSchemePart+1 );
+ size_t nQueryPart = aURL.find( '?', nSchemePart );
+ if ( nQueryPart != std::u16string_view::npos && nQueryPart > 0 )
+ aMainURL += aURL.substr( nSchemePart, nQueryPart-nSchemePart );
+ else if ( nQueryPart == std::u16string_view::npos )
+ aMainURL += aURL.substr( nSchemePart+1 );
}
return aMainURL;