Bug 136551 - FILEOPEN DOTX Template rendered with only one element, missing text and shapes
Summary: FILEOPEN DOTX Template rendered with only one element, missing text and shapes
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.0.3 release
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:7.1.0 target:7.0.3 target:7.3.0
Keywords: bibisected, bisected, regression
: 127819 134867 (view as bug list)
Depends on:
Blocks: DOCX-Opening
  Show dependency treegraph
 
Reported: 2020-09-07 15:47 UTC by Buovjaga
Modified: 2021-11-19 13:56 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Problematic DOTX file (22.30 MB, application/vnd.openxmlformats-officedocument.wordprocessingml.template)
2020-09-07 15:47 UTC, Buovjaga
Details
DOTX compared (255.49 KB, image/png)
2020-09-29 11:21 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Buovjaga 2020-09-07 15:47:23 UTC
Created attachment 165240 [details]
Problematic DOTX file

The attached file is featured in this article, section "Microsoft Office compatibility" (with screenshot): https://www.dedoimedo.com/computers/libreoffice-6-3-review.html

The error upon opening is just due to improved exception handling.

This file has a colourful history.

The timeline in Linux 43max repo:

The oldest commit is perfect, except that the image of the lady is missing.

This commit made it fully perfect:
https://git.libreoffice.org/core/commit/57450afb768c085df0ba2344aa94b5f843060178
DOCX import: declare wps as a supported feature

This commit made the colourful shapes disappear:
https://git.libreoffice.org/core/commit/8c73b16f5f18f3bc1dbf9ff6c1475db56b44d304
DOCX import: declare wpg as a supported feature

This commit made the image of the lady disappear:
https://git.libreoffice.org/core/commit/9820a8b2a0d89c355db5a363857c410125b54214
oox: tokenize wp14 namespace

This commit made the template open completely blank:
https://git.libreoffice.org/core/commit/da52cd209e4ce77ae5dc06866039fd0f0a28e778
writerfilter: remove no longer needed generated resourceids.hxx in doctok

This commit change it from blank to the state where only the colourful shapes were missing (even though the commit looks unrelated):
https://git.libreoffice.org/core/commit/b7ad3991628b0dee40bb1f823ca90b5c71b49939
long to sal_Int32

Moving on to 44max repo:

This commit made the colourful shapes return, so the rendering was fully perfect again:
https://git.libreoffice.org/core/commit/194c17a7c7c00f966b0256a1e90d50d8dd49f2bc
fdo#80895 : Shape in Header&Footer is getting lost after RT

This commit made the shapes disappear again:
https://git.libreoffice.org/core/commit/7f9b242331327c5c1b137b91861a6bb57bfb0ecc
DOCX drawingML import: fix remaining rotation / flip combinations

The final state of only the image of the lady being rendered was achieved with
https://git.libreoffice.org/core/commit/82d08580e368afbc9d73da3613845a36a89b0a8c
switch saxparser from expat to libxml2

Adding Cc: to Miklos Vajna
Comment 1 Miklos Vajna 2020-09-22 12:01:30 UTC
Checking this on master, we simply refuse to open the file. So let's focus on the ability to open the file again, with some reasonable content, after the expat -> libxml2 switch.
Comment 2 Commit Notification 2020-09-29 07:06:37 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/cd85546a2fbdade42f80fd3b6bd650791db9f32d

tdf#136551 DOTX import: restore support for large XML attribute values

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Timur 2020-09-29 08:23:59 UTC
Bibisect of the year.
Comment 4 Xisco Faulí 2020-09-29 09:41:15 UTC
Files opens file in

Version: 7.1.0.0.alpha0+
Build ID: cd85546a2fbdade42f80fd3b6bd650791db9f32d
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: tr-TR (en_US.UTF-8); UI: en-US
Calc: threaded

@Miklos, thanks for fixing this issue!!

Removing needsUItest keyword, as explained in the commit '[ No testcase, adding a 10MB test document to the repo is not preferred. ]'
Comment 5 Timur 2020-09-29 11:21:26 UTC
Created attachment 165944 [details]
DOTX compared
Comment 6 Buovjaga 2020-09-29 11:29:17 UTC
(In reply to Timur from comment #5)
> Created attachment 165944 [details]
> DOTX compared

The comparison is a bit misleading, because for some reason the colours in your MSO are washed out. Compare rather to the screenshot in https://templates.office.com/EN-US/organic-shapes-resume-TM44864860
Comment 7 Commit Notification 2020-09-29 12:30:41 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/9ad456005b2bbc5d570b975e2a54f7d904d079e6

tdf#136551 DOTX import: restore support for large XML attribute values

It will be available in 7.0.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Aron Budea 2020-09-29 12:39:46 UTC
(In reply to Buovjaga from comment #6)
> The comparison is a bit misleading, because for some reason the colours in
> your MSO are washed out. Compare rather to the screenshot in
> https://templates.office.com/EN-US/organic-shapes-resume-TM44864860
The reason is that when in edit mode, content on a different layer is shown washed out, presumably so the user doesn't confuse the two, ie. when you're editing the foreground, the background looks like that, and if you're editing the background, the foreground does.
Comment 9 NISZ LibreOffice Team 2020-12-10 12:58:24 UTC
*** Bug 127819 has been marked as a duplicate of this bug. ***
Comment 10 Xisco Faulí 2021-11-19 09:45:31 UTC
*** Bug 134867 has been marked as a duplicate of this bug. ***
Comment 11 Commit Notification 2021-11-19 13:56:04 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2337bd5f0d9977a0ecd110abdebea7f331d360df

tdf#136551: sc_subsequent_filters: Add unittest

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.