diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx index 2ac44fc13bb2..ba10366aa5c9 100644 --- a/chart2/source/view/axes/ScaleAutomatism.cxx +++ b/chart2/source/view/axes/ScaleAutomatism.cxx @@ -909,6 +909,12 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLinear( fDistanceNormalized = 1.0; fDistanceMagnitude = 1.0e-307; } + else if ( !rtl::math::isFinite(fDistance) ) + { + // fdo#43703: Handle values bigger than limits correctly + fDistanceNormalized = 1.0; + fDistanceMagnitude = std::numeric_limits::max(); + } else { // distance magnitude (a power of 10)