<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Hidden hard linebreak character inserted between image and its caption"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=131302">131302</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Hidden hard linebreak character inserted between image and its caption
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.3.0.3 release
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>URL</th>
          <td>https://ask.libreoffice.org/en/question/233189/
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Keywords</th>
          <td>bibisected, bisected, regression
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Writer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mikekaganski@hotmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>caolanm@redhat.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When a caption is added to an image, there's a hidden linebreak character
between the image and the inserted caption.

Steps:
1. Insert an image
2. Right-click it and add caption with some text
=> this creates a frame holding the original image (now having "As Character"
anchoring) plus inserted caption, both in the same paragraph
3. Select the image (not the frame!) and drag its lower right handle to shrink
it to allow the image and its caption to be on the same line
4. Put cursor in the caption, and use left arrow key to step through characters
up to the image

There's a step when the cursor gets to the left of the first character of the
caption, staying between the caption and the image, when the next press of left
arrow does not move it, but only changes its size. The next press after that
finally moves it to the left of the image.

The hidden character may be selected, and its direct formatting be cleared to
make it not hidden.

The user-visible problem with the character is that it's shown as leading space
in figure index (see <a href="https://ask.libreoffice.org/en/question/233189/">https://ask.libreoffice.org/en/question/233189/</a>).

In versions 5.0 and earlier, the image was anchored "to paragraph", and there
was no characters before first character of caption in the caption's paragraph.

The hard break was introduced for v.5.1 in
<a href="https://gerrit.libreoffice.org/plugins/gitiles/core/+/93ab0ff24cb71c36c9e7958046e96d7472b5af90">https://gerrit.libreoffice.org/plugins/gitiles/core/+/93ab0ff24cb71c36c9e7958046e96d7472b5af90</a>
(related to <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - docx: Graph export Offset and mislabelled"
   href="show_bug.cgi?id=93676">tdf#93676</a>).

The hidden attribute was introduced for v.5.3 in
<a href="https://gerrit.libreoffice.org/plugins/gitiles/core/+/feedd45ba2dd308af2d3a1b2f64681b9467535b6">https://gerrit.libreoffice.org/plugins/gitiles/core/+/feedd45ba2dd308af2d3a1b2f64681b9467535b6</a>
(which BTW broke the idea that hard break should keep the graphic separated
from the caption text if the outer frame is resized).

Removing the character doesn't bring immediately observable problems (it works
as with it, because hidden hard break does effectively nothing for text flow).
However, simply removing it looks incorrect if potential fix for <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Objects anchored as characters aren't treated as characters"
   href="show_bug.cgi?id=65323">tdf#65323</a> is
taken into account (which would make an as-char image to behave as printed
"alphabetic-like" character, which could disallow automatic line break between
the image and the immediately following alphabetic character). IMO, a better
fix would be to keep image anchored as character (as it is now), but make a
separate paragraph for it (using the same Figure paragraph style; separate
dedicated style seems to not be required, since figure index does not list
paragraphs without number range field), and put the caption on the next
paragraph.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>