User: rt      
Date: 2008-06-06 14:13:49+0000
Modified:
   dba/dbaccess/source/ui/querydesign/TableWindowData.cxx

Log:
 INTEGRATION: CWS dba30c (1.13.8); FILE MERGED
 2008/05/05 11:13:38 oj 1.13.8.1: #i87131# collect keys only once, getKeys 
always refetch keys

File Changes:

Directory: /dba/dbaccess/source/ui/querydesign/
===============================================

File [changed]: TableWindowData.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/TableWindowData.cxx?r1=1.14&r2=1.15
Delta lines:  +12 -3
--------------------
--- TableWindowData.cxx 2008-04-22 15:21:01+0000        1.14
+++ TableWindowData.cxx 2008-06-06 14:13:46+0000        1.15
@@ -39,6 +39,7 @@
 #include <com/sun/star/sdb/XQueriesSupplier.hpp>
 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/container/XIndexAccess.hpp>
 
@@ -68,6 +69,7 @@
        ,m_aSize( Size(-1,-1) )
        ,m_bShowAll( TRUE )
     ,m_bIsQuery(false)
+    ,m_bIsValid(true)
 {
        DBG_CTOR(OTableWindowData,NULL);
        if( !m_aWinName.getLength() )
@@ -83,6 +85,10 @@
     Reference<XComponent> xComponent( m_xTable, UNO_QUERY );
        if ( xComponent.is() )
                stopComponentListening( xComponent );
+    // obtain the columns
+    xComponent.set( m_xColumns, UNO_QUERY );
+    if ( xComponent.is() )
+           stopComponentListening( xComponent );
 }
 
 
//------------------------------------------------------------------------------
@@ -123,9 +129,8 @@
         m_xTable.set( xQueries->getByName( m_sComposedName ), UNO_QUERY_THROW 
);
     else if ( bIsKnownTable )
         m_xTable.set( xTables->getByName( m_sComposedName ), UNO_QUERY_THROW );
-    else {
-        DBG_ERROR( "OTableWindow::Init: this is neither a query (or no queries 
are allowed) nor a table!" );
-    }
+    else
+        m_bIsValid = false;
 
     // if we survived so far, we know whether it's a query
     m_bIsQuery = bIsKnownQuery;
@@ -152,6 +157,10 @@
         xComponent.set( m_xColumns, UNO_QUERY );
            if ( xComponent.is() )
                    startComponentListening( xComponent );
+
+        Reference<XKeysSupplier> xKeySup(m_xTable,UNO_QUERY);
+           if ( xKeySup.is() )
+                   m_xKeys = xKeySup->getKeys();
     }
 }
 // 
-----------------------------------------------------------------------------




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

Reply via email to