diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2012-02-23 13:51:21 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-02-24 12:06:54 +0100 |
commit | 8e1dbe2b4b1d36f9994ee23c8d6074d350d17508 (patch) | |
tree | e12811fd58f60a7e449f4f88d2aa85243cd05d74 /oox | |
parent | 39f7bbb201adefa0ad593f5a0a9b2d33facd68bd (diff) |
fdo#45560: Fixed docx textbox position and size import
(cherry picked from commit 94698d89f675da9b4da1143fa150bbd76def6ccf)
Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/vml/vmldrawing.cxx | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index 6483f2053a42..a9088753426b 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -29,9 +29,13 @@ #include "oox/vml/vmldrawing.hxx" #include <algorithm> +#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/drawing/XControlShape.hpp> #include <com/sun/star/drawing/XShapes.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/text/HoriOrientation.hpp> +#include <com/sun/star/text/VertOrientation.hpp> +#include <rtl/oustringostreaminserter.hxx> #include "oox/core/xmlfilterbase.hxx" #include "oox/helper/containerhelper.hxx" #include "oox/ole/axcontrol.hxx" @@ -44,8 +48,10 @@ namespace vml { // ============================================================================ using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::beans; using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::text; using namespace ::com::sun::star::uno; using ::oox::core::XmlFilterBase; @@ -217,13 +223,25 @@ Reference< XShape > Drawing::createAndInsertXShape( const OUString& rService, { Reference< XMultiServiceFactory > xModelFactory( mrFilter.getModelFactory(), UNO_SET_THROW ); xShape.set( xModelFactory->createInstance( rService ), UNO_QUERY_THROW ); - // insert shape into passed shape collection (maybe drawpage or group shape) - rxShapes->add( xShape ); - xShape->setPosition( Point( rShapeRect.X, rShapeRect.Y ) ); + if ( !rService.equalsAscii( "com.sun.star.text.TextFrame" ) ) + { + // insert shape into passed shape collection (maybe drawpage or group shape) + rxShapes->add( xShape ); + xShape->setPosition( Point( rShapeRect.X, rShapeRect.Y ) ); + } + else + { + Reference< XPropertySet > xPropSet( xShape, UNO_QUERY_THROW ); + xPropSet->setPropertyValue( OUString::createFromAscii( "HoriOrient" ), makeAny( HoriOrientation::NONE ) ); + xPropSet->setPropertyValue( OUString::createFromAscii( "VertOrient" ), makeAny( VertOrientation::NONE ) ); + xPropSet->setPropertyValue( OUString::createFromAscii( "HoriOrientPosition" ), makeAny( rShapeRect.X ) ); + xPropSet->setPropertyValue( OUString::createFromAscii( "VertOrientPosition" ), makeAny( rShapeRect.Y ) ); + } xShape->setSize( Size( rShapeRect.Width, rShapeRect.Height ) ); } - catch( Exception& ) + catch( Exception& e ) { + SAL_WARN( "oox", "Drawing::createAndInsertXShape - error during shape object creation: " << e.Message ); } OSL_ENSURE( xShape.is(), "Drawing::createAndInsertXShape - cannot instanciate shape object" ); return xShape; |