User: obo     
Date: 2006/07/10 08:45:50

Modified:
   dba/dbaccess/source/ui/relationdesign/RelationController.cxx

Log:
 INTEGRATION: CWS qiq (1.42.118); FILE MERGED
 2006/06/27 12:58:43 fs 1.42.118.6: RESYNC: (1.42-1.43); FILE MERGED
 2006/06/19 10:46:22 fs 1.42.118.5: during #i51143#: describeSupportedFeatures: 
 DBAddTable is unnecessary, base class already adds (equivalent) AddTable
 2006/06/19 09:27:52 fs 1.42.118.4: during #i51143#: A FeatureState can now 
transport more than one state. In particular, it has typed bChecked and sTitle 
members, instead of the previous unchecked aState
 2006/05/24 06:49:30 fs 1.42.118.3: some refactoring of compose/quoteTableName 
and friends, in preparation of #i51143#
 2006/05/12 13:47:02 fs 1.42.118.2: #i51143# refactoring of controller 
initialization, which allows accessing the load arguments even during Construct 
(and not only in the - later - impl_initialize)
 2006/05/12 11:10:16 fs 1.42.118.1: #i51143# +allowViews/+allowQueries

File Changes:

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

File [changed]: RelationController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/relationdesign/RelationController.cxx?r1=1.43&r2=1.44
Delta lines:  +22 -22
---------------------
--- RelationController.cxx      20 Jun 2006 03:31:07 -0000      1.43
+++ RelationController.cxx      10 Jul 2006 15:45:47 -0000      1.44
@@ -221,7 +221,6 @@
        ,m_bRelationsPossible(sal_True)
 {
        DBG_CTOR(ORelationController,NULL);
-       m_bViewsAllowed = sal_False;
        InvalidateAll();
 }
 // 
-----------------------------------------------------------------------------
@@ -238,7 +237,7 @@
        {
                case SID_RELATION_ADD_RELATION:
                        aReturn.bEnabled = m_vTableData.size() > 1 && 
isConnected() && isEditable();
-                       aReturn.aState = ::cppu::bool2any(sal_False);
+                       aReturn.bChecked = false;
                        break;
                case ID_BROWSER_SAVEDOC:
                        aReturn.bEnabled = haveDataSource() && isModified();
@@ -294,25 +293,14 @@
        InvalidateFeature(_nId);
 }
 // 
-----------------------------------------------------------------------------
-void ORelationController::impl_initialize( const Sequence< Any >& aArguments )
+void ORelationController::impl_initialize()
 {
-       PropertyValue aValue;
-       const Any* pIter        = aArguments.getConstArray();
-       const Any* pEnd         = pIter + aArguments.getLength();
+    const NamedValueCollection& rArguments( getInitParams() );
 
-       for(;pIter != pEnd;++pIter)
-       {
-        if (!(*pIter >>= aValue))
-                       throw 
Exception(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid type in argument 
list. PropertyValue expected.")),*this);
-               if ( 0 == aValue.Name.compareToAscii(PROPERTY_ACTIVECONNECTION) 
)
-               {
-                       Reference< XConnection > xConn;
-            if ( !(aValue.Value >>= xConn) )
-                throw 
Exception(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid argument type 
for ActiveConnection.")),*this);
-                       initializeConnection( xConn );
-                       break;
-               }
-       }
+       Reference< XConnection > xConnection;
+    xConnection = rArguments.getOrDefault( 
(::rtl::OUString)PROPERTY_ACTIVECONNECTION, xConnection );
+       if ( xConnection.is() )
+        initializeConnection( xConnection );
 
        if ( !ensureConnected( sal_False ) )
        {
@@ -348,7 +336,7 @@
                throw SQLException();
        }
 
-       OJoinController::impl_initialize(aArguments);
+       OJoinController::impl_initialize();
 
        if(!m_bRelationsPossible)
                InvalidateAll();
@@ -416,7 +404,6 @@
 {
        OJoinController::describeSupportedFeatures();
     implDescribeSupportedFeature( ".uno:DBAddRelation", 
SID_RELATION_ADD_RELATION, CommandGroup::EDIT );
-    implDescribeSupportedFeature( ".uno:DBAddTable", ID_BROWSER_ADDTABLE, 
CommandGroup::EDIT );
 }
 // 
-----------------------------------------------------------------------------
 void ORelationController::loadData()
@@ -482,7 +469,7 @@
                                        ::rtl::OUString 
sSourceName,sReferencedTable;
                                        Reference<XPropertySet> 
xTableProp(xKeySup,UNO_QUERY);
 
-                                       sSourceName = 
::dbtools::composeTableName(getConnection()->getMetaData(),xTableProp,sal_False,::dbtools::eInTableDefinitions);
+                                       sSourceName = 
::dbtools::composeTableName( getConnection()->getMetaData(), xTableProp, 
::dbtools::eInTableDefinitions, false, false, false );
                                        
xKey->getPropertyValue(PROPERTY_REFERENCEDTABLE) >>= sReferencedTable;
                                        
//////////////////////////////////////////////////////////////////////
                                        // insert windows
@@ -593,6 +580,19 @@
                pView->Invalidate(INVALIDATE_NOERASE);
        }
 }
+
+// 
-----------------------------------------------------------------------------
+bool ORelationController::allowViews() const
+{
+    return false;
+}
+
+// 
-----------------------------------------------------------------------------
+bool ORelationController::allowQueries() const
+{
+    return false;
+}
+
 // 
-----------------------------------------------------------------------------
 
 




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

Reply via email to