tdf#162136: fix crash when formatting data series in Histogram chart

Change-Id: Idc05b82363eca3066b291f05a7e05be4996d28a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171065
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
Julien Nabet 2024-07-26 10:45:20 +02:00
parent 92986f8e04
commit fef3a69df7

View file

@ -37,6 +37,7 @@ enum
PROP_HISTOGRAMCHARTTYPE_BINWIDTH,
PROP_HISTOGRAMCHARTTYPE_BINRANGE,
PROP_HISTOGRAMCHARTTYPE_FREQUENCYTYPE,
PROP_HISTOGRAMCHARTTYPE_OVERLAP_SEQUENCE,
PROP_HISTOGRAMCHARTTYPE_GAPWIDTH_SEQUENCE
};
@ -54,6 +55,11 @@ void lcl_AddPropertiesToVector(std::vector<Property>& rOutProperties)
"FrequencyType", PROP_HISTOGRAMCHARTTYPE_FREQUENCYTYPE, cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT);
rOutProperties.emplace_back("OverlapSequence", PROP_HISTOGRAMCHARTTYPE_OVERLAP_SEQUENCE,
cppu::UnoType<Sequence<sal_Int32>>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT);
rOutProperties.emplace_back("GapwidthSequence", PROP_HISTOGRAMCHARTTYPE_GAPWIDTH_SEQUENCE,
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
@ -153,6 +159,8 @@ void HistogramChartType::GetDefaultValue(sal_Int32 nHandle, uno::Any& rAny) cons
Sequence<sal_Int32> aSeq{ 0 }; // No gap for histogram
::chart::PropertyHelper::setPropertyValueDefault(
aTmp, PROP_HISTOGRAMCHARTTYPE_GAPWIDTH_SEQUENCE, aSeq);
::chart::PropertyHelper::setPropertyValueDefault(
aTmp, PROP_HISTOGRAMCHARTTYPE_OVERLAP_SEQUENCE, aSeq);
::chart::PropertyHelper::setPropertyValueDefault(aTmp, PROP_HISTOGRAMCHARTTYPE_BINWIDTH,
2.0);
::chart::PropertyHelper::setPropertyValueDefault(aTmp, PROP_HISTOGRAMCHARTTYPE_BINRANGE,