diff options
author | Attila Bakos (NISZ) <bakos.attilakaroly@nisz.hu> | 2022-01-19 17:43:54 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2022-02-03 09:12:20 +0100 |
commit | 4a38ca4035ac03571925e72cb47e0beb8da2003a (patch) | |
tree | 6c472f1efe01827320bfd3ae35404f38ee18ba9a /include | |
parent | b8925251e48534706c6960a54c320d3879317321 (diff) |
tdf#146802 OOXML import: fix embedded VML in grouped textbox
E.g. OLE formulas inside them broke document load.
Regression from 121cbc250b36290f0f8c7265fea57256dad69553
"tdf#66039 DOCX: import textboxes (with tables, images etc.)
in group shapes".
Note: now embedded VML OLE is loaded in WPG shapes, thanks to
that the ShapeHandler in oox/ has a stack having the start
token inside for each shape.
Change-Id: I973d78ed88c5c83efffd9629061e2a2c6fdd25e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128627
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/oox/shape/ShapeContextHandler.hxx | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/include/oox/shape/ShapeContextHandler.hxx b/include/oox/shape/ShapeContextHandler.hxx index 27b70d2cf2c4..a245224730ed 100644 --- a/include/oox/shape/ShapeContextHandler.hxx +++ b/include/oox/shape/ShapeContextHandler.hxx @@ -19,6 +19,7 @@ #pragma once #include <memory> +#include <stack> #include <cppuhelper/implbase.hxx> #include <oox/drawingml/graphicshapecontext.hxx> #include <oox/core/fragmenthandler2.hxx> @@ -90,12 +91,15 @@ public: void setRelationFragmentPath(const OUString & the_value); sal_Int32 getStartToken() const; - void setStartToken( sal_Int32 _starttoken ); + void popStartToken(); + void pushStartToken( sal_Int32 _starttoken ); void setPosition(const css::awt::Point& rPosition); - const bool& getFullWPGSupport() { return m_bFullWPGSUpport; }; - void setFullWPGSupport(const bool& rbUse) { m_bFullWPGSUpport = rbUse; }; + const bool& getFullWPGSupport() { return m_bFullWPGSUpport; } + void setFullWPGSupport(const bool& rbUse) { m_bFullWPGSUpport = rbUse; } + + bool isWordProcessingGroupShape() const { return mxWpgContext ? true : false; } void setDocumentProperties(const css::uno::Reference<css::document::XDocumentProperties>& xDocProps); void setMediaDescriptor(const css::uno::Sequence<css::beans::PropertyValue>& rMediaDescriptor); @@ -109,9 +113,13 @@ private: ShapeContextHandler(ShapeContextHandler const &) = delete; void operator =(ShapeContextHandler const &) = delete; - ::sal_uInt32 mnStartToken; + // Special stack which always has at least one element. + // In case of group shapes with embedded content it will have more element than one. + std::stack<sal_uInt32> mnStartTokenStack; + css::awt::Point maPosition; - bool m_bFullWPGSUpport; + bool m_bFullWPGSUpport; // Is this DrawingML shape supposed to be proccessed as WPG? + drawingml::ShapePtr mpShape; std::shared_ptr< vml::Drawing > mpDrawing; |