1# *************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20# *************************************************************
21
22How to install this
23-------------------
24
25> cd instsetoo_native/util
26> LOCALINSTALLDIR=/where/you/want dmake openoffice_en-US PKGFORMAT=installed
27
28OOXML generally
29---------------
30
31- http://www.ecma-international.org/publications/standards/Ecma-376.htm
32- http://www.asahi-net.or.jp/~eb2m-mrt/ooxml/dependencies.html
33
34Related modules
35---------------
36
37- oox
38  - .xlsx and .pptx import
39
40- writerfilter
41  - import of .docx, uses also oox for the graphics etc.
42  - can also parse .doc; but used for ooxml only for now
43
44- filter
45  - the configuration stuff (so that the filters appear in the filepicker)
46
47Old binary filters (export)
48---------------------------
49
50- doc export
51  - sw/source/filter/ww8/wrtww8*
52    - wrtww8.cxx:2191 [SwWW8Writer::StoreDoc()] is the entry point
53
54  - eg.
55    #0  SwWW8Writer::WriteText (this=0x2aaab3dfb7c0) at /local/ooxml/ooxml/sw/source/filter/ww8/wrtww8.cxx:1846
56    #1  0x00002aaaae75a545 in SwWW8Writer::WriteMainText (this=0x2aaab3d6a870)
57        at /local/ooxml/ooxml/sw/source/filter/ww8/wrtww8.cxx:1925
58    #2  0x00002aaaae75e357 in SwWW8Writer::StoreDoc1 (this=0x2aaab3d6a870)
59        at /local/ooxml/ooxml/sw/source/filter/ww8/wrtww8.cxx:2076
60    #3  0x00002aaaae7605ec in SwWW8Writer::StoreDoc (this=0x2aaab3d6a870)
61        at /local/ooxml/ooxml/sw/source/filter/ww8/wrtww8.cxx:2383
62    #4  0x00002aaaae760fd5 in SwWW8Writer::WriteStorage (this=0x2aaab3d6a870)
63        at /local/ooxml/ooxml/sw/source/filter/ww8/wrtww8.cxx:2547
64    #5  0x00002aaaae70b793 in StgWriter::Write (this=0x2aaab3d6a870, rPaM=@0x2b3802a2b640, rStg=@0x2aaab3d621c0,
65        pFName=0x7fffb1b285c0) at /local/ooxml/ooxml/sw/source/filter/writer/writer.cxx:653
66    #6  0x00002aaaae70b84d in Writer::Write (this=0x2aaab3d6a870, rPaM=@0x2b3802a2b640, rStrm=@0x2aaaad979d20,
67        pFName=0x7fffb1b285c0) at /local/ooxml/ooxml/sw/source/filter/writer/writer.cxx:358
68    #7  0x00002aaaae70b993 in Writer::Write (this=0x2aaab3d6a870, rPam=@0x2b3802a2b640, rMed=@0x2aaaad999f30,
69        pFileName=0x7fffb1b285c0) at /local/ooxml/ooxml/sw/source/filter/writer/writer.cxx:385
70    #8  0x00002aaaae6375d7 in SwWriter::Write (this=0x7fffb1b28410, rxWriter=@0x7fffb1b285d0,
71        pRealFileName=0x7fffb1b285c0) at /local/ooxml/ooxml/sw/source/filter/basflt/shellio.cxx:963
72    #9  0x00002aaaae87cc1e in SwDocShell::ConvertTo (this=0xcc27f0, rMedium=@0x2aaaad999f30)
73        at /local/ooxml/ooxml/sw/source/ui/app/docsh.cxx:924
74    #10 0x00002b37faae6b58 in SfxObjectShell::DoLoad ()
75        from /local/ooxml/inst/openoffice.org3.0/program/../basis-link/program//libsfxlx.so
76
77- xls export
78  - sc/source/filter/excel/xe*
79
80  - eg.
81    #0  XclExpRecord::Save (this=0x11ae4c0, rStrm=@0x7fff5e6335d0)
82        at /local/ooxml/ooxml/sc/source/filter/excel/xerecord.cxx:88
83    #1  0x00002aaaae562c4a in ExcRecord::Save (this=0x11ae4c0, rStrm=@0x7fff5e6335d0)
84        at /local/ooxml/ooxml/sc/source/filter/excel/excrecds.cxx:168
85    #2  0x00002aaaae54b0fa in XclExpRecordList<XclExpRecordBase>::Save (this=0x11c5d18, rStrm=@0x7fff5e6335d0)
86        at ../inc/xerecord.hxx:281
87    #3  0x00002aaaae547541 in ExcTable::Write (this=0x11c5cf8, rStr=@0x7fff5e6335d0)
88        at /local/ooxml/ooxml/sc/source/filter/excel/excdoc.cxx:455
89    #4  0x00002aaaae5475fb in ExcDocument::Write (this=0x11c5ce0, rSvStrm=@0x2aaab3dcd070)
90        at /local/ooxml/ooxml/sc/source/filter/excel/excdoc.cxx:525
91    #5  0x00002aaaae568add in ExportBiff5::Write (this=0x7fff5e6339c0)
92        at /local/ooxml/ooxml/sc/source/filter/excel/expop2.cxx:119
93    #6  0x00002aaaae54f4af in ScExportExcel5 (rMedium=@0x2aaab3d87410, pDocument=0xce6a00, bBiff8=1 '\001', eNach=1)
94        at /local/ooxml/ooxml/sc/source/filter/excel/excel.cxx:252
95    #7  0x00002aaaadf1b70a in ScDocShell::ConvertTo (this=0xce6990, rMed=@0x2aaab3d87410)
96        at /local/ooxml/ooxml/sc/source/ui/docshell/docsh.cxx:2080
97    #8  0x00002b354dfd8b58 in SfxObjectShell::DoLoad ()
98        from /local/ooxml/inst/openoffice.org3.0/program/../basis-link/program//libsfxlx.so
99
100  - Current approach is to add a XclExpRecordBase::SaveXml() method, which
101    would be used to write the XML content (while Save() would continue
102    writing the BIFF format).
103  - Q: How do we get to the Save()/SaveXml() methods (e.g. the SST export code)
104    #0  XclExpSstImpl::Save (this=0x1b170b0, rStrm=@0x7fffd4d5c4a0)
105        at /home/jon/Development/OpenOffice.org/ooxml/sc/source/filter/excel/xecontent.cxx:224
106    #1  0x00007f68b7e46ff7 in XclExpSst::Save (this=0x1abc300,
107        rStrm=@0x7fffd4d5c4a0)
108        at /home/jon/Development/OpenOffice.org/ooxml/sc/source/filter/excel/xecontent.cxx:351
109    #2  0x00007f68b7de5090 in XclExpRecordList<XclExpRecordBase>::Save (
110        this=0x1b2d168, rStrm=@0x7fffd4d5c4a0) at ../inc/xerecord.hxx:282
111    // as above, starting at frame 2
112
113  - Thus, to get to the SaveXml() method, we need to add a slew of WriteXml()
114    methods that will (eventually) invoke the SaveXml() methods.
115
116  - ZipStorage for XML handling and StorageRef (XStorage interface)
117		- To construct ZipStorage, need XMultiServiceFactory (!), and
118			XInputStream.
119		- Have an SvStream; need to wrap SvStream with XInputStream
120			- OInputStreamWrapper in <unotools/streamwrap.hxx>
121		- Where do I get XMultiServiceFactory?
122			- Lots of places -- just grep
123			- perhaps XmlFilterBase _does_ make sense here.
124				- Do it anyway.
125	- Looking into having XclExpXmlStream inherit from ZipFilterBase
126		- problem: exception during construction, because ZipStorage hates me:
127		#0  OStorageFactory::createInstanceWithArguments (this=0x10612a0,
128				aArguments=@0x7fffe2ef76d0)
129				at /home/jon/Development/OpenOffice.org/ooxml/package/source/xstor/xfactory.cxx:275
130		#1  0x00007f12d93f0d5c in comphelper::OStorageHelper::GetStorageOfFormatFromStream (aFormat=@0x7fffe2ef7780, xStream=@0x1a502d8, nStorageMode=15,
131				xFactory=@0x1a502c0)
132				at /home/jon/Development/OpenOffice.org/ooxml/comphelper/source/misc/storagehelper.cxx:342
133		#2  0x00007f12c33d1a6d in ZipStorage (this=0x1a92550, rxFactory=@0x1a502c0,
134				rxStream=@0x1a502d8)
135				at /home/jon/Development/OpenOffice.org/ooxml/oox/source/helper/zipstorage.cxx:87
136		#3  0x00007f12c33f089e in oox::core::XmlFilterBase::implCreateStorage (
137				this=0x7fffe2ef7930, rxInStream=@0x1a502d0, rxStream=@0x1a502d8)
138				at /home/jon/Development/OpenOffice.org/ooxml/oox/source/core/xmlfilterbase.cxx:298
139		#4  0x00007f12c33dd204 in oox::core::FilterBase::filter (this=0x7fffe2ef7930,
140				rDescriptor=@0x7fffe2ef78d0)
141				at /home/jon/Development/OpenOffice.org/ooxml/oox/source/core/filterbase.cxx:284
142		#5  0x00007f12c68097a2 in XclExpXmlStream (this=0x7fffe2ef7930,
143				rSMgr=@0x7fffe2ef79a0, rStrm=@0x18d6f90)
144				at /home/jon/Development/OpenOffice.org/ooxml/sc/source/filter/excel/xestream.cxx:659
145		#6  0x00007f12c674c8c1 in ExcDocument::WriteXml (this=0x15911f0,
146				rStrm=@0x18d6f90)
147				at /home/jon/Development/OpenOffice.org/ooxml/sc/source/filter/excel/excdoc.cxx:575
148		...
149		- Actual problem: xfactory.cxx:274, the CheckPackageSignature_Impl() call.
150			- fails because the empty file has content (!), thus fails the "package
151				signature check" (which tries to ensure the file format is correct).
152		- Underlying file is an SvFileStream, created in
153			SfxMedium::GetOutStream().
154		- So why's CheckPackageSignature_Impl() fail?  Because
155			lcl_ExportExcel2007Xml() had the code:
156
157				SotStorageRef xRootStrg = new SotStorage( pMedStrm, FALSE );
158
159			That is, it was creating an OLE Structured Storage document over the
160			SvStream, and then (later) used the *same* SvStream and passed it to
161			ZipStorage.  This caused ZipStorage to complain because OLESS data was
162			already present in the file, with a different file signature than what
163			ZipPackage was expecting (go figure).
164
165- ppt export
166  - sd/source/filter/eppt/*
167  - svx/source/msfilter
168    - for eg. Escher export
169    - Escher: http://chicago.sourceforge.net/devel/docs/escher/index.html
170
171  - eg.
172    #0  PPTWriter (this=0x15807d0, rSvStorage=@0x7fff894f5340, rXModel=@0x142a2e8, rXStatInd=@0x142a2f0, pVBA=0x0,
173        nCnvrtFlags=15) at /local/ooxml/ooxml/sd/source/filter/eppt/eppt.cxx:268
174    #1  0x00002aaab3895719 in ExportPPT (rSvStorage=@0x7fff894f5340, rXModel=@0x142a2e8, rXStatInd=@0x142a2f0,
175        pVBA=0x0, nCnvrtFlags=15) at /local/ooxml/ooxml/sd/source/filter/eppt/eppt.cxx:2503
176    #2  0x00002aaaadef85b7 in SdPage::onParagraphRemoving ()
177       from /local/ooxml/inst/openoffice.org3.0/program/../basis-link/program/libsdlx.so
178    #3  0x00002aaaade202e3 in sd::DrawDocShell::ConvertTo ()
179       from /local/ooxml/inst/openoffice.org3.0/program/../basis-link/program/libsdlx.so
180    #4  0x00002aec23119b58 in SfxObjectShell::DoLoad ()
181       from /local/ooxml/inst/openoffice.org3.0/program/../basis-link/program//libsfxlx.so
182
183- odp export
184    #0  ZipPackage (this=0x1805e80, xNewFactory=@0x7fffe284e990) at /home/rodo/git/ooxml/package/source/zippackage/ZipPackage.cxx:279
185    #1  0x00002aaaadd3dc94 in ZipPackage_createInstance (xMgr=@0x7fffe284e990) at /home/rodo/git/ooxml/package/source/zippackage/ZipPackage.cxx:1546
186    #2  0x00002b0fca7ab6b3 in ?? () from /opt/openoffice.org3.0/program/../basis-link/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3
187    #3  0x00002b0fca7a7fda in ?? () from /opt/openoffice.org3.0/program/../basis-link/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3
188    #4  0x00002b0fca7a811e in ?? () from /opt/openoffice.org3.0/program/../basis-link/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3
189    #5  0x00002b0fca7aa7cc in ?? () from /opt/openoffice.org3.0/program/../basis-link/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3
190    #6  0x00002b0fca7aacbe in ?? () from /opt/openoffice.org3.0/program/../basis-link/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3
191    #7  0x00002b0fca7aa035 in ?? () from /opt/openoffice.org3.0/program/../basis-link/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3
192    #8  0x00002aaaaadae1b3 in ?? () from /opt/openoffice.org/ure/lib/bootstrap.uno.so
193    #9  0x00002aaaaadaa84c in ?? () from /opt/openoffice.org/ure/lib/bootstrap.uno.so
194    #10 0x00002aaab5c7a7e5 in OStorage_Impl::OpenOwnPackage (this=0x185cac0) at /home/rodo/git/ooxml/package/source/xstor/xstorage.cxx:549
195    #11 0x00002aaab5c7ab3e in OStorage_Impl::ReadContents (this=0x185cac0) at /home/rodo/git/ooxml/package/source/xstor/xstorage.cxx:649
196    #12 0x00002aaab5c7d32f in OStorage_Impl::FindElement (this=0x185cac0, rName=@0x7fffe284f280) at /home/rodo/git/ooxml/package/source/xstor/xstorage.cxx:1387
197    #13 0x00002aaab5c7dc45 in OStorage::hasByName (this=0x1808880, aName=@0x7fffe284f280) at /home/rodo/git/ooxml/package/source/xstor/xstorage.cxx:4045
198    #14 0x00002aaab1fde8c5 in XMLVersionListPersistence::load () from /opt/openoffice.org3.0/program/../basis-link/program/libxolx.so
199    #15 0x00002b0fcb058bb2 in SfxMedium::GetVersionList (this=0x1750050, _bNoReload=false) at /home/rodo/git/ooxml/sfx2/source/doc/docfile.cxx:3247
200    #16 0x00002b0fcb0571b5 in SfxMedium::GetStorage (this=0x1750050) at /home/rodo/git/ooxml/sfx2/source/doc/docfile.cxx:1328
201    #17 0x00002b0fcb05d0d7 in SfxMedium::GetOutputStorage (this=0x1750050) at /home/rodo/git/ooxml/sfx2/source/doc/docfile.cxx:1068
202    #18 0x00002b0fcb091227 in SfxObjectShell::SaveTo_Impl (this=0xf44d60, rMedium=@0x1750050, pSet=0x0) at /home/rodo/git/ooxml/sfx2/source/doc/objstor.cxx:1557
203    #19 0x00002b0fcb09443c in SfxObjectShell::PreDoSaveAs_Impl (this=0xf44d60, rFileName=@0x7fffe2850700, aFilterName=@0x7fffe28507f0, pParams=0xf10c10)
204        at /home/rodo/git/ooxml/sfx2/source/doc/objstor.cxx:2984
205    #20 0x00002b0fcb094ea5 in SfxObjectShell::CommonSaveAs_Impl (this=0xf44d60, aURL=@0x7fffe2850870, aFilterName=@0x7fffe28507f0, aParams=0x1740310)
206        at /home/rodo/git/ooxml/sfx2/source/doc/objstor.cxx:2855
207    #21 0x00002b0fcb0a1da2 in SfxObjectShell::APISaveAs_Impl (this=0xf44d60, aFileName=@0x7fffe2850b70, aParams=0x1740310)
208        at /home/rodo/git/ooxml/sfx2/source/doc/objserv.cxx:432
209    #22 0x00002b0fcb0e74c8 in SfxBaseModel::impl_store (this=0xf96a00, sURL=@0x7fffe28516b0, seqArguments=@0x7fffe2851ae0, bSaveTo=0 '\0')
210        at /home/rodo/git/ooxml/sfx2/source/doc/sfxbasemodel.cxx:2591
211    #23 0x00002b0fcb0f124b in SfxBaseModel::storeAsURL (this=0xf96a00, rURL=@0x7fffe28516b0, rArgs=@0x7fffe2851ae0)
212        at /home/rodo/git/ooxml/sfx2/source/doc/sfxbasemodel.cxx:1568
213    #24 0x00002b0fcb101d3d in SfxStoringHelper::GUIStoreModel (this=0x7fffe28519f0, xModel=@0xf18798, aSlotName=@0x7fffe2852200, aArgsSequence=@0x7fffe2851ae0,
214        bPreselectPassword=0 '\0') at /home/rodo/git/ooxml/sfx2/source/doc/guisaveas.cxx:1529
215    #25 0x00002b0fcb0a4051 in SfxObjectShell::ExecFile_Impl (this=0xf44d60, rReq=@0x1484f20) at /home/rodo/git/ooxml/sfx2/source/doc/objserv.cxx:744
216    #26 0x00002b0fcb0a5c73 in SfxStubSfxObjectShellExecFile_Impl (pShell=0xf44d60, rReq=@0x1484f20) at ../../unxlngx6.pro/inc/sfxslots.hxx:161
217    #27 0x00002b0fcb17f398 in SfxShell::CallExec (this=0xf44d60, pFunc=0x2b0fcb0a5c56 <SfxStubSfxObjectShellExecFile_Impl(SfxShell*, SfxRequest&)>, rReq=@0x1484f20)
218        at ../../inc/sfx2/shell.hxx:226
219    #28 0x00002b0fcb17cec3 in SfxDispatcher::Call_Impl (this=0x110fde0, rShell=@0xf44d60, rSlot=@0x2b0fcb576368, rReq=@0x1484f20, bRecord=1 '\001')
220        at /home/rodo/git/ooxml/sfx2/source/control/dispatch.cxx:338
221    #29 0x00002b0fcb17d3f2 in SfxDispatcher::PostMsgHandler (this=0x110fde0, pReq=0x1484f20) at /home/rodo/git/ooxml/sfx2/source/control/dispatch.cxx:1643
222    #30 0x00002b0fcb17d51d in SfxDispatcher::LinkStubPostMsgHandler (pThis=0x110fde0, pCaller=0x1484f20) at /home/rodo/git/ooxml/sfx2/source/control/dispatch.cxx:1610
223    #31 0x00002b0fcafb3e70 in Link::Call (this=0x11488f8, pCaller=0x1484f20) at /home/rodo/git/ooxml/solver/300/unxlngx6.pro/inc/tools/link.hxx:158
224    #32 0x00002b0fcb1a9952 in GenLink::Call (this=0x11488f8, pCaller=0x1484f20) at ../../inc/sfx2/genlink.hxx:63
225    #33 0x00002b0fcb1a9773 in SfxHintPoster::Event (this=0x11488e0, pPostedHint=0x1484f20) at /home/rodo/git/ooxml/sfx2/source/notify/hintpost.cxx:98
226    #34 0x00002b0fcb1a9984 in SfxHintPoster::DoEvent_Impl (this=0x11488e0, pPostedHint=0x1484f20) at /home/rodo/git/ooxml/sfx2/source/notify/hintpost.cxx:88
227    #35 0x00002b0fcb1a974f in SfxHintPoster::LinkStubDoEvent_Impl (pThis=0x11488e0, pCaller=0x1484f20) at /home/rodo/git/ooxml/sfx2/source/notify/hintpost.cxx:92
228    #36 0x00002b0fccef69f8 in ImplWindowFrameProc () from /opt/openoffice.org3.0/program/../basis-link/program/libvcllx.so
229    #37 0x00002b0fd3f91f8f in SalDisplay::DispatchInternalEvent () from /opt/openoffice.org/basis3.0/program/libvclplug_genlx.so
230    #38 0x00002b0fd0fa4a84 in GtkXLib::userEventFn () from /opt/openoffice.org/basis3.0/program/libvclplug_gtklx.so
231    #39 0x00002b0fd3cb0204 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
232    #40 0x00002b0fd3cb34fd in ?? () from /usr/lib64/libglib-2.0.so.0
233    #41 0x00002b0fd3cb39ce in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
234    #42 0x00002b0fd0fa4fd9 in GtkXLib::Yield () from /opt/openoffice.org/basis3.0/program/libvclplug_gtklx.so
235    #43 0x00002b0fccd1859e in Application::Yield () from /opt/openoffice.org3.0/program/../basis-link/program/libvcllx.so
236    #44 0x00002b0fccd18677 in Application::Execute () from /opt/openoffice.org3.0/program/../basis-link/program/libvcllx.so
237    #45 0x00002b0fc86fd803 in ?? () from /opt/openoffice.org3.0/program/../basis-link/program/libsoffice.so
238    #46 0x00002b0fccd1da24 in ImplSVMain () from /opt/openoffice.org3.0/program/../basis-link/program/libvcllx.so
239    #47 0x00002b0fccd1db15 in SVMain () from /opt/openoffice.org3.0/program/../basis-link/program/libvcllx.so
240    #48 0x00002b0fc872fe6c in soffice_main () from /opt/openoffice.org3.0/program/../basis-link/program/libsoffice.so
241    #49 0x000000000040114b in main ()
242