summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorTünde Tóth <tundeth@gmail.com>2020-02-20 14:39:11 +0100
committerXisco Faulí <xiscofauli@libreoffice.org>2020-03-25 16:02:15 +0100
commit730369b8670590cb9625691fa2c0008e904fb4e1 (patch)
tree8b26ac4d3ec61e838a9e2bfb86eccbe29a396be0 /chart2
parent0185241456971f06a7795fb4f304317027f50db9 (diff)
tdf#123268 fix lost chart if all legend entries are hidden
See also commit 19b2ed4dee1ec33ad55473d43bfcd0bfa194cbee (related tdf#51671, add UI options for new "hide legend entry" feature) Change-Id: If20ab167d867d2845fa414ba0bbc490bed09f61c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89123 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 300e65cc47f3d6ae1563350757dbfadc080d7452) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90387 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/main/VLegend.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index df5ca49cea74..8272696ea102 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -951,6 +951,8 @@ void VLegend::createShapes(
std::vector<ViewLegendEntry> aNewEntries = pLegendEntryProvider->createLegendEntries(
aMaxSymbolExtent, eExpansion, xLegendProp,
xLegendContainer, m_xShapeFactory, m_xContext, mrModel);
+ if (aNewEntries.size() == 0)
+ return;
aViewEntries.insert( aViewEntries.end(), aNewEntries.begin(), aNewEntries.end() );
}
}