Bug 96706 - Writer text boxes do not apply default style
Summary: Writer text boxes do not apply default style
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: high normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 107963 112055 (view as bug list)
Depends on:
Blocks: Textbox Writer-Styles
  Show dependency treegraph
 
Reported: 2015-12-24 08:30 UTC by Antonello
Modified: 2024-10-03 19:47 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Descriptive screenshot (33.68 KB, image/png)
2015-12-24 08:30 UTC, Antonello
Details
Example odt (12.29 KB, application/vnd.oasis.opendocument.text)
2015-12-24 08:31 UTC, Antonello
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonello 2015-12-24 08:30:36 UTC
Created attachment 121528 [details]
Descriptive screenshot

Steps to reproduce:
1) In libreoffice writer write some normal text and then add a text box using the AI icon button (see screenshot)
2) Change any of the Default style element (e.g. font red)
3) Changes are applied only to the "normal" paragraph, but not on the content of text box.

Expected behaviour:
As the "Default style" acts as master, the content of the box should apply the new style definition as well.
Comment 1 Antonello 2015-12-24 08:31:18 UTC
Created attachment 121529 [details]
Example odt
Comment 2 Buovjaga 2015-12-27 16:09:28 UTC
Reproduced.

Win 7 Pro 64-bit Version: 5.2.0.0.alpha0+
Build ID: a4764cfa80270f973da5861d0ddc28298bf16f4d
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-12-24_22:45:12
Locale: fi-FI (fi_FI)
Comment 3 QA Administrators 2017-12-08 08:07:24 UTC Comment hidden (obsolete)
Comment 4 Telesto 2018-02-15 19:49:33 UTC
Repro
Version: 6.1.0.0.alpha0+
Build ID: 06cfd5a962f9d8d9462fc270f1b1f730c90bddfe
CPU threads: 4; OS: Windows 6.3; UI render: default; 
Locale: nl-NL (nl_NL); Calc: CL
Comment 5 Heiko Tietze 2018-02-21 09:21:25 UTC
*** Bug 112055 has been marked as a duplicate of this bug. ***
Comment 6 Telesto 2018-02-21 11:03:42 UTC
For the record. Quote from bug 112055 comment 4; 

Regina Henschel

Currently the elements inside the text box are not able to use custom styles (those from styles.xml). That is a limitation of LibreOffice and not covered by file format.

Currently the <span> elements in the paragraphs inside the text box can use the same automatic styles as the <span> elements in the original text. LibreOffice uses it already, but not in all cases. That can be improved, but the current solution is not really an error.

The real problem is, that the paragraph styles are not handled correctly. The original text uses paragraph style "Standard", which is "Default style" in the UI. Because of the lacking feature of using custom styles from styles.xml, currently special automatic paragraph styles are generated in custom.xml. But that is wrongly done. It would be sufficient, if these special styles would get a style:parent-style-name="Standard" and nothing else. And in case the original text uses already an automatic paragraph style, the same automatic style can be used directly in the text-box.

That is about file format. Changes in the internal model might be more difficult.
Comment 7 QA Administrators 2019-04-07 03:44:27 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2021-04-07 03:53:40 UTC Comment hidden (obsolete)
Comment 9 Antonello 2021-04-07 09:49:07 UTC
Bug still present in LO 6.4.6.2

Version: 6.4.6.2
Build ID: 1:6.4.6-0ubuntu0.20.04.1
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: en-GB (en_GB.UTF-8); UI-Language: en-GB
Calc: threaded
Comment 10 QA Administrators 2023-04-08 03:25:31 UTC Comment hidden (obsolete)
Comment 11 V Stuart Foote 2024-10-02 13:15:44 UTC
remains an issue

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7198c5e49eff0b82cb423424eaed0ee94d66db7d
CPU threads: 8; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 12 Eyal Rozenberg 2024-10-03 10:26:11 UTC
Note that there is no need to delay the style change _after_ creating the textbox. This works too, as a reproducer:

1. Create new Writer document
2. Change the Default Paragraph Style (e.g. make the font color red or line spacing double).
3. Insert a new text box.
4. Type some text.

The paragraph within the text box will not respect the Default Paragraph Style.
Comment 13 Eyal Rozenberg 2024-10-03 10:27:41 UTC
(In reply to Regina Henschel from bug 112055 comment #4)
> Currently the elements inside the text box are not able to use custom styles
> (those from styles.xml). 

What about default styles?

> That is a limitation of LibreOffice and not covered by file format.

Didn't quite understand that sentence; does ODF support the use of styles in textboxes?
Comment 14 Regina Henschel 2024-10-03 18:54:34 UTC
(In reply to Eyal Rozenberg from comment #13)
> (In reply to Regina Henschel from bug 112055 comment #4)
> > Currently the elements inside the text box are not able to use custom styles
> > (those from styles.xml). 
> 
> What about default styles?

The "Default Paragraph Style" in Writer is the paragraph style "Standard" in style.xml.

> 
> > That is a limitation of LibreOffice and not covered by file format.
> 
> Didn't quite understand that sentence; does ODF support the use of styles in
> textboxes?

From point of ODF there is not difference between a "Text box" and a "Frame" in Writer. In both cases it is a <draw:frame ...><draw:text-box ...>...</draw:text-box></draw:frame> structure.

The different handling of "text box" and "frame" in Writer is produced by the LibreOffice-only rule "If the style assigned to the <draw:frame> element has an attribute style:parent-style-name, then treat is a 'frame' otherwise as 'text-box'". There is nothing in ODF, that supports such behavior.

And of cause ODF can use styles in text boxes. ODF allows styles for the graphic properties like border and fill, and paragraph and text properties included in the graphic properties at the <draw:frame> element and it allows styles for each paragraph inside the <draw:text-box> element and for each text span inside a paragraph.

It is only that LibreOffice does not support it.
Comment 15 V Stuart Foote 2024-10-03 19:07:31 UTC
*** Bug 163245 has been marked as a duplicate of this bug. ***
Comment 16 V Stuart Foote 2024-10-03 19:08:20 UTC
*** Bug 111921 has been marked as a duplicate of this bug. ***
Comment 17 V Stuart Foote 2024-10-03 19:08:39 UTC
*** Bug 130923 has been marked as a duplicate of this bug. ***
Comment 18 V Stuart Foote 2024-10-03 19:08:59 UTC
*** Bug 107963 has been marked as a duplicate of this bug. ***
Comment 19 V Stuart Foote 2024-10-03 19:21:40 UTC
Inability to style (PS/CS) the textual content of draw:text-box objects should be resolved. ODF would allow it, but from OOo to current LibreOffice we have not implemented support.
Comment 20 Eyal Rozenberg 2024-10-03 19:45:27 UTC
(In reply to Regina Henschel from comment #14)
> The different handling of "text box" and "frame" in Writer is produced by
> the LibreOffice-only rule "If the style assigned to the <draw:frame> element
> has an attribute style:parent-style-name, then treat is a 'frame' otherwise
> as 'text-box'".

What kind of style are we talking about here?

> And of cause ODF can use styles in text boxes. ODF allows styles for the
> graphic properties like border and fill, and paragraph and text properties
> included in the graphic properties at the <draw:frame> element and it allows
> styles for each paragraph inside the <draw:text-box> element and for each
> text span inside a paragraph.
> 
> It is only that LibreOffice does not support it.

About that... please consider confirming bug 163245.

Also, given what you've said, this bug seems like an actual bug rather than an enhancement request, since the Default Paragraph Style should apply to paragraphs within frames/text-boxes. (But correct me if I'm wrong).