[Libreoffice-commits] .: oox/inc oox/source sw/source
oox/inc/oox/export/vmlexport.hxx |2 +- oox/source/export/vmlexport.cxx |6 +++--- sw/source/filter/ww8/rtfsdrexport.cxx |2 +- sw/source/filter/ww8/rtfsdrexport.hxx |2 +- 4 files changed, 6 insertions(+), 6 deletions(-) New commits: commit a0d2c3c59fbe9324395152e544890fe298b60432 Author: Miklos Vajna vmik...@suse.cz Date: Fri Jan 4 18:12:06 2013 +0100 adapt RtfSdrExport and oox::vml::VMLExport to filter changes diff --git a/oox/inc/oox/export/vmlexport.hxx b/oox/inc/oox/export/vmlexport.hxx index 54296a0..29ccdab 100644 --- a/oox/inc/oox/export/vmlexport.hxx +++ b/oox/inc/oox/export/vmlexport.hxx @@ -111,7 +111,7 @@ private: virtual void OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance = 0 ); virtual void CloseContainer(); -virtual sal_uInt32 EnterGroup( const String rShapeName, const Rectangle* pBoundRect = 0 ); +virtual sal_uInt32 EnterGroup( const OUString rShapeName, const Rectangle* pBoundRect = 0 ); virtual void LeaveGroup(); virtual void AddShape( sal_uInt32 nShapeType, sal_uInt32 nShapeFlags, sal_uInt32 nShapeId = 0 ); diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index b843baf..407180c 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -99,7 +99,7 @@ void VMLExport::CloseContainer() EscherEx::CloseContainer(); } -sal_uInt32 VMLExport::EnterGroup( const String rShapeName, const Rectangle* pRect ) +sal_uInt32 VMLExport::EnterGroup( const OUString rShapeName, const Rectangle* pRect ) { sal_uInt32 nShapeId = GenerateShapeId(); @@ -108,8 +108,8 @@ sal_uInt32 VMLExport::EnterGroup( const String rShapeName, const Rectangle* pRe pAttrList-add( XML_id, ShapeIdString( nShapeId ) ); -if ( rShapeName.Len() ) -pAttrList-add( XML_alt, OUStringToOString( OUString( rShapeName ), RTL_TEXTENCODING_UTF8 ) ); +if ( rShapeName.getLength() ) +pAttrList-add( XML_alt, OUStringToOString( rShapeName, RTL_TEXTENCODING_UTF8 ) ); // style if ( pRect ) diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index 91fe300..2ca7ed6 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -82,7 +82,7 @@ void RtfSdrExport::CloseContainer() EscherEx::CloseContainer(); } -sal_uInt32 RtfSdrExport::EnterGroup( const String /*rShapeName*/, const Rectangle* /*pRect*/ ) +sal_uInt32 RtfSdrExport::EnterGroup( const OUString /*rShapeName*/, const Rectangle* /*pRect*/ ) { SAL_INFO(sw.rtf, OSL_THIS_FUNC); diff --git a/sw/source/filter/ww8/rtfsdrexport.hxx b/sw/source/filter/ww8/rtfsdrexport.hxx index 69c25d2..12eafbf 100644 --- a/sw/source/filter/ww8/rtfsdrexport.hxx +++ b/sw/source/filter/ww8/rtfsdrexport.hxx @@ -82,7 +82,7 @@ private: virtual void CloseContainer(); using EscherEx::EnterGroup; -virtual sal_uInt32 EnterGroup( const String rShapeName, const Rectangle* pBoundRect = 0 ); +virtual sal_uInt32 EnterGroup( const OUString rShapeName, const Rectangle* pBoundRect = 0 ); virtual void LeaveGroup(); virtual void AddShape( sal_uInt32 nShapeType, sal_uInt32 nShapeFlags, sal_uInt32 nShapeId = 0 ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: oox/inc oox/source sw/source writerfilter/source
oox/inc/oox/drawingml/drawingmltypes.hxx |2 +- oox/inc/oox/vml/vmlshape.hxx |1 + oox/source/token/properties.txt |1 + oox/source/vml/vmlshape.cxx | 14 +- oox/source/vml/vmlshapecontext.cxx|1 + sw/source/core/layout/anchoreddrawobject.cxx |7 +-- writerfilter/source/dmapper/DomainMapper_Impl.cxx |7 +++ 7 files changed, 29 insertions(+), 4 deletions(-) New commits: commit 51cfbf0cfaec395a99a00f2c20fcba96de9a4427 Author: Miklos Vajna vmik...@suse.cz Date: Thu Mar 22 10:34:24 2012 +0100 n#751054 fix VML import of absolutely positioned pictures There were multiple issues here: - convertEmuToHmm() not handling negative values - position:absolute style property being ignored - mso-position-vertical-relative is not converted to text::RelOrientation - SwAnchoredDrawObject::_SetPositioningAttr() re-positioning already positioned objects - DomainMapper_Impl::PushShapeContext() inserting positioned objects as character diff --git a/oox/inc/oox/drawingml/drawingmltypes.hxx b/oox/inc/oox/drawingml/drawingmltypes.hxx index 600b1bc..71174b3 100644 --- a/oox/inc/oox/drawingml/drawingmltypes.hxx +++ b/oox/inc/oox/drawingml/drawingmltypes.hxx @@ -156,7 +156,7 @@ inline sal_Int64 convertHmmToEmu( sal_Int32 nValue ) /** Converts the passed 64-bit integer value from EMUs to 1/100 mm. */ inline sal_Int32 convertEmuToHmm( sal_Int64 nValue ) { -return getLimitedValue sal_Int32, sal_Int64 ( (nValue + EMU_PER_HMM / 2) / EMU_PER_HMM, 0, SAL_MAX_INT32 ); +return getLimitedValue sal_Int32, sal_Int64 ( (nValue + EMU_PER_HMM / 2) / EMU_PER_HMM, SAL_MIN_INT32, SAL_MAX_INT32 ); } // diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx index 1998a02..37e9c09 100644 --- a/oox/inc/oox/vml/vmlshape.hxx +++ b/oox/inc/oox/vml/vmlshape.hxx @@ -79,6 +79,7 @@ struct ShapeTypeModel ::rtl::OUString maHeight; /// Height of the shape bounding box (number with unit). ::rtl::OUString maMarginLeft; /// X position of the shape bounding box to shape anchor (number with unit). ::rtl::OUString maMarginTop;/// Y position of the shape bounding box to shape anchor (number with unit). +::rtl::OUString maPositionVerticalRelative; /// The Y position is relative to this. StrokeModel maStrokeModel; /// Border line formatting. FillModel maFillModel;/// Shape fill formatting. diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index 176ae08..560f879 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -498,6 +498,7 @@ VerticalAlign VerticalSplitMode VerticalSplitPositionTwips VertOrientPosition +VertOrientRelation ViewBox Visible VisibleFlag diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index c2fbd65..bdecb8b 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -42,6 +42,7 @@ #include com/sun/star/text/XTextContent.hpp #include com/sun/star/text/XTextDocument.hpp #include com/sun/star/text/XTextFrame.hpp +#include com/sun/star/text/TextContentAnchorType.hpp #include rtl/math.hxx #include rtl/ustrbuf.hxx #include oox/drawingml/shapepropertymap.hxx @@ -59,6 +60,7 @@ using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::uno::Any; +using namespace ::com::sun::star; using namespace ::com::sun::star::text; namespace oox { @@ -524,11 +526,21 @@ Reference XShape ComplexShape::implConvertAndInsert( const Reference XShapes if( xShape.is() ) { OUString aGraphicUrl = rFilter.getGraphicHelper().importEmbeddedGraphicObject( aGraphicPath ); +PropertySet aPropSet( xShape ); if( !aGraphicUrl.isEmpty() ) { -PropertySet aPropSet( xShape ); aPropSet.setProperty( PROP_GraphicURL, aGraphicUrl ); } +// If the shape has an absolute position, set the properties accordingly. +if (maTypeModel.maPosition.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(absolute))) +{ +aPropSet.setProperty(PROP_HoriOrientPosition, rShapeRect.X); +aPropSet.setProperty(PROP_VertOrientPosition, rShapeRect.Y); +} +if (maTypeModel.maPositionVerticalRelative.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(page))) +{ +aPropSet.setProperty(PROP_VertOrientRelation, text::RelOrientation::PAGE_FRAME); +} } return xShape; } diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index e0e38ce..91703fc 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++