User: rt      
Date: 2008-06-06 13:59:11+0000
Modified:
   dba/dbaccess/source/core/api/RowSetCache.cxx

Log:
 INTEGRATION: CWS dba30c (1.97.8); FILE MERGED
 2008/05/05 11:09:03 oj 1.97.8.1: #i87131# collect keys only once, getKeys 
always refetch keys

File Changes:

Directory: /dba/dbaccess/source/core/api/
=========================================

File [changed]: RowSetCache.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetCache.cxx?r1=1.97&r2=1.98
Delta lines:  +7 -6
-------------------
--- RowSetCache.cxx     2008-04-10 12:26:52+0000        1.97
+++ RowSetCache.cxx     2008-06-06 13:59:08+0000        1.98
@@ -164,6 +164,7 @@
        sal_Bool bAllKeysFound = sal_False;
        sal_Int32 nTablesCount = 0;
 
+    Reference< XIndexAccess> xUpdateTableKeys;
        ::rtl::OUString aUpdateTableName = _rUpdateTableName;
        Reference< XConnection> xConnection;
        if(_xAnalyzer.is())
@@ -193,15 +194,15 @@
                                Reference<XKeysSupplier> 
xKeys(m_aUpdateTable,UNO_QUERY);
                                if(xKeys.is())
                                {
-                                       Reference< XIndexAccess> xKeyIndex = 
xKeys->getKeys();
-                                       if ( xKeyIndex.is() )
+                                       xUpdateTableKeys = xKeys->getKeys();
+                                       if ( xUpdateTableKeys.is() )
                                        {
                                                Reference<XColumnsSupplier> 
xColumnsSupplier;
                                                // search the one and only 
primary key
-                                               for(sal_Int32 i=0;i< 
xKeyIndex->getCount();++i)
+                        const sal_Int32 nCount = xUpdateTableKeys->getCount();
+                                               for(sal_Int32 i = 0 ; i < 
nCount ; ++i)
                                                {
-                                                       Reference<XPropertySet> 
xProp;
-                                                       
::cppu::extractInterface(xProp,xKeyIndex->getByIndex(i));
+                                                       Reference<XPropertySet> 
xProp(xUpdateTableKeys->getByIndex(i),UNO_QUERY);
                                                        sal_Int32 nKeyType = 0;
                                                        
xProp->getPropertyValue(PROPERTY_TYPE) >>= nKeyType;
                                                        if(KeyType::PRIMARY == 
nKeyType)
@@ -327,7 +328,7 @@
                                }
                        }
 
-                       OKeySet* pKeySet = new 
OKeySet(m_aUpdateTable,aUpdateTableName ,_xAnalyzer);
+                       OKeySet* pKeySet = new 
OKeySet(m_aUpdateTable,xUpdateTableKeys,aUpdateTableName ,_xAnalyzer);
                        try
                        {
                                m_pCacheSet = pKeySet;




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to