Bug 133070 - FILEOPEN DOCX Shape with relative height gets huge height
Summary: FILEOPEN DOCX Shape with relative height gets huge height
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: Balázs Regényi
URL:
Whiteboard: target:7.1.0 target:7.0.1
Keywords: bibisected, bisected, implementationError
Depends on:
Blocks: WPSShapeTextImport-Change
  Show dependency treegraph
 
Reported: 2020-05-15 16:15 UTC by NISZ LibreOffice Team
Modified: 2020-07-16 11:48 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example minimized file from Word (18.92 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-05-15 16:15 UTC, NISZ LibreOffice Team
Details
Screenshot of the original document side by side in Word and Writer (101.57 KB, image/png)
2020-05-15 16:16 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-05-15 16:15:52 UTC
Created attachment 160869 [details]
Example minimized file from Word

Attached document is reduced from attachment #123988 [details] example file of bug #99002.
This has a shape in the footer with relative height and widht. The height is originally 81% from lower margin, but becomes some 24 cm in Writer.

Steps to reproduce:
    1. Open attached document.

Actual results:
Huge blue shape.

Expected results:
Blue shape should fit in the footer.

LibreOffice details:
Version: 7.0.0.0.alpha1+ (x64)
Build ID: 1ed7607454d1492f65c78443cb661d5873face6b
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win; 
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL

Also happens back to 4.4. In 4.3 the shape was imported as frame, not shape, and relative size import worked fine.

Bibisected using bibisect-win32-4.4 to: 
$ git bisect bad 6f08f0920385b5c4262f5891d317ba31a5137ef7 is the first bad commit
commit 6f08f0920385b5c4262f5891d317ba31a5137ef7
Author: buildslave <buildslave@tb51.libreoffice.org>
Date:   Wed May 4 16:06:50 2016 +0200

    source-hash-e62764108a1832e746f68768c29eaa90606903a7

    commit e62764108a1832e746f68768c29eaa90606903a7
    Author:     Caolán McNamara <caolanm@redhat.com>
    AuthorDate: Fri Jun 20 20:59:48 2014 +0100
    Commit:     Caolán McNamara <caolanm@redhat.com>
    CommitDate: Fri Jun 20 21:00:15 2014 +0100

        hmm, that's not right

        Change-Id: Id714a54b08127c594c108c824bb0dedd74bb5c06

:100644 100644 de6937d3b10b84ffab8c38b3a007e3dbddfa59b0 eeb6b0f37cbde900456555060039bee6d12e3f3d M  autogen.log
:100644 100644 58db84f9a39cbd08c0de7a28b0c0c97428a30e22 f6a3b186afe5cb2e09e3c9db0182f419e4a70c6e M  commitmsg
:040000 040000 6e7e2d1afd0861a10854e482d8d74d3a7ce06ba4 efceaa06d7a6e48351c5bb6323759fab04b52c2c M  instdir
:100644 100644 c976c0cb714f6f5c29a4e3532d9a491c15d724e3 e1ea8ca83e3e7232aef1157ba982fbe165d5a2d3 M  make.log


URL: https://cgit.freedesktop.org/libreoffice/core/commit/?id=e62764108a1832e746f68768c29eaa90606903a7

Although this seems to be fishy. Previous commit is e1386e32a85eb5c6b4294a8ca3e4461b92707fc3 so the range between these is:

https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=e1386e32a85eb5c6b4294a8ca3e4461b92707fc3..e62764108a1832e746f68768c29eaa90606903a7
Comment 1 NISZ LibreOffice Team 2020-05-15 16:16:06 UTC
Created attachment 160870 [details]
Screenshot of the original document side by side in Word and Writer
Comment 2 Dieter 2020-05-18 16:59:26 UTC
I confirm it with

Version: 7.0.0.0.alpha1+ (x64)
Build ID: 99c337d1d3831ce9d2c7dc1cbff713f4ac49d6ac
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win; 
Locale: en-GB (de_DE); UI: en-GB
Calc: CL

in comparison with Word 2016

cc: Coalán McNamara
Comment 3 Caolán McNamara 2020-05-18 18:19:28 UTC
you'll have narrow it down further before pinning this one on me through e62764108a1832e746f68768c29eaa90606903a7 as that's surely not responsible
Comment 4 Aron Budea 2020-05-31 00:38:06 UTC
Bibisecting using repo bibisect-44max yielded the following commit, which is in the given range, so seems accurate. Since it was never correct, let's stick to implementationError.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=d379d18666aa42031359ca8eb34b0021960347ae
author		Miklos Vajna <vmiklos@collabora.co.uk>	2014-06-18 11:57:31 +0200
committer	Miklos Vajna <vmiklos@collabora.co.uk>	2014-06-18 12:09:15 +0200

oox: import WPS shape with text as shape with textbox
Comment 5 László Németh 2020-06-26 15:19:13 UTC
See https://issues.oasis-open.org/browse/OFFICE-4073
Comment 6 Commit Notification 2020-07-01 08:16:51 UTC
Regényi Balázs committed a patch related to this issue.
It has been pushed to "master":

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

tdf#133070 DOCX import: fix shape height relative to bottom page margin

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 7 Xisco Faulí 2020-07-16 11:46:29 UTC
Verified in

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

@Balázs Regényi and NISZ Team, thanks for fixing this issue!!
Comment 8 Commit Notification 2020-07-16 11:48:42 UTC
Regényi Balázs committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/86fc133348e88b84fe659258409de84c0a975941

tdf#133070 DOCX import: fix shape height relative to bottom page margin

It will be available in 7.0.1.

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.