summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2012-02-23 13:51:21 +0100
committerCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2012-02-23 13:56:24 +0100
commit94698d89f675da9b4da1143fa150bbd76def6ccf (patch)
treee9e2444d3e4cfbf61d0c05524f2cf1937a97ee12 /oox
parentf0a0b8fb67f76dd91ac2e28f67620d2e026cf4be (diff)
fdo#45560: Fixed docx textbox position and size import
Diffstat (limited to 'oox')
-rw-r--r--oox/source/vml/vmldrawing.cxx26
1 files changed, 22 insertions, 4 deletions
diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx
index 8c6207f7737d..1a3530db9449 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;