diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-16 13:55:24 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-16 13:55:24 +0200 |
commit | b6693080a17418cf79b55f77add3bf7a84f00060 (patch) | |
tree | 2f2609e3549481a37d47fbf869224be6e0642b34 /dbaccess/source/ui/misc | |
parent | 52cc8fded55d1761c6913a3704a03a7c137a7f3d (diff) | |
parent | fd8c2dd9780e8b3f4e9d26783f477452ff62a17c (diff) |
dba33f: merge with m76-branch
Diffstat (limited to 'dbaccess/source/ui/misc')
-rw-r--r-- | dbaccess/source/ui/misc/TableCopyHelper.cxx | 122 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/TokenWriter.cxx | 89 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/UITools.cxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/WCopyTable.cxx | 20 |
4 files changed, 112 insertions, 120 deletions
diff --git a/dbaccess/source/ui/misc/TableCopyHelper.cxx b/dbaccess/source/ui/misc/TableCopyHelper.cxx index 44cc71b31c57..cd03b3dab803 100644 --- a/dbaccess/source/ui/misc/TableCopyHelper.cxx +++ b/dbaccess/source/ui/misc/TableCopyHelper.cxx @@ -160,21 +160,15 @@ using namespace ::com::sun::star::ucb; OTableCopyHelper::OTableCopyHelper(OGenericUnoController* _pControler) :m_pController(_pControler) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OTableCopyHelper::OTableCopyHelper" ); } // ----------------------------------------------------------------------------- -void OTableCopyHelper::insertTable(sal_Int32 _nCommandType - ,const Reference<XConnection>& _xSrcConnection - ,const Sequence< Any >& _aSelection - ,sal_Bool _bBookmarkSelection - ,const ::rtl::OUString& _sCommand - ,const ::rtl::OUString& _sSrcDataSourceName - ,const ::rtl::OUString& _sDestDataSourceName - ,const Reference<XConnection>& _xDestConnection) +void OTableCopyHelper::insertTable( const ::rtl::OUString& i_rSourceDataSource, const Reference<XConnection>& i_rSourceConnection, + const ::rtl::OUString& i_rCommand, const sal_Int32 i_nCommandType, + const Reference< XResultSet >& i_rSourceRows, const Sequence< Any >& i_rSelection, const sal_Bool i_bBookmarkSelection, + const ::rtl::OUString& i_rDestDataSource, const Reference<XConnection>& i_rDestConnection) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OTableCopyHelper::insertTable" ); - if ( CommandType::QUERY != _nCommandType && CommandType::TABLE != _nCommandType ) + if ( CommandType::QUERY != i_nCommandType && CommandType::TABLE != i_nCommandType ) { DBG_ERROR( "OTableCopyHelper::insertTable: invalid call (no supported format found)!" ); return; @@ -182,11 +176,11 @@ void OTableCopyHelper::insertTable(sal_Int32 _nCommandType try { - Reference<XConnection> xSrcConnection( _xSrcConnection ); - if ( _sSrcDataSourceName == _sDestDataSourceName ) - xSrcConnection = _xDestConnection; + Reference<XConnection> xSrcConnection( i_rSourceConnection ); + if ( i_rSourceDataSource == i_rDestDataSource ) + xSrcConnection = i_rDestConnection; - if ( !xSrcConnection.is() || !_xDestConnection.is() ) + if ( !xSrcConnection.is() || !i_rDestConnection.is() ) { OSL_ENSURE( false, "OTableCopyHelper::insertTable: no connection/s!" ); return; @@ -197,14 +191,15 @@ void OTableCopyHelper::insertTable(sal_Int32 _nCommandType Reference< XDataAccessDescriptorFactory > xFactory( DataAccessDescriptorFactory::get( aContext.getUNOContext() ) ); Reference< XPropertySet > xSource( xFactory->createDataAccessDescriptor(), UNO_SET_THROW ); - xSource->setPropertyValue( PROPERTY_COMMAND_TYPE, makeAny( _nCommandType ) ); - xSource->setPropertyValue( PROPERTY_COMMAND, makeAny( _sCommand ) ); + xSource->setPropertyValue( PROPERTY_COMMAND_TYPE, makeAny( i_nCommandType ) ); + xSource->setPropertyValue( PROPERTY_COMMAND, makeAny( i_rCommand ) ); xSource->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( xSrcConnection ) ); - xSource->setPropertyValue( PROPERTY_SELECTION, makeAny( _aSelection ) ); - xSource->setPropertyValue( PROPERTY_BOOKMARK_SELECTION, makeAny( _bBookmarkSelection ) ); + xSource->setPropertyValue( PROPERTY_RESULT_SET, makeAny( i_rSourceRows ) ); + xSource->setPropertyValue( PROPERTY_SELECTION, makeAny( i_rSelection ) ); + xSource->setPropertyValue( PROPERTY_BOOKMARK_SELECTION, makeAny( i_bBookmarkSelection ) ); Reference< XPropertySet > xDest( xFactory->createDataAccessDescriptor(), UNO_SET_THROW ); - xDest->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( _xDestConnection ) ); + xDest->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( i_rDestConnection ) ); Reference< XCopyTableWizard > xWizard( CopyTableWizard::create( aContext.getUNOContext(), xSource, xDest ), UNO_SET_THROW ); @@ -227,72 +222,62 @@ void OTableCopyHelper::insertTable(sal_Int32 _nCommandType } // ----------------------------------------------------------------------------- -void OTableCopyHelper::pasteTable( const ::svx::ODataAccessDescriptor& _rPasteData, const ::rtl::OUString& _sDestDataSourceName, - const SharedConnection& _xDestConnection ) +void OTableCopyHelper::pasteTable( const ::svx::ODataAccessDescriptor& _rPasteData, const ::rtl::OUString& i_rDestDataSourceName, + const SharedConnection& i_rDestConnection ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OTableCopyHelper::pasteTable" ); - Reference<XConnection> xSrcConnection; - ::rtl::OUString sCommand, - sSrcDataSourceName = _rPasteData.getDataSource(); + ::rtl::OUString sSrcDataSourceName = _rPasteData.getDataSource(); + + ::rtl::OUString sCommand; + _rPasteData[ daCommand ] >>= sCommand; - _rPasteData[daCommand] >>= sCommand; + Reference<XConnection> xSrcConnection; if ( _rPasteData.has(daConnection) ) - _rPasteData[daConnection] >>= xSrcConnection; -#if OSL_DEBUG_LEVEL > 0 + { + OSL_VERIFY( _rPasteData[daConnection] >>= xSrcConnection ); + } + + Reference< XResultSet > xResultSet; if ( _rPasteData.has(daCursor) ) { - Reference< XResultSet > xSrcRs; - _rPasteData[daCursor] >>= xSrcRs; - OSL_ENSURE( !xSrcRs.is(), "OTableCopyHelper::pasteTable: source result set not supported anymore!" ); - // There was a time where we supported passing a result set as shortcut to the source - // object. That is, we do not need to create an own result set we already have one. - // Since we UNOized the Copy Table Wizard (#i81658#), we removed this support, since it - // contradicted the semantics of DataAccessDescriptor.ResultSet. - // - // This shouldn't be a problem, since there seems to be no client which actually - // passed a result set here. - // However, if there still is, we probably need to introduce an (undocumented?) property - // at the DataAccessDescriptor, which takes this "source result set". + OSL_VERIFY( _rPasteData[ daCursor ] >>= xResultSet ); } - if ( _rPasteData.has( daSelection ) || _rPasteData.has( daBookmarkSelection ) ) + Sequence< Any > aSelection; + if ( _rPasteData.has( daSelection ) ) { - OSL_ENSURE( false, "OTableCopyHelper::pasteTable: bookmark/selection not supported anymore!" ); - // similar notes here: Selection and BookmarkSelection are not supported in the UNOized - // copy table wizard anymore (it doesn't make sense without support for a source result set), - // and there seem to be no clients which actually use it. So, instead of implementing an - // unused case, we dropped this here. + OSL_VERIFY( _rPasteData[ daSelection ] >>= aSelection ); + OSL_ENSURE( _rPasteData.has( daBookmarkSelection ), "OTableCopyHelper::pasteTable: you should specify BookmarkSelection, too, to be on the safe side!" ); } -#endif - // paste into the tables + + sal_Bool bBookmarkSelection( sal_True ); + if ( _rPasteData.has( daBookmarkSelection ) ) + { + OSL_VERIFY( _rPasteData[ daBookmarkSelection ] >>= bBookmarkSelection ); + } + OSL_ENSURE( bBookmarkSelection, "OTableCopyHelper::pasteTable: working with selection-indicies (instead of bookmarks) is error-prone, and thus deprecated!" ); + sal_Int32 nCommandType = CommandType::COMMAND; if ( _rPasteData.has(daCommandType) ) _rPasteData[daCommandType] >>= nCommandType; - insertTable( nCommandType - ,xSrcConnection - ,Sequence< Any >() - ,sal_False - ,sCommand - ,sSrcDataSourceName - ,_sDestDataSourceName - ,_xDestConnection); + insertTable( sSrcDataSourceName, xSrcConnection, sCommand, nCommandType, + xResultSet, aSelection, bBookmarkSelection, + i_rDestDataSourceName, i_rDestConnection ); } // ----------------------------------------------------------------------------- void OTableCopyHelper::pasteTable( SotFormatStringId _nFormatId ,const TransferableDataHelper& _rTransData - ,const ::rtl::OUString& _sDestDataSourceName + ,const ::rtl::OUString& i_rDestDataSource ,const SharedConnection& _xConnection) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OTableCopyHelper::pasteTable" ); if ( _nFormatId == SOT_FORMATSTR_ID_DBACCESS_TABLE || _nFormatId == SOT_FORMATSTR_ID_DBACCESS_QUERY ) { if ( ODataAccessObjectTransferable::canExtractObjectDescriptor(_rTransData.GetDataFlavorExVector()) ) { ::svx::ODataAccessDescriptor aPasteData = ODataAccessObjectTransferable::extractObjectDescriptor(_rTransData); - pasteTable( aPasteData,_sDestDataSourceName,_xConnection); + pasteTable( aPasteData,i_rDestDataSource,_xConnection); } } else if ( _rTransData.HasFormat(_nFormatId) ) @@ -326,22 +311,20 @@ void OTableCopyHelper::pasteTable( SotFormatStringId _nFormatId // ----------------------------------------------------------------------------- void OTableCopyHelper::pasteTable( const TransferableDataHelper& _rTransData - ,const ::rtl::OUString& _sDestDataSourceName + ,const ::rtl::OUString& i_rDestDataSource ,const SharedConnection& _xConnection) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OTableCopyHelper::pasteTable" ); if ( _rTransData.HasFormat(SOT_FORMATSTR_ID_DBACCESS_TABLE) || _rTransData.HasFormat(SOT_FORMATSTR_ID_DBACCESS_QUERY) ) - pasteTable( SOT_FORMATSTR_ID_DBACCESS_TABLE,_rTransData,_sDestDataSourceName,_xConnection); + pasteTable( SOT_FORMATSTR_ID_DBACCESS_TABLE,_rTransData,i_rDestDataSource,_xConnection); else if ( _rTransData.HasFormat(SOT_FORMATSTR_ID_HTML) ) - pasteTable( SOT_FORMATSTR_ID_HTML,_rTransData,_sDestDataSourceName,_xConnection); + pasteTable( SOT_FORMATSTR_ID_HTML,_rTransData,i_rDestDataSource,_xConnection); else if ( _rTransData.HasFormat(SOT_FORMAT_RTF) ) - pasteTable( SOT_FORMAT_RTF,_rTransData,_sDestDataSourceName,_xConnection); + pasteTable( SOT_FORMAT_RTF,_rTransData,i_rDestDataSource,_xConnection); } // ----------------------------------------------------------------------------- sal_Bool OTableCopyHelper::copyTagTable(OTableCopyHelper::DropDescriptor& _rDesc, sal_Bool _bCheck,const SharedConnection& _xConnection) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OTableCopyHelper::copyTagTable" ); Reference<XEventListener> xEvt; ODatabaseImportExport* pImport = NULL; if ( _rDesc.bHtml ) @@ -364,7 +347,6 @@ sal_Bool OTableCopyHelper::copyTagTable(OTableCopyHelper::DropDescriptor& _rDesc // ----------------------------------------------------------------------------- sal_Bool OTableCopyHelper::isTableFormat(const TransferableDataHelper& _rClipboard) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OTableCopyHelper::isTableFormat" ); sal_Bool bTableFormat = _rClipboard.HasFormat(SOT_FORMATSTR_ID_DBACCESS_TABLE) || _rClipboard.HasFormat(SOT_FORMATSTR_ID_DBACCESS_QUERY) || _rClipboard.HasFormat(SOT_FORMAT_RTF) @@ -377,7 +359,6 @@ sal_Bool OTableCopyHelper::copyTagTable(const TransferableDataHelper& _aDroppedD ,DropDescriptor& _rAsyncDrop ,const SharedConnection& _xConnection) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OTableCopyHelper::copyTagTable" ); sal_Bool bRet = sal_False; sal_Bool bHtml = _aDroppedData.HasFormat(SOT_FORMATSTR_ID_HTML); if ( bHtml || _aDroppedData.HasFormat(SOT_FORMAT_RTF) ) @@ -410,10 +391,9 @@ sal_Bool OTableCopyHelper::copyTagTable(const TransferableDataHelper& _aDroppedD } // ----------------------------------------------------------------------------- void OTableCopyHelper::asyncCopyTagTable( DropDescriptor& _rDesc - ,const ::rtl::OUString& _sDestDataSourceName + ,const ::rtl::OUString& i_rDestDataSource ,const SharedConnection& _xConnection) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OTableCopyHelper::asyncCopyTagTable" ); if ( _rDesc.aHtmlRtfStorage.Is() ) { copyTagTable(_rDesc,sal_False,_xConnection); @@ -424,7 +404,7 @@ void OTableCopyHelper::asyncCopyTagTable( DropDescriptor& _rDesc ::utl::UCBContentHelper::Kill(aURL.GetMainURL(INetURLObject::NO_DECODE)); } else if ( !_rDesc.bError ) - pasteTable(_rDesc.aDroppedData,_sDestDataSourceName,_xConnection); + pasteTable(_rDesc.aDroppedData,i_rDestDataSource,_xConnection); else m_pController->showError(SQLException(String(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE)),*m_pController,::rtl::OUString::createFromAscii("S1000") ,0,Any())); } diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index 0e949c975065..7c41a0fbfa04 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -100,7 +100,8 @@ ODatabaseImportExport::ODatabaseImportExport(const ::svx::ODataAccessDescriptor& const Reference< XMultiServiceFactory >& _rM, const Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, const String& rExchange) - :m_xFormatter(_rxNumberF) + :m_bBookmarkSelection( NULL ) + ,m_xFormatter(_rxNumberF) ,m_xFactory(_rM) ,m_nCommandType(CommandType::TABLE) ,m_bNeedToReInitialize(sal_False) @@ -130,7 +131,8 @@ ODatabaseImportExport::ODatabaseImportExport(const ::svx::ODataAccessDescriptor& // import data ODatabaseImportExport::ODatabaseImportExport( const ::dbtools::SharedConnection& _rxConnection, const Reference< XNumberFormatter >& _rxNumberF, const Reference< XMultiServiceFactory >& _rM ) - :m_xConnection(_rxConnection) + :m_bBookmarkSelection( NULL ) + ,m_xConnection(_rxConnection) ,m_xFormatter(_rxNumberF) ,m_xFactory(_rM) ,m_nCommandType(::com::sun::star::sdb::CommandType::TABLE) @@ -184,6 +186,7 @@ void ODatabaseImportExport::dispose() m_xResultSetMetaData.clear(); m_xResultSet.clear(); m_xRow.clear(); + m_xRowLocate.clear(); m_xFormatter.clear(); } // ----------------------------------------------------------------------------- @@ -228,20 +231,37 @@ void ODatabaseImportExport::impl_initFromDescriptor( const ODataAccessDescriptor if (xComponent.is() && xEvt.is()) xComponent->addEventListener(xEvt); } - if(_aDataDescriptor.has(daSelection)) - _aDataDescriptor[daSelection] >>= m_aSelection; - sal_Bool bBookmarkSelection = sal_True; // the default if not present + if ( _aDataDescriptor.has( daSelection ) ) + _aDataDescriptor[ daSelection ] >>= m_aSelection; + if ( _aDataDescriptor.has( daBookmarkSelection ) ) + _aDataDescriptor[ daBookmarkSelection ] >>= m_bBookmarkSelection; + + if ( _aDataDescriptor.has( daCursor ) ) { - _aDataDescriptor[ daBookmarkSelection ] >>= bBookmarkSelection; - DBG_ASSERT( !bBookmarkSelection, "ODatabaseImportExport::ODatabaseImportExport: bookmarked selection not yet supported!" ); + _aDataDescriptor[ daCursor ] >>= m_xResultSet; + m_xRowLocate.set( m_xResultSet, UNO_QUERY ); } + if ( m_aSelection.getLength() != 0 ) + { + if ( !m_xResultSet.is() ) + { + OSL_ENSURE( false, "ODatabaseImportExport::impl_initFromDescriptor: selection without result set is nonsense!" ); + m_aSelection.realloc( 0 ); + } + } - if(_aDataDescriptor.has(daCursor)) - _aDataDescriptor[daCursor] >>= m_xResultSet; - } // if ( !_bPlusDefaultInit ) + if ( m_aSelection.getLength() != 0 ) + { + if ( m_bBookmarkSelection && !m_xRowLocate.is() ) + { + OSL_ENSURE( false, "ODatabaseImportExport::impl_initFromDescriptor: no XRowLocate -> no bookmars!" ); + m_aSelection.realloc( 0 ); + } + } + } else initialize(); @@ -311,19 +331,14 @@ void ODatabaseImportExport::initialize() // the result set may be already set with the datadescriptor if ( !m_xResultSet.is() ) { - m_xResultSet.set(m_xFactory->createInstance(::rtl::OUString::createFromAscii("com.sun.star.sdb.RowSet")),UNO_QUERY); - Reference<XPropertySet > xProp(m_xResultSet,UNO_QUERY); - if(xProp.is()) - { - xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( m_xConnection.getTyped() ) ); - xProp->setPropertyValue(PROPERTY_COMMAND_TYPE,makeAny(m_nCommandType)); - xProp->setPropertyValue(PROPERTY_COMMAND,makeAny(m_sName)); - Reference<XRowSet> xRowSet(xProp,UNO_QUERY); - xRowSet->execute(); - } - else - OSL_ENSURE(sal_False, "ODatabaseImportExport::initialize: could not instantiate a rowset!"); - } // if ( !m_xResultSet.is() ) + m_xResultSet.set( m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.sdb.RowSet" ) ), UNO_QUERY ); + Reference< XPropertySet > xProp( m_xResultSet, UNO_QUERY_THROW ); + xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( m_xConnection.getTyped() ) ); + xProp->setPropertyValue( PROPERTY_COMMAND_TYPE, makeAny( m_nCommandType ) ); + xProp->setPropertyValue( PROPERTY_COMMAND, makeAny( m_sName ) ); + Reference< XRowSet > xRowSet( xProp, UNO_QUERY ); + xRowSet->execute(); + } impl_initializeRowMember_throw(); } catch(Exception& ) @@ -372,7 +387,8 @@ void ODatabaseImportExport::impl_initializeRowMember_throw() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "ODatabaseImportExport::impl_initializeRowMember_throw" ); if ( !m_xRow.is() && m_xResultSet.is() ) { - m_xRow.set(m_xResultSet,UNO_QUERY); + m_xRow.set( m_xResultSet, UNO_QUERY ); + m_xRowLocate.set( m_xResultSet, UNO_QUERY ); m_xResultSetMetaData = Reference<XResultSetMetaDataSupplier>(m_xRow,UNO_QUERY)->getMetaData(); Reference<XColumnsSupplier> xSup(m_xResultSet,UNO_QUERY_THROW); m_xRowSetColumns.set(xSup->getColumns(),UNO_QUERY_THROW); @@ -567,22 +583,29 @@ BOOL ORTFImportExport::Write() Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY); sal_Int32 k=1; sal_Int32 kk=0; - if(m_aSelection.getLength()) + if ( m_aSelection.getLength() ) { const Any* pSelIter = m_aSelection.getConstArray(); const Any* pEnd = pSelIter + m_aSelection.getLength(); + sal_Bool bContinue = sal_True; - for(;pSelIter != pEnd && bContinue;++pSelIter) + for( ; pSelIter != pEnd && bContinue; ++pSelIter ) { - sal_Int32 nPos = -1; - *pSelIter >>= nPos; - OSL_ENSURE(nPos != -1,"Invalid posiotion!"); - bContinue = (m_xResultSet->absolute(nPos)); - if ( bContinue ) - appendRow(pHorzChar,nCount,k,kk); + if ( m_bBookmarkSelection ) + { + bContinue = m_xRowLocate->moveToBookmark( *pSelIter ); + } + else + { + sal_Int32 nPos = -1; + OSL_VERIFY( *pSelIter >>= nPos ); + bContinue = ( m_xResultSet->absolute( nPos ) ); + } + if ( bContinue ) + appendRow( pHorzChar, nCount, k, kk ); } - } // if(m_aSelection.getLength()) + } else { m_xResultSet->beforeFirst(); // set back before the first row diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 930dd089951a..142da37eb892 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -889,6 +889,7 @@ void setColumnProperties(const Reference<XPropertySet>& _rxColumn,const OFieldDe _rxColumn->setPropertyValue(PROPERTY_SCALE,makeAny(_pFieldDesc->GetScale())); _rxColumn->setPropertyValue(PROPERTY_ISNULLABLE, makeAny(_pFieldDesc->GetIsNullable())); _rxColumn->setPropertyValue(PROPERTY_ISAUTOINCREMENT,::cppu::bool2any(_pFieldDesc->IsAutoIncrement())); + _rxColumn->setPropertyValue(PROPERTY_DESCRIPTION,makeAny(_pFieldDesc->GetDescription())); if ( _rxColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_ISCURRENCY) && _pFieldDesc->IsCurrency() ) _rxColumn->setPropertyValue(PROPERTY_ISCURRENCY,::cppu::bool2any(_pFieldDesc->IsCurrency())); // set autoincrement value when available diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 5670ff86b60e..48258db321cc 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -230,22 +230,10 @@ Sequence< ::rtl::OUString > ObjectCopySource::getColumnNames() const //------------------------------------------------------------------------ Sequence< ::rtl::OUString > ObjectCopySource::getPrimaryKeyColumnNames() const { - 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?!" ); - - Reference< XNameAccess > xKeyCols; - if ( !aPrimaryKeyColumns.empty() ) - xKeyCols = aPrimaryKeyColumns[0]; - + const Reference<XNameAccess> xPrimaryKeyColumns = getPrimaryKeyColumns_throw(m_xObject); Sequence< ::rtl::OUString > aKeyColNames; - if ( xKeyCols.is() ) - aKeyColNames = xKeyCols->getElementNames(); + if ( xPrimaryKeyColumns.is() ) + aKeyColNames = xPrimaryKeyColumns->getElementNames(); return aKeyColNames; } @@ -368,7 +356,7 @@ void NamedTableCopySource::impl_ensureColumnInfo_throw() OFieldDescription aDesc; aDesc.SetName( xStatementMeta->getColumnName( i ) ); - aDesc.SetDescription( xStatementMeta->getColumnLabel( i ) ); + aDesc.SetHelpText( xStatementMeta->getColumnLabel( i ) ); aDesc.SetTypeValue( xStatementMeta->getColumnType( i ) ); aDesc.SetTypeName( xStatementMeta->getColumnTypeName( i ) ); aDesc.SetPrecision( xStatementMeta->getPrecision( i ) ); |