summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2021-06-15 01:47:44 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-06-16 09:29:30 +0200
commit1c0c11defaf6a83870725902825b1931f8ef50e5 (patch)
tree31cebba0fdf57862861e2bac484c6e0f4025b8ea /oox
parent9656cc894673af9db77a29376a94d3029370d127 (diff)
tdf#142361 export: prevent shadow to rotate with shape
OOXML has the feature to rotate a shadow together with the shape. The associated attribute rotWithShape has the default value 'true'. So if this attribute is missing, MS Office shows the shadow rotated. As LibreOffice never rotates a shadow, we need to write this attribute always. Because LibreOffice cannot rotate shadows, the error is only visible in MS Office. Here the attribute is added for the case of documents, which have no InteropGrabBag or no effects in it. When a shadow is generated in MS Office, MSO adds the attribute with value 'false' (0) to the file. MS Office has no UI to set this attribute. Problem is with cases, where the document comes from MS Office, has effects in InteropGrabBag, but the shadow was set in LibreOffice. To add the attribute in such cases too, bug tdf#142858 has to be fixed. Change-Id: I5f1df416bca8ea15a305242afb140d852cfd84c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117206 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de> (cherry picked from commit 58eeec036c3780188feccb0e1a752cfdee90a49b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117225 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 385af08d590b..5f42dc18cd75 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -4241,7 +4241,7 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet )
if( bHasShadow )
{
Sequence< PropertyValue > aShadowGrabBag( 3 );
- Sequence< PropertyValue > aShadowAttribsGrabBag( 3 );
+ Sequence< PropertyValue > aShadowAttribsGrabBag( 4 );
double dX = +0.0, dY = +0.0;
sal_Int32 nBlur =0;
@@ -4255,6 +4255,8 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet )
aShadowAttribsGrabBag[1].Value <<= lcl_CalculateDir(dX, dY);
aShadowAttribsGrabBag[2].Name = "blurRad";
aShadowAttribsGrabBag[2].Value <<= oox::drawingml::convertHmmToEmu(nBlur);
+ aShadowAttribsGrabBag[3].Name = "rotWithShape";
+ aShadowAttribsGrabBag[3].Value <<= false; //ooxml default is 'true', so must write it
aShadowGrabBag[0].Name = "Attribs";
aShadowGrabBag[0].Value <<= aShadowAttribsGrabBag;