From 2b4d78598c55389b24b4a5016279aed26ac0fb2e Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 1 Jul 2013 12:05:23 +0200 Subject: fdo#46361 oox: fixes for the VML import of groupshape textboxes (cherry picked from commits b1f78c44c1acc246f06a963383232c9bf649a06b, f24e4c74d7d6a7d95090c6fa6a584fed7787706c, 6bf79576aeca243db553ed3b5eade492dc35337b, 5a737fca37cd5a5f90aa03a30688d447677d3b8a, ef53d4aec2a3d690de2c7cdaf73ca95bbe29a433 and 2a2105b002c482e6536d5c3046c9e7783c0cdca3) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: Ie7ce4fb5c32ff4b3c1f3d7ee92d8358ae67fc6c1 Reviewed-on: https://gerrit.libreoffice.org/4675 Reviewed-by: Fridrich Strba Tested-by: Fridrich Strba --- include/oox/vml/vmlshape.hxx | 1 + include/oox/vml/vmltextbox.hxx | 11 +++++++++-- include/oox/vml/vmltextboxcontext.hxx | 5 +++++ 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/oox/vml/vmlshape.hxx b/include/oox/vml/vmlshape.hxx index ca815ec8ef8e..0312ec1a17c9 100644 --- a/include/oox/vml/vmlshape.hxx +++ b/include/oox/vml/vmlshape.hxx @@ -96,6 +96,7 @@ struct OOX_DLLPUBLIC ShapeTypeModel OptValue< OUString > moWrapAnchorY; ///< The base object from which our vertical positioning should be calculated. OptValue< ::rtl::OUString > moWrapType; ///< How to wrap the text around the object OptValue< ::rtl::OUString > moWrapSide; ///< On which side to wrap the text around the object + OUString maVTextAnchor; ///< How the text inside the shape is anchored vertically. explicit ShapeTypeModel(); diff --git a/include/oox/vml/vmltextbox.hxx b/include/oox/vml/vmltextbox.hxx index 4975e6bb26b6..fc97dc78413b 100644 --- a/include/oox/vml/vmltextbox.hxx +++ b/include/oox/vml/vmltextbox.hxx @@ -37,6 +37,12 @@ struct ShapeTypeModel; // ============================================================================ +/// A text paragraph in a textbox. +struct TextParagraphModel +{ + OptValue moParaAdjust; ///< Paragraph adjust (left, center, right, etc.) +}; + /** Font settings for a text portion in a textbox. */ struct OOX_DLLPUBLIC TextFontModel { @@ -57,10 +63,11 @@ struct OOX_DLLPUBLIC TextFontModel /** A text portion in a textbox with the same formatting for all characters. */ struct TextPortionModel { + TextParagraphModel maParagraph; TextFontModel maFont; OUString maText; - explicit TextPortionModel( const TextFontModel& rFont, const OUString& rText ); + explicit TextPortionModel( const TextParagraphModel& rParagraph, const TextFontModel& rFont, const OUString& rText ); }; // ============================================================================ @@ -72,7 +79,7 @@ public: explicit TextBox(ShapeTypeModel& rTypeModel); /** Appends a new text portion to the textbox. */ - void appendPortion( const TextFontModel& rFont, const OUString& rText ); + void appendPortion( const TextParagraphModel& rParagraph, const TextFontModel& rFont, const OUString& rText ); /** Returns the current number of text portions. */ inline size_t getPortionCount() const { return maPortions.size(); } diff --git a/include/oox/vml/vmltextboxcontext.hxx b/include/oox/vml/vmltextboxcontext.hxx index 47d71ac41b41..b5502445cdd7 100644 --- a/include/oox/vml/vmltextboxcontext.hxx +++ b/include/oox/vml/vmltextboxcontext.hxx @@ -34,6 +34,7 @@ public: explicit TextPortionContext( ::oox::core::ContextHandler2Helper& rParent, TextBox& rTextBox, + TextParagraphModel& rParagraph, const TextFontModel& rParentFont, sal_Int32 nElement, const AttributeList& rAttribs ); @@ -46,6 +47,7 @@ public: private: TextBox& mrTextBox; + TextParagraphModel maParagraph; TextFontModel maFont; size_t mnInitialPortions; }; @@ -63,9 +65,12 @@ public: virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); + virtual void onStartElement(const AttributeList& rAttribs) SAL_OVERRIDE; + virtual void onEndElement(); private: TextBox& mrTextBox; + TextParagraphModel maParagraph; }; // ============================================================================ -- cgit