summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/tabledesign
diff options
context:
space:
mode:
authorOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-02-08 14:07:46 +0100
committerOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-02-08 14:07:46 +0100
commitcf53b20a8a8a3de042b43c25dc3c61b6ef334481 (patch)
treede708bbe89dcd72c15506d5e84dd71cb0fca1c68 /dbaccess/source/ui/tabledesign
parentce6355d159de3d732303d41d563cceeeca5295ee (diff)
dba33f: don't ask every driver for a tables keys and consolidate some code fragments
Diffstat (limited to 'dbaccess/source/ui/tabledesign')
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx34
1 files changed, 1 insertions, 33 deletions
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index 8eb94aeb3..b84882650 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -971,39 +971,7 @@ void OTableController::loadData()
// -----------------------------------------------------------------------------
Reference<XNameAccess> OTableController::getKeyColumns() const
{
- // use keys and indexes for excat postioning
- // first the keys
- Reference<XKeysSupplier> xKeySup(m_xTable,UNO_QUERY);
- Reference<XIndexAccess> xKeys;
- if(xKeySup.is())
- xKeys = xKeySup->getKeys();
-
- Reference<XColumnsSupplier> xKeyColsSup;
- Reference<XNameAccess> xKeyColumns;
- if(xKeys.is())
- {
- Reference<XPropertySet> xProp;
- sal_Int32 nCount = xKeys->getCount();
- for(sal_Int32 i=0;i< nCount;++i)
- {
- xKeys->getByIndex(i) >>= xProp;
- OSL_ENSURE(xProp.is(),"Key is invalid: NULL!");
- if ( xProp.is() )
- {
- sal_Int32 nKeyType = 0;
- xProp->getPropertyValue(PROPERTY_TYPE) >>= nKeyType;
- if(KeyType::PRIMARY == nKeyType)
- {
- xKeyColsSup.set(xProp,UNO_QUERY);
- OSL_ENSURE(xKeyColsSup.is(),"Columnsupplier is null!");
- xKeyColumns = xKeyColsSup->getColumns();
- break;
- }
- }
- }
- }
-
- return xKeyColumns;
+ return getPrimaryKeyColumns_throw(m_xTable);
}
// -----------------------------------------------------------------------------
sal_Bool OTableController::checkColumns(sal_Bool _bNew) throw(::com::sun::star::sdbc::SQLException)