summaryrefslogtreecommitdiff
path: root/chart2/source/view/main/VDataSeries.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/view/main/VDataSeries.cxx')
-rw-r--r--chart2/source/view/main/VDataSeries.cxx80
1 files changed, 2 insertions, 78 deletions
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index f7a81e9a5..eb90adbd5 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -37,6 +37,7 @@
#include "LabelPositionHelper.hxx"
#include "ChartTypeHelper.hxx"
#include "ContainerHelper.hxx"
+#include "DataSeriesHelper.hxx"
#include "MeanValueRegressionCurveCalculator.hxx"
#include <com/sun/star/chart/MissingValueTreatment.hpp>
@@ -61,87 +62,10 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
-namespace
-{
- struct lcl_LessIndex
- {
- inline bool operator() ( const sal_Int32& first,
- const sal_Int32& second )
- {
- return ( first < second );
- }
- };
-
- void lcl_removeIndices( uno::Sequence< double >& rValues, const uno::Sequence< sal_Int32 >& rIndicesToRemove )
- {
- if( !rIndicesToRemove.getLength() )
- return;
-
- ::std::vector< sal_Int32 > aIndicesToRemove( ContainerHelper::SequenceToVector( rIndicesToRemove) );
- ::std::sort( aIndicesToRemove.begin(), aIndicesToRemove.end(), lcl_LessIndex() );
-
- sal_Int32 nTarget=0;
- sal_Int32 nR = 0;
- sal_Int32 nRemove = aIndicesToRemove[nR];
- for( sal_Int32 nSource=0; nSource<rValues.getLength(); nSource++ )
- {
- if( nSource<nRemove || nRemove==-1 )
- {
- if( nTarget < nSource )
- rValues[nTarget]=rValues[nSource];
- nTarget++;
- continue;
- }
- if( nSource==nRemove )
- {
- ++nR;
- if( nR<static_cast<sal_Int32>(aIndicesToRemove.size()) )
- nRemove = aIndicesToRemove[nR];
- else
- nRemove = -1;
- }
- }
-
- if( nTarget>0 )
- rValues.realloc( nTarget );
- else
- rValues.realloc(0);
- }
-}
-
void VDataSequence::init( const uno::Reference< data::XDataSequence >& xModel )
{
- bool bDisplayHiddenCells = true; //todo: make this configurable in future
- bool bIsHidden = false;
- uno::Sequence< sal_Int32 > aHiddenValues;
- if( !bDisplayHiddenCells )
- {
- uno::Reference<beans::XPropertySet> xProp(xModel, uno::UNO_QUERY );
- if( xProp.is())
- {
- try
- {
- xProp->getPropertyValue( C2U( "IsHidden" ) ) >>= bIsHidden;
- xProp->getPropertyValue( C2U( "HiddenValues" ) ) >>= aHiddenValues;
- }
- catch( uno::Exception& e )
- {
- ASSERT_EXCEPTION( e );
- }
- }
- }
-
Model = xModel;
- if( bDisplayHiddenCells || !bIsHidden )
- Doubles = DataSequenceToDoubleSequence( xModel );
-
- if( !bDisplayHiddenCells )
- {
- if( bIsHidden )
- Doubles.realloc(0);
- else if( aHiddenValues.getLength() )
- lcl_removeIndices( Doubles, aHiddenValues );
- }
+ Doubles = DataSequenceToDoubleSequence( xModel );
}
bool VDataSequence::is() const