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

List:       koffice
Subject:    More thoughts about the filter architecture
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-03-07 1:53:59
[Download RAW message or body]

I just wrote a CSV _export_ filter for kspread, to go with the import
filter I did some time ago.

After using it on a document with a formula, it struck me that 
I had no way to export the _value_ of the cell instead of the 
formula, though that's what people usually want when exporting to CSV.
Well, the only way would be to reimplement KSpread...
... or to use it, since it is a shared library.

=> XML is a fine format for doing conversions, but sometimes we
might want to do more in the filter, using some functionality from
the actual app.

From the above, I can see two solutions in fact:

1 - The filter loads the XML file into KSpread's data structures
and makes kspread do the math - and then gets the values to export.
That's somewhat a bad solution though, because it means:
 KSpread data structures -> XML -> KSpread data structures -> CSV. Bleh.
But it fits quite well into the current architecture (the filter
just needs the XML as input data).

2 - The filter doesn't need an XML file as an input, but can instead
use KSpread's data structures directly (something like: the filter
gets a pointer to the KSpreadTable to export).
Pro: it can directly get hold of the values to export.
Con: the filter is not really standalone anymore, it requires kspread
(not only a compilation order problem, but also means the filter
is dependent on kspread's code - though I don't expect the data structures
to change much).

-> (2) seems the best solution. And IIRC it's very complementary to
what Matthias said he would need for import filters with graphics.
That is: we want to give a way for the app to pass an object to the
filter. The good thing is that QObject provides a safe way to do that
(type safety using inherits(), we don't pass a void * around with no checks).

Werner, IIRC you have some plans for such a thing ? Will the above
be possible in your new filters architecture ?

-- 
David FAURE
david@mandrakesoft.com, faure@kde.org
http://home.clara.net/faure/
KDE, Making The Future of Computing Available Today

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

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