diff options
author | sb <sb@openoffice.org> | 2010-09-22 15:59:47 +0200 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-09-22 15:59:47 +0200 |
commit | 593863090b2346f0cc4a35f99c3f4bbcd2e6f71f (patch) | |
tree | 4b2e05a499e9f304bd7257fad43a157240ba34f3 | |
parent | 4361cdee3491ef0451bb159c1b00dc5e5130ad49 (diff) | |
parent | e483a7e493fa7821ce2e9b3bd6d9898dee36a8e2 (diff) |
sb123: merged in DEV300_m88
-rw-r--r-- | dbaccess/source/core/api/KeySet.cxx | 44 | ||||
-rw-r--r-- | dbaccess/source/core/api/KeySet.hxx | 1 | ||||
-rw-r--r-- | dbaccess/source/core/api/SingleSelectQueryComposer.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/documentdefinition.cxx | 17 | ||||
-rw-r--r-- | dbaccess/source/core/inc/DatabaseDataProvider.hxx | 27 | ||||
-rw-r--r-- | dbaccess/source/core/misc/DatabaseDataProvider.cxx | 95 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppController.cxx | 11 | ||||
-rw-r--r-- | dbaccess/source/ui/app/subcomponentmanager.cxx | 10 | ||||
-rw-r--r-- | dbaccess/source/ui/app/subcomponentmanager.hxx | 3 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx | 18 |
10 files changed, 185 insertions, 45 deletions
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 3de3133bc..6a7cd4087 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -201,13 +201,6 @@ void OKeySet::findTableColumnsMatching_throw(const Any& i_aTable ,const Reference<XDatabaseMetaData>& i_xMeta ,const Reference<XNameAccess>& i_xQueryColumns) { - ::rtl::OUString sCatalog,sSchema,sTable; - Reference<XPropertySet> xTableProp(i_aTable,UNO_QUERY); - Any aCatalog = xTableProp->getPropertyValue(PROPERTY_CATALOGNAME); - aCatalog >>= sCatalog; - xTableProp->getPropertyValue(PROPERTY_SCHEMANAME) >>= sSchema; - xTableProp->getPropertyValue(PROPERTY_NAME) >>= sTable; - // first ask the database itself for the best columns which can be used Sequence< ::rtl::OUString> aBestColumnNames; Reference<XNameAccess> xKeyColumns = getPrimaryKeyColumns_throw(i_aTable); @@ -216,10 +209,6 @@ void OKeySet::findTableColumnsMatching_throw(const Any& i_aTable const Reference<XColumnsSupplier> xTblColSup(i_aTable,UNO_QUERY_THROW); const Reference<XNameAccess> xTblColumns = xTblColSup->getColumns(); - const ::rtl::OUString sComposedUpdateTableName = dbtools::composeTableName( i_xMeta, sCatalog, sSchema, sTable, sal_False, ::dbtools::eInDataManipulation ); - ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,sComposedUpdateTableName,(*m_pKeyColumnNames),true); - ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),sComposedUpdateTableName,(*m_pColumnNames),true); - // locate parameter in select columns Reference<XParametersSupplier> xParaSup(m_xComposer,UNO_QUERY); Reference<XIndexAccess> xQueryParameters = xParaSup->getParameters(); @@ -230,7 +219,26 @@ void OKeySet::findTableColumnsMatching_throw(const Any& i_aTable Reference<XPropertySet> xPara(xQueryParameters->getByIndex(i),UNO_QUERY_THROW); xPara->getPropertyValue(PROPERTY_REALNAME) >>= aParameterColumns[i]; } - ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,sComposedUpdateTableName,(*m_pParameterNames),true); + + if ( m_sUpdateTableName.getLength() ) + { + ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,m_sUpdateTableName,(*m_pKeyColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),m_sUpdateTableName,(*m_pColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,m_sUpdateTableName,(*m_pParameterNames),true); + } + else + { + ::rtl::OUString sCatalog,sSchema,sTable; + Reference<XPropertySet> xTableProp(i_aTable,UNO_QUERY); + Any aCatalog = xTableProp->getPropertyValue(PROPERTY_CATALOGNAME); + aCatalog >>= sCatalog; + xTableProp->getPropertyValue(PROPERTY_SCHEMANAME) >>= sSchema; + xTableProp->getPropertyValue(PROPERTY_NAME) >>= sTable; + const ::rtl::OUString sComposedUpdateTableName = dbtools::composeTableName( i_xMeta, sCatalog, sSchema, sTable, sal_False, ::dbtools::eInDataManipulation ); + ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,sComposedUpdateTableName,(*m_pKeyColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),sComposedUpdateTableName,(*m_pColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,sComposedUpdateTableName,(*m_pParameterNames),true); + } SelectColumnsMetaData::const_iterator aPosIter = m_pKeyColumnNames->begin(); SelectColumnsMetaData::const_iterator aPosEnd = m_pKeyColumnNames->end(); @@ -817,10 +825,12 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString for (;aAutoIter != aAutoEnd; ++aAutoIter) { // we will only fetch values which are keycolumns - if ( m_pKeyColumnNames->find(*aAutoIter) != aEnd ) + SelectColumnsMetaData::iterator aFind = m_pKeyColumnNames->find(*aAutoIter); + if ( aFind != aEnd ) { sMaxStmt += sMax; - sMaxStmt += ::dbtools::quoteName( sQuote,*aAutoIter); + sMaxStmt += ::dbtools::quoteName( sQuote,aFind->second.sRealName +); sMaxStmt += sMaxEnd; } } @@ -831,7 +841,9 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString ::rtl::OUString sStmt = ::rtl::OUString::createFromAscii("SELECT "); sStmt += sMaxStmt; sStmt += ::rtl::OUString::createFromAscii("FROM "); - sStmt += m_aSelectComposedTableName; + ::rtl::OUString sCatalog,sSchema,sTable; + ::dbtools::qualifiedNameComponents(m_xConnection->getMetaData(),m_sUpdateTableName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation); + sStmt += ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable ); try { // now fetch the autoincrement values @@ -1667,7 +1679,7 @@ void OKeySet::impl_convertValue_throw(const ORowSetRow& _rInsertRow,const Select sal_Int32 nIndex = sValue.indexOf('.'); if ( nIndex != -1 ) { - aValue = sValue.copy(0,nIndex + (i_aMetaData.nScale > 0 ? i_aMetaData.nScale + 1 : 0)); + aValue = sValue.copy(0,::std::min(sValue.getLength(),nIndex + (i_aMetaData.nScale > 0 ? i_aMetaData.nScale + 1 : 0))); } } break; diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx index ccd5cf0e6..5403a56d6 100644 --- a/dbaccess/source/core/api/KeySet.hxx +++ b/dbaccess/source/core/api/KeySet.hxx @@ -112,7 +112,6 @@ namespace dbaccess ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow> m_xRow; ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer > m_xComposer; ::rtl::OUString m_sUpdateTableName; - ::rtl::OUString m_aSelectComposedTableName; ::std::vector< ::rtl::OUString > m_aFilterColumns; sal_Bool m_bRowCountFinal; diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index fc8013413..eea07de9d 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -1266,13 +1266,13 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCon // Feldnamen sal_uInt16 i; for (i=0;i< pLhs->count();i++) - pCondition->getChild(i)->parseNodeToPredicateStr( aName, m_xConnection, xFormatter, m_aLocale, static_cast<sal_Char>( m_sDecimalSep.toChar() ) ); + pLhs->getChild(i)->parseNodeToPredicateStr( aName, m_xConnection, xFormatter, m_aLocale, static_cast<sal_Char>( m_sDecimalSep.toChar() ) ); // Kriterium aItem.Handle = pCondition->getChild(1)->getNodeType(); aValue = pCondition->getChild(1)->getTokenValue(); for(i=0;i< pRhs->count();i++) - pCondition->getChild(i)->parseNodeToPredicateStr(aValue, m_xConnection, xFormatter, m_aLocale, static_cast<sal_Char>( m_sDecimalSep.toChar() ) ); + pRhs->getChild(i)->parseNodeToPredicateStr(aValue, m_xConnection, xFormatter, m_aLocale, static_cast<sal_Char>( m_sDecimalSep.toChar() ) ); aItem.Name = aName; aItem.Value <<= aValue; diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index 98c88aaf2..ef8fc20ae 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -1569,16 +1569,7 @@ sal_Bool ODocumentDefinition::saveAs() Reference<XNameContainer> xNC(pDocuSave->getContent(),UNO_QUERY); if ( xNC.is() ) { - if ( m_pImpl->m_aProps.aTitle == pDocuSave->getName() ) - { - Reference<XEmbedPersist> xPersist(m_xEmbeddedObject,UNO_QUERY); - if ( xPersist.is() ) - { - xPersist->storeOwn(); - notifyDataSourceModified(); - } - } - else + if ( m_pImpl->m_aProps.aTitle != pDocuSave->getName() ) { try { @@ -1618,6 +1609,12 @@ sal_Bool ODocumentDefinition::saveAs() DBG_UNHANDLED_EXCEPTION(); } } + Reference<XEmbedPersist> xPersist(m_xEmbeddedObject,UNO_QUERY); + if ( xPersist.is() ) + { + xPersist->storeOwn(); + notifyDataSourceModified(); + } } } } diff --git a/dbaccess/source/core/inc/DatabaseDataProvider.hxx b/dbaccess/source/core/inc/DatabaseDataProvider.hxx index ade231e50..dae466e92 100644 --- a/dbaccess/source/core/inc/DatabaseDataProvider.hxx +++ b/dbaccess/source/core/inc/DatabaseDataProvider.hxx @@ -33,11 +33,12 @@ #include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/chart2/data/XDatabaseDataProvider.hpp" #include "com/sun/star/chart2/XInternalDataProvider.hpp" +#include <com/sun/star/chart/XComplexDescriptionAccess.hpp> #include <com/sun/star/sdbc/XRowSet.hpp> #include <com/sun/star/sdbc/XParameters.hpp> #include <com/sun/star/container/XChild.hpp> -#include "cppuhelper/compbase3.hxx" +#include "cppuhelper/compbase4.hxx" #include "cppuhelper/basemutex.hxx" #include "cppuhelper/propertysetmixin.hxx" #include <cppuhelper/implementationentry.hxx> @@ -52,8 +53,9 @@ namespace dbaccess { class DatabaseDataSource; -typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::chart2::data::XDatabaseDataProvider +typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::chart2::data::XDatabaseDataProvider , ::com::sun::star::container::XChild + , ::com::sun::star::chart::XComplexDescriptionAccess , ::com::sun::star::lang::XServiceInfo > TDatabaseDataProvider; class DatabaseDataProvider: private ::cppu::BaseMutex, @@ -187,6 +189,26 @@ private: // conatiner::XChild virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + + // ____ XComplexDescriptionAccess ____ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > SAL_CALL getComplexRowDescriptions() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setComplexRowDescriptions( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > >& aRowDescriptions ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > SAL_CALL getComplexColumnDescriptions() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setComplexColumnDescriptions( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > >& aColumnDescriptions ) throw (::com::sun::star::uno::RuntimeException); + + // ____ XChartDataArray (base of XComplexDescriptionAccess) ____ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL getData() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& aData ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowDescriptions() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRowDescriptions ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getColumnDescriptions() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aColumnDescriptions ) throw (::com::sun::star::uno::RuntimeException); + + // ____ XChartData (base of XChartDataArray) ____ + virtual void SAL_CALL addChartDataChangeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeChartDataChangeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener )throw (::com::sun::star::uno::RuntimeException); + virtual double SAL_CALL getNotANumber()throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isNotANumber(double nNumber )throw (::com::sun::star::uno::RuntimeException); private: DatabaseDataProvider(DatabaseDataProvider &); // not defined void operator =(DatabaseDataProvider &); // not defined @@ -229,6 +251,7 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xActiveConnection; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > m_xRowSet; ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XInternalDataProvider > m_xInternal; + ::com::sun::star::uno::Reference< ::com::sun::star::chart::XComplexDescriptionAccess > m_xComplexDescriptionAccess; ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XRangeXMLConversion> m_xRangeConversion; ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler> m_xHandler; // the object doin' most of the work - an SDB-rowset diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index 1b4ea8f4d..0ede9ff23 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -43,6 +43,7 @@ #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp> #include <com/sun/star/sdbc/XResultSetMetaData.hpp> +#include <com/sun/star/sdbc/XColumnLocate.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/chart/ChartDataRowSource.hpp> #include <com/sun/star/chart/XChartDataArray.hpp> @@ -72,6 +73,7 @@ DatabaseDataProvider::DatabaseDataProvider(uno::Reference< uno::XComponentContex { m_xInternal.set( m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.chart.InternalDataProvider")),m_xContext ), uno::UNO_QUERY ); m_xRangeConversion.set(m_xInternal,uno::UNO_QUERY); + m_xComplexDescriptionAccess.set(m_xInternal,uno::UNO_QUERY); osl_incrementInterlockedCount( &m_refCount ); { @@ -315,6 +317,75 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL DatabaseDataProvider::cre } return xData; } + +uno::Sequence< uno::Sequence< rtl::OUString > > SAL_CALL DatabaseDataProvider::getComplexRowDescriptions() throw (uno::RuntimeException) +{ + return m_xComplexDescriptionAccess->getComplexRowDescriptions(); +} +void SAL_CALL DatabaseDataProvider::setComplexRowDescriptions( const uno::Sequence< uno::Sequence< ::rtl::OUString > >& aRowDescriptions ) throw (uno::RuntimeException) +{ + m_xComplexDescriptionAccess->setComplexRowDescriptions(aRowDescriptions); +} +uno::Sequence< uno::Sequence< rtl::OUString > > SAL_CALL DatabaseDataProvider::getComplexColumnDescriptions() throw (uno::RuntimeException) +{ + return m_xComplexDescriptionAccess->getComplexColumnDescriptions(); +} +void SAL_CALL DatabaseDataProvider::setComplexColumnDescriptions( const uno::Sequence< uno::Sequence< rtl::OUString > >& aColumnDescriptions ) throw (uno::RuntimeException) +{ + m_xComplexDescriptionAccess->setComplexColumnDescriptions(aColumnDescriptions); +} +// ____ XChartDataArray ____ +uno::Sequence< uno::Sequence< double > > SAL_CALL DatabaseDataProvider::getData() throw (uno::RuntimeException) +{ + return m_xComplexDescriptionAccess->getData(); +} + +void SAL_CALL DatabaseDataProvider::setData( const uno::Sequence< uno::Sequence< double > >& rDataInRows ) throw (uno::RuntimeException) +{ + m_xComplexDescriptionAccess->setData(rDataInRows); +} + +void SAL_CALL DatabaseDataProvider::setRowDescriptions( const uno::Sequence< rtl::OUString >& aRowDescriptions ) throw (uno::RuntimeException) +{ + m_xComplexDescriptionAccess->setRowDescriptions(aRowDescriptions); +} + +void SAL_CALL DatabaseDataProvider::setColumnDescriptions( const uno::Sequence< rtl::OUString >& aColumnDescriptions ) throw (uno::RuntimeException) +{ + m_xComplexDescriptionAccess->setColumnDescriptions(aColumnDescriptions); +} + +uno::Sequence< rtl::OUString > SAL_CALL DatabaseDataProvider::getRowDescriptions() throw (uno::RuntimeException) +{ + return m_xComplexDescriptionAccess->getRowDescriptions(); +} + +uno::Sequence< rtl::OUString > SAL_CALL DatabaseDataProvider::getColumnDescriptions() throw (uno::RuntimeException) +{ + return m_xComplexDescriptionAccess->getColumnDescriptions(); +} + +// ____ XChartData (base of XChartDataArray) ____ +void SAL_CALL DatabaseDataProvider::addChartDataChangeEventListener(const uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& x) throw (uno::RuntimeException) +{ + m_xComplexDescriptionAccess->addChartDataChangeEventListener(x); +} + +void SAL_CALL DatabaseDataProvider::removeChartDataChangeEventListener(const uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& x) throw (uno::RuntimeException) +{ + m_xComplexDescriptionAccess->removeChartDataChangeEventListener(x); +} + +double SAL_CALL DatabaseDataProvider::getNotANumber() throw (uno::RuntimeException) +{ + return m_xComplexDescriptionAccess->getNotANumber(); +} + +::sal_Bool SAL_CALL DatabaseDataProvider::isNotANumber( double nNumber ) throw (uno::RuntimeException) +{ + return m_xComplexDescriptionAccess->isNotANumber(nNumber); +} + // ----------------------------------------------------------------------------- uno::Reference< sheet::XRangeSelection > SAL_CALL DatabaseDataProvider::getRangeSelection() throw (uno::RuntimeException) @@ -616,26 +687,28 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat uno::Reference< sdbc::XResultSet> xRes(m_xRowSet,uno::UNO_QUERY_THROW); uno::Reference< sdbc::XRow> xRow(m_xRowSet,uno::UNO_QUERY_THROW); uno::Reference< sdbc::XResultSetMetaData> xResultSetMetaData = uno::Reference< sdbc::XResultSetMetaDataSupplier>(m_xRowSet,uno::UNO_QUERY)->getMetaData(); + uno::Reference< sdbc::XColumnLocate> xColumnLocate(m_xRowSet,uno::UNO_QUERY_THROW); ::std::vector<sal_Int32> aColumnTypes; uno::Sequence< uno::Any > aLabelArgs(1); const sal_Int32 nCount = aColumns.getLength(); if ( nCount ) aColumnTypes.push_back(xResultSetMetaData->getColumnType(1)); - for (sal_Int32 i = 1; i < nCount; ++i) - { - aColumnTypes.push_back(xResultSetMetaData->getColumnType(i+1)); - } // for (sal_Int32 i = 1; i < nCount; ++i) + ::std::vector< sal_Int32 > aColumnPositions; const ::rtl::OUString* pIter = aColumns.getConstArray(); const ::rtl::OUString* pEnd = pIter + aColumns.getLength(); for(sal_Int32 k = 0;pIter != pEnd;++pIter,++k) { + aColumnPositions.push_back(xColumnLocate->findColumn(*pIter)); uno::Reference< beans::XPropertySet> xColumn(xColumns->getByName(*pIter),uno::UNO_QUERY); + sal_Int32 nType = sdbc::DataType::VARCHAR; if ( xColumn.is() ) { m_aNumberFormats.insert( ::std::map< ::rtl::OUString,uno::Any>::value_type(::rtl::OUString::valueOf(k),xColumn->getPropertyValue(PROPERTY_NUMBERFORMAT))); + xColumn->getPropertyValue(PROPERTY_TYPE) >>= nType; } + aColumnTypes.push_back(nType); } ::std::vector< ::rtl::OUString > aRowLabels; @@ -649,9 +722,17 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat aValue.fill(1,aColumnTypes[0],xRow); aRowLabels.push_back(aValue.getString()); ::std::vector< double > aRow; - for (sal_Int32 j = _bHasCategories ? 2 : 1,i = 0; j <= nCount; ++j,++i) + ::std::vector< sal_Int32 >::iterator aColumnPosIter = aColumnPositions.begin(); + ::std::vector< sal_Int32 >::iterator aColumnPosEnd = aColumnPositions.end(); + sal_Int32 i = 0; + if ( _bHasCategories ) { - aValue.fill(j,aColumnTypes[j-1],xRow); + ++aColumnPosIter; + ++i; + } + for (; aColumnPosIter != aColumnPosEnd; ++aColumnPosIter,++i) + { + aValue.fill(*aColumnPosIter,aColumnTypes[i],xRow); if ( aValue.isNull() ) { double nValue; @@ -660,7 +741,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat } else aRow.push_back(aValue.getDouble()); - } // for (sal_Int32 j = 2,i = 0; j <= nCount; ++j,++i) + } aDataValues.push_back(aRow); } // while( xRes->next() && (!m_RowLimit || nRowCount < m_RowLimit) ) diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 94bbb23d7..001105bc1 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -1347,7 +1347,9 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa InvalidateAll(); break; case SID_DB_APP_DSRELDESIGN: - if ( !m_pSubComponentManager->activateSubFrame( ::rtl::OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN ) ) + { + Reference< XComponent > xRelationDesigner; + if ( !m_pSubComponentManager->activateSubFrame( ::rtl::OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xRelationDesigner ) ) { SharedConnection xConnection( ensureConnection() ); if ( xConnection.is() ) @@ -1359,7 +1361,8 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa onDocumentOpened( ::rtl::OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xComponent, NULL ); } } - break; + } + break; case SID_DB_APP_DSUSERADMIN: { SharedConnection xConnection( ensureConnection() ); @@ -1844,7 +1847,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const case E_REPORT: case E_FORM: { - if ( !m_pSubComponentManager->activateSubFrame( _sName, _eType, _eOpenMode ) ) + if ( !m_pSubComponentManager->activateSubFrame( _sName, _eType, _eOpenMode, xRet ) ) { ::std::auto_ptr< OLinkedDocumentsAccess > aHelper = getDocumentsAccess( _eType ); if ( !aHelper->isConnected() ) @@ -1861,7 +1864,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const case E_QUERY: case E_TABLE: { - if ( !m_pSubComponentManager->activateSubFrame( _sName, _eType, _eOpenMode ) ) + if ( !m_pSubComponentManager->activateSubFrame( _sName, _eType, _eOpenMode, xRet ) ) { SharedConnection xConnection( ensureConnection() ); if ( !xConnection.is() ) diff --git a/dbaccess/source/ui/app/subcomponentmanager.cxx b/dbaccess/source/ui/app/subcomponentmanager.cxx index 251ba9b8d..ea37fcf96 100644 --- a/dbaccess/source/ui/app/subcomponentmanager.cxx +++ b/dbaccess/source/ui/app/subcomponentmanager.cxx @@ -529,7 +529,8 @@ namespace dbaui } //------------------------------------------------------------------------------------------------------------------ - bool SubComponentManager::activateSubFrame( const ::rtl::OUString& _rName, const sal_Int32 _nComponentType, const ElementOpenMode _eOpenMode ) const + bool SubComponentManager::activateSubFrame( const ::rtl::OUString& _rName, const sal_Int32 _nComponentType, + const ElementOpenMode _eOpenMode, Reference< XComponent >& o_rComponent ) const { ::osl::MutexGuard aGuard( m_pData->getMutex() ); @@ -546,6 +547,13 @@ namespace dbaui const Reference< XTopWindow > xTopWindow( xFrame->getContainerWindow(), UNO_QUERY_THROW ); xTopWindow->toFront(); + if ( pos->xModel.is() ) + o_rComponent = pos->xModel.get(); + else if ( pos->xController.is() ) + o_rComponent = pos->xController.get(); + else + o_rComponent = pos->xFrame.get(); + return true; } diff --git a/dbaccess/source/ui/app/subcomponentmanager.hxx b/dbaccess/source/ui/app/subcomponentmanager.hxx index d84cef286..a0dd80b65 100644 --- a/dbaccess/source/ui/app/subcomponentmanager.hxx +++ b/dbaccess/source/ui/app/subcomponentmanager.hxx @@ -90,7 +90,8 @@ namespace dbaui bool activateSubFrame( const ::rtl::OUString& _rName, const sal_Int32 _nComponentType, - const ElementOpenMode _eOpenMode + const ElementOpenMode _eOpenMode, + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& o_rComponent ) const; /** closes all frames of the given component diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index 29f8857df..40f211ecf 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -29,6 +29,7 @@ #include "xmlExportDocumentHandler.hxx" #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp> +#include <com/sun/star/chart/XComplexDescriptionAccess.hpp> #include <com/sun/star/reflection/XProxyFactory.hpp> #include <com/sun/star/sdb/CommandType.hpp> #include <comphelper/sequence.hxx> @@ -338,12 +339,27 @@ void SAL_CALL ExportDocumentHandler::initialize( const uno::Sequence< uno::Any > // set ourself as delegator m_xProxy->setDelegator( *this ); - const ::rtl::OUString sCommand = m_xDatabaseDataProvider->getCommand(); if ( sCommand.getLength() ) m_aColumns = ::dbtools::getFieldNamesByCommandDescriptor(m_xDatabaseDataProvider->getActiveConnection() ,m_xDatabaseDataProvider->getCommandType() ,sCommand); + + uno::Reference< chart::XComplexDescriptionAccess > xDataProvider(m_xDatabaseDataProvider,uno::UNO_QUERY); + if ( xDataProvider.is() ) + { + m_aColumns.realloc(1); + uno::Sequence< uno::Sequence< ::rtl::OUString > > aColumnNames = xDataProvider->getComplexColumnDescriptions(); + for(sal_Int32 i = 0 ; i < aColumnNames.getLength();++i) + { + if ( aColumnNames[i].getLength() ) + { + sal_Int32 nCount = m_aColumns.getLength(); + m_aColumns.realloc(nCount+1); + m_aColumns[nCount] = aColumnNames[i][0]; + } + } + } } // -------------------------------------------------------------------------------- uno::Any SAL_CALL ExportDocumentHandler::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException) |