summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/tabledesign
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2002-11-21 12:57:18 +0000
committerOcke Janssen <oj@openoffice.org>2002-11-21 12:57:18 +0000
commitde05b49073a0d79c17d9689e9dcc28ec69fe5e78 (patch)
treeaa361169853251bc0fc020a84116617050e725ef /dbaccess/source/ui/tabledesign
parent0f4b987972104f02750f6bdbf960dd60cb6401d7 (diff)
#104812# insert more defensive programming
Diffstat (limited to 'dbaccess/source/ui/tabledesign')
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 2d1ca25b56ad..7453974e1ea5 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: TEditControl.cxx,v $
*
- * $Revision: 1.34 $
+ * $Revision: 1.35 $
*
- * last change: $Author: oj $ $Date: 2002-09-24 09:19:03 $
+ * last change: $Author: oj $ $Date: 2002-11-21 13:57:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1504,11 +1504,19 @@ sal_Bool OTableEditorCtrl::IsPrimaryKeyAllowed( long nRow )
return sal_False;
OTableController* pController = GetView()->getController();
- Reference<XConnection> xCon = pController->getConnection();
+ try
+ {
+ Reference<XConnection> xCon = pController->getConnection();
- Reference< XDatabaseMetaData> xMetaData = xCon.is() ? xCon->getMetaData() : Reference< XDatabaseMetaData>();
- if(!xMetaData.is() || !xMetaData->supportsCoreSQLGrammar())
- return sal_False; // no primary keys allowed
+ Reference< XDatabaseMetaData> xMetaData = xCon.is() ? xCon->getMetaData() : Reference< XDatabaseMetaData>();
+ if(!xMetaData.is() || !xMetaData->supportsCoreSQLGrammar())
+ return sal_False; // no primary keys allowed
+
+ }
+ catch(SQLException&)
+ {
+ OSL_ASSERT(!"supportsCoreSQLGrammar");
+ }
Reference<XPropertySet> xTable = pController->getTable();
//////////////////////////////////////////////////////////////