Bug 97397 - When adding a caption to an image, an extra space is added
Summary: When adding a caption to an image, an extra space is added
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.0.2 rc
Hardware: All All
: medium trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-27 15:11 UTC by Moritz Ulmer
Modified: 2019-03-02 01:16 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Illustration Space Bug sample (20.70 KB, application/vnd.oasis.opendocument.text)
2016-01-27 15:11 UTC, Moritz Ulmer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Ulmer 2016-01-27 15:11:55 UTC
Created attachment 122239 [details]
Illustration Space Bug sample

When adding a caption to an image, an invisible space is added at the beginning of the caption, before "Illustration 1.2: FooBar".

This can only be seen when creating a cross reference or in the index. A sample document has been attached to show this effect. This bug has only appeared since the 5.x releases. I've used several of them and most if not all show this behaviour.

To fix this problem, go into the caption and press delete with the cursor placed before the "I" of Illustration.
Comment 1 FutureProject 2016-01-27 15:53:13 UTC
Hello, and thank you for bringing this issue to our attention.

I was not able to reproduce this issue with:
Version: 5.0.4.2
Build ID: 2b9802c1994aa0b7dc6079e128979269cf95bc78
Locale: en-US (de_DE)

But I was able to reproduce with:
Version: 5.1.0.2 (x64)
Build ID: ecd3574d51754b043f865cf5bafee286d24db7cc
CPU Threads: 4; OS Version: Windows 6.19; UI Render: GL; 
Locale: de-DE (de_DE)

The issue was introduced somewhere in between, probably with the change in how illustrations are referenced.

In 5.0.4.2 it takes the form of "Illustration <n>: <caption>"
While 5.1.0.2 changed it to " <n>. Illustration: <caption>", note the space

To reproduce in 5.1.0.2:
1. Open new Writer document, insert any image.
2. Right-click on image -> "Insert Caption..."
3. In the new window, insert any text for caption, choose any properties, click "okay"
4. Put the writing cursor into any valid line and "Insert -> Cross-reference..."
5. In the new dialog: Type: Illustration, Insert reference to: Reference, click "Insert"
6. The new reference has a leading space

I'm setting this issue to NEW, but I'm not sure if this was an intentional choice or not.

In the meantime, a valid workaround might be not use a manual leading space and just let the reference touch against the previous word. The grey background will not be visible in print and the automatic space will not be noticeable. Because of this I will be lowering this issue to TRIVIAL.

--
Windows 10 Pro, Version 1511 (OS Build 10586.36)
Comment 2 Moritz Ulmer 2016-01-28 09:06:08 UTC
I agree that it is a trivial bug. A case where the work-around does not work is in indexes and if a sentence is started with the reference. This is especially noticeable if some of the captions were created with earlier versions of LO.

Out of curiosity, why was the change made?
Comment 3 QA Administrators 2017-03-06 14:25:58 UTC Comment hidden (obsolete)
Comment 4 lomacar 2019-03-02 01:16:23 UTC
I can confirm that this is still an issue in 6.0.6.2 (Windows x64).

Although strangely, sometimes it seems like it is not an issue, because other captions I created yesterday do not have the extra space, for no apparent reason. I can't recall doing anything different to those other images/captions. I certainly didn't delete the invisible space.