summaryrefslogtreecommitdiff
path: root/filter/source
diff options
context:
space:
mode:
authorNikhil Walvekar <nikhil.walvekar@synerzip.com>2013-11-29 14:03:46 +0530
committerAndras Timar <andras.timar@collabora.com>2014-09-17 10:04:06 +0000
commit6f87913d843a97963703721506495bd57af36461 (patch)
treee995c84a370fbc9c1c8075dbe3c4d422b48b9236 /filter/source
parent23a817342f264bde5b6d4cb6b00b298c7b930430 (diff)
fdo#65836 bnc#621241 Do not compress WMF / EMF file incase of OOXML export
(cherry picked from commit 8fe352be80ff69552f622f3c7a6a6f269912ab71) Change-Id: Ic498e5703ab48719f998be6da3f245843cc0979d Reviewed-on: https://gerrit.libreoffice.org/11426 Reviewed-by: Nikhil Walvekar <nikhil.walvekar@synerzip.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'filter/source')
-rw-r--r--filter/source/msfilter/escherex.cxx11
-rw-r--r--filter/source/msfilter/eschesdo.cxx14
-rw-r--r--filter/source/msfilter/eschesdo.hxx4
3 files changed, 16 insertions, 13 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 7318de19195d..cc865ba1f1ae 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1428,7 +1428,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_Bool bRetValue = sal_False;
sal_Bool bCreateFillStyles = sal_False;
@@ -1742,7 +1742,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
@@ -4217,7 +4217,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 );
@@ -4353,7 +4354,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 0e20dfb03c3d..cbf457f4bd0c 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 );
- if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, "GraphicURL", sal_False, sal_True ) )
+ if ( aPropOpt.CreateGraphicProperties( rObj.mXPropSet, "GraphicURL", sal_False, sal_True, sal_True, bOOxmlExport ) )
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
}
}
@@ -934,10 +934,10 @@ void ImplEscherExSdr::ImplWriteCurrentPage()
}
-sal_uInt32 ImplEscherExSdr::ImplWriteTheShape( ImplEESdrObject& rObj )
+sal_uInt32 ImplEscherExSdr::ImplWriteTheShape( ImplEESdrObject& rObj , bool ooxmlExport )
{
DBG_ASSERT( mpSolverContainer, "ImplEscherExSdr::ImplWriteShape: no SolverContainer" );
- return ImplWriteShape( rObj, *mpSolverContainer, NORMAL );
+ return ImplWriteShape( rObj, *mpSolverContainer, NORMAL, ooxmlExport );
}
@@ -953,11 +953,11 @@ void EscherEx::AddUnoShapes( const Reference< XShapes >& rxShapes )
mpImplEscherExSdr->ImplWriteCurrentPage();
}
-sal_uInt32 EscherEx::AddSdrObject( const SdrObject& rObj )
+sal_uInt32 EscherEx::AddSdrObject( const SdrObject& rObj, bool ooxmlExport )
{
ImplEESdrObject aObj( *mpImplEscherExSdr, rObj );
if( aObj.IsValid() )
- return mpImplEscherExSdr->ImplWriteTheShape( aObj );
+ return mpImplEscherExSdr->ImplWriteTheShape( aObj, ooxmlExport );
return 0;
}
diff --git a/filter/source/msfilter/eschesdo.hxx b/filter/source/msfilter/eschesdo.hxx
index f01128533318..8ddc1db6dd81 100644
--- a/filter/source/msfilter/eschesdo.hxx
+++ b/filter/source/msfilter/eschesdo.hxx
@@ -150,7 +150,7 @@ protected:
sal_uInt32 ImplWriteShape( ImplEESdrObject& rObj,
EscherSolverContainer& rSolver,
- ImplEESdrPageType ePageType ); // returns ShapeID
+ ImplEESdrPageType ePageType, const sal_Bool bOOxmlExport = false ); // returns ShapeID
void ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherPropertyContainer& rPropOpt );
sal_Bool ImplGetText( ImplEESdrObject& rObj );
@@ -189,7 +189,7 @@ public:
bool ImplInitUnoShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
void ImplWriteCurrentPage();
- sal_uInt32 ImplWriteTheShape( ImplEESdrObject& rObj );
+ sal_uInt32 ImplWriteTheShape( ImplEESdrObject& rObj, bool ooxmlExport = false );
void ImplExitPage();
void ImplFlushSolverContainer();