diff options
author | Tünde Tóth <tundeth@gmail.com> | 2019-12-18 09:49:26 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-01-10 14:21:35 +0100 |
commit | 6e847aa817999ab18acd534f9e6a86685bb268fc (patch) | |
tree | 640176e25db6e79ef4976b9fd6c527b684456c7d /chart2/source/view | |
parent | 04b2310aaa094794ceedaa1bb6ff1823a2d29d3e (diff) |
tdf#129859 XLSX import: don't show deleted legend entries
by adding a new feature to disable selected data points
in pie charts.
Fixing also tdf#129858 by deleting the correct legend entry
in bar charts.
Change-Id: Iaaf3a864e9404b8b6d3e2affbb366e18d0f4b43e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86160
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2/source/view')
-rw-r--r-- | chart2/source/view/charttypes/VSeriesPlotter.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 34036f3dd0ed..f7e828425246 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -2657,9 +2657,28 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries( Sequence< OUString > aCategoryNames; if( m_pExplicitCategoriesProvider ) aCategoryNames = m_pExplicitCategoriesProvider->getSimpleCategories(); - + Sequence<sal_Int32> deletedLegendEntries; + try + { + rSeries.getPropertiesOfSeries()->getPropertyValue("DeletedLegendEntries") >>= deletedLegendEntries; + } + catch (const uno::Exception&) + { + } for( sal_Int32 nIdx=0; nIdx<aCategoryNames.getLength(); ++nIdx ) { + bool deletedLegendEntry = false; + for (auto& deletedLegendEntryIdx : deletedLegendEntries) + { + if (nIdx == deletedLegendEntryIdx) + { + deletedLegendEntry = true; + break; + } + } + if (deletedLegendEntry) + continue; + // symbol uno::Reference< drawing::XShapes > xSymbolGroup( ShapeFactory::getOrCreateShapeFactory(xShapeFactory)->createGroup2D( xTarget )); |