[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - oox/source sw/qa
Szabolcs Toth (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 27 18:03:59 UTC 2020
oox/source/export/drawingml.cxx | 2 +-
sw/qa/extras/ooxmlexport/data/tdf92526_ShapeLineWidth.odt |binary
sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 12 ++++++++++++
3 files changed, 13 insertions(+), 1 deletion(-)
New commits:
commit 1dc3fa541159e746b81561bb6a6170dcd968704d
Author: Szabolcs Toth <szabolcs450 at gmail.com>
AuthorDate: Mon May 11 15:56:27 2020 +0200
Commit: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Mon Jul 27 20:03:26 2020 +0200
tdf#92526 DrawingML shape export: fix 0 line width
0 line width is the thinnest possible line width,
but without its explicit export (a:ln w="0"), shape
outline was imported with 0.75 pt line width by MSO.
Co-authored-by: Balázs Regényi
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93968
Reviewed-by: László Németh <nemeth at numbertext.org>
Tested-by: László Németh <nemeth at numbertext.org>
(cherry picked from commit 96319d662dca12616eb52c601a2d5b5adca3ae57)
Change-Id: I40f7aefe6358bebe9a3853fe3e7d6faa170bc34c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99533
Tested-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
Reviewed-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 468c89ad7b7e..9ef07ec5ef5d 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -874,7 +874,7 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc
mpFS->startElementNS( XML_a, XML_ln,
XML_cap, cap,
- XML_w, nLineWidth > 1 && nStyleLineWidth != nLineWidth ?
+ XML_w, nLineWidth == 0 || (nLineWidth > 1 && nStyleLineWidth != nLineWidth) ?
OString::number(oox::drawingml::convertHmmToEmu(nLineWidth)).getStr() : nullptr );
if( bColorSet )
diff --git a/sw/qa/extras/ooxmlexport/data/tdf92526_ShapeLineWidth.odt b/sw/qa/extras/ooxmlexport/data/tdf92526_ShapeLineWidth.odt
new file mode 100644
index 000000000000..fffd9b9b2037
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf92526_ShapeLineWidth.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 7e9bcb639012..089154675288 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -1118,6 +1118,18 @@ DECLARE_OOXMLEXPORT_TEST(testArrowMarker, "tdf123346_ArrowMarker.docx")
"/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:tailEnd", "type", "arrow");
}
+DECLARE_OOXMLEXPORT_TEST(testShapeLineWidth, "tdf92526_ShapeLineWidth.odt")
+{
+ // tdf#92526: Make sure that line with stays 0.
+ xmlDocPtr pXml = parseExport("word/document.xml");
+ if (!pXml)
+ return;
+
+ // "w" attribute was not exported.
+ assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing"
+ "/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln", "w", "0");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list