Bug 123789 - Extend SfxStyleFamily by Shapes
Summary: Extend SfxStyleFamily by Shapes
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected)
Hardware: All All
: medium enhancement
Assignee: Not Assigned
Keywords: needsDevEval
Depends on:
Blocks: UNO-Command-New 89155 89369
  Show dependency treegraph
Reported: 2019-03-01 13:31 UTC by Heiko Tietze
Modified: 2019-04-04 12:48 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Tietze 2019-03-01 13:31:12 UTC
In order to have the drawing styles at menus and toolbars we need access to it. There exists the UNO command StyleApply with the attributes Style <string> (set to "Filled Blue", for example) and FamilyName <string> which needs to be added.

Rough code pointer to start: https://opengrok.libreoffice.org/xref/core/sw/source/core/unocore/unostyle.cxx?r=4d502ef3#1086

@Maxim: Is that enough for being a qualified easyhack? (There are many occurrences for StyleFamily)
Comment 1 Regina Henschel 2019-03-02 11:53:08 UTC
The problem is deeper than adding something to UI. There exists no special style family for frames but frame and shape styles both belong to the family 'graphic'. The distinction between frame and shape is done by the fact, that the automatic style which is referenced by the object has a parent style in case of a frame and does not have a parent style in case of a shape. The parent style is a custom style and visible in the UI.

Second problem is, that using custom styles is not implemented for shapes in Writer. Meaning, if you directly refer a custom style in the draw:style-name attribute of an object, it will make the object to a Writer-object if possible and will be ignored otherwise. 

You can see what problems this has looking at the attempt to consolidate the features of Writer-images and Draw-images. Similar hard problems will occur with Writer-frames and Draw-textboxes.

These problems are homemade and have nothing to do with the ODF specification.

All together I classify it has hard task.
Comment 2 Heiko Tietze 2019-03-02 14:10:35 UTC
Could imagine a intermediate solution is possible.
Comment 3 Regina Henschel 2019-03-03 12:56:54 UTC
It might be possible to solve a sub-task first: Implement the use of custom styles for a subset of shapes. Especially leave out those, which are written with draw:frame in file format. But that is still not an easyhack.
Comment 4 Xisco Faulí 2019-04-03 14:07:51 UTC
Hi Heiko,
What about adding this issue to the GSOC's ideas page ?
Comment 5 Heiko Tietze 2019-04-04 12:48:05 UTC
(In reply to Xisco Faulí from comment #4)
> What about adding this issue to the GSOC's ideas page ?