Revision 830870

Go back to digest for 13th July 2008

Other in Office

Pierre Ducroquet committed changes in /trunk/koffice:

Ok, I think I'll not understand the mess with KoListStyle soon, and I hate having code waiting on my harddrive for more than a week.

I store the outline level in KoTextBlockData because it is *not* a style property.

So I agree that it could be cool, easier to have the outline level in the style, but it is not the right place if we want a strict implementation.

Setting the outline level in a block attribute would have bad results : the QTextBlockFormat could be different for blocks even if they share the same style, and that would be a mess to merge back the QTextBlockFormats together.

Because it is perfectly legal to have two headings with the same style but a different outline level. For instance, the user create a "heading" style, apply this style for every heading he has, but decides to change the outline for each heading. It is allowed (but not supported by OpenOffice.org).

Also supporting the default outline level is gonna be quite hard, because we need a difference in KoParagraphStyle::applyStyle : if we apply when loading the document, the default outline level doesn't matter (see the spec quote above), but if we apply following a request from the user, we must set the outline level if it's not already set.

I hope this explanation is clear enough.

Ideally, I would have used a KoListStyle, but I fear we will run into troubles when saving. (Ok, currently, we don't support saving lists at all, that's easier)

So, I'll continue hitting the wall with my head to understand how we are supposed to use KoListStyle with headings and still support the spec, but meanwhile I commit to show that I'm working on this thing and to prevent any code loss (I had an hardware problem yesterday, I only hope I won't have other problems in the next days).

File Changes

Modified 4 files
  • /trunk/koffice
  •   /libs/kotext/KoTextBlockData.cpp
  •   /libs/kotext/KoTextBlockData.h
  •   /plugins/variables/TOCVariable.cpp
  •   /libs/kotext/opendocument/KoTextLoader.cpp
4 files changed in total