[Libreoffice-commits] core.git: chart2/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 20 21:09:13 UTC 2019


 chart2/source/view/charttypes/BarChart.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 96a2590ddd5b5985c04c0797169ffb93e893eb68
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Jun 20 21:01:57 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Jun 20 23:08:00 2019 +0200

    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 at redhat.com>

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())


More information about the Libreoffice-commits mailing list