Bug 99729 - Large non-autofit text ignores anchor in TextBox
Summary: Large non-autofit text ignores anchor in TextBox
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:5.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-08 11:21 UTC by Mike Kaganski
Modified: 2016-08-09 12:34 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2016-05-08 11:21:21 UTC
If a Text Box contains text that is larger than the box, and
autofit is off, and autosize is off, and full width is off,
then test always alignes to box's top, regardless of
text anchor setting.

Steps to reproduce:
1. Create a new document (any of Writer, Calc, Impress, or Draw).
2. In this document, create a net Text Box (Insert->Text Box).
3. In new Text Box, add some text (just one letter is enough, just to prevent empty object removal).
4. While the object selected, Format->Object and shape->Text...
5. In the dialog, deselect "Fit * to text", and chose text anchor to bottom left.
5a. To make things more evident, apply a border to the Text Box.
6. Add some more text lines to the text box, to exceed the Text Box height. While typing, notice that text correctly align to the selected anchor (it goes upwards from bottom left corner of the box). Leave Text Box editor.

Expected result:
The text should stay where it was while typing.

Actual result:
The text jumps down, now it is aligned to the top left corner of the Text Box.

This bug is similar to bug 93124, but it is not the same, their internal causes are different. Bug 93124 is fixed by setting block (full width) alignment for imported text having differently-aligned paragraphs. This one is a core bug.

This is related to OOo bug i103454 (https://bz.apache.org/ooo/show_bug.cgi?id=103454). The fix for OOo bug dealt with only one king of text alignment (block/full width), but ignored other cases.

Tested with LO master, OOo 3.3.0 under Win10x64 and Ubuntu 14.04x64.
Comment 1 Mike Kaganski 2016-05-08 11:22:31 UTC
Confirming and taking. A patch is submitted to gerrit: https://gerrit.libreoffice.org/24717
Comment 2 V Stuart Foote 2016-05-08 12:46:25 UTC
Thanks Mike, confirming and adding Armin as well he might have some feedback for you.
Comment 3 Commit Notification 2016-06-28 07:05:29 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d37e39081328e94b7106c8f3ca1dbc629ecb9a80

tdf#99729 related: make SfxObjectShell::IsOwnStorageFormat acccessible

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2016-06-28 07:06:52 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3f9acf02b0a45deb258c96b638c6fddd9af31ff9

tdf#99729 prerequisite: model-level user data r/w

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2016-06-28 17:27:56 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0cb200d000fad8ba31c7400e08cd031823f27308

tdf#99729: fix text alignment (no autofit & no full width)

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2016-06-29 08:38:35 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a4780b3c8b45261e59ed3cbb34c4463d58ad8079

Revert "tdf#99729: fix text alignment (no autofit & no full width)"

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2016-06-29 09:50:37 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=488fd60c2dc2372f3dc33f5a5313e4f032adf968

Reinstate: tdf#99729: fix text alignment (no autofit & no full width)

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Christian Lohmaier 2016-07-06 12:18:04 UTC
please fix the measurements so it will also work without cleartype enabled on windows..

It is a pain to enable it on rdp connections each time, and easy to forget...

without cleartype I only get 134 nowhitecounts[0], with cleartype enabled it is 239

similar for the test for bug 93124 - without freetype the value is only 71 (Tor did change the test to make it work in this case by reducing the asserted value from 100 to 50)

Windows baseline, (Windows Server 2012R2, VS2013, virtualized in kvm)
Comment 9 Commit Notification 2016-07-07 14:15:23 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=90cf31d8fefb46adc582bc2466fae15778f2cfd7

tdf#99729: temporary fix unit test for cleartype-disabled config

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Mike Kaganski 2016-08-09 12:34:20 UTC
The submitted commit fixes the erroneous handling of oversized text in LO for any new LO document and for any document imported from foreign formats. It introduces a new compatibility flag: AnchoredTextOverflowLegacy, that is true by default, and is false for new documents and imported ones. This way, if an existing ODF document happens to rely on old behaviour, then it won't be affected by the patch, because it will not have the compat flag -> it will have default legacy handling.

Imported documents will also be improved; e.g., a test PPT document from attachment 123223 [details] (from bug 93124) will have last line of first slide vertically-aligned correctly.

Thanks Caolán for fixing my mistake, and thanks Thorsten for review!

Closing as RESOLVED FIXED.