Bug 132897 - FILEOPEN DOCX: Wrong rounded corners in autoshape rectangle and fit size to text ignored
Summary: FILEOPEN DOCX: Wrong rounded corners in autoshape rectangle and fit size to t...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 141658 (view as bug list)
Depends on:
Blocks: VML-Textbox
  Show dependency treegraph
 
Reported: 2020-05-09 22:06 UTC by Alvaro Segura
Modified: 2025-11-17 00:01 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample file where this behavior appears (41.67 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-05-09 22:07 UTC, Alvaro Segura
Details
Comparison of MSWord vs Writer rendering (8.82 KB, image/png)
2020-05-09 22:08 UTC, Alvaro Segura
Details
Rendering it LO 7.1.1 (2.92 KB, image/png)
2021-02-14 21:36 UTC, Alvaro Segura
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alvaro Segura 2020-05-09 22:06:52 UTC
Description:
A document contains a frame with a border having roundings in its corners. When loading in Writer the corners are sharp, not rounded.

Steps to Reproduce:
Load a document with a frame with rounded borders (a sample will be attached)

Actual Results:
No rounding

Expected Results:
Rounded borders


Reproducible: Always


User Profile Reset: No



Additional Info:
-
Comment 1 Alvaro Segura 2020-05-09 22:07:33 UTC
Created attachment 160578 [details]
Sample file where this behavior appears
Comment 2 Alvaro Segura 2020-05-09 22:08:30 UTC
Created attachment 160579 [details]
Comparison of MSWord vs Writer rendering

Look at the blue box in the first page: rounded in Power Point, not rounded in Writer
Comment 3 m_a_riosv 2020-05-11 08:00:30 UTC Comment hidden (obsolete)
Comment 4 Mike Kaganski 2020-06-01 08:25:13 UTC
(In reply to m.a.riosv from comment #3)

No, this is about rounded corners, while bug 49247 is about blurry effect on edges.
Comment 5 NISZ LibreOffice Team 2020-12-01 13:44:12 UTC
This is a VML shape v:roundrect with text inside it. Converting to DML in Word makes the rounded shape import correctly.
Comment 6 Aron Budea 2021-02-14 18:10:31 UTC
The borders are rounded after the following commit, but the shape is now smaller than the text box, which is a regression.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=bda05ba17362222b74727872579b65b3fa14e3d8
author		Regényi Balázs <regenyi.balazs@nisz.hu>	2020-12-01 12:16:12 +0100
committer	László Németh <nemeth@numbertext.org>	2020-12-10 10:27:33 +0100

tdf#41466 DOCX import: fix VML v:shape/v:textbox
Comment 7 Alvaro Segura 2021-02-14 21:36:16 UTC
Created attachment 169741 [details]
Rendering it LO 7.1.1

This is what the original sample file looks like in LO Writer 7.1.1. Probably what Aron mentions.

Not only is the border too small for the content, but also the rounding seems to have a radius too small.
Comment 8 Justin L 2021-11-10 09:23:22 UTC
*** Bug 141658 has been marked as a duplicate of this bug. ***
Comment 9 QA Administrators 2023-11-11 03:13:57 UTC Comment hidden (obsolete)
Comment 10 Regina Henschel 2023-11-11 14:51:02 UTC
The problem still exists in Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL threaded

The shape is imported as legacy rounded rectangle according to v:roundrect element in the file. But the file has in addition a v:textbox element. Such shape should be imported as drawing object 'text box'. Otherwise the attribute "mso-fit-shape-to-text:t" cannot be translated. The drawing object 'text box' has rounded corners too, so that is not a problem.

The radius of the rounding is half as large as it should be.
Comment 11 Regina Henschel 2023-11-11 15:10:17 UTC
It seems the description in https://learn.microsoft.com/en-us/windows/win32/vml/msdn-online-vml-arcsize-attribute:

"Defines the rounded corners of a rounded rectangle as a percentage of half the smaller dimension of the length and width of a rectangle. 0% would have square corners, and 100% would form circular corners. A square with an ArcSize value of 1.0 would be a circle. The default value is 0.2 (20%)."

does not fit to the reality. When the handle in the shape is dragged to its maximum, creating a circular rounding, then MS Office writes arcsize="0.5". So in reality the reference value is not "half the smaller dimension" but the "smaller of height and width".
Comment 12 QA Administrators 2025-11-11 03:14:29 UTC Comment hidden (obsolete)
Comment 13 Alvaro Segura 2025-11-16 21:31:28 UTC
I just tried the sample document with the latest LO 25.8.3 and the problem persists.

The autoshape rectangle is too small vertically (text overflows) and the corners rounding is too small.


Now some more info after more analysis:


The style says: "width:375.75pt;height:57.35pt" so the size is correct. But in Word the shape has *Adjust size to text* checked, so Word is expanding the shape for the text to fit. The XML indicates

<v:textbox style="mso-fit-shape-to-text:t">

and LO seems to ignore this flag.

Regarding the rounding, I've learned that the radius (arcsize="6981f" attribute) is expressed as a fraction of the smallest size (height or width). So, if the height was too short then the radius appeared too small.

After fixing the height so that the rectangles look the same, the rounding is still a little smaller.

The "f" suffix in arcsize means the fraction is scaled by 65536 ("6981f" -> 6981/65536 = 0.106 -> r = 10.6% of height).

By comparing Word and LO with different roundings, it appears that LO is making the radius *half of what it should*.
Comment 14 Regina Henschel 2025-11-17 00:01:09 UTC
Additional problem is, that the shape gets a text box attached although that is only implemented for custom shapes. But the imported shape is not a custom shape but a legacy rectangle. Thus the textbox is lost, when you save it as odt. And as it is not a text box, the command "Fit height to text" does not exist.