summaryrefslogtreecommitdiff
path: root/emfio/source
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/source
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/source')
-rw-r--r--emfio/source/reader/emfreader.cxx17
1 files changed, 6 insertions, 11 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index 30730725a182..e5a3b7d65046 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1131,17 +1131,12 @@ namespace emfio
mpInputStream->ReadUInt32( nStyle ).ReadInt32( nPenWidth ).ReadInt32( nIgnored );
- SAL_INFO("emfio", "\t\tIndex: " << nIndex << " nStyle: 0x" << std::hex << nStyle << std::dec << " nPenWidth: " << nPenWidth);
- // nStyle = PS_COSMETIC = 0x0 - line with a width of one logical unit and a style that is a solid color
- if ( !nStyle )
- {
- // Width 0 means default width for LineInfo (HairLine) with 1 pixel wide
- aLineInfo.SetWidth( 0 );
- }
- else
- {
- aLineInfo.SetWidth( nPenWidth );
- }
+ SAL_INFO("emfio", "\t\tIndex: " << nIndex << " Style: 0x" << std::hex << nStyle << std::dec << " PenWidth: " << nPenWidth);
+ // According to documentation: nStyle = PS_COSMETIC = 0x0 - line with a width of one logical unit and a style that is a solid color
+ // tdf#140271 Based on observed behaviour the line width is not constant with PS_COSMETIC
+
+ // Width 0 means default width for LineInfo (HairLine) with 1 pixel wide
+ aLineInfo.SetWidth( nPenWidth );
bool bTransparent = false;
switch( nStyle & PS_STYLE_MASK )