Bug 140219 - Changing anchor from "to paragraph' to 'to character' makes to anchor pick different area and causing different page layout (which happens automatically out DOCX export)
Summary: Changing anchor from "to paragraph' to 'to character' makes to anchor pick di...
Status: RESOLVED DUPLICATE of bug 135581
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.6.0
Keywords:
Depends on:
Blocks: DOCX-Anchor-and-Text-Wrap
  Show dependency treegraph
 
Reported: 2021-02-06 19:59 UTC by Telesto
Modified: 2023-03-17 17:22 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (166.04 KB, application/vnd.oasis.opendocument.text)
2021-02-06 19:59 UTC, Telesto
Details
Reduced example with less noise (168.08 KB, application/vnd.oasis.opendocument.text)
2021-02-06 20:04 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2021-02-06 19:59:16 UTC
Description:
Image moves to different page after DOCX export

Steps to Reproduce:
1. Open the attached file
2. Save as DOCX
3. File reload

Actual Results:
Image from page 1 to page 2

Expected Results:
Page 1?


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 3ed9bba283a6a67864c0928186e277240be0d9ba
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 1 Telesto 2021-02-06 19:59:30 UTC
Created attachment 169539 [details]
Example file
Comment 2 Telesto 2021-02-06 20:04:37 UTC
Created attachment 169540 [details]
Reduced example with less noise
Comment 3 Telesto 2021-02-06 20:11:33 UTC
@Justin
Is this one of those rounding issues? Where image size gets bigger because of measuring difference between DOCX and ODT. Or something else? And if it's rounding, maybe not rounding up?
Comment 4 Dieter 2021-02-22 20:49:22 UTC
I confirm it with

Version: 7.1.0.3 (x64) / LibreOffice Community
Build ID: f6099ecf3d29644b5008cc8f48f42f4a40986e4c
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

What is happening is, that anchor changes from "To Pargraph" to "To Character". Telesto, would be very kind and useful, if you could spend some more time on investigation about what is happening.
Comment 5 Telesto 2021-02-24 16:06:14 UTC
(In reply to Dieter from comment #4)
> I confirm it with
> 
> Version: 7.1.0.3 (x64) / LibreOffice Community
> Build ID: f6099ecf3d29644b5008cc8f48f42f4a40986e4c
> CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL:
> win
> Locale: de-DE (de_DE); UI: en-GB
> Calc: CL
> 
> What is happening is, that anchor changes from "To Pargraph" to "To
> Character". Telesto, would be very kind and useful, if you could spend some
> more time on investigation about what is happening.

Didn't notice that (or didn't look carefully). Conversion to DOCX always including    conversion of 'to paragraph' to 'to character' for compatibility reasons
Comment 6 Dieter 2021-02-24 16:31:43 UTC
(In reply to Telesto from comment #5)
> Conversion to DOCX always
> including    conversion of 'to paragraph' to 'to character' for
> compatibility reasons

So what does it mean then: WONTFIX or Enhancement or something else?
Comment 7 Telesto 2021-02-24 19:34:03 UTC
@NISZ/ @Miklos
Any idea about this. DOCX converts 'to paragraph' anchors to 'to character' which causes a layout change in the specific consternation here. A manual change of the anchor does - obviously - the same thing

The question is: So what does it mean then: WONTFIX or Enhancement or something else?
Comment 8 Miklos Vajna 2021-02-25 10:43:46 UTC
docx only has to-char (anchored) and as-char (inline), so if the request is to preserve to-para in docx, that's a wontfix.
Comment 9 Telesto 2021-02-25 12:45:50 UTC
(In reply to Miklos Vajna from comment #8)
> docx only has to-char (anchored) and as-char (inline), so if the request is
> to preserve to-para in docx, that's a wontfix.

I don't care much about anchoring type. I assume the 'conversion' from 'to paragraph' 'to character' is done with the idea in mind that the page should look the same.

It mostly works as expected. However the current example shows a case where 'to paragraph' looking different from 'to character' anchoring.

This because the anchor - to character - attaches itself to the paragraph below. 
However anchors are kind of 'hairy'
Comment 10 Telesto 2021-02-28 08:52:04 UTC
To be kind of more specific.. bulleted list is involved.
Comment 11 NISZ LibreOffice Team 2021-05-05 08:03:24 UTC
It seems like the image is anchored to the beginning of the bulleted "Low Color Reference" paragraph and has a 
						<text:soft-page-break/>
in the odt, which is not exported to docx, but other properties seem to be exported fine.

I'm not sure whether there is anything in docx that could be used here.
Comment 12 Dieter 2022-01-12 16:22:21 UTC

*** This bug has been marked as a duplicate of bug 94302 ***
Comment 13 Timur 2022-02-07 12:35:45 UTC

*** This bug has been marked as a duplicate of bug 135581 ***
Comment 14 Commit Notification 2023-03-17 17:22:40 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

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

sw: fix assert on tdf140219-2.odt

It will be available in 7.6.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.