diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-22 09:52:13 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-02-22 14:34:21 +0200 |
commit | db8067145f0126402be39042934e11228a1b42e9 (patch) | |
tree | 0a9d18faaf0c862cc544e6a991b32a68bbb40e28 /chart2/source/tools | |
parent | 14420e83296fd393cba956047370564c3517cdae (diff) |
loplugin:write only fields
Change-Id: I44f249a17d0a510ec63a488b656d57a1a392f821
Diffstat (limited to 'chart2/source/tools')
-rw-r--r-- | chart2/source/tools/ExplicitCategoriesProvider.cxx | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx index b661046d9560..2d1802cec97d 100644 --- a/chart2/source/tools/ExplicitCategoriesProvider.cxx +++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx @@ -400,16 +400,7 @@ Sequence< OUString > ExplicitCategoriesProvider::getExplicitSimpleCategories( return lcl_getExplicitSimpleCategories( rSplitCategoriesProvider, aComplexCats ); } -struct DatePlusIndexComparator -{ - inline bool operator() ( const DatePlusIndex& aFirst, - const DatePlusIndex& aSecond ) const - { - return ( aFirst.fValue < aSecond.fValue ); - } -}; - -bool lcl_fillDateCategories( const uno::Reference< data::XDataSequence >& xDataSequence, std::vector< DatePlusIndex >& rDateCategories, bool bIsAutoDate, ChartModel& rModel ) +bool lcl_fillDateCategories( const uno::Reference< data::XDataSequence >& xDataSequence, std::vector< double >& rDateCategories, bool bIsAutoDate, ChartModel& rModel ) { bool bOnlyDatesFound = true; bool bAnyDataFound = false; @@ -468,18 +459,18 @@ bool lcl_fillDateCategories( const uno::Reference< data::XDataSequence >& xDataS if( !bContainsEmptyString && !bContainsNan ) bAnyDataFound = true; } - DatePlusIndex aDatePlusIndex( 1.0, nN ); - if( bIsDate && (aAny >>= aDatePlusIndex.fValue) ) - rDateCategories.push_back( aDatePlusIndex ); + double aDate( 1.0 ); + if( bIsDate && (aAny >>= aDate) ) + rDateCategories.push_back( aDate ); else { if( aAny.hasValue() && !bContainsEmptyString )//empty string does not count as non date value! bOnlyDatesFound=false; - ::rtl::math::setNan( &aDatePlusIndex.fValue ); - rDateCategories.push_back( aDatePlusIndex ); + ::rtl::math::setNan( &aDate ); + rDateCategories.push_back( aDate ); } } - ::std::sort( rDateCategories.begin(), rDateCategories.end(), DatePlusIndexComparator() ); + ::std::sort( rDateCategories.begin(), rDateCategories.end() ); } return bAnyDataFound && bOnlyDatesFound; @@ -572,7 +563,7 @@ bool ExplicitCategoriesProvider::isDateAxis() return m_bIsDateAxis; } -const std::vector< DatePlusIndex >& ExplicitCategoriesProvider::getDateCategories() +const std::vector< double >& ExplicitCategoriesProvider::getDateCategories() { init(); return m_aDateCategories; |