diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-05-05 21:10:25 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-08-16 16:12:44 +0200 |
commit | 0eb7d3c8dfbfd7ddddd8ba8bd959743b68758049 (patch) | |
tree | 96244661b6b7f6060df8316d96fe579ea2e3b468 /chart2 | |
parent | f67f444d966210ecc876acaa77f0fd75a2be9e38 (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>
(cherry picked from commit ed883b92efa9ca8e3006290eb2c28485e9052575)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138306
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/inc/ShapeFactory.hxx | 3 | ||||
-rw-r--r-- | chart2/source/view/main/ShapeFactory.cxx | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx index f2699e5372f1..5b03509a3695 100644 --- a/chart2/source/view/inc/ShapeFactory.hxx +++ b/chart2/source/view/inc/ShapeFactory.hxx @@ -25,6 +25,7 @@ #include <com/sun/star/drawing/PointSequenceSequence.hpp> #include <rtl/ustring.hxx> +#include <svx/unodraw/SvxTableShape.hxx> namespace chart { struct VLineProperties; } namespace com::sun::star::beans { class XPropertySet; } @@ -212,6 +213,8 @@ public: const css::uno::Reference< css::beans::XPropertySet > & xTextProperties, double nRotation, const OUString& aName, sal_Int32 nTextMaxWidth ); + static rtl::Reference<SvxTableShape> createTable(css::uno::Reference< css::drawing::XShapes >& xTarget); + css::uno::Reference< css::drawing::XShape > createInvisibleRectangle( const css::uno::Reference< css::drawing::XShapes >& xTarget diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index a7011527dfc6..7c2574c5f407 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -2656,6 +2656,20 @@ void ShapeFactory::removeSubShapes( const uno::Reference< drawing::XShapes >& xS } } +rtl::Reference<SvxTableShape> ShapeFactory::createTable(uno::Reference<drawing::XShapes>& xTarget) +{ + if (!xTarget.is()) + return nullptr; + + //create table shape + rtl::Reference<SvxTableShape> xShape = new SvxTableShape(nullptr); + xShape->setShapeKind(OBJ_TABLE); + uno::Reference<drawing::XShape> xShapeUno(xShape); + xTarget->add(xShapeUno); + + return xShape; +} + } //namespace chart /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |