summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2022-05-05 21:10:25 +0900
committerTomaž Vajngerl <quikee@gmail.com>2022-05-06 11:23:37 +0200
commited883b92efa9ca8e3006290eb2c28485e9052575 (patch)
treef282b35f1ed09ca1c26a9b915c9f696b1efedefa /chart2/source
parent71dee51995d46d0c820c83790d521fbd6bdd568d (diff)
chart2: add function to create a table shape to ShapeFactory
Change-Id: I18f76c3372504c1d660aa168ee0387f61817f30a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133921 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/view/inc/ShapeFactory.hxx3
-rw-r--r--chart2/source/view/main/ShapeFactory.cxx14
2 files changed, 17 insertions, 0 deletions
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx
index 89991afaf1b0..d6c05af04d18 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -27,6 +27,7 @@
#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
#include <svx/unoshape.hxx>
+#include <svx/unodraw/SvxTableShape.hxx>
#include <svx/unopage.hxx>
namespace chart { struct VLineProperties; }
@@ -216,6 +217,8 @@ public:
const css::uno::Reference< css::beans::XPropertySet > & xTextProperties,
double nRotation, const OUString& aName, sal_Int32 nTextMaxWidth );
+ static rtl::Reference<SvxTableShape> createTable(rtl::Reference<SvxShapeGroupAnyD> const& xTarget);
+
static rtl::Reference<SvxShapeRect>
createInvisibleRectangle(
const rtl::Reference<SvxShapeGroupAnyD>& xTarget
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index 86e93fc44394..d145feabbda9 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -2531,6 +2531,20 @@ void ShapeFactory::removeSubShapes( const rtl::Reference<SvxShapeGroupAnyD>& xSh
}
}
+rtl::Reference<SvxTableShape>
+ShapeFactory::createTable(rtl::Reference<SvxShapeGroupAnyD> const& xTarget)
+{
+ if( !xTarget.is() )
+ return nullptr;
+
+ //create table shape
+ rtl::Reference<SvxTableShape> xShape = new SvxTableShape(nullptr);
+ xShape->setShapeKind(SdrObjKind::Table);
+ xTarget->addShape(*xShape);
+
+ return xShape;
+}
+
} //namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */