diff options
-rw-r--r-- | include/oox/vml/vmlshape.hxx | 1 | ||||
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 14 | ||||
-rw-r--r-- | oox/source/vml/vmlshapecontext.cxx | 1 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo76591.docx | bin | 0 -> 109793 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 17 |
6 files changed, 40 insertions, 1 deletions
diff --git a/include/oox/vml/vmlshape.hxx b/include/oox/vml/vmlshape.hxx index d38c58f25246..832d3be95744 100644 --- a/include/oox/vml/vmlshape.hxx +++ b/include/oox/vml/vmlshape.hxx @@ -64,6 +64,7 @@ struct OOX_DLLPUBLIC ShapeTypeModel OptValue< Int32Pair > moCoordPos; ///< Top-left position of coordinate system for children scaling. OptValue< Int32Pair > moCoordSize; ///< Size of coordinate system for children scaling. OUString maPosition; ///< Position type of the shape. + OUString maZIndex; ///< ZIndex of the shape OUString maLeft; ///< X position of the shape bounding box (number with unit). OUString maTop; ///< Y position of the shape bounding box (number with unit). OUString maWidth; ///< Width of the shape bounding box (number with unit). diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index e79c9b803c76..d4bdbcfb1ea9 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -41,6 +41,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/lang/XServiceInfo.hpp> #include <com/sun/star/text/TextContentAnchorType.hpp> #include <rtl/math.hxx> #include <rtl/ustrbuf.hxx> @@ -322,6 +323,19 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS PropertySet aShapeProp( xShape ); if( aShapeProp.hasProperty( PROP_Name ) ) aShapeProp.setProperty( PROP_Name, getShapeName() ); + uno::Reference< lang::XServiceInfo > xSInfo( xShape, uno::UNO_QUERY_THROW ); + if (xSInfo->supportsService("com.sun.star.text.TextFrame")) + { + uno::Sequence<beans::PropertyValue> aGrabBag; + uno::Reference<beans::XPropertySet> propertySet (xShape, uno::UNO_QUERY); + propertySet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag; + sal_Int32 length = aGrabBag.getLength(); + + aGrabBag.realloc( length+1 ); + aGrabBag[length].Name = "VML-Z-ORDER"; + aGrabBag[length].Value = uno::makeAny( maTypeModel.maZIndex.toInt32() ); + propertySet->setPropertyValue( "FrameInteropGrabBag", uno::makeAny(aGrabBag) ); + } Reference< XControlShape > xControlShape( xShape, uno::UNO_QUERY ); if ( xControlShape.is() && !getTypeModel().mbVisible ) { diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index fdeca3276169..146940e03041 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -399,6 +399,7 @@ void ShapeTypeContext::setStyle( const OUString& rStyle ) if( ConversionHelper::separatePair( aName, aValue, rStyle.getToken( 0, ';', nIndex ), ':' ) ) { if( aName == "position" ) mrTypeModel.maPosition = aValue; + else if( aName == "z-index" ) mrTypeModel.maZIndex = aValue; else if( aName == "left" ) mrTypeModel.maLeft = aValue; else if( aName == "top" ) mrTypeModel.maTop = aValue; else if( aName == "width" ) mrTypeModel.maWidth = aValue; diff --git a/sw/qa/extras/ooxmlexport/data/fdo76591.docx b/sw/qa/extras/ooxmlexport/data/fdo76591.docx Binary files differnew file mode 100644 index 000000000000..8ca43879ca83 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76591.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 68ef7ebbe7bd..aa48fda87959 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2989,6 +2989,14 @@ DECLARE_OOXMLEXPORT_TEST(testFDO76163 , "fdo76163.docx") assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:hyperlink/w:r[11]/w:fldChar", "fldCharType", "end" ); } +DECLARE_OOXMLEXPORT_TEST(fdo76591, "fdo76591.docx") +{ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]", "relativeHeight", "3"); +} + DECLARE_OOXMLEXPORT_TEST(test76317_2K10, "test76317_2K10.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 2177596330ad..d6c97ed55874 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -59,6 +59,7 @@ #include <com/sun/star/text/ControlCharacter.hpp> #include <com/sun/star/text/XTextColumns.hpp> #include <oox/mathml/import.hxx> + #include <GraphicHelpers.hxx> #ifdef DEBUG_DOMAINMAPPER #include <resourcemodel/QNameToString.hxx> @@ -1735,16 +1736,30 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape if (xSInfo->supportsService("com.sun.star.text.TextFrame")) { // Extract the special "btLr text frame" mode, requested by oox, if needed. + // Extract vml ZOrder from FrameInteropGrabBag uno::Reference<beans::XPropertySet> xShapePropertySet(xShape, uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aGrabBag; xShapePropertySet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag; + bool checkBtLrStatus = false;bool checkZOredrStatus = false; + for (int i = 0; i < aGrabBag.getLength(); ++i) { if (aGrabBag[i].Name == "mso-layout-flow-alt") { m_bFrameBtLr = aGrabBag[i].Value.get<OUString>() == "bottom-to-top"; - break; + checkBtLrStatus = true; } + if (aGrabBag[i].Name == "VML-Z-ORDER") + { + GraphicZOrderHelper* pZOrderHelper = m_rDMapper.graphicZOrderHelper(); + sal_Int32 zOrder; + aGrabBag[i].Value >>= zOrder; + xShapePropertySet->setPropertyValue( "ZOrder", uno::makeAny(pZOrderHelper->findZOrder(zOrder))); + pZOrderHelper->addItem(xShapePropertySet, zOrder); + checkZOredrStatus = true; + } + if(checkBtLrStatus && checkZOredrStatus) + break; } uno::Reference<text::XTextContent> xTextContent(xShape, uno::UNO_QUERY_THROW); |