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

List:       koffice-devel
Subject:    Re: Faster saving
From:       David Faure <faure () kde ! org>
Date:       2004-04-13 20:25:45
Message-ID: 200404132225.46327.faure () kde ! org
[Download RAW message or body]

On Tuesday 13 April 2004 21:52, Nicolas Goutte wrote:
> (The problem are the automatical styles. You have to process the last 
> paragraph to have them all. So you have the whole document in one way or 
> another in memory before writing the first OOWriter paragraph.)

I'm not sure why that's a problem. You just write out the whole content first,
and while iterating over them you register the automatic styles in KoOasisStyles
(dicts and maps), then you save those into styles.xml
(you just said in another mail that they have to be in content.xml, but I think that's 
not necessarily true, although OO does it that way).

This requires some data structures for the things to be saved - currently KoOasisStyles
uses QDomElement for loading, but if we decide against QDom for saving we
can use something else (even just a QString).

Keeping the string definition of the automatic styles during saving will still eat
much less memory than keeping the whole QDomDocument.
But I'm not yet sure it's really worth it.

> If you use QDom, it is for the flexibility to add 
> tags where and when you want. Otherwise, you can well go away from the QDom 
> idea and write directly the tags.

Well the idea is that by using an intermediate API, we can
1) avoid the risk of syntax errors
2) change the underlying implementation more easily.

-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.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