diff options
Diffstat (limited to 'sal/qa')
-rw-r--r-- | sal/qa/osl/file/osl_File.cxx | 8 | ||||
-rw-r--r-- | sal/qa/osl/module/osl_Module.cxx | 5 |
2 files changed, 5 insertions, 8 deletions
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index 54966aca78c9..50268ff49a57 100644 --- a/sal/qa/osl/file/osl_File.cxx +++ b/sal/qa/osl/file/osl_File.cxx @@ -322,9 +322,9 @@ inline sal_Bool isURL( const sal_Char *pathname ) /** simple version to judge if a file name or directory name is a URL or a system path, just to see if it is start with "file:///";. */ -inline sal_Bool isURL( const ::rtl::OUString pathname ) +inline bool isURL( const ::rtl::OUString pathname ) { - return ( ( pathname.indexOf( aPreURL ) == 0 ) ? sal_True : sal_False ); + return pathname.startsWith( aPreURL ); } /** concat two part to form a URL or system path, add PATH_SEPARATOR between them if necessary, add "file:///" to beginning if necessary. @@ -339,10 +339,8 @@ inline void concatURL( ::rtl::OUString & pathname1, const ::rtl::OUString & path pathname1 = aPathName.copy( 0 ); } - sal_Int32 index = 0; //check if '/' is in the end of pathname1 or at the begin of pathname2; - if ( ( ( index = pathname1.lastIndexOf( aSlashURL ) ) != ( pathname1.getLength() - 1 ) ) && - ( ( index = pathname2.indexOf( aSlashURL ) ) != 0 ) ) + if ( !pathname1.endsWith( aSlashURL ) && !pathname2.startsWith( aSlashURL ) ) pathname1 += aSlashURL; pathname1 += pathname2; } diff --git a/sal/qa/osl/module/osl_Module.cxx b/sal/qa/osl/module/osl_Module.cxx index 2b51bdfbc5fa..d6358d4c692c 100644 --- a/sal/qa/osl/module/osl_Module.cxx +++ b/sal/qa/osl/module/osl_Module.cxx @@ -70,10 +70,9 @@ inline ::rtl::OUString getDllURL( void ) return dllPath; } -inline sal_Bool isURL( const ::rtl::OUString pathname ) +inline bool isURL( const ::rtl::OUString pathname ) { - ::rtl::OUString aPreURL( "file:///" ); - return ( ( pathname.indexOf( aPreURL ) == 0 ) ? sal_True : sal_False ); + return pathname.startsWith( "file:///" ); } /** create a temp test directory using OUString name of full qualified URL or system path. |