diff options
author | Vinaya Mandke <vinaya.mandke@synerzip.com> | 2014-01-08 18:54:51 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-13 17:48:18 +0100 |
commit | c4ff46485f0461de6a2804ae859dbbc81b6af105 (patch) | |
tree | b314c4ec6ea2da7ddf85c5f091a7755e5c9d9a83 /oox | |
parent | 4a68f12691d4fd77652d824ccb4147e8ce643182 (diff) |
fdo#65833 Fix to preserve VML Canvas Information
Grab-bagged the "editas" attribute of v:group and added UT for
the same
Please verify this fix on MS Office 2007 as it renders the mc:Fallback VML part
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/7335
Change-Id: I4e4456997621089967514009005ee775b71d6d69
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/vmlexport.cxx | 18 | ||||
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 22 | ||||
-rw-r--r-- | oox/source/vml/vmlshapecontext.cxx | 2 |
3 files changed, 39 insertions, 3 deletions
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index c594cd5cc2b3..85003b7d5445 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -129,9 +129,18 @@ sal_uInt32 VMLExport::EnterGroup( const OUString& rShapeName, const Rectangle* p if ( rShapeName.getLength() ) pAttrList->add( XML_alt, OUStringToOString( rShapeName, RTL_TEXTENCODING_UTF8 ) ); + sal_Bool rbAbsolutePos = true; + //editAs + OUString rEditAs = EscherEx::GetEditAs(); + if (!rEditAs.isEmpty()) + { + pAttrList->add(XML_editas, OUStringToOString( rEditAs, RTL_TEXTENCODING_UTF8 )); + rbAbsolutePos = false; + } + // style if ( pRect ) - AddRectangleDimensions( aStyle, *pRect ); + AddRectangleDimensions( aStyle, *pRect, rbAbsolutePos ); if ( !aStyle.isEmpty() ) pAttrList->add( XML_style, aStyle.makeStringAndClear() ); @@ -844,12 +853,15 @@ void VMLExport::AddLineDimensions( const Rectangle& rRectangle ) .makeStringAndClear() ); } -void VMLExport::AddRectangleDimensions( OStringBuffer& rBuffer, const Rectangle& rRectangle ) +void VMLExport::AddRectangleDimensions( OStringBuffer& rBuffer, const Rectangle& rRectangle, sal_Bool rbAbsolutePos) { if ( !rBuffer.isEmpty() ) rBuffer.append( ";" ); - rBuffer.append( "position:absolute;" ); + if (rbAbsolutePos) + { + rBuffer.append( "position:absolute;" ); + } if ( mnGroupLevel == 1 ) { diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 731931df66ea..31828dbba891 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -1068,6 +1068,28 @@ Reference< XShape > GroupShape::implConvertAndInsert( const Reference< XShapes > catch( Exception& ) { } + + if (!maTypeModel.maEditAs.isEmpty()) + { + uno::Reference<beans::XPropertySet> xPropertySet(xGroupShape, uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aGrabBag; + xPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag; + beans::PropertyValue aPair; + aPair.Name = "mso-edit-as"; + aPair.Value = uno::makeAny(maTypeModel.maEditAs); + if (aGrabBag.hasElements()) + { + sal_Int32 nLength = aGrabBag.getLength(); + aGrabBag.realloc(nLength + 1); + aGrabBag[nLength] = aPair; + } + else + { + aGrabBag.realloc(1); + aGrabBag[0] = aPair; + } + xPropertySet->setPropertyValue("InteropGrabBag", uno::makeAny(aGrabBag)); + } // Make sure group shapes are inline as well, unless there is an explicit different style. PropertySet aPropertySet(xGroupShape); lcl_SetAnchorType(aPropertySet, maTypeModel); diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index 95c98a281fb6..9e51e2a4177b 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -312,6 +312,8 @@ ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper& rParent, ShapeType& r // For roundrect we may have a arcsize attribute to read mrTypeModel.maArcsize = rAttribs.getString( XML_arcsize,OUString( ) ); + // editas + mrTypeModel.maEditAs = rAttribs.getString(XML_editas, OUString()); } ContextHandlerRef ShapeTypeContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) |