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

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 14 16:04:55 UTC 2019


 chart2/source/view/charttypes/PieChart.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f2dd0e97758d562752ddbf86bb2999e4426b9c6b
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Jun 14 16:07:16 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Jun 14 18:03:46 2019 +0200

    Avoid -fsanitize=signed-integer-overflow
    
    ...as happens when loading xls/fdo76137-3.xls as obtained by
    bin/get-bugzilla-attachments-by-mimetype (i.e, the attachment at
    <https://bugs.documentfoundation.org/show_bug.cgi?id=76137#c6>):
    
    > chart2/source/view/charttypes/PieChart.cxx:1110:81: runtime error: signed integer overflow: 2025540036 + 157276681 cannot be represented in type 'int'
    >  #0 in chart::PieChart::rearrangeLabelToAvoidOverlapIfRequested(com::sun::star::awt::Size const&) at chart2/source/view/charttypes/PieChart.cxx:1110:81
    >  #1 in chart::ChartView::impl_createDiagramAndContent(chart::CreateShapeParam2D const&, com::sun::star::awt::Size const&) at chart2/source/view/main/ChartView.cxx:1651:23
    >  #2 in chart::ChartView::createShapes2D(com::sun::star::awt::Size const&) at chart2/source/view/main/ChartView.cxx:3037:41
    
    Change-Id: I52a8363db2ca37dbcf56e1c136d9ee2223add945
    Reviewed-on: https://gerrit.libreoffice.org/74048
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx
index d4fe022f48f9..9694f9cb75cf 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -1107,7 +1107,7 @@ void PieChart::rearrangeLabelToAvoidOverlapIfRequested( const awt::Size& rPageSi
     if(!bMoveableFound)
         return;
 
-    double fPageDiagonaleLength = sqrt( double( rPageSize.Width*rPageSize.Width + rPageSize.Height*rPageSize.Height) );
+    double fPageDiagonaleLength = sqrt( double(rPageSize.Width)*double(rPageSize.Width) + double(rPageSize.Height)*double(rPageSize.Height) );
     if( fPageDiagonaleLength == 0.0 )
         return;
 


More information about the Libreoffice-commits mailing list