summaryrefslogtreecommitdiff
path: root/dbaccess/source/core/api/RowSetCache.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/core/api/RowSetCache.cxx')
-rw-r--r--dbaccess/source/core/api/RowSetCache.cxx26
1 files changed, 17 insertions, 9 deletions
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index 295e29ebe..d42c8d20f 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -158,17 +158,25 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
try
{
Reference< XResultSetUpdate> xUp(_xRs,UNO_QUERY_THROW);
- xUp->moveToInsertRow();
- xUp->cancelRowUpdates();
- _xRs->beforeFirst();
- m_nPrivileges = Privilege::SELECT|Privilege::DELETE|Privilege::INSERT|Privilege::UPDATE;
- m_pCacheSet = new WrappedResultSet();
- m_xCacheSet = m_pCacheSet;
- m_pCacheSet->construct(_xRs,i_sRowSetFilter);
- return;
+ Reference< XPropertySet> xProp(_xRs,UNO_QUERY);
+ Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo();
+ sal_Bool bBookmarkable = xPropInfo->hasPropertyByName(PROPERTY_ISBOOKMARKABLE) &&
+ any2bool(xProp->getPropertyValue(PROPERTY_ISBOOKMARKABLE)) && Reference< XRowLocate >(_xRs, UNO_QUERY).is();
+ if ( bBookmarkable )
+ {
+ xUp->moveToInsertRow();
+ xUp->cancelRowUpdates();
+ _xRs->beforeFirst();
+ m_nPrivileges = Privilege::SELECT|Privilege::DELETE|Privilege::INSERT|Privilege::UPDATE;
+ m_pCacheSet = new WrappedResultSet();
+ m_xCacheSet = m_pCacheSet;
+ m_pCacheSet->construct(_xRs,i_sRowSetFilter);
+ return;
+ }
}
- catch(const Exception&)
+ catch(const Exception& ex)
{
+ (void)ex;
}
_xRs->beforeFirst();