Bug 89698 - DOCX: Images anchored with 'as character' should have no spacing
Summary: DOCX: Images anchored with 'as character' should have no spacing
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.6.2 release
Hardware: Other All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:5.1.0 target:5.0.0.2 target:4.4.5
Keywords: bibisected, bisected, regression
Depends on:
Blocks: DOCX-Anchor-and-Text-Wrap
  Show dependency treegraph
 
Reported: 2015-02-27 00:59 UTC by Yousuf Philips (jay) (retired)
Modified: 2018-10-10 11:36 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
sample docx (549.22 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2015-02-27 00:59 UTC, Yousuf Philips (jay) (retired)
Details
Word 2010 vs Master (264.88 KB, image/png)
2015-02-27 01:00 UTC, Yousuf Philips (jay) (retired)
Details
small sample (42.09 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2015-05-20 12:14 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2015-02-27 00:59:13 UTC
Created attachment 113722 [details]
sample docx

With DOC and DOCX, if an image is anchored as 'as character', MS Word ignores all spacing settings, but libreoffice still imports them.

Steps:
1) Open attached file
2) Right-click on any image then Format Image...
3) Select the wrap tab
4) Notice that values are not 0.00"

This is a regression as it worked correctly in 3.6.7.

Microsoft Office sets images anchored to 'as character' to paddings of 0.13" on the left and right and 0.00" on the top and bottom and libreoffice will automatically reset this to 0.00" on all sides when imported until 4.4, but not master.

This document was created in google docs, which doesnt set padding values the same way, which is why it gets imported into LO so badly but still shows correctly in MS Word.

Version: 4.5.0.0.alpha0+
Build ID: 4cf69df2f543b023f4ec3d4279c5ac11a2a819d9
TinderBox: Linux-rpm_deb-x86@45-TDF, Branch:master, Time: 2015-02-21_03:46:34
Comment 1 Yousuf Philips (jay) (retired) 2015-02-27 01:00:13 UTC
Created attachment 113723 [details]
Word 2010 vs Master
Comment 2 Buovjaga 2015-02-27 14:08:45 UTC
Confirmed.

But 3.x also have a gap, just not quite as big (something like 60% the size).

Can you include a screenshot from 3.6.7?

Win 7 Pro 64-bit, LibO Version: 4.4.1.2
Build ID: 45e2de17089c24a1fa810c8f975a7171ba4cd432
Locale: fi_FI

Ubuntu 14.10 64-bit
LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735

Version 3.6.7.2 (Build ID: e183d5b)
Comment 3 Yousuf Philips (jay) (retired) 2015-02-27 14:12:50 UTC
The extra large space above the image is covered in bug 89699.
Comment 4 Buovjaga 2015-02-27 14:14:31 UTC
(In reply to Beluga from comment #2)
> Can you include a screenshot from 3.6.7?

Whoops, my bad: I forgot to read the steps properly and got bitten by the top gap.
Confirmed that the wrap is 0 in 3.x.
Comment 5 Robinson Tryon (qubit) 2015-03-05 16:41:32 UTC
Whiteboard -> bibisectRequest
Comment 6 Matthew Francis 2015-03-17 08:30:54 UTC
In bibisect-43all, the images disappear as of:

    source-hash-98a77cef93663a0ae41dcc2c2858b418aeaaa40e

And become visible again with the changed spacing as of: 

    source-hash-609cb4b332e4b2ddb1f449ba059fd33c3d49dc84


The connection between these two seems to be the below commits.
Adding Cc: to vmiklos@collabora.co.uk; Could you possibly take a look at this? Thanks


commit 3d7e168a2a43c2414b0633379102ddb29437e75b
Author: Miklos Vajna <vmiklos@suse.cz>
Date:   Thu Oct 11 10:21:57 2012 +0200

    n#783638 DOCX import of wp:inline's distT/B/L/R attributes
    
    Change-Id: I181fcae021eed07608b06744b469628e4d78ccba

commit a88ac708403c03d0f950f09ec29c0d5a1e5a85b4
Author: Miklos Vajna <vmiklos@suse.cz>
Date:   Fri Apr 19 17:14:05 2013 +0200

    fdo#63685 wp:inline's distT/B/L/R is in EMU's, not twips
    
    Regression from 3d7e168a2a43c2414b0633379102ddb29437e75b.
    
    Change-Id: I9ab3f9f41316a01d5a74f3e500bad7a83c8d2dca
Comment 7 Jorendc 2015-05-16 19:53:04 UTC
Jay,

Can you please upload a testcase with only the relevant page?
This is a pain to dig deeper into the ooxml code with that many pages.

Just the text right above it (one line if possible) and that image.

Thanks!
Joren
Comment 8 Yousuf Philips (jay) (retired) 2015-05-20 12:14:19 UTC
Created attachment 115746 [details]
small sample

Hopefully this is a suitable sample.
Comment 9 Commit Notification 2015-06-24 07:17:13 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9781a8786da5c32e2250cbe1ae97bd10f84f39bb

tdf#89698 DOCX import: inline picture should have no spacing

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2015-06-24 07:34:08 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=115662b46ee3cea3620b016c9a2ac91ac9eaaeec&h=libreoffice-5-0

tdf#89698 DOCX import: inline picture should have no spacing

It will be available in 5.0.0.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Buovjaga 2015-06-27 10:43:22 UTC
(In reply to Yousuf (Jay) Philips from comment #8)
> Created attachment 115746 [details]
> small sample

Wrap values for image are now 0.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: ee3d40b30816a8fc6d4e8f984659c8dfac19ec3b
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-06-26_00:21:32
Locale: fi-FI (fi_FI)
Comment 12 Commit Notification 2015-07-07 20:33:31 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8b7ec09054f3186ec9d6cb49a1314143cb89da78&h=libreoffice-4-4

tdf#89698 DOCX import: inline picture should have no spacing

It will be available in 4.4.5.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 Robinson Tryon (qubit) 2015-12-17 08:47:22 UTC Comment hidden (obsolete)