summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2012-04-02 18:21:51 -0430
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-11 17:55:41 +0200
commit0e3bd5c0c4e18d9daa6bc827996e860ede1f438b (patch)
tree7e3b64c9ae20d6193fd3030bb9b276a926a1d8de /chart2
parent883d20c5eb68893c73ab2fd5d3bfee528d0a02d1 (diff)
Display correct errorbars columns in chart data browser.
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/dialogs/DataBrowserModel.cxx41
-rw-r--r--chart2/source/controller/dialogs/DataBrowserModel.hxx2
2 files changed, 9 insertions, 34 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index 1ec9acfae18f..b9ae25bb1328 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -918,7 +918,10 @@ void DataBrowserModel::updateFromModel()
// add ranges for error bars if present for a series
if( StatisticsHelper::usesErrorBarRanges( aSeries[nSeriesIdx], /* bYError = */ true ))
- addErrorBarRanges( aSeries[nSeriesIdx], nYAxisNumberFormatKey, nSeqIdx, nHeaderEnd );
+ addErrorBarRanges( aSeries[nSeriesIdx], nYAxisNumberFormatKey, nSeqIdx, nHeaderEnd, true );
+
+ if( StatisticsHelper::usesErrorBarRanges( aSeries[nSeriesIdx], /* bYError = */ false ))
+ addErrorBarRanges( aSeries[nSeriesIdx], nYAxisNumberFormatKey, nSeqIdx, nHeaderEnd, false );
m_aHeaders.push_back(
tDataHeader(
@@ -942,59 +945,31 @@ void DataBrowserModel::addErrorBarRanges(
const Reference< chart2::XDataSeries > & xDataSeries,
sal_Int32 nNumberFormatKey,
sal_Int32 & rInOutSequenceIndex,
- sal_Int32 & rInOutHeaderEnd )
+ sal_Int32 & rInOutHeaderEnd, bool bYError )
{
try
{
::std::vector< Reference< chart2::data::XLabeledDataSequence > > aSequences;
- // x error bars
- // ------------
Reference< chart2::data::XDataSource > xErrorSource(
- StatisticsHelper::getErrorBars( xDataSeries, /* bYError = */ false ), uno::UNO_QUERY );
+ StatisticsHelper::getErrorBars( xDataSeries, bYError ), uno::UNO_QUERY );
- // positive x error bars
Reference< chart2::data::XLabeledDataSequence > xErrorLSequence(
StatisticsHelper::getErrorLabeledDataSequenceFromDataSource(
xErrorSource,
/* bPositiveValue = */ true,
- /* bYError = */ false ));
+ bYError ));
if( xErrorLSequence.is())
aSequences.push_back( xErrorLSequence );
- // negative x error bars
xErrorLSequence.set(
StatisticsHelper::getErrorLabeledDataSequenceFromDataSource(
xErrorSource,
/* bPositiveValue = */ false,
- /* bYError = */ false ));
- if( xErrorLSequence.is())
- aSequences.push_back( xErrorLSequence );
-
- // y error bars
- // ------------
- xErrorSource.set(
- StatisticsHelper::getErrorBars( xDataSeries, /* bYError = */ true ), uno::UNO_QUERY );
-
- // positive y error bars
- xErrorLSequence.set(
- StatisticsHelper::getErrorLabeledDataSequenceFromDataSource(
- xErrorSource,
- /* bPositiveValue = */ true,
- /* bYError = */ true ));
+ bYError ));
if( xErrorLSequence.is())
aSequences.push_back( xErrorLSequence );
- // negative y error bars
- xErrorLSequence.set(
- StatisticsHelper::getErrorLabeledDataSequenceFromDataSource(
- xErrorSource,
- /* bPositiveValue = */ false,
- /* bYError = */ true ));
- if( xErrorLSequence.is())
- aSequences.push_back( xErrorLSequence );
-
-
for( ::std::vector< Reference< chart2::data::XLabeledDataSequence > >::const_iterator aIt( aSequences.begin());
aIt != aSequences.end(); ++aIt )
{
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.hxx b/chart2/source/controller/dialogs/DataBrowserModel.hxx
index ee48fa0d8065..7d6e99a3883e 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.hxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.hxx
@@ -159,7 +159,7 @@ private:
::com::sun::star::chart2::XDataSeries > & xDataSeries,
sal_Int32 nNumberFormatKey,
sal_Int32 & rInOutSequenceIndex,
- sal_Int32 & rInOutHeaderEnd );
+ sal_Int32 & rInOutHeaderEnd, bool bYError );
sal_Int32 getCategoryColumnCount();