*** orig/chart2/source/view/inc/VDataSeries.hxx Fri Apr 11 06:43:48 2008 --- new/chart2/source/view/inc/VDataSeries.hxx Fri Oct 10 15:08:14 2008 *************** *** 168,173 **** --- 168,175 ---- void releaseShapes(); + bool isXValuesValid( const ::com::sun::star::uno::Sequence< double >& Doubles ); + private: //methods VDataSeries(); ::com::sun::star::chart2::DataPointLabel* *************** *** 240,245 **** --- 242,249 ---- m_apSymbolProperties_InvisibleSymbolForSelection; mutable sal_Int32 m_nCurrentAttributedPoint; ::com::sun::star::awt::Size m_aReferenceSize; + + bool m_bXValuesIsValid; // }; *** orig/chart2/source/view/main/VDataSeries.cxx Fri Jun 6 17:19:24 2008 --- new/chart2/source/view/main/VDataSeries.cxx Fri Oct 10 15:10:18 2008 *************** *** 251,256 **** --- 251,257 ---- , m_apSymbolProperties_AttributedPoint(NULL) , m_apSymbolProperties_InvisibleSymbolForSelection(NULL) , m_nCurrentAttributedPoint(-1) + , m_bXValuesIsValid( true ) { uno::Reference xDataSource = uno::Reference( xDataSeries, uno::UNO_QUERY ); *************** *** 292,297 **** --- 293,301 ---- } } + if( m_aValues_X.is() ) + m_bXValuesIsValid = isXValuesValid( m_aValues_X.Doubles ); + //determine the point count m_nPointCount = m_aValues_Y.getLength(); { *************** *** 330,335 **** --- 334,349 ---- { } + bool VDataSeries::isXValuesValid( const uno::Sequence< double >& Doubles ) + { + for( sal_Int32 i = 0; i < Doubles.getLength(); ++i ) + { + if( ::rtl::math::isNan( Doubles[i] ) ) + return false; + } + return true; + } + void VDataSeries::doSortByXValues() { if( m_aValues_X.is() && m_aValues_X.Doubles.getLength() ) *************** *** 502,507 **** --- 516,524 ---- { if(m_aValues_X.is()) { + if( !m_bXValuesIsValid ) + return index + 1; + if( 0<=index && index