Bug 113166 - FILEOPEN: Incorrect symbol displayed on document
Summary: FILEOPEN: Incorrect symbol displayed on document
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Armin Le Grand (allotropia)
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: PPT
  Show dependency treegraph
 
Reported: 2017-10-16 22:43 UTC by Xisco Faulí
Modified: 2018-06-07 08:41 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
minimized document (46.97 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2017-10-16 22:43 UTC, Xisco Faulí
Details
render of current master (39.18 KB, application/pdf)
2017-10-24 13:11 UTC, Patrick Jaap
Details
issue on linux and on win (93.59 KB, image/png)
2017-10-24 19:55 UTC, Xisco Faulí
Details
linux screenshot (28.32 KB, image/png)
2017-10-24 21:01 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2017-10-16 22:43:40 UTC
Created attachment 137027 [details]
minimized document

Steps to reproduce:
1. Open attached document

Observed document: 2 euro symbols are displayed on the document

Reproduced in

Version: 6.0.0.0.alpha0+
Build ID: d4daf634cd9ce8d422d49669c324a2220eba54a9
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

[Bug found by office-interoperability-tools]
Comment 1 Xisco Faulí 2017-10-16 22:45:42 UTC Comment hidden (obsolete)
Comment 2 Armin Le Grand (allotropia) 2017-10-18 07:45:08 UTC
That fallback is no longer in the code, cannot be the reason
Comment 3 Xisco Faulí 2017-10-18 08:19:13 UTC
Hi Armin,
Actually I was wrong in my bisection. it's wrong after 600a2aa24085cb972686b46061f9045785208a9e and it's ok before 5868745db74ae930edb0058490076d82aaeafbe9 so the issue was introduced either on one commit or the other, if you say the fallback is no longer in the code, then it should be 5868745db74ae930edb0058490076d82aaeafbe9. Sorry for that
Comment 4 Xisco Faulí 2017-10-18 08:23:18 UTC
Regression introduced by:

author	Armin Le Grand <Armin.Le.Grand@cib.de>	2017-06-12 13:27:16 (GMT)
committer	Thorsten Behrens <Thorsten.Behrens@CIB.de>	2017-07-15 09:01:29 (GMT)
commit 5868745db74ae930edb0058490076d82aaeafbe9 (patch)
tree 78bea29cb44b770d9e3affef2a303d0d38722d85
parent 83535a28c57ffb59f795dd35332d6b3426071e32 (diff)
emfplus: make VectorFormats Emf/Wmf/Svg work
make complete turn around and internal buffering
for Emf/Wmf/Svg work, including images in ODF and
re-save from UI. The correct FileType has to be
determined. It has shown that *.wmf exist that really
contain *.emf, so this turn around will not alter
the binary data, but may change the mimetype
Comment 5 Armin Le Grand (allotropia) 2017-10-24 08:09:02 UTC
I do not see '€' symbols when opening, it's more like chess figures...? And two formulas top-right which look good. What is the error?
Comment 6 Armin Le Grand (allotropia) 2017-10-24 08:11:42 UTC
Also adding Patrick to CC, may be the same as #113197, stuff outside WMF-Bounds and clipping
Comment 7 Armin Le Grand (allotropia) 2017-10-24 10:08:40 UTC
Probably double to tdf#113197
Comment 8 Patrick Jaap 2017-10-24 13:11:12 UTC
Hi, I cannot confirm this bug. I dont see any €-symbols or chess figures :)
there are two rectangles in the middle.

I'll create an attachment how it looks on my computer.
Comment 9 Patrick Jaap 2017-10-24 13:11:39 UTC
Created attachment 137249 [details]
render of current master
Comment 10 Xisco Faulí 2017-10-24 19:55:38 UTC
Created attachment 137258 [details]
issue on linux and on win

Yep, actually the euro symbol is on Linux whereas on Win there's another symbol.
So the problem is about the extra symbol/empty square displayed.
Comment 11 Yousuf Philips (jay) (retired) 2017-10-24 20:55:07 UTC
I opened attachment 137027 [details] in Powerpoint 2013 and master and there was nothing there on Windows 8.1.

