summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2010-03-24 10:16:28 +0000
committerOcke Janssen <oj@openoffice.org>2010-03-24 10:16:28 +0000
commit3e2140dbcb05fe8b7b1268be084f4de8289ac1ca (patch)
tree6293c15523cd46b7d809bb15c6d76555d8238718 /dbaccess
parentb43e45fb6acd061cba855a158afa2f60983dbd9a (diff)
#i109549# cache row values when a filter value which is not part of the key values
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/api/KeySet.cxx11
-rw-r--r--dbaccess/source/core/api/KeySet.hxx3
2 files changed, 13 insertions, 1 deletions
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index 3ea3c318e360..e3938cb43da8 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -602,13 +602,24 @@ void SAL_CALL OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow
i = 1;
// first the set values
+ bool bRefetch = true;
aIter = m_pColumnNames->begin();
sal_uInt16 j = 0;
+ Reference<XRow> xRow;
for(;aIter != aEnd;++aIter,++j)
{
sal_Int32 nPos = aIter->second.nPosition;
if((_rInsertRow->get())[nPos].isModified())
{
+ if ( bRefetch )
+ {
+ bRefetch = ::std::find(m_aFilterColumns.begin(),m_aFilterColumns.end(),aIter->first) == m_aFilterColumns.end();
+ if ( !bRefetch )
+ {
+ xRow = new OPrivateRow(_rInsertRow->get());
+ }
+ }
+
impl_convertValue_throw(_rInsertRow,aIter->second);
(_rInsertRow->get())[nPos].setSigned((_rOrginalRow->get())[nPos].isSigned());
setParameter(i++,xParameter,(_rInsertRow->get())[nPos],aIter->second.nType,aIter->second.nScale);
diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx
index 98332fd03338..a09af9359078 100644
--- a/dbaccess/source/core/api/KeySet.hxx
+++ b/dbaccess/source/core/api/KeySet.hxx
@@ -88,7 +88,7 @@ namespace dbaccess
const ::rtl::OUString& _rsUpdateTableName,
SelectColumnsMetaData& _rColumnAssignments /* out */);
- typedef ::std::pair<ORowSetRow,sal_Int32> OKeySetValue;
+ typedef ::std::pair<ORowSetRow,::std::pair<sal_Int32,::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow> > > OKeySetValue;
typedef ::std::map<sal_Int32,OKeySetValue > OKeySetMatrix;
typedef ::std::map<sal_Int32,ORowSetValueVector > OUpdatedParameter;
// is used when the source supports keys
@@ -113,6 +113,7 @@ namespace dbaccess
::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer > m_xComposer;
::rtl::OUString m_sUpdateTableName;
::rtl::OUString m_aSelectComposedTableName;
+ ::std::vector< ::rtl::OUString > m_aFilterColumns;
sal_Bool m_bRowCountFinal;