summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-06-20 21:01:57 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-06-20 23:08:00 +0200
commit96a2590ddd5b5985c04c0797169ffb93e893eb68 (patch)
tree92fd40f8925041ad983ed52055283dbfba38536f /chart2
parent4908a4585ca36af159ae5fcd1ab361abc5b32e02 (diff)
Also filter out fUnscaledLogicX being NaN
...which doesn't get filtered out by the following checks against the pPosHelper->getLogicMin/MaxX() range, but leads to -fsanitize=float-cast-overflow down the road when casting the propagated NaN in double fDepth to sal_Int32 when loading xlsx/tdf80820-1.xlsx as obtained by bin/get-bugzilla-attachments-by-mimetype (i.e., the attachment at <https://bugs.documentfoundation.org/show_bug.cgi?id=80820#c0>): > chart2/source/view/main/ShapeFactory.cxx:438:36: runtime error: nan is outside the range of representable values of type 'int' > #0 in chart::ShapeFactory::impl_createCube(com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, com::sun::star::drawing::Position3D const&, com::sun::star::drawing::Direction3D const&, int, bool) at chart2/source/view/main/ShapeFactory.cxx:438:36 > #1 in chart::ShapeFactory::createCube(com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, com::sun::star::drawing::Position3D const&, com::sun::star::drawing::Direction3D const&, int, com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> const&, std::__debug::map<rtl::OUString, rtl::OUString, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, rtl::OUString> > > const&, bool) at chart2/source/view/main/ShapeFactory.cxx:385:46 > #2 in chart::BarChart::createDataPoint3D_Bar(com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, com::sun::star::drawing::Position3D const&, com::sun::star::drawing::Direction3D const&, double, int, com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> const&, int) at chart2/source/view/charttypes/BarChart.cxx:337:39 > #3 in chart::BarChart::createShapes() at chart2/source/view/charttypes/BarChart.cxx:836:42 > #4 in chart::ChartView::impl_createDiagramAndContent(chart::CreateShapeParam2D const&, com::sun::star::awt::Size const&) at chart2/source/view/main/ChartView.cxx:1608:25 > #5 in chart::ChartView::createShapes2D(com::sun::star::awt::Size const&) at chart2/source/view/main/ChartView.cxx:3037:41 > #6 in chart::ChartView::createShapes() at chart2/source/view/main/ChartView.cxx:2506:5 > #7 in chart::ChartView::impl_updateView(bool) at chart2/source/view/main/ChartView.cxx:2558:17 [...] Change-Id: I25c743e4b98d9c7d98182144d30cb8c9782864ad Reviewed-on: https://gerrit.libreoffice.org/74467 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/charttypes/BarChart.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx
index d732a683d0e6..47c137b32ab4 100644
--- a/chart2/source/view/charttypes/BarChart.cxx
+++ b/chart2/source/view/charttypes/BarChart.cxx
@@ -642,6 +642,8 @@ void BarChart::createShapes()
//collect data point information (logic coordinates, style ):
double fUnscaledLogicX = pSeries->getXValue( nPointIndex );
fUnscaledLogicX = DateHelper::RasterizeDateValue( fUnscaledLogicX, m_aNullDate, m_nTimeResolution );
+ if(rtl::math::isNan(fUnscaledLogicX))
+ continue;//point not visible
if(fUnscaledLogicX<pPosHelper->getLogicMinX())
continue;//point not visible
if(fUnscaledLogicX>pPosHelper->getLogicMaxX())