User: vg      
Date: 05/03/10 07:21:06

Modified:
 /dba/connectivity/source/drivers/adabas/
  BKeys.cxx

Log:
 INTEGRATION: CWS dba24 (1.18.52); FILE MERGED
 2005/02/09 08:07:37 oj 1.18.52.1: #i26950# remove the need for XNamed

File Changes:

Directory: /dba/connectivity/source/drivers/adabas/
===================================================

File [changed]: BKeys.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/adabas/BKeys.cxx?r1=1.18&r2=1.19
Delta lines:  +12 -18
---------------------
--- BKeys.cxx   2 Aug 2004 16:56:04 -0000       1.18
+++ BKeys.cxx   10 Mar 2005 15:21:03 -0000      1.19
@@ -92,7 +92,7 @@
 
 
 using namespace ::comphelper;
-
+using namespace connectivity;
 using namespace connectivity::adabas;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::beans;
@@ -103,9 +103,9 @@
 typedef connectivity::sdbcx::OCollection OCollection_TYPE;
 
 // -------------------------------------------------------------------------
-Reference< XNamed > OKeys::createObject(const ::rtl::OUString& _rName)
+sdbcx::ObjectType OKeys::createObject(const ::rtl::OUString& _rName)
 {
-       Reference< XNamed > xRet = NULL;
+       sdbcx::ObjectType xRet = NULL;
 
        if(_rName.getLength())
        {
@@ -141,10 +141,7 @@
                }
        }
        else
-       {
-               OAdabasKey* pRet = new 
OAdabasKey(m_pTable,_rName,::rtl::OUString(),KeyType::PRIMARY,KeyRule::NO_ACTION,KeyRule::NO_ACTION);
-               xRet = pRet;
-       }
+               xRet = new 
OAdabasKey(m_pTable,_rName,::rtl::OUString(),KeyType::PRIMARY,KeyRule::NO_ACTION,KeyRule::NO_ACTION);
 
        return xRet;
 }
@@ -218,16 +215,16 @@
                        switch(nDeleteRule)
                        {
                                case KeyRule::CASCADE:
-                                       aSql = aSql + 
::rtl::OUString::createFromAscii(" ON DELETE CASCADE ");
+                                       aSql += 
::rtl::OUString::createFromAscii(" ON DELETE CASCADE ");
                                        break;
                                case KeyRule::RESTRICT:
-                                       aSql = aSql + 
::rtl::OUString::createFromAscii(" ON DELETE RESTRICT ");
+                                       aSql += 
::rtl::OUString::createFromAscii(" ON DELETE RESTRICT ");
                                        break;
                                case KeyRule::SET_NULL:
-                                       aSql = aSql + 
::rtl::OUString::createFromAscii(" ON DELETE SET NULL ");
+                                       aSql += 
::rtl::OUString::createFromAscii(" ON DELETE SET NULL ");
                                        break;
                                case KeyRule::SET_DEFAULT:
-                                       aSql = aSql + 
::rtl::OUString::createFromAscii(" ON DELETE SET DEFAULT ");
+                                       aSql += 
::rtl::OUString::createFromAscii(" ON DELETE SET DEFAULT ");
                                        break;
                                default:
                                        ;
@@ -292,21 +289,18 @@
        }
 }
 // 
-----------------------------------------------------------------------------
-Reference< XNamed > OKeys::cloneObject(const Reference< XPropertySet >& 
_xDescriptor)
+sdbcx::ObjectType OKeys::cloneObject(const Reference< XPropertySet >& 
_xDescriptor)
 {
-       Reference< XNamed > xName;
+       sdbcx::ObjectType xName;
        if(!m_pTable->isNew())
        {
-               xName = Reference< XNamed >(_xDescriptor,UNO_QUERY);            
-               OSL_ENSURE(xName.is(),"Must be a XName interface here !");
-               xName = xName.is() ? createObject(xName->getName()) : 
Reference< XNamed >();
+               xName = OCollection_TYPE::cloneObject(_xDescriptor);
        }
        else
        {
                OAdabasKey* pKey = new OAdabasKey(m_pTable);
                xName = pKey;
-               Reference<XPropertySet> xProp = pKey;
-               ::comphelper::copyProperties(_xDescriptor,xProp);
+               ::comphelper::copyProperties(_xDescriptor,xName);
                Reference<XColumnsSupplier> xSup(_xDescriptor,UNO_QUERY);
                Reference<XIndexAccess> xIndex(xSup->getColumns(),UNO_QUERY);
                Reference<XAppend> xAppend(pKey->getColumns(),UNO_QUERY);




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

Reply via email to