diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-05-16 16:19:39 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-07-17 21:49:43 +0200 |
commit | 7077e688408210b32596cbac2f2202610094ddf3 (patch) | |
tree | c1cfe10cfc61b37014e16a81fe9ac9135294eb83 | |
parent | 6b481f8bb44a14ebbfe010476cf2ca3728e7d539 (diff) |
oox: support reading text and shape properties for a data table
Change-Id: I740d3bd6af11457ecb54878be648ad1e22b9d4b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137153
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r-- | oox/inc/drawingml/chart/datatablemodel.hxx | 3 | ||||
-rw-r--r-- | oox/source/drawingml/chart/datatablecontext.cxx | 7 | ||||
-rw-r--r-- | oox/source/drawingml/chart/datatableconverter.cxx | 3 |
3 files changed, 12 insertions, 1 deletions
diff --git a/oox/inc/drawingml/chart/datatablemodel.hxx b/oox/inc/drawingml/chart/datatablemodel.hxx index 5c7fe7901200..937dbb3c60a6 100644 --- a/oox/inc/drawingml/chart/datatablemodel.hxx +++ b/oox/inc/drawingml/chart/datatablemodel.hxx @@ -28,6 +28,9 @@ struct DataTableModel bool mbShowOutline : 1; /// Show outline bool mbShowKeys : 1; + ModelRef<Shape> mxShapeProp; /// frame formatting. + ModelRef<TextBody> mxTextProp; /// text formatting. + DataTableModel() : mbShowHBorder(false) , mbShowVBorder(false) diff --git a/oox/source/drawingml/chart/datatablecontext.cxx b/oox/source/drawingml/chart/datatablecontext.cxx index 0813a6424312..c277dae5f4d6 100644 --- a/oox/source/drawingml/chart/datatablecontext.cxx +++ b/oox/source/drawingml/chart/datatablecontext.cxx @@ -18,7 +18,8 @@ */ #include <drawingml/chart/datatablecontext.hxx> - +#include <drawingml/shapepropertiescontext.hxx> +#include <drawingml/textbodycontext.hxx> #include <drawingml/chart/plotareamodel.hxx> #include <oox/core/xmlfilterbase.hxx> #include <oox/helper/attributelist.hxx> @@ -57,6 +58,10 @@ ContextHandlerRef DataTableContext::onCreateContext(sal_Int32 nElement, case C_TOKEN(showKeys): mrModel.mbShowKeys = rAttribs.getBool(XML_val, false); break; + case C_TOKEN(spPr): + return new ShapePropertiesContext(*this, mrModel.mxShapeProp.create()); + case C_TOKEN(txPr): + return new TextBodyContext(*this, mrModel.mxTextProp.create()); } break; } diff --git a/oox/source/drawingml/chart/datatableconverter.cxx b/oox/source/drawingml/chart/datatableconverter.cxx index 3c477c5d7507..4e42b7468ebc 100644 --- a/oox/source/drawingml/chart/datatableconverter.cxx +++ b/oox/source/drawingml/chart/datatableconverter.cxx @@ -55,6 +55,9 @@ void DataTableConverter::convertFromModel(uno::Reference<chart2::XDiagram> const aPropSet.setProperty(PROP_Outline, mrModel.mbShowOutline); if (mrModel.mbShowKeys) aPropSet.setProperty(PROP_Keys, mrModel.mbShowKeys); + + getFormatter().convertFormatting(aPropSet, mrModel.mxShapeProp, mrModel.mxTextProp, + OBJECTTYPE_DATATABLE); } catch (uno::Exception&) { |