Description: I created a line chart in LibreOffice Calc and updated the x-axis formatting to set it to "On tick marks" in the "positioning" tab. But when I save and re-open the document, the chart reverted to the default "Between tick marks" option. Steps to Reproduce: 1.Create a line chart on LibreOffice Calc (it may work with other chart types) 2.Right click on the x-axis, click "format x-axis", go to "positioning" tab, check the "On tick marks" box. 3.Save the document and close it 4.Re-open the document. Actual Results: The chart's x-axis reverted to the default formatting option "Between tick marks" Expected Results: The chart's x-axis should have been saved in its "On tick marks" option Reproducible: Always User Profile Reset: No Additional Info: Version: 7.2.5.2 (x64) / LibreOffice Community Build ID: 499f9727c189e6ef3471021d6132d4c694f357e5 CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win Locale: fr-FR (en_GB); UI: en-GB Calc: threaded
On pc Debian x86-64 with master sources updated today, I could almost reproduce this. I mean, at the beginning the option by default is on "On tick marks" by default. Then if I set "Between tick marks", save it, reopen and try to put back "On tick marks", it takes it into account but when saving again and reopening, it forgot the change and stays on "Between tick marks".
It works with this patch: diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 8bc776e5e421..616300000ea4 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -2341,7 +2341,7 @@ void SchXMLExportHelper_Impl::exportAxis( const Reference< chart2::XAxis >& rChart2Axis, const OUString& rCategoriesRange, bool bHasTitle, bool bHasMajorGrid, bool bHasMinorGrid, - bool bExportContent, std::u16string_view sChartType ) + bool bExportContent, std::u16string_view /* sChartType */) { std::vector< XMLPropertyState > aPropertyStates; std::unique_ptr<SvXMLElementExport> pAxis; @@ -2356,13 +2356,7 @@ void SchXMLExportHelper_Impl::exportAxis( { chart2::ScaleData aScaleData(rChart2Axis->getScaleData()); bool bShiftedCatPos = aScaleData.ShiftedCategoryPosition; - if (sChartType == u"com.sun.star.chart.BarDiagram" || sChartType == u"com.sun.star.chart.StockDiagram") - { - if (!bShiftedCatPos) - rAxisProps->setPropertyValue("MajorOrigin", uno::makeAny(0.0)); - } - else if (bShiftedCatPos) - rAxisProps->setPropertyValue("MajorOrigin", uno::makeAny(0.5)); + rAxisProps->setPropertyValue("MajorOrigin", uno::makeAny(bShiftedCatPos?0.5:0.0)); } lcl_exportNumberFormat( "NumberFormat", rAxisProps, mrExport ); Tünde/László: any thoughts here about what was the use of testing sChartType ?
Tünde Tóth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/deb2512e5ea16ad8fa9f975569fbc5363cebf8dd tdf#148142 chart: fix export of modified On/Between tick marks It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Tünde Tóth committed a patch related to this issue. It has been pushed to "libreoffice-7-5": https://git.libreoffice.org/core/commit/9d7d35718f32fd757f6ce994e6aab0c6f3494b3c tdf#148142 chart: fix export of modified On/Between tick marks It will be available in 7.5.5. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Verified in: Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community Build ID: f4c24da1e7f11664e0d2f688d2531f068e4a3bc0 CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win Locale: en-US (hu_HU); UI: en-US Calc: CL threaded