Description: A cross-reference inserted in a justified paragraph, with a space in the referenced text, broken across a line boundary, causes a space to appear at the beginning of the new line. Steps to Reproduce: 1. Create a paragraph with the text "one two" 2. Select "one two" and insert a bookmark 3. Create a new paragraph with a nearly full line of text, with enough space at the end for "one" but not for "one two" 4. Set the paragraph to be justified 5. Insert a cross-reference to the bookmarked paragraph at the end of the line, selecting "Referenced text" for "Refer using". Actual Results: The "two" on the second line has a space before it. Expected Results: There should be no space before the "two". Reproducible: Always User Profile Reset: No Additional Info: This did not happen in 6.2.4 (the version I was hoping to upgrade from).
This was caused by https://gerrit.libreoffice.org/c/core/+/152274 so CCing Michael Stahl.
Also CCing Caolán McNamara.
Created attachment 191946 [details] This is how I interpreted the description of the bug. NO Repro with: Version: 7.6.0.0.beta1 (X86_64) / LibreOffice Community Build ID: be55b15d98c5f059483845a183fcb5ea8023d27c CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win Locale: it-IT (it_IT); UI: it-IT Calc: CL threaded I don't know if I should call it a bug at all... the space you say before 'two' is the same as the one on the bookmark, it doesn't create an additional one. Everything works fine for me, just let me know if the file I uploaded reproduces the error you reported or if I did something wrong.
Surely the space is unnecessary now that the second word is on a new line. This is new behaviour in 7.6 and looks awful to me. If nothing else, why does it only do this when the paragraph alignment is set to justified?
Matthew Kogan committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/4cdb542348b20d8a558cd6413c7cccdc50241fa9 tdf#159101 sw: Fix space appearing at start of line when field wraps It will be available in 24.8.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.
Matthew Kogan committed a patch related to this issue. It has been pushed to "libreoffice-24-2": https://git.libreoffice.org/core/commit/ee0a6a4179b17b76dfd97982ef87d92661afc28c tdf#159101 sw: Fix space appearing at start of line when field wraps It will be available in 24.2.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.
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c8aef3e46256b667f4c777d6a26684df1d4c57f2 tdf#159101: sw_layoutwriter: Add unittest It will be available in 24.8.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.
I think we can close this issue as FIXED. @Matthew, thank you very much for fixing it
Matthew Kogan committed a patch related to this issue. It has been pushed to "libreoffice-7-6": https://git.libreoffice.org/core/commit/b860f50e88cb3aeaab596787e0184fb8bddb6cd7 tdf#159101 sw: Fix space appearing at start of line when field wraps It will be available in 7.6.5. 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.
*** Bug 159613 has been marked as a duplicate of this bug. ***
*** Bug 158680 has been marked as a duplicate of this bug. ***