diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-03 10:34:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-17 10:27:33 +0200 |
commit | 33bd16b344e273c427091ee68e946bf67b371dd7 (patch) | |
tree | 85fb383ea8e3d30f393bb197b5c74f73f6ca247f /desktop | |
parent | fe597a337914decd62480d3eba84258333116db9 (diff) |
loplugin:stringviewparam convert methods using copy()
which converts to std::string_view::substr()
Change-Id: I3f42213b41a97e77ddcc79d84d512f49d68ca559
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132729
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/dispatchwatcher.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index 3d24a158261e..e4745f6761a5 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -243,16 +243,16 @@ void scriptCat(const Reference< XModel >& xDoc ) } // Perform batch print -void batchPrint( const OUString &rPrinterName, const Reference< XPrintable > &xDoc, +void batchPrint( std::u16string_view rPrinterName, const Reference< XPrintable > &xDoc, const INetURLObject &aObj, const OUString &aName ) { OUString aFilterOut; OUString aPrinterName; - sal_Int32 nPathIndex = rPrinterName.lastIndexOf( ';' ); - if( nPathIndex != -1 ) - aFilterOut=rPrinterName.copy( nPathIndex+1 ); + size_t nPathIndex = rPrinterName.rfind( ';' ); + if( nPathIndex != std::u16string_view::npos ) + aFilterOut=rPrinterName.substr( nPathIndex+1 ); if( nPathIndex != 0 ) - aPrinterName=rPrinterName.copy( 0, nPathIndex ); + aPrinterName=rPrinterName.substr( 0, nPathIndex ); INetURLObject aOutFilename( aObj ); aOutFilename.SetExtension( u"pdf" ); |