summaryrefslogtreecommitdiff
path: root/sd/source/filter/eppt/epptso.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-11-20 12:03:21 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-11-20 13:26:49 +0100
commit7032be2e9edd82dad2d67f1582aaa57676bda4a1 (patch)
treed98a2a0321750662247d7dfb18aa3f0caf808b0c /sd/source/filter/eppt/epptso.cxx
parent1bad449a6a2427a2c9d217a3f84d9b350b28c0b3 (diff)
tdf#127086 PPT export: fix lost bitmap fill for OOXML custom shapes
PPT can't store an OOXML custom shape with fill bitmap, PowerPoint generates a fallback bitmap when saving to PPT. We used to keep the bitmap and loose the custom shape geometry, but that was changed with commit f4ba484183a1e7b9824f10580d633466c266828f (ooxml import: supprt cropping to shape, 2019-05-13). Fix the regression by going back to keeping the bitmap, a full fallback bitmap (ala PowerPoint), would be more work, taking e.g. blurry shadows (changing the shape position and size) into account. Change-Id: I7192f912077f2de026573855dbebbdf576e39ebc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106219 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sd/source/filter/eppt/epptso.cxx')
-rw-r--r--sd/source/filter/eppt/epptso.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 92ee21a6f5c6..b17dc66364e9 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -1666,6 +1666,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
bool bClosedBezier = mType == "drawing.ClosedBezier";
bool bPolyPolygon = mType == "drawing.PolyPolygon";
bool bPolyLine = mType == "drawing.PolyLine";
+ OUString aGraphicPropertyName("Graphic");
const css::awt::Size aSize100thmm( mXShape->getSize() );
const css::awt::Point aPoint100thmm( mXShape->getPosition() );
@@ -1700,6 +1701,20 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
css::drawing::FillStyle eFS;
aAny >>= eFS;
bIsHatching = eFS == css::drawing::FillStyle_HATCH;
+ if (mType == "drawing.Custom" && eFS == drawing::FillStyle_BITMAP)
+ {
+ ShapeFlag nMirrorFlags;
+ OUString sCustomShapeType;
+ MSO_SPT eShapeType = EscherPropertyContainer::GetCustomShapeType(
+ mXShape, nMirrorFlags, sCustomShapeType);
+ if (eShapeType == mso_sptMax)
+ {
+ // We can't map this custom shape to a PPT preset and it has a bitmap
+ // fill. Make sure that at least the bitmap fill is not lost.
+ mType = "drawing.GraphicObject";
+ aGraphicPropertyName = "FillBitmap";
+ }
+ }
}
if ( bIsHatching || bIsFontwork || ( mType == "drawing.Measure" ) || ( mType == "drawing.Caption" ) )
{
@@ -2216,7 +2231,8 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty,
aSolverContainer );
- if ( aPropOpt.CreateGraphicProperties( mXPropSet, "Graphic", false, true ) )
+ if (aPropOpt.CreateGraphicProperties(mXPropSet, aGraphicPropertyName, false,
+ true))
{
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
}