summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-06-14 16:07:16 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-06-14 18:03:46 +0200
commitf2dd0e97758d562752ddbf86bb2999e4426b9c6b (patch)
tree80a519bb5552d1258a30f313cbcc507f23954854 /chart2
parentf44d14e5f3909a4271034ba02da92ed2dee7b89c (diff)
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@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/charttypes/PieChart.cxx2
1 files changed, 1 insertions, 1 deletions
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;