summaryrefslogtreecommitdiff
path: root/emfio/qa
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2021-03-17 18:16:04 +0100
committerBartosz Kosiorek <gang65@poczta.onet.pl>2021-03-19 09:00:11 +0100
commit54a8aefa3372dce3da7cf0ad846d55d1b7b92467 (patch)
tree5c846d3fb656fff6fea560e69b4364fc58600a73 /emfio/qa
parente782937228479054336b564a4c34697a12530469 (diff)
tdf#35986 tdf#140271 EMF Fix line width of CREATEPEN record
According to [MS-EMF] documentation: "If the pen type in the PenStyle field is PS_COSMETIC, this value MUST be 0x00000001." Unfortunately based on observation of EMF import, it seems that it is not true. As a result the implementation must be partially reversed. Change-Id: I0c2ec5e26b710e1a12d5196b6c8be4709f26dc4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112651 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'emfio/qa')
-rw-r--r--emfio/qa/cppunit/emf/EmfImportTest.cxx30
1 files changed, 15 insertions, 15 deletions
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx
index 85450a2e67a3..f587135e1b1e 100644
--- a/emfio/qa/cppunit/emf/EmfImportTest.cxx
+++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx
@@ -312,7 +312,7 @@ void Test::TestEnglishMapMode()
void Test::TestCreatePen()
{
// Check import of EMF image with records: RESTOREDC, SAVEDC, MOVETOEX, LINETO, POLYLINE16, EXTTEXTOUTW with DxBuffer
- // The CREATEPEN record is used with PS_COSMETIC line style, which will be displayed as solid hairline
+ // The CREATEPEN record is used with PS_COSMETIC line style, which sometimes will be displayed as solid hairline
Primitive2DSequence aSequence = parseEmf(u"/emfio/qa/cppunit/emf/data/TestCreatePen.emf");
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength()));
drawinglayer::Primitive2dXmlDump dumper;
@@ -321,24 +321,24 @@ void Test::TestCreatePen()
assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polypolygon", "path", "m0 0h31250v18192h-31250z");
- assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke", 3);
- assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[1]/polygon", "17898,5693 20172,5693");
- assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[1]/line", "color", "#008000");
- assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[1]/line", "width", "3");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke", 748);
+ assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[1]/polygon", "27875,16523 27875,1453");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[1]/line", "color", "#ff0000");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[1]/line", "width", "6");
- assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[2]/polygon", "17898,6959 20172,6959");
- assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[2]/line", "color", "#000080");
- assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[2]/line", "width", "3");
+ assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[2]/polygon", "27975,16453 27875,16453");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[2]/line", "color", "#ff0000");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[2]/line", "width", "6");
- assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[3]/polygon", "17898,7381 20172,7381");
+ assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[3]/polygon", "27925,16078 27875,16078");
assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[3]/line", "color", "#ff0000");
- assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[3]/line", "width", "3");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonstroke[3]/line", "width", "6");
- assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline", 755);
- assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline[10]", "color", "#ff0000");
- assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline[10]/polygon", "27925,14180 27875,14180");
- assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline[100]", "color", "#008000");
- assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline[100]/polygon", "26100,14414 26050,14414");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline", 10);
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline[5]", "color", "#008000");
+ assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline[5]/polygon", "25850,2179 25844,1958");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline[10]", "color", "#000080");
+ assertXPathContent(pDocument, "/primitive2D/metafile/transform/mask/polygonhairline[10]/polygon", "2025,1642 2025,1501");
assertXPath(pDocument, "/primitive2D/metafile/transform/mask/textsimpleportion", 69);
assertXPath(pDocument, "/primitive2D/metafile/transform/mask/textsimpleportion[1]", "width", "374");