summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-11-09 05:12:48 +0000
committerOcke Janssen <oj@openoffice.org>2001-11-09 05:12:48 +0000
commit07b9b825fbf9f6df847faa4f8bf2ba55dbf04562 (patch)
tree276a4039d7ff3e9f62d5bcb94d6222bc57d4ad8f
parent27ed966c388c9dd5fa50e7aa6bb8695022828b5a (diff)
#94373# create new column only when table is new
-rw-r--r--connectivity/source/drivers/dbase/DColumns.cxx24
1 files changed, 16 insertions, 8 deletions
diff --git a/connectivity/source/drivers/dbase/DColumns.cxx b/connectivity/source/drivers/dbase/DColumns.cxx
index 230147cabde4..da260a69153c 100644
--- a/connectivity/source/drivers/dbase/DColumns.cxx
+++ b/connectivity/source/drivers/dbase/DColumns.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: DColumns.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: oj $ $Date: 2001-10-12 11:46:05 $
+ * last change: $Author: oj $ $Date: 2001-11-09 06:12:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -129,12 +129,20 @@ void ODbaseColumns::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementNa
// -----------------------------------------------------------------------------
Reference< XNamed > ODbaseColumns::cloneObject(const Reference< XPropertySet >& _xDescriptor)
{
- sdbcx::OColumn* pColumn = new sdbcx::OColumn(isCaseSensitive());
- Reference<XPropertySet> xProp = pColumn;
- ::comphelper::copyProperties(_xDescriptor,xProp);
- Reference< XNamed > xName(xProp,UNO_QUERY);
- OSL_ENSURE(xName.is(),"Must be a XName interface here !");
- return xName;
+ if(m_pTable->isNew())
+ {
+ sdbcx::OColumn* pColumn = new sdbcx::OColumn(isCaseSensitive());
+ Reference<XPropertySet> xProp = pColumn;
+ ::comphelper::copyProperties(_xDescriptor,xProp);
+ Reference< XNamed > xName(xProp,UNO_QUERY);
+ OSL_ENSURE(xName.is(),"Must be a XName interface here !");
+ return xName;
+ }
+
+ ::rtl::OUString sColumnName;
+ if(_xDescriptor.is())
+ _xDescriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= sColumnName;
+ return createObject(sColumnName);
}
// -----------------------------------------------------------------------------