A bin width much smaller than the data range asks for a bin count with no upper bound. Over a range of 1000 a width of a millionth resolves to a billion bins. The conversion from double to sal_Int32 had no range check either, so it could overflow. Cap the count at MAX_HISTOGRAM_BINS. The division stays in double and saturates at the cap, and a fixed count from a document is clamped the same way. A capped count no longer spans the range with the requested width, so the range is divided evenly instead. Scott's rule gets the same treatment when it yields no width at all. Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> Change-Id: Ib59ee462edade94799cc58e503b843696743ecfe Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10257 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins CPCI <releng@collaboraoffice.com> (cherry picked from commit 93a9df897a14ec12457aa40d328616eb071a9175) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210337 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
Chart Implementation for LibreOffice Calc
The chart2 denotes a second generation re-write done to rid us of the
foul and twisted legacy chart code.
Debugging
Shortcuts
CTRL + F12 creates a layout dump based on the XShapeDumper based on SAL_WARN("chart2", ...