Bug 132928 - Optimal wrap wraps mostly at the right even enough room (2cm) at the left
Summary: Optimal wrap wraps mostly at the right even enough room (2cm) at the left
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Anchor-and-Text-Wrap
  Show dependency treegraph
 
Reported: 2020-05-10 18:04 UTC by Telesto
Modified: 2023-03-28 06:11 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (13.49 KB, application/vnd.oasis.opendocument.text)
2020-05-10 18:04 UTC, Telesto
Details
Example file (465.29 KB, application/vnd.oasis.opendocument.text)
2020-06-29 21:20 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-05-10 18:04:07 UTC
Description:
Optimal wrap  behavior does not match the documentation

Automatically wraps text to the left, to the right, or on all four sides of the border frame of the object. If the distance between the object and the page margin is less than 2 cm, the text is not wrapped.

Steps to Reproduce:
1. Open the attached file
2. Optimal wrap is enabled.. and proper result
3. Select the shape -> Position and size -> Increase height/width with 0,10
4. Text is wrapped to the right 

Actual Results:
Text is wrapped to the right 

Expected Results:
The shape is still 2 cm of the border.. or I'm i missing something


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.0.0.alpha0+ (x64)
Build ID: 97a2c1fc5e376c0c00968f17a0392c6d3a5ed565
CPU-threads: 4; Besturingssysteem: Windows 6.3 Build 9600; UI-render: Skia/Rooster; VCL: win; 
Locale: nl-NL (nl_NL); UI-taal: nl-NL
Calc: threaded
Comment 1 Telesto 2020-05-10 18:04:23 UTC
Created attachment 160616 [details]
Example file
Comment 2 Xisco Faulí 2020-05-11 09:21:13 UTC
Could you please share the link to the documentation ?
Comment 3 Telesto 2020-05-11 09:52:54 UTC
(In reply to Xisco Faulí from comment #2)
> Could you please share the link to the documentation ?

https://help.libreoffice.org/6.4/en-US/text/swriter/01/05060200.html?&DbPAR=WRITER&System=WIN

But not sure if it's a documentation issue.. It's more the behavioral part I'm concerned about.. Text should wrap around the shape, except if between border and shape is less than 2 cm.. But if i'm 2 cm out border it still isn't wrapping at the left.. 

Initial vision was.. Optimal wrap is wrap to the right always.. but documentation suggested otherwise.. I tried until I get the described result.. but this doesn't match the description.

However the current behavior is something it does for long long time already
Comment 4 Telesto 2020-05-11 12:18:33 UTC
How is optimal wrap supposed to work... It seems to me it's working differently compared how it's advertised..
Comment 5 Heiko Tietze 2020-05-12 08:00:12 UTC
First thought was that wrap starts with less than 1x width. But double size 2.8cm makes the line break either left or right. So the question goes to the developers: How exactly does optimal wrap work?
Comment 6 Heiko Tietze 2020-05-14 14:31:02 UTC
"Optimal" decides whether text floats before or after. Help says: "Automatically wraps text to the left, to the right, or on all four sides of the border frame of the object. If the distance between the object and the page margin is less than 2 cm, the text is not wrapped." file:///usr/lib/libreoffice/help/en-US/text/swriter/01/05060200.html

We can rename and we can change the default to parallel, which allows text floating to left and right. But I believe the question is resolved. Is it, Telesto?
Comment 7 Telesto 2020-05-14 19:25:21 UTC
(In reply to Heiko Tietze from comment #6)
> "Optimal" decides whether text floats before or after. Help says:
> "Automatically wraps text to the left, to the right, or on all four sides of
> the border frame of the object. If the distance between the object and the
> page margin is less than 2 cm, the text is not wrapped."
> file:///usr/lib/libreoffice/help/en-US/text/swriter/01/05060200.html
> 
> We can rename and we can change the default to parallel, which allows text
> floating to left and right. 

No answer given. The question is, does LibreOffice do what the Help says. 
Is the documentation is wrong; the behavior wrong; or even both? Or I'm I misreading something... 

1. Open the attached file
2. What you see: Optimal wrap (wrapped around; as expected from the help]
3. Select the shape -> Position and size -> Increase height/width with 0,10
4. Text is wrapped to the right 

Result: wrapped to the right (or left) depending on position
Expected:  wrapped around, as initial. Shape is still 2 cm from left/right page margin as I can see

Same for images; didn't expect otherwise.. but checked
Comment 8 Heiko Tietze 2020-05-15 08:08:16 UTC
(In reply to Telesto from comment #7)
> 2. What you see: Optimal wrap (wrapped around; as expected from the help]
> 3. Select the shape -> Position and size -> Increase height/width with 0,10
> 4. Text is wrapped to the right 

Again, Optimal wraps either left or right but not _parallel_. Knowing that I can follow the help. The icon is misleading and the label.
Comment 9 Telesto 2020-05-15 08:52:51 UTC
(In reply to Heiko Tietze from comment #8)
> (In reply to Telesto from comment #7)
> > 2. What you see: Optimal wrap (wrapped around; as expected from the help]
> > 3. Select the shape -> Position and size -> Increase height/width with 0,10
> > 4. Text is wrapped to the right 
> 
> Again, Optimal wraps either left or right but not _parallel_. Knowing that I
> can follow the help. The icon is misleading and the label.

If it's either left or right as you say: I agreee misleading icon/label..

However: why does it do _parallel_ in the sample file if the image/shape is small enough.
Comment 10 Heiko Tietze 2020-05-19 06:21:07 UTC
Some constants are defined in txtfly.cxx [1]:

// #i68520# (see https://bz.apache.org/ooo/show_bug.cgi?id=68520)

// Wrap only on sides with at least 2cm space for the text
#define TEXT_MIN 1134

// MS Word wraps on sides with even less space (value guessed).
#define TEXT_MIN_SMALL 300

// Wrap on both sides up to a frame width of 1.5cm
#define FRAME_MAX 850


Meaning, if the object is <1.5cm it wraps parallel in case of >2cm space to the border, otherwise left or right. The FRAME_MAX value seems ridiculous small but it's there since the big bang. From the UX POV I would either always try to parallel wrap (FRAME_MAX=PAGE_SIZE) or up to PAGE_SIZE-OBJECT_SIZE. However, if we touch this it breaks the layout of existing documents.

What we could do is to change the default to Parallel (or Page Wrap, see also bug 86429 for labeling issues) and hide Optimal from the context menu and the properties dialog. Not least because MSO has no "optimal" wrapping and the round-trip fails.

[1] https://opengrok.libreoffice.org/xref/core/sw/source/core/text/txtfly.cxx?r=d7855213#1350
Comment 11 Telesto 2020-05-22 14:24:31 UTC
(In reply to Heiko Tietze from comment #10)
> What we could do is to change the default to Parallel (or Page Wrap, see
> also bug 86429 for labeling issues) and hide Optimal from the context menu
> and the properties dialog. Not least because MSO has no "optimal" wrapping
> and the round-trip fails.

* Changing the page wrap to parallel +1 [Ideally with 7.0, IMHO]
* Hide optimal from the properties dialog/ context menu. Not showing any wrap for all those with optimal wrap? Sounds confusing. Removing from context menu, I can understand (but I foresee confusion/complains already). Banning it out.. maybe long term.. However if you plan to do that; phasing out..say next 2 years, please announce it already in release notes as forward guidance..
Comment 12 Telesto 2020-06-29 21:20:11 UTC
Created attachment 162526 [details]
Example file

Small note/warning of a side effect of changing the wrap setting to page wrap

Optimal wrap places the first paragraph below the image, if the image is the first thing on the page (as does Wrap off) All other cases hide the paragraph/cursor behind the image (in the given case). A like the 'optimal wrap' way, so a cursor below (instead of hidden behind). Except the part where you press Enter below the image, and image moves down.. but that does only happen with to character anchoring, not with to paragraph (I ideally prefer the "to paragraph" behavior in this given case)

So it's not a simple change the default without side effects (or additional changes are needed)
Comment 13 Justin L 2023-03-27 23:04:43 UTC
So, optimal wraps text to the side with the most room for text (except in the case where it is tiny in which case it wraps parallel). Sounds like only a documentation issue to me. That definition makes perfect sense in a practical world (although from a standards perspective it is very arbitrary and should not have included the parallel aspect).

Changing a default to use parallel wrap instead of optimal sounds like a bad idea to me. Rarely do you want text to wrap on both sides of something (only in the case of something centred and tiny). I suggest removing easy-hack.

In fact, I suggest closing this as NOTABUG. I don't see anything actionable here.

P.S. Microsoft DOES have an optimal setting. Both "tight" and "square" have a "largest only" choice. (It just doesn't do an arbitrary justify on occasion.)