diff options
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/token/properties.txt | 1 | ||||
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 20 | ||||
-rw-r--r-- | oox/source/vml/vmlshapecontext.cxx | 2 |
3 files changed, 23 insertions, 0 deletions
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index 243058010841..fb3e5a5e4529 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -465,6 +465,7 @@ StringItemList Subtotals SubViewSize Suffix +Surround SwapXAndYAxis Symbol SymbolColor diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 3239151aa0f0..0af325d52233 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -36,6 +36,7 @@ #include <com/sun/star/text/RelOrientation.hpp> #include <com/sun/star/text/SizeType.hpp> #include <com/sun/star/text/VertOrientation.hpp> +#include <com/sun/star/text/WrapTextMode.hpp> #include <com/sun/star/text/XTextContent.hpp> #include <com/sun/star/text/XTextDocument.hpp> #include <com/sun/star/text/XTextFrame.hpp> @@ -405,6 +406,24 @@ SimpleShape::SimpleShape( Drawing& rDrawing, const OUString& rService ) : { } +void lcl_setSurround(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel) +{ + sal_Int32 nSurround = com::sun::star::text::WrapTextMode_THROUGHT; + if ( rTypeModel.moWrapType.get() == "square" || rTypeModel.moWrapType .get()== "tight" || + rTypeModel.moWrapType.get() == "through" ) + { + nSurround = com::sun::star::text::WrapTextMode_PARALLEL; + if ( rTypeModel.moWrapSide.get() == "left" ) + nSurround = com::sun::star::text::WrapTextMode_LEFT; + else if ( rTypeModel.moWrapSide.get() == "right" ) + nSurround = com::sun::star::text::WrapTextMode_RIGHT; + } + else if ( rTypeModel.moWrapType.get() == "topAndBottom" ) + nSurround = com::sun::star::text::WrapTextMode_NONE; + + rPropSet.setProperty(PROP_Surround, nSurround); +} + void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel) { if ( rTypeModel.maPositionHorizontal == "center" ) @@ -449,6 +468,7 @@ void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel) { rPropSet.setProperty(PROP_AnchorType, text::TextContentAnchorType_AS_CHARACTER); } + lcl_setSurround( rPropSet, rTypeModel ); } Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes >& rxShapes, const awt::Rectangle& rShapeRect ) const diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index c5edd00e65ac..e0f8cfb659a7 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -360,6 +360,8 @@ ContextHandlerRef ShapeTypeContext::onCreateContext( sal_Int32 nElement, const A case NMSP_vmlWord | XML_wrap: mrTypeModel.moWrapAnchorX = rAttribs.getString(XML_anchorx); mrTypeModel.moWrapAnchorY = rAttribs.getString(XML_anchory); + mrTypeModel.moWrapType = rAttribs.getString(XML_type); + mrTypeModel.moWrapSide = rAttribs.getString(XML_side); break; case VML_TOKEN( shadow ): { |