summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-03-02 20:23:04 +0100
committerXisco Faulí <xiscofauli@libreoffice.org>2020-03-04 10:53:52 +0100
commit7d210f5c9bf7db39f0043d8d218b337b9a78053d (patch)
tree6419a0b88386733f81a748e1dedba6bfeefc8e7f /include
parent1000169ebca79478a05b4c23e760d99bd77e739e (diff)
tdf#84399 VML import: map <v:shape o:spt="202"> to TextShape
This partially reverts commit 81f9fe3a14f0fc99afbfa7ce3a26a9c7855d0919 (fdo#74401 VML groupshape import: only handle v:rect as TextShape, 2014-03-19), which wanted to map triangles to custom shapes. It was overlooked that we can have not only explicit rectangles and custom shapes, but also <v:shape> elements which have their shape type explicitly set to TextBox. The later is now again handled similar to rectangles. This keeps the triangle case working, but fixes the <v:shape o:spt="202"> case. We need to make this decision while parsing the XML, so some rework is needed to have earlier access to its container (group shape or draw page) and also to its shape type. (cherry picked from commit 198685ded79d64b21023ee85e9a15fa1b32705a0) Conflicts: include/oox/vml/vmlshapecontainer.hxx Change-Id: I33a4b3cd03b0df5d93cffa19e7ea834113df2bdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89876 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'include')
-rw-r--r--include/oox/vml/vmlshape.hxx4
-rw-r--r--include/oox/vml/vmlshapecontainer.hxx1
2 files changed, 5 insertions, 0 deletions
diff --git a/include/oox/vml/vmlshape.hxx b/include/oox/vml/vmlshape.hxx
index dc4db50c27fe..2b3677df106d 100644
--- a/include/oox/vml/vmlshape.hxx
+++ b/include/oox/vml/vmlshape.hxx
@@ -264,6 +264,9 @@ public:
void convertFormatting(
const css::uno::Reference< css::drawing::XShape >& rxShape ) const;
+ void setContainer(ShapeContainer* pContainer);
+ ShapeContainer* getContainer() const;
+
protected:
explicit ShapeBase( Drawing& rDrawing );
@@ -284,6 +287,7 @@ protected:
protected:
ShapeModel maShapeModel; ///< The model structure containing shape data.
+ ShapeContainer* mpContainer = nullptr;
};
diff --git a/include/oox/vml/vmlshapecontainer.hxx b/include/oox/vml/vmlshapecontainer.hxx
index ff39d5f7212c..72fc9286536e 100644
--- a/include/oox/vml/vmlshapecontainer.hxx
+++ b/include/oox/vml/vmlshapecontainer.hxx
@@ -126,6 +126,7 @@ template< typename ShapeT >
std::shared_ptr<ShapeT> ShapeContainer::createShape()
{
std::shared_ptr< ShapeT > xShape( new ShapeT( mrDrawing ) );
+ xShape->setContainer(this);
maShapes.push_back( xShape );
return xShape;
}