summaryrefslogtreecommitdiff
path: root/oox/inc
diff options
context:
space:
mode:
authorTünde Tóth <tundeth@gmail.com>2019-12-04 16:17:09 +0100
committerLászló Németh <nemeth@numbertext.org>2019-12-12 10:40:52 +0100
commitcea1ae2a4f7abdcfc3874d714bdafef801910c1c (patch)
treeb74644f6d6bffa3fdf8ea1cb092066eef7f548bc /oox/inc
parent4a8d3b80283cec4a93dd697eab70afcb82f04f4f (diff)
tdf#121991 Chart OOXML import: fix deleted legend entries
The legend showed deleted legend entries too. Change-Id: I1e205cdfc4262c73d2bb189237d6bc316781931d Reviewed-on: https://gerrit.libreoffice.org/84516 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox/inc')
-rw-r--r--oox/inc/drawingml/chart/titlecontext.hxx12
-rw-r--r--oox/inc/drawingml/chart/titleconverter.hxx3
-rw-r--r--oox/inc/drawingml/chart/titlemodel.hxx17
3 files changed, 29 insertions, 3 deletions
diff --git a/oox/inc/drawingml/chart/titlecontext.hxx b/oox/inc/drawingml/chart/titlecontext.hxx
index 2d52720ef7a4..8538d5ce2e56 100644
--- a/oox/inc/drawingml/chart/titlecontext.hxx
+++ b/oox/inc/drawingml/chart/titlecontext.hxx
@@ -55,6 +55,18 @@ public:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
};
+struct LegendEntryModel;
+
+/** Handler for a chart legend entry context (c:legendEntry element).
+ */
+class LegendEntryContext : public ContextBase< LegendEntryModel >
+{
+public:
+ explicit LegendEntryContext( ::oox::core::ContextHandler2Helper& rParent, LegendEntryModel& rModel );
+ virtual ~LegendEntryContext() override;
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
+};
struct LegendModel;
diff --git a/oox/inc/drawingml/chart/titleconverter.hxx b/oox/inc/drawingml/chart/titleconverter.hxx
index 10f2f000d4aa..40b95d25d193 100644
--- a/oox/inc/drawingml/chart/titleconverter.hxx
+++ b/oox/inc/drawingml/chart/titleconverter.hxx
@@ -90,6 +90,9 @@ public:
/** Creates a legend object and attaches it at the passed diagram. */
void convertFromModel(
const css::uno::Reference< css::chart2::XDiagram >& rxDiagram );
+
+private:
+ void legendEntriesFormatting(const css::uno::Reference<css::chart2::XDiagram>& rxDiagram);
};
diff --git a/oox/inc/drawingml/chart/titlemodel.hxx b/oox/inc/drawingml/chart/titlemodel.hxx
index dde078443869..f069c7697a60 100644
--- a/oox/inc/drawingml/chart/titlemodel.hxx
+++ b/oox/inc/drawingml/chart/titlemodel.hxx
@@ -57,12 +57,23 @@ struct TitleModel
~TitleModel();
};
+struct LegendEntryModel
+{
+ sal_Int32 mnLegendEntryIdx; /// Legend entry index.
+ bool mbLabelDeleted; /// True = legend label deleted.
+
+ LegendEntryModel();
+ ~LegendEntryModel();
+};
+
struct LegendModel
{
- typedef ModelRef< Shape > ShapeRef;
- typedef ModelRef< TextBody > TextBodyRef;
- typedef ModelRef< LayoutModel > LayoutRef;
+ typedef ModelVector< LegendEntryModel > LegendEntryVector;
+ typedef ModelRef< Shape > ShapeRef;
+ typedef ModelRef< TextBody > TextBodyRef;
+ typedef ModelRef< LayoutModel > LayoutRef;
+ LegendEntryVector maLegendEntries; /// Legend entries formatting.
ShapeRef mxShapeProp; /// Legend shape formatting.
TextBodyRef mxTextProp; /// Legend text formatting.
LayoutRef mxLayout; /// Layout/position of the legend.