From 99671d27b08076d2dabfbb989003970c3ed42bd3 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 19 Apr 2010 11:50:35 +0200 Subject: dba321b: #i110942# use default if key columsn are unknown --- dbaccess/source/core/api/KeySet.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 581af61c8..f277179f8 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -367,15 +367,17 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::O } Sequence< ::rtl::OUString> aBestColumnNames; - if ( aBestRowColumnNames.empty() ) + if ( !aBestRowColumnNames.empty() ) { - if ( xKeyColumns.is() ) - aBestColumnNames = xKeyColumns->getElementNames(); - } - else aBestColumnNames = Sequence< ::rtl::OUString>(&aBestRowColumnNames[0],aBestRowColumnNames.size()); - - ::dbaccess::getColumnPositions(xSup->getColumns(),aBestColumnNames,m_sUpdateTableName,(*m_pKeyColumnNames)); + ::dbaccess::getColumnPositions(xSup->getColumns(),aBestColumnNames,m_sUpdateTableName,(*m_pKeyColumnNames)); + } + + if (m_pKeyColumnNames->empty() && xKeyColumns.is()) + { + aBestColumnNames = xKeyColumns->getElementNames(); + ::dbaccess::getColumnPositions(xSup->getColumns(),aBestColumnNames,m_sUpdateTableName,(*m_pKeyColumnNames)); + } ::dbaccess::getColumnPositions(xSup->getColumns(),xSourceColumns->getElementNames(),m_sUpdateTableName,(*m_pColumnNames)); ::dbaccess::getColumnPositions(xSup->getColumns(),aParameterColumns,m_sUpdateTableName,(*m_pParameterNames)); -- cgit v1.2.3