[Libreoffice] text:class-names and nested text:span/text:style-name

Michael Stahl mstahl at redhat.com
Thu Nov 24 14:46:10 PST 2011


On 24/11/11 16:37, Dag Wieers wrote:
> On Thu, 24 Nov 2011, Dag Wieers wrote:
> 
>> Case 1: Using text:class-names
>>
>>    <text:span text:class-names="strong">bold <text:span 
>> text:class-names="strong blue">blue</text:span> bold</text:span>
>>
>> No syles seem to have been applied.

i have found some rudimentary processing of text:class-names in the ODF
paragraph import, but even that is incomplete and cannot work.

so this attribute is sadly not supported; please file a bug in bugzilla.

>> Case 2: Using nested text:span/text:style-name
>>
>>    <text:span text:style-name="strong">bold <text:span 
>> text:style-name="blue">blue</text:span> bold</text:span>
>>
>> Bold is bold. Blue is blue, but not bold !
> 
> After more experiments I found that Case 2 does work when the styles 
> are defined inside <office:automatic-styles/> instead of <offic:styles/>.
> 
> Which I believe is a bug in LibreOffice.

have reproduced this: the problem only happens with the flat ODT import
filter, the ODT package import does it correctly.

so there is apparently a bug with the import of non-automatic styles in
flat ODT files; please file this also in bugzilla (separate from
class-names issue).

note that there is actually an obscure feature in the UI that allows you
to add multiple character styles:

1. open stylist
2. apply first character style. e.g. Emphasis
3. single click on second character style, e.g. Strong Emphasis
4. shift+double-click on second character style

the stylist cannot display a multi selection (i filed an OOo issue for
that once...), so it will only display one style as selected, but in the
text you can see both are applied.

in the ODF file this is stored as:

 <text:span text:style-name="Emphasis">
   <text:span text:style-name="Strong_20_Emphasis">Foo</text:span>
 </text:span>

which is the same thing you have.

regards,
 michael



More information about the LibreOffice mailing list