[Libreoffice-commits] core.git: filter/source include/filter include/oox oox/source
filter/source/msfilter/util.cxx| 1244 ++--- include/filter/msfilter/util.hxx |4 include/oox/export/drawingml.hxx |6 oox/source/export/DMLPresetShapeExport.cxx |4 oox/source/export/drawingml.cxx| 12 oox/source/export/shapes.cxx |4 6 files changed, 620 insertions(+), 654 deletions(-) New commits: commit d65c8b37595a4775fd766b2b7becbc01fe21a04e Author: Mike Kaganski AuthorDate: Mon Mar 14 18:27:43 2022 +0300 Commit: Mike Kaganski CommitDate: Tue Mar 15 06:19:53 2022 +0100 Simplify GetOOXMLPresetGeometry and GETVMLShapeType Let them use types that know string lengths, don't require conversion, and are convenient at call sites. Also inline the maps initialization, instead of having separate arrays and initialization loops. Change-Id: Id4469f3f99f3f0eb2cd83f0671cf892df4e420a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131550 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx index d0e4b24fe08c..51e2d3de5a80 100644 --- a/filter/source/msfilter/util.cxx +++ b/filter/source/msfilter/util.cxx @@ -601,650 +601,616 @@ EquationResult ParseCombinedChars(const OUString& rStr) return aResult; } -namespace { - -struct CustomShapeTypeTranslationTable -{ -const char* sOOo; -const char* sMSO; -}; - -} - -const CustomShapeTypeTranslationTable pCustomShapeTypeTranslationTable[] = +OString GetOOXMLPresetGeometry( std::u16string_view rShapeType ) { -// { "non-primitive", mso_sptMin }, -{ "frame", "frame" }, -{ "rectangle", "rect" }, -{ "round-rectangle", "roundRect" }, -{ "ellipse", "ellipse" }, -{ "diamond", "diamond" }, -{ "isosceles-triangle", "triangle" }, -{ "right-triangle", "rtTriangle" }, -{ "parallelogram", "parallelogram" }, -{ "trapezoid", "trapezoid" }, -{ "hexagon", "hexagon" }, -{ "octagon", "octagon" }, -{ "cross", "plus" }, -{ "star5", "star5" }, -{ "right-arrow", "rightArrow" }, -// { "mso-spt14", mso_sptThickArrow }, -{ "pentagon-right", "homePlate" }, -{ "cube", "cube" }, -// { "mso-spt17", mso_sptBalloon }, -// { "mso-spt18", mso_sptSeal }, -{ "mso-spt19", "arc" }, -{ "mso-spt20", "line" }, -{ "mso-spt21", "plaque" }, -{ "can", "can" }, -{ "ring", "donut" }, -{ "mso-spt24", "textPlain" }, -{ "mso-spt25", "textStop" }, -{ "mso-spt26", "textTriangle" }, -{ "mso-spt27", "textCanDown" }, -{ "mso-spt28", "textWave1" }, -{ "mso-spt29", "textArchUpPour" }, -{ "mso-spt30", "textCanDown" }, -{ "mso-spt31", "textArchUp" }, -{ "mso-spt32", "straightConnector1" }, -{ "mso-spt33", "bentConnector2" }, -{ "mso-spt34", "bentConnector3" }, -{ "mso-spt35", "bentConnector4" }, -{ "mso-spt36", "bentConnector5" }, -{ "mso-spt37", "curvedConnector2" }, -{ "mso-spt38", "curvedConnector3" }, -{ "mso-spt39", "curvedConnector4" }, -{ "mso-spt40", "curvedConnector5" }, -{ "mso-spt41", "callout1" }, -{ "mso-spt42", "callout2" }, -{ "mso-spt43", "callout3" }, -{ "mso-spt44", "accentCallout1" }, -{ "mso-spt45", "accentCallout2" }, -{ "mso-spt46", "accentCallout3" }, -{ "line-callout-1", "borderCallout1" }, -{ "line-callout-2", "borderCallout2" }, -{ "line-callout-3", "borderCallout3" }, -{ "mso-spt49", "borderCallout3" }, -{ "mso-spt50", "accentBorderCallout1" }, -{ "mso-spt51", "accentBorderCallout2" }, -{ "mso-spt52", "accentBorderCallout3" }, -{ "mso-spt53", "ribbon" }, -{ "mso-spt54", "ribbon2" }, -{ "chevron", "chevron" }, -{ "pentagon", "pentagon" }, -{ "forbidden", "noSmoking" }, -{ "star8", "star8" }, -{ "mso-spt59", "star16" }, -{ "mso-spt60", "star32" }, -{ "rectangular-callout", "wedgeRectCallout" }, -{ "round-rectangular-callout", "wedgeRoundRectCallout" }, -{ "round-callout", "wedgeEllipseCallout" }, -{ "mso-spt64", "wave" }, -{ "paper", "foldedCorner" }, -{ "left-arrow", "leftArrow" }, -{ "down-arrow", "downArrow" }, -{ "up-arrow", "upArrow" }, -{ "left-right-arrow", "leftRightArrow" }, -{ "up-down-arrow", "upDownArrow" }, -{ "mso-spt71", "irregularSeal1" }, -{ "bang", "irregularSeal2" }, -{ "lightning", "lightningBolt" }, -{ "heart", "heart" }, -{ "quad-arrow", "quadArrow" }, -{ "left-arrow-callout", "leftArrowCallout" }, -{ "right-arrow-callout", "rightArrowCallout" }, -{ "up-arrow-callout", "upArrowCallout" }, -{ "down-arrow-callout", "downArrowCallout" }, -{ "left-right-arrow-callout", "leftRightArrowCallout" }, -{ "up-down-arrow-callout", "upDownArrowCallout" }, -{ "quad-arrow-callout", "quadArrowCallout" }, -{ "quad-bevel", "bevel" }, -{ "left-bracket", "leftBracket" }, -{ "right-bracket",
[Libreoffice-commits] core.git: filter/source include/filter include/oox oox/source sc/source sd/source sw/source
filter/source/msfilter/escherex.cxx| 47 ++-- filter/source/msfilter/eschesdo.cxx| 89 filter/source/msfilter/msdffimp.cxx| 77 +++-- filter/source/msfilter/svdfppt.cxx | 14 +-- include/filter/msfilter/escherex.hxx | 33 ++--- include/filter/msfilter/msdffimp.hxx | 26 ++- include/oox/export/vmlexport.hxx |4 - oox/source/export/shapes.cxx |2 oox/source/export/vmlexport.cxx| 17 ++-- sc/source/filter/excel/xeescher.cxx|7 + sc/source/filter/excel/xiescher.cxx| 10 +- sc/source/filter/inc/xiescher.hxx | 14 +-- sc/source/filter/xcl97/xcl97rec.cxx|4 - sd/source/filter/eppt/eppt.cxx |9 +- sd/source/filter/eppt/eppt.hxx |2 sd/source/filter/eppt/epptso.cxx | 120 +++-- sd/source/filter/eppt/escherex.cxx |4 - sw/source/filter/ww8/docxsdrexport.cxx |2 sw/source/filter/ww8/escher.hxx|2 sw/source/filter/ww8/rtfsdrexport.cxx | 18 +--- sw/source/filter/ww8/rtfsdrexport.hxx |4 - sw/source/filter/ww8/wrtw8esh.cxx | 34 + sw/source/filter/ww8/ww8graf.cxx |4 - sw/source/filter/ww8/ww8par.cxx|8 +- 24 files changed, 306 insertions(+), 245 deletions(-) New commits: commit 31ee13b5a40715e217711e48753eeb7170e3349c Author: Jochen NitschkeDate: Thu Aug 31 14:13:46 2017 +0200 convert SHAPEFLAG defines to scoped enum ShapeFlag they were defined in escherex.hxx as SHAPEFLAG_* and in msdffimp.hxx as SP_*. Added include for escherex.hxx to msdffimp.hxx. Filled the missing flag bits. ShapeFlag::Deleted is not used at the moment. Convert ADD_SHAPE macro to lambda. Fix horizontal/vertical mixup in RtfSdrExport::AddLineDimensions. Comments for flag Connector were wrong. The flag applies to shapes which ARE connectors. MSO definition: "connector: A line that is used to connect two or more shapes and that remains connected to those shapes." So Rectangles and such with Connector flag don't make sense. Change-Id: I735de00110411b280a302840dc0fcdfac5156399 Reviewed-on: https://gerrit.libreoffice.org/41754 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 9660cbfccf07..84530d4e4269 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -2123,7 +2123,7 @@ void lcl_Rotate(sal_Int32 nAngle, Point center, Point& pt) Generally, draw the connector from top to bottom, from left to right when meet the adjust value, but when (X1>X2 or Y1>Y2),the draw director must be reverse, FlipV or FlipH should be set to true. */ -bool lcl_GetAngle(tools::Polygon ,sal_uInt16& rShapeFlags,sal_Int32& nAngle ) +bool lcl_GetAngle(tools::Polygon , ShapeFlag& rShapeFlags,sal_Int32& nAngle ) { Point aStart = rPoly[0]; Point aEnd = rPoly[rPoly.GetSize()-1]; @@ -2139,22 +2139,22 @@ bool lcl_GetAngle(tools::Polygon ,sal_uInt16& rShapeFlags,sal_Int32& nAngl if ( p1.X() > p2.X() ) { if ( nAngle ) -rShapeFlags |= SHAPEFLAG_FLIPV; +rShapeFlags |= ShapeFlag::FlipV; else -rShapeFlags |= SHAPEFLAG_FLIPH; +rShapeFlags |= ShapeFlag::FlipH; } if ( p1.Y() > p2.Y() ) { if ( nAngle ) -rShapeFlags |= SHAPEFLAG_FLIPH; +rShapeFlags |= ShapeFlag::FlipH; else -rShapeFlags |= SHAPEFLAG_FLIPV; +rShapeFlags |= ShapeFlag::FlipV; } -if ( (rShapeFlags_FLIPH) && (rShapeFlags_FLIPV) ) +if ( (rShapeFlags::FlipH) && (rShapeFlags::FlipV) ) { -rShapeFlags &= ~( SHAPEFLAG_FLIPH | SHAPEFLAG_FLIPV ); +rShapeFlags &= ~ShapeFlag( ShapeFlag::FlipH | ShapeFlag::FlipV ); nAngle +=18000; } @@ -2171,10 +2171,11 @@ bool lcl_GetAngle(tools::Polygon ,sal_uInt16& rShapeFlags,sal_Int32& nAngl bool EscherPropertyContainer::CreateConnectorProperties( const css::uno::Reference< css::drawing::XShape > & rXShape, EscherSolverContainer& rSolverContainer, css::awt::Rectangle& rGeoRect, -sal_uInt16& rShapeType, sal_uInt16& rShapeFlags ) +sal_uInt16& rShapeType, ShapeFlag& rShapeFlags ) { bool bRetValue = false; -rShapeType = rShapeFlags = 0; +rShapeType = 0; +rShapeFlags = ShapeFlag::NONE; if ( rXShape.is() ) { @@ -2195,7 +2196,7 @@ bool EscherPropertyContainer::CreateConnectorProperties( { aEndPoint = *o3tl::doAccess(aAny); -rShapeFlags = SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT | SHAPEFLAG_CONNECTOR; +rShapeFlags = ShapeFlag::HaveAnchor |
[Libreoffice-commits] core.git: filter/source include/filter include/oox oox/source sw/qa
filter/source/msfilter/eschesdo.cxx | 16 - filter/source/msfilter/eschesdo.hxx |1 filter/source/msfilter/util.cxx |1 include/filter/msfilter/escherex.hxx|6 ++- include/oox/export/vmlexport.hxx|2 - oox/source/export/vmlexport.cxx | 48 +++- sw/qa/extras/ooxmlexport/data/fdo69616.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx|9 + 8 files changed, 64 insertions(+), 19 deletions(-) New commits: commit f1ec5dcfca45e9623d3da05503353df63e8dba4f Author: Rohit Deshmukh rohit.deshm...@synerzip.com Date: Mon Jan 6 11:26:46 2014 +0530 fdo#69616: Fix for VML part missing for group. Cause: - In altenrate content, Fallback contains only group tag. Implementation: - Added export logic in Vml export. - Added unit test case for vml group. Change-Id: Ia1c9834950528dc892caea1cb675a7f42165d9ba Reviewed-on: https://gerrit.libreoffice.org/7276 Reviewed-by: Miklos Vajna vmik...@collabora.co.uk Tested-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index c5fb193..afddce7 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -233,7 +233,10 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject rObj, ImplEESdrObject aObj( *this, *(Reference XShape *) xXIndexAccess-getByIndex( n ).getValue() ); if( aObj.IsValid() ) +{ +aObj.SetOOXML(bOOxmlExport); ImplWriteShape( aObj, rSolverContainer, ePageType, bOOxmlExport ); +} } mpEscherEx-LeaveGroup(); } @@ -686,7 +689,9 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject rObj, ImplFlipBoundingBox( rObj, aPropOpt ); aPropOpt.CreateShapeProperties( rObj.GetShapeRef() ); -mpEscherEx-Commit( aPropOpt, rObj.GetRect() ); +const SdrObject* sdrObj = rObj.GetSdrObject(); +mpEscherEx-AddSdrObjectVMLObject(*sdrObj ); +mpEscherEx-Commit( aPropOpt, rObj.GetRect()); if( mpEscherEx-GetGroupLevel() 1 ) mpEscherEx-AddChildAnchor( rObj.GetRect() ); @@ -784,7 +789,9 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject rObj, } rObj.SetAngle( nAngle ); aPropOpt.CreateShapeProperties( rObj.GetShapeRef() ); -mpEscherEx-Commit( aPropOpt, rObj.GetRect() ); +const SdrObject* sdrObj = rObj.GetSdrObject(); +mpEscherEx-AddSdrObjectVMLObject(*sdrObj ); +mpEscherEx-Commit( aPropOpt, rObj.GetRect()); // write the childanchor mpEscherEx-AddChildAnchor( rObj.GetRect() ); @@ -1288,4 +1295,9 @@ bool ImplEESdrObject::GetOOXML() const return mbOOXML; } +void ImplEESdrObject::SetOOXML(bool bOOXML) +{ +mbOOXML = bOOXML; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/msfilter/eschesdo.hxx b/filter/source/msfilter/eschesdo.hxx index 53f5705..dd78aba 100644 --- a/filter/source/msfilter/eschesdo.hxx +++ b/filter/source/msfilter/eschesdo.hxx @@ -87,6 +87,7 @@ public: sal_uInt32 ImplGetText(); sal_BoolImplHasText() const; bool GetOOXML() const; +void SetOOXML(bool bOOXML); }; diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx index 72e15dd..a2b121c 100644 --- a/filter/source/msfilter/util.cxx +++ b/filter/source/msfilter/util.cxx @@ -1085,6 +1085,7 @@ static const CustomShapeTypeTranslationTable pCustomShapeTypeTranslationTable[] { ooxml-cloudCallout, cloudCallout }, { ooxml-callout1, callout1 }, { ooxml-ribbon, ribbon }, +{ ooxml-rect, rectangle }, }; static struct { diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx index d69e49d..70a017a 100644 --- a/include/filter/msfilter/escherex.hxx +++ b/include/filter/msfilter/escherex.hxx @@ -1675,7 +1675,7 @@ public: // a ESCHER_Sp is being written ( a ESCHER_DgContainer has to be opened for this purpose!) virtual void AddShape( sal_uInt32 nShpInstance, sal_uInt32 nFlagIds, sal_uInt32 nShapeID = 0 ); -virtual void Commit( EscherPropertyContainer rProps, const Rectangle rRect ); +virtual void Commit( EscherPropertyContainer rProps, const Rectangle rRect); sal_uInt32 GetColor( const sal_uInt32 nColor, sal_Bool bSwap = sal_True ); sal_uInt32 GetColor( const Color rColor, sal_Bool bSwap = sal_True ); @@ -1687,6 +1687,10 @@ public: /// returns the ShapeID sal_uInt32 AddSdrObject( const SdrObject rObj, bool ooxmlExport = false ); +virtual void AddSdrObjectVMLObject( const SdrObject /*rObj*/) +{ +//
[Libreoffice-commits] core.git: filter/source include/filter include/oox oox/source sw/qa
filter/source/msfilter/escherex.cxx |5 + filter/source/msfilter/eschesdo.cxx | 24 include/filter/msfilter/escherex.hxx|4 +++- include/oox/export/vmlexport.hxx|2 +- include/oox/vml/vmlshape.hxx|2 ++ oox/source/export/vmlexport.cxx | 18 +++--- oox/source/vml/vmlshape.cxx | 22 ++ oox/source/vml/vmlshapecontext.cxx |2 ++ sw/qa/extras/ooxmlexport/data/fdo65833.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx| 10 ++ 10 files changed, 84 insertions(+), 5 deletions(-) New commits: commit c4ff46485f0461de6a2804ae859dbbc81b6af105 Author: Vinaya Mandke vinaya.man...@synerzip.com Date: Wed Jan 8 18:54:51 2014 +0530 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 diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 782dcfc..129831e 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -5081,6 +5081,11 @@ void EscherEx::ReplacePersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset ) PtReplace( ESCHER_Persist_PrivateEntry | nKey, nOffset ); } +void EscherEx::SetEditAs( OUString rEditAs ) +{ +mEditAs = rEditAs; +} + sal_uInt32 EscherEx::GetPersistOffset( sal_uInt32 nKey ) { return PtGetOffsetByID( ESCHER_Persist_PrivateEntry | nKey ); diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index 16311df..fa697ee 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -191,6 +191,30 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject rObj, if( const SdrObject* pSdrObj = rObj.GetSdrObject() ) if (!pSdrObj-GetName().isEmpty()) aShapeName = pSdrObj-GetName(); +uno::Reference drawing::XShape mXShape(rObj.GetShapeRef(), uno::UNO_QUERY); +if (mXShape.is()) +{ +uno::Referencebeans::XPropertySet xPropertySet(mXShape, uno::UNO_QUERY); +if (xPropertySet.is()) +{ +uno::Sequencebeans::PropertyValue aGrabBag; +uno::Reference XPropertySetInfo xPropInfo = xPropertySet-getPropertySetInfo(); +if ( xPropInfo.is() xPropInfo-hasPropertyByName( InteropGrabBag ) ) +{ +xPropertySet-getPropertyValue( InteropGrabBag ) = aGrabBag; +for (int i=0; i aGrabBag.getLength(); i++) +{ +if (aGrabBag[i].Name == mso-edit-as) +{ +OUString rEditAs; +aGrabBag[i].Value = rEditAs; +mpEscherEx-SetEditAs(rEditAs); +break; +} +} +} +} +} Point aTextRefPoint; diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx index e24996c..d69e49d 100644 --- a/include/filter/msfilter/escherex.hxx +++ b/include/filter/msfilter/escherex.hxx @@ -1588,6 +1588,7 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable sal_BoolmbEscherDg; sal_BoolmbOleEmf; // OLE is EMF instead of WMF boolmbOOXML; +OUStringmEditAs; virtual sal_Bool DoSeek( sal_uInt32 nKey ); @@ -1643,7 +1644,8 @@ public: sal_BoolSeekToPersistOffset( sal_uInt32 nKey ); virtual sal_Bool InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue ); // nValue is being inserted into the Stream where it's appropriate (overwrite modus), without that the // current StreamPosition changes - +voidSetEditAs( OUString rEditAs ); +rtl::OUString GetEditAs() { return mEditAs; } SvStream GetStream() const { return *mpOutStrm; } sal_uLong GetStreamPos() const{ return mpOutStrm-Tell(); } diff --git a/include/oox/export/vmlexport.hxx b/include/oox/export/vmlexport.hxx index 876ff7b..bc7bf29 100644 --- a/include/oox/export/vmlexport.hxx +++ b/include/oox/export/vmlexport.hxx @@ -133,7 +133,7 @@ private: void AddLineDimensions( const Rectangle rRectangle ); /// Add position and size to the OStringBuffer. -void AddRectangleDimensions( OStringBuffer rBuffer,
[Libreoffice-commits] core.git: filter/source include/filter include/oox oox/source sw/source
filter/source/msfilter/escherex.cxx | 11 +++ filter/source/msfilter/eschesdo.cxx | 14 +++--- filter/source/msfilter/eschesdo.hxx |4 ++-- include/filter/msfilter/escherex.hxx |8 +--- include/oox/export/vmlexport.hxx |2 +- oox/source/export/vmlexport.cxx |4 ++-- sw/source/filter/ww8/docxattributeoutput.cxx |2 +- 7 files changed, 25 insertions(+), 20 deletions(-) New commits: commit 8fe352be80ff69552f622f3c7a6a6f269912ab71 Author: Nikhil Walvekar nikhil.walve...@synerzip.com Date: Fri Nov 29 14:03:46 2013 +0530 fdo#65836 Do not compress WMF / EMF file incase of OOXML export Change-Id: Ic498e5703ab48719f998be6da3f245843cc0979d Reviewed-on: https://gerrit.libreoffice.org/6849 Reviewed-by: Miklos Vajna vmik...@collabora.co.uk Tested-by: Miklos Vajna vmik...@collabora.co.uk diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 4f94859..1f41f2b 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -1429,7 +1429,7 @@ sal_Bool EscherPropertyContainer::CreateEmbeddedHatchProperties( const ::com::su sal_Bool EscherPropertyContainer::CreateGraphicProperties( const ::com::sun::star::uno::Reference ::com::sun::star::beans::XPropertySet rXPropSet, const OUString rSource, const sal_Bool bCreateFillBitmap, const sal_Bool bCreateCroppingAttributes, -const sal_Bool bFillBitmapModeAllowed ) +const sal_Bool bFillBitmapModeAllowed, const sal_Bool bOOxmlExport ) { sal_BoolbRetValue = sal_False; sal_BoolbCreateFillStyles = sal_False; @@ -1743,7 +1743,7 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties( SvMemoryStream aMemStrm; Rectangle aRect; -if ( aProvider.GetBlibID( aMemStrm, aUniqueId, aRect, NULL, pGraphicAttr ) ) +if ( aProvider.GetBlibID( aMemStrm, aUniqueId, aRect, NULL, pGraphicAttr, bOOxmlExport ) ) { // grab BLIP from stream and insert directly as complex property // ownership of stream memory goes to complex property @@ -4231,7 +4231,8 @@ sal_Bool EscherGraphicProvider::GetPrefSize( const sal_uInt32 nBlibId, Size rPr } sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream rPicOutStrm, const OString rId, -const Rectangle /* rBoundRect */, const com::sun::star::awt::Rectangle* pVisArea, const GraphicAttr* pGraphicAttr ) +const Rectangle /* rBoundRect */, const com::sun::star::awt::Rectangle* pVisArea, +const GraphicAttr* pGraphicAttr, const sal_Bool bOOxmlExport ) { sal_uInt32 nBlibId = 0; GraphicObject aGraphicObject( rId ); @@ -4367,7 +4368,9 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream rPicOutStrm, const OStrin else if ( eBlibType == PEG ) rPicOutStrm (sal_uInt16)0x0505; } -if ( ( eBlibType == PEG ) || ( eBlibType == PNG ) ) +// #69607 do not compress WMF files if we are in OOXML export +if ( ( eBlibType == PEG ) || ( eBlibType == PNG ) || +( ( ( eBlibType == WMF ) || ( eBlibType == EMF ) ) bOOxmlExport ) ) { nExtra = 17; p_EscherBlibEntry-mnSizeExtra = nExtra + 8; diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index ca78c69..16311df 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -173,7 +173,7 @@ void ImplEESdrWriter::MapRect(ImplEESdrObject /* rObj */ ) sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject rObj, EscherSolverContainer rSolverContainer, -ImplEESdrPageType ePageType ) +ImplEESdrPageType ePageType, const sal_Bool bOOxmlExport ) { sal_uInt32 nShapeID = 0; sal_uInt16 nShapeType = 0; @@ -209,7 +209,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject rObj, ImplEESdrObject aObj( *this, *(Reference XShape *) xXIndexAccess-getByIndex( n ).getValue() ); if( aObj.IsValid() ) -ImplWriteShape( aObj, rSolverContainer, ePageType ); +ImplWriteShape( aObj, rSolverContainer, ePageType, bOOxmlExport ); } mpEscherEx-LeaveGroup(); } @@ -551,7 +551,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject rObj, else { ADD_SHAPE( ESCHER_ShpInst_PictureFrame, 0xa00 ); -