diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2020-08-12 08:34:42 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-08-23 13:05:46 +0200 |
commit | 886c2e35fadc7813498da041fc4ea8a8ba2fb358 (patch) | |
tree | 32e5d766192acc68043d414a754cef96ce8e11ab /oox/source | |
parent | 46911d142952a4bf01d5b82816ffd8ab3da7710e (diff) |
tdf#134118 Chart OOXML import: fix gaps in month based data
Leave gaps instead of zeroes, like MSO does, if data ranges
contain empty cells at month based time resolution.
Change-Id: Ie934b56d9d5cb556bcca41e0e4ddce3ea65f7228
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100573
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/drawingml/chart/chartspaceconverter.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx index 342b6190a67d..1f90c2e092eb 100644 --- a/oox/source/drawingml/chart/chartspaceconverter.cxx +++ b/oox/source/drawingml/chart/chartspaceconverter.cxx @@ -206,7 +206,16 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern { using namespace ::com::sun::star::chart::MissingValueTreatment; sal_Int32 nMissingValues = LEAVE_GAP; - switch( mrModel.mnDispBlanksAs ) + + // tdf#134118 leave gap if the time unit is month + bool bIsMonthBasedTimeUnit = false; + if( mrModel.mxPlotArea.is() && mrModel.mxPlotArea->maAxes.size() > 0 && + mrModel.mxPlotArea->maAxes[0]->monBaseTimeUnit.has() ) + { + bIsMonthBasedTimeUnit = mrModel.mxPlotArea->maAxes[0]->monBaseTimeUnit.get() == XML_months; + } + + if (!bIsMonthBasedTimeUnit) switch( mrModel.mnDispBlanksAs ) { case XML_gap: nMissingValues = LEAVE_GAP; break; case XML_zero: nMissingValues = USE_ZERO; break; |