From f5ef6b39fb572a581a54927930dda6b8e8d71797 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 18 Dec 2013 12:37:09 +0000 Subject: nIndex can only be -1 or < sSystemPath.getLength() from sal_Int32 nIndex = sSystemPath.lastIndexOf('.'); so OUString sConnPartURL = sSystemPath.copy( 0, ::std::max< sal_Int32 >( nIndex, sSystemPath.getLength() ) is equivalent to OUString sConnPartURL = sSystemPath.copy( 0, sSystemPath.getLength() ) which is OUString sConnPartURL = sSystemPath; so drop sConnPartURL and replace with sSystemPath Change-Id: I3fc8e88a4b3e474c3dccd08cf356e4663503ae02 --- connectivity/source/drivers/hsqldb/HDriver.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx index 9734d6a8b0b3..8e6dff91b3ad 100644 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -208,7 +208,6 @@ namespace connectivity OUString sSystemPath; osl_getSystemPathFromFileURL( sURL.pData, &sSystemPath.pData ); - sal_Int32 nIndex = sSystemPath.lastIndexOf('.'); if ( sURL.isEmpty() || sSystemPath.isEmpty() ) { ::connectivity::SharedResources aResources; @@ -221,8 +220,7 @@ namespace connectivity ::comphelper::NamedValueCollection aProperties; // properties for accessing the embedded storage - OUString sConnPartURL = sSystemPath.copy( 0, ::std::max< sal_Int32 >( nIndex, sSystemPath.getLength() ) ); - OUString sKey = StorageContainer::registerStorage( xStorage, sConnPartURL ); + OUString sKey = StorageContainer::registerStorage( xStorage, sSystemPath ); aProperties.put( "storage_key", sKey ); aProperties.put( "storage_class_name", OUString( "com.sun.star.sdbcx.comp.hsqldb.StorageAccess" ) ); @@ -335,7 +333,7 @@ namespace connectivity OUString sConnectURL("jdbc:hsqldb:"); - sConnectURL += sConnPartURL; + sConnectURL += sSystemPath; Reference xOrig; try { -- cgit