Version: 6.0.0.0.alpha1+
Build ID: 0c46b3a9a384d5b70a708c3e9459a790dd815c63
CPU threads: 4; OS: Windows 6.3; UI render: default; 
Locale: en-US (en_US); Calc: group
Comment 12 Yousuf Philips (jay) (retired) 2017-10-24 21:01:44 UTC
Created attachment 137262 [details]
linux screenshot

I see two square boxes outlines but they arent selectable or have any character in it. If i select either of the two WMF formulas and click delete, and alt+tab away and alt+tab back, 1 of the boxes will disappear.

Version: 6.0.0.0.alpha1+
Build ID: 43d6b11a5c1dda0cc2c1e06c768eece25051a56c
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk2; 
Locale: en-US (en_US.UTF-8); Calc: group
Comment 13 V Stuart Foote 2017-10-24 23:28:00 UTC
Extracting the media folder from the pptx. There are two formulas labeled and identified as WMF (ImageMagick 7.0.6-9 Q16).

Opening the WMFs with Corel Draw 2017, there is char in Symbol font showing at the lower left edge of the drawing objects as shown on canvas. 

Copying it out and converting to Unicode it seems to be U+00a0U+0020

Seems like these should be clipped away when document is opened into LibreOffice, but are not, and are picked up some odd glyph (PUA?), in 5.4.3.1 on Windows 10 I see the dagger glyph (U+2020) for each.

