metanorma / libemf2svg

Microsoft (MS) EMF to SVG conversion library
GNU General Public License v2.0
11 stars 2 forks source link

Switch on wrong fill_mode #38

Closed KeterSCP closed 7 months ago

KeterSCP commented 10 months ago

I've noticed at least 2 places where switch over states->currentDeviceContext.fill_mode is compared to wrong enum.

First: https://github.com/metanorma/libemf2svg/blob/792609a1d0591a741e3e882fdd053eb8bf619590/src/lib/emf2svg_print.c#L45-L58

Second: https://github.com/metanorma/libemf2svg/blob/792609a1d0591a741e3e882fdd053eb8bf619590/src/lib/emf2svg_utils.c#L296-L306

Here values are compared to PolygonFillMode, but states->currentDeviceContext.fill_mode is a brush style. Probably those switches should be done over states->currentDeviceContext.fill_polymode

maxirmx commented 7 months ago

Thank you, @KeterSCP Do you have an example which is affected by this issue ?

KeterSCP commented 7 months ago

Hi @maxirmx, thanks for the response! Unfortunately, I cannot share example file due to the company's NDA

maxirmx commented 7 months ago

Hi @maxirmx, thanks for the response! Unfortunately, I cannot share example file due to the company's NDA

Ok, let me ask it in a better way - can you advise how it needs to be fixed ? Thank you

KeterSCP commented 7 months ago

@maxirmx Sure! As mentioned in the issue description a fix would be to change

- switch (states->currentDeviceContext.fill_mode) {
+ switch (states->currentDeviceContext.fill_polymode) {