Remove list style from headings
AcceptedPublic

Authored by akomakhin on Oct 22 2019, 9:05 AM.

Details

Reviewers
pvuorela
boemann
danders
Group Reviewers
Calligra: 3.0
Summary

Bug description: headings are interpreted as lists, so, list style applied, and list markers (numbers by default) appear.
After some investigation I've found a style:num-format property of text:outline-level-style. It's used for analyzing, which symbol should be used for numbered list: decimal number, Rome number, alphabet, etc. If style:num-format = "" (this is normal), then Calligra leaves formatSpecification's default value -- it is Numeric, which leads to behavior, seen on a screenshot.

Diff Detail

Repository
R8 Calligra
Lint
Lint Skipped
Unit
Unit Tests Skipped
akomakhin created this revision.Oct 22 2019, 9:05 AM
Restricted Application added a project: Calligra: 3.0. · View Herald TranscriptOct 22 2019, 9:05 AM
Restricted Application added a subscriber: Calligra-Devel-list. · View Herald Transcript
akomakhin requested review of this revision.Oct 22 2019, 9:05 AM
akomakhin added reviewers: pvuorela, Calligra: 3.0.
akomakhin edited the summary of this revision. (Show Details)Oct 22 2019, 9:08 AM

I think this will break those headings that actually should have numbering, so i think further investigation is needed with such cases

I think this will break those headings that actually should have numbering, so i think further investigation is needed with such cases

list->add(block, level); is called everytime, no matter if option "is-list-header" exists, or not. So, all headings are supposed to be lists? Then, how should we distinguish numbered from nonnumbered one?

All I'm saying is removing it completely is probably just as wrong as leaving it in. Maybe you could come up with some if case

All I'm saying is removing it completely is probably just as wrong as leaving it in. Maybe you could come up with some if case

Interesting: saving document with numbered, and then unnumbered headings explicitly sets text:is-list-header to "true".

I think add should be conditional.

akomakhin updated this revision to Diff 69451.Nov 8 2019, 3:16 PM
akomakhin edited the summary of this revision. (Show Details)

This looks scarily generic

What happens when the user via gui adds a numbered lists, and what is the impact in the other applications

You are definitely on to something with formatSpecification, but maybe not setting is for all but only when loading headers without numbers.

But there is a simple statement in loadOdf function: if "num-format" is empty, then formatSpecification has a default value -- Numeric style. Isn't it strange, assuming all list styles numerical?

Not strange for a normal list - but yes for headings it sounds wrong - and I think this is where you need to make the changes.

So if in load odf you are loading a heading and it doesn't specify numbering set it formatspecification to empty.

But please make sure that "it doesn't specify numbering" is checked in parent styles etc. Also if the code is shared with presenter then presenter probably should react differently. the fix is probably not simple at all, but keep digging and check the odf standard specification

According to this is it correct to set formatSpecification to Empty if "num-format" value is empty in all lists, not only in headings?

akomakhin updated this revision to Diff 69568.Nov 11 2019, 9:09 AM

OK, let's set formatSpecification explicitly to Empty if "num-format" value is empty. OASIS 1.2 says, in cases "an empty string" or "no value" is given, then no number sequence is displayed.

+1, i'm ok with that.

Actually seems to now revert that one line as it was before commit fc7b878f206fb / https://bugs.kde.org/show_bug.cgi?id=306141

But the rationale sounds good to me, fixes the issue and not able to immediately reproduce the old bug.

Camilla, ok for you?

danders accepted this revision.Mar 12 2020, 8:36 AM
danders added a subscriber: danders.

Most seems to be positive, so go for it.

This revision is now accepted and ready to land.Mar 12 2020, 8:36 AM