diff options
author | BaiXiaochun <bai.xiaochun.mofan@protonmail.com> | 2021-06-29 17:38:29 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-06-30 09:52:45 +0200 |
commit | 7838efe4b703945ccde963f8506c8c7744e04e6e (patch) | |
tree | 5b51faa8c5bd0799aafb1af702126f4b0feb852b /xmloff | |
parent | e9dc82b761a71369c4c49ae6d5fd8892f999c77a (diff) |
Purge out rtl::math::setNan
Change-Id: If8794c105e279afd4437517d3e61f2f900eb6490
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118123
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLTableContext.cxx | 13 |
2 files changed, 6 insertions, 14 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index f418cebd4500..4d1596b04aa5 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -46,6 +46,7 @@ #include <rtl/math.hxx> #include <o3tl/sorted_vector.hxx> +#include <limits> #include <vector> #include <algorithm> #include <queue> @@ -629,8 +630,6 @@ uno::Sequence< OUString > lcl_DataSequenceToStringSequence( } ::std::vector< double > lcl_getAllValuesFromSequence( const Reference< chart2::data::XDataSequence > & xSeq ) { - double fNan = 0.0; - ::rtl::math::setNan( &fNan ); ::std::vector< double > aResult; if(!xSeq.is()) return aResult; @@ -810,11 +809,9 @@ lcl_TableData lcl_getDataForLocalTable( // resize data aResult.aDataInRows.resize( nNumRows ); - double fNan = 0.0; - ::rtl::math::setNan( &fNan ); for (auto& aData: aResult.aDataInRows) - aData.resize(nNumColumns, fNan); + aData.resize(nNumColumns, std::numeric_limits<double>::quiet_NaN()); aResult.aColumnDescriptions.resize( nNumColumns ); aResult.aComplexColumnDescriptions.realloc( nNumColumns ); aResult.aRowDescriptions.resize( nNumRows ); diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index 6b86ad529daf..47cc4f573ed2 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -27,7 +27,6 @@ #include "transporttypes.hxx" #include <XMLStringBufferImportContext.hxx> #include <o3tl/safeint.hxx> -#include <rtl/math.hxx> #include <sal/log.hxx> #include <xmloff/xmlnamespace.hxx> #include <xmloff/xmltoken.hxx> @@ -42,6 +41,7 @@ #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp> +#include <limits> #include <vector> #include <algorithm> #include <iterator> @@ -65,10 +65,8 @@ struct lcl_ApplyCellToData explicit lcl_ApplyCellToData( Sequence< double > & rOutData ) : m_rData( rOutData ), m_nIndex( 0 ), - m_nSize( rOutData.getLength()), - m_fNaN( 0.0 ) + m_nSize( rOutData.getLength()) { - ::rtl::math::setNan( &m_fNaN ); } void operator() ( const SchXMLCell & rCell ) @@ -78,7 +76,7 @@ struct lcl_ApplyCellToData if( rCell.eType == SCH_CELL_TYPE_FLOAT ) m_rData[m_nIndex] = rCell.fValue; else - m_rData[m_nIndex] = m_fNaN; + m_rData[m_nIndex] = std::numeric_limits<double>::quiet_NaN(); } ++m_nIndex; } @@ -92,7 +90,6 @@ private: Sequence< double > & m_rData; sal_Int32 m_nIndex; sal_Int32 m_nSize; - double m_fNaN; }; void lcl_fillRangeMapping( @@ -741,10 +738,8 @@ void SchXMLTableHelper::applyTableToInternalDataProvider( // values Sequence< double >& rTargetRow = aDataInRows[nRow]; lcl_ApplyCellToData aApplyCellToData = ::std::for_each( rRow.begin() + nColOffset, rRow.end(), lcl_ApplyCellToData( rTargetRow ) ); - double fNaN = 0.0; - ::rtl::math::setNan( &fNaN ); for( sal_Int32 nCurrentIndex = aApplyCellToData.getCurrentIndex(); nCurrentIndex<nNumColumns; nCurrentIndex++ ) - rTargetRow[nCurrentIndex] = fNaN;//#i110615# + rTargetRow[nCurrentIndex] = std::numeric_limits<double>::quiet_NaN();//#i110615# } } } |