loplugin:stringviewparam
Change-Id: I8f27a2260e7195dd0a7dbb0b5e3dd0064ef06c81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133164 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
@@ -17,6 +17,9 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sal/config.h>
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
#include "updatehdl.hxx"
|
#include "updatehdl.hxx"
|
||||||
#include <helpids.h>
|
#include <helpids.h>
|
||||||
@@ -240,13 +243,13 @@ void UpdateHandler::setErrorMessage( const OUString& rErrorMsg )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UpdateHandler::setDownloadFile( const OUString& rFilePath )
|
void UpdateHandler::setDownloadFile( std::u16string_view rFilePath )
|
||||||
{
|
{
|
||||||
sal_Int32 nLast = rFilePath.lastIndexOf( '/' );
|
std::size_t nLast = rFilePath.rfind( '/' );
|
||||||
if ( nLast != -1 )
|
if ( nLast != std::u16string_view::npos )
|
||||||
{
|
{
|
||||||
msDownloadFile = rFilePath.copy( nLast+1 );
|
msDownloadFile = rFilePath.substr( nLast+1 );
|
||||||
const OUString aDownloadURL = rFilePath.copy( 0, nLast );
|
const OUString aDownloadURL(rFilePath.substr( 0, nLast ));
|
||||||
osl::FileBase::getSystemPathFromFileURL( aDownloadURL, msDownloadPath );
|
osl::FileBase::getSystemPathFromFileURL( aDownloadURL, msDownloadPath );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -166,7 +166,7 @@ public:
|
|||||||
void setProgress( sal_Int32 nPercent );
|
void setProgress( sal_Int32 nPercent );
|
||||||
void setNextVersion( const OUString &rNextVersion ) { msNextVersion = rNextVersion; }
|
void setNextVersion( const OUString &rNextVersion ) { msNextVersion = rNextVersion; }
|
||||||
void setDownloadPath( const OUString &rPath ) { msDownloadPath = rPath; }
|
void setDownloadPath( const OUString &rPath ) { msDownloadPath = rPath; }
|
||||||
void setDownloadFile( const OUString &rPath );
|
void setDownloadFile( std::u16string_view rPath );
|
||||||
void setErrorMessage( const OUString &rErrorMsg );
|
void setErrorMessage( const OUString &rErrorMsg );
|
||||||
void setDescription( const OUString &rDescription ){ msDescriptionMsg = rDescription; }
|
void setDescription( const OUString &rDescription ){ msDescriptionMsg = rDescription; }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user