chart2/source/controller/dialogs/tp_RangeChooser.cxx | 2 dbaccess/source/core/misc/DatabaseDataProvider.cxx | 2 reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx | 28 +++++++++++- xmloff/source/chart/SchXMLTableContext.cxx | 10 ---- 4 files changed, 29 insertions(+), 13 deletions(-)
New commits: commit b090cbdf82e0827234caf5969124f6631311ef35 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Fri Aug 30 18:00:21 2013 +0200 fdo#68663 don't blindly force categories when there are none Change-Id: If52ea471ee3ca10e2f69d2fcd7b3ae0d5772bfc3 diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index c5377e3..18cd73c 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -979,16 +979,6 @@ void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary( } } - // there exist files with own data without a categories element but with row - // descriptions. The row descriptions were used as categories even without - // the categories element - if( ! bCategoriesApplied ) - { - SchXMLTools::CreateCategories( - xDataProv, xChartDoc, OUString("categories"), - 0 /* nCooSysIndex */, 0 /* nDimension */ ); - } - //i91578 display of hidden values (copy paste scenario; use hidden flag during migration to locale table upon paste ) //remove series that consist only of hidden columns Reference< chart2::XInternalDataProvider > xInternalDataProvider( xDataProv, uno::UNO_QUERY ); commit 2a0b2d9371b47689d34fc238c73ebc1126cba5b1 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Fri Aug 30 17:59:33 2013 +0200 fdo#68663 open chart-in-report: actually test for categories presence Change-Id: Icf8c8c1f3b1443bf051b3834f6407996e4ef2bfb diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index e75591f..65cbca5 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/chart2/data/DatabaseDataProvider.hpp> #include <com/sun/star/chart2/data/XDataReceiver.hpp> +#include <com/sun/star/chart2/data/XDataSource.hpp> #include <com/sun/star/chart/XComplexDescriptionAccess.hpp> #include <com/sun/star/chart/ChartDataRowSource.hpp> #include <com/sun/star/reflection/ProxyFactory.hpp> @@ -118,10 +119,35 @@ void SAL_CALL ImportDocumentHandler::endDocument() throw (uno::RuntimeException, // this fills the chart again ::comphelper::NamedValueCollection aArgs; aArgs.put( "CellRangeRepresentation", OUString("all") ); - aArgs.put( "HasCategories", uno::makeAny( sal_True ) ); aArgs.put( "FirstCellAsLabel", uno::makeAny( sal_True ) ); aArgs.put( "DataRowSource", uno::makeAny( chart::ChartDataRowSource_COLUMNS ) ); + sal_Bool bHasCategories = sal_False; + + uno::Reference< chart2::data::XDataSource > xDataSource(m_xModel, uno::UNO_QUERY); + if( xDataSource.is()) + { + uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aSequences(xDataSource->getDataSequences()); + const sal_Int32 nCount( aSequences.getLength()); + for( sal_Int32 nIdx=0; nIdx<nCount; ++nIdx ) + { + if( aSequences[nIdx].is() ) + { + uno::Reference< beans::XPropertySet > xSeqProp( aSequences[nIdx]->getValues(), uno::UNO_QUERY ); + OUString aRole; + if ( xSeqProp.is() + && ( xSeqProp->getPropertyValue( "Role" ) >>= aRole ) + && aRole == "categories" + ) + { + bHasCategories = sal_True; + break; + } + } + } + } + aArgs.put( "HasCategories", uno::makeAny( bHasCategories ) ); + uno::Reference< chart::XComplexDescriptionAccess > xDataProvider(m_xModel->getDataProvider(),uno::UNO_QUERY); if ( xDataProvider.is() ) { commit 6d4c69ff8446184ac725713b8b53a66f0ee56701 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Fri Aug 30 17:57:22 2013 +0200 that comment is patently wrong categories presence used to be hardcoded to sal_True, but now it is tested a few lines below. Change-Id: I413bbac3069e49a56c74637b75b8d8990f6111b4 diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index 79056db..ec94426 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -245,7 +245,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL DatabaseDataProvider::detectArgum ::comphelper::NamedValueCollection aArguments; aArguments.put( "CellRangeRepresentation", uno::Any( OUString( "all" ) ) ); aArguments.put( "DataRowSource", uno::makeAny( chart::ChartDataRowSource_COLUMNS ) ); - // internal data always contains labels and categories + // internal data always contains labels aArguments.put( "FirstCellAsLabel", uno::makeAny( sal_True ) ); sal_Bool bHasCategories = sal_False; commit ef3e7f23168d85db8310484e92d4234ff1916af8 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Fri Aug 30 17:56:18 2013 +0200 janitorial: indentation Change-Id: I3070c0b4fa84090412191415b23e455b9e8d1bbc diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.cxx b/chart2/source/controller/dialogs/tp_RangeChooser.cxx index 9223e06..891d48b 100644 --- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx +++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx @@ -324,7 +324,7 @@ bool RangeChooserTabPage::isValid() m_aRB_Columns.Enable( bIsValid ); m_aCB_FirstRowAsLabel.Enable( bIsValid ); m_aCB_FirstColumnAsLabel.Enable( bIsValid ); -} + } sal_Bool bShowIB = m_rDialogModel.getRangeSelectionHelper()->hasRangeSelection(); lcl_ShowChooserButton( m_aIB_Range, m_aED_Range, bShowIB ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits