Description: There is a significant difference in how LibreOffice Writer handles images anchored to a paragraph when the parent paragraph is deleted, depending on the file format of the document: – If the format of the document is DOCX, deleting the paragraph also deletes the image. – If the format of the document is ODT, deleting the paragraph simply causes the image to move up one paragraph. The issue is more apparent when the paragraph contains only one single character besides the anchor of image: – If the format of the document is DOCX, selecting the only character in the paragraph also marks the image as selected. – If the format of the document is ODT, selecting the only character in the paragraph doesn't mark the image as selected. Steps to Reproduce: 1.Create a new text document in LibreOffice Writer, and add a few paragraphs of random text. 2.Create an empty paragraph somewhere in the document and insert an image by clicking on Insert > Image. Writer inserts the image anchored to paragraph by default, so there is no need to change that. 3.Save the document both as ODT and DOCX. 4.Close the document and reopen both the ODT and DOCX file in Writer. 5.Delete the paragraph containing the image in both versions of the document. Actual Results: The image disappears from the DOCX document, and moves up one paragraph in the ODT document Expected Results: The image should move up one paragraph both in the DOCX and the ODT document. Reproducible: Always User Profile Reset: No Additional Info:
Created attachment 146475 [details] The original document in ODT format.
Created attachment 146476 [details] The same document saved as DOCX.
Created attachment 146477 [details] A screenshot showcasing the issue.
I can't reproduce this in Version: 6.2.0.0.alpha1+ (x64) Build ID: 8274c4c62df5b937b3f0bec9e1eeca85f3b219d4 CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; TinderBox: Win-x86_64@42, Branch:master, Time: 2018-10-22_01:47:50 Locale: en-US (de_DE); Calc: CL And there is another observation: When I save the odt-file as docx and reopen, the image is anchered to character insted of paragrph (see attachment from comment 2); I couldn't find, that this bug is reported yet.
*** Bug 122103 has been marked as a duplicate of this bug. ***
I can not confirm with Version: 6.3.0.0.alpha0+ Build ID: 0ad2302cf6787cacbbaca081a890a0e356a55297 CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; Image is still in docx file.
(In reply to raal from comment #6) > I can not confirm with Version: 6.3.0.0.alpha0+ > Build ID: 0ad2302cf6787cacbbaca081a890a0e356a55297 > CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; > Image is still in docx file. Hi I can still reproduce, but it's a bit tricky. There is another example file in the duplicate bug, with more straightforward steps. Here, the paragraph you should delete is the one containing the number 5: place the cursor at the beginning of the paragraph and press Del twice. The image should disappear with a current-ish master.
Created attachment 147629 [details] Video showing the odt and docx with the image disappearing
I can reproduce it 1. Open docx 2. Delete 5 2. Put cursor and the beginning of line "Sixth paragraph" 3. Press delete Version: 6.2.0.0.beta1 (x64) Build ID: d1b41307be3f8c19fe6f1938cf056e7ff1eb1d18 CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; Locale: en-US (de_DE); UI-Language: en-GB Calc: threaded
see also bug 122103 comment 5
the DOCX vs ODT here is a bit incidental; the real difference is the at-character vs. at-paragraph anchor. it's just that MS Word only supports 2 anchor types (as-character / at-character), so the at-paragraph anchor necessarily becomes at-character after a round-trip in Word formats. we have thought already about the at-character case in editing operations (see commit 28b77c89dfcafae82cf2a6d85731b643ff9290e5) so probably the way to go is to adapt the at-paragraph case to work consistently with that. clearly the current behavior where at-paragraph fly is shown as selected but then it survives a delete operation is a bug; i disagree with the Expected Results in the description and propose instead that the fly should be deleted in both cases.
Michael Stahl committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/91b2325808a75174f284c48c8b8afc118fad74e4 tdf#121300 sw: consistent fly at-pargraph selection It will be available in 6.5.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.
made the at-paragraph selection consistent now; there's a small tweak to the at-character selection pending until jenkins finishes that should make both consistent with each other too. the tweak is that if the selection is from the end of one paragraph to the start of the next one, it's probably backspace/delete key and no flys will be deleted.
Michael Stahl committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/98d1622b3721fe899c4e1faa0b4cc35695253014 tdf#121300 sw: adapt at-char selection to latest at-para design It will be available in 6.5.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.
Michael Stahl committed a patch related to this issue. It has been pushed to "libreoffice-6-4": https://git.libreoffice.org/core/commit/e75dd1fc992f168f24d66595265a978071cdd277 tdf#121300 sw: consistent fly at-pargraph selection It will be available in 6.4.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.
Michael Stahl committed a patch related to this issue. It has been pushed to "libreoffice-6-4": https://git.libreoffice.org/core/commit/1644fb345e41851fe9fa9d34544e7a1556e1afd6 tdf#121300 sw: adapt at-char selection to latest at-para design It will be available in 6.4.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.