Difference between revisions of "Export filter framework"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Export to external (alien) format)
Line 13: Line 13:
 
== Zip-based package format ==
 
== Zip-based package format ==
 
TODO: fill it.
 
TODO: fill it.
 +
 +
[[Category: Office Open XML]]

Revision as of 15:15, 1 May 2007

The best thing to do in order to have a good understanding of what OO.o does when you save or export a file is to read the relevant code. A good place to start would be the SfxObjectShell::SaveTo_Impl(...) method in sfx2/source/doc/objstor.cxx. This method depicts the overall flow of the file save / file export operation, so reading that code will give you a good overview of the process. Beware, though, that the SaveTo_Impl method has roughly 600-lines of code in it. So, tracing the code there will probably drain a lot of your energy. Take a lot of vitamin before you start! :-)

The basic export framework is set by class SfxObjectShell, which is sub-classed by the document shell class of each application (Writer, Calc and Draw/Impress) to implement several virtual functions of SfxObjectShell. Class SfxMedium represents the document to be saved, and class SfxFilter represents the filter that saves the document.

The export process also makes the following distinction.

  • Native OO.o format (such as ODF) - call SfxObjectShell::SaveAsOwnFormat(...)
  • Non-native, "alien" format - call SfxObjectShell::ExportTo(...) or SfxObjectShell::ConvertTo(...), the latter being a virtual function that is overwritten by each application.

Export to external (alien) format

This probably covers the vast majority of the export filters. The main flow moves to either ExportTo(...) in SfxObjectShell, or ConvertTo(...) in the same class. ConvertTo(...) is a virtual function overwritten by the current application's document shell class; ScDocShell for Calc, SwDocShell for Writer, and sd::DrawDocShell for Draw/Impress. The distinction between these two calls is unclear; it is differentiated based on whether or not the filter has flag SFX_FILTER_STARONEFILTER, but it's not clear what that flag means.

Zip-based package format

TODO: fill it.

Personal tools