So this is some filter mishandling of the WMF bounding box--or a malformed WMF?
Comment 14 Armin Le Grand (allotropia) 2017-10-25 12:43:07 UTC
@Patrick: Already on it - see https://gerrit.libreoffice.org/#/c/43746/. In your pic: The two gray rectangles - depending of used font, there is a charater (was no € sign in my version, too)
Comment 15 Armin Le Grand (allotropia) 2017-11-02 09:20:51 UTC
SOlution was integrated, but taken back. Build fails on Mac in CppunitTest_sw_ooxmlexport4. I have no mac, but checked that it does indeed *not* fail when masking out test (see https://gerrit.libreoffice.org/#/c/44058/, patch set 3). No ides ahow to continue - I have no Mac.
Start guessing...? I already took a look at ooxmlexport4.cxx in sw, but found no obvious change.
What changed is that when emf/wmf/emf+ is imported there *may be* an additional layer in the dumped and parsed Metafile, now including PRIMITIVE2D_ID_MASKPRIMITIVE2D and thus ("mask") (see Primitive2dXmlDump::decomposeAndWrite). Found no clue in ooxmlexport4.cxx using this (as in various tests, e.g. 'assertXPath(pDocument, "/primitive2D/metafile/transform/textsimpleportion", "height", "276")'.
Any clue...?
Comment 16 Armin Le Grand (allotropia) 2017-11-02 17:39:08 UTC
log of failing mac now on https://ci.libreoffice.org/job/lo_gerrit/21351/Config=macosx_clang_dbgutil/console (end is:)

Error: a unit test failed, please do one of:
make CppunitTest_sw_ooxmlexport4 CPPUNITTRACE="lldb --"       # for interactive debugging on OS X
make CppunitTest_sw_ooxmlexport4 VALGRIND=memcheck            # for memory checking

/Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/solenv/gbuild/CppunitTest.mk:114: recipe for target '/Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/workdir/CppunitTest/sw_ooxmlexport4.test' failed
make[1]: *** [/Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/workdir/CppunitTest/sw_ooxmlexport4.test] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:266: recipe for target 'build' failed
make: *** [build] Error 2
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Comment 17 Armin Le Grand (allotropia) 2017-11-03 08:29:36 UTC
No idea how to continue here - does someone on CC have a mac...?
Comment 18 Patrick Jaap 2017-11-03 11:11:15 UTC
Hi Armin! I have no Mac available ...

Which patch set was merged into the master? Did Jenkins report no error back then?
Comment 19 Patrick Jaap 2017-11-03 11:14:03 UTC
Ah, just saw the older link to gerrit from Comment 14. Now I understand your confusion. Why should this be a OS dependent bug?
Comment 20 Regina Henschel 2017-11-03 15:06:45 UTC
I see this error: The document contains MathType 3 equations. So if you have set the load options to convert them, then you should get a StarMath equation. If you have set to not convert them, then you should get an OLE object. So in both cases there should not be a wmf-image at all.

But when I open the file, then I get for each equation a wmf-image and in addition a broken OLE-object. "Broken" means, that it is listed in Navigator, and is named as "Embedded OLE" in the status bar, but there are no actions available for it in context menu or in Edit. It is shown in the slide as rectangle with icon OLE in it. 

I see this error in Version: 6.0.0.0.alpha1+
Build ID: d30522e46ca884e9bc74af21711d9537e8118859
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-10-29_23:13:14
Locale: de-DE (de_DE); Calc: group

The pptx file uses the feature to provide alternative content, whereby the preferred content has the attribute Requires="v". In this case the namespace v is bound to "urn:schemas-microsoft-com:vml". That all is in elements with mc namespace. It is specified in the part 3 of ECMA-376. https://www.ecma-international.org/publications/standards/Ecma-376.htm. Is LibreOffice able to handle elements of namespace mc correctly?
Comment 21 V Stuart Foote 2017-11-03 16:03:12 UTC
(In reply to Regina Henschel from comment #20)

> The pptx file uses the feature to provide alternative content, whereby the
> preferred content has the attribute Requires="v". In this case the namespace
> v is bound to "urn:schemas-microsoft-com:vml". That all is in elements with
> mc namespace. It is specified in the part 3 of ECMA-376.
> https://www.ecma-international.org/publications/standards/Ecma-376.htm. Is
> LibreOffice able to handle elements of namespace mc correctly?

Is that relevant? Regardless of how we parse the PPTX, the "extra" character appears in either WMF when they are extracted from the OOXML archive media directory and used individually as images. 

If the errant character is not part of the WMF image, it should be clipped out--right?
Comment 22 Regina Henschel 2017-11-03 16:35:38 UTC
(In reply to V Stuart Foote from comment #21)
> (In reply to Regina Henschel from comment #20)
> 
> > The pptx file uses the feature to provide alternative content, whereby the
> > preferred content has the attribute Requires="v". In this case the namespace
> > v is bound to "urn:schemas-microsoft-com:vml". That all is in elements with
> > mc namespace. It is specified in the part 3 of ECMA-376.
> > https://www.ecma-international.org/publications/standards/Ecma-376.htm. Is
> > LibreOffice able to handle elements of namespace mc correctly?
> 
> Is that relevant?

Yes. If you open the attached pptx file in LO, then there should not be any wmf-image, but either an OLE-object or a StarMath equation.

 Regardless of how we parse the PPTX, the "extra" character
> appears in either WMF when they are extracted from the OOXML archive media
> directory and used individually as images.

I cannot confirm that. The wmf-images display correctly and do not have any additional part. Have you tried it without OpenGL too? I ask, because OpenGL is disabled in my LO.

So if the isolated wmf-image does display incorrectly in your version, then that is independent from the pptx import. That would mean, that the attached pptx file has two problems and an additional issue is needed. 

> If the errant character is not part of the WMF image, it should be clipped
> out--right?

Do you get "Object 5" and "Object 8" in the Navigator? If yes, what is selected, if you double-click it? I wonder, if perhaps that what is an "errant character" in your version is the same as the broken OLE in my version.
Comment 23 Armin Le Grand (allotropia) 2018-06-06 07:25:17 UTC
Seems fixed after I did integrate that long lasting change with the Mac UnitTest problem which was so hard to fix (but showend an error that was good to be found and fixed :-))
Comment 24 Xisco Faulí 2018-06-07 08:41:12 UTC
Verified in

Version: 6.1.0.0.beta1+
Build ID: 8b96445766efe237eb47608ade6c147673466e2e
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded

@Armin, thanks for fixing this!