summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/source/export/drawingml.cxx4
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf142361ShadowDirection.odtbin0 -> 9135 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport16.cxx13
3 files changed, 16 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;
diff --git a/sw/qa/extras/ooxmlexport/data/tdf142361ShadowDirection.odt b/sw/qa/extras/ooxmlexport/data/tdf142361ShadowDirection.odt
new file mode 100644
index 000000000000..78372e603542
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf142361ShadowDirection.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index f75faf8bbe04..b550e62ef6a2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -505,6 +505,19 @@ DECLARE_OOXMLEXPORT_TEST(testCommentDoneModel, "CommentDone.docx")
}
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Test_ShadowDirection, "tdf142361ShadowDirection.odt")
+{
+ // The attribute 'rotWithShape' has the default value 'true' in OOXML, so Words interprets a
+ // missing attribute as 'true'. That means that Word rotates the shadow if the shape is
+ // rotated. Because in LibreOffice a shadow is never rotated, we must not omit this
+ // attribute.
+ xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+ assertXPath(pXmlDoc,
+ "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/"
+ "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:outerShdw",
+ "rotWithShape", "0");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */