[Libreoffice-commits] core.git: 2 commits - dbaccess/source wizards/com
Lionel Elie Mamane
lionel at mamane.lu
Wed Jul 3 09:14:51 PDT 2013
dbaccess/source/sdbtools/connection/objectnames.cxx | 4 ++++
wizards/com/sun/star/wizards/db/DBMetaData.java | 5 +++--
2 files changed, 7 insertions(+), 2 deletions(-)
New commits:
commit 8079326b97df9b9da56bc62f67df705efb407409
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Wed Jul 3 18:10:38 2013 +0200
database suggestname: no '/' for queries
In particular, this keeps the new query wizard
from silently failing by default
when the underlying table name has a slash: it would
generate a name proposal based on the table name,
and then use suggestName to get a similar,
yet guaranteed allowed name.
In this case, the "guaranteed allowed" part was failing,
since suggestName failed to strip slashes, which are
forbidden in query names.
Change-Id: I53d3976979ee45f5659765ed5dd3371b78837b5b
diff --git a/dbaccess/source/sdbtools/connection/objectnames.cxx b/dbaccess/source/sdbtools/connection/objectnames.cxx
index 9e1d0dd..add3509 100644
--- a/dbaccess/source/sdbtools/connection/objectnames.cxx
+++ b/dbaccess/source/sdbtools/connection/objectnames.cxx
@@ -419,6 +419,10 @@ namespace sdbtools
else
sBaseName = OUString( SdbtRes( STR_BASENAME_QUERY ) );
}
+ else if( _CommandType == CommandType::QUERY )
+ {
+ sBaseName=sBaseName.replace('/', '_');
+ }
OUString sName( sBaseName );
sal_Int32 i = 1;
commit 7b957555d0027e9e7eeb8f31dcba6aa6408f4e16
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Wed Jul 3 18:04:28 2013 +0200
handle non-wrapped SQLException
This happens e.g. when the user types a forbidden name for the query
(e.g. containing '/'
Also uniformise Logger usage instead of exception.printStackTrace
Change-Id: I29b14b65dae487e0eb61b90ceba968142981e755
diff --git a/wizards/com/sun/star/wizards/db/DBMetaData.java b/wizards/com/sun/star/wizards/db/DBMetaData.java
index 39c4f84..a75009c 100644
--- a/wizards/com/sun/star/wizards/db/DBMetaData.java
+++ b/wizards/com/sun/star/wizards/db/DBMetaData.java
@@ -856,11 +856,12 @@ public class DBMetaData
callSQLErrorMessageDialog(sqlError, null);
return false;
}
- exception.printStackTrace(System.err);
+ Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, exception );
}
catch (SQLException e)
{
- Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e );
+ callSQLErrorMessageDialog(e, null);
+ return false;
}
catch (Exception e)
{
More information about the Libreoffice-commits
mailing list