User: rt Date: 2008-06-06 14:16:10+0000 Modified: dba/dbaccess/source/ui/tabledesign/TableController.cxx
Log: INTEGRATION: CWS dba30c (1.119.4); FILE MERGED 2008/05/09 08:24:44 oj 1.119.4.2: RESYNC: (1.119-1.120); FILE MERGED 2008/05/05 12:50:46 oj 1.119.4.1: #i87421# check if primary was already append by column append File Changes: Directory: /dba/dbaccess/source/ui/tabledesign/ =============================================== File [changed]: TableController.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/tabledesign/TableController.cxx?r1=1.120&r2=1.121 Delta lines: +14 -1 -------------------- --- TableController.cxx 2008-05-05 16:09:55+0000 1.120 +++ TableController.cxx 2008-06-06 14:16:08+0000 1.121 @@ -861,7 +861,20 @@ return; // the database doesn't support keys OSL_ENSURE(_rxSup.is(),"No XKeysSupplier!"); - Reference<XDataDescriptorFactory> xKeyFactory(_rxSup->getKeys(),UNO_QUERY); + Reference<XIndexAccess> xKeys(_rxSup->getKeys(),UNO_QUERY); + Reference<XPropertySet> xProp; + const sal_Int32 nCount = xKeys->getCount(); + for(sal_Int32 i=0;i< nCount ;++i) + { + xKeys->getByIndex(i) >>= xProp; + sal_Int32 nKeyType = 0; + xProp->getPropertyValue(PROPERTY_TYPE) >>= nKeyType; + if(KeyType::PRIMARY == nKeyType) + { + return; // primary key already exists after appending a column + } + } + Reference<XDataDescriptorFactory> xKeyFactory(xKeys,UNO_QUERY); OSL_ENSURE(xKeyFactory.is(),"No XDataDescriptorFactory Interface!"); if ( !xKeyFactory.is() ) return; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
