Files
odfstudio/chart2
Tomaž Vajngerl 3aa0160c31 Bound the number of histogram bins
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
2026-09-01 19:49:22 +02:00
..
2026-09-01 19:49:22 +02:00
2026-09-01 19:49:22 +02:00
…
…

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", ...