From 22f8333ea6ca8e5c74b8be8a9900136e13874d7c Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 14 Dec 2012 18:16:56 +0100 Subject: n#792778 DOCX import: parse group shapes in oox only Previously textframes inside groupshapes were tried to be imported as TextFrames, but then their addition to a GroupShape failed, so the text simply ended up as a normal paragraph. Fix this by importing members of groupshapes as drawinglayer objects, just like how the WW8 import does. Also fix two testcases, which implicitely tested that the groupshape VML element is ignored on import. Change-Id: I1a9fba8a5fd532203a825e55b1d5996277ea12fa Signed-off-by: Andras Timar --- oox/inc/oox/vml/vmlshape.hxx | 2 +- oox/inc/oox/vml/vmltextbox.hxx | 11 ++++++++++- oox/inc/oox/vml/vmltextboxcontext.hxx | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'oox/inc') diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx index 87b51d1cedac..35d3a8524ee7 100644 --- a/oox/inc/oox/vml/vmlshape.hxx +++ b/oox/inc/oox/vml/vmlshape.hxx @@ -202,7 +202,7 @@ struct ShapeModel ~ShapeModel(); /** Creates and returns a new shape textbox structure. */ - TextBox& createTextBox(); + TextBox& createTextBox(ShapeTypeModel& rModel); /** Creates and returns a new shape client data structure. */ ClientData& createClientData(); }; diff --git a/oox/inc/oox/vml/vmltextbox.hxx b/oox/inc/oox/vml/vmltextbox.hxx index af69e779e601..49814439a91f 100644 --- a/oox/inc/oox/vml/vmltextbox.hxx +++ b/oox/inc/oox/vml/vmltextbox.hxx @@ -24,10 +24,17 @@ #include #include "oox/helper/helper.hxx" #include "oox/dllapi.h" +#include + +namespace com { namespace sun { namespace star { + namespace drawing { class XShape; } +} } } namespace oox { namespace vml { +class ShapeTypeModel; + // ============================================================================ /** Font settings for a text portion in a textbox. */ @@ -62,7 +69,7 @@ struct TextPortionModel class OOX_DLLPUBLIC TextBox { public: - explicit TextBox(); + explicit TextBox(ShapeTypeModel& rTypeModel); /** Appends a new text portion to the textbox. */ void appendPortion( const TextFontModel& rFont, const ::rtl::OUString& rText ); @@ -73,7 +80,9 @@ public: const TextFontModel* getFirstFont() const; /** Returns the entire text of all text portions. */ ::rtl::OUString getText() const; + void convert(com::sun::star::uno::Reference xShape) const; + ShapeTypeModel& mrTypeModel; /// Text distance from the border (inset attribute of v:textbox), valid only if set. bool borderDistanceSet; int borderDistanceLeft, borderDistanceTop, borderDistanceRight, borderDistanceBottom; diff --git a/oox/inc/oox/vml/vmltextboxcontext.hxx b/oox/inc/oox/vml/vmltextboxcontext.hxx index 4fd35d187f2f..a644026f7b4d 100644 --- a/oox/inc/oox/vml/vmltextboxcontext.hxx +++ b/oox/inc/oox/vml/vmltextboxcontext.hxx @@ -41,6 +41,7 @@ public: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual void onCharacters( const ::rtl::OUString& rChars ); + virtual void onStartElement(const AttributeList& rAttribs); virtual void onEndElement(); private: -- cgit v1.2.3