[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: ODF Lists
From:       Sebastian Sauer <mail () dipe ! org>
Date:       2008-07-25 18:09:18
Message-ID: 200807252009.18738.mail () dipe ! org
[Download RAW message or body]

On Friday 25 July 2008, Thomas Zander wrote:
> On Thursday 24. July 2008 23:11:29 Sebastian Sauer wrote:
> > Sorry, but you disqualified for a reply. Please try again.
>
> Ok, reminder to self; don't write email after coming back from a tiring day
> (with some alcohol involved)...
> I apologize for insulting you or otherwise making you uncomfortable.

Thank you, that means a lot to me.

> On Thursday 24. July 2008 22:29:47 Sebastian Sauer wrote:
> > On Thursday 24 July 2008, Girish Ramakrishnan wrote:
> > > 2. Loading headings is not correct. We are supposed to use the header's
> > > paragraph's list style (See 14.11). Currently, we use outline-style.
> >
> > 14.11 (1.1 specs);
> > "The outline style is a list style that is applied to all headings within
> > a text document where the heading's paragraph style does not define a
> > list style to use itself."
> >
> > So, the paragstyle [list style] is only used if there is no outline-style
> > for it
>
> That's not how I read it, I think you misread it.
> I read it that the style's list style is to be used and only when there is
> no list style associated with the paragraph style we use the document-wide
> outline style as a fallback.

right, I turned the logic around in the description above but not that 
important since r830869 shows code that is more clear anyway;

KoParagraphStyle * paragraphStyle =
    d->textSharedData->paragraphStyle(styleName, d->stylesDotXml);
if( ! paragraphStyle->listStyle().isValid()) {
    // The outline style is a list style that is applied to all headings
    // within a text document where the heading's paragraph style
    // does not define a list style to use itself.
    KoListStyle liststyle;
    liststyle.setLevel(d->textSharedData->outlineLevel(level));
    paragraphStyle->setListStyle(liststyle);
}
else if( ! paragraphStyle->listStyle().hasPropertiesForLevel(level) ) {
    // Would imho make sense to apply the same logic to the level.
    KoListStyle liststyle = paragraphStyle->listStyle();
    liststyle.setLevel(d->textSharedData->outlineLevel(level));
    paragraphStyle->setListStyle(liststyle);
}
paragraphStyle->setListLevel(level);
paragraphStyle->applyStyle(block, /*applyListStyle*/ false);

But there is still the prob, that we need to create a QTextList for each 
header and put it in there (numbering, tree-structure). That's what the code 
within the "#if 0" block (r830869 - seems some of the logic went away) did a 
year ago;
1. create a QTextList where we put the header in (the QTextList acts logical 
as listitem) and
2. attach it to the parent (header-)QTextList as child and voila, we had a 
very easy way to deal with headers as if there are trees (iirc that logic was 
partly even ported from 1.6).

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic