[Libreoffice-commits] core.git: connectivity/source
Caolán McNamara
caolanm at redhat.com
Wed Dec 18 04:39:23 PST 2013
connectivity/source/drivers/hsqldb/HDriver.cxx | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit f5ef6b39fb572a581a54927930dda6b8e8d71797
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Dec 18 12:37:09 2013 +0000
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
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index 9734d6a..8e6dff9 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
{
More information about the Libreoffice-commits
mailing list