User: rt Date: 2008-06-06 14:11:50+0000 Modified: dba/dbaccess/source/ui/misc/WCopyTable.cxx
Log: INTEGRATION: CWS dba30c (1.56.16); FILE MERGED 2008/05/05 11:13:37 oj 1.56.16.3: #i87131# collect keys only once, getKeys always refetch keys 2008/04/16 06:51:41 fs 1.56.16.2: RESYNC: (1.56-1.57); FILE MERGED 2008/04/02 13:40:36 fs 1.56.16.1: #i86957# better handling for empty/colliding PK names File Changes: Directory: /dba/dbaccess/source/ui/misc/ ======================================== File [changed]: WCopyTable.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/WCopyTable.cxx?r1=1.57&r2=1.58 Delta lines: +11 -2 -------------------- --- WCopyTable.cxx 2008-04-10 16:01:41+0000 1.57 +++ WCopyTable.cxx 2008-06-06 14:11:47+0000 1.58 @@ -225,7 +225,12 @@ //------------------------------------------------------------------------ Sequence< ::rtl::OUString > ObjectCopySource::getPrimaryKeyColumnNames() const { - ::std::vector< Reference< XNameAccess > > aPrimaryKeyColumns( ::dbaui::getKeyColumns( m_xObject, KeyType::PRIMARY ) ); + Reference<XKeysSupplier> xSup(m_xObject,UNO_QUERY); + Reference< XIndexAccess> xKeys; + if(xSup.is() ) + xKeys = xSup->getKeys(); + + ::std::vector< Reference< XNameAccess > > aPrimaryKeyColumns( ::dbaui::getKeyColumns( xKeys, KeyType::PRIMARY ) ); OSL_ENSURE( ( aPrimaryKeyColumns.size() == 1 ) || aPrimaryKeyColumns.empty(), "ObjectCopySource::getPrimaryKeyColumnNames: more than one primary key?!" ); @@ -920,6 +925,9 @@ OCopyTable* pPage = static_cast<OCopyTable*>(GetPage(0)); m_bCreatePrimaryKeyColumn = sal_True; m_aKeyName = pPage->GetKeyName(); + if ( !m_aKeyName.getLength() ) + m_aKeyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ID" ) ); + m_aKeyName = createUniqueName( m_aKeyName ); sal_Int32 nBreakPos2 = 0; CheckColumns(nBreakPos2); break; @@ -958,6 +966,7 @@ void OCopyTableWizard::setCreatePrimaryKey( bool _bDoCreate, const ::rtl::OUString& _rSuggestedName ) { m_bCreatePrimaryKeyColumn = _bDoCreate; + if ( _rSuggestedName.getLength() ) m_aKeyName = _rSuggestedName; OCopyTable* pSettingsPage = dynamic_cast< OCopyTable* >( GetPage( 0 ) ); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
