Bug 139246 - Drawing objects disappear when RTL page gets all-0 margins
Summary: Drawing objects disappear when RTL page gets all-0 margins
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
: 142966 (view as bug list)
Depends on:
Blocks: RTL-CTL Regressions-no-off-page-print-drawobj
  Show dependency treegraph
 
Reported: 2020-12-26 18:06 UTC by K.F.
Modified: 2023-05-04 08:44 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 K.F. 2020-12-26 18:06:47 UTC
Description:
The text box disappears when the text orientation is changed from right to left and the margin is set to 0.

However, it does not disappear completely, the print result is normal, and it disappears only on the edit screen.

Also, just invisible, if you click where the text box would be, the text will appear and you can edit it, but once you confirm it, it will disappear.

Steps to Reproduce:
1. After opening LibreOffice Writer, open "Styles"-> "Page Style" in the menu bar and go to the "Page" tab.
2.Change the value of "Text direction" to "Right-to-left (horizontal)" or "Right-to-left (vertical)",set "Margin" to 0 cm in all directions and press "OK" to confirm the setting.
3.Press "Insert" in the menu bar, press "Text Box", place the text box somewhere, and enter the appropriate sentence to confirm.

Actual Results:
The text box disappears.

Expected Results:
The text box should be displayed normally.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
When tested on Ubuntu 20.04 and Windows 7, both gave the same results.
The text box disappears only when editing. The result of exporting as PDF or printing is displayed without any problem.
Also, on the edit screen, it is not completely disappeared, it is just invisible, and if you click around the text box, the text will appear and you can edit it.
Comment 1 Dieter 2021-01-10 13:26:40 UTC
I confirm it with

Version: 7.0.4.2 (x64)
Build ID: dcf040e67528d9187c66b2379df5ea4407429775
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: threaded

Problem is related to text direction:
1. "Styles"-> "Page Style" => set all margins to 0 cm
2. Insert text box with some text => looks O.K.
3. "Styles"-> "Page Style" => Change the value of "Text direction" to "Right-to-left (horizontal)

Actual result: Textbox disappears

Related to bug 124987 (althouh textbox is anchored to paragraph)
Comment 2 Eyal Rozenberg 2021-02-26 20:34:26 UTC
Confirmed with 

Version: 7.1.0.3 / LibreOffice Community
Build ID: f6099ecf3d29644b5008cc8f48f42f4a40986e4c
CPU threads: 4; OS: Linux 5.9; UI render: default; VCL: gtk3
Locale: he-IL (en_IL); UI: en-US

but I believe the reproduction instructions are inaccurate. To reproduce what Fujita-san describes, do the following:

1. Start Libreoffice Writer.
2. On the menu bar, choose "Format | Page Style..."
3. Select the Page tab
4. Set "Text direction" to "Right-to-left (Horizontal)" ("Right-to-Left (Vertical)" may also do)
5. Press Ok.
6. On the menu bar, choose "Insert | Text Box"
7. Draw a reasonable-size text box, anywhere you like on the page (but to keep it simple, make sure it's within the page boundaries).
8. Click the text box.
9. Type in some text, e.g. "This is my textbox." The text may be either LTR or RTL, it doesn't matter.

Actual Results:
The textbox "disappears" - in the sense that nothing is rendered. But you can select it, and the selection matches the textbox's area you had drawn before. When editing, you see the text you've typed.

Expected Results:
The text box should be displayed normally, with the text you typed in.
Comment 3 Eyal Rozenberg 2021-02-26 20:38:01 UTC
But actually, you don't even need a textbox. That is, this issue is not about textboxes per se. Try this:


1. Start Libreoffice Writer.
2. Draw a(n opaque) rectangle on the page (e.g. using the Drawing toolbar)
3. On the menu bar, choose "Format | Page Style..."
4. Select the Page tab
5. Set "Text direction" to "Right-to-left (Horizontal)" ("Right-to-Left (Vertical)" may also do)
6. Press Ok.

Actual Results:
The rectangle "disappears" - in the sense that nothing is rendered. You can select it, and the selection is offset as you would expect it to be due to the changes of margins (i.e. due to the anchoring of the rectangle)

Expected Results:
The rectangle should be offset according to the margin change, but continue to appear with its opaque color.
Comment 4 Regina Henschel 2022-08-15 11:56:52 UTC
This is about the situation, that an object is anchored to paragraph for example and the page margins are zero. Bug 117938 is about page anchored objects. Thus I think it is not duplicate to bug 117938.

The behavior is still wrong in Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 4e2ce2a460458f17ee4360c45a2da2fc4b4d753e
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (en_US); UI: en-US
Calc: CL
Comment 5 Regina Henschel 2022-08-15 11:57:34 UTC
*** Bug 142966 has been marked as a duplicate of this bug. ***
Comment 6 Mike Kaganski 2022-08-15 12:21:03 UTC
(In reply to Regina Henschel from comment #5)

Please do not forget to bring relevant info from the duplicate, if it's missing in the main bug; or alternatively, mark even older bugs as duplicates of a newer one, when it contain more information.

(raal from bug 142966 comment #4)
> This seems to have begun at the below commit.
> Adding Cc: to Michael Stahl; Could you possibly take a look at this one?
> Thanks
> 
>     source 689cead9e0837dc932e3a4cd765f7d319b529018
> 
> https://git.libreoffice.org/core/+/689cead9e0837dc932e3a4cd765f7d319b529018
>    tdf#91260 svx, sw: don't paint off-page part of drawing object