Skip to content

New Calligra factories for ods, odp, odg documents

Ben Martin requested to merge monkeyiq/odfserver:calligramulti into master

Because each of these uses a different executable to interact with the Office Suite it makes sense to have a collection of factories to handle "Calligra" as a whole. Otherwise you are having to manage many executable paths for a single factory which makes Calligra different to other factories.

I'm happy to switch over to doing multiple executables in one factory if that is the more desired approach.

I'm not too sure about the naming on these guys. The Calligra Words factory appears as just "Words" and the spreadsheet handling is just "Sheets" which seems a tad generic and prone to clashing with other applications. We could switch to compound naming like Calligra-Words or some other scheme. Along these lines MSO appears as just "Office" which is perhaps a bit misleading, perhaps Microsoft-Office would be a better canonical name for the factory/sniffer combination there.

It is possible to abstract some of perform() here. But that also extends to the perform in many other factories so I've left it for a future task. For example, many of the perform() calls test the input and output types for sanity, but the sniffer already knows what triples are valid for this factory, so we could reuse that information in an ensureInputOutputTypesAreValid() type call which uses the sniffer metadata and throws exceptions if there is an anomaly. But I think perhaps it is better to consider this as a future task and throw it around a little.

Merge request reports