diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-12-18 12:37:09 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-18 12:37:09 +0000 |
commit | f5ef6b39fb572a581a54927930dda6b8e8d71797 (patch) | |
tree | ce0ee73931ea9ffc1f719f1a4b864ebe191b70b3 /connectivity | |
parent | 365baa17faa71bd2a2b9a372d779b0eca21d3a1b (diff) |
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
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/hsqldb/HDriver.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
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<XConnection> xOrig; try { |