diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-09-09 11:45:13 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-09-09 11:45:13 +0200 |
commit | 7ff5554bceddb816903b641d274e13f121f3c75e (patch) | |
tree | 4fc3653adb51da1a3cfb6a6d122d22cf10ba7999 /dbaccess/source/ui/uno | |
parent | 419fa1df08feb265c9e777f8054ff4deca296912 (diff) | |
parent | 752941d76c608a475db454b0010a315d86bfc748 (diff) |
merge commit to DEV300_m57
Diffstat (limited to 'dbaccess/source/ui/uno')
-rw-r--r-- | dbaccess/source/ui/uno/copytablewizard.cxx | 32 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/makefile.mk | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/unoadmin.cxx | 3 |
3 files changed, 33 insertions, 10 deletions
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index 511edcd4bb07..26f859cf2045 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -171,6 +171,8 @@ namespace dbaui virtual void SAL_CALL setDestinationTableName( const ::rtl::OUString& _destinationTableName ) throw (RuntimeException); virtual Optional< ::rtl::OUString > SAL_CALL getCreatePrimaryKey() throw (RuntimeException); virtual void SAL_CALL setCreatePrimaryKey( const Optional< ::rtl::OUString >& _newPrimaryKey ) throw (IllegalArgumentException, RuntimeException); + virtual sal_Bool SAL_CALL getUseHeaderLineAsColumnNames() throw (RuntimeException); + virtual void SAL_CALL setUseHeaderLineAsColumnNames( sal_Bool _bUseHeaderLineAsColumnNames ) throw (RuntimeException); virtual void SAL_CALL addCopyTableListener( const Reference< XCopyTableListener >& Listener ) throw (RuntimeException); virtual void SAL_CALL removeCopyTableListener( const Reference< XCopyTableListener >& Listener ) throw (RuntimeException); @@ -331,6 +333,7 @@ private: sal_Int16 m_nOperation; ::rtl::OUString m_sDestinationTable; Optional< ::rtl::OUString > m_aPrimaryKeyName; + sal_Bool m_bUseHeaderLineAsColumnNames; // source SharedConnection m_xSourceConnection; @@ -381,6 +384,7 @@ CopyTableWizard::CopyTableWizard( const Reference< XMultiServiceFactory >& _rxOR ,m_nOperation( CopyTableOperation::CopyDefinitionAndData ) ,m_sDestinationTable() ,m_aPrimaryKeyName( sal_False, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ID" ) )) + ,m_bUseHeaderLineAsColumnNames( sal_True ) ,m_xSourceConnection() ,m_nCommandType( CommandType::COMMAND ) ,m_pSourceObject() @@ -522,7 +526,18 @@ void SAL_CALL CopyTableWizard::setCreatePrimaryKey( const Optional< ::rtl::OUStr m_aPrimaryKeyName = _newPrimaryKey; } - +// ----------------------------------------------------------------------------- +sal_Bool SAL_CALL CopyTableWizard::getUseHeaderLineAsColumnNames() throw (RuntimeException) +{ + CopyTableAccessGuard aGuard( *this ); + return m_bUseHeaderLineAsColumnNames; +} +// ----------------------------------------------------------------------------- +void SAL_CALL CopyTableWizard::setUseHeaderLineAsColumnNames( sal_Bool _bUseHeaderLineAsColumnNames ) throw (RuntimeException) +{ + CopyTableAccessGuard aGuard( *this ); + m_bUseHeaderLineAsColumnNames = _bUseHeaderLineAsColumnNames; +} //-------------------------------------------------------------------- void SAL_CALL CopyTableWizard::addCopyTableListener( const Reference< XCopyTableListener >& _rxListener ) throw (RuntimeException) { @@ -589,6 +604,7 @@ void CopyTableWizard::impl_attributesToDialog_nothrow( OCopyTableWizard& _rDialo RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "uno", "Ocke.Janssen@sun.com", "CopyTableWizard::impl_attributesToDialog_nothrow" ); // primary key column _rDialog.setCreatePrimaryKey( m_aPrimaryKeyName.IsPresent, m_aPrimaryKeyName.Value ); + _rDialog.setUseHeaderLine(m_bUseHeaderLineAsColumnNames); // everything else was passed at construction time already } @@ -606,6 +622,7 @@ void CopyTableWizard::impl_dialogToAttributes_nothrow( const OCopyTableWizard& _ m_sDestinationTable = _rDialog.getName(); m_nOperation = _rDialog.getOperation(); + m_bUseHeaderLineAsColumnNames = _rDialog.UseHeaderLine(); } //------------------------------------------------------------------------- @@ -1018,18 +1035,18 @@ namespace else (m_xDest.get()->*_pSetter)( m_rDestPos, value ); } - - template< typename VALUE_TYPE > + template< typename VALUE_TYPE > void transferComplexValue( VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ), void (SAL_CALL XParameters::*_pSetter)( sal_Int32, const VALUE_TYPE& ) ) { - VALUE_TYPE value( (m_xSource.get()->*_pGetter)( m_rSourcePos ) ); + const VALUE_TYPE value( (m_xSource.get()->*_pGetter)( m_rSourcePos ) ); + { if ( m_xSource->wasNull() ) m_xDest->setNull( m_rDestPos, m_rColTypes[ m_rSourcePos ] ); else (m_xDest.get()->*_pSetter)( m_rDestPos, value ); + } } - private: const sal_Int32& m_rSourcePos; const sal_Int32& m_rDestPos; @@ -1193,11 +1210,14 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou bContinue = _rxSourceResultSet->next(); if ( !bContinue ) + { break; + } ++nRowCount; sal_Bool bInsertAutoIncrement = sal_True; ODatabaseExport::TPositions::const_iterator aPosIter = aColumnMapping.begin(); + ODatabaseExport::TPositions::const_iterator aPosEnd = aColumnMapping.end(); aCopyEvent.Error.clear(); try @@ -1209,7 +1229,7 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou sal_Int32 nSourceColumn( 1 ); ValueTransfer aTransfer( nSourceColumn, nDestColumn, aSourceColTypes, xRow, xStatementParams ); - for ( ; aPosIter != aColumnMapping.end(); ++aPosIter ) + for ( ; aPosIter != aPosEnd; ++aPosIter ) { nDestColumn = aPosIter->first; if ( nDestColumn == COLUMN_POSITION_NOT_FOUND ) diff --git a/dbaccess/source/ui/uno/makefile.mk b/dbaccess/source/ui/uno/makefile.mk index 8651a83fd33a..11a1c7c5fbbd 100644 --- a/dbaccess/source/ui/uno/makefile.mk +++ b/dbaccess/source/ui/uno/makefile.mk @@ -51,8 +51,14 @@ SRC1FILES = \ copytablewizard.src # ... object files ............................ +# workaround for issue http://qa.openoffice.org/issues/show_bug.cgi?id=102305 Linux specific +.IF "$(COM)" == "GCC" +NOOPTFILES=\ + $(SLO)$/copytablewizard.obj +.ENDIF SLOFILES= \ + $(SLO)$/copytablewizard.obj \ $(SLO)$/composerdialogs.obj \ $(SLO)$/unosqlmessage.obj \ $(SLO)$/unoadmin.obj \ @@ -62,13 +68,11 @@ SLOFILES= \ $(SLO)$/unoDirectSql.obj \ $(SLO)$/DBTypeWizDlg.obj \ $(SLO)$/DBTypeWizDlgSetup.obj \ - $(SLO)$/AdabasSettingsDlg.obj \ $(SLO)$/UserSettingsDlg.obj \ $(SLO)$/ColumnModel.obj \ $(SLO)$/ColumnControl.obj \ $(SLO)$/ColumnPeer.obj \ $(SLO)$/dbinteraction.obj \ - $(SLO)$/copytablewizard.obj \ $(SLO)$/textconnectionsettings_uno.obj # --- Targets ---------------------------------- diff --git a/dbaccess/source/ui/uno/unoadmin.cxx b/dbaccess/source/ui/uno/unoadmin.cxx index 547bad4cee07..d41675c0c051 100644 --- a/dbaccess/source/ui/uno/unoadmin.cxx +++ b/dbaccess/source/ui/uno/unoadmin.cxx @@ -94,8 +94,7 @@ ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XM { DBG_CTOR(ODatabaseAdministrationDialog,NULL); - m_pCollection = new ::dbaccess::ODsnTypeCollection(); - m_pCollection->initUserDriverTypes(m_aContext.getLegacyServiceFactory()); + m_pCollection = new ::dbaccess::ODsnTypeCollection(_rxORB); ODbAdminDialog::createItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults, m_pCollection); } |