diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2019-11-07 13:49:09 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-11-12 21:46:29 +0100 |
commit | b5c14ba1987ba102ac98530e2e718100655e1042 (patch) | |
tree | b3533f7d262bb631cfc9706e9be89450f75e33e2 /oox | |
parent | e63fdaa0d6eed45ad677c36e4a8301f606c603f5 (diff) |
tdf#128627 tdf#128634 Fix OOXML import of CrossBetween
Set default 'midCat' value during the import, for Radar charts,
because MSO created them with default 'midCat', but exported a
'between' value.
Set default 'between' value during the import, for 3D Bar and
Stock charts, because sometimes the OOXML file can contain a
wrong CrossBetween value, but MSO import them with default
values.
tdf#128627 regression from commit: 830e539547c463b932ce643517f880789185032d
(tdf#127393 OOXML chart import: fix X axis position setting "CrossBetween")
tdf#128634 regression from commit: 111c260ab2883b7906f1a66e222dbf4dc3c58c4f
(tdf#127777 OOXML chart export: fix "CrossBetween" for not imported charts)
Change-Id: Ie9763197b79c3a661e66043da7b89b4f0f00ba33
Reviewed-on: https://gerrit.libreoffice.org/82211
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/chart/axisconverter.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx index 9f2cc0f715dc..5f64586ffbb0 100644 --- a/oox/source/drawingml/chart/axisconverter.cxx +++ b/oox/source/drawingml/chart/axisconverter.cxx @@ -213,7 +213,14 @@ void AxisConverter::convertFromModel( aScaleData.AxisType = (bDateAxis && !mrModel.mbAuto) ? cssc2::AxisType::DATE : cssc2::AxisType::CATEGORY; aScaleData.AutoDateAxis = mrModel.mbAuto; aScaleData.Categories = rTypeGroups.front()->createCategorySequence(); - aScaleData.ShiftedCategoryPosition = pCrossingAxis->mnCrossBetween == XML_between; + /* set default ShiftedCategoryPosition values for some charttype, + because the XML can contain wrong CrossBetween value, if came from MSO */ + if( rTypeGroups.front()->is3dChart() && (rTypeInfo.meTypeId == TYPEID_BAR || rTypeInfo.meTypeId == TYPEID_HORBAR || rTypeInfo.meTypeId == TYPEID_STOCK) ) + aScaleData.ShiftedCategoryPosition = true; + else if( rTypeInfo.meTypeId == TYPEID_RADARLINE || rTypeInfo.meTypeId == TYPEID_RADARAREA ) + aScaleData.ShiftedCategoryPosition = false; + else + aScaleData.ShiftedCategoryPosition = pCrossingAxis->mnCrossBetween == XML_between; } else { |