Tag: cws_src680_dba30
User: fs      
Date: 2006/07/19 05:10:53

Modified:
   dba/dbaccess/source/core/api/TableDeco.cxx

Log:
 RESYNC: (1.25-1.27); FILE MERGED

File Changes:

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

File [changed]: TableDeco.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/TableDeco.cxx?r1=1.25.14.1&r2=1.25.14.2
Delta lines:  +29 -14
---------------------
--- TableDeco.cxx       2 Jan 2006 09:17:08 -0000       1.25.14.1
+++ TableDeco.cxx       19 Jul 2006 12:10:50 -0000      1.25.14.2
@@ -127,15 +127,15 @@
                ) throw(SQLException)
        :OTableDescriptor_BASE(m_aMutex)
        ,ODataSettings(OTableDescriptor_BASE::rBHelper)
-       ,m_nPrivileges(-1)
-       ,m_xMetaData(_rxMetaData)
        ,m_xTable(_rxNewTable)
-       ,m_xNumberFormats( _rxNumberFormats )
        ,m_xColumnDefinitions(_xColumnDefinitions)
+       ,m_xMetaData(_rxMetaData)
+       ,m_xNumberFormats( _rxNumberFormats )
+       ,m_nPrivileges(-1)
        ,m_pColumns(NULL)
 {
        DBG_CTOR(ODBTableDecorator, NULL);
-       ODataSettings::registerProperties(this);
+       ODataSettings::registerPropertiesFor(this);
 }
 // -------------------------------------------------------------------------
 ODBTableDecorator::~ODBTableDecorator()
@@ -392,7 +392,7 @@
                                                &m_nPrivileges, 
::getCppuType(static_cast<sal_Int32*>(NULL)));
 }
 // 
-----------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* ODBTableDecorator::createArrayHelper(sal_Int32 
_nId) const
+::cppu::IPropertyArrayHelper* ODBTableDecorator::createArrayHelper(sal_Int32 
/*_nId*/) const
 {
        Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
        Reference<XPropertySetInfo> xInfo = xProp->getPropertySetInfo();
@@ -431,9 +431,19 @@
 ::cppu::IPropertyArrayHelper & SAL_CALL ODBTableDecorator::getInfoHelper() 
 {
        Reference<XPropertySet> xProp(m_xTable,UNO_QUERY);
+
        Reference<XPropertySetInfo> xInfo = xProp->getPropertySetInfo();
+    bool bIsDescriptor = (xInfo->getPropertyByName(PROPERTY_NAME).Attributes & 
PropertyAttribute::READONLY) == 0;
 
-       return 
*ODBTableDecorator_PROP::getArrayHelper((xInfo->getPropertyByName(PROPERTY_NAME).Attributes
 & PropertyAttribute::READONLY) == PropertyAttribute::READONLY ? 1 : 0);
+    return *ODBTableDecorator_PROP::getArrayHelper( bIsDescriptor ? 0 : 1 );
+
+    // TODO: this is a HACK, and prone to errors
+    // The OIdPropertyArrayUsageHelper is intended for classes where there 
exists a known, limited
+    // number of different property set infos (distinguished by the ID), all 
implemented by this very
+    // same class.
+    // However, in this case here we have an unknown, potentially unlimited 
number of different
+    // property set infos: Depending on the table for which we act as 
decorator, different property
+    // sets might exist.
 }
 // -------------------------------------------------------------------------
 // XServiceInfo
@@ -601,7 +611,7 @@
        }
        catch(const SQLException& e)
        {
-               UNUSED(e);
+        (void)e;
                DBG_ERROR("ODBTableDecorator::ODBTableDecorator : could not 
collect the privileges !");
        }
 }
@@ -690,16 +700,20 @@
        return pReturn;
 }
 // 
-----------------------------------------------------------------------------
+void ODBTableDecorator::columnAppended( const Reference< XPropertySet >& 
/*_rxSourceDescriptor*/ )
+{
+    // not interested in
+}
+// 
-----------------------------------------------------------------------------
 void ODBTableDecorator::columnDropped(const ::rtl::OUString& _sName)
 {
        Reference<XDrop> xDrop(m_xColumnDefinitions,UNO_QUERY);
        if ( xDrop.is() && m_xColumnDefinitions->hasByName(_sName) )
-       {
                xDrop->dropByName(_sName);
-       }
 }
+
 // 
-----------------------------------------------------------------------------
-Reference< XPropertySet > ODBTableDecorator::createEmptyObject()
+Reference< XPropertySet > ODBTableDecorator::createColumnDescriptor()
 {
        Reference<XDataDescriptorFactory> xNames;
        if(m_xTable.is())
@@ -721,8 +735,9 @@
 }
 
 // 
-----------------------------------------------------------------------------
-void SAL_CALL ODBTableDecorator::setName( const ::rtl::OUString& aName ) throw 
(::com::sun::star::uno::RuntimeException)
+void SAL_CALL ODBTableDecorator::setName( const ::rtl::OUString& /*aName*/ ) 
throw (::com::sun::star::uno::RuntimeException)
 {
+    throwFunctionNotSupportedException( "XNamed::setName", *this );
 }
 
 // 
-----------------------------------------------------------------------------




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

Reply via email to