diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-05-08 21:48:04 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-05-11 01:58:50 +0200 |
commit | 172e208e6b0674f42c301c5ee5e280e9138ba1b4 (patch) | |
tree | c3d690cd958f4fedff96095dbbdbeb6321ebd4f3 /chart2/source | |
parent | 462457455e9664a4ba79c4b21747cdb4e47da6ca (diff) |
chart2: prefix VDataSeries members, rename Double to m_aValues
Change-Id: I74d560fa8a9c9d1ee761b26aa1ca90798f774a7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134052
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'chart2/source')
-rw-r--r-- | chart2/source/view/inc/VDataSeries.hxx | 5 | ||||
-rw-r--r-- | chart2/source/view/main/VDataSeries.cxx | 59 |
2 files changed, 31 insertions, 33 deletions
diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx index f445d06092ee..29a71918b549 100644 --- a/chart2/source/view/inc/VDataSeries.hxx +++ b/chart2/source/view/inc/VDataSeries.hxx @@ -53,9 +53,8 @@ public: sal_Int32 detectNumberFormatKey( sal_Int32 index ) const; sal_Int32 getLength() const; - css::uno::Reference<css::chart2::data::XDataSequence> Model; - - mutable css::uno::Sequence<double> Doubles; + css::uno::Reference<css::chart2::data::XDataSequence> m_xModel; + mutable css::uno::Sequence<double> m_aValues; }; class VDataSeries final diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index 311273034e10..3fb12ebca325 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -49,24 +49,24 @@ using ::com::sun::star::uno::Reference; void VDataSequence::init( const uno::Reference< data::XDataSequence >& xModel ) { - Model = xModel; - Doubles = DataSequenceToDoubleSequence( xModel ); + m_xModel = xModel; + m_aValues = DataSequenceToDoubleSequence( xModel ); } bool VDataSequence::is() const { - return Model.is(); + return m_xModel.is(); } void VDataSequence::clear() { - Model = nullptr; - Doubles.realloc(0); + m_xModel = nullptr; + m_aValues.realloc(0); } double VDataSequence::getValue( sal_Int32 index ) const { - if( 0<=index && index<Doubles.getLength() ) - return Doubles[index]; + if( 0<=index && index<m_aValues.getLength() ) + return m_aValues[index]; return std::numeric_limits<double>::quiet_NaN(); } @@ -75,10 +75,9 @@ sal_Int32 VDataSequence::detectNumberFormatKey( sal_Int32 index ) const sal_Int32 nNumberFormatKey = -1; // -1 is allowed and means a key for the whole sequence - if( -1<=index && index<Doubles.getLength() && - Model.is()) + if( -1<=index && index<m_aValues.getLength() && m_xModel.is()) { - nNumberFormatKey = Model->getNumberFormatKeyByIndex( index ); + nNumberFormatKey = m_xModel->getNumberFormatKeyByIndex( index ); } return nNumberFormatKey; @@ -86,7 +85,7 @@ sal_Int32 VDataSequence::detectNumberFormatKey( sal_Int32 index ) const sal_Int32 VDataSequence::getLength() const { - return Doubles.getLength(); + return m_aValues.getLength(); } namespace @@ -107,10 +106,10 @@ struct lcl_LessXOfPoint void lcl_clearIfNoValuesButTextIsContained( VDataSequence& rData, const uno::Reference<data::XDataSequence>& xDataSequence ) { //#i71686#, #i101968#, #i102428# - sal_Int32 nCount = rData.Doubles.getLength(); + sal_Int32 nCount = rData.m_aValues.getLength(); for( sal_Int32 i = 0; i < nCount; ++i ) { - if( !std::isnan( rData.Doubles[i] ) ) + if( !std::isnan( rData.m_aValues[i] ) ) return; } //no double value is contained @@ -248,7 +247,7 @@ VDataSeries::~VDataSeries() void VDataSeries::doSortByXValues() { - if( !(m_aValues_X.is() && m_aValues_X.Doubles.hasElements()) ) + if( !(m_aValues_X.is() && m_aValues_X.m_aValues.hasElements()) ) return; //prepare a vector for sorting @@ -257,9 +256,9 @@ void VDataSeries::doSortByXValues() for( nPointIndex=0; nPointIndex < m_nPointCount; nPointIndex++ ) { aTmp.push_back( - { ((nPointIndex < m_aValues_X.Doubles.getLength()) ? m_aValues_X.Doubles[nPointIndex] + { ((nPointIndex < m_aValues_X.m_aValues.getLength()) ? m_aValues_X.m_aValues[nPointIndex] : std::numeric_limits<double>::quiet_NaN()), - ((nPointIndex < m_aValues_Y.Doubles.getLength()) ? m_aValues_Y.Doubles[nPointIndex] + ((nPointIndex < m_aValues_Y.m_aValues.getLength()) ? m_aValues_Y.m_aValues[nPointIndex] : std::numeric_limits<double>::quiet_NaN()) } ); @@ -269,10 +268,10 @@ void VDataSeries::doSortByXValues() std::stable_sort( aTmp.begin(), aTmp.end(), lcl_LessXOfPoint() ); //fill the sorted points back to the members - m_aValues_X.Doubles.realloc( m_nPointCount ); - auto pDoublesX = m_aValues_X.Doubles.getArray(); - m_aValues_Y.Doubles.realloc( m_nPointCount ); - auto pDoublesY = m_aValues_Y.Doubles.getArray(); + m_aValues_X.m_aValues.realloc( m_nPointCount ); + auto pDoublesX = m_aValues_X.m_aValues.getArray(); + m_aValues_Y.m_aValues.realloc( m_nPointCount ); + auto pDoublesY = m_aValues_Y.m_aValues.getArray(); for( nPointIndex=0; nPointIndex < m_nPointCount; nPointIndex++ ) { @@ -421,10 +420,10 @@ double VDataSeries::getXValue( sal_Int32 index ) const { if( 0<=index && index<m_aValues_X.getLength() ) { - fRet = m_aValues_X.Doubles[index]; + fRet = m_aValues_X.m_aValues[index]; if(mpOldSeries && index < mpOldSeries->m_aValues_X.getLength()) { - double nOldVal = mpOldSeries->m_aValues_X.Doubles[index]; + double nOldVal = mpOldSeries->m_aValues_X.m_aValues[index]; fRet = nOldVal + (fRet - nOldVal) * mnPercent; } } @@ -446,10 +445,10 @@ double VDataSeries::getYValue( sal_Int32 index ) const { if( 0<=index && index<m_aValues_Y.getLength() ) { - fRet = m_aValues_Y.Doubles[index]; + fRet = m_aValues_Y.m_aValues[index]; if(mpOldSeries && index < mpOldSeries->m_aValues_Y.getLength()) { - double nOldVal = mpOldSeries->m_aValues_Y.Doubles[index]; + double nOldVal = mpOldSeries->m_aValues_Y.m_aValues[index]; fRet = nOldVal + (fRet - nOldVal) * mnPercent; } } @@ -719,12 +718,12 @@ uno::Sequence< double > const & VDataSeries::getAllX() const { //init x values from category indexes //first category (index 0) matches with real number 1.0 - m_aValues_X.Doubles.realloc( m_nPointCount ); - auto pDoubles = m_aValues_X.Doubles.getArray(); + m_aValues_X.m_aValues.realloc( m_nPointCount ); + auto pDoubles = m_aValues_X.m_aValues.getArray(); for(sal_Int32 nN=m_aValues_X.getLength();nN--;) pDoubles[nN] = nN+1; } - return m_aValues_X.Doubles; + return m_aValues_X.m_aValues; } uno::Sequence< double > const & VDataSeries::getAllY() const @@ -733,12 +732,12 @@ uno::Sequence< double > const & VDataSeries::getAllY() const { //init y values from indexes //first y-value (index 0) matches with real number 1.0 - m_aValues_Y.Doubles.realloc( m_nPointCount ); - auto pDoubles = m_aValues_Y.Doubles.getArray(); + m_aValues_Y.m_aValues.realloc( m_nPointCount ); + auto pDoubles = m_aValues_Y.m_aValues.getArray(); for(sal_Int32 nN=m_aValues_Y.getLength();nN--;) pDoubles[nN] = nN+1; } - return m_aValues_Y.Doubles; + return m_aValues_Y.m_aValues; } double VDataSeries::getXMeanValue() const |