diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2021-06-15 01:47:44 +0200 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2021-06-15 18:26:50 +0200 |
commit | 58eeec036c3780188feccb0e1a752cfdee90a49b (patch) | |
tree | d412d239d94e8901c66670c63323615d8d8a603b /sw | |
parent | 93e2cc6d5d3408a4d480ac9a44e6adb0060965bf (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>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf142361ShadowDirection.odt | bin | 0 -> 9135 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 13 |
2 files changed, 13 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf142361ShadowDirection.odt b/sw/qa/extras/ooxmlexport/data/tdf142361ShadowDirection.odt Binary files differnew file mode 100644 index 000000000000..78372e603542 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf142361ShadowDirection.odt 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: */ |