summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2011-03-09 22:49:23 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2011-03-09 22:49:23 -0600
commitf673d89a6a4f6b2d3d519ab17a57b299cb6be1ad (patch)
treedc8127da17e362197b1b19df7b6957ce554fb0fd /oox
parent50bc1bc97b170c38648fab979ccb812a3c458cab (diff)
parent818573bfbce420afedffd45d7bb080f25da32625 (diff)
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101
* commit 'ooo/DEV300_m101': (252 commits) masterfix DEV300: #i10000# usage of L10N build_type ab80: Adding changes of cws mib21, ab77, ab77run2, dr77i to dev300 DEV300 masterfix: #i116747#: remove pre-OSX Mac resoure fork definition files (*.r) hr75: #i116747#: remove obsolete copyright notices hr75: #i116747#: remove pre-OSX Mac resoure fork definition files (*.r) #i10000# WAE: cast to right type gnumake3: remove comphelper version; fix including extract.hxx chart52: #i28670# import/export of manual chart legend size from/to XLS chart52: #i28670# import of manual chart legend size from OOXML chart52: adapt to changed API removetooltypes: adjust rebase for linux removetooltypes01: #i112600# adjust rebase for windows removetooltypes01: #i112600# Fix build problems on non-pro CWS gnumake3: -D_DLL is needed on Windows; removed superficial _DLL_ usage all over the place added some accessible names and releations in PDFImport dialog and XML Settings dialog masterfix: #i10000# header file removed XPathLogger.cxx: added include for <stdio.h> masterfix: #i10000#: WAE fix removetooltypes01: #i112600# Remove tool types from binfilter, starmath, svx, toolkit and xmloff removetooltypes01: #i112600# remove tooltypes from writerfilter ... Conflicts: binfilter/bf_basic/source/classes/sbunoobj.cxx binfilter/bf_basic/source/inc/buffer.hxx binfilter/bf_basic/source/inc/filefmt.hxx binfilter/bf_basic/source/runtime/basrdll.cxx binfilter/bf_basic/source/sbx/sbxdec.hxx binfilter/bf_basic/source/sbx/sbxres.hxx binfilter/bf_forms/source/component/DatabaseForm.hxx binfilter/bf_forms/source/component/forms_CheckBox.cxx binfilter/bf_forms/source/component/forms_ComboBox.cxx binfilter/bf_forms/source/component/forms_Currency.cxx binfilter/bf_forms/source/component/forms_Date.cxx binfilter/bf_forms/source/component/forms_Edit.cxx binfilter/bf_forms/source/component/forms_File.cxx binfilter/bf_forms/source/component/forms_Filter.cxx binfilter/bf_forms/source/component/forms_FormComponent.cxx binfilter/bf_forms/source/component/forms_FormattedField.cxx binfilter/bf_forms/source/component/forms_GroupManager.cxx binfilter/bf_forms/source/component/forms_Hidden.cxx binfilter/bf_forms/source/component/forms_ImageControl.cxx binfilter/bf_forms/source/component/forms_ListBox.cxx binfilter/bf_forms/source/component/forms_Numeric.cxx binfilter/bf_forms/source/component/forms_Pattern.cxx binfilter/bf_forms/source/component/forms_RadioButton.cxx binfilter/bf_forms/source/component/forms_Time.cxx binfilter/bf_forms/source/misc/forms_formsmodule.cxx binfilter/bf_forms/source/misc/forms_services.cxx binfilter/bf_forms/source/resource/forms_frm_resource.cxx binfilter/bf_sc/source/core/inc/ansitab.hxx binfilter/bf_sc/source/core/tool/sc_compiler.cxx binfilter/bf_sc/source/ui/docshell/sc_docsh.cxx binfilter/bf_sc/source/ui/inc/dbdocfun.hxx binfilter/bf_sc/source/ui/inc/drawutil.hxx binfilter/bf_sc/source/ui/inc/dwfunctr.hxx binfilter/bf_sc/source/ui/inc/editable.hxx binfilter/bf_sc/source/ui/inc/gridmerg.hxx binfilter/bf_sc/source/ui/inc/imoptdlg.hxx binfilter/bf_sc/source/ui/inc/namecrea.hxx binfilter/bf_sc/source/ui/inc/navsett.hxx binfilter/bf_sc/source/ui/inc/refundo.hxx binfilter/bf_sc/source/ui/inc/undoolk.hxx binfilter/bf_sc/source/ui/inc/viewutil.hxx binfilter/bf_sc/source/ui/unoobj/sc_appluno.cxx binfilter/bf_sch/source/ui/app/sch_menu.src binfilter/bf_sch/source/ui/inc/globopt.hxx binfilter/bf_sch/source/ui/inc/guiutil.hxx binfilter/bf_sch/source/ui/unoidl/sch_register.cxx binfilter/bf_sd/source/filter/bin/sd_sdbinfilter.cxx binfilter/bf_sd/source/filter/propread.hxx binfilter/bf_sd/source/filter/xml/sd_sdxmlwrp.cxx binfilter/bf_sd/source/ui/inc/unokywds.hxx binfilter/bf_sd/source/ui/unoidl/sd_facreg.cxx binfilter/bf_sfx2/source/appl/sfx2_appmain.cxx binfilter/bf_sfx2/source/appl/sfx2_appuno.cxx binfilter/bf_sfx2/source/doc/sfx2_objserv.cxx binfilter/bf_sfx2/source/inc/fltoptint.hxx binfilter/bf_sfx2/source/inc/sfxtypes.hxx binfilter/bf_so3/inc/binddata.hxx binfilter/bf_so3/source/inplace/client.cxx binfilter/bf_so3/source/ole/socont.h binfilter/bf_so3/source/persist/binddata.cxx binfilter/bf_so3/source/persist/transbnd.cxx binfilter/bf_so3/source/persist/transprt.cxx binfilter/bf_starmath/source/starmath_register.cxx binfilter/bf_svtools/source/config/svt_menuoptions.cxx binfilter/bf_svtools/source/config/svt_saveopt.cxx binfilter/bf_svtools/source/config/svt_searchopt.cxx binfilter/bf_svtools/source/filter.vcl/igif/decode.hxx binfilter/bf_svtools/source/items1/svt_cenumitm.cxx binfilter/bf_svtools/source/items1/svt_poolio.cxx binfilter/bf_svtools/source/misc/svt_ehdl.cxx binfilter/bf_svtools/source/misc1/svt_adrparse.cxx binfilter/bf_svtools/source/misc1/svt_inethist.cxx binfilter/bf_svtools/source/numbers/numfmuno.hxx binfilter/bf_svtools/source/numbers/numhead.hxx binfilter/bf_svtools/source/numbers/svt_numfmuno.cxx binfilter/bf_svtools/source/numbers/svt_numuno.cxx binfilter/bf_svtools/source/numbers/zforscan.hxx binfilter/bf_svtools/source/svdde/ddeimp.hxx binfilter/bf_svtools/source/uno/svt_registerservices.cxx binfilter/bf_svx/source/editeng/svx_editattr.cxx binfilter/bf_svx/source/inc/dbtoolsclient.hxx binfilter/bf_svx/source/items/svx_paperinf.cxx binfilter/bf_svx/source/outliner/paralist.hxx binfilter/bf_svx/source/svdraw/svdtxhdl.hxx binfilter/bf_svx/source/svdraw/svx_svdattr.cxx binfilter/bf_svx/source/unodraw/svx_unoctabl.cxx binfilter/bf_svx/source/unodraw/svx_unoprov.cxx binfilter/bf_svx/source/xoutdev/svx_xfontmac.cxx binfilter/bf_sw/source/core/bastyp/sw_index.cxx binfilter/bf_sw/source/core/except/sw_errhdl.cxx binfilter/bf_sw/source/core/inc/docfld.hxx binfilter/bf_sw/source/core/inc/flowfrm.hxx binfilter/bf_sw/source/core/inc/frame.hxx binfilter/bf_sw/source/core/inc/hffrm.hxx binfilter/bf_sw/source/core/inc/notxtfrm.hxx binfilter/bf_sw/source/core/inc/pamtyp.hxx binfilter/bf_sw/source/core/inc/rowfrm.hxx binfilter/bf_sw/source/core/inc/sectfrm.hxx binfilter/bf_sw/source/core/inc/splargs.hxx binfilter/bf_sw/source/core/inc/splcstk.hxx binfilter/bf_sw/source/core/inc/swblocks.hxx binfilter/bf_sw/source/core/inc/tabfrm.hxx binfilter/bf_sw/source/core/inc/toxhlp.hxx binfilter/bf_sw/source/core/inc/txmsrt.hxx binfilter/bf_sw/source/core/inc/txtfrm.hxx binfilter/bf_sw/source/core/layout/virtoutp.hxx binfilter/bf_sw/source/core/sw3io/crypter.hxx binfilter/bf_sw/source/core/sw3io/sw3imp.hxx binfilter/bf_sw/source/core/sw3io/sw3marks.hxx binfilter/bf_sw/source/core/sw3io/sw_sw3imp.cxx binfilter/bf_sw/source/core/sw3io/sw_sw3io.cxx binfilter/bf_sw/source/core/swg/rdswg.hxx binfilter/bf_sw/source/core/swg/swgids.hxx binfilter/bf_sw/source/core/text/guess.hxx binfilter/bf_sw/source/core/text/itratr.hxx binfilter/bf_sw/source/core/unocore/sw_unoobj.cxx binfilter/bf_sw/source/core/unocore/sw_unoobj2.cxx binfilter/bf_sw/source/filter/basflt/sw_fltini.cxx binfilter/bf_sw/source/filter/excel/excfntbf.hxx binfilter/bf_sw/source/filter/excel/excvfbff.hxx binfilter/bf_sw/source/filter/excel/excxfbuf.hxx binfilter/bf_sw/source/filter/inc/fltglbls.hxx binfilter/bf_sw/source/filter/inc/fltini.hxx binfilter/bf_sw/source/filter/inc/w4wflt.hxx binfilter/bf_sw/source/filter/inc/w4wpar.hxx binfilter/bf_sw/source/filter/inc/w4wstk.hxx binfilter/bf_sw/source/filter/inc/wrt_fn.hxx binfilter/bf_sw/source/filter/inc/wrtswtbl.hxx binfilter/bf_sw/source/filter/w4w/w4wgraf.hxx binfilter/bf_sw/source/filter/w4w/wrtw4w.hxx binfilter/bf_sw/source/filter/xml/sw_swxml.cxx binfilter/bf_sw/source/filter/xml/sw_xmliteme.cxx binfilter/bf_sw/source/filter/xml/xmlexpit.hxx binfilter/bf_sw/source/filter/xml/xmlimpit.hxx binfilter/bf_sw/source/filter/xml/xmlitem.hxx binfilter/bf_sw/source/filter/xml/xmltbli.hxx binfilter/bf_sw/source/ui/app/sw_docsh.cxx binfilter/bf_sw/source/ui/app/sw_docshini.cxx binfilter/bf_sw/source/ui/dbui/sw_dbmgr.cxx binfilter/bf_sw/source/ui/inc/bmpwin.hxx binfilter/bf_sw/source/ui/inc/caption.hxx binfilter/bf_sw/source/ui/inc/docinf.hxx binfilter/bf_sw/source/ui/inc/fontcfg.hxx binfilter/bf_sw/source/ui/inc/formedt.hxx binfilter/bf_sw/source/ui/inc/hdftctrl.hxx binfilter/bf_sw/source/ui/inc/idxmrk.hxx binfilter/bf_sw/source/ui/inc/initui.hxx binfilter/bf_sw/source/ui/inc/modcfg.hxx binfilter/bf_sw/source/ui/inc/pview.hxx binfilter/bf_sw/source/ui/inc/scroll.hxx binfilter/bf_sw/source/ui/inc/swcont.hxx binfilter/bf_sw/source/ui/inc/uitool.hxx binfilter/bf_sw/source/ui/inc/unotxvw.hxx binfilter/bf_sw/source/ui/inc/usrpref.hxx binfilter/bf_sw/source/ui/inc/workctrl.hxx binfilter/bf_sw/source/ui/inc/wrtsh.hxx binfilter/bf_sw/source/ui/uno/sw_unofreg.cxx binfilter/bf_xmloff/source/core/xmloff_facreg.cxx binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx binfilter/bf_xmloff/source/forms/xmloff_elementexport.cxx binfilter/bf_xmloff/source/forms/xmloff_formenums.cxx binfilter/bf_xmloff/source/forms/xmloff_layerimport.cxx binfilter/bf_xmloff/source/style/xmloff_EnumPropertyHdl.cxx binfilter/bf_xmloff/source/style/xmloff_adjushdl.cxx binfilter/bf_xmloff/source/style/xmloff_weighhdl.cxx binfilter/bf_xmloff/source/text/xmloff_txtimp.cxx binfilter/binfilterdetect/source/bindetect.cxx binfilter/filter/source/bf_migrate/bf_migrateexports.cxx binfilter/filter/source/bf_migrate/bf_migratefilter.cxx binfilter/filter/source/bf_migrate/bf_migratefilter.hxx binfilter/filter/source/bf_offwrp/bf_wrapper.cxx binfilter/inc/bf_basic/basmgr.hxx binfilter/inc/bf_basic/sbmeth.hxx binfilter/inc/bf_basic/sbstar.hxx binfilter/inc/bf_basic/sbx.hxx binfilter/inc/bf_basic/sbxcore.hxx binfilter/inc/bf_basic/sbxdef.hxx binfilter/inc/bf_basic/sbxfac.hxx binfilter/inc/bf_basic/sbxobj.hxx binfilter/inc/bf_basic/sbxvar.hxx binfilter/inc/bf_goodies/b3dcolor.hxx binfilter/inc/bf_goodies/b3dcompo.hxx binfilter/inc/bf_goodies/b3dentty.hxx binfilter/inc/bf_goodies/b3dgeom.hxx binfilter/inc/bf_goodies/b3dlight.hxx binfilter/inc/bf_goodies/b3dtex.hxx binfilter/inc/bf_goodies/b3dtrans.hxx binfilter/inc/bf_goodies/b3dvolum.hxx binfilter/inc/bf_goodies/base3d.hxx binfilter/inc/bf_goodies/bucket.hxx binfilter/inc/bf_goodies/hmatrix.hxx binfilter/inc/bf_goodies/matril3d.hxx binfilter/inc/bf_goodies/matrix3d.hxx binfilter/inc/bf_goodies/point3d.hxx binfilter/inc/bf_goodies/point4d.hxx binfilter/inc/bf_goodies/vector3d.hxx binfilter/inc/bf_sc/arealink.hxx binfilter/inc/bf_sc/bclist.hxx binfilter/inc/bf_sc/callform.hxx binfilter/inc/bf_sc/cellform.hxx binfilter/inc/bf_sc/chartuno.hxx binfilter/inc/bf_sc/chgviset.hxx binfilter/inc/bf_sc/collect.hxx binfilter/inc/bf_sc/column.hxx binfilter/inc/bf_sc/conditio.hxx binfilter/inc/bf_sc/consoli.hxx binfilter/inc/bf_sc/dbcolect.hxx binfilter/inc/bf_sc/dbdocutl.hxx binfilter/inc/bf_sc/dbtoken.hxx binfilter/inc/bf_sc/detdata.hxx binfilter/inc/bf_sc/detfunc.hxx binfilter/inc/bf_sc/dociter.hxx binfilter/inc/bf_sc/docpool.hxx binfilter/inc/bf_sc/docuno.hxx binfilter/inc/bf_sc/dpobject.hxx binfilter/inc/bf_sc/dpoutput.hxx binfilter/inc/bf_sc/dpsave.hxx binfilter/inc/bf_sc/dpshttab.hxx binfilter/inc/bf_sc/dptabdat.hxx binfilter/inc/bf_sc/dptabres.hxx binfilter/inc/bf_sc/drawpage.hxx binfilter/inc/bf_sc/drwlayer.hxx binfilter/inc/bf_sc/editsrc.hxx binfilter/inc/bf_sc/fielduno.hxx binfilter/inc/bf_sc/filter.hxx binfilter/inc/bf_sc/fmtuno.hxx binfilter/inc/bf_sc/funcuno.hxx binfilter/inc/bf_sc/global.hxx binfilter/inc/bf_sc/hints.hxx binfilter/inc/bf_sc/indexmap.hxx binfilter/inc/bf_sc/inputopt.hxx binfilter/inc/bf_sc/markarr.hxx binfilter/inc/bf_sc/markdata.hxx binfilter/inc/bf_sc/navicfg.hxx binfilter/inc/bf_sc/optutil.hxx binfilter/inc/bf_sc/pagepar.hxx binfilter/inc/bf_sc/printopt.hxx binfilter/inc/bf_sc/prnsave.hxx binfilter/inc/bf_sc/progress.hxx binfilter/inc/bf_sc/rangelst.hxx binfilter/inc/bf_sc/rangenam.hxx binfilter/inc/bf_sc/rangeseq.hxx binfilter/inc/bf_sc/rangeutl.hxx binfilter/inc/bf_sc/rechead.hxx binfilter/inc/bf_sc/refdata.hxx binfilter/inc/bf_sc/refreshtimer.hxx binfilter/inc/bf_sc/scmod.hxx binfilter/inc/bf_sc/shapeuno.hxx binfilter/inc/bf_sc/sortparam.hxx binfilter/inc/bf_sc/stlsheet.hxx binfilter/inc/bf_sc/subtotal.hxx binfilter/inc/bf_sc/table.hxx binfilter/inc/bf_sc/tablink.hxx binfilter/inc/bf_sc/tabopparams.hxx binfilter/inc/bf_sc/textuno.hxx binfilter/inc/bf_sc/unoguard.hxx binfilter/inc/bf_sc/unowids.hxx binfilter/inc/bf_sc/userdat.hxx binfilter/inc/bf_sc/validat.hxx binfilter/inc/bf_sc/viewopti.hxx binfilter/inc/bf_sch/calculat.hxx binfilter/inc/bf_sch/charttyp.hxx binfilter/inc/bf_sch/chaxis.hxx binfilter/inc/bf_sch/chdescr.hxx binfilter/inc/bf_sch/docshell.hxx binfilter/inc/bf_sch/glob.hxx binfilter/inc/bf_sch/globfunc.hxx binfilter/inc/bf_sch/memchrt.hxx binfilter/inc/bf_sch/objfac.hxx binfilter/inc/bf_sch/schgroup.hxx binfilter/inc/bf_sch/stlsheet.hxx binfilter/inc/bf_sd/anminfo.hxx binfilter/inc/bf_sd/docshell.hxx binfilter/inc/bf_sd/drawdoc.hxx binfilter/inc/bf_sd/grdocsh.hxx binfilter/inc/bf_sd/sdattr.hxx binfilter/inc/bf_sfx2/app.hxx binfilter/inc/bf_sfx2/bitset.hxx binfilter/inc/bf_sfx2/docfac.hxx binfilter/inc/bf_sfx2/docfile.hxx binfilter/inc/bf_sfx2/docfilt.hxx binfilter/inc/bf_sfx2/docinf.hxx binfilter/inc/bf_sfx2/doctempl.hxx binfilter/inc/bf_sfx2/event.hxx binfilter/inc/bf_sfx2/fcontnr.hxx binfilter/inc/bf_sfx2/frameobj.hxx binfilter/inc/bf_sfx2/genlink.hxx binfilter/inc/bf_sfx2/interno.hxx binfilter/inc/bf_sfx2/minarray.hxx binfilter/inc/bf_sfx2/minstack.hxx binfilter/inc/bf_sfx2/misccfg.hxx binfilter/inc/bf_sfx2/plugobj.hxx binfilter/inc/bf_sfx2/printer.hxx binfilter/inc/bf_sfx2/saveopt.hxx binfilter/inc/bf_sfx2/sfxuno.hxx binfilter/inc/bf_sfx2/timestamp.hxx binfilter/inc/bf_so3/binding.hxx binfilter/inc/bf_so3/factory.hxx binfilter/inc/bf_so3/ipenv.hxx binfilter/inc/bf_so3/ipwin.hxx binfilter/inc/bf_so3/linkmgr.hxx binfilter/inc/bf_so3/linksrc.hxx binfilter/inc/bf_so3/lnkbase.hxx binfilter/inc/bf_so3/outplace.hxx binfilter/inc/bf_so3/persist.hxx binfilter/inc/bf_so3/protocol.hxx binfilter/inc/bf_so3/pseudo.hxx binfilter/inc/bf_so3/so2dll.hxx binfilter/inc/bf_so3/svstor.hxx binfilter/inc/bf_so3/transbnd.hxx binfilter/inc/bf_so3/transprt.hxx binfilter/inc/bf_starmath/symbol.hxx binfilter/inc/bf_starmath/unomodel.hxx binfilter/inc/bf_starmath/utility.hxx binfilter/inc/bf_starmath/xchar.hxx binfilter/inc/bf_svtools/DocumentInfoPreview.hxx binfilter/inc/bf_svtools/aeitem.hxx binfilter/inc/bf_svtools/apearcfg.hxx binfilter/inc/bf_svtools/bf_prewin.h binfilter/inc/bf_svtools/bintitem.hxx binfilter/inc/bf_svtools/brdcst.hxx binfilter/inc/bf_svtools/broadcast.hxx binfilter/inc/bf_svtools/cancel.hxx binfilter/inc/bf_svtools/cenumitm.hxx binfilter/inc/bf_svtools/cintitem.hxx binfilter/inc/bf_svtools/cntnrsrt.hxx binfilter/inc/bf_svtools/cntwall.hxx binfilter/inc/bf_svtools/cstitem.hxx binfilter/inc/bf_svtools/ctypeitm.hxx binfilter/inc/bf_svtools/custritm.hxx binfilter/inc/bf_svtools/dateitem.hxx binfilter/inc/bf_svtools/defaultoptions.hxx binfilter/inc/bf_svtools/dtritem.hxx binfilter/inc/bf_svtools/eitem.hxx binfilter/inc/bf_svtools/expander.hxx binfilter/inc/bf_svtools/filerec.hxx binfilter/inc/bf_svtools/filter.hxx binfilter/inc/bf_svtools/flagitem.hxx binfilter/inc/bf_svtools/flbytes.hxx binfilter/inc/bf_svtools/fltcall.hxx binfilter/inc/bf_svtools/fltdefs.hxx binfilter/inc/bf_svtools/frqitem.hxx binfilter/inc/bf_svtools/fstathelper.hxx binfilter/inc/bf_svtools/gifread.hxx binfilter/inc/bf_svtools/globalnameitem.hxx binfilter/inc/bf_svtools/hint.hxx binfilter/inc/bf_svtools/htmlout.hxx binfilter/inc/bf_svtools/httpcook.hxx binfilter/inc/bf_svtools/imap.hxx binfilter/inc/bf_svtools/imapcirc.hxx binfilter/inc/bf_svtools/imapobj.hxx binfilter/inc/bf_svtools/imappoly.hxx binfilter/inc/bf_svtools/imaprect.hxx binfilter/inc/bf_svtools/inethist.hxx binfilter/inc/bf_svtools/inidef.hxx binfilter/inc/bf_svtools/intitem.hxx binfilter/inc/bf_svtools/itemiter.hxx binfilter/inc/bf_svtools/itempool.hxx binfilter/inc/bf_svtools/itemset.hxx binfilter/inc/bf_svtools/jpeg.hxx binfilter/inc/bf_svtools/lckbitem.hxx binfilter/inc/bf_svtools/lingucfg.hxx binfilter/inc/bf_svtools/listener.hxx binfilter/inc/bf_svtools/lngmisc.hxx binfilter/inc/bf_svtools/loginerr.hxx binfilter/inc/bf_svtools/lstner.hxx binfilter/inc/bf_svtools/misccfg.hxx binfilter/inc/bf_svtools/nfkeytab.hxx binfilter/inc/bf_svtools/nranges.hxx binfilter/inc/bf_svtools/pngread.hxx binfilter/inc/bf_svtools/poolcach.hxx binfilter/inc/bf_svtools/ptitem.hxx binfilter/inc/bf_svtools/rectitem.hxx binfilter/inc/bf_svtools/reqitem.hxx binfilter/inc/bf_svtools/searchopt.hxx binfilter/inc/bf_svtools/sectctr.hxx binfilter/inc/bf_svtools/section.hxx binfilter/inc/bf_svtools/sgfbram.hxx binfilter/inc/bf_svtools/sgffilt.hxx binfilter/inc/bf_svtools/slstitm.hxx binfilter/inc/bf_svtools/style.hxx binfilter/inc/bf_svtools/svarray.hxx binfilter/inc/bf_svtools/svdde.hxx binfilter/inc/bf_svtools/svicnvw.hxx binfilter/inc/bf_svtools/svimpbox.hxx binfilter/inc/bf_svtools/svimpicn.hxx binfilter/inc/bf_svtools/syslocaleoptions.hxx binfilter/inc/bf_svtools/szitem.hxx binfilter/inc/bf_svtools/testtool.hxx binfilter/inc/bf_svtools/tfrmitem.hxx binfilter/inc/bf_svtools/tresitem.hxx binfilter/inc/bf_svtools/ttprops.hxx binfilter/inc/bf_svtools/undo.hxx binfilter/inc/bf_svtools/whiter.hxx binfilter/inc/bf_svtools/wmf.hxx binfilter/inc/bf_svtools/xbmread.hxx binfilter/inc/bf_svtools/xmlcnimp.hxx binfilter/inc/bf_svtools/xpmread.hxx binfilter/inc/bf_svtools/zforfind.hxx binfilter/inc/bf_svtools/zforlist.hxx binfilter/inc/bf_svtools/zformat.hxx binfilter/inc/bf_svx/boxobj.hxx binfilter/inc/bf_svx/camera3d.hxx binfilter/inc/bf_svx/cube3d.hxx binfilter/inc/bf_svx/def3d.hxx binfilter/inc/bf_svx/deflt3d.hxx binfilter/inc/bf_svx/dlight3d.hxx binfilter/inc/bf_svx/editdata.hxx binfilter/inc/bf_svx/editobj.hxx binfilter/inc/bf_svx/editstat.hxx binfilter/inc/bf_svx/editview.hxx binfilter/inc/bf_svx/extrud3d.hxx binfilter/inc/bf_svx/fmmodel.hxx binfilter/inc/bf_svx/fmpage.hxx binfilter/inc/bf_svx/forbiddencharacterstable.hxx binfilter/inc/bf_svx/gallery.hxx binfilter/inc/bf_svx/grfcrop.hxx binfilter/inc/bf_svx/lathe3d.hxx binfilter/inc/bf_svx/light3d.hxx binfilter/inc/bf_svx/linkmgr.hxx binfilter/inc/bf_svx/obj3d.hxx binfilter/inc/bf_svx/outliner.hxx binfilter/inc/bf_svx/outlobj.hxx binfilter/inc/bf_svx/plight3d.hxx binfilter/inc/bf_svx/pntobj3d.hxx binfilter/inc/bf_svx/poly3d.hxx binfilter/inc/bf_svx/polygn3d.hxx binfilter/inc/bf_svx/polyob3d.hxx binfilter/inc/bf_svx/polysc3d.hxx binfilter/inc/bf_svx/scene3d.hxx binfilter/inc/bf_svx/sdginitm.hxx binfilter/inc/bf_svx/sdooitm.hxx binfilter/inc/bf_svx/sdshitm.hxx binfilter/inc/bf_svx/sdtagitm.hxx binfilter/inc/bf_svx/sdtaiitm.hxx binfilter/inc/bf_svx/sdtcfitm.hxx binfilter/inc/bf_svx/sdynitm.hxx binfilter/inc/bf_svx/sphere3d.hxx binfilter/inc/bf_svx/svdattr.hxx binfilter/inc/bf_svx/svddrag.hxx binfilter/inc/bf_svx/svdetc.hxx binfilter/inc/bf_svx/svdhdl.hxx binfilter/inc/bf_svx/svdhlpln.hxx binfilter/inc/bf_svx/svdio.hxx binfilter/inc/bf_svx/svditer.hxx binfilter/inc/bf_svx/svdlayer.hxx binfilter/inc/bf_svx/svdmark.hxx binfilter/inc/bf_svx/svdmodel.hxx binfilter/inc/bf_svx/svdmrkv.hxx binfilter/inc/bf_svx/svdoattr.hxx binfilter/inc/bf_svx/svdocapt.hxx binfilter/inc/bf_svx/svdocirc.hxx binfilter/inc/bf_svx/svdoedge.hxx binfilter/inc/bf_svx/svdograf.hxx binfilter/inc/bf_svx/svdogrp.hxx binfilter/inc/bf_svx/svdomeas.hxx binfilter/inc/bf_svx/svdoole2.hxx binfilter/inc/bf_svx/svdopage.hxx binfilter/inc/bf_svx/svdopath.hxx binfilter/inc/bf_svx/svdorect.hxx binfilter/inc/bf_svx/svdosmbr.hxx binfilter/inc/bf_svx/svdosmev.hxx binfilter/inc/bf_svx/svdosmrt.hxx binfilter/inc/bf_svx/svdotext.hxx binfilter/inc/bf_svx/svdouno.hxx binfilter/inc/bf_svx/svdovirt.hxx binfilter/inc/bf_svx/svdpage.hxx binfilter/inc/bf_svx/svdpagv.hxx binfilter/inc/bf_svx/svdpntv.hxx binfilter/inc/bf_svx/svdpool.hxx binfilter/inc/bf_svx/svdsob.hxx binfilter/inc/bf_svx/svdtouch.hxx binfilter/inc/bf_svx/svdtypes.hxx binfilter/inc/bf_svx/svdundo.hxx binfilter/inc/bf_svx/svdviter.hxx binfilter/inc/bf_svx/svdvmark.hxx binfilter/inc/bf_svx/svimbase.hxx binfilter/inc/bf_svx/svx3ditems.hxx binfilter/inc/bf_svx/svxfont.hxx binfilter/inc/bf_svx/swafopt.hxx binfilter/inc/bf_svx/sxcaitm.hxx binfilter/inc/bf_svx/sxcecitm.hxx binfilter/inc/bf_svx/sxcllitm.hxx binfilter/inc/bf_svx/sxmbritm.hxx binfilter/inc/bf_svx/sxmspitm.hxx binfilter/inc/bf_svx/sxmsuitm.hxx binfilter/inc/bf_svx/sxmtaitm.hxx binfilter/inc/bf_svx/sxmtfitm.hxx binfilter/inc/bf_svx/sxmtritm.hxx binfilter/inc/bf_svx/sxopitm.hxx binfilter/inc/bf_svx/unoedsrc.hxx binfilter/inc/bf_svx/unoforou.hxx binfilter/inc/bf_svx/unolingu.hxx binfilter/inc/bf_svx/unoshape.hxx binfilter/inc/bf_svx/unotext.hxx binfilter/inc/bf_svx/unoviwed.hxx binfilter/inc/bf_svx/unoviwou.hxx binfilter/inc/bf_svx/viewpt3d.hxx binfilter/inc/bf_svx/volume3d.hxx binfilter/inc/bf_svx/xbitmap.hxx binfilter/inc/bf_svx/xflbckit.hxx binfilter/inc/bf_svx/xflbmsli.hxx binfilter/inc/bf_svx/xflbmtit.hxx binfilter/inc/bf_svx/xflbstit.hxx binfilter/inc/bf_svx/xflftrit.hxx binfilter/inc/bf_svx/xflgrit.hxx binfilter/inc/bf_svx/xflhtit.hxx binfilter/inc/bf_svx/xftmrit.hxx binfilter/inc/bf_svx/xit.hxx binfilter/inc/bf_svx/xlndsit.hxx binfilter/inc/bf_svx/xlnedcit.hxx binfilter/inc/bf_svx/xlnstcit.hxx binfilter/inc/bf_svx/xmlcnitm.hxx binfilter/inc/bf_svx/xmlgrhlp.hxx binfilter/inc/bf_svx/xoutbmp.hxx binfilter/inc/bf_svx/xoutx.hxx binfilter/inc/bf_svx/xpoly.hxx binfilter/inc/bf_svx/xpolyimp.hxx binfilter/inc/bf_svx/xpool.hxx binfilter/inc/bf_svx/xtextit0.hxx binfilter/inc/bf_svx/zoomitem.hxx binfilter/inc/bf_sw/accessibilityoptions.hxx binfilter/inc/bf_sw/authfld.hxx binfilter/inc/bf_sw/authratr.hxx binfilter/inc/bf_sw/bparr.hxx binfilter/inc/bf_sw/breakit.hxx binfilter/inc/bf_sw/calbck.hxx binfilter/inc/bf_sw/cellatr.hxx binfilter/inc/bf_sw/cellfml.hxx binfilter/inc/bf_sw/charatr.hxx binfilter/inc/bf_sw/crsrsh.hxx binfilter/inc/bf_sw/crsskip.hxx binfilter/inc/bf_sw/cshtyp.hxx binfilter/inc/bf_sw/ddefld.hxx binfilter/inc/bf_sw/docary.hxx binfilter/inc/bf_sw/docfac.hxx binfilter/inc/bf_sw/docsh.hxx binfilter/inc/bf_sw/docstat.hxx binfilter/inc/bf_sw/docufld.hxx binfilter/inc/bf_sw/dpage.hxx binfilter/inc/bf_sw/drawdoc.hxx binfilter/inc/bf_sw/editsh.hxx binfilter/inc/bf_sw/errhdl.hxx binfilter/inc/bf_sw/expfld.hxx binfilter/inc/bf_sw/fesh.hxx binfilter/inc/bf_sw/fmtanchr.hxx binfilter/inc/bf_sw/fmtclds.hxx binfilter/inc/bf_sw/fmtcnct.hxx binfilter/inc/bf_sw/fmtcntnt.hxx binfilter/inc/bf_sw/fmtfordr.hxx binfilter/inc/bf_sw/fmtfsize.hxx binfilter/inc/bf_sw/fmtftntx.hxx binfilter/inc/bf_sw/fmthdft.hxx binfilter/inc/bf_sw/fmtline.hxx binfilter/inc/bf_sw/fmtlsplt.hxx binfilter/inc/bf_sw/fmtornt.hxx binfilter/inc/bf_sw/fmtsrnd.hxx binfilter/inc/bf_sw/format.hxx binfilter/inc/bf_sw/frmatr.hxx binfilter/inc/bf_sw/frmfmt.hxx binfilter/inc/bf_sw/ftninfo.hxx binfilter/inc/bf_sw/grfatr.hxx binfilter/inc/bf_sw/hintids.hxx binfilter/inc/bf_sw/hints.hxx binfilter/inc/bf_sw/index.hxx binfilter/inc/bf_sw/iodetect.hxx binfilter/inc/bf_sw/linetype.hxx binfilter/inc/bf_sw/mdiexp.hxx binfilter/inc/bf_sw/ndarr.hxx binfilter/inc/bf_sw/ndindex.hxx binfilter/inc/bf_sw/ndole.hxx binfilter/inc/bf_sw/ndtxt.hxx binfilter/inc/bf_sw/ndtyp.hxx binfilter/inc/bf_sw/newhdl.hxx binfilter/inc/bf_sw/pagedesc.hxx binfilter/inc/bf_sw/pageiter.hxx binfilter/inc/bf_sw/paratr.hxx binfilter/inc/bf_sw/poolfmt.awk binfilter/inc/bf_sw/poolfmt.hxx binfilter/inc/bf_sw/pvprtdat.hxx binfilter/inc/bf_sw/redline.hxx binfilter/inc/bf_sw/reffld.hxx binfilter/inc/bf_sw/shellio.hxx binfilter/inc/bf_sw/sw3io.hxx binfilter/inc/bf_sw/swatrset.hxx binfilter/inc/bf_sw/swcrsr.hxx binfilter/inc/bf_sw/swdbdata.hxx binfilter/inc/bf_sw/swdbtoolsclient.hxx binfilter/inc/bf_sw/swevent.hxx binfilter/inc/bf_sw/swgpar.hxx binfilter/inc/bf_sw/swgstr.hxx binfilter/inc/bf_sw/swmodule.hxx binfilter/inc/bf_sw/swprtopt.hxx binfilter/inc/bf_sw/swrect.hxx binfilter/inc/bf_sw/swregion.hxx binfilter/inc/bf_sw/swserv.hxx binfilter/inc/bf_sw/swtable.hxx binfilter/inc/bf_sw/swtypes.hxx binfilter/inc/bf_sw/swunohelper.hxx binfilter/inc/bf_sw/swwait.hxx binfilter/inc/bf_sw/tgrditem.hxx binfilter/inc/bf_sw/toxwrap.hxx binfilter/inc/bf_sw/txatbase.hxx binfilter/inc/bf_sw/txatritr.hxx binfilter/inc/bf_sw/txtatr.hxx binfilter/inc/bf_sw/txtftn.hxx binfilter/inc/bf_sw/txtinet.hxx binfilter/inc/bf_sw/undobj.hxx binfilter/inc/bf_sw/unoatxt.hxx binfilter/inc/bf_sw/unocoll.hxx binfilter/inc/bf_sw/unocrsr.hxx binfilter/inc/bf_sw/unodraw.hxx binfilter/inc/bf_sw/unoevtlstnr.hxx binfilter/inc/bf_sw/unofield.hxx binfilter/inc/bf_sw/unoframe.hxx binfilter/inc/bf_sw/unoidx.hxx binfilter/inc/bf_sw/unoobj.hxx binfilter/inc/bf_sw/unoport.hxx binfilter/inc/bf_sw/unoprnms.hxx binfilter/inc/bf_sw/unoredline.hxx binfilter/inc/bf_sw/unoredlines.hxx binfilter/inc/bf_sw/unosrch.hxx binfilter/inc/bf_sw/unostyle.hxx binfilter/inc/bf_sw/unotbl.hxx binfilter/inc/bf_sw/unotxdoc.hxx binfilter/inc/bf_sw/viewopt.hxx binfilter/inc/bf_sw/viewsh.hxx binfilter/inc/bf_sw/viscrs.hxx binfilter/inc/bf_xmloff/NamedBoolPropertyHdl.hxx binfilter/inc/bf_xmloff/VisAreaContext.hxx binfilter/inc/bf_xmloff/i18nmap.hxx binfilter/inc/bf_xmloff/sdxmlexp.hxx binfilter/inc/bf_xmloff/styleexp.hxx binfilter/inc/bf_xmloff/txtfldi.hxx binfilter/inc/bf_xmloff/xexptran.hxx binfilter/inc/bf_xmloff/xmlcnimp.hxx binfilter/inc/bf_xmloff/xmlcnitm.hxx binfilter/inc/bf_xmloff/xmlehelp.hxx binfilter/inc/bf_xmloff/xmlexp.hxx binfilter/inc/bf_xmloff/xmlictxt.hxx binfilter/inc/bf_xmloff/xmlimppr.hxx binfilter/inc/bf_xmloff/xmlnume.hxx binfilter/inc/bf_xmloff/xmlnumfi.hxx binfilter/inc/bf_xmloff/xmlstyle.hxx binfilter/inc/bf_xmloff/xmltoken.hxx binfilter/inc/bf_xmloff/xmluconv.hxx filter/inc/filter/msfilter/escherex.hxx filter/inc/filter/msfilter/msdffimp.hxx filter/inc/filter/msfilter/svdfppt.hxx filter/inc/filter/msfilter/svxmsbas.hxx filter/inc/registration.hxx filter/source/docbook/sofftodocbookheadings.xsl filter/source/flash/swfuno.cxx filter/source/flash/swfwriter1.cxx filter/source/graphicfilter/egif/dlgegif.cxx filter/source/graphicfilter/egif/egif.cxx filter/source/graphicfilter/egif/makefile.mk filter/source/graphicfilter/eos2met/dlgeos2.cxx filter/source/graphicfilter/eos2met/dlgeos2.hxx filter/source/graphicfilter/eos2met/eos2met.cxx filter/source/graphicfilter/eos2met/makefile.mk filter/source/graphicfilter/epbm/dlgepbm.cxx filter/source/graphicfilter/epbm/epbm.cxx filter/source/graphicfilter/epbm/makefile.mk filter/source/graphicfilter/epgm/dlgepgm.cxx filter/source/graphicfilter/epgm/dlgepgm.hxx filter/source/graphicfilter/epgm/epgm.cxx filter/source/graphicfilter/epgm/makefile.mk filter/source/graphicfilter/epict/dlgepct.cxx filter/source/graphicfilter/epict/epict.cxx filter/source/graphicfilter/epict/makefile.mk filter/source/graphicfilter/eppm/dlgeppm.cxx filter/source/graphicfilter/eppm/dlgeppm.hxx filter/source/graphicfilter/eppm/eppm.cxx filter/source/graphicfilter/eppm/makefile.mk filter/source/graphicfilter/eps/dlgeps.cxx filter/source/graphicfilter/eps/dlgeps.hxx filter/source/graphicfilter/eps/eps.cxx filter/source/graphicfilter/eps/makefile.mk filter/source/graphicfilter/eras/eras.cxx filter/source/graphicfilter/etiff/etiff.cxx filter/source/graphicfilter/expm/expm.cxx filter/source/graphicfilter/icgm/actimpr.cxx filter/source/graphicfilter/idxf/dxf2mtf.cxx filter/source/graphicfilter/idxf/dxf2mtf.hxx filter/source/graphicfilter/idxf/dxfgrprd.cxx filter/source/graphicfilter/idxf/dxfgrprd.hxx filter/source/graphicfilter/idxf/idxf.cxx filter/source/graphicfilter/ieps/ieps.cxx filter/source/graphicfilter/ios2met/ios2met.cxx filter/source/graphicfilter/ipbm/ipbm.cxx filter/source/graphicfilter/ipcd/ipcd.cxx filter/source/graphicfilter/ipcx/ipcx.cxx filter/source/graphicfilter/ipict/ipict.cxx filter/source/graphicfilter/ipict/makefile.mk filter/source/graphicfilter/ipsd/ipsd.cxx filter/source/graphicfilter/iras/iras.cxx filter/source/graphicfilter/itga/itga.cxx filter/source/graphicfilter/itiff/itiff.cxx filter/source/msfilter/escherex.cxx filter/source/msfilter/eschesdo.cxx filter/source/msfilter/eschesdo.hxx filter/source/msfilter/makefile.mk filter/source/msfilter/msdffimp.cxx filter/source/msfilter/msocximex.cxx filter/source/msfilter/msoleexp.cxx filter/source/msfilter/msvbahelper.cxx filter/source/msfilter/powerpoint/pptimporteruno.cxx filter/source/msfilter/svdfppt.cxx filter/source/msfilter/svxmsbas.cxx filter/source/pdf/pdfexport.cxx filter/source/pdf/pdfuno.cxx filter/source/placeware/uno.cxx filter/source/svg/makefile.mk filter/source/svg/svgexport.cxx filter/source/svg/svgfontexport.cxx filter/source/svg/svguno.cxx filter/source/svg/svgwriter.cxx filter/source/t602/filterenv.cxx filter/source/xmlfilteradaptor/genericfilter.cxx filter/source/xmlfilterdetect/fdcomp.cxx filter/source/xslt/odf2xhtml/export/xhtml/body.xsl filter/source/xsltdialog/xmlfileview.cxx filter/source/xsltdialog/xmlfilterdialogcomponent.cxx filter/source/xsltfilter/XSLTFilter.cxx hwpfilter/source/hwpreader.hxx oox/inc/oox/core/binarycodec.hxx oox/inc/oox/core/binaryfilterbase.hxx oox/inc/oox/core/contexthandler.hxx oox/inc/oox/core/contexthandler2.hxx oox/inc/oox/core/fasttokenhandler.hxx oox/inc/oox/core/filterbase.hxx oox/inc/oox/core/filterdetect.hxx oox/inc/oox/core/fragmenthandler.hxx oox/inc/oox/core/fragmenthandler2.hxx oox/inc/oox/core/recordparser.hxx oox/inc/oox/core/relations.hxx oox/inc/oox/core/relationshandler.hxx oox/inc/oox/core/xmlfilterbase.hxx oox/inc/oox/drawingml/chart/axiscontext.hxx oox/inc/oox/drawingml/chart/axisconverter.hxx oox/inc/oox/drawingml/chart/axismodel.hxx oox/inc/oox/drawingml/chart/chartcontextbase.hxx oox/inc/oox/drawingml/chart/chartconverter.hxx oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx oox/inc/oox/drawingml/chart/chartspaceconverter.hxx oox/inc/oox/drawingml/chart/chartspacefragment.hxx oox/inc/oox/drawingml/chart/chartspacemodel.hxx oox/inc/oox/drawingml/chart/converterbase.hxx oox/inc/oox/drawingml/chart/datasourcecontext.hxx oox/inc/oox/drawingml/chart/datasourceconverter.hxx oox/inc/oox/drawingml/chart/datasourcemodel.hxx oox/inc/oox/drawingml/chart/modelbase.hxx oox/inc/oox/drawingml/chart/objectformatter.hxx oox/inc/oox/drawingml/chart/plotareacontext.hxx oox/inc/oox/drawingml/chart/plotareaconverter.hxx oox/inc/oox/drawingml/chart/plotareamodel.hxx oox/inc/oox/drawingml/chart/seriescontext.hxx oox/inc/oox/drawingml/chart/seriesconverter.hxx oox/inc/oox/drawingml/chart/seriesmodel.hxx oox/inc/oox/drawingml/chart/titlecontext.hxx oox/inc/oox/drawingml/chart/titleconverter.hxx oox/inc/oox/drawingml/chart/titlemodel.hxx oox/inc/oox/drawingml/chart/typegroupcontext.hxx oox/inc/oox/drawingml/chart/typegroupconverter.hxx oox/inc/oox/drawingml/chart/typegroupmodel.hxx oox/inc/oox/drawingml/textbody.hxx oox/inc/oox/drawingml/textliststyle.hxx oox/inc/oox/drawingml/textparagraphproperties.hxx oox/inc/oox/helper/attributelist.hxx oox/inc/oox/helper/binaryinputstream.hxx oox/inc/oox/helper/binaryoutputstream.hxx oox/inc/oox/helper/binarystreambase.hxx oox/inc/oox/helper/containerhelper.hxx oox/inc/oox/helper/graphichelper.hxx oox/inc/oox/helper/helper.hxx oox/inc/oox/helper/modelobjecthelper.hxx oox/inc/oox/helper/progressbar.hxx oox/inc/oox/helper/propertymap.hxx oox/inc/oox/helper/propertyset.hxx oox/inc/oox/helper/textinputstream.hxx oox/inc/oox/ole/axbinaryreader.hxx oox/inc/oox/ole/axcontrolfragment.hxx oox/inc/oox/ole/olehelper.hxx oox/inc/oox/ole/oleobjecthelper.hxx oox/inc/oox/ole/vbacontrol.hxx oox/inc/oox/ole/vbainputstream.hxx oox/inc/oox/ole/vbamodule.hxx oox/inc/oox/ole/vbaproject.hxx oox/inc/oox/ole/vbaprojectfilter.hxx oox/inc/oox/token/propertynames.hxx oox/inc/oox/vml/vmldrawing.hxx oox/inc/oox/vml/vmldrawingfragment.hxx oox/inc/oox/vml/vmlformatting.hxx oox/inc/oox/vml/vmlinputstream.hxx oox/inc/oox/vml/vmlshape.hxx oox/inc/oox/vml/vmlshapecontainer.hxx oox/inc/oox/vml/vmlshapecontext.hxx oox/inc/oox/xls/addressconverter.hxx oox/inc/oox/xls/biffcodec.hxx oox/inc/oox/xls/biffdetector.hxx oox/inc/oox/xls/biffhelper.hxx oox/inc/oox/xls/biffinputstream.hxx oox/inc/oox/xls/biffoutputstream.hxx oox/inc/oox/xls/chartsheetfragment.hxx oox/inc/oox/xls/commentsbuffer.hxx oox/inc/oox/xls/commentsfragment.hxx oox/inc/oox/xls/condformatbuffer.hxx oox/inc/oox/xls/condformatcontext.hxx oox/inc/oox/xls/connectionsfragment.hxx oox/inc/oox/xls/defnamesbuffer.hxx oox/inc/oox/xls/drawingfragment.hxx oox/inc/oox/xls/excelchartconverter.hxx oox/inc/oox/xls/excelfilter.hxx oox/inc/oox/xls/excelhandlers.hxx oox/inc/oox/xls/excelvbaproject.hxx oox/inc/oox/xls/externallinkbuffer.hxx oox/inc/oox/xls/externallinkfragment.hxx oox/inc/oox/xls/formulabase.hxx oox/inc/oox/xls/formulaparser.hxx oox/inc/oox/xls/numberformatsbuffer.hxx oox/inc/oox/xls/ooxformulaparser.hxx oox/inc/oox/xls/pagesettings.hxx oox/inc/oox/xls/pivotcachebuffer.hxx oox/inc/oox/xls/pivotcachefragment.hxx oox/inc/oox/xls/pivottablebuffer.hxx oox/inc/oox/xls/pivottablefragment.hxx oox/inc/oox/xls/querytablefragment.hxx oox/inc/oox/xls/richstring.hxx oox/inc/oox/xls/richstringcontext.hxx oox/inc/oox/xls/scenariobuffer.hxx oox/inc/oox/xls/scenariocontext.hxx oox/inc/oox/xls/sharedformulabuffer.hxx oox/inc/oox/xls/sharedstringsbuffer.hxx oox/inc/oox/xls/sharedstringsfragment.hxx oox/inc/oox/xls/sheetdatacontext.hxx oox/inc/oox/xls/stylesbuffer.hxx oox/inc/oox/xls/stylesfragment.hxx oox/inc/oox/xls/tablebuffer.hxx oox/inc/oox/xls/tablefragment.hxx oox/inc/oox/xls/themebuffer.hxx oox/inc/oox/xls/unitconverter.hxx oox/inc/oox/xls/viewsettings.hxx oox/inc/oox/xls/webquerybuffer.hxx oox/inc/oox/xls/workbookfragment.hxx oox/inc/oox/xls/workbooksettings.hxx oox/inc/oox/xls/worksheetbuffer.hxx oox/inc/oox/xls/worksheetfragment.hxx oox/inc/oox/xls/worksheethelper.hxx oox/inc/oox/xls/worksheetsettings.hxx oox/prj/build.lst oox/prj/d.lst oox/source/core/binarycodec.cxx oox/source/core/binaryfilterbase.cxx oox/source/core/contexthandler.cxx oox/source/core/contexthandler2.cxx oox/source/core/facreg.cxx oox/source/core/fasttokenhandler.cxx oox/source/core/filterbase.cxx oox/source/core/filterdetect.cxx oox/source/core/fragmenthandler.cxx oox/source/core/fragmenthandler2.cxx oox/source/core/recordparser.cxx oox/source/core/relations.cxx oox/source/core/relationshandler.cxx oox/source/core/xmlfilterbase.cxx oox/source/docprop/ooxmldocpropimport.cxx oox/source/docprop/ooxmldocpropimport.hxx oox/source/drawingml/chart/axiscontext.cxx oox/source/drawingml/chart/axisconverter.cxx oox/source/drawingml/chart/axismodel.cxx oox/source/drawingml/chart/chartcontextbase.cxx oox/source/drawingml/chart/chartconverter.cxx oox/source/drawingml/chart/chartdrawingfragment.cxx oox/source/drawingml/chart/chartspaceconverter.cxx oox/source/drawingml/chart/chartspacefragment.cxx oox/source/drawingml/chart/chartspacemodel.cxx oox/source/drawingml/chart/converterbase.cxx oox/source/drawingml/chart/datasourcecontext.cxx oox/source/drawingml/chart/datasourceconverter.cxx oox/source/drawingml/chart/datasourcemodel.cxx oox/source/drawingml/chart/modelbase.cxx oox/source/drawingml/chart/objectformatter.cxx oox/source/drawingml/chart/plotareacontext.cxx oox/source/drawingml/chart/plotareaconverter.cxx oox/source/drawingml/chart/seriescontext.cxx oox/source/drawingml/chart/seriesconverter.cxx oox/source/drawingml/chart/seriesmodel.cxx oox/source/drawingml/chart/titlecontext.cxx oox/source/drawingml/chart/titleconverter.cxx oox/source/drawingml/chart/titlemodel.cxx oox/source/drawingml/chart/typegroupcontext.cxx oox/source/drawingml/chart/typegroupconverter.cxx oox/source/drawingml/chart/typegroupmodel.cxx oox/source/drawingml/shape.cxx oox/source/drawingml/shapecontext.cxx oox/source/drawingml/table/tableproperties.cxx oox/source/drawingml/textbodypropertiescontext.cxx oox/source/drawingml/textliststyle.cxx oox/source/drawingml/transform2dcontext.cxx oox/source/dump/biffdumper.cxx oox/source/dump/dffdumper.cxx oox/source/dump/dumperbase.cxx oox/source/dump/oledumper.cxx oox/source/dump/pptxdumper.cxx oox/source/dump/xlsbdumper.cxx oox/source/helper/attributelist.cxx oox/source/helper/binaryinputstream.cxx oox/source/helper/binarystreambase.cxx oox/source/helper/containerhelper.cxx oox/source/helper/graphichelper.cxx oox/source/helper/modelobjecthelper.cxx oox/source/helper/progressbar.cxx oox/source/helper/propertymap.cxx oox/source/helper/propertyset.cxx oox/source/helper/textinputstream.cxx oox/source/ole/axbinaryreader.cxx oox/source/ole/axcontrol.cxx oox/source/ole/olehelper.cxx oox/source/ole/oleobjecthelper.cxx oox/source/ole/vbacontrol.cxx oox/source/ole/vbamodule.cxx oox/source/ole/vbaproject.cxx oox/source/ole/vbaprojectfilter.cxx oox/source/ppt/customshowlistcontext.cxx oox/source/ppt/pptimport.cxx oox/source/ppt/pptshapegroupcontext.cxx oox/source/shape/FastTokenHandlerService.cxx oox/source/shape/FastTokenHandlerService.hxx oox/source/token/makefile.mk oox/source/token/namespacemap.cxx oox/source/token/properties.txt oox/source/token/propertynames.cxx oox/source/token/tokenmap.cxx oox/source/token/tokens.hxx.head oox/source/vml/vmldrawing.cxx oox/source/vml/vmldrawingfragment.cxx oox/source/vml/vmlformatting.cxx oox/source/vml/vmlinputstream.cxx oox/source/vml/vmlshape.cxx oox/source/vml/vmlshapecontainer.cxx oox/source/vml/vmlshapecontext.cxx oox/source/vml/vmltextbox.cxx oox/source/xls/addressconverter.cxx oox/source/xls/autofiltercontext.cxx oox/source/xls/biffcodec.cxx oox/source/xls/biffdetector.cxx oox/source/xls/biffhelper.cxx oox/source/xls/biffinputstream.cxx oox/source/xls/biffoutputstream.cxx oox/source/xls/chartsheetfragment.cxx oox/source/xls/commentsbuffer.cxx oox/source/xls/commentsfragment.cxx oox/source/xls/condformatbuffer.cxx oox/source/xls/condformatcontext.cxx oox/source/xls/connectionsfragment.cxx oox/source/xls/defnamesbuffer.cxx oox/source/xls/drawingfragment.cxx oox/source/xls/excelchartconverter.cxx oox/source/xls/excelfilter.cxx oox/source/xls/excelhandlers.cxx oox/source/xls/externallinkbuffer.cxx oox/source/xls/externallinkfragment.cxx oox/source/xls/formulabase.cxx oox/source/xls/formulaparser.cxx oox/source/xls/numberformatsbuffer.cxx oox/source/xls/ooxformulaparser.cxx oox/source/xls/pagesettings.cxx oox/source/xls/pivotcachebuffer.cxx oox/source/xls/pivotcachefragment.cxx oox/source/xls/pivottablebuffer.cxx oox/source/xls/pivottablefragment.cxx oox/source/xls/querytablefragment.cxx oox/source/xls/richstring.cxx oox/source/xls/richstringcontext.cxx oox/source/xls/scenariobuffer.cxx oox/source/xls/scenariocontext.cxx oox/source/xls/sharedformulabuffer.cxx oox/source/xls/sharedstringsbuffer.cxx oox/source/xls/sharedstringsfragment.cxx oox/source/xls/sheetdatacontext.cxx oox/source/xls/stylesbuffer.cxx oox/source/xls/stylesfragment.cxx oox/source/xls/tablebuffer.cxx oox/source/xls/tablefragment.cxx oox/source/xls/themebuffer.cxx oox/source/xls/unitconverter.cxx oox/source/xls/webquerybuffer.cxx oox/source/xls/workbookfragment.cxx oox/source/xls/workbookhelper.cxx oox/source/xls/workbooksettings.cxx oox/source/xls/worksheetbuffer.cxx oox/source/xls/worksheetfragment.cxx oox/source/xls/worksheethelper.cxx oox/source/xls/worksheetsettings.cxx unoxml/source/rdf/librdf_repository.cxx unoxml/source/xpath/xpathapi.hxx writerfilter/inc/resourcemodel/Fraction.hxx writerfilter/inc/resourcemodel/TagLogger.hxx writerfilter/inc/resourcemodel/XPathLogger.hxx writerfilter/source/dmapper/BorderHandler.cxx writerfilter/source/dmapper/CellColorHandler.cxx writerfilter/source/dmapper/CellColorHandler.hxx writerfilter/source/dmapper/CellMarginHandler.cxx writerfilter/source/dmapper/CellMarginHandler.hxx writerfilter/source/dmapper/DomainMapper.cxx writerfilter/source/dmapper/DomainMapperTableHandler.cxx writerfilter/source/dmapper/DomainMapper_Impl.cxx writerfilter/source/dmapper/FFDataHandler.cxx writerfilter/source/dmapper/FontTable.cxx writerfilter/source/dmapper/FontTable.hxx writerfilter/source/dmapper/GraphicImport.cxx writerfilter/source/dmapper/GraphicImport.hxx writerfilter/source/dmapper/MeasureHandler.cxx writerfilter/source/dmapper/NumberingManager.cxx writerfilter/source/dmapper/NumberingManager.hxx writerfilter/source/dmapper/OLEHandler.cxx writerfilter/source/dmapper/OLEHandler.hxx writerfilter/source/dmapper/PropertyIds.hxx writerfilter/source/dmapper/PropertyMap.cxx writerfilter/source/dmapper/PropertyMap.hxx writerfilter/source/dmapper/PropertyMapHelper.cxx writerfilter/source/dmapper/PropertyMapHelper.hxx writerfilter/source/dmapper/SectionColumnHandler.cxx writerfilter/source/dmapper/SettingsTable.cxx writerfilter/source/dmapper/StyleSheetTable.cxx writerfilter/source/dmapper/StyleSheetTable.hxx writerfilter/source/dmapper/TDefTableHandler.cxx writerfilter/source/dmapper/dmapperLoggers.hxx writerfilter/source/filter/ImportFilter.cxx writerfilter/source/filter/RtfFilter.cxx writerfilter/source/filter/RtfFilter.hxx writerfilter/source/ooxml/OOXMLFactory.cxx writerfilter/source/ooxml/OOXMLFastContextHandler.cxx writerfilter/source/ooxml/OOXMLFastContextHandler.hxx writerfilter/source/ooxml/OOXMLFastHelper.hxx writerfilter/source/ooxml/OOXMLParserState.hxx writerfilter/source/ooxml/factoryimpl_ns.xsl writerfilter/source/ooxml/model.xml writerfilter/source/resourcemodel/TagLogger.cxx writerfilter/source/resourcemodel/XPathLogger.cxx writerperfect/prj/build.lst writerperfect/source/wpdimp/wpft_genericfilter.cxx
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/oox/core/binarycodec.hxx52
-rw-r--r--oox/inc/oox/core/binaryfilterbase.hxx5
-rw-r--r--oox/inc/oox/core/contexthandler.hxx14
-rw-r--r--oox/inc/oox/core/contexthandler2.hxx146
-rwxr-xr-xoox/inc/oox/core/fastparser.hxx93
-rw-r--r--oox/inc/oox/core/fasttokenhandler.hxx15
-rw-r--r--oox/inc/oox/core/filterbase.hxx52
-rw-r--r--oox/inc/oox/core/filterdetect.hxx12
-rw-r--r--oox/inc/oox/core/fragmenthandler.hxx2
-rw-r--r--oox/inc/oox/core/fragmenthandler2.hxx15
-rw-r--r--oox/inc/oox/core/recordparser.hxx3
-rwxr-xr-x[-rw-r--r--]oox/inc/oox/core/relations.hxx15
-rw-r--r--oox/inc/oox/core/relationshandler.hxx2
-rw-r--r--oox/inc/oox/core/xmlfilterbase.hxx25
-rw-r--r--oox/inc/oox/drawingml/chart/axiscontext.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/axisconverter.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/axismodel.hxx6
-rw-r--r--oox/inc/oox/drawingml/chart/chartcontextbase.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/chartconverter.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx5
-rw-r--r--oox/inc/oox/drawingml/chart/chartspaceconverter.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/chartspacefragment.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/chartspacemodel.hxx3
-rw-r--r--oox/inc/oox/drawingml/chart/converterbase.hxx7
-rw-r--r--oox/inc/oox/drawingml/chart/datasourcecontext.hxx6
-rw-r--r--oox/inc/oox/drawingml/chart/datasourceconverter.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/datasourcemodel.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/modelbase.hxx6
-rw-r--r--oox/inc/oox/drawingml/chart/objectformatter.hxx3
-rw-r--r--oox/inc/oox/drawingml/chart/plotareacontext.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/plotareaconverter.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/plotareamodel.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/seriescontext.hxx8
-rw-r--r--oox/inc/oox/drawingml/chart/seriesconverter.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/seriesmodel.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/titlecontext.hxx4
-rw-r--r--oox/inc/oox/drawingml/chart/titleconverter.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/titlemodel.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/typegroupcontext.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/typegroupconverter.hxx2
-rw-r--r--oox/inc/oox/drawingml/chart/typegroupmodel.hxx2
-rw-r--r--oox/inc/oox/drawingml/clrscheme.hxx1
-rw-r--r--oox/inc/oox/drawingml/customshapeproperties.hxx14
-rw-r--r--oox/inc/oox/drawingml/fillproperties.hxx2
-rw-r--r--oox/inc/oox/drawingml/graphicshapecontext.hxx4
-rw-r--r--oox/inc/oox/drawingml/shape.hxx79
-rw-r--r--oox/inc/oox/drawingml/textbody.hxx1
-rw-r--r--oox/inc/oox/drawingml/textliststyle.hxx6
-rw-r--r--oox/inc/oox/drawingml/textparagraph.hxx1
-rw-r--r--oox/inc/oox/drawingml/textparagraphproperties.hxx4
-rw-r--r--oox/inc/oox/drawingml/theme.hxx1
-rw-r--r--oox/inc/oox/dump/biffdumper.hxx5
-rw-r--r--oox/inc/oox/dump/dumperbase.hxx4
-rw-r--r--oox/inc/oox/dump/oledumper.hxx12
-rw-r--r--oox/inc/oox/dump/xlsbdumper.hxx5
-rw-r--r--oox/inc/oox/helper/attributelist.hxx8
-rw-r--r--oox/inc/oox/helper/binaryinputstream.hxx2
-rw-r--r--oox/inc/oox/helper/binaryoutputstream.hxx2
-rw-r--r--oox/inc/oox/helper/binarystreambase.hxx2
-rw-r--r--oox/inc/oox/helper/containerhelper.hxx474
-rw-r--r--oox/inc/oox/helper/graphichelper.hxx9
-rw-r--r--oox/inc/oox/helper/helper.hxx2
-rw-r--r--oox/inc/oox/helper/modelobjecthelper.hxx56
-rw-r--r--oox/inc/oox/helper/progressbar.hxx2
-rw-r--r--oox/inc/oox/helper/propertymap.hxx14
-rw-r--r--oox/inc/oox/helper/propertyset.hxx7
-rwxr-xr-xoox/inc/oox/helper/refmap.hxx181
-rwxr-xr-xoox/inc/oox/helper/refvector.hxx201
-rw-r--r--oox/inc/oox/helper/storagebase.hxx4
-rw-r--r--oox/inc/oox/helper/textinputstream.hxx2
-rw-r--r--oox/inc/oox/ole/axbinaryreader.hxx7
-rw-r--r--oox/inc/oox/ole/axcontrol.hxx139
-rw-r--r--oox/inc/oox/ole/axcontrolfragment.hxx2
-rw-r--r--oox/inc/oox/ole/olehelper.hxx6
-rw-r--r--oox/inc/oox/ole/oleobjecthelper.hxx4
-rw-r--r--oox/inc/oox/ole/olestorage.hxx2
-rw-r--r--oox/inc/oox/ole/vbacontrol.hxx5
-rw-r--r--oox/inc/oox/ole/vbainputstream.hxx2
-rw-r--r--oox/inc/oox/ole/vbamodule.hxx2
-rw-r--r--oox/inc/oox/ole/vbaproject.hxx87
-rw-r--r--oox/inc/oox/ole/vbaprojectfilter.hxx11
-rw-r--r--oox/inc/oox/ppt/pptimport.hxx5
-rw-r--r--oox/inc/oox/ppt/pptshape.hxx2
-rw-r--r--oox/inc/oox/ppt/slidepersist.hxx5
-rwxr-xr-xoox/inc/oox/token/namespacemap.hxx49
-rw-r--r--oox/inc/oox/token/propertynames.hxx (renamed from oox/inc/oox/token/propertylist.hxx)16
-rw-r--r--oox/inc/oox/token/tokenmap.hxx1
-rw-r--r--oox/inc/oox/vml/vmldrawing.hxx73
-rw-r--r--oox/inc/oox/vml/vmldrawingfragment.hxx2
-rw-r--r--oox/inc/oox/vml/vmlformatting.hxx32
-rw-r--r--oox/inc/oox/vml/vmlinputstream.hxx2
-rw-r--r--oox/inc/oox/vml/vmlshape.hxx70
-rw-r--r--oox/inc/oox/vml/vmlshapecontainer.hxx8
-rw-r--r--oox/inc/oox/vml/vmlshapecontext.hxx52
-rwxr-xr-xoox/inc/oox/vml/vmltextbox.hxx95
-rwxr-xr-xoox/inc/oox/vml/vmltextboxcontext.hxx82
-rw-r--r--oox/inc/oox/xls/addressconverter.hxx16
-rwxr-xr-xoox/inc/oox/xls/autofilterbuffer.hxx279
-rw-r--r--oox/inc/oox/xls/autofiltercontext.hxx130
-rw-r--r--oox/inc/oox/xls/biffcodec.hxx23
-rw-r--r--oox/inc/oox/xls/biffdetector.hxx15
-rw-r--r--oox/inc/oox/xls/biffhelper.hxx479
-rw-r--r--oox/inc/oox/xls/biffinputstream.hxx2
-rw-r--r--oox/inc/oox/xls/biffoutputstream.hxx2
-rw-r--r--oox/inc/oox/xls/chartsheetfragment.hxx20
-rw-r--r--oox/inc/oox/xls/commentsbuffer.hxx4
-rw-r--r--oox/inc/oox/xls/commentsfragment.hxx17
-rw-r--r--oox/inc/oox/xls/condformatbuffer.hxx19
-rw-r--r--oox/inc/oox/xls/condformatcontext.hxx14
-rwxr-xr-xoox/inc/oox/xls/connectionsbuffer.hxx186
-rw-r--r--oox/inc/oox/xls/connectionsfragment.hxx38
-rw-r--r--oox/inc/oox/xls/defnamesbuffer.hxx81
-rw-r--r--oox/inc/oox/xls/drawingfragment.hxx150
-rw-r--r--oox/inc/oox/xls/excelchartconverter.hxx2
-rw-r--r--oox/inc/oox/xls/excelfilter.hxx19
-rw-r--r--oox/inc/oox/xls/excelhandlers.hxx192
-rwxr-xr-xoox/inc/oox/xls/excelvbaproject.hxx68
-rw-r--r--oox/inc/oox/xls/externallinkbuffer.hxx54
-rw-r--r--oox/inc/oox/xls/externallinkfragment.hxx77
-rw-r--r--oox/inc/oox/xls/formulabase.hxx111
-rw-r--r--oox/inc/oox/xls/formulaparser.hxx19
-rw-r--r--oox/inc/oox/xls/numberformatsbuffer.hxx5
-rw-r--r--oox/inc/oox/xls/ooxformulaparser.hxx2
-rw-r--r--oox/inc/oox/xls/pagesettings.hxx18
-rw-r--r--oox/inc/oox/xls/pivotcachebuffer.hxx56
-rw-r--r--oox/inc/oox/xls/pivotcachefragment.hxx32
-rw-r--r--oox/inc/oox/xls/pivottablebuffer.hxx50
-rw-r--r--oox/inc/oox/xls/pivottablefragment.hxx32
-rw-r--r--oox/inc/oox/xls/querytablebuffer.hxx109
-rw-r--r--oox/inc/oox/xls/querytablefragment.hxx32
-rw-r--r--oox/inc/oox/xls/richstring.hxx20
-rw-r--r--oox/inc/oox/xls/richstringcontext.hxx16
-rw-r--r--oox/inc/oox/xls/scenariobuffer.hxx11
-rw-r--r--oox/inc/oox/xls/scenariocontext.hxx18
-rw-r--r--oox/inc/oox/xls/sharedformulabuffer.hxx6
-rw-r--r--oox/inc/oox/xls/sharedstringsbuffer.hxx3
-rw-r--r--oox/inc/oox/xls/sharedstringsfragment.hxx13
-rw-r--r--oox/inc/oox/xls/sheetdatacontext.hxx77
-rw-r--r--oox/inc/oox/xls/stylesbuffer.hxx127
-rw-r--r--oox/inc/oox/xls/stylesfragment.hxx48
-rw-r--r--oox/inc/oox/xls/tablebuffer.hxx25
-rw-r--r--oox/inc/oox/xls/tablefragment.hxx17
-rw-r--r--oox/inc/oox/xls/themebuffer.hxx2
-rw-r--r--oox/inc/oox/xls/unitconverter.hxx4
-rw-r--r--oox/inc/oox/xls/viewsettings.hxx18
-rw-r--r--oox/inc/oox/xls/webquerybuffer.hxx129
-rw-r--r--oox/inc/oox/xls/workbookfragment.hxx18
-rw-r--r--oox/inc/oox/xls/workbookhelper.hxx91
-rw-r--r--oox/inc/oox/xls/workbooksettings.hxx12
-rw-r--r--oox/inc/oox/xls/worksheetbuffer.hxx15
-rw-r--r--oox/inc/oox/xls/worksheetfragment.hxx91
-rw-r--r--oox/inc/oox/xls/worksheethelper.hxx43
-rw-r--r--oox/inc/oox/xls/worksheetsettings.hxx16
-rw-r--r--oox/prj/build.lst2
-rw-r--r--oox/prj/d.lst12
-rw-r--r--oox/source/core/binarycodec.cxx114
-rw-r--r--oox/source/core/binaryfilterbase.cxx25
-rw-r--r--oox/source/core/contexthandler.cxx22
-rw-r--r--oox/source/core/contexthandler2.cxx125
-rw-r--r--oox/source/core/facreg.cxx185
-rwxr-xr-xoox/source/core/fastparser.cxx136
-rw-r--r--oox/source/core/fasttokenhandler.cxx62
-rw-r--r--oox/source/core/filterbase.cxx166
-rw-r--r--oox/source/core/filterdetect.cxx231
-rw-r--r--oox/source/core/fragmenthandler.cxx20
-rw-r--r--oox/source/core/fragmenthandler2.cxx39
-rw-r--r--oox/source/core/makefile.mk3
-rw-r--r--oox/source/core/recordparser.cxx24
-rw-r--r--oox/source/core/relations.cxx15
-rw-r--r--oox/source/core/relationshandler.cxx20
-rw-r--r--oox/source/core/services.cxx97
-rw-r--r--oox/source/core/xmlfilterbase.cxx168
-rw-r--r--oox/source/docprop/docprophandler.cxx138
-rw-r--r--oox/source/docprop/docprophandler.hxx10
-rw-r--r--oox/source/docprop/ooxmldocpropimport.cxx261
-rw-r--r--oox/source/docprop/ooxmldocpropimport.hxx41
-rw-r--r--oox/source/drawingml/chart/axiscontext.cxx15
-rw-r--r--oox/source/drawingml/chart/axisconverter.cxx131
-rw-r--r--oox/source/drawingml/chart/axismodel.cxx3
-rw-r--r--oox/source/drawingml/chart/chartcontextbase.cxx13
-rw-r--r--oox/source/drawingml/chart/chartconverter.cxx25
-rw-r--r--oox/source/drawingml/chart/chartdrawingfragment.cxx58
-rw-r--r--oox/source/drawingml/chart/chartspaceconverter.cxx25
-rw-r--r--oox/source/drawingml/chart/chartspacefragment.cxx16
-rw-r--r--oox/source/drawingml/chart/chartspacemodel.cxx5
-rw-r--r--oox/source/drawingml/chart/converterbase.cxx92
-rw-r--r--oox/source/drawingml/chart/datasourcecontext.cxx17
-rw-r--r--oox/source/drawingml/chart/datasourceconverter.cxx15
-rw-r--r--oox/source/drawingml/chart/datasourcemodel.cxx2
-rw-r--r--oox/source/drawingml/chart/modelbase.cxx9
-rw-r--r--oox/source/drawingml/chart/objectformatter.cxx43
-rw-r--r--oox/source/drawingml/chart/plotareacontext.cxx11
-rw-r--r--oox/source/drawingml/chart/plotareaconverter.cxx28
-rw-r--r--oox/source/drawingml/chart/seriescontext.cxx51
-rw-r--r--oox/source/drawingml/chart/seriesconverter.cxx28
-rw-r--r--oox/source/drawingml/chart/seriesmodel.cxx2
-rw-r--r--oox/source/drawingml/chart/titlecontext.cxx125
-rw-r--r--oox/source/drawingml/chart/titleconverter.cxx67
-rw-r--r--oox/source/drawingml/chart/titlemodel.cxx2
-rw-r--r--oox/source/drawingml/chart/typegroupcontext.cxx11
-rw-r--r--oox/source/drawingml/chart/typegroupconverter.cxx30
-rw-r--r--oox/source/drawingml/chart/typegroupmodel.cxx2
-rw-r--r--oox/source/drawingml/clrscheme.cxx2
-rw-r--r--oox/source/drawingml/clrschemecontext.cxx4
-rw-r--r--oox/source/drawingml/color.cxx8
-rw-r--r--oox/source/drawingml/colorchoicecontext.cxx1
-rw-r--r--oox/source/drawingml/connectorshapecontext.cxx4
-rw-r--r--oox/source/drawingml/customshapegeometry.cxx57
-rw-r--r--oox/source/drawingml/customshapeproperties.cxx3
-rw-r--r--oox/source/drawingml/diagram/datamodelcontext.cxx43
-rw-r--r--oox/source/drawingml/diagram/diagram.cxx2
-rw-r--r--oox/source/drawingml/diagram/diagramdefinitioncontext.cxx18
-rw-r--r--oox/source/drawingml/diagram/diagramfragmenthandler.cxx10
-rw-r--r--oox/source/drawingml/diagram/layoutnodecontext.cxx41
-rw-r--r--oox/source/drawingml/drawingmltypes.cxx2
-rw-r--r--oox/source/drawingml/embeddedwavaudiofile.cxx5
-rw-r--r--oox/source/drawingml/fillproperties.cxx24
-rw-r--r--oox/source/drawingml/fillpropertiesgroupcontext.cxx29
-rw-r--r--oox/source/drawingml/graphicshapecontext.cxx160
-rw-r--r--oox/source/drawingml/guidcontext.cxx3
-rw-r--r--oox/source/drawingml/hyperlinkcontext.cxx15
-rw-r--r--oox/source/drawingml/lineproperties.cxx5
-rw-r--r--oox/source/drawingml/linepropertiescontext.cxx4
-rw-r--r--oox/source/drawingml/objectdefaultcontext.cxx8
-rw-r--r--oox/source/drawingml/shape.cxx163
-rw-r--r--oox/source/drawingml/shapecontext.cxx4
-rw-r--r--oox/source/drawingml/shapegroupcontext.cxx6
-rw-r--r--oox/source/drawingml/shapepropertiescontext.cxx20
-rw-r--r--oox/source/drawingml/shapestylecontext.cxx12
-rw-r--r--oox/source/drawingml/spdefcontext.cxx10
-rw-r--r--oox/source/drawingml/table/tablebackgroundstylecontext.cxx11
-rw-r--r--oox/source/drawingml/table/tablecell.cxx3
-rw-r--r--oox/source/drawingml/table/tablecellcontext.cxx21
-rw-r--r--oox/source/drawingml/table/tablecontext.cxx16
-rw-r--r--oox/source/drawingml/table/tablepartstylecontext.cxx7
-rw-r--r--oox/source/drawingml/table/tableproperties.cxx2
-rw-r--r--oox/source/drawingml/table/tablerow.cxx2
-rw-r--r--oox/source/drawingml/table/tablerowcontext.cxx6
-rw-r--r--oox/source/drawingml/table/tablestylecellstylecontext.cxx33
-rw-r--r--oox/source/drawingml/table/tablestylecontext.cxx33
-rw-r--r--oox/source/drawingml/table/tablestylelistfragmenthandler.cxx4
-rw-r--r--oox/source/drawingml/table/tablestylepart.cxx2
-rw-r--r--oox/source/drawingml/table/tablestyletextstylecontext.cxx17
-rw-r--r--oox/source/drawingml/textbodycontext.cxx28
-rw-r--r--oox/source/drawingml/textbodyproperties.cxx3
-rw-r--r--oox/source/drawingml/textbodypropertiescontext.cxx19
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx5
-rw-r--r--oox/source/drawingml/textcharacterpropertiescontext.cxx52
-rw-r--r--oox/source/drawingml/textfieldcontext.cxx10
-rw-r--r--oox/source/drawingml/textfont.cxx1
-rw-r--r--oox/source/drawingml/textliststyle.cxx11
-rw-r--r--oox/source/drawingml/textliststylecontext.cxx26
-rw-r--r--oox/source/drawingml/textparagraphproperties.cxx3
-rw-r--r--oox/source/drawingml/textparagraphpropertiescontext.cxx35
-rw-r--r--oox/source/drawingml/textrun.cxx51
-rw-r--r--oox/source/drawingml/textspacingcontext.cxx9
-rw-r--r--oox/source/drawingml/texttabstoplistcontext.cxx4
-rw-r--r--oox/source/drawingml/theme.cxx1
-rw-r--r--oox/source/drawingml/themeelementscontext.cxx46
-rw-r--r--oox/source/drawingml/themefragmenthandler.cxx14
-rw-r--r--oox/source/drawingml/transform2dcontext.cxx9
-rw-r--r--oox/source/dump/biffdumper.cxx282
-rw-r--r--oox/source/dump/biffdumper.ini208
-rw-r--r--oox/source/dump/dffdumper.cxx8
-rw-r--r--oox/source/dump/dffdumper.ini1
-rw-r--r--oox/source/dump/dumperbase.cxx61
-rw-r--r--oox/source/dump/dumperbase.ini1
-rw-r--r--oox/source/dump/oledumper.cxx164
-rw-r--r--oox/source/dump/oledumper.ini1
-rw-r--r--oox/source/dump/pptxdumper.cxx24
-rw-r--r--oox/source/dump/pptxdumper.ini1
-rw-r--r--oox/source/dump/xlsbdumper.cxx441
-rw-r--r--oox/source/dump/xlsbdumper.ini123
-rw-r--r--oox/source/export/drawingml.cxx1
-rw-r--r--oox/source/export/shapes.cxx1
-rw-r--r--oox/source/helper/attributelist.cxx23
-rw-r--r--oox/source/helper/binaryinputstream.cxx19
-rw-r--r--oox/source/helper/binaryoutputstream.cxx16
-rw-r--r--oox/source/helper/binarystreambase.cxx12
-rw-r--r--oox/source/helper/containerhelper.cxx84
-rwxr-xr-x[-rw-r--r--]oox/source/helper/graphichelper.cxx71
-rw-r--r--oox/source/helper/makefile.mk1
-rw-r--r--oox/source/helper/modelobjecthelper.cxx80
-rw-r--r--oox/source/helper/progressbar.cxx12
-rw-r--r--oox/source/helper/propertymap.cxx59
-rw-r--r--oox/source/helper/propertyset.cxx29
-rw-r--r--oox/source/helper/storagebase.cxx21
-rw-r--r--oox/source/helper/textinputstream.cxx9
-rw-r--r--oox/source/helper/zipstorage.cxx30
-rw-r--r--oox/source/ole/axbinaryreader.cxx16
-rw-r--r--oox/source/ole/axcontrol.cxx243
-rw-r--r--oox/source/ole/axcontrolfragment.cxx26
-rw-r--r--oox/source/ole/olehelper.cxx26
-rw-r--r--oox/source/ole/oleobjecthelper.cxx34
-rw-r--r--oox/source/ole/olestorage.cxx38
-rw-r--r--oox/source/ole/vbacontrol.cxx19
-rw-r--r--oox/source/ole/vbahelper.cxx5
-rw-r--r--oox/source/ole/vbainputstream.cxx2
-rw-r--r--oox/source/ole/vbamodule.cxx7
-rw-r--r--oox/source/ole/vbaproject.cxx119
-rw-r--r--oox/source/ole/vbaprojectfilter.cxx33
-rw-r--r--oox/source/ppt/animationspersist.cxx4
-rw-r--r--oox/source/ppt/animationtypes.cxx2
-rw-r--r--oox/source/ppt/animvariantcontext.cxx12
-rw-r--r--oox/source/ppt/backgroundproperties.cxx4
-rw-r--r--oox/source/ppt/buildlistcontext.cxx15
-rw-r--r--oox/source/ppt/commonbehaviorcontext.cxx18
-rw-r--r--oox/source/ppt/commontimenodecontext.cxx20
-rw-r--r--oox/source/ppt/conditioncontext.cxx12
-rw-r--r--oox/source/ppt/customshowlistcontext.cxx9
-rw-r--r--oox/source/ppt/headerfootercontext.cxx2
-rw-r--r--oox/source/ppt/layoutfragmenthandler.cxx6
-rw-r--r--oox/source/ppt/pptimport.cxx32
-rw-r--r--oox/source/ppt/pptshape.cxx4
-rw-r--r--oox/source/ppt/pptshapecontext.cxx15
-rw-r--r--oox/source/ppt/pptshapegroupcontext.cxx22
-rw-r--r--oox/source/ppt/pptshapepropertiescontext.cxx5
-rw-r--r--oox/source/ppt/presentationfragmenthandler.cxx38
-rw-r--r--oox/source/ppt/slidefragmenthandler.cxx52
-rw-r--r--oox/source/ppt/slidemastertextstylescontext.cxx10
-rw-r--r--oox/source/ppt/slidepersist.cxx11
-rw-r--r--oox/source/ppt/slidetimingcontext.cxx8
-rw-r--r--oox/source/ppt/slidetransition.cxx45
-rw-r--r--oox/source/ppt/slidetransitioncontext.cxx49
-rw-r--r--oox/source/ppt/soundactioncontext.cxx11
-rw-r--r--oox/source/ppt/timeanimvaluecontext.cxx10
-rw-r--r--oox/source/ppt/timenode.cxx2
-rw-r--r--oox/source/ppt/timenodelistcontext.cxx122
-rw-r--r--oox/source/ppt/timetargetelementcontext.cxx28
-rw-r--r--oox/source/shape/FastTokenHandlerService.cxx119
-rw-r--r--oox/source/shape/FastTokenHandlerService.hxx84
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx73
-rw-r--r--oox/source/shape/ShapeContextHandler.hxx22
-rw-r--r--oox/source/shape/ShapeFilterBase.cxx14
-rw-r--r--oox/source/shape/ShapeFilterBase.hxx8
-rw-r--r--oox/source/shape/makefile.mk3
-rw-r--r--oox/source/token/gennamespaces.pl66
-rw-r--r--oox/source/token/genproperties.pl46
-rw-r--r--oox/source/token/gentoken.pl61
-rw-r--r--oox/source/token/makefile.mk44
-rwxr-xr-x[-rw-r--r--]oox/source/token/namespacemap.cxx (renamed from oox/source/token/propertylist.cxx)30
-rwxr-xr-xoox/source/token/namespaces.hxx.head36
-rwxr-xr-xoox/source/token/namespaces.hxx.tail35
-rw-r--r--oox/source/token/namespaces.pl79
-rw-r--r--oox/source/token/namespaces.txt101
-rw-r--r--oox/source/token/parsexsd.pl27
-rwxr-xr-xoox/source/token/properties.hxx.head36
-rwxr-xr-xoox/source/token/properties.hxx.tail6
-rw-r--r--oox/source/token/properties.pl67
-rw-r--r--oox/source/token/properties.txt24
-rw-r--r--oox/source/token/propertynames.cxx (renamed from oox/inc/oox/helper/recordinputstream.hxx)36
-rw-r--r--oox/source/token/tokenmap.cxx45
-rwxr-xr-xoox/source/token/tokens.hxx.head36
-rwxr-xr-xoox/source/token/tokens.hxx.tail8
-rw-r--r--oox/source/token/tokens.pl80
-rw-r--r--oox/source/token/tokens.txt15
-rw-r--r--oox/source/vml/makefile.mk16
-rw-r--r--oox/source/vml/vmldrawing.cxx145
-rw-r--r--oox/source/vml/vmldrawingfragment.cxx24
-rw-r--r--oox/source/vml/vmlformatting.cxx113
-rw-r--r--oox/source/vml/vmlinputstream.cxx66
-rw-r--r--oox/source/vml/vmlshape.cxx229
-rw-r--r--oox/source/vml/vmlshapecontainer.cxx16
-rw-r--r--oox/source/vml/vmlshapecontext.cxx148
-rwxr-xr-x[-rw-r--r--]oox/source/vml/vmltextbox.cxx (renamed from oox/source/helper/recordinputstream.cxx)69
-rwxr-xr-xoox/source/vml/vmltextboxcontext.cxx146
-rw-r--r--oox/source/xls/addressconverter.cxx42
-rwxr-xr-xoox/source/xls/autofilterbuffer.cxx853
-rw-r--r--oox/source/xls/autofiltercontext.cxx735
-rw-r--r--oox/source/xls/biffcodec.cxx104
-rw-r--r--oox/source/xls/biffdetector.cxx89
-rw-r--r--oox/source/xls/biffhelper.cxx60
-rw-r--r--oox/source/xls/biffinputstream.cxx11
-rw-r--r--oox/source/xls/biffoutputstream.cxx2
-rw-r--r--oox/source/xls/chartsheetfragment.cxx164
-rw-r--r--oox/source/xls/commentsbuffer.cxx35
-rw-r--r--oox/source/xls/commentsfragment.cxx92
-rw-r--r--oox/source/xls/condformatbuffer.cxx283
-rw-r--r--oox/source/xls/condformatcontext.cxx42
-rwxr-xr-xoox/source/xls/connectionsbuffer.cxx501
-rw-r--r--oox/source/xls/connectionsfragment.cxx143
-rw-r--r--oox/source/xls/defnamesbuffer.cxx245
-rw-r--r--oox/source/xls/drawingfragment.cxx618
-rw-r--r--oox/source/xls/excelchartconverter.cxx28
-rw-r--r--oox/source/xls/excelfilter.cxx120
-rw-r--r--oox/source/xls/excelhandlers.cxx175
-rwxr-xr-xoox/source/xls/excelvbaproject.cxx147
-rw-r--r--oox/source/xls/externallinkbuffer.cxx187
-rw-r--r--oox/source/xls/externallinkfragment.cxx358
-rwxr-xr-x[-rw-r--r--]oox/source/xls/formulabase.cxx108
-rw-r--r--oox/source/xls/formulaparser.cxx407
-rw-r--r--oox/source/xls/makefile.mk7
-rw-r--r--oox/source/xls/numberformatsbuffer.cxx48
-rw-r--r--oox/source/xls/ooxformulaparser.cxx31
-rw-r--r--oox/source/xls/pagesettings.cxx162
-rw-r--r--oox/source/xls/pivotcachebuffer.cxx340
-rw-r--r--oox/source/xls/pivotcachefragment.cxx190
-rw-r--r--oox/source/xls/pivottablebuffer.cxx415
-rw-r--r--oox/source/xls/pivottablefragment.cxx191
-rw-r--r--oox/source/xls/querytablebuffer.cxx390
-rw-r--r--oox/source/xls/querytablefragment.cxx69
-rw-r--r--oox/source/xls/richstring.cxx56
-rw-r--r--oox/source/xls/richstringcontext.cxx51
-rw-r--r--oox/source/xls/scenariobuffer.cxx36
-rw-r--r--oox/source/xls/scenariocontext.cxx43
-rw-r--r--oox/source/xls/sharedformulabuffer.cxx28
-rw-r--r--oox/source/xls/sharedstringsbuffer.cxx11
-rw-r--r--oox/source/xls/sharedstringsfragment.cxx41
-rw-r--r--oox/source/xls/sheetdatacontext.cxx461
-rw-r--r--oox/source/xls/stylesbuffer.cxx461
-rw-r--r--oox/source/xls/stylesfragment.cxx159
-rw-r--r--oox/source/xls/tablebuffer.cxx82
-rw-r--r--oox/source/xls/tablefragment.cxx57
-rw-r--r--oox/source/xls/themebuffer.cxx12
-rw-r--r--oox/source/xls/unitconverter.cxx28
-rw-r--r--oox/source/xls/viewsettings.cxx223
-rw-r--r--oox/source/xls/webquerybuffer.cxx201
-rw-r--r--oox/source/xls/workbookfragment.cxx336
-rw-r--r--oox/source/xls/workbookhelper.cxx236
-rw-r--r--oox/source/xls/workbooksettings.cxx81
-rw-r--r--oox/source/xls/worksheetbuffer.cxx34
-rw-r--r--oox/source/xls/worksheetfragment.cxx693
-rw-r--r--oox/source/xls/worksheethelper.cxx326
-rw-r--r--oox/source/xls/worksheetsettings.cxx67
-rw-r--r--oox/util/makefile.mk8
-rw-r--r--oox/util/oox.component67
426 files changed, 15113 insertions, 10632 deletions
diff --git a/oox/inc/oox/core/binarycodec.hxx b/oox/inc/oox/core/binarycodec.hxx
index f60dca65eb1d..f7dccbb3b43e 100644
--- a/oox/inc/oox/core/binarycodec.hxx
+++ b/oox/inc/oox/core/binarycodec.hxx
@@ -29,6 +29,9 @@
#ifndef OOX_CORE_BINARYCODEC_HXX
#define OOX_CORE_BINARYCODEC_HXX
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
+
#include <rtl/cipher.h>
#include <rtl/digest.h>
@@ -86,6 +89,22 @@ public:
*/
void initKey( const sal_uInt8 pnPassData[ 16 ] );
+ /** Initializes the algorithm with the encryption data.
+
+ @param aData
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ bool initCodec( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aData );
+
+ /** Retrieves the encryption data
+
+ @return
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > getEncryptionData();
+
/** Verifies the validity of the password using the passed key and hash.
@precond
@@ -151,16 +170,6 @@ public:
*/
bool skip( sal_Int32 nBytes );
- // static -----------------------------------------------------------------
-
- /** Calculates the 16-bit hash value for the given password.
-
- The password data may be longer than 16 bytes. The array does not need
- to be terminated with a null byte (but it can without invalidating the
- result).
- */
- static sal_uInt16 getHash( const sal_uInt8* pnPassData, sal_Int32 nSize );
-
private:
CodecType meCodecType; /// Codec type.
sal_uInt8 mpnKey[ 16 ]; /// Encryption key.
@@ -190,6 +199,22 @@ public:
~BinaryCodec_RCF();
+ /** Initializes the algorithm with the encryption data.
+
+ @param aData
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ bool initCodec( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aData );
+
+ /** Retrieves the encryption data
+
+ @return
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > getEncryptionData();
+
/** Initializes the algorithm with the specified password and document ID.
@param pnPassData
@@ -279,9 +304,14 @@ public:
bool skip( sal_Int32 nBytes );
private:
+ void InitKeyImpl(
+ const sal_uInt8 pKeyData[64],
+ const sal_uInt8 pUnique[16] );
+
rtlCipher mhCipher;
rtlDigest mhDigest;
sal_uInt8 mpnDigestValue[ RTL_DIGEST_LENGTH_MD5 ];
+ sal_uInt8 mpnUnique[16];
};
// ============================================================================
@@ -291,4 +321,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/core/binaryfilterbase.hxx b/oox/inc/oox/core/binaryfilterbase.hxx
index f1e1bf877996..d347ac755f63 100644
--- a/oox/inc/oox/core/binaryfilterbase.hxx
+++ b/oox/inc/oox/core/binaryfilterbase.hxx
@@ -41,7 +41,8 @@ class BinaryFilterBase : public FilterBase
{
public:
explicit BinaryFilterBase(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~BinaryFilterBase();
@@ -61,4 +62,4 @@ typedef ::rtl::Reference< BinaryFilterBase > BinaryFilterRef;
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/core/contexthandler.hxx b/oox/inc/oox/core/contexthandler.hxx
index 3fb3766b4ef2..9bad2003c12c 100644
--- a/oox/inc/oox/core/contexthandler.hxx
+++ b/oox/inc/oox/core/contexthandler.hxx
@@ -29,16 +29,18 @@
#ifndef OOX_CORE_CONTEXTHANDLER_HXX
#define OOX_CORE_CONTEXTHANDLER_HXX
+#include <com/sun/star/xml/sax/XFastContextHandler.hpp>
#include <boost/shared_ptr.hpp>
-#include <rtl/ref.hxx>
#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/xml/sax/XFastContextHandler.hpp>
+#include <rtl/ref.hxx>
+#include "oox/token/namespaces.hxx"
+#include "oox/token/tokens.hxx"
namespace com { namespace sun { namespace star {
namespace xml { namespace sax { class XLocator; } }
} } }
-namespace oox { class RecordInputStream; }
+namespace oox { class SequenceInputStream; }
namespace oox {
namespace core {
@@ -92,8 +94,8 @@ public:
// record context interface -----------------------------------------------
- virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void startRecord( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual void endRecord( sal_Int32 nRecId );
protected:
@@ -116,4 +118,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/core/contexthandler2.hxx b/oox/inc/oox/core/contexthandler2.hxx
index 3f6db7c813c3..303693914920 100644
--- a/oox/inc/oox/core/contexthandler2.hxx
+++ b/oox/inc/oox/core/contexthandler2.hxx
@@ -31,39 +31,43 @@
#include <vector>
#include <boost/shared_ptr.hpp>
-#include "tokens.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/helper/recordinputstream.hxx"
+#include "oox/helper/binaryinputstream.hxx"
#include "oox/core/contexthandler.hxx"
-#include "oox/core/namespaces.hxx"
namespace oox {
namespace core {
// ============================================================================
-struct ContextInfo;
+const sal_Int32 XML_ROOT_CONTEXT = SAL_MAX_INT32;
-/** Helper class that provides a context identifier stack.
+// ============================================================================
+
+struct ElementInfo;
+
+/** Helper class that provides a context stack.
Fragment handlers and context handlers derived from this helper class will
- track the identifiers of the current context in a stack. The idea is to use
- the same instance of a fragment handler or context handler to process
+ track the identifiers of the visited elements in a stack. The idea is to
+ use the same instance of a fragment handler or context handler to process
several nested elements in an XML stream. For that, the abstract function
- onCreateContext() has to return 'true' for the passed element.
+ onCreateContext() has to return 'this' for the passed element.
Derived classes have to implement the createFastChildContext(),
startFastElement(), characters(), and endFastElement() functions from the
com.sun.star.xml.sax.XFastContextHandler interface by simply forwarding
- them to the respective implCreateChildContext(), implStartCurrentContext(),
- implCharacters(), and implEndCurrentContext() functions of this helper. The
- new abstract functions have to be implemented according to the elements to
- be processed.
+ them to the respective implCreateChildContext(), implStartElement(),
+ implCharacters(), and implEndElement() functions of this helper. This is
+ implemented already in the classes ContextHandler2 and FragmentHandler2.
+ The new abstract functions have to be implemented according to the elements
+ to be processed.
Similarly, for binary import, derived classes have to forward the
createRecordContext(), startRecord(), and endRecord() functions from the
ContextHandler class to the implCreateRecordContext(), implStartRecord(),
- and implEndRecord() functions of this helper.
+ and implEndRecord() functions of this helper. Again, this is implemented
+ already in the classes ContextHandler2 and FragmentHandler2.
*/
class ContextHandler2Helper
{
@@ -72,78 +76,97 @@ public:
explicit ContextHandler2Helper( const ContextHandler2Helper& rParent );
virtual ~ContextHandler2Helper();
+ // allow instances to be stored in ::rtl::Reference
virtual void SAL_CALL acquire() throw() = 0;
virtual void SAL_CALL release() throw() = 0;
- virtual ContextHandler& queryContextHandler() = 0;
-
// interface --------------------------------------------------------------
- /** Will be called if a new context can be created for the passed element.
+ /** Will be called to create a context handler for the passed element.
- Usually 'true' should be returned to improve performance by reusing the
+ Usually 'this' can be returned to improve performance by reusing the
same instance to process several elements. Used by OOXML import only.
*/
virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) = 0;
- /** Will be called if a new context element has been started.
+ /** Will be called when a new element has been started.
+
+ This function is called at the context handler returned from
+ onCreateContext(), or, for root elements of an XML stream, at the
+ fragment handler itself.
- The current element identifier can be accessed by using
- getCurrentContext() or isCurrentContext(). Used by OOXML import only.
+ The current element identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by OOXML import only.
*/
virtual void onStartElement( const AttributeList& rAttribs ) = 0;
- /** Will be called if the current context element is about to be left.
+ /** Will be called before a new child element starts, or if the current
+ element is about to be left.
- The current element identifier can be accessed by using
- getCurrentContext() or isCurrentContext(). Used by OOXML import only.
+ This helper function collects all text fragments received by the
+ characters() function (such as encoded characters which are passed in
+ separate calls to the characters() function), and passes the
+ concatenated and trimmed string.
- @param rChars The characters collected in this element.
+ The current element identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by OOXML import only.
*/
- virtual void onEndElement( const ::rtl::OUString& rChars ) = 0;
+ virtual void onCharacters( const ::rtl::OUString& rChars ) = 0;
- /** Will be called if a new context can be created for the passed element.
+ /** Will be called when the current element is about to be left.
- Usually 'true' should be returned to improve performance by reusing the
- same instance to process several elements. Used by OOBIN import only.
+ The current element identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by OOXML import only.
*/
- virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm ) = 0;
+ virtual void onEndElement() = 0;
- /** Will be called if a new record in a binary stream has been started.
+ /** Will be called to create a context handler for the passed record.
- The current record identifier can be accessed by using
- getCurrentContext() or isCurrentContext(). Used by OOBIN import only.
+ Usually 'this' can be returned to improve performance by reusing the
+ same instance to process several records. Used by BIFF import only.
*/
- virtual void onStartRecord( RecordInputStream& rStrm ) = 0;
+ virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) = 0;
- /** Will be called if the current context record is about to be left.
+ /** Will be called when a new record block in a binary stream has been
+ started.
- The current record identifier can be accessed by using
- getCurrentContext() or isCurrentContext(). Used by OOBIN import only.
+ The current record identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by BIFF import only.
+ */
+ virtual void onStartRecord( SequenceInputStream& rStrm ) = 0;
+
+ /** Will be called when the current record block is about to be left.
+
+ The current record identifier can be accessed with getCurrentElement()
+ or isCurrentElement(). Used by BIFF import only.
*/
virtual void onEndRecord() = 0;
// helpers ----------------------------------------------------------------
- /** Returns the element identifier of the current topmost context. */
+ /** Returns the identifier of the currently processed element. */
sal_Int32 getCurrentElement() const;
- /** Returns true, if nElement contains the current topmost context. */
+ /** Returns true, if nElement contains the identifier of the currently
+ processed element. */
inline bool isCurrentElement( sal_Int32 nElement ) const
{ return getCurrentElement() == nElement; }
- /** Returns true, if either nElement1 or nElement2 contain the current topmost context. */
+ /** Returns true, if either nElement1 or nElement2 contain the identifier
+ of the currently processed element. */
inline bool isCurrentElement( sal_Int32 nElement1, sal_Int32 nElement2 ) const
{ return isCurrentElement( nElement1 ) || isCurrentElement( nElement2 ); }
- /** Returns the element identifier of the specified parent context. */
- sal_Int32 getPreviousElement( sal_Int32 nCountBack = 1 ) const;
+ /** Returns the identifier of the specified parent element. */
+ sal_Int32 getParentElement( sal_Int32 nCountBack = 1 ) const;
- /** Returns the element identifier of the specified parent context. */
- inline sal_Int32 isPreviousElement( sal_Int32 nElement, sal_Int32 nCountBack = 1 ) const
- { return getPreviousElement( nCountBack ) == nElement; }
+ /** Returns true, if nElement contains the identifier of the specified
+ parent element. */
+ inline sal_Int32 isParentElement( sal_Int32 nElement, sal_Int32 nCountBack = 1 ) const
+ { return getParentElement( nCountBack ) == nElement; }
- /** Returns true, if the current element is the root element. */
+ /** Returns true, if the element currently processed is the root element of
+ the context or fragment handler. */
bool isRootElement() const;
// implementation ---------------------------------------------------------
@@ -156,7 +179,7 @@ protected:
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs );
/** Must be called from startFastElement() in derived classes. */
- void implStartCurrentContext(
+ void implStartElement(
sal_Int32 nElement,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs );
@@ -164,13 +187,13 @@ protected:
void implCharacters( const ::rtl::OUString& rChars );
/** Must be called from endFastElement() in derived classes. */
- void implEndCurrentContext( sal_Int32 nElement );
+ void implEndElement( sal_Int32 nElement );
/** Must be called from createRecordContext() in derived classes. */
- ContextHandlerRef implCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ ContextHandlerRef implCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
/** Must be called from startRecord() in derived classes. */
- void implStartRecord( sal_Int32 nRecId, RecordInputStream& rStrm );
+ void implStartRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
/** Must be called from endRecord() in derived classes. */
void implEndRecord( sal_Int32 nRecId );
@@ -178,15 +201,15 @@ protected:
private:
ContextHandler2Helper& operator=( const ContextHandler2Helper& );
- ContextInfo& pushContextInfo( sal_Int32 nElement );
- void popContextInfo();
- void appendCollectedChars();
+ ElementInfo& pushElementInfo( sal_Int32 nElement );
+ void popElementInfo();
+ void processCollectedChars();
private:
- typedef ::std::vector< ContextInfo > ContextStack;
+ typedef ::std::vector< ElementInfo > ContextStack;
typedef ::boost::shared_ptr< ContextStack > ContextStackRef;
- ContextStackRef mxContextStack; /// Stack of processed contexts.
+ ContextStackRef mxContextStack; /// Stack of all processed elements.
size_t mnRootStackSize; /// Stack size on construction time.
bool mbEnableTrimSpace; /// True = trim whitespace in characters().
};
@@ -203,8 +226,6 @@ public:
virtual void SAL_CALL acquire() throw() { ContextHandler::acquire(); }
virtual void SAL_CALL release() throw() { ContextHandler::release(); }
- virtual ContextHandler& queryContextHandler();
-
// com.sun.star.xml.sax.XFastContextHandler interface ---------------------
virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
@@ -230,18 +251,19 @@ public:
// oox.core.ContextHandler interface --------------------------------------
- virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void startRecord( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual void endRecord( sal_Int32 nRecId );
// oox.core.ContextHandler2Helper interface -------------------------------
virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
- virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
virtual void onEndRecord();
};
@@ -252,4 +274,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/core/fastparser.hxx b/oox/inc/oox/core/fastparser.hxx
new file mode 100755
index 000000000000..967c42474dcc
--- /dev/null
+++ b/oox/inc/oox/core/fastparser.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_CORE_FASTPARSER_HXX
+#define OOX_CORE_FASTPARSER_HXX
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/xml/sax/XFastParser.hpp>
+
+namespace oox {
+ struct NamespaceMap;
+ class StorageBase;
+}
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+/** Wrapper for a fast SAX parser that works on automatically generated OOXML
+ token and namespace identifiers.
+ */
+class FastParser
+{
+public:
+ explicit FastParser(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ virtual ~FastParser();
+
+ /** Registers an OOXML namespace at the parser. */
+ void registerNamespace( sal_Int32 nNamespaceId )
+ throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
+
+ /** Sets the passed document handler that will receive the SAX parser events. */
+ void setDocumentHandler(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastDocumentHandler >& rxDocHandler )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ /** Parses the passed SAX input source.
+ @param bCloseStream True = closes the stream in the input source after parsing. */
+ void parseStream( const ::com::sun::star::xml::sax::InputSource& rInputSource, bool bCloseStream = false )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException );
+
+ /** Parses the passed input stream.
+ @param bCloseStream True = closes the passed stream after parsing. */
+ void parseStream(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream,
+ const ::rtl::OUString& rStreamName, bool bCloseStream = false )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException );
+
+ /** Parses a stream from the passed storage with the specified name.
+ @param bCloseStream True = closes the stream after parsing. */
+ void parseStream( StorageBase& rStorage, const ::rtl::OUString& rStreamName, bool bCloseStream = false )
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastParser >
+ mxParser;
+ const NamespaceMap& mrNamespaceMap;
+};
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/core/fasttokenhandler.hxx b/oox/inc/oox/core/fasttokenhandler.hxx
index 31035b1daba5..e3bdee6b728d 100644
--- a/oox/inc/oox/core/fasttokenhandler.hxx
+++ b/oox/inc/oox/core/fasttokenhandler.hxx
@@ -29,8 +29,9 @@
#ifndef OOX_CORE_FASTTOKENHANDLER_HXX
#define OOX_CORE_FASTTOKENHANDLER_HXX
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
-#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
namespace oox { class TokenMap; }
@@ -39,15 +40,23 @@ namespace core {
// ============================================================================
+typedef ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::xml::sax::XFastTokenHandler > FastTokenHandlerBase;
+
/** Wrapper implementing the com.sun.star.xml.sax.XFastTokenHandler API interface
that provides access to the tokens generated from the internal token name list.
*/
-class FastTokenHandler : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastTokenHandler >
+class FastTokenHandler : public FastTokenHandlerBase
{
public:
explicit FastTokenHandler();
virtual ~FastTokenHandler();
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
+
+ // XFastTokenHandler
virtual sal_Int32 SAL_CALL getToken( const ::rtl::OUString& rIdentifier ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getIdentifier( sal_Int32 nToken ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getUTF8Identifier( sal_Int32 nToken ) throw (::com::sun::star::uno::RuntimeException);
@@ -64,4 +73,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/core/filterbase.hxx b/oox/inc/oox/core/filterbase.hxx
index 0e4b0f2e4b4e..e2eea2587391 100644
--- a/oox/inc/oox/core/filterbase.hxx
+++ b/oox/inc/oox/core/filterbase.hxx
@@ -30,14 +30,15 @@
#define OOX_CORE_FILTERBASE_HXX
#include <memory>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/document/XImporter.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase5.hxx>
#include "oox/helper/binarystreambase.hxx"
@@ -45,16 +46,18 @@
#include "oox/dllapi.h"
namespace com { namespace sun { namespace star {
- namespace lang { class XMultiServiceFactory; }
namespace awt { struct DeviceInfo; }
- namespace frame { class XModel; }
- namespace task { class XStatusIndicator; }
- namespace task { class XInteractionHandler; }
namespace frame { class XFrame; }
+ namespace frame { class XModel; }
+ namespace graphic { class XGraphic; }
namespace io { class XInputStream; }
namespace io { class XOutputStream; }
namespace io { class XStream; }
- namespace graphic { class XGraphic; }
+ namespace lang { class XMultiComponentFactory; }
+ namespace lang { class XMultiServiceFactory; }
+ namespace task { class XInteractionHandler; }
+ namespace task { class XStatusIndicator; }
+ namespace uno { class XComponentContext; }
} } }
namespace comphelper {
@@ -69,6 +72,7 @@ namespace oox {
namespace oox { namespace ole {
class OleObjectHelper;
+ class VbaProject;
} }
namespace oox {
@@ -96,7 +100,8 @@ class OOX_DLLPUBLIC FilterBase : public FilterBaseBase, public ::cppu::BaseMutex
{
public:
explicit FilterBase(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~FilterBase();
@@ -118,9 +123,17 @@ public:
/** Returns the specified argument passed through the XInitialization interface. */
::com::sun::star::uno::Any getArgument( const ::rtl::OUString& rArgName ) const;
- /** Returns the global service factory passed in the filter constructor (always existing). */
+ /** Returns the component context passed in the filter constructor (always existing). */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&
+ getComponentContext() const;
+
+ /** Returns the component service factory (always existing). */
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory >&
+ getComponentFactory() const;
+
+ /** Returns the multi service factory of the component (always existing). */
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
- getGlobalFactory() const;
+ getServiceFactory() const;
/** Returns the document model (always existing). */
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >&
@@ -130,7 +143,7 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
getModelFactory() const;
- /** Returns the frame that will contain the document model. */
+ /** Returns the frame that will contain the document model (may be null). */
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&
getTargetFrame() const;
@@ -203,9 +216,13 @@ public:
/** Returns a helper for the handling of OLE obejcts. */
::oox::ole::OleObjectHelper& getOleObjectHelper() const;
- /** Requests a password from the media descriptor or from the user. On
- success, the password will be inserted into the media descriptor. */
- ::rtl::OUString requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier ) const;
+ /** Returns the VBA project manager. */
+ ::oox::ole::VbaProject& getVbaProject() const;
+
+ /** Requests the encryption data from the media descriptor or from the user. On
+ success, the encryption data will be inserted into the media descriptor. */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >
+ requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const;
/** Imports the raw binary data from the specified stream.
@return True, if the data could be imported from the stream. */
@@ -280,6 +297,9 @@ private:
resolving palette colors. */
virtual GraphicHelper* implCreateGraphicHelper() const;
+ /** Derived classes create a VBA project manager object. */
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const = 0;
+
virtual ::rtl::OUString implGetImplementationName() const = 0;
virtual StorageRef implCreateStorage(
@@ -298,4 +318,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/core/filterdetect.hxx b/oox/inc/oox/core/filterdetect.hxx
index 5944766195d8..f28af86eea37 100644
--- a/oox/inc/oox/core/filterdetect.hxx
+++ b/oox/inc/oox/core/filterdetect.hxx
@@ -39,6 +39,7 @@
namespace com { namespace sun { namespace star {
namespace io { class XInputStream; }
+ namespace uno { class XComponentContext; }
} } }
namespace comphelper { class MediaDescriptor; }
@@ -97,7 +98,8 @@ private:
class OOX_DLLPUBLIC FilterDetect : public ::cppu::WeakImplHelper2< ::com::sun::star::document::XExtendedFilterDetection, ::com::sun::star::lang::XServiceInfo >
{
public:
- explicit FilterDetect( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory );
+ explicit FilterDetect( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~FilterDetect();
/** Tries to extract an unencrypted ZIP package from the passed media
@@ -150,12 +152,12 @@ public:
interface of the temporary file will be stored in the 'ComponentData'
property of the passed media descriptor.
*/
- virtual ::rtl::OUString SAL_CALL detect(
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rMediaDescSeq )
+ virtual ::rtl::OUString SAL_CALL
+ detect( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rMediaDescSeq )
throw( ::com::sun::star::uno::RuntimeException );
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
};
// ============================================================================
@@ -165,4 +167,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/core/fragmenthandler.hxx b/oox/inc/oox/core/fragmenthandler.hxx
index 5f8dc3463e68..4cadfce9c121 100644
--- a/oox/inc/oox/core/fragmenthandler.hxx
+++ b/oox/inc/oox/core/fragmenthandler.hxx
@@ -136,4 +136,4 @@ typedef ::rtl::Reference< FragmentHandler > FragmentHandlerRef;
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/core/fragmenthandler2.hxx b/oox/inc/oox/core/fragmenthandler2.hxx
index fcfea7c3070f..7408fbd12e2e 100644
--- a/oox/inc/oox/core/fragmenthandler2.hxx
+++ b/oox/inc/oox/core/fragmenthandler2.hxx
@@ -50,8 +50,6 @@ public:
virtual void SAL_CALL acquire() throw() { FragmentHandler::acquire(); }
virtual void SAL_CALL release() throw() { FragmentHandler::release(); }
- virtual ContextHandler& queryContextHandler();
-
// com.sun.star.xml.sax.XFastContextHandler interface ---------------------
virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
@@ -87,18 +85,19 @@ public:
// oox.core.ContextHandler interface --------------------------------------
- virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void startRecord( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ContextHandlerRef createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual void endRecord( sal_Int32 nRecId );
// oox.core.ContextHandler2Helper interface -------------------------------
virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
- virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
virtual void onEndRecord();
// oox.core.FragmentHandler2 interface ------------------------------------
@@ -114,4 +113,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/core/recordparser.hxx b/oox/inc/oox/core/recordparser.hxx
index f1812e3169c9..90ac5f3b487c 100644
--- a/oox/inc/oox/core/recordparser.hxx
+++ b/oox/inc/oox/core/recordparser.hxx
@@ -30,7 +30,6 @@
#define OOX_CORE_RECORDPARSER_HXX
#include <map>
-#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/io/IOException.hpp>
#include <com/sun/star/xml/sax/SAXException.hpp>
#include <rtl/ref.hxx>
@@ -97,4 +96,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/core/relations.hxx b/oox/inc/oox/core/relations.hxx
index 1317de745382..1b5432426f5d 100644..100755
--- a/oox/inc/oox/core/relations.hxx
+++ b/oox/inc/oox/core/relations.hxx
@@ -36,14 +36,21 @@
namespace oox {
namespace core {
-/** Expands to an OUString containing an officeDocument relation type created
+// ============================================================================
+
+/** Expands to an OUString containing an 'officeDocument' relation type created
from the passed literal(!) ASCII(!) character array. */
-#define CREATE_OFFICEDOC_RELATIONSTYPE( ascii ) \
+#define CREATE_OFFICEDOC_RELATION_TYPE( ascii ) \
CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/" ascii )
+/** Expands to an OUString containing a 'package' relation type created from
+ the passed literal(!) ASCII(!) character array. */
+#define CREATE_PACKAGE_RELATION_TYPE( ascii ) \
+ CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships/" ascii )
+
/** Expands to an OUString containing an MS Office specific relation type
created from the passed literal(!) ASCII(!) character array. */
-#define CREATE_MSOFFICE_RELATIONSTYPE( ascii ) \
+#define CREATE_MSOFFICE_RELATION_TYPE( ascii ) \
CREATE_OUSTRING( "http://schemas.microsoft.com/office/2006/relationships/" ascii )
// ============================================================================
@@ -101,4 +108,4 @@ private:
#endif // OOX_CORE_RELATIONS
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/core/relationshandler.hxx b/oox/inc/oox/core/relationshandler.hxx
index e42bb4639a83..06e237460b43 100644
--- a/oox/inc/oox/core/relationshandler.hxx
+++ b/oox/inc/oox/core/relationshandler.hxx
@@ -60,4 +60,4 @@ private:
#endif // OOX_CORE_RELATIONSHANDLER
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/core/xmlfilterbase.hxx b/oox/inc/oox/core/xmlfilterbase.hxx
index 0f7393bec4ab..eb809c3eddfe 100644
--- a/oox/inc/oox/core/xmlfilterbase.hxx
+++ b/oox/inc/oox/core/xmlfilterbase.hxx
@@ -29,16 +29,16 @@
#ifndef OOX_CORE_XMLFILTERBASE_HXX
#define OOX_CORE_XMLFILTERBASE_HXX
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/text/XTextCursor.hpp>
+#include <com/sun/star/text/XTextField.hpp>
#include <rtl/ref.hxx>
#include <rtl/string.hxx>
#include <rtl/ustring.hxx>
-#include "oox/drawingml/table/tablestylelist.hxx"
#include "oox/core/filterbase.hxx"
#include "oox/core/relations.hxx"
-#include <oox/dllapi.h>
-#include <com/sun/star/text/XTextField.hpp>
-#include <com/sun/star/text/XTextCursor.hpp>
-#include <com/sun/star/text/XText.hpp>
+#include "oox/drawingml/table/tablestylelist.hxx"
+#include "oox/dllapi.h"
namespace com { namespace sun { namespace star {
namespace container { class XNameContainer; }
@@ -47,9 +47,11 @@ namespace com { namespace sun { namespace star {
namespace xml { namespace sax { class XFastDocumentHandler; } }
} } }
-namespace oox { namespace drawingml { class Theme; } }
-namespace oox { namespace drawingml { namespace chart { class ChartConverter; } } }
-namespace oox { namespace vml { class Drawing; } }
+namespace oox {
+ namespace drawingml { class Theme; }
+ namespace drawingml { namespace chart { class ChartConverter; } }
+ namespace vml { class Drawing; }
+}
namespace sax_fastparser {
class FastSerializerHelper;
@@ -62,6 +64,8 @@ namespace core {
class FragmentHandler;
+// ============================================================================
+
struct TextField {
com::sun::star::uno::Reference< com::sun::star::text::XText > xText;
com::sun::star::uno::Reference< com::sun::star::text::XTextCursor > xTextCursor;
@@ -77,7 +81,8 @@ class OOX_DLLPUBLIC XmlFilterBase : public FilterBase
{
public:
explicit XmlFilterBase(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~XmlFilterBase();
@@ -226,4 +231,4 @@ typedef ::rtl::Reference< XmlFilterBase > XmlFilterRef;
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/axiscontext.hxx b/oox/inc/oox/drawingml/chart/axiscontext.hxx
index 0cf08d0c99b8..762760aa8aa3 100644
--- a/oox/inc/oox/drawingml/chart/axiscontext.hxx
+++ b/oox/inc/oox/drawingml/chart/axiscontext.hxx
@@ -126,4 +126,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/axisconverter.hxx b/oox/inc/oox/drawingml/chart/axisconverter.hxx
index 2293b96b5e3c..395d2e0a9006 100644
--- a/oox/inc/oox/drawingml/chart/axisconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/axisconverter.hxx
@@ -70,4 +70,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/axismodel.hxx b/oox/inc/oox/drawingml/chart/axismodel.hxx
index bd9aa42fc715..7fd9ffaf355d 100644
--- a/oox/inc/oox/drawingml/chart/axismodel.hxx
+++ b/oox/inc/oox/drawingml/chart/axismodel.hxx
@@ -78,9 +78,9 @@ struct AxisModel
OptValue< double > mofLogBase; /// Logarithmic base for logarithmic axes.
OptValue< double > mofMax; /// Maximum axis value.
OptValue< double > mofMin; /// Minimum axis value.
+ OptValue< sal_Int32 > monBaseTimeUnit; /// Base time unit shown on a date axis.
sal_Int32 mnAxisId; /// Unique axis identifier.
sal_Int32 mnAxisPos; /// Position of the axis (top/bottom/left/right).
- sal_Int32 mnBaseTimeUnit; /// Base time unit shown on a date axis.
sal_Int32 mnCrossAxisId; /// Identifier of a crossing axis.
sal_Int32 mnCrossBetween; /// This value axis crosses between or inside category.
sal_Int32 mnCrossMode; /// Mode this axis crosses another axis (min, max, auto).
@@ -95,7 +95,7 @@ struct AxisModel
sal_Int32 mnTickLabelSkip; /// Number of tick mark labels to skip.
sal_Int32 mnTickMarkSkip; /// Number of tick marks to skip.
sal_Int32 mnTypeId; /// Type identifier of this axis.
- bool mbAuto; /// True = automatic axis settings.
+ bool mbAuto; /// True = automatic selection of text/date axis type.
bool mbDeleted; /// True = axis has been deleted manually.
bool mbNoMultiLevel; /// True = no multi-level categories supported.
@@ -111,4 +111,4 @@ struct AxisModel
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/chartcontextbase.hxx b/oox/inc/oox/drawingml/chart/chartcontextbase.hxx
index 4e368341b210..d5a944bcec3d 100644
--- a/oox/inc/oox/drawingml/chart/chartcontextbase.hxx
+++ b/oox/inc/oox/drawingml/chart/chartcontextbase.hxx
@@ -101,4 +101,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/chartconverter.hxx b/oox/inc/oox/drawingml/chart/chartconverter.hxx
index 96a22187da53..8c39f37405c2 100644
--- a/oox/inc/oox/drawingml/chart/chartconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/chartconverter.hxx
@@ -110,4 +110,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
index 585b4217663e..37a49835e92f 100644
--- a/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
+++ b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
@@ -102,7 +102,8 @@ public:
virtual ~ChartDrawingFragment();
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
private:
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
@@ -121,4 +122,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx b/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx
index e03642927c5e..eb711c2332c3 100644
--- a/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx
@@ -63,4 +63,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/chartspacefragment.hxx b/oox/inc/oox/drawingml/chart/chartspacefragment.hxx
index a3e796b70b67..54277e8e4a38 100644
--- a/oox/inc/oox/drawingml/chart/chartspacefragment.hxx
+++ b/oox/inc/oox/drawingml/chart/chartspacefragment.hxx
@@ -61,4 +61,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/chartspacemodel.hxx b/oox/inc/oox/drawingml/chart/chartspacemodel.hxx
index 7ad710bd3c18..0a2d21bb5d8d 100644
--- a/oox/inc/oox/drawingml/chart/chartspacemodel.hxx
+++ b/oox/inc/oox/drawingml/chart/chartspacemodel.hxx
@@ -64,6 +64,7 @@ struct ChartSpaceModel
bool mbAutoTitleDel; /// True = automatic title deleted manually.
bool mbPlotVisOnly; /// True = plot visible cells in a sheet only.
bool mbShowLabelsOverMax;/// True = show labels over chart maximum.
+ bool mbPivotChart; /// True = pivot chart.
explicit ChartSpaceModel();
~ChartSpaceModel();
@@ -77,4 +78,4 @@ struct ChartSpaceModel
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/converterbase.hxx b/oox/inc/oox/drawingml/chart/converterbase.hxx
index 855e5faddefa..1d717e75da63 100644
--- a/oox/inc/oox/drawingml/chart/converterbase.hxx
+++ b/oox/inc/oox/drawingml/chart/converterbase.hxx
@@ -139,9 +139,10 @@ public:
OOXML layout model. Returns true, if returned rectangle is valid. */
bool calcAbsRectangle( ::com::sun::star::awt::Rectangle& orRect ) const;
- /** Tries to set the position from the contained OOXML layout model.
- Returns true, if a manual position could be calculated. */
+ /** Tries to set the position and size from the contained OOXML layout model.
+ Returns true, if a manual position and size could be calculated. */
bool convertFromModel( PropertySet& rPropSet );
+
/** Tries to set the position from the contained OOXML layout model.
Returns true, if a manual position could be calculated. */
bool convertFromModel(
@@ -157,4 +158,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/datasourcecontext.hxx b/oox/inc/oox/drawingml/chart/datasourcecontext.hxx
index 9f232b7534e9..d0948ac1035e 100644
--- a/oox/inc/oox/drawingml/chart/datasourcecontext.hxx
+++ b/oox/inc/oox/drawingml/chart/datasourcecontext.hxx
@@ -52,7 +52,7 @@ public:
virtual ~DoubleSequenceContext();
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
private:
sal_Int32 mnPtIndex; /// Current data point index.
@@ -70,7 +70,7 @@ public:
virtual ~StringSequenceContext();
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
private:
sal_Int32 mnPtIndex; /// Current data point index.
@@ -100,4 +100,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/datasourceconverter.hxx b/oox/inc/oox/drawingml/chart/datasourceconverter.hxx
index 39b9e0f5cae2..7186529fade4 100644
--- a/oox/inc/oox/drawingml/chart/datasourceconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/datasourceconverter.hxx
@@ -77,4 +77,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/datasourcemodel.hxx b/oox/inc/oox/drawingml/chart/datasourcemodel.hxx
index 143e6a7fbf21..bb26a3257fbd 100644
--- a/oox/inc/oox/drawingml/chart/datasourcemodel.hxx
+++ b/oox/inc/oox/drawingml/chart/datasourcemodel.hxx
@@ -71,4 +71,4 @@ struct DataSourceModel
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/modelbase.hxx b/oox/inc/oox/drawingml/chart/modelbase.hxx
index b4f5819de8b2..8da378328dbb 100644
--- a/oox/inc/oox/drawingml/chart/modelbase.hxx
+++ b/oox/inc/oox/drawingml/chart/modelbase.hxx
@@ -29,9 +29,9 @@
#ifndef OOX_DRAWINGML_CHART_MODELBASE_HXX
#define OOX_DRAWINGML_CHART_MODELBASE_HXX
-#include "oox/helper/containerhelper.hxx"
#include "oox/helper/helper.hxx"
-#include "tokens.hxx"
+#include "oox/helper/refmap.hxx"
+#include "oox/helper/refvector.hxx"
namespace oox { class AttributeList; }
@@ -140,4 +140,4 @@ struct LayoutModel
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/objectformatter.hxx b/oox/inc/oox/drawingml/chart/objectformatter.hxx
index d88450d95f7c..7c837a3e03d0 100644
--- a/oox/inc/oox/drawingml/chart/objectformatter.hxx
+++ b/oox/inc/oox/drawingml/chart/objectformatter.hxx
@@ -29,7 +29,6 @@
#ifndef OOX_DRAWINGML_CHART_OBJECTFORMATTER_HXX
#define OOX_DRAWINGML_CHART_OBJECTFORMATTER_HXX
-#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/chart/modelbase.hxx"
@@ -172,4 +171,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/plotareacontext.hxx b/oox/inc/oox/drawingml/chart/plotareacontext.hxx
index aac136ffd49a..da379f878249 100644
--- a/oox/inc/oox/drawingml/chart/plotareacontext.hxx
+++ b/oox/inc/oox/drawingml/chart/plotareacontext.hxx
@@ -89,4 +89,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/plotareaconverter.hxx b/oox/inc/oox/drawingml/chart/plotareaconverter.hxx
index 42af2ced4479..3ac712aabbbb 100644
--- a/oox/inc/oox/drawingml/chart/plotareaconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/plotareaconverter.hxx
@@ -109,4 +109,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/plotareamodel.hxx b/oox/inc/oox/drawingml/chart/plotareamodel.hxx
index afa471b30fb5..2cb156b19a5b 100644
--- a/oox/inc/oox/drawingml/chart/plotareamodel.hxx
+++ b/oox/inc/oox/drawingml/chart/plotareamodel.hxx
@@ -93,4 +93,4 @@ struct PlotAreaModel
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/seriescontext.hxx b/oox/inc/oox/drawingml/chart/seriescontext.hxx
index 5a4c84140fec..09c6a7c30936 100644
--- a/oox/inc/oox/drawingml/chart/seriescontext.hxx
+++ b/oox/inc/oox/drawingml/chart/seriescontext.hxx
@@ -48,7 +48,7 @@ public:
virtual ~DataLabelContext();
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
};
// ============================================================================
@@ -64,7 +64,7 @@ public:
virtual ~DataLabelsContext();
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
};
// ============================================================================
@@ -125,7 +125,7 @@ public:
virtual ~TrendlineContext();
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
};
// ============================================================================
@@ -272,4 +272,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/seriesconverter.hxx b/oox/inc/oox/drawingml/chart/seriesconverter.hxx
index d63133ade7a7..098dbc4f93ee 100644
--- a/oox/inc/oox/drawingml/chart/seriesconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/seriesconverter.hxx
@@ -173,4 +173,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/seriesmodel.hxx b/oox/inc/oox/drawingml/chart/seriesmodel.hxx
index 7d5469c5dd4f..45cad7bdfafa 100644
--- a/oox/inc/oox/drawingml/chart/seriesmodel.hxx
+++ b/oox/inc/oox/drawingml/chart/seriesmodel.hxx
@@ -243,4 +243,4 @@ struct SeriesModel
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/titlecontext.hxx b/oox/inc/oox/drawingml/chart/titlecontext.hxx
index 80a425217af7..c11cdbcc32ac 100644
--- a/oox/inc/oox/drawingml/chart/titlecontext.hxx
+++ b/oox/inc/oox/drawingml/chart/titlecontext.hxx
@@ -48,7 +48,7 @@ public:
virtual ~TextContext();
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
};
// ============================================================================
@@ -89,4 +89,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/titleconverter.hxx b/oox/inc/oox/drawingml/chart/titleconverter.hxx
index 993254206b04..01cd7092fbe3 100644
--- a/oox/inc/oox/drawingml/chart/titleconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/titleconverter.hxx
@@ -112,4 +112,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/titlemodel.hxx b/oox/inc/oox/drawingml/chart/titlemodel.hxx
index c401ee322bf8..27dd93f99494 100644
--- a/oox/inc/oox/drawingml/chart/titlemodel.hxx
+++ b/oox/inc/oox/drawingml/chart/titlemodel.hxx
@@ -95,4 +95,4 @@ struct LegendModel
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/typegroupcontext.hxx b/oox/inc/oox/drawingml/chart/typegroupcontext.hxx
index a6d1507ece80..dbba5de9625d 100644
--- a/oox/inc/oox/drawingml/chart/typegroupcontext.hxx
+++ b/oox/inc/oox/drawingml/chart/typegroupcontext.hxx
@@ -170,4 +170,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/typegroupconverter.hxx b/oox/inc/oox/drawingml/chart/typegroupconverter.hxx
index 30d2d0b49dd9..23f95af47735 100644
--- a/oox/inc/oox/drawingml/chart/typegroupconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/typegroupconverter.hxx
@@ -204,4 +204,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/chart/typegroupmodel.hxx b/oox/inc/oox/drawingml/chart/typegroupmodel.hxx
index ba997f8a9f2d..4ecb74744294 100644
--- a/oox/inc/oox/drawingml/chart/typegroupmodel.hxx
+++ b/oox/inc/oox/drawingml/chart/typegroupmodel.hxx
@@ -102,4 +102,4 @@ struct TypeGroupModel
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/drawingml/clrscheme.hxx b/oox/inc/oox/drawingml/clrscheme.hxx
index ac0fc6d89bbc..73af9c1ac351 100644
--- a/oox/inc/oox/drawingml/clrscheme.hxx
+++ b/oox/inc/oox/drawingml/clrscheme.hxx
@@ -32,7 +32,6 @@
#include <boost/shared_ptr.hpp>
#include <map>
#include <vector>
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/color.hxx"
namespace oox { namespace drawingml {
diff --git a/oox/inc/oox/drawingml/customshapeproperties.hxx b/oox/inc/oox/drawingml/customshapeproperties.hxx
index f9f91327a39d..112a337a8ceb 100644
--- a/oox/inc/oox/drawingml/customshapeproperties.hxx
+++ b/oox/inc/oox/drawingml/customshapeproperties.hxx
@@ -29,13 +29,7 @@
#ifndef OOX_DRAWINGML_CUSTOMSHAPEPROPERTIES_HXX
#define OOX_DRAWINGML_CUSTOMSHAPEPROPERTIES_HXX
-#include "oox/helper/propertymap.hxx"
-#include "oox/drawingml/color.hxx"
-#include "oox/core/xmlfilterbase.hxx"
-#include <com/sun/star/graphic/XGraphic.hpp>
#include <boost/shared_ptr.hpp>
-#include "oox/helper/helper.hxx"
-#include "tokens.hxx"
#include <vector>
#include <map>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
@@ -46,11 +40,15 @@
#include <com/sun/star/drawing/EnhancedCustomShapeTextFrame.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
-#ifndef __com_sun_star_beans_PropertyValues_hpp__
#include <com/sun/star/beans/PropertyValues.hpp>
-#endif
#include <com/sun/star/drawing/ProjectionMode.hpp>
#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include "oox/core/xmlfilterbase.hxx"
+#include "oox/drawingml/color.hxx"
+#include "oox/helper/helper.hxx"
+#include "oox/helper/propertymap.hxx"
+#include "oox/token/tokens.hxx"
namespace oox { namespace drawingml {
diff --git a/oox/inc/oox/drawingml/fillproperties.hxx b/oox/inc/oox/drawingml/fillproperties.hxx
index c2a0a5e32534..7fcfa38bddbd 100644
--- a/oox/inc/oox/drawingml/fillproperties.hxx
+++ b/oox/inc/oox/drawingml/fillproperties.hxx
@@ -118,6 +118,8 @@ struct BlipFillProperties
OptValue< sal_Int32 > moBitmapMode; /// Bitmap tile or stretch.
OptValue< ::com::sun::star::geometry::IntegerRectangle2D >
moFillRect; /// Stretch fill offsets.
+ OptValue< ::com::sun::star::geometry::IntegerRectangle2D >
+ moClipRect;
OptValue< sal_Int32 > moTileOffsetX; /// Width of bitmap tiles (EMUs).
OptValue< sal_Int32 > moTileOffsetY; /// Height of bitmap tiles (EMUs).
OptValue< sal_Int32 > moTileScaleX; /// Horizontal scaling of bitmap tiles (1/1000 percent).
diff --git a/oox/inc/oox/drawingml/graphicshapecontext.hxx b/oox/inc/oox/drawingml/graphicshapecontext.hxx
index 7b08057419d2..45ac831aa1c8 100644
--- a/oox/inc/oox/drawingml/graphicshapecontext.hxx
+++ b/oox/inc/oox/drawingml/graphicshapecontext.hxx
@@ -69,7 +69,7 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
private:
- ::boost::shared_ptr< ::oox::vml::OleObjectInfo > mxOleObjectInfo;
+ ::oox::vml::OleObjectInfo& mrOleObjectInfo;
};
// ====================================================================
@@ -107,7 +107,7 @@ public:
throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
private:
- bool mbEmbedShapes;
+ ChartShapeInfo& mrChartShapeInfo;
};
// ====================================================================
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index 879036d78e6c..f5ad5540a7de 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -41,6 +41,10 @@
#include <vector>
#include <map>
+namespace oox { namespace vml {
+ struct OleObjectInfo;
+} }
+
namespace oox { namespace drawingml {
class CustomShapeProperties;
@@ -58,37 +62,15 @@ typedef ::std::map< sal_Int32, ShapeStyleRef > ShapeStyleRefMap;
// ============================================================================
-/** A callback that will be called before and after the API shape is created
- from the imported shape.
-
- An instance of a derived class of this callback can be set at every
- ::oox::drawingml::Shape instance to implement anything that needs a created
- and inserted XShape.
- */
-class CreateShapeCallback
+/** Additional information for a chart embedded in a drawing shape. */
+struct ChartShapeInfo
{
-public:
- virtual ::rtl::OUString onCreateXShape(
- const ::rtl::OUString& rServiceName,
- const ::com::sun::star::awt::Rectangle& rShapeRect );
+ ::rtl::OUString maFragmentPath; /// Path to related XML stream, e.g. for charts.
+ bool mbEmbedShapes; /// True = load chart shapes into chart, false = load into parent drawpage.
- virtual void onXShapeCreated(
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes ) const;
-
- inline const PropertyMap& getShapeProperties() const { return maShapeProps; }
-
-protected:
- explicit CreateShapeCallback( ::oox::core::XmlFilterBase& rFilter );
- virtual ~CreateShapeCallback();
-
-protected:
- ::oox::core::XmlFilterBase& mrFilter;
- PropertyMap maShapeProps;
+ inline explicit ChartShapeInfo( bool bEmbedShapes ) : mbEmbedShapes( bEmbedShapes ) {}
};
-typedef ::boost::shared_ptr< CreateShapeCallback > CreateShapeCallbackRef;
-
// ============================================================================
class Shape
@@ -96,7 +78,7 @@ class Shape
{
public:
- Shape( const sal_Char* pServiceType = NULL );
+ explicit Shape( const sal_Char* pServiceType = 0 );
virtual ~Shape();
rtl::OUString& getServiceName(){ return msServiceName; }
@@ -141,6 +123,11 @@ public:
// setDefaults has to be called if styles are imported (OfficeXML is not storing properties having the default value)
void setDefaults();
+ ::oox::vml::OleObjectInfo& setOleObjectType();
+ ChartShapeInfo& setChartType( bool bEmbedShapes );
+ void setDiagramType();
+ void setTableType();
+
void setTextBody(const TextBodyPtr & pTextBody);
TextBodyPtr getTextBody();
void setMasterTextListStyle( const TextListStylePtr& pMasterTextListStyle );
@@ -150,11 +137,9 @@ public:
inline const ShapeStyleRefMap& getShapeStyleRefs() const { return maShapeStyleRefs; }
const ShapeStyleRef* getShapeStyleRef( sal_Int32 nRefType ) const;
- inline void setCreateShapeCallback( CreateShapeCallbackRef xCallback ) { mxCreateCallback = xCallback; }
-
// addShape is creating and inserting the corresponding XShape.
void addShape(
- const oox::core::XmlFilterBase& rFilterBase,
+ ::oox::core::XmlFilterBase& rFilterBase,
const Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const ::com::sun::star::awt::Rectangle* pShapeRect = 0,
@@ -171,7 +156,7 @@ protected:
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
createAndInsert(
- const ::oox::core::XmlFilterBase& rFilterBase,
+ ::oox::core::XmlFilterBase& rFilterBase,
const ::rtl::OUString& rServiceName,
const Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
@@ -179,13 +164,22 @@ protected:
sal_Bool bClearText );
void addChildren(
- const ::oox::core::XmlFilterBase& rFilterBase,
+ ::oox::core::XmlFilterBase& rFilterBase,
Shape& rMaster,
const Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const ::com::sun::star::awt::Rectangle& rClientRect,
ShapeIdMap* pShapeMap );
+ virtual ::rtl::OUString finalizeServiceName(
+ ::oox::core::XmlFilterBase& rFilter,
+ const ::rtl::OUString& rServiceName,
+ const ::com::sun::star::awt::Rectangle& rShapeRect );
+
+ virtual void finalizeXShape(
+ ::oox::core::XmlFilterBase& rFilter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
+
std::vector< ShapePtr > maChildren; // only used for group shapes
com::sun::star::awt::Size maChSize; // only used for group shapes
com::sun::star::awt::Point maChPosition; // only used for group shapes
@@ -216,7 +210,22 @@ protected:
com::sun::star::awt::Point maPosition;
private:
- CreateShapeCallbackRef mxCreateCallback;
+ enum FrameType
+ {
+ FRAMETYPE_GENERIC, /// Generic shape, no special type.
+ FRAMETYPE_OLEOBJECT, /// OLE object embedded in a shape.
+ FRAMETYPE_CHART, /// Chart embedded in a shape.
+ FRAMETYPE_DIAGRAM, /// Complex diagram drawing shape.
+ FRAMETYPE_TABLE /// A table embedded in a shape.
+ };
+
+ typedef ::boost::shared_ptr< ::oox::vml::OleObjectInfo > OleObjectInfoRef;
+ typedef ::boost::shared_ptr< ChartShapeInfo > ChartShapeInfoRef;
+
+ FrameType meFrameType; /// Type for graphic frame shapes.
+ OleObjectInfoRef mxOleObjectInfo; /// Additional data for OLE objects.
+ ChartShapeInfoRef mxChartShapeInfo; /// Additional data for chart shapes.
+
sal_Int32 mnRotation;
sal_Bool mbFlipH;
sal_Bool mbFlipV;
@@ -225,6 +234,8 @@ private:
::rtl::OUString GetShapeType( sal_Int32 nType );
+// ============================================================================
+
} }
#endif // OOX_DRAWINGML_SHAPE_HXX
diff --git a/oox/inc/oox/drawingml/textbody.hxx b/oox/inc/oox/drawingml/textbody.hxx
index 2e545ebdca63..aa2fdcd71317 100644
--- a/oox/inc/oox/drawingml/textbody.hxx
+++ b/oox/inc/oox/drawingml/textbody.hxx
@@ -29,7 +29,6 @@
#ifndef OOX_DRAWINGML_TEXTBODY_HXX
#define OOX_DRAWINGML_TEXTBODY_HXX
-#include "oox/helper/containerhelper.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/textbodyproperties.hxx"
#include "oox/drawingml/textliststyle.hxx"
diff --git a/oox/inc/oox/drawingml/textliststyle.hxx b/oox/inc/oox/drawingml/textliststyle.hxx
index 04e9919275df..29d8f29a48ce 100644
--- a/oox/inc/oox/drawingml/textliststyle.hxx
+++ b/oox/inc/oox/drawingml/textliststyle.hxx
@@ -29,8 +29,8 @@
#ifndef OOX_DRAWINGML_TEXTLISTSTYLE_HXX
#define OOX_DRAWINGML_TEXTLISTSTYLE_HXX
-#include "oox/helper/containerhelper.hxx"
#include "oox/drawingml/textparagraphproperties.hxx"
+#include "oox/helper/refvector.hxx"
namespace oox { namespace drawingml {
@@ -51,10 +51,6 @@ public:
inline const TextParagraphPropertiesVector& getAggregationListStyle() const { return maAggregationListStyle; };
inline TextParagraphPropertiesVector& getAggregationListStyle() { return maAggregationListStyle; };
-#if OSL_DEBUG_LEVEL > 0
- void dump( int nLevels=9 ) const;
-#endif
-
protected:
TextParagraphPropertiesVector maListStyle;
diff --git a/oox/inc/oox/drawingml/textparagraph.hxx b/oox/inc/oox/drawingml/textparagraph.hxx
index fa4bec9af1da..b1f6599a30aa 100644
--- a/oox/inc/oox/drawingml/textparagraph.hxx
+++ b/oox/inc/oox/drawingml/textparagraph.hxx
@@ -32,7 +32,6 @@
#include <com/sun/star/text/XTextCursor.hpp>
#include <com/sun/star/text/XText.hpp>
-#include "oox/helper/containerhelper.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/textrun.hxx"
#include "oox/drawingml/textliststyle.hxx"
diff --git a/oox/inc/oox/drawingml/textparagraphproperties.hxx b/oox/inc/oox/drawingml/textparagraphproperties.hxx
index b2c50964d8f7..e037ff2c3726 100644
--- a/oox/inc/oox/drawingml/textparagraphproperties.hxx
+++ b/oox/inc/oox/drawingml/textparagraphproperties.hxx
@@ -114,10 +114,6 @@ public:
size can be zero and the default value is returned. */
float getCharHeightPoints( float fDefault ) const;
-#if OSL_DEBUG_LEVEL > 0
- void dump() const;
-#endif
-
protected:
TextCharacterProperties maTextCharacterProperties;
diff --git a/oox/inc/oox/drawingml/theme.hxx b/oox/inc/oox/drawingml/theme.hxx
index 0638aeafdb11..81041be136d3 100644
--- a/oox/inc/oox/drawingml/theme.hxx
+++ b/oox/inc/oox/drawingml/theme.hxx
@@ -29,7 +29,6 @@
#ifndef OOX_DRAWINGML_THEME_HXX
#define OOX_DRAWINGML_THEME_HXX
-#include "oox/helper/containerhelper.hxx"
#include "oox/drawingml/clrscheme.hxx"
#include "oox/drawingml/shape.hxx"
#include "oox/drawingml/textfont.hxx"
diff --git a/oox/inc/oox/dump/biffdumper.hxx b/oox/inc/oox/dump/biffdumper.hxx
index d76df7fc8bba..c6eae2876621 100644
--- a/oox/inc/oox/dump/biffdumper.hxx
+++ b/oox/inc/oox/dump/biffdumper.hxx
@@ -191,6 +191,9 @@ protected:
::oox::xls::BiffStringFlags nUniFlags = ::oox::xls::BIFF_STR_DEFAULT,
rtl_TextEncoding eDefaultTextEnc = RTL_TEXTENCODING_DONTKNOW );
+ ::rtl::OUString dumpSegmentedUniString( const String& rName );
+ void dumpSegmentedUniStringArray( const String& rName );
+
sal_uInt8 dumpBoolean( const String& rName = EMPTY_STRING );
sal_uInt8 dumpErrorCode( const String& rName = EMPTY_STRING );
@@ -441,6 +444,8 @@ private:
void dumpExtCfColor( const String& rName = EMPTY_STRING );
void dumpExtGradientHead();
+ sal_uInt8 dumpFilterColumnOperator( const String& rName );
+
::rtl::OUString dumpPivotString( const String& rName, sal_uInt16 nStrLen );
::rtl::OUString dumpPivotString( const String& rName );
diff --git a/oox/inc/oox/dump/dumperbase.hxx b/oox/inc/oox/dump/dumperbase.hxx
index 0a6099ca887c..98ecd090dd9d 100644
--- a/oox/inc/oox/dump/dumperbase.hxx
+++ b/oox/inc/oox/dump/dumperbase.hxx
@@ -911,7 +911,7 @@ public:
void eraseNameList( const ::rtl::OUString& rListName );
NameListRef getNameList( const ::rtl::OUString& rListName ) const;
- ::rtl::OUString requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier );
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier );
inline bool isPasswordCancelled() const { return mbPwCancelled; }
protected:
@@ -1012,7 +1012,7 @@ public:
template< typename Type >
bool hasName( const NameListWrapper& rListWrp, Type nKey ) const;
- ::rtl::OUString requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier );
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier );
bool isPasswordCancelled() const;
protected:
diff --git a/oox/inc/oox/dump/oledumper.hxx b/oox/inc/oox/dump/oledumper.hxx
index b4759c686f71..c02d07d79758 100644
--- a/oox/inc/oox/dump/oledumper.hxx
+++ b/oox/inc/oox/dump/oledumper.hxx
@@ -142,15 +142,19 @@ private:
void dumpCodePageProperty( sal_uInt32 nStartPos );
void dumpDictionaryProperty( sal_uInt32 nStartPos );
- void dumpPropertyContents( sal_Int32 nPropId );
- void dumpPropertyValue( sal_Int32 nPropId, sal_Int32 nBaseType );
+ sal_uInt16 dumpPropertyContents( sal_Int32 nPropId );
+ void dumpPropertyValue( sal_Int32 nPropId, sal_uInt16 nBaseType );
+ void dumpPropertyVector( sal_Int32 nPropId, sal_uInt16 nBaseType );
+ void dumpPropertyArray( sal_Int32 nPropId, sal_uInt16 nBaseType );
- sal_Int32 dumpPropertyType();
- void dumpBlob( const String& rName );
+ sal_uInt16 dumpPropertyType();
+ void dumpBlob( sal_Int32 nPropId, const String& rName );
::rtl::OUString dumpString8( const String& rName );
::rtl::OUString dumpCharArray8( const String& rName, sal_Int32 nLen );
::rtl::OUString dumpString16( const String& rName );
::rtl::OUString dumpCharArray16( const String& rName, sal_Int32 nLen );
+ bool dumpTypedProperty( const String& rName, sal_uInt16 nExpectedType );
+ void dumpHlinks( sal_Int32 nSize );
bool startElement( sal_uInt32 nStartPos );
void writeSectionHeader( const ::rtl::OUString& rGuid, sal_uInt32 nStartPos );
diff --git a/oox/inc/oox/dump/xlsbdumper.hxx b/oox/inc/oox/dump/xlsbdumper.hxx
index dd175309ff02..197844387b03 100644
--- a/oox/inc/oox/dump/xlsbdumper.hxx
+++ b/oox/inc/oox/dump/xlsbdumper.hxx
@@ -30,7 +30,6 @@
#define OOX_DUMP_XLSBDUMPER_HXX
#include "oox/dump/dumperbase.hxx"
-#include "oox/helper/recordinputstream.hxx"
#if OOX_INCLUDE_DUMPER
@@ -97,9 +96,9 @@ private:
bool readCompressedInt( BinaryInputStream& rStrm, sal_Int32& ornValue );
private:
- typedef ::boost::shared_ptr< RecordInputStream > RecordInputStreamRef;
+ typedef ::boost::shared_ptr< SequenceInputStream > SequenceInputStreamRef;
- RecordInputStreamRef mxBiffStrm;
+ SequenceInputStreamRef mxBiffStrm;
NameListRef mxErrCodes;
};
diff --git a/oox/inc/oox/helper/attributelist.hxx b/oox/inc/oox/helper/attributelist.hxx
index f792b12c293b..3d079fc178b1 100644
--- a/oox/inc/oox/helper/attributelist.hxx
+++ b/oox/inc/oox/helper/attributelist.hxx
@@ -32,7 +32,8 @@
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
#include "oox/helper/helper.hxx"
-#include "tokens.hxx"
+#include "oox/token/namespaces.hxx"
+#include "oox/token/tokens.hxx"
namespace oox {
@@ -44,6 +45,9 @@ namespace oox {
class AttributeConversion
{
public:
+ /** Returns the XML token identifier from the passed string. */
+ static sal_Int32 decodeToken( const ::rtl::OUString& rValue );
+
/** Returns the decoded string value. All characters in the format
'_xHHHH_' (H being a hexadecimal digit), will be decoded. */
static ::rtl::OUString decodeXString( const ::rtl::OUString& rValue );
@@ -191,4 +195,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/helper/binaryinputstream.hxx b/oox/inc/oox/helper/binaryinputstream.hxx
index d2e0141213ed..2c7d0bd18f5c 100644
--- a/oox/inc/oox/helper/binaryinputstream.hxx
+++ b/oox/inc/oox/helper/binaryinputstream.hxx
@@ -290,4 +290,4 @@ typedef ::boost::shared_ptr< RelativeInputStream > RelativeInputStreamRef;
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/helper/binaryoutputstream.hxx b/oox/inc/oox/helper/binaryoutputstream.hxx
index 240ce2e15fb8..c9bab075ebf1 100644
--- a/oox/inc/oox/helper/binaryoutputstream.hxx
+++ b/oox/inc/oox/helper/binaryoutputstream.hxx
@@ -160,4 +160,4 @@ typedef ::boost::shared_ptr< SequenceOutputStream > SequenceOutputStreamRef;
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/helper/binarystreambase.hxx b/oox/inc/oox/helper/binarystreambase.hxx
index 130a094fed51..de0bedbb2b37 100644
--- a/oox/inc/oox/helper/binarystreambase.hxx
+++ b/oox/inc/oox/helper/binarystreambase.hxx
@@ -146,4 +146,4 @@ protected:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/helper/containerhelper.hxx b/oox/inc/oox/helper/containerhelper.hxx
index 9a0a0774c43b..e2577313a11e 100644
--- a/oox/inc/oox/helper/containerhelper.hxx
+++ b/oox/inc/oox/helper/containerhelper.hxx
@@ -31,8 +31,6 @@
#include <vector>
#include <map>
-#include <boost/shared_ptr.hpp>
-#include <boost/bind.hpp>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
@@ -50,81 +48,6 @@ namespace oox {
// ============================================================================
-/** Template for a vector of ref-counted objects with additional accessor functions.
-
- An instance of the class RefVector< Type > stores elements of the type
- ::boost::shared_ptr< Type >. The new accessor functions has() and get()
- work correctly for indexes out of the current range, there is no need to
- check the passed index before.
- */
-template< typename ObjType >
-class RefVector : public ::std::vector< ::boost::shared_ptr< ObjType > >
-{
-public:
- typedef ::std::vector< ::boost::shared_ptr< ObjType > > container_type;
- typedef typename container_type::value_type value_type;
- typedef typename container_type::size_type size_type;
-
-public:
- /** Returns true, if the object with the passed index exists. Returns
- false, if the vector element exists but is an empty reference. */
- inline bool has( sal_Int32 nIndex ) const
- {
- const value_type* pxRef = getRef( nIndex );
- return pxRef && pxRef->get();
- }
-
- /** Returns a reference to the object with the passed index, or 0 on error. */
- inline value_type get( sal_Int32 nIndex ) const
- {
- if( const value_type* pxRef = getRef( nIndex ) ) return *pxRef;
- return value_type();
- }
-
- /** Returns the index of the last element, or -1, if the vector is empty.
- Does *not* check whether the last element is an empty reference. */
- inline sal_Int32 getLastIndex() const { return static_cast< sal_Int32 >( this->size() ) - 1; }
-
- /** Calls the passed functor for every contained object, automatically
- skips all elements that are empty references. */
- template< typename FunctorType >
- inline void forEach( FunctorType aFunctor ) const
- {
- ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( aFunctor ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType >
- inline void forEachMem( FuncType pFunc ) const
- {
- forEach( ::boost::bind( pFunc, _1 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType, typename ParamType >
- inline void forEachMem( FuncType pFunc, ParamType aParam ) const
- {
- forEach( ::boost::bind( pFunc, _1, aParam ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType, typename ParamType1, typename ParamType2 >
- inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
- {
- forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
- inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
- {
- forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) );
- }
-
/** Calls the passed member function of ObjType on every contained object,
automatically skips all elements that are empty references. */
template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3, typename ParamType4 >
@@ -132,163 +55,6 @@ public:
{
forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3, aParam4 ) );
}
- /** Calls the passed functor for every contained object. Passes the index as
- first argument and the object reference as second argument to rFunctor. */
- template< typename FunctorType >
- inline void forEachWithIndex( const FunctorType& rFunctor ) const
- {
- ::std::for_each( this->begin(), this->end(), ForEachFunctorWithIndex< FunctorType >( rFunctor ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the vector index to the member function. */
- template< typename FuncType >
- inline void forEachMemWithIndex( FuncType pFunc ) const
- {
- forEachWithIndex( ::boost::bind( pFunc, _2, _1 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the vector index as first argument to the member function. */
- template< typename FuncType, typename ParamType >
- inline void forEachMemWithIndex( FuncType pFunc, ParamType aParam ) const
- {
- forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the vector index as first argument to the member function. */
- template< typename FuncType, typename ParamType1, typename ParamType2 >
- inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
- {
- forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the vector index as first argument to the member function. */
- template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
- inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
- {
- forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) );
- }
-
- /** Searches for an element by using the passed functor that takes a
- constant reference of the object type (const ObjType&). */
- template< typename FunctorType >
- inline value_type findIf( const FunctorType& rFunctor ) const
- {
- typename container_type::const_iterator aIt = ::std::find_if( this->begin(), this->end(), FindFunctor< FunctorType >( rFunctor ) );
- return (aIt == this->end()) ? value_type() : *aIt;
- }
-
-private:
- template< typename FunctorType >
- struct ForEachFunctor
- {
- FunctorType maFunctor;
- inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
- inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( *rxValue ); }
- };
-
- template< typename FunctorType >
- struct ForEachFunctorWithIndex
- {
- FunctorType maFunctor;
- sal_Int32 mnIndex;
- inline explicit ForEachFunctorWithIndex( const FunctorType& rFunctor ) : maFunctor( rFunctor ), mnIndex( 0 ) {}
- inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( mnIndex, *rxValue ); ++mnIndex; }
- };
-
- template< typename FunctorType >
- struct FindFunctor
- {
- FunctorType maFunctor;
- inline explicit FindFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
- inline bool operator()( const value_type& rxValue ) { return rxValue.get() && maFunctor( *rxValue ); }
- };
-
- inline const value_type* getRef( sal_Int32 nIndex ) const
- {
- return ((0 <= nIndex) && (static_cast< size_type >( nIndex ) < this->size())) ?
- &(*this)[ static_cast< size_type >( nIndex ) ] : 0;
- }
-};
-
-// ============================================================================
-
-/** Template for a map of ref-counted objects with additional accessor functions.
-
- An instance of the class RefMap< Type > stores elements of the type
- ::boost::shared_ptr< Type >. The new accessor functions has() and get()
- work correctly for nonexisting keys, there is no need to check the passed
- key before.
- */
-template< typename KeyType, typename ObjType, typename CompType = ::std::less< KeyType > >
-class RefMap : public ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType >
-{
-public:
- typedef ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType > container_type;
- typedef typename container_type::key_type key_type;
- typedef typename container_type::mapped_type mapped_type;
- typedef typename container_type::value_type value_type;
- typedef typename container_type::key_compare key_compare;
-
-public:
- /** Returns true, if the object accossiated to the passed key exists.
- Returns false, if the key exists but points to an empty reference. */
- inline bool has( key_type nKey ) const
- {
- const mapped_type* pxRef = getRef( nKey );
- return pxRef && pxRef->get();
- }
-
- /** Returns a reference to the object accossiated to the passed key, or an
- empty reference on error. */
- inline mapped_type get( key_type nKey ) const
- {
- if( const mapped_type* pxRef = getRef( nKey ) ) return *pxRef;
- return mapped_type();
- }
-
- /** Calls the passed functor for every contained object, automatically
- skips all elements that are empty references. */
- template< typename FunctorType >
- inline void forEach( const FunctorType& rFunctor ) const
- {
- ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( rFunctor ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType >
- inline void forEachMem( FuncType pFunc ) const
- {
- forEach( ::boost::bind( pFunc, _1 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType, typename ParamType >
- inline void forEachMem( FuncType pFunc, ParamType aParam ) const
- {
- forEach( ::boost::bind( pFunc, _1, aParam ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType, typename ParamType1, typename ParamType2 >
- inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
- {
- forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object,
- automatically skips all elements that are empty references. */
- template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
- inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
- {
- forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) );
- }
/** Calls the passed member function of ObjType on every contained object,
automatically skips all elements that are empty references. */
template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3, typename ParamType4 >
@@ -296,72 +62,6 @@ public:
{
forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3, aParam4 ) );
}
- /** Calls the passed functor for every contained object. Passes the key as
- first argument and the object reference as second argument to rFunctor. */
- template< typename FunctorType >
- inline void forEachWithKey( const FunctorType& rFunctor ) const
- {
- ::std::for_each( this->begin(), this->end(), ForEachFunctorWithKey< FunctorType >( rFunctor ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the object key as argument to the member function. */
- template< typename FuncType >
- inline void forEachMemWithKey( FuncType pFunc ) const
- {
- forEachWithKey( ::boost::bind( pFunc, _2, _1 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the object key as first argument to the member function. */
- template< typename FuncType, typename ParamType >
- inline void forEachMemWithKey( FuncType pFunc, ParamType aParam ) const
- {
- forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the object key as first argument to the member function. */
- template< typename FuncType, typename ParamType1, typename ParamType2 >
- inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
- {
- forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) );
- }
-
- /** Calls the passed member function of ObjType on every contained object.
- Passes the object key as first argument to the member function. */
- template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
- inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
- {
- forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) );
- }
-
-private:
- template< typename FunctorType >
- struct ForEachFunctor
- {
- FunctorType maFunctor;
- inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
- inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( *rValue.second ); }
- };
-
- template< typename FunctorType >
- struct ForEachFunctorWithKey
- {
- FunctorType maFunctor;
- inline explicit ForEachFunctorWithKey( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
- inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( rValue.first, *rValue.second ); }
- };
-
- inline const mapped_type* getRef( key_type nKey ) const
- {
- typename container_type::const_iterator aIt = find( nKey );
- return (aIt == this->end()) ? 0 : &aIt->second;
- }
-};
-
-// ============================================================================
-
/** Template for a 2-dimensional array of objects.
This class template provides a similar interface to the ::std::vector
@@ -533,45 +233,53 @@ public:
/** Returns the pointer to an existing element of the passed vector, or a
null pointer, if the passed index is out of bounds. */
- template< typename Type >
- static const Type* getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex );
+ template< typename VectorType >
+ static const typename VectorType::value_type*
+ getVectorElement( const VectorType& rVector, sal_Int32 nIndex );
/** Returns the pointer to an existing element of the passed vector, or a
null pointer, if the passed index is out of bounds. */
- template< typename Type >
- static Type* getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex );
+ template< typename VectorType >
+ static typename VectorType::value_type*
+ getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex );
/** Returns the reference to an existing element of the passed vector, or
the passed default value, if the passed index is out of bounds. */
- template< typename Type >
- static const Type& getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex, const Type& rDefault );
+ template< typename VectorType >
+ static const typename VectorType::value_type&
+ getVectorElement( const VectorType& rVector, sal_Int32 nIndex, const typename VectorType::value_type& rDefault );
/** Returns the reference to an existing element of the passed vector, or
the passed default value, if the passed index is out of bounds. */
- template< typename Type >
- static Type& getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex, Type& rDefault );
+ template< typename VectorType >
+ static typename VectorType::value_type&
+ getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex, typename VectorType::value_type& rDefault );
/** Returns the pointer to an existing element of the passed map, or a null
pointer, if an element with the passed key does not exist. */
- template< typename Type, typename KeyType >
- static const Type* getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey );
+ template< typename MapType >
+ static const typename MapType::mapped_type*
+ getMapElement( const MapType& rMap, const typename MapType::key_type& rKey );
/** Returns the pointer to an existing element of the passed map, or a null
pointer, if an element with the passed key does not exist. */
- template< typename Type, typename KeyType >
- static Type* getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey );
+ template< typename MapType >
+ static typename MapType::mapped_type*
+ getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey );
/** Returns the reference to an existing element of the passed map, or the
passed default value, if an element with the passed key does not exist. */
- template< typename Type, typename KeyType >
- static const Type& getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey, const Type& rDefault );
+ template< typename MapType >
+ static const typename MapType::mapped_type&
+ getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault );
/** Returns the reference to an existing element of the passed map, or the
passed default value, if an element with the passed key does not exist. */
- template< typename Type, typename KeyType >
- static Type& getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey, Type& rDefault );
+ template< typename MapType >
+ static typename MapType::mapped_type&
+ getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey, typename MapType::mapped_type& rDefault );
- // vector/matrix to Sequence ----------------------------------------------
+ // vector/map/matrix to UNO sequence --------------------------------------
/** Creates a UNO sequence from a std::vector with copies of all elements.
@@ -580,9 +288,20 @@ public:
@return A com.sun.star.uno.Sequence object with copies of all objects
contained in the passed vector.
*/
- template< typename Type >
- static ::com::sun::star::uno::Sequence< Type >
- vectorToSequence( const ::std::vector< Type >& rVector );
+ template< typename VectorType >
+ static ::com::sun::star::uno::Sequence< typename VectorType::value_type >
+ vectorToSequence( const VectorType& rVector );
+
+ /** Creates a UNO sequence from a std::map with copies of all elements.
+
+ @param rMap The map to be converted to a sequence.
+
+ @return A com.sun.star.uno.Sequence object with copies of all objects
+ contained in the passed map.
+ */
+ template< typename MapType >
+ static ::com::sun::star::uno::Sequence< typename MapType::mapped_type >
+ mapToSequence( const MapType& rMap );
/** Creates a UNO sequence of sequences from a matrix with copies of all elements.
@@ -592,127 +311,106 @@ public:
com.sun.star.uno.Sequence objects with copies of all objects
contained in the passed matrix.
*/
- template< typename Type >
- static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Type > >
- matrixToSequenceSequence( const Matrix< Type >& rMatrix );
+ template< typename MatrixType >
+ static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< typename MatrixType::value_type > >
+ matrixToSequenceSequence( const MatrixType& rMatrix );
};
// ----------------------------------------------------------------------------
-template< typename Type >
-const Type* ContainerHelper::getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex )
+template< typename VectorType >
+/*static*/ const typename VectorType::value_type* ContainerHelper::getVectorElement( const VectorType& rVector, sal_Int32 nIndex )
{
return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? &rVector[ static_cast< size_t >( nIndex ) ] : 0;
}
-template< typename Type >
-Type* ContainerHelper::getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex )
+template< typename VectorType >
+/*static*/ typename VectorType::value_type* ContainerHelper::getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex )
{
return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? &rVector[ static_cast< size_t >( nIndex ) ] : 0;
}
-template< typename Type >
-const Type& ContainerHelper::getVectorElement( const ::std::vector< Type >& rVector, sal_Int32 nIndex, const Type& rDefault )
+template< typename VectorType >
+/*static*/ const typename VectorType::value_type& ContainerHelper::getVectorElement( const VectorType& rVector, sal_Int32 nIndex, const typename VectorType::value_type& rDefault )
{
return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault;
}
-template< typename Type >
-Type& ContainerHelper::getVectorElement( ::std::vector< Type >& rVector, sal_Int32 nIndex, Type& rDefault )
+template< typename VectorType >
+/*static*/ typename VectorType::value_type& ContainerHelper::getVectorElementAccess( VectorType& rVector, sal_Int32 nIndex, typename VectorType::value_type& rDefault )
{
return ((0 <= nIndex) && (static_cast< size_t >( nIndex ) < rVector.size())) ? rVector[ static_cast< size_t >( nIndex ) ] : rDefault;
}
-template< typename Type, typename KeyType >
-const Type* ContainerHelper::getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey )
+template< typename MapType >
+/*static*/ const typename MapType::mapped_type* ContainerHelper::getMapElement( const MapType& rMap, const typename MapType::key_type& rKey )
{
- typename ::std::map< KeyType, Type >::const_iterator aIt = rMap.find( nKey );
+ typename MapType::const_iterator aIt = rMap.find( rKey );
return (aIt == rMap.end()) ? 0 : &aIt->second;
}
-template< typename Type, typename KeyType >
-Type* ContainerHelper::getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey )
+template< typename MapType >
+/*static*/ typename MapType::mapped_type* ContainerHelper::getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey )
{
- typename ::std::map< KeyType, Type >::iterator aIt = rMap.find( nKey );
+ typename MapType::iterator aIt = rMap.find( rKey );
return (aIt == rMap.end()) ? 0 : &aIt->second;
}
-template< typename Type, typename KeyType >
-const Type& ContainerHelper::getMapElement( const ::std::map< KeyType, Type >& rMap, KeyType nKey, const Type& rDefault )
+template< typename MapType >
+/*static*/ const typename MapType::mapped_type& ContainerHelper::getMapElement( const MapType& rMap, const typename MapType::key_type& rKey, const typename MapType::mapped_type& rDefault )
{
- typename ::std::map< KeyType, Type >::const_iterator aIt = rMap.find( nKey );
+ typename MapType::const_iterator aIt = rMap.find( rKey );
return (aIt == rMap.end()) ? rDefault : aIt->second;
}
-template< typename Type, typename KeyType >
-Type& ContainerHelper::getMapElement( ::std::map< KeyType, Type >& rMap, KeyType nKey, Type& rDefault )
+template< typename MapType >
+/*static*/ typename MapType::mapped_type& ContainerHelper::getMapElementAccess( MapType& rMap, const typename MapType::key_type& rKey, typename MapType::mapped_type& rDefault )
{
- typename ::std::map< KeyType, Type >::iterator aIt = rMap.find( nKey );
+ typename MapType::iterator aIt = rMap.find( rKey );
return (aIt == rMap.end()) ? rDefault : aIt->second;
}
-template< typename Type >
-::com::sun::star::uno::Sequence< Type > ContainerHelper::vectorToSequence( const ::std::vector< Type >& rVector )
+template< typename VectorType >
+/*static*/ ::com::sun::star::uno::Sequence< typename VectorType::value_type > ContainerHelper::vectorToSequence( const VectorType& rVector )
{
+ typedef typename VectorType::value_type ValueType;
if( rVector.empty() )
- return ::com::sun::star::uno::Sequence< Type >();
- return ::com::sun::star::uno::Sequence< Type >( &rVector.front(), static_cast< sal_Int32 >( rVector.size() ) );
+ return ::com::sun::star::uno::Sequence< ValueType >();
+ return ::com::sun::star::uno::Sequence< ValueType >( &rVector.front(), static_cast< sal_Int32 >( rVector.size() ) );
}
-template< typename Type >
-::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Type > > ContainerHelper::matrixToSequenceSequence( const Matrix< Type >& rMatrix )
+template< typename MapType >
+/*static*/ ::com::sun::star::uno::Sequence< typename MapType::mapped_type > ContainerHelper::mapToSequence( const MapType& rMap )
+{
+ typedef typename MapType::mapped_type ValueType;
+ if( rMap.empty() )
+ return ::com::sun::star::uno::Sequence< ValueType >();
+ ::com::sun::star::uno::Sequence< ValueType > aSeq( static_cast< sal_Int32 >( rMap.size() ) );
+ sal_Int32 nIndex = 0;
+ for( typename MapType::const_iterator aIt = rMap.begin(), aEnd = rMap.end(); aIt != aEnd; ++aIt, ++nIndex )
+ aSeq[ nIndex ] = *aIt;
+ return aSeq;
+}
+
+template< typename MatrixType >
+/*static*/ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< typename MatrixType::value_type > > ContainerHelper::matrixToSequenceSequence( const MatrixType& rMatrix )
{
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< Type > > aSeq;
+ typedef typename MatrixType::value_type ValueType;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ValueType > > aSeq;
if( !rMatrix.empty() )
{
aSeq.realloc( static_cast< sal_Int32 >( rMatrix.height() ) );
for( size_t nRow = 0, nHeight = rMatrix.height(); nRow < nHeight; ++nRow )
aSeq[ static_cast< sal_Int32 >( nRow ) ] =
- ::com::sun::star::uno::Sequence< Type >( &rMatrix.row_front( nRow ), static_cast< sal_Int32 >( rMatrix.width() ) );
+ ::com::sun::star::uno::Sequence< ValueType >( &rMatrix.row_front( nRow ), static_cast< sal_Int32 >( rMatrix.width() ) );
}
return aSeq;
}
// ============================================================================
-/** This helper manages named objects in a container, which is created on demand.
- */
-class ObjectContainer
-{
-public:
- explicit ObjectContainer(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
- const ::rtl::OUString& rServiceName );
- ~ObjectContainer();
-
- /** Returns true, if the object with the passed name exists in the container. */
- bool hasObject( const ::rtl::OUString& rObjName ) const;
-
- /** Returns the object with the passed name from the container. */
- ::com::sun::star::uno::Any getObject( const ::rtl::OUString& rObjName ) const;
-
- /** Inserts the passed object into the container, returns its final name. */
- ::rtl::OUString insertObject(
- const ::rtl::OUString& rObjName,
- const ::com::sun::star::uno::Any& rObj,
- bool bInsertByUnusedName );
-
-private:
- void createContainer() const;
-
-private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- mxFactory; /// Factory to create the container.
- mutable ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
- mxContainer; /// Container for the objects.
- ::rtl::OUString maServiceName; /// Service name to create the container.
- sal_Int32 mnIndex; /// Index to create unique identifiers.
-};
-
-// ============================================================================
-
} // namespace oox
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/helper/graphichelper.hxx b/oox/inc/oox/helper/graphichelper.hxx
index b6f09a25316b..78bd38566943 100644
--- a/oox/inc/oox/helper/graphichelper.hxx
+++ b/oox/inc/oox/helper/graphichelper.hxx
@@ -46,7 +46,6 @@ namespace com { namespace sun { namespace star {
namespace graphic { class XGraphic; }
namespace graphic { class XGraphicObject; }
namespace graphic { class XGraphicProvider; }
- namespace lang { class XMultiServiceFactory; }
namespace uno { class XComponentContext; }
} } }
@@ -69,7 +68,7 @@ class OOX_DLLPUBLIC GraphicHelper
{
public:
explicit GraphicHelper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxTargetFrame,
const StorageRef& rxStorage );
virtual ~GraphicHelper();
@@ -149,6 +148,10 @@ public:
@return The URL of the created and internally cached graphic object. */
::rtl::OUString importEmbeddedGraphicObject( const ::rtl::OUString& rStreamName ) const;
+ /** calculates the orignal size of a graphic which is necessary to be able to calculate cropping values
+ @return The original Graphic size in 100thmm */
+ ::com::sun::star::awt::Size getOriginalSize( const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rxGraphic ) const;
+
// ------------------------------------------------------------------------
private:
typedef ::std::map< sal_Int32, sal_Int32 > SystemPalette;
@@ -174,4 +177,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/helper/helper.hxx b/oox/inc/oox/helper/helper.hxx
index 2e34090ac7dc..687891bd36c5 100644
--- a/oox/inc/oox/helper/helper.hxx
+++ b/oox/inc/oox/helper/helper.hxx
@@ -328,4 +328,4 @@ inline void ByteOrderConverter::swap8( sal_uInt8* pnData )
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/helper/modelobjecthelper.hxx b/oox/inc/oox/helper/modelobjecthelper.hxx
index 56e98812ead0..9bac77718a58 100644
--- a/oox/inc/oox/helper/modelobjecthelper.hxx
+++ b/oox/inc/oox/helper/modelobjecthelper.hxx
@@ -30,19 +30,55 @@
#define OOX_HELPER_MODELOBJECTHELPER_HXX
#include <com/sun/star/uno/Reference.hxx>
-#include "oox/helper/containerhelper.hxx"
namespace com { namespace sun { namespace star {
- namespace lang { class XMultiServiceFactory; }
namespace awt { struct Gradient; }
+ namespace container { class XNameContainer; }
namespace drawing { struct LineDash; }
namespace drawing { struct PolyPolygonBezierCoords; }
+ namespace lang { class XMultiServiceFactory; }
} } }
namespace oox {
// ============================================================================
+/** This helper manages named objects in a container, which is created on demand.
+ */
+class ObjectContainer
+{
+public:
+ explicit ObjectContainer(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory,
+ const ::rtl::OUString& rServiceName );
+ ~ObjectContainer();
+
+ /** Returns true, if the object with the passed name exists in the container. */
+ bool hasObject( const ::rtl::OUString& rObjName ) const;
+
+ /** Returns the object with the passed name from the container. */
+ ::com::sun::star::uno::Any getObject( const ::rtl::OUString& rObjName ) const;
+
+ /** Inserts the passed object into the container, returns its final name. */
+ ::rtl::OUString insertObject(
+ const ::rtl::OUString& rObjName,
+ const ::com::sun::star::uno::Any& rObj,
+ bool bInsertByUnusedName );
+
+private:
+ void createContainer() const;
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
+ mxFactory; /// Factory to create the container.
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+ mxContainer; /// Container for the objects.
+ ::rtl::OUString maServiceName; /// Service name to create the container.
+ sal_Int32 mnIndex; /// Index to create unique identifiers.
+};
+
+// ============================================================================
+
/** Contains tables for named drawing objects for a document model.
Contains tables for named line markers, line dashes, fill gradients, and
@@ -78,13 +114,13 @@ public:
::rtl::OUString insertFillBitmap( const ::rtl::OUString& rGraphicUrl );
private:
- ObjectContainer maMarkerContainer;
- ObjectContainer maDashContainer;
- ObjectContainer maGradientContainer;
- ObjectContainer maBitmapContainer;
- const ::rtl::OUString maDashNameBase;
- const ::rtl::OUString maGradientNameBase;
- const ::rtl::OUString maBitmapNameBase;
+ ObjectContainer maMarkerContainer; /// Contains all named line markers (line end polygons).
+ ObjectContainer maDashContainer; /// Contains all named line dsahes.
+ ObjectContainer maGradientContainer; /// Contains all named fill gradients.
+ ObjectContainer maBitmapContainer; /// Contains all named fill bitmaps.
+ const ::rtl::OUString maDashNameBase; /// Base name for all named line dashes.
+ const ::rtl::OUString maGradientNameBase; /// Base name for all named fill gradients.
+ const ::rtl::OUString maBitmapNameBase; /// Base name for all named fill bitmaps.
};
// ============================================================================
@@ -93,4 +129,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/helper/progressbar.hxx b/oox/inc/oox/helper/progressbar.hxx
index 898ede10f20b..89d28962c8c7 100644
--- a/oox/inc/oox/helper/progressbar.hxx
+++ b/oox/inc/oox/helper/progressbar.hxx
@@ -144,4 +144,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/helper/propertymap.hxx b/oox/inc/oox/helper/propertymap.hxx
index 07408f71f752..31d92a14b639 100644
--- a/oox/inc/oox/helper/propertymap.hxx
+++ b/oox/inc/oox/helper/propertymap.hxx
@@ -31,9 +31,10 @@
#include <vector>
#include <map>
-#include <rtl/ustring.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
+#include <rtl/ustring.hxx>
+#include "oox/token/properties.hxx"
namespace com { namespace sun { namespace star { namespace beans {
struct PropertyValue;
@@ -42,7 +43,7 @@ namespace com { namespace sun { namespace star { namespace beans {
namespace oox {
-struct PropertyList;
+struct PropertyNameVector;
// ============================================================================
@@ -90,13 +91,8 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
makePropertySet() const;
-#if OSL_DEBUG_LEVEL > 0
- static void dump( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet);
- void dump();
-#endif
-
private:
- const PropertyList* mpPropNames;
+ const PropertyNameVector* mpPropNames;
};
// ============================================================================
@@ -105,4 +101,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/helper/propertyset.hxx b/oox/inc/oox/helper/propertyset.hxx
index 54a2a0c4f8be..55792a1bfa60 100644
--- a/oox/inc/oox/helper/propertyset.hxx
+++ b/oox/inc/oox/helper/propertyset.hxx
@@ -31,6 +31,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include "oox/token/properties.hxx"
namespace oox {
@@ -128,10 +129,6 @@ public:
@param rPropertyMap The property map. */
void setProperties( const PropertyMap& rPropertyMap );
-#if OSL_DEBUG_LEVEL > 0
- void dump();
-#endif
-
// ------------------------------------------------------------------------
private:
/** Gets the specified property from the property set.
@@ -169,4 +166,4 @@ inline void PropertySet::setProperty( sal_Int32 nPropId, const Type& rValue )
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/helper/refmap.hxx b/oox/inc/oox/helper/refmap.hxx
new file mode 100755
index 000000000000..e833e1196c81
--- /dev/null
+++ b/oox/inc/oox/helper/refmap.hxx
@@ -0,0 +1,181 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_HELPER_REFMAP_HXX
+#define OOX_HELPER_REFMAP_HXX
+
+#include <map>
+#include <boost/bind.hpp>
+#include <boost/shared_ptr.hpp>
+#include <sal/types.h>
+
+namespace oox {
+
+// ============================================================================
+
+/** Template for a map of ref-counted objects with additional accessor functions.
+
+ An instance of the class RefMap< Type > stores elements of the type
+ ::boost::shared_ptr< Type >. The new accessor functions has() and get()
+ work correctly for nonexisting keys, there is no need to check the passed
+ key before.
+ */
+template< typename KeyType, typename ObjType, typename CompType = ::std::less< KeyType > >
+class RefMap : public ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType >
+{
+public:
+ typedef ::std::map< KeyType, ::boost::shared_ptr< ObjType >, CompType > container_type;
+ typedef typename container_type::key_type key_type;
+ typedef typename container_type::mapped_type mapped_type;
+ typedef typename container_type::value_type value_type;
+ typedef typename container_type::key_compare key_compare;
+
+public:
+ /** Returns true, if the object accossiated to the passed key exists.
+ Returns false, if the key exists but points to an empty reference. */
+ inline bool has( key_type nKey ) const
+ {
+ const mapped_type* pxRef = getRef( nKey );
+ return pxRef && pxRef->get();
+ }
+
+ /** Returns a reference to the object accossiated to the passed key, or an
+ empty reference on error. */
+ inline mapped_type get( key_type nKey ) const
+ {
+ if( const mapped_type* pxRef = getRef( nKey ) ) return *pxRef;
+ return mapped_type();
+ }
+
+ /** Calls the passed functor for every contained object, automatically
+ skips all elements that are empty references. */
+ template< typename FunctorType >
+ inline void forEach( const FunctorType& rFunctor ) const
+ {
+ ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( rFunctor ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType >
+ inline void forEachMem( FuncType pFunc ) const
+ {
+ forEach( ::boost::bind( pFunc, _1 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType >
+ inline void forEachMem( FuncType pFunc, ParamType aParam ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) );
+ }
+ /** Calls the passed functor for every contained object. Passes the key as
+ first argument and the object reference as second argument to rFunctor. */
+ template< typename FunctorType >
+ inline void forEachWithKey( const FunctorType& rFunctor ) const
+ {
+ ::std::for_each( this->begin(), this->end(), ForEachFunctorWithKey< FunctorType >( rFunctor ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the object key as argument to the member function. */
+ template< typename FuncType >
+ inline void forEachMemWithKey( FuncType pFunc ) const
+ {
+ forEachWithKey( ::boost::bind( pFunc, _2, _1 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the object key as first argument to the member function. */
+ template< typename FuncType, typename ParamType >
+ inline void forEachMemWithKey( FuncType pFunc, ParamType aParam ) const
+ {
+ forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the object key as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2 >
+ inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
+ {
+ forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the object key as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMemWithKey( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEachWithKey( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) );
+ }
+
+private:
+ template< typename FunctorType >
+ struct ForEachFunctor
+ {
+ FunctorType maFunctor;
+ inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( *rValue.second ); }
+ };
+
+ template< typename FunctorType >
+ struct ForEachFunctorWithKey
+ {
+ FunctorType maFunctor;
+ inline explicit ForEachFunctorWithKey( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline void operator()( const value_type& rValue ) { if( rValue.second.get() ) maFunctor( rValue.first, *rValue.second ); }
+ };
+
+ inline const mapped_type* getRef( key_type nKey ) const
+ {
+ typename container_type::const_iterator aIt = find( nKey );
+ return (aIt == this->end()) ? 0 : &aIt->second;
+ }
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/helper/refvector.hxx b/oox/inc/oox/helper/refvector.hxx
new file mode 100755
index 000000000000..0a2d8be62e2f
--- /dev/null
+++ b/oox/inc/oox/helper/refvector.hxx
@@ -0,0 +1,201 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_HELPER_REFVECTOR_HXX
+#define OOX_HELPER_REFVECTOR_HXX
+
+#include <vector>
+#include <boost/bind.hpp>
+#include <boost/shared_ptr.hpp>
+#include <sal/types.h>
+
+namespace oox {
+
+// ============================================================================
+
+/** Template for a vector of ref-counted objects with additional accessor functions.
+
+ An instance of the class RefVector< Type > stores elements of the type
+ ::boost::shared_ptr< Type >. The new accessor functions has() and get()
+ work correctly for indexes out of the current range, there is no need to
+ check the passed index before.
+ */
+template< typename ObjType >
+class RefVector : public ::std::vector< ::boost::shared_ptr< ObjType > >
+{
+public:
+ typedef ::std::vector< ::boost::shared_ptr< ObjType > > container_type;
+ typedef typename container_type::value_type value_type;
+ typedef typename container_type::size_type size_type;
+
+public:
+ /** Returns true, if the object with the passed index exists. Returns
+ false, if the vector element exists but is an empty reference. */
+ inline bool has( sal_Int32 nIndex ) const
+ {
+ const value_type* pxRef = getRef( nIndex );
+ return pxRef && pxRef->get();
+ }
+
+ /** Returns a reference to the object with the passed index, or 0 on error. */
+ inline value_type get( sal_Int32 nIndex ) const
+ {
+ if( const value_type* pxRef = getRef( nIndex ) ) return *pxRef;
+ return value_type();
+ }
+
+ /** Returns the index of the last element, or -1, if the vector is empty.
+ Does *not* check whether the last element is an empty reference. */
+ inline sal_Int32 getLastIndex() const { return static_cast< sal_Int32 >( this->size() ) - 1; }
+
+ /** Calls the passed functor for every contained object, automatically
+ skips all elements that are empty references. */
+ template< typename FunctorType >
+ inline void forEach( FunctorType aFunctor ) const
+ {
+ ::std::for_each( this->begin(), this->end(), ForEachFunctor< FunctorType >( aFunctor ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType >
+ inline void forEachMem( FuncType pFunc ) const
+ {
+ forEach( ::boost::bind( pFunc, _1 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType >
+ inline void forEachMem( FuncType pFunc, ParamType aParam ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object,
+ automatically skips all elements that are empty references. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) );
+ }
+
+ /** Calls the passed functor for every contained object. Passes the index as
+ first argument and the object reference as second argument to rFunctor. */
+ template< typename FunctorType >
+ inline void forEachWithIndex( const FunctorType& rFunctor ) const
+ {
+ ::std::for_each( this->begin(), this->end(), ForEachFunctorWithIndex< FunctorType >( rFunctor ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index to the member function. */
+ template< typename FuncType >
+ inline void forEachMemWithIndex( FuncType pFunc ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index as first argument to the member function. */
+ template< typename FuncType, typename ParamType >
+ inline void forEachMemWithIndex( FuncType pFunc, ParamType aParam ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2 >
+ inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2 ) );
+ }
+
+ /** Calls the passed member function of ObjType on every contained object.
+ Passes the vector index as first argument to the member function. */
+ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 >
+ inline void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
+ {
+ forEachWithIndex( ::boost::bind( pFunc, _2, _1, aParam1, aParam2, aParam3 ) );
+ }
+
+ /** Searches for an element by using the passed functor that takes a
+ constant reference of the object type (const ObjType&). */
+ template< typename FunctorType >
+ inline value_type findIf( const FunctorType& rFunctor ) const
+ {
+ typename container_type::const_iterator aIt = ::std::find_if( this->begin(), this->end(), FindFunctor< FunctorType >( rFunctor ) );
+ return (aIt == this->end()) ? value_type() : *aIt;
+ }
+
+private:
+ template< typename FunctorType >
+ struct ForEachFunctor
+ {
+ FunctorType maFunctor;
+ inline explicit ForEachFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( *rxValue ); }
+ };
+
+ template< typename FunctorType >
+ struct ForEachFunctorWithIndex
+ {
+ FunctorType maFunctor;
+ sal_Int32 mnIndex;
+ inline explicit ForEachFunctorWithIndex( const FunctorType& rFunctor ) : maFunctor( rFunctor ), mnIndex( 0 ) {}
+ inline void operator()( const value_type& rxValue ) { if( rxValue.get() ) maFunctor( mnIndex, *rxValue ); ++mnIndex; }
+ };
+
+ template< typename FunctorType >
+ struct FindFunctor
+ {
+ FunctorType maFunctor;
+ inline explicit FindFunctor( const FunctorType& rFunctor ) : maFunctor( rFunctor ) {}
+ inline bool operator()( const value_type& rxValue ) { return rxValue.get() && maFunctor( *rxValue ); }
+ };
+
+ inline const value_type* getRef( sal_Int32 nIndex ) const
+ {
+ return ((0 <= nIndex) && (static_cast< size_type >( nIndex ) < this->size())) ?
+ &(*this)[ static_cast< size_type >( nIndex ) ] : 0;
+ }
+};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/helper/storagebase.hxx b/oox/inc/oox/helper/storagebase.hxx
index 84bf05e4f042..dbb929c3fdb0 100644
--- a/oox/inc/oox/helper/storagebase.hxx
+++ b/oox/inc/oox/helper/storagebase.hxx
@@ -29,8 +29,10 @@
#ifndef OOX_HELPER_STORAGEBASE_HXX
#define OOX_HELPER_STORAGEBASE_HXX
+#include <vector>
+#include <com/sun/star/uno/Reference.hxx>
+#include "oox/helper/refmap.hxx"
#include "oox/dllapi.h"
-#include "oox/helper/containerhelper.hxx"
namespace com { namespace sun { namespace star {
namespace embed { class XStorage; }
diff --git a/oox/inc/oox/helper/textinputstream.hxx b/oox/inc/oox/helper/textinputstream.hxx
index 5b1d1424cf8e..b3256bd33235 100644
--- a/oox/inc/oox/helper/textinputstream.hxx
+++ b/oox/inc/oox/helper/textinputstream.hxx
@@ -57,4 +57,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/ole/axbinaryreader.hxx b/oox/inc/oox/ole/axbinaryreader.hxx
index cf55d371bdce..811e7937d236 100644
--- a/oox/inc/oox/ole/axbinaryreader.hxx
+++ b/oox/inc/oox/ole/axbinaryreader.hxx
@@ -31,7 +31,7 @@
#include <utility>
#include "oox/helper/binaryinputstream.hxx"
-#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/refvector.hxx"
namespace oox {
namespace ole {
@@ -93,6 +93,8 @@ typedef ::std::vector< ::rtl::OUString > AxStringArray;
// ============================================================================
+const sal_Char* const AX_GUID_CFONT = "{AFC20920-DA4E-11CE-B943-00AA006887B4}";
+
const sal_uInt32 AX_FONTDATA_BOLD = 0x00000001;
const sal_uInt32 AX_FONTDATA_ITALIC = 0x00000002;
const sal_uInt32 AX_FONTDATA_UNDERLINE = 0x00000004;
@@ -112,6 +114,7 @@ struct AxFontData
sal_Int32 mnFontHeight; /// Height of the font (not really twips, see code).
sal_Int32 mnFontCharSet; /// Windows character set of the font.
sal_Int32 mnHorAlign; /// Horizontal text alignment.
+ bool mbDblUnderline; /// True = double underline style (legacy VML drawing controls only).
explicit AxFontData();
@@ -295,4 +298,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/ole/axcontrol.hxx b/oox/inc/oox/ole/axcontrol.hxx
index ae4305b5ae7a..273bacd5121a 100644
--- a/oox/inc/oox/ole/axcontrol.hxx
+++ b/oox/inc/oox/ole/axcontrol.hxx
@@ -59,6 +59,9 @@ namespace ole {
#define COMCTL_GUID_PROGRESSBAR_50 "{0713E8D2-850A-101B-AFC0-4210102A8DA7}"
#define COMCTL_GUID_PROGRESSBAR_60 "{35053A22-8589-11D1-B16A-00C0F0283628}"
+const sal_uInt16 COMCTL_VERSION_50 = 5;
+const sal_uInt16 COMCTL_VERSION_60 = 6;
+
// ----------------------------------------------------------------------------
#define AX_GUID_COMMANDBUTTON "{D7053240-CE69-11CD-A777-00DD01143C57}"
@@ -80,6 +83,28 @@ const sal_uInt32 AX_SYSCOLOR_WINDOWTEXT = 0x80000008;
const sal_uInt32 AX_SYSCOLOR_BUTTONFACE = 0x8000000F;
const sal_uInt32 AX_SYSCOLOR_BUTTONTEXT = 0x80000012;
+const sal_uInt32 AX_FLAGS_ENABLED = 0x00000002;
+const sal_uInt32 AX_FLAGS_LOCKED = 0x00000004;
+const sal_uInt32 AX_FLAGS_OPAQUE = 0x00000008;
+const sal_uInt32 AX_FLAGS_COLUMNHEADS = 0x00000400;
+const sal_uInt32 AX_FLAGS_ENTIREROWS = 0x00000800;
+const sal_uInt32 AX_FLAGS_EXISTINGENTRIES = 0x00001000;
+const sal_uInt32 AX_FLAGS_CAPTIONLEFT = 0x00002000;
+const sal_uInt32 AX_FLAGS_EDITABLE = 0x00004000;
+const sal_uInt32 AX_FLAGS_IMEMODE_MASK = 0x00078000;
+const sal_uInt32 AX_FLAGS_DRAGENABLED = 0x00080000;
+const sal_uInt32 AX_FLAGS_ENTERASNEWLINE = 0x00100000;
+const sal_uInt32 AX_FLAGS_KEEPSELECTION = 0x00200000;
+const sal_uInt32 AX_FLAGS_TABASCHARACTER = 0x00400000;
+const sal_uInt32 AX_FLAGS_WORDWRAP = 0x00800000;
+const sal_uInt32 AX_FLAGS_BORDERSSUPPRESSED = 0x02000000;
+const sal_uInt32 AX_FLAGS_SELECTLINE = 0x04000000;
+const sal_uInt32 AX_FLAGS_SINGLECHARSELECT = 0x08000000;
+const sal_uInt32 AX_FLAGS_AUTOSIZE = 0x10000000;
+const sal_uInt32 AX_FLAGS_HIDESELECTION = 0x20000000;
+const sal_uInt32 AX_FLAGS_MAXLENAUTOTAB = 0x40000000;
+const sal_uInt32 AX_FLAGS_MULTILINE = 0x80000000;
+
const sal_Int32 AX_BORDERSTYLE_NONE = 0;
const sal_Int32 AX_BORDERSTYLE_SINGLE = 1;
@@ -99,6 +124,26 @@ const sal_Int32 AX_PICALIGN_CENTER = 2;
const sal_Int32 AX_PICALIGN_BOTTOMLEFT = 3;
const sal_Int32 AX_PICALIGN_BOTTOMRIGHT = 4;
+const sal_Int32 AX_DISPLAYSTYLE_TEXT = 1;
+const sal_Int32 AX_DISPLAYSTYLE_LISTBOX = 2;
+const sal_Int32 AX_DISPLAYSTYLE_COMBOBOX = 3;
+const sal_Int32 AX_DISPLAYSTYLE_CHECKBOX = 4;
+const sal_Int32 AX_DISPLAYSTYLE_OPTBUTTON = 5;
+const sal_Int32 AX_DISPLAYSTYLE_TOGGLE = 6;
+const sal_Int32 AX_DISPLAYSTYLE_DROPDOWN = 7;
+
+const sal_Int32 AX_SELCTION_SINGLE = 0;
+const sal_Int32 AX_SELCTION_MULTI = 1;
+const sal_Int32 AX_SELCTION_EXTENDED = 2;
+
+const sal_Int32 AX_SHOWDROPBUTTON_NEVER = 0;
+const sal_Int32 AX_SHOWDROPBUTTON_FOCUS = 1;
+const sal_Int32 AX_SHOWDROPBUTTON_ALWAYS = 2;
+
+const sal_Int32 AX_SCROLLBAR_NONE = 0x00;
+const sal_Int32 AX_SCROLLBAR_HORIZONTAL = 0x01;
+const sal_Int32 AX_SCROLLBAR_VERTICAL = 0x02;
+
// ----------------------------------------------------------------------------
/** Enumerates all UNO API control types supported by these filters. */
@@ -110,6 +155,7 @@ enum ApiControlType
API_CONTROL_CHECKBOX,
API_CONTROL_RADIOBUTTON,
API_CONTROL_EDIT,
+ API_CONTROL_NUMERIC,
API_CONTROL_LISTBOX,
API_CONTROL_COMBOBOX,
API_CONTROL_SPINBUTTON,
@@ -183,6 +229,11 @@ public:
PropertyMap& rPropMap,
bool bHorizontal ) const;
+ /** Converts the vertical alignment to UNO properties. */
+ void convertVerticalAlign(
+ PropertyMap& rPropMap,
+ sal_Int32 nVerticalAlign ) const;
+
/** Converts common scrollbar settings to UNO properties. */
void convertScrollBar(
PropertyMap& rPropMap,
@@ -290,8 +341,10 @@ public:
/** Converts the control size to UNO properties. */
void convertSize( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
-protected:
+public: // direct access needed for legacy VML drawing controls
AxPairData maSize; /// Size of the control in 1/100 mm.
+
+protected:
bool mbAwtModel; /// True = AWT control model, false = form component.
};
@@ -411,8 +464,10 @@ public:
/** Returns the font height in points. */
inline sal_Int16 getFontHeight() const { return maFontData.getHeightPoints(); }
-protected:
+public: // direct access needed for legacy VML drawing controls
AxFontData maFontData; /// The font settings.
+
+private:
bool mbSupportsAlign; /// True = UNO model supports Align property.
};
@@ -431,13 +486,14 @@ public:
virtual ApiControlType getControlType() const;
virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
-private:
+public: // direct access needed for legacy VML drawing controls
StreamDataSequence maPictureData; /// Binary picture stream.
::rtl::OUString maCaption; /// Visible caption of the button.
sal_uInt32 mnTextColor; /// Text color.
sal_uInt32 mnBackColor; /// Fill color.
sal_uInt32 mnFlags; /// Various flags.
sal_uInt32 mnPicturePos; /// Position of the picture relative to text.
+ sal_Int32 mnVerticalAlign; /// Vertical alignment (legacy VML drawing controls only).
bool mbFocusOnClick; /// True = take focus on click.
};
@@ -455,7 +511,7 @@ public:
virtual ApiControlType getControlType() const;
virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
-private:
+public: // direct access needed for legacy VML drawing controls
::rtl::OUString maCaption; /// Visible caption of the button.
sal_uInt32 mnTextColor; /// Text color.
sal_uInt32 mnBackColor; /// Fill color.
@@ -463,6 +519,7 @@ private:
sal_uInt32 mnBorderColor; /// Flat border color.
sal_Int32 mnBorderStyle; /// Flat border style.
sal_Int32 mnSpecialEffect; /// 3D border effect.
+ sal_Int32 mnVerticalAlign; /// Vertical alignment (legacy VML drawing controls only).
};
// ============================================================================
@@ -505,7 +562,7 @@ public:
virtual bool importBinaryModel( BinaryInputStream& rInStrm );
virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
-protected:
+public: // direct access needed for legacy VML drawing controls
StreamDataSequence maPictureData; /// Binary picture stream.
::rtl::OUString maCaption; /// Visible caption of the button.
::rtl::OUString maValue; /// Current value of the control.
@@ -525,6 +582,7 @@ protected:
sal_Int32 mnMaxLength; /// Maximum character count.
sal_Int32 mnPasswordChar; /// Password character in edit fields.
sal_Int32 mnListRows; /// Number of rows in dropdown box.
+ sal_Int32 mnVerticalAlign; /// Vertical alignment (legacy VML drawing controls only).
};
// ============================================================================
@@ -580,6 +638,18 @@ public:
// ============================================================================
+/** Model for a numeric field (legacy drawing controls only). */
+class AxNumericFieldModel : public AxMorphDataModelBase
+{
+public:
+ explicit AxNumericFieldModel();
+
+ virtual ApiControlType getControlType() const;
+ virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
+};
+
+// ============================================================================
+
/** Model for a Forms 2.0 list box. */
class AxListBoxModel : public AxMorphDataModelBase
{
@@ -616,7 +686,7 @@ public:
virtual ApiControlType getControlType() const;
virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
-private:
+public: // direct access needed for legacy VML drawing controls
sal_uInt32 mnArrowColor; /// Button arrow color.
sal_uInt32 mnBackColor; /// Fill color.
sal_uInt32 mnFlags; /// Various flags.
@@ -642,7 +712,7 @@ public:
virtual ApiControlType getControlType() const;
virtual void convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
-private:
+public: // direct access needed for legacy VML drawing controls
sal_uInt32 mnArrowColor; /// Button arrow color.
sal_uInt32 mnBackColor; /// Fill color.
sal_uInt32 mnFlags; /// Various flags.
@@ -706,7 +776,7 @@ public:
model from the 'f' stream. */
bool importClassTable( BinaryInputStream& rInStrm, AxClassTable& orClassTable );
-protected:
+public: // direct access needed for legacy VML drawing controls
StreamDataSequence maPictureData; /// Binary picture stream.
::rtl::OUString maCaption; /// Visible caption of the form.
AxPairData maLogicalSize; /// Logical form size (scroll area).
@@ -791,14 +861,27 @@ class EmbeddedControl
{
public:
explicit EmbeddedControl( const ::rtl::OUString& rName );
- ~EmbeddedControl();
+ virtual ~EmbeddedControl();
+
+ /** Creates and returns the internal control model of the specified type. */
+ template< typename ModelType >
+ inline ModelType& createModel();
+
+ /** Creates and returns the internal control model of the specified type. */
+ template< typename ModelType, typename ParamType >
+ inline ModelType& createModel( const ParamType& rParam );
/** Creates and returns the internal control model according to the passed
MS class identifier. */
- ControlModelRef createModel( const ::rtl::OUString& rClassId );
+ ControlModelBase* createModelFromGuid( const ::rtl::OUString& rClassId );
/** Returns true, if the internal control model exists. */
inline bool hasModel() const { return mxModel.get() != 0; }
+ /** Returns read-only access to the internal control model. */
+ inline const ControlModelBase* getModel() const { return mxModel.get(); }
+ /** Returns read/write access to the internal control model. */
+ inline ControlModelBase* getModel() { return mxModel.get(); }
+
/** Returns the UNO service name needed to construct the control model. */
::rtl::OUString getServiceName() const;
@@ -812,10 +895,30 @@ private:
::rtl::OUString maName; /// Name of the control.
};
+// ----------------------------------------------------------------------------
+
+template< typename ModelType >
+inline ModelType& EmbeddedControl::createModel()
+{
+ ::boost::shared_ptr< ModelType > xModel( new ModelType );
+ mxModel = xModel;
+ xModel->setFormComponentMode();
+ return *xModel;
+}
+
+template< typename ModelType, typename ParamType >
+inline ModelType& EmbeddedControl::createModel( const ParamType& rParam )
+{
+ ::boost::shared_ptr< ModelType > xModel( new ModelType( rParam ) );
+ mxModel = xModel;
+ xModel->setFormComponentMode();
+ return *xModel;
+}
+
// ============================================================================
/** A wrapper for a control form embedded directly in a draw page. */
-class EmbeddedForm : public ControlConverter
+class EmbeddedForm
{
public:
explicit EmbeddedForm(
@@ -824,20 +927,22 @@ public:
const GraphicHelper& rGraphicHelper,
bool bDefaultColorBgr = true );
- /** Converts the passed ActiveX control and inserts it into the form.
+ /** Converts the passed control and inserts the control model into the form.
@return The API control model, if conversion was successful. */
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >
- convertAndInsert( const EmbeddedControl& rControl );
+ convertAndInsert( const EmbeddedControl& rControl, sal_Int32& rnCtrlIndex );
-private:
- /** Tries to insert the passed control model into the form. */
- bool insertControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel );
+ /** Returns the XIndexContainer interface of the UNO control form, if existing. */
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >
+ getXForm() const { return mxFormIC; }
+private:
/** Creates the form that will hold the form controls. */
::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >
- createForm();
+ createXForm();
private:
+ ControlConverter maControlConv;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxModelFactory;
::com::sun::star::uno::Reference< ::com::sun::star::form::XFormsSupplier > mxFormsSupp;
::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > mxFormIC;
diff --git a/oox/inc/oox/ole/axcontrolfragment.hxx b/oox/inc/oox/ole/axcontrolfragment.hxx
index ce9fc5436cd2..8688cabe68a9 100644
--- a/oox/inc/oox/ole/axcontrolfragment.hxx
+++ b/oox/inc/oox/ole/axcontrolfragment.hxx
@@ -80,4 +80,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/ole/olehelper.hxx b/oox/inc/oox/ole/olehelper.hxx
index 9bfd290e1211..ffaaf8328636 100644
--- a/oox/inc/oox/ole/olehelper.hxx
+++ b/oox/inc/oox/ole/olehelper.hxx
@@ -101,6 +101,10 @@ public:
sal_uInt32 nOleColor,
bool bDefaultColorBgr = true );
+ /** Returns the OLE color from the passed UNO RGB color.
+ */
+ static sal_uInt32 encodeOleColor( sal_Int32 nRgbColor );
+
/** Imports a GUID from the passed binary stream and returns its string
representation (in uppercase characters).
*/
@@ -142,4 +146,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/ole/oleobjecthelper.hxx b/oox/inc/oox/ole/oleobjecthelper.hxx
index 56f2c8b7c8c6..659e927d203b 100644
--- a/oox/inc/oox/ole/oleobjecthelper.hxx
+++ b/oox/inc/oox/ole/oleobjecthelper.hxx
@@ -33,8 +33,8 @@
namespace com { namespace sun { namespace star {
namespace awt { struct Size; }
- namespace lang { class XMultiServiceFactory; }
namespace document { class XEmbeddedObjectResolver; }
+ namespace lang { class XMultiServiceFactory; }
} } }
namespace oox { class PropertyMap; }
@@ -85,4 +85,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/ole/olestorage.hxx b/oox/inc/oox/ole/olestorage.hxx
index e76cb7e89d6b..d2c22f5aa0f6 100644
--- a/oox/inc/oox/ole/olestorage.hxx
+++ b/oox/inc/oox/ole/olestorage.hxx
@@ -32,8 +32,8 @@
#include "oox/helper/storagebase.hxx"
namespace com { namespace sun { namespace star {
- namespace lang { class XMultiServiceFactory; }
namespace container { class XNameContainer; }
+ namespace lang { class XMultiServiceFactory; }
} } }
namespace oox {
diff --git a/oox/inc/oox/ole/vbacontrol.hxx b/oox/inc/oox/ole/vbacontrol.hxx
index df25e746bc6d..11b2a0f78779 100644
--- a/oox/inc/oox/ole/vbacontrol.hxx
+++ b/oox/inc/oox/ole/vbacontrol.hxx
@@ -34,6 +34,7 @@
namespace com { namespace sun { namespace star {
namespace container { class XNameContainer; }
+ namespace uno { class XComponentContext; }
} } }
namespace oox { class StorageBase; }
@@ -188,7 +189,7 @@ class VbaUserForm : public VbaFormControl
{
public:
explicit VbaUserForm(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel,
const GraphicHelper& rGraphicHelper,
bool bDefaultColorBgr = true );
@@ -203,7 +204,7 @@ public:
rtl_TextEncoding eTextEnc );
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxGlobalFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxCompContext;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxDocModel;
ControlConverter maConverter;
};
diff --git a/oox/inc/oox/ole/vbainputstream.hxx b/oox/inc/oox/ole/vbainputstream.hxx
index 86b09efa87a6..0dc644d3bc24 100644
--- a/oox/inc/oox/ole/vbainputstream.hxx
+++ b/oox/inc/oox/ole/vbainputstream.hxx
@@ -71,4 +71,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/ole/vbamodule.hxx b/oox/inc/oox/ole/vbamodule.hxx
index 52d04c0e5d45..a0fc68a6c3f5 100644
--- a/oox/inc/oox/ole/vbamodule.hxx
+++ b/oox/inc/oox/ole/vbamodule.hxx
@@ -29,8 +29,8 @@
#ifndef OOX_OLE_VBAMODULE_HXX
#define OOX_OLE_VBAMODULE_HXX
-#include <rtl/ustring.hxx>
#include <com/sun/star/uno/Reference.hxx>
+#include <rtl/ustring.hxx>
namespace com { namespace sun { namespace star {
namespace container { class XNameAccess; }
diff --git a/oox/inc/oox/ole/vbaproject.hxx b/oox/inc/oox/ole/vbaproject.hxx
index 24863c2bd314..94af918b71e2 100644
--- a/oox/inc/oox/ole/vbaproject.hxx
+++ b/oox/inc/oox/ole/vbaproject.hxx
@@ -31,6 +31,7 @@
#include <map>
#include <com/sun/star/uno/XInterface.hpp>
+#include "oox/helper/refvector.hxx"
#include "oox/helper/storagebase.hxx"
namespace com { namespace sun { namespace star {
@@ -38,7 +39,8 @@ namespace com { namespace sun { namespace star {
namespace document { class XEventsSupplier; }
namespace frame { class XModel; }
namespace script { class XLibraryContainer; }
- namespace lang { class XMultiServiceFactory; }
+ namespace script { namespace vba { class XVBAMacroResolver; } }
+ namespace uno { class XComponentContext; }
} } }
namespace oox { class GraphicHelper; }
@@ -52,7 +54,7 @@ class VbaFilterConfig
{
public:
explicit VbaFilterConfig(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::rtl::OUString& rConfigCompName );
~VbaFilterConfig();
@@ -70,11 +72,52 @@ private:
// ============================================================================
+/** Base class for objects that attach a amcro to a specific action.
+
+ Purpose is to collect objects that need to attach a VBA macro to an action.
+ The VBA project will be loaded at a very late point of the document import
+ process, because it depends on an initialized core document model (e.g.
+ spreadsheet codenames). Some objects that want to attach a VBA macro to an
+ action (e.g. mouse click action for drawing shapes) are loaded long before
+ the VBA project. The drawback is that in most cases macros are specified
+ without module name, or the VBA project name is part of the macro name.
+ In the former case, all code modules have to be scanned for the macro to be
+ able to create a valid script URL.
+
+ The import code will register these requests to attach a VBA macro with an
+ instance of a class derived from this base class. The derived class will
+ store all information needed to finally attach the macro to the action,
+ once the VBA project has been imported.
+ */
+class VbaMacroAttacherBase
+{
+public:
+ explicit VbaMacroAttacherBase( const ::rtl::OUString& rMacroName );
+ virtual ~VbaMacroAttacherBase();
+
+ /** Resolves the internal macro name to the related macro URL, and attaches
+ the macro to the object. */
+ void resolveAndAttachMacro(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::script::vba::XVBAMacroResolver >& rxResolver );
+
+private:
+ /** Called after the VBA project has been imported. Derived classes will
+ attach the passed script to the object represented by this instance. */
+ virtual void attachMacro( const ::rtl::OUString& rScriptUrl ) = 0;
+
+private:
+ ::rtl::OUString maMacroName;
+};
+
+typedef ::boost::shared_ptr< VbaMacroAttacherBase > VbaMacroAttacherRef;
+
+// ============================================================================
+
class OOX_DLLPUBLIC VbaProject : public VbaFilterConfig
{
public:
explicit VbaProject(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel,
const ::rtl::OUString& rConfigCompName );
virtual ~VbaProject();
@@ -88,6 +131,10 @@ public:
const GraphicHelper& rGraphicHelper,
bool bDefaultColorBgr = true );
+ /** Registers a macro atatcher object. For details, see description of the
+ VbaMacroAttacherBase class. */
+ void registerMacroAttacher( const VbaMacroAttacherRef& rxAttacher );
+
/** Returns true, if the document contains at least one code module. */
bool hasModules() const;
/** Returns true, if the document contains the specified code module. */
@@ -100,6 +147,16 @@ public:
void setOleOverridesSink( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxOleOverridesSink ){ mxOleOverridesSink = rxOleOverridesSink; }
+protected:
+ /** Registers a dummy module that will be created when the VBA project is
+ imported. */
+ void addDummyModule( const ::rtl::OUString& rName, sal_Int32 nType );
+
+ /** Called when the import process of the VBA project has been started. */
+ virtual void prepareImport();
+ /** Called when the import process of the VBA project is finished. */
+ virtual void finalizeImport();
+
private:
VbaProject( const VbaProject& );
VbaProject& operator=( const VbaProject& );
@@ -116,38 +173,36 @@ private:
/** Creates and returns the dialog library of the document used for import. */
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
createDialogLibrary();
+
/** Imports the VBA code modules and forms. */
void importVba(
StorageBase& rVbaPrjStrg,
const GraphicHelper& rGraphicHelper,
bool bDefaultColorBgr );
+ /** Attaches VBA macros to objects registered via registerMacroAttacher(). */
+ void attachMacros();
+
/** Copies the entire VBA project storage to the passed document model. */
void copyStorage( StorageBase& rVbaPrjStrg );
-
-protected:
- /** Registers a dummy module that will be created when the VBA project is
- imported. */
- void addDummyModule( const ::rtl::OUString& rName, sal_Int32 nType );
-
- /** Called when the import process of the VBA code modules starts. */
- virtual void prepareModuleImport();
-
private:
- typedef ::std::map< ::rtl::OUString, sal_Int32 > DummyModuleMap;
+ typedef RefVector< VbaMacroAttacherBase > MacroAttacherVector;
+ typedef ::std::map< ::rtl::OUString, sal_Int32 > DummyModuleMap;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- mxGlobalFactory; /// Global service factory.
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ mxCompContext; /// Component context with service manager.
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
mxDocModel; /// Document model used to import/export the VBA project.
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
mxBasicLib; /// The Basic library of the document used for import.
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
mxDialogLib; /// The dialog library of the document used for import.
+ MacroAttacherVector maMacroAttachers; /// Objects that want to attach a VBA macro to an action.
+ DummyModuleMap maDummyModules; /// Additional empty modules created on import.
+ ::rtl::OUString maPrjName; /// Name of the VBA project.
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
mxOleOverridesSink;
- DummyModuleMap maDummyModules; /// Additional empty modules created on import.
::rtl::OUString maPrjName; /// Name of the VBA project.
};
diff --git a/oox/inc/oox/ole/vbaprojectfilter.hxx b/oox/inc/oox/ole/vbaprojectfilter.hxx
index c2baaf6c551b..03d49dfb71f1 100644
--- a/oox/inc/oox/ole/vbaprojectfilter.hxx
+++ b/oox/inc/oox/ole/vbaprojectfilter.hxx
@@ -40,14 +40,18 @@ class VbaProjectFilterBase : public ::oox::core::BinaryFilterBase
{
public:
explicit VbaProjectFilterBase(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::rtl::OUString& rAppName,
- const ::rtl::OUString& rStorageName );
+ const ::rtl::OUString& rStorageName )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual bool importDocument() throw();
virtual bool exportDocument() throw();
private:
+ virtual VbaProject* implCreateVbaProject() const;
+
+private:
::rtl::OUString maAppName;
::rtl::OUString maStorageName;
};
@@ -58,7 +62,8 @@ class WordVbaProjectFilter : public VbaProjectFilterBase
{
public:
explicit WordVbaProjectFilter(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
private:
virtual ::rtl::OUString implGetImplementationName() const;
diff --git a/oox/inc/oox/ppt/pptimport.hxx b/oox/inc/oox/ppt/pptimport.hxx
index 9c87c66a97e4..06f345ba0f8c 100644
--- a/oox/inc/oox/ppt/pptimport.hxx
+++ b/oox/inc/oox/ppt/pptimport.hxx
@@ -35,7 +35,6 @@
#include <oox/drawingml/theme.hxx>
#include "oox/ppt/presentationfragmenthandler.hxx"
#include "oox/ppt/slidepersist.hxx"
-#include "tokens.hxx"
#include <vector>
#include <map>
@@ -47,7 +46,8 @@ class PowerPointImport : public oox::core::XmlFilterBase
{
public:
- PowerPointImport( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr );
+ PowerPointImport( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~PowerPointImport();
// from FilterBase
@@ -76,6 +76,7 @@ public:
private:
virtual GraphicHelper* implCreateGraphicHelper() const;
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
virtual ::rtl::OUString implGetImplementationName() const;
private:
diff --git a/oox/inc/oox/ppt/pptshape.hxx b/oox/inc/oox/ppt/pptshape.hxx
index 3e1bee7c7469..104a1c210d6e 100644
--- a/oox/inc/oox/ppt/pptshape.hxx
+++ b/oox/inc/oox/ppt/pptshape.hxx
@@ -49,7 +49,7 @@ public:
using oox::drawingml::Shape::addShape;
// addShape is creating and inserting the corresponding XShape.
void addShape(
- const oox::core::XmlFilterBase& rFilterBase,
+ oox::core::XmlFilterBase& rFilterBase,
const SlidePersist& rPersist,
const oox::drawingml::Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
diff --git a/oox/inc/oox/ppt/slidepersist.hxx b/oox/inc/oox/ppt/slidepersist.hxx
index 0aa95dde5f5a..0a197e1d4135 100644
--- a/oox/inc/oox/ppt/slidepersist.hxx
+++ b/oox/inc/oox/ppt/slidepersist.hxx
@@ -29,7 +29,6 @@
#ifndef OOX_POWERPOINT_SLIDEPERSIST_HXX
#define OOX_POWERPOINT_SLIDEPERSIST_HXX
-#include "tokens.hxx"
#include <boost/shared_ptr.hpp>
#include "oox/drawingml/shape.hxx"
#include "oox/drawingml/theme.hxx"
@@ -96,6 +95,7 @@ public:
void setBackgroundProperties( const oox::drawingml::FillPropertiesPtr pFillPropertiesPtr ){ mpBackgroundPropertiesPtr = pFillPropertiesPtr; }
oox::drawingml::FillPropertiesPtr getBackgroundProperties() const { return mpBackgroundPropertiesPtr; }
+ oox::drawingml::Color& getBackgroundColorRef() { return maBackgroundColorRef; }
sal_Bool isMasterPage() const { return mbMaster; }
sal_Bool isNotesPage() const { return mbNotes; }
@@ -116,7 +116,7 @@ public:
oox::vml::Drawing* getDrawing() { return mpDrawingPtr.get(); }
- void createXShapes( const oox::core::XmlFilterBase& rFilterBase );
+ void createXShapes( oox::core::XmlFilterBase& rFilterBase );
void createBackground( const oox::core::XmlFilterBase& rFilterBase );
void applyTextStyles( const oox::core::XmlFilterBase& rFilterBase );
@@ -135,6 +135,7 @@ private:
SlidePersistPtr mpMasterPagePtr;
oox::drawingml::ShapePtr maShapesPtr;
+ oox::drawingml::Color maBackgroundColorRef;
oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr;
::std::list< boost::shared_ptr< TimeNode > > maTimeNodeList;
diff --git a/oox/inc/oox/token/namespacemap.hxx b/oox/inc/oox/token/namespacemap.hxx
new file mode 100755
index 000000000000..e4daa18f6b56
--- /dev/null
+++ b/oox/inc/oox/token/namespacemap.hxx
@@ -0,0 +1,49 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_TOKEN_NAMESPACEMAP_HXX
+#define OOX_TOKEN_NAMESPACEMAP_HXX
+
+#include <map>
+#include <rtl/instance.hxx>
+#include <rtl/ustring.hxx>
+
+namespace oox {
+
+// ============================================================================
+
+/** A map that contains all XML namespace URLs used in the filters. */
+struct NamespaceMap : public ::std::map< sal_Int32, ::rtl::OUString > { NamespaceMap(); };
+
+/** Thread-save singleton of a map of all supported XML namespace URLs. */
+struct StaticNamespaceMap : public ::rtl::Static< NamespaceMap, StaticNamespaceMap > {};
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/token/propertylist.hxx b/oox/inc/oox/token/propertynames.hxx
index 94c643b2f6b8..3beaa76ccf90 100644
--- a/oox/inc/oox/token/propertylist.hxx
+++ b/oox/inc/oox/token/propertynames.hxx
@@ -26,10 +26,11 @@
*
************************************************************************/
-#ifndef OOX_TOKEN_PROPERTYLIST_HXX
-#define OOX_TOKEN_PROPERTYLIST_HXX
+#ifndef OOX_TOKEN_PROPERTYNAMES_HXX
+#define OOX_TOKEN_PROPERTYNAMES_HXX
#include <vector>
+#include <rtl/instance.hxx>
#include <rtl/ustring.hxx>
namespace oox {
@@ -37,11 +38,10 @@ namespace oox {
// ============================================================================
/** A vector that contains all predefined property names used in the filters. */
-struct PropertyList : public ::std::vector< ::rtl::OUString >
-{
- explicit PropertyList();
- ~PropertyList();
-};
+struct PropertyNameVector : public ::std::vector< ::rtl::OUString > { PropertyNameVector(); };
+
+/** Thread-save singleton of a vector of all supported property names. */
+struct StaticPropertyNameVector : public ::rtl::Static< PropertyNameVector, StaticPropertyNameVector > {};
// ============================================================================
@@ -49,4 +49,4 @@ struct PropertyList : public ::std::vector< ::rtl::OUString >
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/token/tokenmap.hxx b/oox/inc/oox/token/tokenmap.hxx
index c7a8f42bd74a..153711195825 100644
--- a/oox/inc/oox/token/tokenmap.hxx
+++ b/oox/inc/oox/token/tokenmap.hxx
@@ -67,7 +67,6 @@ private:
typedef ::std::vector< TokenName > TokenNameVector;
TokenNameVector maTokenNames;
-
};
// ============================================================================
diff --git a/oox/inc/oox/vml/vmldrawing.hxx b/oox/inc/oox/vml/vmldrawing.hxx
index 929d77d84dea..ed01461f4e51 100644
--- a/oox/inc/oox/vml/vmldrawing.hxx
+++ b/oox/inc/oox/vml/vmldrawing.hxx
@@ -31,7 +31,7 @@
#include <map>
#include <memory>
-
+#include <vector>
#include <oox/ole/oleobjecthelper.hxx>
namespace com { namespace sun { namespace star {
@@ -39,17 +39,21 @@ namespace com { namespace sun { namespace star {
namespace awt { class XControlModel; }
namespace drawing { class XDrawPage; }
namespace drawing { class XShape; }
+ namespace drawing { class XShapes; }
} } }
-namespace oox { namespace core { class XmlFilterBase; } }
-namespace oox { namespace ole { class EmbeddedForm; } }
+namespace oox {
+ namespace core { class XmlFilterBase; }
+ namespace ole { class EmbeddedControl; }
+ namespace ole { class EmbeddedForm; }
+}
namespace oox {
namespace vml {
class ShapeBase;
class ShapeContainer;
-struct ShapeClientData;
+struct ClientData;
// ============================================================================
@@ -116,6 +120,9 @@ public:
/** Returns the form object used to process ActiveX form controls. */
::oox::ole::EmbeddedForm& getControlForm() const;
+ /** Registers a block of shape identifiers reserved by this drawing. Block
+ size is 1024, shape identifiers are one-based (block 1 => 1025-2048). */
+ void registerBlockId( sal_Int32 nBlockId );
/** Registers the passed embedded OLE object. The related shape will then
load the OLE object data from the specified fragment. */
void registerOleObject( const OleObjectInfo& rOleObject );
@@ -127,36 +134,65 @@ public:
void finalizeFragmentImport();
/** Creates and inserts all UNO shapes into the passed container. The virtual
- function notifyShapeInserted() will be called for each new shape. */
+ function notifyXShapeInserted() will be called for each new shape. */
void convertAndInsert() const;
+ /** Returns the local shape index from the passed global shape identifier. */
+ sal_Int32 getLocalShapeIndex( const ::rtl::OUString& rShapeId ) const;
/** Returns the registered info structure for an OLE object, if extant. */
const OleObjectInfo* getOleObjectInfo( const ::rtl::OUString& rShapeId ) const;
/** Returns the registered info structure for a form control, if extant. */
const ControlInfo* getControlInfo( const ::rtl::OUString& rShapeId ) const;
+ /** Creates a new UNO shape object, inserts it into the passed UNO shape
+ container, and sets the shape position and size. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ createAndInsertXShape(
+ const ::rtl::OUString& rService,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+
+ /** Creates a new UNO shape object for a form control, inserts the control
+ model into the form, and the shape into the passed UNO shape container. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ createAndInsertXControlShape(
+ const ::oox::ole::EmbeddedControl& rControl,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect,
+ sal_Int32& rnCtrlIndex ) const;
+
/** Derived classes may disable conversion of specific shapes. */
virtual bool isShapeSupported( const ShapeBase& rShape ) const;
+ /** Derived classes may return additional base names for automatic shape
+ name creation. */
+ virtual ::rtl::OUString getShapeBaseName( const ShapeBase& rShape ) const;
+
/** Derived classes may calculate the shape rectangle from a non-standard
anchor information string. */
- virtual bool convertShapeClientAnchor(
+ virtual bool convertClientAnchor(
::com::sun::star::awt::Rectangle& orShapeRect,
const ::rtl::OUString& rShapeAnchor ) const;
- /** Derived classes may convert additional form control properties from the
- passed VML shape client data. */
- virtual void convertControlClientData(
- const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel,
- const ShapeClientData& rClientData ) const;
-
- /** Derived classes may want to know that a shape has been inserted. Will
- be called from the convertAndInsert() implementation. */
- virtual void notifyShapeInserted(
+ /** Derived classes create a UNO shape according to the passed shape model.
+ Called for shape models that specify being under host control. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ createAndInsertClientXShape(
+ const ShapeBase& rShape,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
+
+ /** Derived classes may want to know that a UNO shape has been inserted.
+ Will be called from the convertAndInsert() implementation.
+ @param bGroupChild True = inserted into a group shape,
+ false = inserted directly into this drawing. */
+ virtual void notifyXShapeInserted(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
- const ::com::sun::star::awt::Rectangle& rShapeRect );
+ const ::com::sun::star::awt::Rectangle& rShapeRect,
+ const ShapeBase& rShape, bool bGroupChild );
private:
+ typedef ::std::vector< sal_Int32 > BlockIdVector;
typedef ::std::auto_ptr< ::oox::ole::EmbeddedForm > EmbeddedFormPtr;
typedef ::std::auto_ptr< ShapeContainer > ShapeContainerPtr;
typedef ::std::map< ::rtl::OUString, OleObjectInfo > OleObjectInfoMap;
@@ -165,7 +201,8 @@ private:
::oox::core::XmlFilterBase& mrFilter; /// Filter object that imports/exports the VML drawing.
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >
mxDrawPage; /// UNO draw page used to insert the shapes.
- mutable EmbeddedFormPtr mxCtrlForm; /// The control form used to process ActiveX controls.
+ mutable EmbeddedFormPtr mxCtrlForm; /// The control form used to process embedded controls.
+ mutable BlockIdVector maBlockIds; /// Block identifiers used by this drawing.
ShapeContainerPtr mxShapes; /// All shapes and shape templates.
OleObjectInfoMap maOleObjects; /// Info about all embedded OLE objects, mapped by shape id.
ControlInfoMap maControls; /// Info about all embedded form controls, mapped by control name.
@@ -179,4 +216,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/vml/vmldrawingfragment.hxx b/oox/inc/oox/vml/vmldrawingfragment.hxx
index 2b6be0eac7ff..b2b954c8c96c 100644
--- a/oox/inc/oox/vml/vmldrawingfragment.hxx
+++ b/oox/inc/oox/vml/vmldrawingfragment.hxx
@@ -65,4 +65,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/vml/vmlformatting.hxx b/oox/inc/oox/vml/vmlformatting.hxx
index 49c60d785ac3..a71539a7793d 100644
--- a/oox/inc/oox/vml/vmlformatting.hxx
+++ b/oox/inc/oox/vml/vmlformatting.hxx
@@ -35,6 +35,7 @@ namespace oox {
class GraphicHelper;
class ModelObjectHelper;
class PropertyMap;
+ namespace drawingml { class Color; }
}
namespace oox {
@@ -113,6 +114,35 @@ public:
bool bPixelX,
bool bDefaultAsPixel );
+ /** Converts VML color attributes to a DrawingML color.
+
+ @param roVmlColor The VML string representation of the color. If
+ existing, this can be a 3-digit or 6-digit hexadecimal RGB value
+ with leading '#' character, a predefined color name (e.g. 'black',
+ 'red', etc.), the index into an application defined color palette
+ in brackets with leading color name (e.g. 'red [9]' or
+ 'windowColor [64]'), or a color modifier used in one-color
+ gradients (e.g. 'fill darken(128)' or 'fill lighten(0)').
+
+ @param roVmlOpacity The opacity of the color. If existing, this should
+ be a floating-point value in the range [0.0;1.0].
+
+ @param nDefaultRgb Deafult RGB color used if the parameter roVmlColor
+ is empty.
+
+ @param nPrimaryRgb If set to something else than API_RGB_TRANSPARENT,
+ specifies the color to be used to resolve the color modifiers used
+ in one-color gradients.
+
+ @return The resulting DrawingML color.
+ */
+ static ::oox::drawingml::Color decodeColor(
+ const GraphicHelper& rGraphicHelper,
+ const OptValue< ::rtl::OUString >& roVmlColor,
+ const OptValue< double >& roVmlOpacity,
+ sal_Int32 nDefaultRgb,
+ sal_Int32 nPrimaryRgb = API_RGB_TRANSPARENT );
+
private:
ConversionHelper();
~ConversionHelper();
@@ -189,4 +219,4 @@ struct FillModel
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/vml/vmlinputstream.hxx b/oox/inc/oox/vml/vmlinputstream.hxx
index 5e3dd738c2ab..ad46888c3856 100644
--- a/oox/inc/oox/vml/vmlinputstream.hxx
+++ b/oox/inc/oox/vml/vmlinputstream.hxx
@@ -68,4 +68,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index 314800c27e43..e2ea06500683 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -46,6 +46,19 @@ namespace vml {
class Drawing;
struct ShapeParentAnchor;
class ShapeContainer;
+class TextBox;
+
+// ============================================================================
+
+const sal_Int32 VML_CLIENTDATA_UNCHECKED = 0;
+const sal_Int32 VML_CLIENTDATA_CHECKED = 1;
+const sal_Int32 VML_CLIENTDATA_MIXED = 2;
+
+const sal_Int32 VML_CLIENTDATA_TEXT = 0;
+const sal_Int32 VML_CLIENTDATA_INTEGER = 1;
+const sal_Int32 VML_CLIENTDATA_NUMBER = 2;
+const sal_Int32 VML_CLIENTDATA_REFERENCE = 3;
+const sal_Int32 VML_CLIENTDATA_FORMULA = 4;
// ============================================================================
@@ -53,7 +66,7 @@ class ShapeContainer;
struct ShapeTypeModel
{
::rtl::OUString maShapeId; /// Unique identifier of the shape.
- ::rtl::OUString maName; /// Name of the shape, if present.
+ ::rtl::OUString maShapeName; /// Name of the shape, if present.
OptValue< sal_Int32 > moShapeType; /// Builtin shape type identifier.
OptValue< Int32Pair > moCoordPos; /// Top-left position of coordinate system for children scaling.
@@ -94,6 +107,8 @@ public:
/** Returns the shape identifier (which is unique through the containing drawing). */
inline const ::rtl::OUString& getShapeId() const { return maTypeModel.maShapeId; }
+ /** Returns the application defined shape type. */
+ sal_Int32 getShapeType() const;
/** Returns the fragment path to the embedded graphic used by this shape. */
::rtl::OUString getGraphicPath() const;
@@ -117,19 +132,39 @@ protected:
// ============================================================================
/** Excel specific shape client data (such as cell anchor). */
-struct ShapeClientData
+struct ClientData
{
::rtl::OUString maAnchor; /// Cell anchor as comma-separated string.
- ::rtl::OUString maPictureLink; /// Target cell range of picture links.
- ::rtl::OUString maLinkedCell; /// Link to value cell associated to the control.
- ::rtl::OUString maSourceRange; /// Link to cell range used as data source for the control.
+ ::rtl::OUString maFmlaMacro; /// Link to macro associated to the control.
+ ::rtl::OUString maFmlaPict; /// Target cell range of picture links.
+ ::rtl::OUString maFmlaLink; /// Link to value cell associated to the control.
+ ::rtl::OUString maFmlaRange; /// Link to cell range used as data source for the control.
+ ::rtl::OUString maFmlaGroup; /// Link to value cell associated to a group of option buttons.
sal_Int32 mnObjType; /// Type of the shape.
+ sal_Int32 mnTextHAlign; /// Horizontal text alignment.
+ sal_Int32 mnTextVAlign; /// Vertical text alignment.
sal_Int32 mnCol; /// Column index for spreadsheet cell note.
sal_Int32 mnRow; /// Row index for spreadsheet cell note.
+ sal_Int32 mnChecked; /// State for checkboxes and option buttons.
+ sal_Int32 mnDropStyle; /// Drop down box style (read-only or editable).
+ sal_Int32 mnDropLines; /// Number of lines in drop down box.
+ sal_Int32 mnVal; /// Current value of spin buttons and scroll bars.
+ sal_Int32 mnMin; /// Minimum value of spin buttons and scroll bars.
+ sal_Int32 mnMax; /// Maximum value of spin buttons and scroll bars.
+ sal_Int32 mnInc; /// Small increment of spin buttons and scroll bars.
+ sal_Int32 mnPage; /// Large increment of spin buttons and scroll bars.
+ sal_Int32 mnSelType; /// Listbox selection type.
+ sal_Int32 mnVTEdit; /// Data type of the textbox.
bool mbPrintObject; /// True = print the object.
bool mbVisible; /// True = cell note is visible.
-
- explicit ShapeClientData();
+ bool mbDde; /// True = object is linked through DDE.
+ bool mbNo3D; /// True = flat style, false = 3D style.
+ bool mbNo3D2; /// True = flat style, false = 3D style (listboxes and dropdowns).
+ bool mbMultiLine; /// True = textbox allows line breaks.
+ bool mbVScroll; /// True = textbox has a vertical scrollbar.
+ bool mbSecretEdit; /// True = textbox is a password edit field.
+
+ explicit ClientData();
};
// ----------------------------------------------------------------------------
@@ -137,16 +172,21 @@ struct ShapeClientData
struct ShapeModel
{
typedef ::std::vector< ::com::sun::star::awt::Point > PointVector;
- typedef ::std::auto_ptr< ShapeClientData > ShapeClientDataPtr;
+ typedef ::std::auto_ptr< TextBox > TextBoxPtr;
+ typedef ::std::auto_ptr< ClientData > ClientDataPtr;
::rtl::OUString maType; /// Shape template with default properties.
PointVector maPoints; /// Points for the polyline shape.
- ShapeClientDataPtr mxClientData; /// Excel specific shape client data.
+ TextBoxPtr mxTextBox; /// Text contents and properties.
+ ClientDataPtr mxClientData; /// Excel specific client data.
explicit ShapeModel();
+ ~ShapeModel();
+ /** Creates and returns a new shape textbox structure. */
+ TextBox& createTextBox();
/** Creates and returns a new shape client data structure. */
- ShapeClientData& createClientData();
+ ClientData& createClientData();
};
// ----------------------------------------------------------------------------
@@ -161,9 +201,17 @@ public:
/** Returns read access to the shape model structure. */
inline const ShapeModel& getShapeModel() const { return maShapeModel; }
+ /** Returns read access to the shape textbox. */
+ inline const TextBox* getTextBox() const { return maShapeModel.mxTextBox.get(); }
+ /** Returns read access to the shape client data structure. */
+ inline const ClientData* getClientData() const { return maShapeModel.mxClientData.get(); }
+
/** Final processing after import of the drawing fragment. */
virtual void finalizeFragmentImport();
+ /** Returns the real shape name if existing, or a generated shape name. */
+ ::rtl::OUString getShapeName() const;
+
/** Returns the shape template with the passed identifier from the child shapes. */
virtual const ShapeType* getChildTypeById( const ::rtl::OUString& rShapeId ) const;
/** Returns the shape with the passed identifier from the child shapes. */
@@ -331,4 +379,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/vml/vmlshapecontainer.hxx b/oox/inc/oox/vml/vmlshapecontainer.hxx
index 2ee370473408..16e115f1d2a0 100644
--- a/oox/inc/oox/vml/vmlshapecontainer.hxx
+++ b/oox/inc/oox/vml/vmlshapecontainer.hxx
@@ -30,7 +30,8 @@
#define OOX_VML_VMLSHAPECONTAINER_HXX
#include <com/sun/star/awt/Rectangle.hpp>
-#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/refmap.hxx"
+#include "oox/helper/refvector.hxx"
namespace com { namespace sun { namespace star {
namespace drawing { class XShapes; }
@@ -60,6 +61,9 @@ public:
explicit ShapeContainer( Drawing& rDrawing );
~ShapeContainer();
+ /** Returns the drawing this shape container is part of. */
+ inline Drawing& getDrawing() { return mrDrawing; }
+
/** Creates and returns a new shape template object. */
ShapeType& createShapeType();
/** Creates and returns a new shape object of the specified type. */
@@ -140,4 +144,4 @@ const ShapeBase* ShapeContainer::findShape( const Functor& rFunctor ) const
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/vml/vmlshapecontext.hxx b/oox/inc/oox/vml/vmlshapecontext.hxx
index 101fefe39a3b..445502791a47 100644
--- a/oox/inc/oox/vml/vmlshapecontext.hxx
+++ b/oox/inc/oox/vml/vmlshapecontext.hxx
@@ -34,10 +34,12 @@
namespace oox {
namespace vml {
+class Drawing;
+
struct ShapeTypeModel;
class ShapeType;
-struct ShapeClientData;
+struct ClientData;
struct ShapeModel;
class ShapeBase;
class GroupShape;
@@ -47,20 +49,38 @@ class ShapeContainer;
// ============================================================================
-class ShapeClientDataContext : public ::oox::core::ContextHandler2
+class ShapeLayoutContext : public ::oox::core::ContextHandler2
{
public:
- explicit ShapeClientDataContext(
+ explicit ShapeLayoutContext(
::oox::core::ContextHandler2Helper& rParent,
- const AttributeList& rAttribs,
- ShapeClientData& rClientData );
+ Drawing& rDrawing );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+private:
+ Drawing& mrDrawing;
+};
+
+// ============================================================================
+
+class ClientDataContext : public ::oox::core::ContextHandler2
+{
+public:
+ explicit ClientDataContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ ClientData& rClientData,
+ const AttributeList& rAttribs );
virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
private:
- ShapeClientData& mrClientData;
+ ClientData& mrClientData;
+ ::rtl::OUString maElementText;
};
// ============================================================================
@@ -71,9 +91,9 @@ public:
static ::oox::core::ContextHandlerRef
createShapeContext(
::oox::core::ContextHandler2Helper& rParent,
+ ShapeContainer& rShapes,
sal_Int32 nElement,
- const AttributeList& rAttribs,
- ShapeContainer& rShapes );
+ const AttributeList& rAttribs );
protected:
explicit ShapeContextBase( ::oox::core::ContextHandler2Helper& rParent );
@@ -86,8 +106,8 @@ class ShapeTypeContext : public ShapeContextBase
public:
explicit ShapeTypeContext(
::oox::core::ContextHandler2Helper& rParent,
- const AttributeList& rAttribs,
- ShapeType& rShapeType );
+ ShapeType& rShapeType,
+ const AttributeList& rAttribs );
virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -110,8 +130,8 @@ class ShapeContext : public ShapeTypeContext
public:
explicit ShapeContext(
::oox::core::ContextHandler2Helper& rParent,
- const AttributeList& rAttribs,
- ShapeBase& rShape );
+ ShapeBase& rShape,
+ const AttributeList& rAttribs );
virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -134,8 +154,8 @@ class GroupShapeContext : public ShapeContext
public:
explicit GroupShapeContext(
::oox::core::ContextHandler2Helper& rParent,
- const AttributeList& rAttribs,
- GroupShape& rShape );
+ GroupShape& rShape,
+ const AttributeList& rAttribs );
virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -164,4 +184,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/vml/vmltextbox.hxx b/oox/inc/oox/vml/vmltextbox.hxx
new file mode 100755
index 000000000000..5aedaf86bc74
--- /dev/null
+++ b/oox/inc/oox/vml/vmltextbox.hxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_VML_VMLTEXTBOX_HXX
+#define OOX_VML_VMLTEXTBOX_HXX
+
+#include <vector>
+#include <rtl/ustring.hxx>
+#include "oox/helper/helper.hxx"
+
+namespace oox {
+namespace vml {
+
+// ============================================================================
+
+/** Font settings for a text portion in a textbox. */
+struct TextFontModel
+{
+ OptValue< ::rtl::OUString > moName; /// Font name.
+ OptValue< ::rtl::OUString > moColor; /// Font color, HTML encoded, sort of.
+ OptValue< sal_Int32 > monSize; /// Font size in twips.
+ OptValue< sal_Int32 > monUnderline; /// Single or double underline.
+ OptValue< sal_Int32 > monEscapement; /// Subscript or superscript.
+ OptValue< bool > mobBold;
+ OptValue< bool > mobItalic;
+ OptValue< bool > mobStrikeout;
+
+ explicit TextFontModel();
+};
+
+// ============================================================================
+
+/** A text portion in a textbox with the same formatting for all characters. */
+struct TextPortionModel
+{
+ TextFontModel maFont;
+ ::rtl::OUString maText;
+
+ explicit TextPortionModel( const TextFontModel& rFont, const ::rtl::OUString& rText );
+};
+
+// ============================================================================
+
+/** The textbox contains all text contents and properties. */
+class TextBox
+{
+public:
+ explicit TextBox();
+
+ /** Appends a new text portion to the textbox. */
+ void appendPortion( const TextFontModel& rFont, const ::rtl::OUString& rText );
+
+ /** Returns the current number of text portions. */
+ inline size_t getPortionCount() const { return maPortions.size(); }
+ /** Returns the font settings of the first text portion. */
+ const TextFontModel* getFirstFont() const;
+ /** Returns the entire text of all text portions. */
+ ::rtl::OUString getText() const;
+
+private:
+ typedef ::std::vector< TextPortionModel > PortionVector;
+
+ PortionVector maPortions;
+};
+
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/vml/vmltextboxcontext.hxx b/oox/inc/oox/vml/vmltextboxcontext.hxx
new file mode 100755
index 000000000000..1dc8832f9cc4
--- /dev/null
+++ b/oox/inc/oox/vml/vmltextboxcontext.hxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_VML_VMLTEXTBOXCONTEXT_HXX
+#define OOX_VML_VMLTEXTBOXCONTEXT_HXX
+
+#include "oox/core/contexthandler2.hxx"
+#include "oox/vml/vmltextbox.hxx"
+
+namespace oox {
+namespace vml {
+
+// ============================================================================
+
+class TextPortionContext : public ::oox::core::ContextHandler2
+{
+public:
+ explicit TextPortionContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ TextBox& rTextBox,
+ const TextFontModel& rParentFont,
+ sal_Int32 nElement,
+ const AttributeList& rAttribs );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
+
+private:
+ TextBox& mrTextBox;
+ TextFontModel maFont;
+ size_t mnInitialPortions;
+};
+
+// ============================================================================
+
+class TextBoxContext : public ::oox::core::ContextHandler2
+{
+public:
+ explicit TextBoxContext(
+ ::oox::core::ContextHandler2Helper& rParent,
+ TextBox& rTextBox,
+ const AttributeList& rAttribs );
+
+ virtual ::oox::core::ContextHandlerRef
+ onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+
+private:
+ TextBox& mrTextBox;
+};
+
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/xls/addressconverter.hxx b/oox/inc/oox/xls/addressconverter.hxx
index 6ca688ab7e08..b1d690913eeb 100644
--- a/oox/inc/oox/xls/addressconverter.hxx
+++ b/oox/inc/oox/xls/addressconverter.hxx
@@ -70,7 +70,7 @@ struct BinAddress
inline void set( sal_Int32 nCol, sal_Int32 nRow ) { mnCol = nCol; mnRow = nRow; }
inline void set( const ::com::sun::star::table::CellAddress& rAddr ) { mnCol = rAddr.Column; mnRow = rAddr.Row; }
- void read( RecordInputStream& rStrm );
+ void read( SequenceInputStream& rStrm );
void read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false );
void write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const;
};
@@ -87,7 +87,7 @@ inline bool operator<( const BinAddress& rL, const BinAddress& rR )
return (rL.mnCol < rR.mnCol) || ((rL.mnCol == rR.mnCol) && (rL.mnRow < rR.mnRow));
}
-inline RecordInputStream& operator>>( RecordInputStream& rStrm, BinAddress& orPos )
+inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, BinAddress& orPos )
{
orPos.read( rStrm );
return rStrm;
@@ -135,7 +135,7 @@ struct BinRange
inline sal_Int32 getRowCount() const { return maLast.mnRow - maFirst.mnRow + 1; }
bool contains( const BinAddress& rAddr ) const;
- void read( RecordInputStream& rStrm );
+ void read( SequenceInputStream& rStrm );
void read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false );
void write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const;
};
@@ -152,7 +152,7 @@ inline bool operator<( const BinRange& rL, const BinRange& rR )
return (rL.maFirst < rR.maFirst) || ((rL.maFirst == rR.maFirst) && (rL.maLast < rR.maLast));
}
-inline RecordInputStream& operator>>( RecordInputStream& rStrm, BinRange& orRange )
+inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, BinRange& orRange )
{
orRange.read( rStrm );
return rStrm;
@@ -180,7 +180,7 @@ public:
BinRange getEnclosingRange() const;
- void read( RecordInputStream& rStrm );
+ void read( SequenceInputStream& rStrm );
void read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false );
void write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const;
void writeSubList( BiffOutputStream& rStrm,
@@ -189,7 +189,7 @@ public:
// ----------------------------------------------------------------------------
-inline RecordInputStream& operator>>( RecordInputStream& rStrm, BinRangeList& orRanges )
+inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, BinRangeList& orRanges )
{
orRanges.read( rStrm );
return rStrm;
@@ -222,7 +222,7 @@ enum BiffTargetType
// ============================================================================
// ============================================================================
-/** Converter for cell addresses and cell ranges for OOX and BIFF filters.
+/** Converter for cell addresses and cell ranges for OOXML and BIFF filters.
*/
class AddressConverter : public WorkbookHelper
{
@@ -691,4 +691,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/autofilterbuffer.hxx b/oox/inc/oox/xls/autofilterbuffer.hxx
new file mode 100755
index 000000000000..ddf083c2ea98
--- /dev/null
+++ b/oox/inc/oox/xls/autofilterbuffer.hxx
@@ -0,0 +1,279 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_XLS_AUTOFILTERBUFFER_HXX
+#define OOX_XLS_AUTOFILTERBUFFER_HXX
+
+#include <com/sun/star/table/CellRangeAddress.hpp>
+#include "oox/helper/refvector.hxx"
+#include "oox/xls/workbookhelper.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace sheet { struct TableFilterField2; }
+ namespace sheet { class XDatabaseRange; }
+ namespace sheet { class XSheetFilterDescriptor2; }
+} } }
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+/** Contains UNO API filter settings for a column in a filtered range. */
+struct ApiFilterSettings
+{
+ typedef ::std::vector< ::com::sun::star::sheet::TableFilterField2 > FilterFieldVector;
+
+ FilterFieldVector maFilterFields; /// List of UNO API filter settings.
+ OptValue< bool > mobNeedsRegExp; /// If set, requires regular expressions to be enabled/disabled.
+
+ explicit ApiFilterSettings();
+
+ void appendField( bool bAnd, sal_Int32 nOperator, double fValue );
+ void appendField( bool bAnd, sal_Int32 nOperator, const ::rtl::OUString& rValue );
+};
+
+// ============================================================================
+
+/** Base class for specific filter settings for a column in a filtered range.
+ */
+class FilterSettingsBase : public WorkbookHelper
+{
+public:
+ explicit FilterSettingsBase( const WorkbookHelper& rHelper );
+
+ /** Derived classes import filter settings from the passed attribute list. */
+ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs );
+ /** Derived classes import filter settings from the passed record. */
+ virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ /** Derived classes import filter settings from the FILTERCOLUMN record. */
+ virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags );
+
+ /** Derived classes return converted UNO API filter settings representing all filter settings. */
+ virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount );
+};
+
+typedef ::boost::shared_ptr< FilterSettingsBase > FilterSettingsRef;
+
+// ============================================================================
+
+/** Settings for a discrete filter, specifying a list of values to be shown in
+ the filtered range.
+ */
+class DiscreteFilter : public FilterSettingsBase
+{
+public:
+ explicit DiscreteFilter( const WorkbookHelper& rHelper );
+
+ /** Imports filter settings from the filters and filter elements. */
+ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs );
+ /** Imports filter settings from the FILTERS and FILTER records. */
+ virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
+
+ /** Returns converted UNO API filter settings representing all filter settings. */
+ virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount );
+
+private:
+ typedef ::std::vector< ::rtl::OUString > FilterValueVector;
+
+ FilterValueVector maValues;
+ sal_Int32 mnCalendarType;
+ bool mbShowBlank;
+};
+
+// ============================================================================
+
+/** Settings for a top-10 filter. */
+class Top10Filter : public FilterSettingsBase
+{
+public:
+ explicit Top10Filter( const WorkbookHelper& rHelper );
+
+ /** Imports filter settings from the filters and filter elements. */
+ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs );
+ /** Imports filter settings from the FILTERS and FILTER records. */
+ virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ /** Imports filter settings from the FILTERCOLUMN record. */
+ virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags );
+
+ /** Returns converted UNO API filter settings representing all filter settings. */
+ virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount );
+
+private:
+ double mfValue; /// Number of items or percentage.
+ bool mbTop; /// True = show top (greatest) items/percentage.
+ bool mbPercent; /// True = percentage, false = number of items.
+};
+
+// ============================================================================
+
+/** A filter criterion for a custom filter. */
+struct FilterCriterionModel
+{
+ ::com::sun::star::uno::Any maValue; /// Comparison operand.
+ sal_Int32 mnOperator; /// Comparison operator.
+ sal_uInt8 mnDataType; /// Operand data type (BIFF only).
+ sal_uInt8 mnStrLen; /// Length of string operand (BIFF5-BIFF8 only).
+
+ explicit FilterCriterionModel();
+
+ /** Sets the passed BIFF operator constant. */
+ void setBiffOperator( sal_uInt8 nOperator );
+
+ /** Imports the criterion model from the passed BIFF12 stream. */
+ void readBiffData( SequenceInputStream& rStrm );
+ /** Imports the initial criterion data from the passed BIFF5/BIFF8 stream. */
+ void readBiffData( BiffInputStream& rStrm );
+ /** Imports the trailing string data from the passed BIFF5/BIFF8 stream. */
+ void readString( BiffInputStream& rStrm, BiffType eBiff, rtl_TextEncoding eTextEnc );
+};
+
+// ----------------------------------------------------------------------------
+
+/** Settings for a custom filter, specifying one or two comparison operators
+ associated with some values.
+ */
+class CustomFilter : public FilterSettingsBase
+{
+public:
+ explicit CustomFilter( const WorkbookHelper& rHelper );
+
+ /** Imports filter settings from the filters and filter elements. */
+ virtual void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs );
+ /** Imports filter settings from the FILTERS and FILTER records. */
+ virtual void importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ /** Imports filter settings from the FILTERCOLUMN record. */
+ virtual void importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags );
+
+ /** Returns converted UNO API filter settings representing all filter settings. */
+ virtual ApiFilterSettings finalizeImport( sal_Int32 nMaxCount );
+
+private:
+ /** Apeends the passed filter criteriom, if it contains valid settings. */
+ void appendCriterion( const FilterCriterionModel& rCriterion );
+
+private:
+ typedef ::std::vector< FilterCriterionModel > FilterCriterionVector;
+
+ FilterCriterionVector maCriteria;
+ bool mbAnd;
+};
+
+// ============================================================================
+
+/** A column in a filtered range. Contains an object with specific filter
+ settings for the cells in the column.
+ */
+class FilterColumn : public WorkbookHelper
+{
+public:
+ explicit FilterColumn( const WorkbookHelper& rHelper );
+
+ /** Imports auto filter column settings from the filterColumn element. */
+ void importFilterColumn( const AttributeList& rAttribs );
+ /** Imports auto filter column settings from the FILTERCOLUMN record. */
+ void importFilterColumn( SequenceInputStream& rStrm );
+ /** Imports auto filter column settings from the FILTERCOLUMN record. */
+ void importFilterColumn( BiffInputStream& rStrm );
+
+ /** Creates and returns the specified filter settings object. */
+ template< typename FilterSettingsType >
+ inline FilterSettingsBase& createFilterSettings()
+ { mxSettings.reset( new FilterSettingsType( *this ) ); return *mxSettings; }
+
+ /** Returns the index of the column in the filtered range this object is related to. */
+ inline sal_Int32 getColumnId() const { return mnColId; }
+
+ /** Returns converted UNO API filter settings representing all filter
+ settings of this column. */
+ ApiFilterSettings finalizeImport( sal_Int32 nMaxCount );
+
+private:
+ FilterSettingsRef mxSettings;
+ sal_Int32 mnColId;
+ bool mbHiddenButton;
+ bool mbShowButton;
+};
+
+// ============================================================================
+
+class AutoFilter : public WorkbookHelper
+{
+public:
+ explicit AutoFilter( const WorkbookHelper& rHelper );
+
+ /** Imports auto filter settings from the autoFilter element. */
+ void importAutoFilter( const AttributeList& rAttribs, sal_Int16 nSheet );
+ /** Imports auto filter settings from the AUTOFILTER record. */
+ void importAutoFilter( SequenceInputStream& rStrm, sal_Int16 nSheet );
+
+ /** Creates a new auto filter column and stores it internally. */
+ FilterColumn& createFilterColumn();
+
+ /** Applies the filter to the passed filter descriptor. */
+ void finalizeImport( const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor2 >& rxFilterDesc );
+
+private:
+ typedef RefVector< FilterColumn > FilterColumnVector;
+
+ FilterColumnVector maFilterColumns;
+ ::com::sun::star::table::CellRangeAddress maRange;
+};
+
+// ============================================================================
+
+class AutoFilterBuffer : public WorkbookHelper
+{
+public:
+ explicit AutoFilterBuffer( const WorkbookHelper& rHelper );
+
+ /** Creates a new auto filter and stores it internally. */
+ AutoFilter& createAutoFilter();
+
+ /** Applies filter settings to a new database range object (used for sheet
+ autofilter or advanced filter as specified by built-in defined names). */
+ void finalizeImport( sal_Int16 nSheet );
+
+ /** Applies the filters to the passed database range object.
+ @return True = this buffer contains valid auto filter settings. */
+ bool finalizeImport( const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDatabaseRange >& rxDatabaseRange );
+
+private:
+ /** Returns the auto filter object used to perform auto filtering. */
+ AutoFilter* getActiveAutoFilter();
+
+private:
+ typedef RefVector< AutoFilter > AutoFilterVector;
+ AutoFilterVector maAutoFilters;
+};
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/xls/autofiltercontext.hxx b/oox/inc/oox/xls/autofiltercontext.hxx
index 62d4b114f99c..7860f6047824 100644
--- a/oox/inc/oox/xls/autofiltercontext.hxx
+++ b/oox/inc/oox/xls/autofiltercontext.hxx
@@ -29,126 +29,82 @@
#ifndef OOX_XLS_AUTOFILTERCONTEXT_HXX
#define OOX_XLS_AUTOFILTERCONTEXT_HXX
-#define USE_SC_MULTI_STRING_FILTER_PATCH 0
-
#include "oox/xls/excelhandlers.hxx"
-#include <com/sun/star/table/CellRangeAddress.hpp>
-
-#if USE_SC_MULTI_STRING_FILTER_PATCH
-#include <com/sun/star/sheet/TableFilterFieldBase.hpp>
-#else
-#include <com/sun/star/sheet/TableFilterField.hpp>
-#endif
-
-#include <boost/shared_ptr.hpp>
-#include <list>
-
-namespace com { namespace sun { namespace star { namespace sheet {
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- struct TableFilterFieldBase;
-#else
- struct TableFilterField;
-#endif
- struct TableFilterFieldMultiString;
-}}}}
namespace oox {
namespace xls {
+class AutoFilter;
+class FilterColumn;
+class FilterSettingsBase;
+
// ============================================================================
-struct FilterFieldItem
+class FilterSettingsContext : public WorksheetContextBase
{
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- typedef ::boost::shared_ptr< ::com::sun::star::sheet::TableFilterFieldBase > TableFilterFieldRef;
-#else
- typedef ::boost::shared_ptr< ::com::sun::star::sheet::TableFilterField > TableFilterFieldRef;
-#endif
+public:
+ explicit FilterSettingsContext( WorksheetContextBase& rParent, FilterSettingsBase& rFilterSettings );
- enum Type { NORMAL, MULTI_STRING };
+protected:
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onStartElement( const AttributeList& rAttribs );
- TableFilterFieldRef mpField;
- Type meType;
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
- FilterFieldItem();
- FilterFieldItem(Type eType);
+private:
+ FilterSettingsBase& mrFilterSettings;
};
// ============================================================================
-class OoxAutoFilterContext : public OoxWorksheetContextBase
+class FilterColumnContext : public WorksheetContextBase
{
public:
- explicit OoxAutoFilterContext( OoxWorksheetFragmentBase& rFragment );
+ explicit FilterColumnContext( WorksheetContextBase& rParent, FilterColumn& rFilterColumn );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
-
-private:
- /** Initializes data members to prepare for autofilter parsing. Call this
- method when a new autofilter context starts. */
- void initialize();
-
- /** Commits the imported autofilter data to Calc. */
- void setAutoFilter();
-
- /** Check if the shown blank bit is on, if so, add show blank filter to the
- list. */
- void maybeShowBlank();
-
- /** Packs the collected filter names into a single regex string. */
- void setFilterNames();
- void importAutoFilter( const AttributeList& rAttribs );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
- void importFilterColumn( const AttributeList& rAttribs );
-
- void importTop10( const AttributeList& rAttribs );
-
- /** Be sure to check for its 'and' attribute when there are two
- customFilter's. If the attribute is not given, assume OR. */
- void importCustomFilters( const AttributeList& rAttribs );
+private:
+ FilterColumn& mrFilterColumn;
+};
- /** Imports custumFilter element. Note that the standard specifies there
- can be at most two custom filters specified, but no more than two. When
- there are two custom filters, then their relationship (AND or OR) must
- be specified by the parent element <customFilters>. */
- void importCustomFilter( const AttributeList& rAttribs );
+// ============================================================================
- void importFilters( const AttributeList& rAttribs );
+class AutoFilterContext : public WorksheetContextBase
+{
+public:
+ explicit AutoFilterContext( WorksheetFragmentBase& rFragment, AutoFilter& rAutoFilter );
- void importFilter( const AttributeList& rAttribs );
+protected:
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onStartElement( const AttributeList& rAttribs );
- void importDynamicFilter( const AttributeList& rAttribs );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
private:
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::table::XCell > XCellRef;
-
- ::std::list< FilterFieldItem > maFields;
-
- ::std::list< ::rtl::OUString > maFilterNames;
- ::com::sun::star::table::CellRangeAddress maAutoFilterRange;
- sal_Int32 mnCurColID;
+ AutoFilter& mrAutoFilter;
+};
- /** If this is false (i.e. the given cell range address is not valid), then
- don't do anything. */
- bool mbValidAddress:1;
+// ============================================================================
- /** We use regex to compensate for Calc's lack of filtering by individual
- names (i.e. <filter> tag). */
- bool mbUseRegex:1;
+class BiffAutoFilterContext : public BiffWorksheetContextBase
+{
+public:
+ explicit BiffAutoFilterContext( const WorksheetHelper& rHelper, AutoFilter& rAutoFilter );
- /** The <filters> tag may have a 'blank' attribute when the blank values
- need to be shown. This flag stores that information. */
- bool mbShowBlank:1;
+protected:
+ /** Imports all records related to the current auto filter. */
+ virtual void importRecord( BiffInputStream& rStrm );
- /** true if FilterConnection_AND, or false if FilterConnection_OR. This
- flag is used to store the relationship of paired customFilter's. */
- bool mbConnectionAnd:1;
+private:
+ AutoFilter& mrAutoFilter;
};
// ============================================================================
diff --git a/oox/inc/oox/xls/biffcodec.hxx b/oox/inc/oox/xls/biffcodec.hxx
index d35c2267f910..69527f0cb454 100644
--- a/oox/inc/oox/xls/biffcodec.hxx
+++ b/oox/inc/oox/xls/biffcodec.hxx
@@ -53,10 +53,9 @@ public:
/** Derived classes return a clone of the decoder for usage in new streams. */
inline BiffDecoderBase* clone() { return implClone(); }
- /** Implementation of the ::comphelper::IDocPasswordVerifier interface,
- calls the new virtual function implVerify(). */
- virtual ::comphelper::DocPasswordVerifierResult
- verifyPassword( const ::rtl::OUString& rPassword );
+ /** Implementation of the ::comphelper::IDocPasswordVerifier interface. */
+ virtual ::comphelper::DocPasswordVerifierResult verifyPassword( const ::rtl::OUString& rPassword, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData );
+ virtual ::comphelper::DocPasswordVerifierResult verifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& o_rEncryptionData );
/** Returns true, if the decoder has been initialized correctly. */
inline bool isValid() const { return mbValid; }
@@ -74,7 +73,8 @@ private:
/** Derived classes implement password verification and initialization of
the decoder. */
- virtual bool implVerify( const ::rtl::OUString& rPassword ) = 0;
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > implVerifyPassword( const ::rtl::OUString& rPassword ) = 0;
+ virtual bool implVerifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData ) = 0;
/** Implementation of decryption of a memory block. */
virtual void implDecode(
@@ -105,7 +105,9 @@ private:
virtual BiffDecoder_XOR* implClone();
/** Implements password verification and initialization of the decoder. */
- virtual bool implVerify( const ::rtl::OUString& rPassword );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > implVerifyPassword( const ::rtl::OUString& rPassword );
+ virtual bool implVerifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData );
+
/** Implementation of decryption of a memory block. */
virtual void implDecode(
@@ -116,7 +118,7 @@ private:
private:
::oox::core::BinaryCodec_XOR maCodec; /// Cipher algorithm implementation.
- ::std::vector< sal_uInt8 > maPassword;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > maEncryptionData;
sal_uInt16 mnKey;
sal_uInt16 mnHash;
};
@@ -140,7 +142,8 @@ private:
virtual BiffDecoder_RCF* implClone();
/** Implements password verification and initialization of the decoder. */
- virtual bool implVerify( const ::rtl::OUString& rPassword );
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > implVerifyPassword( const ::rtl::OUString& rPassword );
+ virtual bool implVerifyEncryptionData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rEncryptionData );
/** Implementation of decryption of a memory block. */
virtual void implDecode(
@@ -151,7 +154,7 @@ private:
private:
::oox::core::BinaryCodec_RCF maCodec; /// Cipher algorithm implementation.
- ::std::vector< sal_uInt16 > maPassword;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > maEncryptionData;
::std::vector< sal_uInt8 > maSalt;
::std::vector< sal_uInt8 > maVerifier;
::std::vector< sal_uInt8 > maVerifierHash;
@@ -184,4 +187,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/biffdetector.hxx b/oox/inc/oox/xls/biffdetector.hxx
index 8b9e8b59dca3..93d7338f4847 100644
--- a/oox/inc/oox/xls/biffdetector.hxx
+++ b/oox/inc/oox/xls/biffdetector.hxx
@@ -29,15 +29,15 @@
#ifndef OOX_XLS_BIFFDETECTOR_HXX
#define OOX_XLS_BIFFDETECTOR_HXX
-#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/document/XExtendedFilterDetection.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase2.hxx>
#include "oox/helper/storagebase.hxx"
#include "oox/xls/biffhelper.hxx"
namespace com { namespace sun { namespace star {
- namespace lang { class XMultiServiceFactory; }
namespace beans { struct PropertyValue; }
+ namespace uno { class XComponentContext; }
} } }
namespace oox { class BinaryInputStream; }
@@ -54,7 +54,8 @@ class BiffDetector : public ::cppu::WeakImplHelper2<
{
public:
explicit BiffDetector(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~BiffDetector();
@@ -64,7 +65,7 @@ public:
/** Detects the BIFF version and workbook stream name of the passed storage. */
static BiffType detectStorageBiffVersion(
::rtl::OUString& orWorkbookStreamName,
- StorageRef xStorage );
+ const StorageRef& rxStorage );
// com.sun.star.lang.XServiceInfo interface -------------------------------
@@ -85,8 +86,8 @@ public:
throw( ::com::sun::star::uno::RuntimeException );
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- mxFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ mxContext;
};
// ============================================================================
@@ -96,4 +97,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/biffhelper.hxx b/oox/inc/oox/xls/biffhelper.hxx
index 818186d4a004..328cde3f0c32 100644
--- a/oox/inc/oox/xls/biffhelper.hxx
+++ b/oox/inc/oox/xls/biffhelper.hxx
@@ -31,217 +31,229 @@
#include "oox/helper/binarystreambase.hxx"
+namespace oox { class SequenceInputStream; }
+
namespace oox {
namespace xls {
class BiffInputStream;
-// OOBIN record identifiers ===================================================
-
-const sal_Int32 OOBIN_ID_ARRAY = 0x01AA;
-const sal_Int32 OOBIN_ID_AUTOFILTER = 0x00A1;
-const sal_Int32 OOBIN_ID_AUTOSORTSCOPE = 0x01CB;
-const sal_Int32 OOBIN_ID_BINARYINDEXBLOCK = 0x002A;
-const sal_Int32 OOBIN_ID_BINARYINDEXROWS = 0x0028;
-const sal_Int32 OOBIN_ID_BOOKVIEWS = 0x0087;
-const sal_Int32 OOBIN_ID_BORDER = 0x002E;
-const sal_Int32 OOBIN_ID_BORDERS = 0x0265;
-const sal_Int32 OOBIN_ID_BRK = 0x018C;
-const sal_Int32 OOBIN_ID_CALCPR = 0x009D;
-const sal_Int32 OOBIN_ID_CELL_BLANK = 0x0001;
-const sal_Int32 OOBIN_ID_CELL_BOOL = 0x0004;
-const sal_Int32 OOBIN_ID_CELL_DOUBLE = 0x0005;
-const sal_Int32 OOBIN_ID_CELL_ERROR = 0x0003;
-const sal_Int32 OOBIN_ID_CELL_RK = 0x0002;
-const sal_Int32 OOBIN_ID_CELL_RSTRING = 0x003E;
-const sal_Int32 OOBIN_ID_CELL_SI = 0x0007;
-const sal_Int32 OOBIN_ID_CELL_STRING = 0x0006;
-const sal_Int32 OOBIN_ID_CELLSTYLE = 0x0030;
-const sal_Int32 OOBIN_ID_CELLSTYLES = 0x026B;
-const sal_Int32 OOBIN_ID_CELLSTYLEXFS = 0x0272;
-const sal_Int32 OOBIN_ID_CELLXFS = 0x0269;
-const sal_Int32 OOBIN_ID_CFCOLOR = 0x0234;
-const sal_Int32 OOBIN_ID_CFRULE = 0x01CF;
-const sal_Int32 OOBIN_ID_CHARTPAGESETUP = 0x028C;
-const sal_Int32 OOBIN_ID_CHARTPROTECTION = 0x029D;
-const sal_Int32 OOBIN_ID_CHARTSHEETPR = 0x028B;
-const sal_Int32 OOBIN_ID_CHARTSHEETVIEW = 0x008D;
-const sal_Int32 OOBIN_ID_CHARTSHEETVIEWS = 0x008B;
-const sal_Int32 OOBIN_ID_COL = 0x003C;
-const sal_Int32 OOBIN_ID_COLBREAKS = 0x018A;
-const sal_Int32 OOBIN_ID_COLOR = 0x023C;
-const sal_Int32 OOBIN_ID_COLORS = 0x01D9;
-const sal_Int32 OOBIN_ID_COLORSCALE = 0x01D5;
-const sal_Int32 OOBIN_ID_COLS = 0x0186;
-const sal_Int32 OOBIN_ID_COMMENT = 0x027B;
-const sal_Int32 OOBIN_ID_COMMENTAUTHOR = 0x0278;
-const sal_Int32 OOBIN_ID_COMMENTAUTHORS = 0x0276;
-const sal_Int32 OOBIN_ID_COMMENTLIST = 0x0279;
-const sal_Int32 OOBIN_ID_COMMENTS = 0x0274;
-const sal_Int32 OOBIN_ID_COMMENTTEXT = 0x027D;
-const sal_Int32 OOBIN_ID_CONDFORMATTING = 0x01CD;
-const sal_Int32 OOBIN_ID_CONTROL = 0x0284;
-const sal_Int32 OOBIN_ID_CONTROLS = 0x0283;
-const sal_Int32 OOBIN_ID_CUSTOMCHARTVIEW = 0x028F;
-const sal_Int32 OOBIN_ID_CUSTOMCHARTVIEWS = 0x028D;
-const sal_Int32 OOBIN_ID_CUSTOMSHEETVIEW = 0x01A7;
-const sal_Int32 OOBIN_ID_CUSTOMSHEETVIEWS = 0x01A6;
-const sal_Int32 OOBIN_ID_CUSTOMWORKBOOKVIEW = 0x018D;
-const sal_Int32 OOBIN_ID_DATABAR = 0x01D3;
-const sal_Int32 OOBIN_ID_DATATABLE = 0x01AC;
-const sal_Int32 OOBIN_ID_DATAVALIDATION = 0x0040;
-const sal_Int32 OOBIN_ID_DATAVALIDATIONS = 0x023D;
-const sal_Int32 OOBIN_ID_DDEITEMVALUES = 0x0242;
-const sal_Int32 OOBIN_ID_DDEITEM_BOOL = 0x0248;
-const sal_Int32 OOBIN_ID_DDEITEM_DOUBLE = 0x0244;
-const sal_Int32 OOBIN_ID_DDEITEM_ERROR = 0x0245;
-const sal_Int32 OOBIN_ID_DDEITEM_STRING = 0x0246;
-const sal_Int32 OOBIN_ID_DEFINEDNAME = 0x0027;
-const sal_Int32 OOBIN_ID_DIMENSION = 0x0094;
-const sal_Int32 OOBIN_ID_DRAWING = 0x0226;
-const sal_Int32 OOBIN_ID_DXF = 0x01FB;
-const sal_Int32 OOBIN_ID_DXFS = 0x01F9;
-const sal_Int32 OOBIN_ID_EXTCELL_BLANK = 0x016F;
-const sal_Int32 OOBIN_ID_EXTCELL_BOOL = 0x0171;
-const sal_Int32 OOBIN_ID_EXTCELL_DOUBLE = 0x0170;
-const sal_Int32 OOBIN_ID_EXTCELL_ERROR = 0x0172;
-const sal_Int32 OOBIN_ID_EXTCELL_STRING = 0x0173;
-const sal_Int32 OOBIN_ID_EXTERNALADDIN = 0x029B;
-const sal_Int32 OOBIN_ID_EXTERNALBOOK = 0x0168;
-const sal_Int32 OOBIN_ID_EXTERNALNAME = 0x0241;
-const sal_Int32 OOBIN_ID_EXTERNALREF = 0x0163;
-const sal_Int32 OOBIN_ID_EXTERNALREFS = 0x0161;
-const sal_Int32 OOBIN_ID_EXTERNALSELF = 0x0165;
-const sal_Int32 OOBIN_ID_EXTERNALSAME = 0x0166;
-const sal_Int32 OOBIN_ID_EXTERNALSHEETS = 0x016A;
-const sal_Int32 OOBIN_ID_EXTROW = 0x016E;
-const sal_Int32 OOBIN_ID_EXTSHEETDATA = 0x016B;
-const sal_Int32 OOBIN_ID_EXTERNALNAMEFLAGS = 0x024A;
-const sal_Int32 OOBIN_ID_EXTSHEETNAMES = 0x0167;
-const sal_Int32 OOBIN_ID_FILESHARING = 0x0224;
-const sal_Int32 OOBIN_ID_FILEVERSION = 0x0080;
-const sal_Int32 OOBIN_ID_FILL = 0x002D;
-const sal_Int32 OOBIN_ID_FILLS = 0x025B;
-const sal_Int32 OOBIN_ID_FILTERCOLUMN = 0x00A3;
-const sal_Int32 OOBIN_ID_FONT = 0x002B;
-const sal_Int32 OOBIN_ID_FONTS = 0x0263;
-const sal_Int32 OOBIN_ID_FORMULA_STRING = 0x0008;
-const sal_Int32 OOBIN_ID_FORMULA_DOUBLE = 0x0009;
-const sal_Int32 OOBIN_ID_FORMULA_BOOL = 0x000A;
-const sal_Int32 OOBIN_ID_FORMULA_ERROR = 0x000B;
-const sal_Int32 OOBIN_ID_FUNCTIONGROUP = 0x0299;
-const sal_Int32 OOBIN_ID_FUNCTIONGROUPS = 0x0298;
-const sal_Int32 OOBIN_ID_HEADERFOOTER = 0x01DF;
-const sal_Int32 OOBIN_ID_HYPERLINK = 0x01EE;
-const sal_Int32 OOBIN_ID_ICONSET = 0x01D1;
-const sal_Int32 OOBIN_ID_INDEXEDCOLORS = 0x0235;
-const sal_Int32 OOBIN_ID_INPUTCELLS = 0x01F8;
-const sal_Int32 OOBIN_ID_LEGACYDRAWING = 0x0227;
-const sal_Int32 OOBIN_ID_MERGECELL = 0x00B0;
-const sal_Int32 OOBIN_ID_MERGECELLS = 0x00B1;
-const sal_Int32 OOBIN_ID_MRUCOLORS = 0x0239;
-const sal_Int32 OOBIN_ID_MULTCELL_BLANK = 0x000C;
-const sal_Int32 OOBIN_ID_MULTCELL_BOOL = 0x000F;
-const sal_Int32 OOBIN_ID_MULTCELL_DOUBLE = 0x0010;
-const sal_Int32 OOBIN_ID_MULTCELL_ERROR = 0x000E;
-const sal_Int32 OOBIN_ID_MULTCELL_RK = 0x000D;
-const sal_Int32 OOBIN_ID_MULTCELL_RSTRING = 0x003D;
-const sal_Int32 OOBIN_ID_MULTCELL_SI = 0x0012;
-const sal_Int32 OOBIN_ID_MULTCELL_STRING = 0x0011;
-const sal_Int32 OOBIN_ID_NUMFMT = 0x002C;
-const sal_Int32 OOBIN_ID_NUMFMTS = 0x0267;
-const sal_Int32 OOBIN_ID_OLEOBJECT = 0x027F;
-const sal_Int32 OOBIN_ID_OLEOBJECTS = 0x027E;
-const sal_Int32 OOBIN_ID_OLESIZE = 0x0225;
-const sal_Int32 OOBIN_ID_PAGEMARGINS = 0x01DC;
-const sal_Int32 OOBIN_ID_PAGESETUP = 0x01DE;
-const sal_Int32 OOBIN_ID_PANE = 0x0097;
-const sal_Int32 OOBIN_ID_PCDEFINITION = 0x00B3;
-const sal_Int32 OOBIN_ID_PCDFDISCRETEPR = 0x00E1;
-const sal_Int32 OOBIN_ID_PCDFGROUPITEMS = 0x00DD;
-const sal_Int32 OOBIN_ID_PCDFIELD = 0x00B7;
-const sal_Int32 OOBIN_ID_PCDFIELDGROUP = 0x00DB;
-const sal_Int32 OOBIN_ID_PCDFIELDS = 0x00B5;
-const sal_Int32 OOBIN_ID_PCDFRANGEPR = 0x00DF;
-const sal_Int32 OOBIN_ID_PCDFSHAREDITEMS = 0x00BD;
-const sal_Int32 OOBIN_ID_PCDSHEETSOURCE = 0x00BB;
-const sal_Int32 OOBIN_ID_PCDSOURCE = 0x00B9;
-const sal_Int32 OOBIN_ID_PCITEM_ARRAY = 0x00BF;
-const sal_Int32 OOBIN_ID_PCITEM_BOOL = 0x0016;
-const sal_Int32 OOBIN_ID_PCITEM_DATE = 0x0019;
-const sal_Int32 OOBIN_ID_PCITEM_DOUBLE = 0x0015;
-const sal_Int32 OOBIN_ID_PCITEM_ERROR = 0x0017;
-const sal_Int32 OOBIN_ID_PCITEM_INDEX = 0x001A;
-const sal_Int32 OOBIN_ID_PCITEM_MISSING = 0x0014;
-const sal_Int32 OOBIN_ID_PCITEM_STRING = 0x0018;
-const sal_Int32 OOBIN_ID_PCITEMA_BOOL = 0x001D;
-const sal_Int32 OOBIN_ID_PCITEMA_DATE = 0x0020;
-const sal_Int32 OOBIN_ID_PCITEMA_DOUBLE = 0x001C;
-const sal_Int32 OOBIN_ID_PCITEMA_ERROR = 0x001E;
-const sal_Int32 OOBIN_ID_PCITEMA_MISSING = 0x001B;
-const sal_Int32 OOBIN_ID_PCITEMA_STRING = 0x001F;
-const sal_Int32 OOBIN_ID_PCRECORD = 0x0021;
-const sal_Int32 OOBIN_ID_PCRECORDDT = 0x0022;
-const sal_Int32 OOBIN_ID_PCRECORDS = 0x00C1;
-const sal_Int32 OOBIN_ID_PHONETICPR = 0x0219;
-const sal_Int32 OOBIN_ID_PICTURE = 0x0232;
-const sal_Int32 OOBIN_ID_PIVOTAREA = 0x00F7;
-const sal_Int32 OOBIN_ID_PIVOTCACHE = 0x0182;
-const sal_Int32 OOBIN_ID_PIVOTCACHES = 0x0180;
-const sal_Int32 OOBIN_ID_PRINTOPTIONS = 0x01DD;
-const sal_Int32 OOBIN_ID_PTCOLFIELDS = 0x0137;
-const sal_Int32 OOBIN_ID_PTDATAFIELD = 0x0125;
-const sal_Int32 OOBIN_ID_PTDATAFIELDS = 0x0127;
-const sal_Int32 OOBIN_ID_PTDEFINITION = 0x0118;
-const sal_Int32 OOBIN_ID_PTFIELD = 0x011D;
-const sal_Int32 OOBIN_ID_PTFIELDS = 0x011F;
-const sal_Int32 OOBIN_ID_PTFILTER = 0x0259;
-const sal_Int32 OOBIN_ID_PTFILTERS = 0x0257;
-const sal_Int32 OOBIN_ID_PTFITEM = 0x011A;
-const sal_Int32 OOBIN_ID_PTFITEMS = 0x011B;
-const sal_Int32 OOBIN_ID_PTLOCATION = 0x013A;
-const sal_Int32 OOBIN_ID_PTPAGEFIELD = 0x0121;
-const sal_Int32 OOBIN_ID_PTPAGEFIELDS = 0x0123;
-const sal_Int32 OOBIN_ID_PTREFERENCE = 0x00FB;
-const sal_Int32 OOBIN_ID_PTREFERENCEITEM = 0x017E;
-const sal_Int32 OOBIN_ID_PTREFERENCES = 0x00F9;
-const sal_Int32 OOBIN_ID_PTROWFIELDS = 0x0135;
-const sal_Int32 OOBIN_ID_RGBCOLOR = 0x01DB;
-const sal_Int32 OOBIN_ID_ROW = 0x0000;
-const sal_Int32 OOBIN_ID_ROWBREAKS = 0x0188;
-const sal_Int32 OOBIN_ID_SCENARIO = 0x01F6;
-const sal_Int32 OOBIN_ID_SCENARIOS = 0x01F4;
-const sal_Int32 OOBIN_ID_SELECTION = 0x0098;
-const sal_Int32 OOBIN_ID_SHAREDFMLA = 0x01AB;
-const sal_Int32 OOBIN_ID_SHEET = 0x009C;
-const sal_Int32 OOBIN_ID_SHEETDATA = 0x0091;
-const sal_Int32 OOBIN_ID_SHEETFORMATPR = 0x01E5;
-const sal_Int32 OOBIN_ID_SHEETPR = 0x0093;
-const sal_Int32 OOBIN_ID_SHEETPROTECTION = 0x0217;
-const sal_Int32 OOBIN_ID_SHEETS = 0x008F;
-const sal_Int32 OOBIN_ID_SHEETVIEW = 0x0089;
-const sal_Int32 OOBIN_ID_SHEETVIEWS = 0x0085;
-const sal_Int32 OOBIN_ID_SI = 0x0013;
-const sal_Int32 OOBIN_ID_SST = 0x009F;
-const sal_Int32 OOBIN_ID_STYLESHEET = 0x0116;
-const sal_Int32 OOBIN_ID_TABLE = 0x0157;
-const sal_Int32 OOBIN_ID_TABLEPART = 0x0295;
-const sal_Int32 OOBIN_ID_TABLEPARTS = 0x0294;
-const sal_Int32 OOBIN_ID_TABLESTYLEINFO = 0x0201;
-const sal_Int32 OOBIN_ID_TABLESTYLES = 0x01FC;
-const sal_Int32 OOBIN_ID_TOP10FILTER = 0x00AA;
-const sal_Int32 OOBIN_ID_VOLTYPE = 0x0204;
-const sal_Int32 OOBIN_ID_VOLTYPEMAIN = 0x0206;
-const sal_Int32 OOBIN_ID_VOLTYPES = 0x0202;
-const sal_Int32 OOBIN_ID_VOLTYPESTP = 0x020A;
-const sal_Int32 OOBIN_ID_VOLTYPETR = 0x020B;
-const sal_Int32 OOBIN_ID_WORKBOOK = 0x0083;
-const sal_Int32 OOBIN_ID_WORKBOOKPR = 0x0099;
-const sal_Int32 OOBIN_ID_WORKBOOKVIEW = 0x009E;
-const sal_Int32 OOBIN_ID_WORKSHEET = 0x0081;
-const sal_Int32 OOBIN_ID_XF = 0x002F;
+// BIFF12 record identifiers ==================================================
-// ============================================================================
+const sal_Int32 BIFF12_ID_ARRAY = 0x01AA;
+const sal_Int32 BIFF12_ID_AUTOFILTER = 0x00A1;
+const sal_Int32 BIFF12_ID_AUTOSORTSCOPE = 0x01CB;
+const sal_Int32 BIFF12_ID_BINARYINDEXBLOCK = 0x002A;
+const sal_Int32 BIFF12_ID_BINARYINDEXROWS = 0x0028;
+const sal_Int32 BIFF12_ID_BOOKVIEWS = 0x0087;
+const sal_Int32 BIFF12_ID_BORDER = 0x002E;
+const sal_Int32 BIFF12_ID_BORDERS = 0x0265;
+const sal_Int32 BIFF12_ID_BRK = 0x018C;
+const sal_Int32 BIFF12_ID_CALCPR = 0x009D;
+const sal_Int32 BIFF12_ID_CELL_BLANK = 0x0001;
+const sal_Int32 BIFF12_ID_CELL_BOOL = 0x0004;
+const sal_Int32 BIFF12_ID_CELL_DOUBLE = 0x0005;
+const sal_Int32 BIFF12_ID_CELL_ERROR = 0x0003;
+const sal_Int32 BIFF12_ID_CELL_RK = 0x0002;
+const sal_Int32 BIFF12_ID_CELL_RSTRING = 0x003E;
+const sal_Int32 BIFF12_ID_CELL_SI = 0x0007;
+const sal_Int32 BIFF12_ID_CELL_STRING = 0x0006;
+const sal_Int32 BIFF12_ID_CELLSTYLE = 0x0030;
+const sal_Int32 BIFF12_ID_CELLSTYLES = 0x026B;
+const sal_Int32 BIFF12_ID_CELLSTYLEXFS = 0x0272;
+const sal_Int32 BIFF12_ID_CELLXFS = 0x0269;
+const sal_Int32 BIFF12_ID_CFCOLOR = 0x0234;
+const sal_Int32 BIFF12_ID_CFRULE = 0x01CF;
+const sal_Int32 BIFF12_ID_CHARTPAGESETUP = 0x028C;
+const sal_Int32 BIFF12_ID_CHARTPROTECTION = 0x029D;
+const sal_Int32 BIFF12_ID_CHARTSHEETPR = 0x028B;
+const sal_Int32 BIFF12_ID_CHARTSHEETVIEW = 0x008D;
+const sal_Int32 BIFF12_ID_CHARTSHEETVIEWS = 0x008B;
+const sal_Int32 BIFF12_ID_COL = 0x003C;
+const sal_Int32 BIFF12_ID_COLBREAKS = 0x018A;
+const sal_Int32 BIFF12_ID_COLOR = 0x023C;
+const sal_Int32 BIFF12_ID_COLORS = 0x01D9;
+const sal_Int32 BIFF12_ID_COLORSCALE = 0x01D5;
+const sal_Int32 BIFF12_ID_COLS = 0x0186;
+const sal_Int32 BIFF12_ID_COMMENT = 0x027B;
+const sal_Int32 BIFF12_ID_COMMENTAUTHOR = 0x0278;
+const sal_Int32 BIFF12_ID_COMMENTAUTHORS = 0x0276;
+const sal_Int32 BIFF12_ID_COMMENTLIST = 0x0279;
+const sal_Int32 BIFF12_ID_COMMENTS = 0x0274;
+const sal_Int32 BIFF12_ID_COMMENTTEXT = 0x027D;
+const sal_Int32 BIFF12_ID_CONDFORMATTING = 0x01CD;
+const sal_Int32 BIFF12_ID_CONNECTION = 0x00C9;
+const sal_Int32 BIFF12_ID_CONNECTIONS = 0x01AD;
+const sal_Int32 BIFF12_ID_CONTROL = 0x0284;
+const sal_Int32 BIFF12_ID_CONTROLS = 0x0283;
+const sal_Int32 BIFF12_ID_CUSTOMCHARTVIEW = 0x028F;
+const sal_Int32 BIFF12_ID_CUSTOMCHARTVIEWS = 0x028D;
+const sal_Int32 BIFF12_ID_CUSTOMFILTER = 0x00AE;
+const sal_Int32 BIFF12_ID_CUSTOMFILTERS = 0x00AC;
+const sal_Int32 BIFF12_ID_CUSTOMSHEETVIEW = 0x01A7;
+const sal_Int32 BIFF12_ID_CUSTOMSHEETVIEWS = 0x01A6;
+const sal_Int32 BIFF12_ID_CUSTOMWORKBOOKVIEW= 0x018D;
+const sal_Int32 BIFF12_ID_DATABAR = 0x01D3;
+const sal_Int32 BIFF12_ID_DATATABLE = 0x01AC;
+const sal_Int32 BIFF12_ID_DATAVALIDATION = 0x0040;
+const sal_Int32 BIFF12_ID_DATAVALIDATIONS = 0x023D;
+const sal_Int32 BIFF12_ID_DDEITEMVALUES = 0x0242;
+const sal_Int32 BIFF12_ID_DDEITEM_BOOL = 0x0248;
+const sal_Int32 BIFF12_ID_DDEITEM_DOUBLE = 0x0244;
+const sal_Int32 BIFF12_ID_DDEITEM_ERROR = 0x0245;
+const sal_Int32 BIFF12_ID_DDEITEM_STRING = 0x0246;
+const sal_Int32 BIFF12_ID_DEFINEDNAME = 0x0027;
+const sal_Int32 BIFF12_ID_DIMENSION = 0x0094;
+const sal_Int32 BIFF12_ID_DISCRETEFILTER = 0x00A7;
+const sal_Int32 BIFF12_ID_DISCRETEFILTERS = 0x00A5;
+const sal_Int32 BIFF12_ID_DRAWING = 0x0226;
+const sal_Int32 BIFF12_ID_DXF = 0x01FB;
+const sal_Int32 BIFF12_ID_DXFS = 0x01F9;
+const sal_Int32 BIFF12_ID_EXTCELL_BLANK = 0x016F;
+const sal_Int32 BIFF12_ID_EXTCELL_BOOL = 0x0171;
+const sal_Int32 BIFF12_ID_EXTCELL_DOUBLE = 0x0170;
+const sal_Int32 BIFF12_ID_EXTCELL_ERROR = 0x0172;
+const sal_Int32 BIFF12_ID_EXTCELL_STRING = 0x0173;
+const sal_Int32 BIFF12_ID_EXTERNALADDIN = 0x029B;
+const sal_Int32 BIFF12_ID_EXTERNALBOOK = 0x0168;
+const sal_Int32 BIFF12_ID_EXTERNALNAME = 0x0241;
+const sal_Int32 BIFF12_ID_EXTERNALREF = 0x0163;
+const sal_Int32 BIFF12_ID_EXTERNALREFS = 0x0161;
+const sal_Int32 BIFF12_ID_EXTERNALSELF = 0x0165;
+const sal_Int32 BIFF12_ID_EXTERNALSAME = 0x0166;
+const sal_Int32 BIFF12_ID_EXTERNALSHEETS = 0x016A;
+const sal_Int32 BIFF12_ID_EXTROW = 0x016E;
+const sal_Int32 BIFF12_ID_EXTSHEETDATA = 0x016B;
+const sal_Int32 BIFF12_ID_EXTERNALNAMEFLAGS = 0x024A;
+const sal_Int32 BIFF12_ID_EXTSHEETNAMES = 0x0167;
+const sal_Int32 BIFF12_ID_FILESHARING = 0x0224;
+const sal_Int32 BIFF12_ID_FILEVERSION = 0x0080;
+const sal_Int32 BIFF12_ID_FILL = 0x002D;
+const sal_Int32 BIFF12_ID_FILLS = 0x025B;
+const sal_Int32 BIFF12_ID_FILTERCOLUMN = 0x00A3;
+const sal_Int32 BIFF12_ID_FONT = 0x002B;
+const sal_Int32 BIFF12_ID_FONTS = 0x0263;
+const sal_Int32 BIFF12_ID_FORMULA_STRING = 0x0008;
+const sal_Int32 BIFF12_ID_FORMULA_DOUBLE = 0x0009;
+const sal_Int32 BIFF12_ID_FORMULA_BOOL = 0x000A;
+const sal_Int32 BIFF12_ID_FORMULA_ERROR = 0x000B;
+const sal_Int32 BIFF12_ID_FUNCTIONGROUP = 0x0299;
+const sal_Int32 BIFF12_ID_FUNCTIONGROUPS = 0x0298;
+const sal_Int32 BIFF12_ID_HEADERFOOTER = 0x01DF;
+const sal_Int32 BIFF12_ID_HYPERLINK = 0x01EE;
+const sal_Int32 BIFF12_ID_ICONSET = 0x01D1;
+const sal_Int32 BIFF12_ID_INDEXEDCOLORS = 0x0235;
+const sal_Int32 BIFF12_ID_INPUTCELLS = 0x01F8;
+const sal_Int32 BIFF12_ID_LEGACYDRAWING = 0x0227;
+const sal_Int32 BIFF12_ID_MERGECELL = 0x00B0;
+const sal_Int32 BIFF12_ID_MERGECELLS = 0x00B1;
+const sal_Int32 BIFF12_ID_MRUCOLORS = 0x0239;
+const sal_Int32 BIFF12_ID_MULTCELL_BLANK = 0x000C;
+const sal_Int32 BIFF12_ID_MULTCELL_BOOL = 0x000F;
+const sal_Int32 BIFF12_ID_MULTCELL_DOUBLE = 0x0010;
+const sal_Int32 BIFF12_ID_MULTCELL_ERROR = 0x000E;
+const sal_Int32 BIFF12_ID_MULTCELL_RK = 0x000D;
+const sal_Int32 BIFF12_ID_MULTCELL_RSTRING = 0x003D;
+const sal_Int32 BIFF12_ID_MULTCELL_SI = 0x0012;
+const sal_Int32 BIFF12_ID_MULTCELL_STRING = 0x0011;
+const sal_Int32 BIFF12_ID_NUMFMT = 0x002C;
+const sal_Int32 BIFF12_ID_NUMFMTS = 0x0267;
+const sal_Int32 BIFF12_ID_OLEOBJECT = 0x027F;
+const sal_Int32 BIFF12_ID_OLEOBJECTS = 0x027E;
+const sal_Int32 BIFF12_ID_OLESIZE = 0x0225;
+const sal_Int32 BIFF12_ID_PAGEMARGINS = 0x01DC;
+const sal_Int32 BIFF12_ID_PAGESETUP = 0x01DE;
+const sal_Int32 BIFF12_ID_PANE = 0x0097;
+const sal_Int32 BIFF12_ID_PCDEFINITION = 0x00B3;
+const sal_Int32 BIFF12_ID_PCDFDISCRETEPR = 0x00E1;
+const sal_Int32 BIFF12_ID_PCDFGROUPITEMS = 0x00DD;
+const sal_Int32 BIFF12_ID_PCDFIELD = 0x00B7;
+const sal_Int32 BIFF12_ID_PCDFIELDGROUP = 0x00DB;
+const sal_Int32 BIFF12_ID_PCDFIELDS = 0x00B5;
+const sal_Int32 BIFF12_ID_PCDFRANGEPR = 0x00DF;
+const sal_Int32 BIFF12_ID_PCDFSHAREDITEMS = 0x00BD;
+const sal_Int32 BIFF12_ID_PCDSHEETSOURCE = 0x00BB;
+const sal_Int32 BIFF12_ID_PCDSOURCE = 0x00B9;
+const sal_Int32 BIFF12_ID_PCITEM_ARRAY = 0x00BF;
+const sal_Int32 BIFF12_ID_PCITEM_BOOL = 0x0016;
+const sal_Int32 BIFF12_ID_PCITEM_DATE = 0x0019;
+const sal_Int32 BIFF12_ID_PCITEM_DOUBLE = 0x0015;
+const sal_Int32 BIFF12_ID_PCITEM_ERROR = 0x0017;
+const sal_Int32 BIFF12_ID_PCITEM_INDEX = 0x001A;
+const sal_Int32 BIFF12_ID_PCITEM_MISSING = 0x0014;
+const sal_Int32 BIFF12_ID_PCITEM_STRING = 0x0018;
+const sal_Int32 BIFF12_ID_PCITEMA_BOOL = 0x001D;
+const sal_Int32 BIFF12_ID_PCITEMA_DATE = 0x0020;
+const sal_Int32 BIFF12_ID_PCITEMA_DOUBLE = 0x001C;
+const sal_Int32 BIFF12_ID_PCITEMA_ERROR = 0x001E;
+const sal_Int32 BIFF12_ID_PCITEMA_MISSING = 0x001B;
+const sal_Int32 BIFF12_ID_PCITEMA_STRING = 0x001F;
+const sal_Int32 BIFF12_ID_PCRECORD = 0x0021;
+const sal_Int32 BIFF12_ID_PCRECORDDT = 0x0022;
+const sal_Int32 BIFF12_ID_PCRECORDS = 0x00C1;
+const sal_Int32 BIFF12_ID_PHONETICPR = 0x0219;
+const sal_Int32 BIFF12_ID_PICTURE = 0x0232;
+const sal_Int32 BIFF12_ID_PIVOTAREA = 0x00F7;
+const sal_Int32 BIFF12_ID_PIVOTCACHE = 0x0182;
+const sal_Int32 BIFF12_ID_PIVOTCACHES = 0x0180;
+const sal_Int32 BIFF12_ID_PRINTOPTIONS = 0x01DD;
+const sal_Int32 BIFF12_ID_PTCOLFIELDS = 0x0137;
+const sal_Int32 BIFF12_ID_PTDATAFIELD = 0x0125;
+const sal_Int32 BIFF12_ID_PTDATAFIELDS = 0x0127;
+const sal_Int32 BIFF12_ID_PTDEFINITION = 0x0118;
+const sal_Int32 BIFF12_ID_PTFIELD = 0x011D;
+const sal_Int32 BIFF12_ID_PTFIELDS = 0x011F;
+const sal_Int32 BIFF12_ID_PTFILTER = 0x0259;
+const sal_Int32 BIFF12_ID_PTFILTERS = 0x0257;
+const sal_Int32 BIFF12_ID_PTFITEM = 0x011A;
+const sal_Int32 BIFF12_ID_PTFITEMS = 0x011B;
+const sal_Int32 BIFF12_ID_PTLOCATION = 0x013A;
+const sal_Int32 BIFF12_ID_PTPAGEFIELD = 0x0121;
+const sal_Int32 BIFF12_ID_PTPAGEFIELDS = 0x0123;
+const sal_Int32 BIFF12_ID_PTREFERENCE = 0x00FB;
+const sal_Int32 BIFF12_ID_PTREFERENCEITEM = 0x017E;
+const sal_Int32 BIFF12_ID_PTREFERENCES = 0x00F9;
+const sal_Int32 BIFF12_ID_PTROWFIELDS = 0x0135;
+const sal_Int32 BIFF12_ID_QUERYTABLE = 0x01BF;
+const sal_Int32 BIFF12_ID_QUERYTABLEREFRESH = 0x01C1;
+const sal_Int32 BIFF12_ID_RGBCOLOR = 0x01DB;
+const sal_Int32 BIFF12_ID_ROW = 0x0000;
+const sal_Int32 BIFF12_ID_ROWBREAKS = 0x0188;
+const sal_Int32 BIFF12_ID_SCENARIO = 0x01F6;
+const sal_Int32 BIFF12_ID_SCENARIOS = 0x01F4;
+const sal_Int32 BIFF12_ID_SELECTION = 0x0098;
+const sal_Int32 BIFF12_ID_SHAREDFMLA = 0x01AB;
+const sal_Int32 BIFF12_ID_SHEET = 0x009C;
+const sal_Int32 BIFF12_ID_SHEETDATA = 0x0091;
+const sal_Int32 BIFF12_ID_SHEETFORMATPR = 0x01E5;
+const sal_Int32 BIFF12_ID_SHEETPR = 0x0093;
+const sal_Int32 BIFF12_ID_SHEETPROTECTION = 0x0217;
+const sal_Int32 BIFF12_ID_SHEETS = 0x008F;
+const sal_Int32 BIFF12_ID_SHEETVIEW = 0x0089;
+const sal_Int32 BIFF12_ID_SHEETVIEWS = 0x0085;
+const sal_Int32 BIFF12_ID_SI = 0x0013;
+const sal_Int32 BIFF12_ID_SST = 0x009F;
+const sal_Int32 BIFF12_ID_STYLESHEET = 0x0116;
+const sal_Int32 BIFF12_ID_TABLE = 0x0157;
+const sal_Int32 BIFF12_ID_TABLEPART = 0x0295;
+const sal_Int32 BIFF12_ID_TABLEPARTS = 0x0294;
+const sal_Int32 BIFF12_ID_TABLESTYLEINFO = 0x0201;
+const sal_Int32 BIFF12_ID_TABLESTYLES = 0x01FC;
+const sal_Int32 BIFF12_ID_TOP10FILTER = 0x00AA;
+const sal_Int32 BIFF12_ID_VOLTYPE = 0x0204;
+const sal_Int32 BIFF12_ID_VOLTYPEMAIN = 0x0206;
+const sal_Int32 BIFF12_ID_VOLTYPES = 0x0202;
+const sal_Int32 BIFF12_ID_VOLTYPESTP = 0x020A;
+const sal_Int32 BIFF12_ID_VOLTYPETR = 0x020B;
+const sal_Int32 BIFF12_ID_WEBPR = 0x0105;
+const sal_Int32 BIFF12_ID_WEBPRTABLES = 0x0107;
+const sal_Int32 BIFF12_ID_WORKBOOK = 0x0083;
+const sal_Int32 BIFF12_ID_WORKBOOKPR = 0x0099;
+const sal_Int32 BIFF12_ID_WORKBOOKVIEW = 0x009E;
+const sal_Int32 BIFF12_ID_WORKSHEET = 0x0081;
+const sal_Int32 BIFF12_ID_XF = 0x002F;
+
+// BIFF2-BIFF8 record identifiers =============================================
/** An enumeration for all binary Excel file format types (BIFF types). */
enum BiffType
@@ -261,6 +273,7 @@ const sal_uInt16 BIFF8_MAXRECSIZE = 8224;
const sal_uInt16 BIFF2_ID_ARRAY = 0x0021;
const sal_uInt16 BIFF3_ID_ARRAY = 0x0221;
+const sal_uInt16 BIFF_ID_AUTOFILTER = 0x009D;
const sal_uInt16 BIFF2_ID_BLANK = 0x0001;
const sal_uInt16 BIFF3_ID_BLANK = 0x0201;
const sal_uInt16 BIFF2_ID_BOF = 0x0009;
@@ -291,6 +304,7 @@ const sal_uInt16 BIFF_ID_CHCHART = 0x1002;
const sal_uInt16 BIFF_ID_CHCHART3D = 0x103A;
const sal_uInt16 BIFF_ID_CHCHARTLINE = 0x101C;
const sal_uInt16 BIFF_ID_CHDATAFORMAT = 0x1006;
+const sal_uInt16 BIFF_ID_CHDATERANGE = 0x1062;
const sal_uInt16 BIFF_ID_CHDEFAULTTEXT = 0x1024;
const sal_uInt16 BIFF_ID_CHDROPBAR = 0x103D;
const sal_uInt16 BIFF_ID_CHECKCOMPAT = 0x088C;
@@ -315,7 +329,6 @@ const sal_uInt16 BIFF_ID_CHFRTEXTPROPS = 0x08A5;
const sal_uInt16 BIFF_ID_CHFRUNITPROPS = 0x0857;
const sal_uInt16 BIFF_ID_CHFRWRAPPER = 0x0851;
const sal_uInt16 BIFF_ID_CHLABELRANGE = 0x1020;
-const sal_uInt16 BIFF_ID_CHLABELRANGE2 = 0x1062;
const sal_uInt16 BIFF_ID_CHLEGEND = 0x1015;
const sal_uInt16 BIFF_ID_CHLINE = 0x1018;
const sal_uInt16 BIFF_ID_CHLINEFORMAT = 0x1007;
@@ -353,6 +366,7 @@ const sal_uInt16 BIFF_ID_COLINFO = 0x007D;
const sal_uInt16 BIFF_ID_COLUMNDEFAULT = 0x0020;
const sal_uInt16 BIFF_ID_COLWIDTH = 0x0024;
const sal_uInt16 BIFF_ID_COMPRESSPICS = 0x089B;
+const sal_uInt16 BIFF_ID_CONNECTION = 0x0876;
const sal_uInt16 BIFF_ID_CONT = 0x003C;
const sal_uInt16 BIFF_ID_COORDLIST = 0x00A9;
const sal_uInt16 BIFF_ID_COUNTRY = 0x008C;
@@ -364,6 +378,7 @@ const sal_uInt16 BIFF_ID_DATAVALIDATION = 0x01BE;
const sal_uInt16 BIFF_ID_DATAVALIDATIONS = 0x01B2;
const sal_uInt16 BIFF_ID_DATEMODE = 0x0022;
const sal_uInt16 BIFF_ID_DBCELL = 0x00D7;
+const sal_uInt16 BIFF_ID_DBQUERY = 0x00DC;
const sal_uInt16 BIFF_ID_DCONBINAME = 0x01B5;
const sal_uInt16 BIFF_ID_DCONNAME = 0x0052;
const sal_uInt16 BIFF_ID_DCONREF = 0x0051;
@@ -386,6 +401,8 @@ const sal_uInt16 BIFF_ID_EXTERNSHEET = 0x0017;
const sal_uInt16 BIFF_ID_EXTSST = 0x00FF;
const sal_uInt16 BIFF_ID_FILEPASS = 0x002F;
const sal_uInt16 BIFF_ID_FILESHARING = 0x005B;
+const sal_uInt16 BIFF_ID_FILTERCOLUMN = 0x009E;
+const sal_uInt16 BIFF_ID_FILTERMODE = 0x009B;
const sal_uInt16 BIFF2_ID_FONT = 0x0031;
const sal_uInt16 BIFF3_ID_FONT = 0x0231;
const sal_uInt16 BIFF5_ID_FONT = 0x0031;
@@ -435,6 +452,7 @@ const sal_uInt16 BIFF_ID_PAGELAYOUTVIEW = 0x088B;
const sal_uInt16 BIFF_ID_PAGESETUP = 0x00A1;
const sal_uInt16 BIFF_ID_PALETTE = 0x0092;
const sal_uInt16 BIFF_ID_PANE = 0x0041;
+const sal_uInt16 BIFF_ID_PARAMQUERY = 0x00DC;
const sal_uInt16 BIFF_ID_PASSWORD = 0x0013;
const sal_uInt16 BIFF_ID_PCDEFINITION = 0x00C6;
const sal_uInt16 BIFF_ID_PCDEFINITION2 = 0x0122;
@@ -470,6 +488,10 @@ const sal_uInt16 BIFF_ID_PTFITEM = 0x00B2;
const sal_uInt16 BIFF_ID_PTPAGEFIELDS = 0x00B6;
const sal_uInt16 BIFF_ID_PTROWCOLFIELDS = 0x00B4;
const sal_uInt16 BIFF_ID_PTROWCOLITEMS = 0x00B5;
+const sal_uInt16 BIFF_ID_QUERYTABLE = 0x01AD;
+const sal_uInt16 BIFF_ID_QUERYTABLEREFRESH = 0x0802;
+const sal_uInt16 BIFF_ID_QUERYTABLESETTINGS = 0x0803;
+const sal_uInt16 BIFF_ID_QUERYTABLESTRING = 0x0804;
const sal_uInt16 BIFF_ID_RECALCID = 0x01C1;
const sal_uInt16 BIFF_ID_REFMODE = 0x000F;
const sal_uInt16 BIFF_ID_RIGHTMARGIN = 0x0027;
@@ -496,7 +518,6 @@ const sal_uInt16 BIFF2_ID_STRING = 0x0007;
const sal_uInt16 BIFF3_ID_STRING = 0x0207;
const sal_uInt16 BIFF_ID_STYLE = 0x0293;
const sal_uInt16 BIFF_ID_STYLEEXT = 0x0892;
-const sal_uInt16 BIFF_ID_SXEXT = 0x00DC;
const sal_uInt16 BIFF_ID_TABLESTYLES = 0x088E;
const sal_uInt16 BIFF_ID_THEME = 0x0896;
const sal_uInt16 BIFF_ID_TOPMARGIN = 0x0028;
@@ -521,6 +542,8 @@ const sal_uInt16 BIFF_ID_XFEXT = 0x087D;
const sal_uInt16 BIFF_ID_UNKNOWN = SAL_MAX_UINT16;
+// OBJ subrecord identifiers --------------------------------------------------
+
const sal_uInt16 BIFF_ID_OBJEND = 0x0000; /// End of OBJ.
const sal_uInt16 BIFF_ID_OBJMACRO = 0x0004; /// Macro link.
const sal_uInt16 BIFF_ID_OBJBUTTON = 0x0005; /// Button data.
@@ -563,7 +586,10 @@ const sal_uInt8 BIFF_DATATYPE_STRING = 2;
const sal_uInt8 BIFF_DATATYPE_BOOL = 4;
const sal_uInt8 BIFF_DATATYPE_ERROR = 16;
-// unicode strings ------------------------------------------------------------
+const sal_uInt8 BIFF_BOOLERR_BOOL = 0;
+const sal_uInt8 BIFF_BOOLERR_ERROR = 1;
+
+// BIFF8 unicode strings ------------------------------------------------------
const sal_uInt8 BIFF_STRF_16BIT = 0x01;
const sal_uInt8 BIFF_STRF_PHONETIC = 0x04;
@@ -592,6 +618,32 @@ public:
/** Returns a Windows code page from a text encoding. */
static sal_uInt16 calcCodePageFromTextEncoding( rtl_TextEncoding eTextEnc );
+ // BIFF12 import ----------------------------------------------------------
+
+ /** Reads a BIFF12 string with leading 16-bit or 32-bit length field. */
+ static ::rtl::OUString readString( SequenceInputStream& rStrm, bool b32BitLen = true );
+
+ // BIFF2-BIFF8 import -----------------------------------------------------
+
+ /** Returns true, if the current record of the stream is a BOF record. */
+ static bool isBofRecord( BiffInputStream& rStrm );
+
+ /** Skips a block of records up to the specified end record.
+
+ Skips all records until next end record. When this function returns,
+ the stream points to the end record, and the next call of the function
+ startNextRecord() at the stream will start the record following the end
+ record.
+
+ The identifier of the record that is active while this function is
+ called is used as start record identifier. This identifier is used to
+ correctly skip embedded record blocks with the same start and end
+ record identifier.
+
+ @return True = stream points to the end record.
+ */
+ static bool skipRecordBlock( BiffInputStream& rStrm, sal_uInt16 nEndRecId );
+
/** Imports a picture from an IMGDATA record. */
static void importImgData( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, BiffType eBiff );
@@ -600,6 +652,15 @@ private:
~BiffHelper(); // not implemented
};
+// ----------------------------------------------------------------------------
+
+/** BIFF12 stream operator for an ::rtl::OUString, reads 32-bit string length and Unicode array. */
+inline SequenceInputStream& operator>>( SequenceInputStream& rStrm, ::rtl::OUString& orString )
+{
+ orString = BiffHelper::readString( rStrm );
+ return rStrm;
+}
+
// ============================================================================
} // namespace xls
@@ -607,4 +668,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/biffinputstream.hxx b/oox/inc/oox/xls/biffinputstream.hxx
index 5b6520339d3b..3fd8d4d8fbdc 100644
--- a/oox/inc/oox/xls/biffinputstream.hxx
+++ b/oox/inc/oox/xls/biffinputstream.hxx
@@ -446,4 +446,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/biffoutputstream.hxx b/oox/inc/oox/xls/biffoutputstream.hxx
index aab816f65f3e..6f56bac31c8d 100644
--- a/oox/inc/oox/xls/biffoutputstream.hxx
+++ b/oox/inc/oox/xls/biffoutputstream.hxx
@@ -164,4 +164,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/chartsheetfragment.hxx b/oox/inc/oox/xls/chartsheetfragment.hxx
index 7c5a33d08173..3e2f3b4feb0f 100644
--- a/oox/inc/oox/xls/chartsheetfragment.hxx
+++ b/oox/inc/oox/xls/chartsheetfragment.hxx
@@ -36,24 +36,20 @@ namespace xls {
// ============================================================================
-class OoxChartsheetFragment : public OoxWorksheetFragmentBase
+class ChartsheetFragment : public WorksheetFragmentBase
{
public:
- explicit OoxChartsheetFragment(
+ explicit ChartsheetFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
sal_Int16 nSheet );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
-
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
- // oox.core.FragmentHandler2 interface ------------------------------------
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
virtual void initializeImport();
@@ -63,7 +59,7 @@ private:
/** Imports the the relation identifier for the DrawingML part. */
void importDrawing( const AttributeList& rAttribs );
/** Imports the DRAWING record containing the relation identifier for the DrawingML part. */
- void importDrawing( RecordInputStream& rStrm );
+ void importDrawing( SequenceInputStream& rStrm );
};
// ============================================================================
@@ -73,7 +69,7 @@ class BiffChartsheetFragment : public BiffWorksheetFragmentBase
public:
explicit BiffChartsheetFragment(
const BiffWorkbookFragmentBase& rParent,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
sal_Int16 nSheet );
/** Imports the entire sheet fragment, returns true, if EOF record has been reached. */
@@ -87,4 +83,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/commentsbuffer.hxx b/oox/inc/oox/xls/commentsbuffer.hxx
index 4a96683a3571..85ae32ee9b1a 100644
--- a/oox/inc/oox/xls/commentsbuffer.hxx
+++ b/oox/inc/oox/xls/commentsbuffer.hxx
@@ -71,7 +71,7 @@ public:
/** Imports the anchor points in CommentPr */
void importAnchor( bool bFrom, sal_Int32 nWhich, const ::rtl::OUString &rChars );
/** Imports a cell comment from the passed stream of a COMMENT record. */
- void importComment( RecordInputStream& rStrm );
+ void importComment( SequenceInputStream& rStrm );
/** Creates and returns a new rich-string object for the comment text. */
RichStringRef createText();
@@ -115,4 +115,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/commentsfragment.hxx b/oox/inc/oox/xls/commentsfragment.hxx
index e9fb6d69d578..c549c3bc7461 100644
--- a/oox/inc/oox/xls/commentsfragment.hxx
+++ b/oox/inc/oox/xls/commentsfragment.hxx
@@ -37,30 +37,27 @@ namespace xls {
// ============================================================================
-class OoxCommentsFragment : public OoxWorksheetFragmentBase
+class CommentsFragment : public WorksheetFragmentBase
{
public:
- explicit OoxCommentsFragment(
+ explicit CommentsFragment(
const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual void onEndRecord();
- // oox.core.FragmentHandler2 interface ------------------------------------
-
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
private:
/** Imports comment data from the comment element. */
void importComment( const AttributeList& rAttribs );
/** Imports comment data from the COMMENT record. */
- void importComment( RecordInputStream& rStrm );
+ void importComment( SequenceInputStream& rStrm );
private:
CommentRef mxComment;
@@ -73,4 +70,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/condformatbuffer.hxx b/oox/inc/oox/xls/condformatbuffer.hxx
index ef5ab1d1f154..08d318e0a3c3 100644
--- a/oox/inc/oox/xls/condformatbuffer.hxx
+++ b/oox/inc/oox/xls/condformatbuffer.hxx
@@ -30,7 +30,6 @@
#define OOX_XLS_CONDFORMATBUFFER_HXX
#include <com/sun/star/sheet/ConditionOperator2.hpp>
-#include "oox/helper/containerhelper.hxx"
#include "oox/xls/formulaparser.hxx"
#include "oox/xls/worksheethelper.hxx"
@@ -65,11 +64,11 @@ struct CondFormatRuleModel
explicit CondFormatRuleModel();
- /** Sets the passed OOBIN or BIFF operator for condition type cellIs. */
- void setBinOperator( sal_Int32 nOperator );
+ /** Sets the passed BIFF operator for condition type cellIs. */
+ void setBiffOperator( sal_Int32 nOperator );
- /** Sets the passed OOBIN text comparison type and operator. */
- void setOobTextType( sal_Int32 nOperator );
+ /** Sets the passed BIFF12 text comparison type and operator. */
+ void setBiff12TextType( sal_Int32 nOperator );
};
// ============================================================================
@@ -88,7 +87,7 @@ public:
void appendFormula( const ::rtl::OUString& rFormula );
/** Imports rule settings from a CFRULE record. */
- void importCfRule( RecordInputStream& rStrm );
+ void importCfRule( SequenceInputStream& rStrm );
/** Imports rule settings from a CFRULE record. */
void importCfRule( BiffInputStream& rStrm, sal_Int32 nPriority );
@@ -132,9 +131,9 @@ public:
CondFormatRuleRef importCfRule( const AttributeList& rAttribs );
/** Imports settings from the CONDFORMATTING record. */
- void importCondFormatting( RecordInputStream& rStrm );
+ void importCondFormatting( SequenceInputStream& rStrm );
/** Imports a conditional formatting rule from the CFRULE record. */
- void importCfRule( RecordInputStream& rStrm );
+ void importCfRule( SequenceInputStream& rStrm );
/** Imports settings from the CFHEADER record. */
void importCfHeader( BiffInputStream& rStrm );
@@ -168,7 +167,7 @@ public:
/** Imports settings from the conditionalFormatting element. */
CondFormatRef importConditionalFormatting( const AttributeList& rAttribs );
/** Imports settings from the CONDFORMATTING record. */
- CondFormatRef importCondFormatting( RecordInputStream& rStrm );
+ CondFormatRef importCondFormatting( SequenceInputStream& rStrm );
/** Imports settings from the CFHEADER record. */
void importCfHeader( BiffInputStream& rStrm );
@@ -193,4 +192,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/condformatcontext.hxx b/oox/inc/oox/xls/condformatcontext.hxx
index e6b402d21ef5..bd383c89af8b 100644
--- a/oox/inc/oox/xls/condformatcontext.hxx
+++ b/oox/inc/oox/xls/condformatcontext.hxx
@@ -37,20 +37,18 @@ namespace xls {
// ============================================================================
-class OoxCondFormatContext : public OoxWorksheetContextBase
+class CondFormatContext : public WorksheetContextBase
{
public:
- explicit OoxCondFormatContext( OoxWorksheetFragmentBase& rFragment );
+ explicit CondFormatContext( WorksheetFragmentBase& rFragment );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
private:
CondFormatRef mxCondFmt;
@@ -64,4 +62,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/connectionsbuffer.hxx b/oox/inc/oox/xls/connectionsbuffer.hxx
new file mode 100755
index 000000000000..98a5bea17bc6
--- /dev/null
+++ b/oox/inc/oox/xls/connectionsbuffer.hxx
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_XLS_CONNECTIONSBUFFER_HXX
+#define OOX_XLS_CONNECTIONSBUFFER_HXX
+
+#include "oox/helper/refvector.hxx"
+#include "oox/xls/workbookhelper.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+const sal_Int32 BIFF12_CONNECTION_UNKNOWN = 0;
+const sal_Int32 BIFF12_CONNECTION_ODBC = 1;
+const sal_Int32 BIFF12_CONNECTION_DAO = 2;
+const sal_Int32 BIFF12_CONNECTION_FILE = 3;
+const sal_Int32 BIFF12_CONNECTION_HTML = 4;
+const sal_Int32 BIFF12_CONNECTION_OLEDB = 5;
+const sal_Int32 BIFF12_CONNECTION_TEXT = 6;
+const sal_Int32 BIFF12_CONNECTION_ADO = 7;
+const sal_Int32 BIFF12_CONNECTION_DSP = 8;
+
+// ============================================================================
+
+/** Special properties for data connections representing web queries. */
+struct WebPrModel
+{
+ typedef ::std::vector< ::com::sun::star::uno::Any > TablesVector;
+
+ TablesVector maTables; /// Names or indexes of the web query tables.
+ ::rtl::OUString maUrl; /// Source URL to refresh the data.
+ ::rtl::OUString maPostMethod; /// POST method to query data.
+ ::rtl::OUString maEditPage; /// Web page showing query data (for XML queries).
+ sal_Int32 mnHtmlFormat; /// Plain text, rich text, or HTML.
+ bool mbXml; /// True = XML query, false = HTML query.
+ bool mbSourceData; /// True = import XML source data referred by HTML table.
+ bool mbParsePre; /// True = parse preformatted sections (<pre> tag).
+ bool mbConsecutive; /// True = join consecutive delimiters.
+ bool mbFirstRow; /// True = use column withs of first row for entire <pre> tag.
+ bool mbXl97Created; /// True = web query created with Excel 97.
+ bool mbTextDates; /// True = read date values as text, false = parse dates.
+ bool mbXl2000Refreshed; /// True = refreshed with Excel 2000 or newer.
+ bool mbHtmlTables; /// True = HTML tables, false = entire document.
+
+ explicit WebPrModel();
+};
+
+// ----------------------------------------------------------------------------
+
+/** Common properties of an external data connection. */
+struct ConnectionModel
+{
+ typedef ::std::auto_ptr< WebPrModel > WebPrModelPtr;
+
+ WebPrModelPtr mxWebPr; /// Special settings for web queries.
+ ::rtl::OUString maName; /// Unique name of this connection.
+ ::rtl::OUString maDescription; /// User description of this connection.
+ ::rtl::OUString maSourceFile; /// URL of a source data file.
+ ::rtl::OUString maSourceConnFile; /// URL of a source connection file.
+ ::rtl::OUString maSsoId; /// Single sign-on identifier.
+ sal_Int32 mnId; /// Unique connection identifier.
+ sal_Int32 mnType; /// Data source type.
+ sal_Int32 mnReconnectMethod; /// Reconnection method.
+ sal_Int32 mnCredentials; /// Credentials method.
+ sal_Int32 mnInterval; /// Refresh interval in minutes.
+ bool mbKeepAlive; /// True = keep connection open after import.
+ bool mbNew; /// True = new connection, never updated.
+ bool mbDeleted; /// True = connection has been deleted.
+ bool mbOnlyUseConnFile; /// True = use maSourceConnFile, ignore mnReconnectMethod.
+ bool mbBackground; /// True = background refresh enabled.
+ bool mbRefreshOnLoad; /// True = refresh connection on import.
+ bool mbSaveData; /// True = save cached data with connection.
+ bool mbSavePassword; /// True = save password in connection string.
+
+ explicit ConnectionModel();
+
+ WebPrModel& createWebPr();
+};
+
+// ----------------------------------------------------------------------------
+
+/** An external data connection (database, web query, etc.). */
+class Connection : public WorkbookHelper
+{
+public:
+ explicit Connection( const WorkbookHelper& rHelper, sal_Int32 nConnId = -1 );
+
+ /** Imports connection settings from the connection element. */
+ void importConnection( const AttributeList& rAttribs );
+ /** Imports web query settings from the webPr element. */
+ void importWebPr( const AttributeList& rAttribs );
+ /** Imports web query table settings from the tables element. */
+ void importTables( const AttributeList& rAttribs );
+ /** Imports a web query table identifier from the m, s, or x element. */
+ void importTable( const AttributeList& rAttribs, sal_Int32 nElement );
+
+ /** Imports connection settings from the CONNECTION record. */
+ void importConnection( SequenceInputStream& rStrm );
+ /** Imports web query settings from the WEBPR record. */
+ void importWebPr( SequenceInputStream& rStrm );
+ /** Imports web query table settings from the WEBPRTABLES record. */
+ void importWebPrTables( SequenceInputStream& rStrm );
+ /** Imports a web query table identifier from the PCITEM_MISSING, PCITEM_STRING, or PCITEM_INDEX record. */
+ void importWebPrTable( SequenceInputStream& rStrm, sal_Int32 nRecId );
+
+ /** Imports connection settings from the DBQUERY record. */
+ void importDbQuery( BiffInputStream& rStrm );
+ /** Imports connection settings from the QUERYTABLESETTINGS record. */
+ void importQueryTableSettings( BiffInputStream& rStrm );
+
+ /** Returns the unique connection identifier. */
+ inline sal_Int32 getConnectionId() const { return maModel.mnId; }
+ /** Returns the source data type of the connection. */
+ inline sal_Int32 getConnectionType() const { return maModel.mnType; }
+ /** Returns read-only access to the connection model data. */
+ const ConnectionModel& getModel() const { return maModel; }
+
+private:
+ ConnectionModel maModel;
+};
+
+typedef ::boost::shared_ptr< Connection > ConnectionRef;
+
+// ============================================================================
+
+class ConnectionsBuffer : public WorkbookHelper
+{
+public:
+ explicit ConnectionsBuffer( const WorkbookHelper& rHelper );
+
+ /** Creates a new empty connection. */
+ Connection& createConnection();
+ /** Creates a new empty connection with a valid but unused identifier. */
+ Connection& createConnectionWithId();
+
+ /** Maps all connections by their identifier. */
+ void finalizeImport();
+
+ /** Returns a data connection by its unique identifier. */
+ ConnectionRef getConnection( sal_Int32 nConnId ) const;
+
+private:
+ /** Inserts the passed connection into the map according to its identifier. */
+ void insertConnectionToMap( const ConnectionRef& rxConnection );
+
+private:
+ typedef RefVector< Connection > ConnectionVector;
+ typedef RefMap< sal_Int32, Connection > ConnectionMap;
+
+ ConnectionVector maConnections;
+ ConnectionMap maConnectionsById;
+ sal_Int32 mnUnusedId;
+};
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/xls/connectionsfragment.hxx b/oox/inc/oox/xls/connectionsfragment.hxx
index 929f57c0a566..6a0a449ba75d 100644
--- a/oox/inc/oox/xls/connectionsfragment.hxx
+++ b/oox/inc/oox/xls/connectionsfragment.hxx
@@ -30,31 +30,45 @@
#define OOX_XLS_CONNECTIONSFRAGMENT_HXX
#include "oox/xls/excelhandlers.hxx"
-#include "oox/xls/workbookhelper.hxx"
namespace oox {
namespace xls {
+class Connection;
+
// ============================================================================
-class OoxConnectionsFragment : public OoxWorkbookFragmentBase
+class ConnectionContext : public WorkbookContextBase
{
public:
- explicit OoxConnectionsFragment(
+ explicit ConnectionContext( WorkbookFragmentBase& rParent, Connection& rConnection );
+
+protected:
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onStartElement( const AttributeList& rAttribs );
+
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
+
+private:
+ Connection& mrConnection;
+};
+
+// ============================================================================
+
+class ConnectionsFragment : public WorkbookFragmentBase
+{
+public:
+ explicit ConnectionsFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
-private:
- void importConnection( const AttributeList& rAttribs );
- void importWebPr( const AttributeList& rAttribs );
- void importTables( const AttributeList& rAttribs );
- void importS( const AttributeList& rAttribs );
- void importX( const AttributeList& rAttribs );
+ virtual const ::oox::core::RecordInfo* getRecordInfos() const;
+ virtual void finalizeImport();
};
// ============================================================================
@@ -64,4 +78,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/defnamesbuffer.hxx b/oox/inc/oox/xls/defnamesbuffer.hxx
index 474773191d2e..e76c0ad6cf74 100644
--- a/oox/inc/oox/xls/defnamesbuffer.hxx
+++ b/oox/inc/oox/xls/defnamesbuffer.hxx
@@ -29,8 +29,6 @@
#ifndef OOX_XLS_DEFINEDNAMESBUFFER_HXX
#define OOX_XLS_DEFINEDNAMESBUFFER_HXX
-#include "oox/helper/containerhelper.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/formulabase.hxx"
namespace com { namespace sun { namespace star {
@@ -46,21 +44,21 @@ class BiffInputStreamPos;
// ============================================================================
// codes for built-in names
-const sal_Unicode OOX_DEFNAME_CONSOLIDATEAREA = '\x00';
-const sal_Unicode OOX_DEFNAME_AUTOOPEN = '\x01';
-const sal_Unicode OOX_DEFNAME_AUTOCLOSE = '\x02';
-const sal_Unicode OOX_DEFNAME_EXTRACT = '\x03';
-const sal_Unicode OOX_DEFNAME_DATABASE = '\x04';
-const sal_Unicode OOX_DEFNAME_CRITERIA = '\x05';
-const sal_Unicode OOX_DEFNAME_PRINTAREA = '\x06';
-const sal_Unicode OOX_DEFNAME_PRINTTITLES = '\x07';
-const sal_Unicode OOX_DEFNAME_RECORDER = '\x08';
-const sal_Unicode OOX_DEFNAME_DATAFORM = '\x09';
-const sal_Unicode OOX_DEFNAME_AUTOACTIVATE = '\x0A';
-const sal_Unicode OOX_DEFNAME_AUTODEACTIVATE = '\x0B';
-const sal_Unicode OOX_DEFNAME_SHEETTITLE = '\x0C';
-const sal_Unicode OOX_DEFNAME_FILTERDATABASE = '\x0D';
-const sal_Unicode OOX_DEFNAME_UNKNOWN = '\x0E';
+const sal_Unicode BIFF_DEFNAME_CONSOLIDATEAREA = '\x00';
+const sal_Unicode BIFF_DEFNAME_AUTOOPEN = '\x01'; // Sheet macro executed when workbook is opened.
+const sal_Unicode BIFF_DEFNAME_AUTOCLOSE = '\x02'; // Sheet macro executed when workbook is closed.
+const sal_Unicode BIFF_DEFNAME_EXTRACT = '\x03'; // Filter output destination for advanced filter.
+const sal_Unicode BIFF_DEFNAME_DATABASE = '\x04';
+const sal_Unicode BIFF_DEFNAME_CRITERIA = '\x05'; // Filter criteria source range for advanced filter.
+const sal_Unicode BIFF_DEFNAME_PRINTAREA = '\x06'; // Print ranges.
+const sal_Unicode BIFF_DEFNAME_PRINTTITLES = '\x07'; // Rows/columns repeated on each page when printing.
+const sal_Unicode BIFF_DEFNAME_RECORDER = '\x08';
+const sal_Unicode BIFF_DEFNAME_DATAFORM = '\x09';
+const sal_Unicode BIFF_DEFNAME_AUTOACTIVATE = '\x0A'; // Sheet macro executed when workbook is activated.
+const sal_Unicode BIFF_DEFNAME_AUTODEACTIVATE = '\x0B'; // Sheet macro executed when workbook is deactivated.
+const sal_Unicode BIFF_DEFNAME_SHEETTITLE = '\x0C';
+const sal_Unicode BIFF_DEFNAME_FILTERDATABASE = '\x0D'; // Sheet range autofilter or advanced filter works on.
+const sal_Unicode BIFF_DEFNAME_UNKNOWN = '\x0E';
// ============================================================================
@@ -70,9 +68,9 @@ struct DefinedNameModel
::rtl::OUString maFormula; /// The formula string.
sal_Int32 mnSheet; /// Sheet index for local names.
sal_Int32 mnFuncGroupId; /// Function group identifier.
- bool mbMacro; /// True = Macro name (VBasic or sheet macro).
+ bool mbMacro; /// True = Macro name (VBA or sheet macro).
bool mbFunction; /// True = function, false = command.
- bool mbVBName; /// True = VBasic macro, false = sheet macro.
+ bool mbVBName; /// True = VBA macro, false = sheet macro.
bool mbHidden; /// True = name hidden in UI.
explicit DefinedNameModel();
@@ -97,10 +95,10 @@ public:
::com::sun::star::uno::Any getReference( const ::com::sun::star::table::CellAddress& rBaseAddress ) const;
protected:
- /** Imports the OOX formula string, using the passed formula context. */
+ /** Imports the OOXML formula string, using the passed formula context. */
void importOoxFormula( FormulaContext& rContext, sal_Int16 nBaseSheet );
- /** Imports the OOBIN formula, using the passed formula context. */
- void importOobFormula( FormulaContext& rContext, sal_Int16 nBaseSheet, RecordInputStream& rStrm );
+ /** Imports the BIFF12 formula, using the passed formula context. */
+ void importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, SequenceInputStream& rStrm );
/** Imports the BIFF formula, using the passed formula context. */
void importBiffFormula( FormulaContext& rContext, sal_Int16 nBaseSheet, BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize = 0 );
@@ -126,7 +124,7 @@ public:
/** Sets the formula string from the body of the definedName element. */
void setFormula( const ::rtl::OUString& rFormula );
/** Imports the defined name from a DEFINEDNAME record in the passed stream. */
- void importDefinedName( RecordInputStream& rStrm );
+ void importDefinedName( SequenceInputStream& rStrm );
/** Imports the defined name from a DEFINEDNAME record in the passed BIFF stream. */
void importDefinedName( BiffInputStream& rStrm, sal_Int16 nCalcSheet );
@@ -135,22 +133,26 @@ public:
/** Converts the formula string or BIFF token array for this defined name. */
void convertFormula();
+ /** Returns true, if this defined name is global in the document. */
+ inline bool isGlobalName() const { return mnCalcSheet < 0; }
/** Returns true, if this defined name is a special builtin name. */
- inline bool isBuiltinName() const { return mcBuiltinId != OOX_DEFNAME_UNKNOWN; }
+ inline bool isBuiltinName() const { return mcBuiltinId != BIFF_DEFNAME_UNKNOWN; }
/** Returns true, if this defined name is a macro function call. */
inline bool isMacroFunction() const { return maModel.mbMacro && maModel.mbFunction; }
- /** Returns true, if this defined name is global in the document. */
- inline bool isGlobalName() const { return mnCalcSheet < 0; }
+ /** Returns true, if this defined name is a reference to a VBA macro. */
+ inline bool isVBName() const { return maModel.mbMacro && maModel.mbVBName; }
- /** Returns the token index used in API token arrays (com.sun.star.sheet.FormulaToken). */
- inline sal_Int32 getTokenIndex() const { return mnTokenIndex; }
/** Returns the 0-based sheet index for local names, or -1 for global names. */
inline sal_Int16 getLocalCalcSheet() const { return mnCalcSheet; }
+ /** Returns the built-in identifier of the defined name. */
+ inline sal_Unicode getBuiltinId() const { return mcBuiltinId; }
+ /** Returns the token index used in API token arrays (com.sun.star.sheet.FormulaToken). */
+ inline sal_Int32 getTokenIndex() const { return mnTokenIndex; }
/** Tries to resolve the defined name to an absolute cell range. */
bool getAbsoluteRange( ::com::sun::star::table::CellRangeAddress& orRange ) const;
private:
- /** Imports the OOX or OOBIN formula, using the passed formula context. */
+ /** Imports the OOXML or BIFF12 formula, using the passed formula context. */
void implImportOoxFormula( FormulaContext& rContext );
/** Imports the BIFF formula, using the passed formula context. */
void implImportBiffFormula( FormulaContext& rContext );
@@ -164,7 +166,7 @@ private:
sal_Int32 mnTokenIndex; /// Name index used in API token array.
sal_Int16 mnCalcSheet; /// Calc sheet index for sheet-local names.
sal_Unicode mcBuiltinId; /// Identifier for built-in defined names.
- StreamDataSeqPtr mxFormula; /// Formula data for OOBIN import.
+ StreamDataSeqPtr mxFormula; /// Formula data for BIFF12 import.
BiffStreamPosPtr mxBiffStrm; /// Cached BIFF stream for formula import.
sal_uInt16 mnFmlaSize; /// Cached BIFF formula size for formula import.
};
@@ -184,7 +186,7 @@ public:
/** Imports a defined name from the passed attribute set. */
DefinedNameRef importDefinedName( const AttributeList& rAttribs );
/** Imports a defined name from a DEFINEDNAME record in the passed stream. */
- void importDefinedName( RecordInputStream& rStrm );
+ void importDefinedName( SequenceInputStream& rStrm );
/** Imports a defined name from a DEFINEDNAME record in the passed BIFF stream. */
void importDefinedName( BiffInputStream& rStrm );
@@ -200,16 +202,27 @@ public:
If no local name is found, tries to find a matching global name.
@return Reference to the defined name or empty reference. */
DefinedNameRef getByModelName( const ::rtl::OUString& rModelName, sal_Int16 nCalcSheet = -1 ) const;
+ /** Returns a built-in defined name by its built-in identifier.
+ @param nSheet The sheet index of the built-in name.
+ @return Reference to the defined name or empty reference. */
+ DefinedNameRef getByBuiltinId( sal_Unicode cBuiltinId, sal_Int16 nCalcSheet ) const;
private:
DefinedNameRef createDefinedName();
private:
+ typedef ::std::pair< sal_Int16, ::rtl::OUString > SheetNameKey;
+ typedef ::std::pair< sal_Int16, sal_Unicode > BuiltinKey;
+
typedef RefVector< DefinedName > DefNameVector;
- typedef RefMap< sal_Int32, DefinedName > DefNameMap;
+ typedef RefMap< SheetNameKey, DefinedName > DefNameNameMap;
+ typedef RefMap< BuiltinKey, DefinedName > DefNameBuiltinMap;
+ typedef RefMap< sal_Int32, DefinedName > DefNameTokenIdMap;
DefNameVector maDefNames; /// List of all defined names in insertion order.
- DefNameMap maDefNameMap; /// Maps all defined names by API token index.
+ DefNameNameMap maModelNameMap; /// Maps all defined names by sheet index and model name.
+ DefNameBuiltinMap maBuiltinMap; /// Maps all defined names by sheet index and built-in identifier.
+ DefNameTokenIdMap maTokenIdMap; /// Maps all defined names by API token index.
sal_Int16 mnCalcSheet; /// Current sheet index for BIFF2-BIFF4 names (always sheet-local).
};
@@ -220,4 +233,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/drawingfragment.hxx b/oox/inc/oox/xls/drawingfragment.hxx
index 71d60433e4c6..d78b038cd3b4 100644
--- a/oox/inc/oox/xls/drawingfragment.hxx
+++ b/oox/inc/oox/xls/drawingfragment.hxx
@@ -32,15 +32,25 @@
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/Size.hpp>
#include "oox/drawingml/shape.hxx"
+#include "oox/drawingml/shapegroupcontext.hxx"
#include "oox/ole/axcontrol.hxx"
+#include "oox/ole/vbaproject.hxx"
#include "oox/vml/vmldrawing.hxx"
#include "oox/vml/vmldrawingfragment.hxx"
+#include "oox/vml/vmltextbox.hxx"
#include "oox/xls/excelhandlers.hxx"
+namespace oox { namespace ole {
+ struct AxFontData;
+ class AxMorphDataModelBase;
+} }
+
namespace oox {
namespace xls {
// ============================================================================
+// DrawingML
+// ============================================================================
/** Absolute position in spreadsheet (in EMUs) independent from cells. */
struct AnchorPosModel : public ::oox::drawingml::EmuPoint
@@ -102,6 +112,7 @@ public:
void importClientData( const AttributeList& rAttribs );
/** Sets an attribute of the cell-dependent anchor position from xdr:from and xdr:to elements. */
void setCellPos( sal_Int32 nElement, sal_Int32 nParentContext, const ::rtl::OUString& rValue );
+ /** Imports and converts the VML specific client anchor. */
void importVmlAnchor( const ::rtl::OUString& rAnchor );
/** Returns true, if the anchor contains valid position and size settings. */
@@ -133,19 +144,81 @@ typedef ::boost::shared_ptr< ShapeAnchor > ShapeAnchorRef;
// ============================================================================
+class ShapeMacroAttacher : public ::oox::ole::VbaMacroAttacherBase
+{
+public:
+ explicit ShapeMacroAttacher( const ::rtl::OUString& rMacroName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape );
+
+private:
+ virtual void attachMacro( const ::rtl::OUString& rMacroUrl );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxShape;
+};
+
+// ============================================================================
+
+class Shape : public ::oox::drawingml::Shape, public WorksheetHelper
+{
+public:
+ explicit Shape(
+ const WorksheetHelper& rHelper,
+ const AttributeList& rAttribs,
+ const sal_Char* pcServiceName = 0 );
+
+protected:
+ virtual void finalizeXShape(
+ ::oox::core::XmlFilterBase& rFilter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
+
+private:
+ ::rtl::OUString maMacroName;
+};
+
+// ============================================================================
+
+/** Context handler for creation of shapes embedded in group shapes. */
+class GroupShapeContext : public ::oox::drawingml::ShapeGroupContext, public WorksheetHelper
+{
+public:
+ explicit GroupShapeContext(
+ ::oox::core::ContextHandler& rParent,
+ const WorksheetHelper& rHelper,
+ const ::oox::drawingml::ShapePtr& rxParentShape,
+ const ::oox::drawingml::ShapePtr& rxShape );
+
+ static ::oox::core::ContextHandlerRef
+ createShapeContext(
+ ::oox::core::ContextHandler& rParent,
+ const WorksheetHelper& rHelper,
+ sal_Int32 nElement,
+ const AttributeList& rAttribs,
+ const ::oox::drawingml::ShapePtr& rxParentShape,
+ ::oox::drawingml::ShapePtr* pxShape = 0 );
+
+protected:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
+ createFastChildContext(
+ sal_Int32 nElement,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+};
+
+// ============================================================================
+
/** Fragment handler for a complete sheet drawing. */
-class OoxDrawingFragment : public OoxWorksheetFragmentBase
+class DrawingFragment : public WorksheetFragmentBase
{
public:
- explicit OoxDrawingFragment(
+ explicit DrawingFragment(
const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
private:
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
@@ -157,6 +230,27 @@ private:
};
// ============================================================================
+// VML
+// ============================================================================
+
+class VmlControlMacroAttacher : public ::oox::ole::VbaMacroAttacherBase
+{
+public:
+ explicit VmlControlMacroAttacher( const ::rtl::OUString& rMacroName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& rxCtrlFormIC,
+ sal_Int32 nCtrlIndex, sal_Int32 nCtrlType, sal_Int32 nDropStyle );
+
+private:
+ virtual void attachMacro( const ::rtl::OUString& rMacroUrl );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > mxCtrlFormIC;
+ sal_Int32 mnCtrlIndex;
+ sal_Int32 mnCtrlType;
+ sal_Int32 mnDropStyle;
+};
+
+// ============================================================================
class VmlDrawing : public ::oox::vml::Drawing, public WorksheetHelper
{
@@ -169,33 +263,55 @@ public:
/** Filters cell note shapes. */
virtual bool isShapeSupported( const ::oox::vml::ShapeBase& rShape ) const;
+ /** Returns additional base names for automatic shape name creation. */
+ virtual ::rtl::OUString getShapeBaseName( const ::oox::vml::ShapeBase& rShape ) const;
+
/** Calculates the shape rectangle from a cell anchor string. */
- virtual bool convertShapeClientAnchor(
+ virtual bool convertClientAnchor(
::com::sun::star::awt::Rectangle& orShapeRect,
const ::rtl::OUString& rShapeAnchor ) const;
- /** Converts additional form control properties from the passed VML shape
- client data. */
- virtual void convertControlClientData(
- const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel,
- const ::oox::vml::ShapeClientData& rClientData ) const;
+ /** Creates a UNO control shape for legacy drawing controls. */
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ createAndInsertClientXShape(
+ const ::oox::vml::ShapeBase& rShape,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
+ const ::com::sun::star::awt::Rectangle& rShapeRect ) const;
/** Updates the bounding box covering all shapes of this drawing. */
- virtual void notifyShapeInserted(
+ virtual void notifyXShapeInserted(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
- const ::com::sun::star::awt::Rectangle& rShapeRect );
+ const ::com::sun::star::awt::Rectangle& rShapeRect,
+ const ::oox::vml::ShapeBase& rShape, bool bGroupChild );
private:
- ::oox::ole::ControlConverter maControlConv;
+ /** Converts the passed VML textbox text color to an OLE color. */
+ sal_uInt32 convertControlTextColor( const ::rtl::OUString& rTextColor ) const;
+ /** Converts the passed VML textbox font to an ActiveX form control font. */
+ void convertControlFontData(
+ ::oox::ole::AxFontData& rAxFontData, sal_uInt32& rnOleTextColor,
+ const ::oox::vml::TextFontModel& rFontModel ) const;
+ /** Converts the caption, the font settings, and the horizontal alignment
+ from the passed VML textbox to ActiveX form control settings. */
+ void convertControlText(
+ ::oox::ole::AxFontData& rAxFontData, sal_uInt32& rnOleTextColor, ::rtl::OUString& rCaption,
+ const ::oox::vml::TextBox* pTextBox, sal_Int32 nTextHAlign ) const;
+ /** Converts the passed VML shape background formatting to ActiveX control formatting. */
+ void convertControlBackground(
+ ::oox::ole::AxMorphDataModelBase& rAxModel,
+ const ::oox::vml::ShapeBase& rShape ) const;
+private:
+ ::oox::ole::ControlConverter maControlConv;
+ ::oox::vml::TextFontModel maListBoxFont;
};
// ============================================================================
-class OoxVmlDrawingFragment : public ::oox::vml::DrawingFragment, public WorksheetHelper
+class VmlDrawingFragment : public ::oox::vml::DrawingFragment, public WorksheetHelper
{
public:
- explicit OoxVmlDrawingFragment(
+ explicit VmlDrawingFragment(
const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
@@ -210,4 +326,4 @@ protected:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/excelchartconverter.hxx b/oox/inc/oox/xls/excelchartconverter.hxx
index 9d0562dab7b8..2a4d44325f72 100644
--- a/oox/inc/oox/xls/excelchartconverter.hxx
+++ b/oox/inc/oox/xls/excelchartconverter.hxx
@@ -61,4 +61,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/excelfilter.hxx b/oox/inc/oox/xls/excelfilter.hxx
index f3e4a571653c..aa4e1f7a449e 100644
--- a/oox/inc/oox/xls/excelfilter.hxx
+++ b/oox/inc/oox/xls/excelfilter.hxx
@@ -29,8 +29,8 @@
#ifndef OOX_XLS_EXCELFILTER_HXX
#define OOX_XLS_EXCELFILTER_HXX
-#include "oox/core/xmlfilterbase.hxx"
#include "oox/core/binaryfilterbase.hxx"
+#include "oox/core/xmlfilterbase.hxx"
#include "oox/ole/vbaprojectfilter.hxx"
namespace oox {
@@ -61,7 +61,8 @@ class ExcelFilter : public ::oox::core::XmlFilterBase, public ExcelFilterBase
{
public:
explicit ExcelFilter(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~ExcelFilter();
virtual bool importDocument() throw();
@@ -76,6 +77,7 @@ public:
private:
virtual GraphicHelper* implCreateGraphicHelper() const;
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
virtual ::rtl::OUString implGetImplementationName() const;
};
@@ -85,7 +87,8 @@ class ExcelBiffFilter : public ::oox::core::BinaryFilterBase, public ExcelFilter
{
public:
explicit ExcelBiffFilter(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~ExcelBiffFilter();
virtual bool importDocument() throw();
@@ -93,6 +96,7 @@ public:
private:
virtual GraphicHelper* implCreateGraphicHelper() const;
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
virtual ::rtl::OUString implGetImplementationName() const;
};
@@ -102,19 +106,20 @@ class ExcelVbaProjectFilter : public ExcelBiffFilter
{
public:
explicit ExcelVbaProjectFilter(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual bool importDocument() throw();
+ virtual bool exportDocument() throw();
private:
virtual ::rtl::OUString implGetImplementationName() const;
};
-
-// ============================================================================
+ // ============================================================================
} // namespace xls
} // namespace oox
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/excelhandlers.hxx b/oox/inc/oox/xls/excelhandlers.hxx
index 25e5f5e7f2ed..28d8c527c878 100644
--- a/oox/inc/oox/xls/excelhandlers.hxx
+++ b/oox/inc/oox/xls/excelhandlers.hxx
@@ -42,17 +42,17 @@ namespace xls {
Used to import contexts in global workbook fragments.
*/
-class OoxWorkbookContextBase : public ::oox::core::ContextHandler2, public WorkbookHelper
+class WorkbookContextBase : public ::oox::core::ContextHandler2, public WorkbookHelper
{
public:
template< typename ParentType >
- explicit OoxWorkbookContextBase( ParentType& rParent );
+ explicit WorkbookContextBase( ParentType& rParent );
};
// ----------------------------------------------------------------------------
template< typename ParentType >
-OoxWorkbookContextBase::OoxWorkbookContextBase( ParentType& rParent ) :
+WorkbookContextBase::WorkbookContextBase( ParentType& rParent ) :
::oox::core::ContextHandler2( rParent ),
WorkbookHelper( rParent )
{
@@ -64,32 +64,32 @@ OoxWorkbookContextBase::OoxWorkbookContextBase( ParentType& rParent ) :
Used to import contexts in sheet fragments.
*/
-class OoxWorksheetContextBase : public ::oox::core::ContextHandler2, public WorksheetHelperRoot
+class WorksheetContextBase : public ::oox::core::ContextHandler2, public WorksheetHelperRoot
{
public:
template< typename ParentType >
- explicit OoxWorksheetContextBase(
+ explicit WorksheetContextBase(
ParentType& rParent,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
template< typename ParentType >
- explicit OoxWorksheetContextBase( ParentType& rParent );
+ explicit WorksheetContextBase( ParentType& rParent );
};
// ----------------------------------------------------------------------------
template< typename ParentType >
-OoxWorksheetContextBase::OoxWorksheetContextBase( ParentType& rParent,
- ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+WorksheetContextBase::WorksheetContextBase( ParentType& rParent,
+ const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
::oox::core::ContextHandler2( rParent ),
- WorksheetHelperRoot( rParent, xProgressBar, eSheetType, nSheet )
+ WorksheetHelperRoot( rParent, rxProgressBar, eSheetType, nSheet )
{
}
template< typename ParentType >
-OoxWorksheetContextBase::OoxWorksheetContextBase( ParentType& rParent ) :
+WorksheetContextBase::WorksheetContextBase( ParentType& rParent ) :
::oox::core::ContextHandler2( rParent ),
WorksheetHelperRoot( rParent )
{
@@ -101,10 +101,10 @@ OoxWorksheetContextBase::OoxWorksheetContextBase( ParentType& rParent ) :
Used to import global workbook fragments.
*/
-class OoxWorkbookFragmentBase : public ::oox::core::FragmentHandler2, public WorkbookHelper
+class WorkbookFragmentBase : public ::oox::core::FragmentHandler2, public WorkbookHelper
{
public:
- explicit OoxWorkbookFragmentBase(
+ explicit WorkbookFragmentBase(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
};
@@ -115,17 +115,17 @@ public:
Used to import sheet fragments.
*/
-class OoxWorksheetFragmentBase : public ::oox::core::FragmentHandler2, public WorksheetHelperRoot
+class WorksheetFragmentBase : public ::oox::core::FragmentHandler2, public WorksheetHelperRoot
{
public:
- explicit OoxWorksheetFragmentBase(
+ explicit WorksheetFragmentBase(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
- explicit OoxWorksheetFragmentBase(
+ explicit WorksheetFragmentBase(
const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
};
@@ -133,72 +133,21 @@ public:
// ============================================================================
// ============================================================================
-/** An enumeration for all types of fragments in a BIFF workbook stream. */
-enum BiffFragmentType
-{
- BIFF_FRAGMENT_GLOBALS, /// Workbook globals fragment.
- BIFF_FRAGMENT_WORKSHEET, /// Worksheet fragment.
- BIFF_FRAGMENT_CHARTSHEET, /// Chart sheet fragment.
- BIFF_FRAGMENT_MACROSHEET, /// Macro sheet fragment.
- BIFF_FRAGMENT_MODULESHEET, /// BIFF5 VB module fragment.
- BIFF_FRAGMENT_EMPTYSHEET, /// Sheet fragment of unsupported type.
- BIFF_FRAGMENT_WORKSPACE, /// BIFF4 workspace/workbook globals.
- BIFF_FRAGMENT_UNKNOWN /// Unknown fragment/error.
-};
-
-// ============================================================================
-
-/** Base class for all BIFF context handlers and fragment handlers.
-
- This base class holds a reference to the BIFF input stream which can be
- accessed in all derived classes.
- */
-class BiffHandlerBase
-{
-protected:
- inline explicit BiffHandlerBase( BiffInputStream& rStrm ) : mrStrm( rStrm ) {}
- virtual ~BiffHandlerBase();
-
- /** Skips a block of records up to the specified end record.
-
- Skips all records until next end record. When this function returns,
- stream points to the end record, and the next call of startNextRecord()
- at the stream will start the record following the end record.
-
- The identifier of the record that is active while this function is
- called is used as start record identifier. This identifier is used to
- correctly skip embedded record blocks with the same start and end
- record identifier.
-
- @return True = stream points to the end record.
- */
- bool skipRecordBlock( sal_uInt16 nEndRecId );
-
- /** @return True = current record identifier is a BOF record. */
- bool isBofRecord() const;
-
-protected:
- BiffInputStream& mrStrm;
-};
-
-// ============================================================================
-
/** Base class for all BIFF context handlers.
Derived handlers have to implement the importRecord() function that has to
- import the record the BIFF input stream currently points to.
+ import the record the passed BIFF input stream currently points to.
*/
-class BiffContextHandler : public BiffHandlerBase
+class BiffContextHandler
{
public:
- /** Derived classes have to implement importing the current record. */
- virtual void importRecord() = 0;
+ virtual ~BiffContextHandler();
-protected:
- explicit BiffContextHandler( const BiffHandlerBase& rParent );
+ /** Derived classes have to implement importing the current record. */
+ virtual void importRecord( BiffInputStream& rStrm ) = 0;
};
-// ============================================================================
+// ----------------------------------------------------------------------------
/** Context handler derived from the WorkbookHelper helper class.
@@ -207,21 +156,11 @@ protected:
class BiffWorkbookContextBase : public BiffContextHandler, public WorkbookHelper
{
protected:
- template< typename ParentType >
- explicit BiffWorkbookContextBase( const ParentType& rParent );
+ explicit BiffWorkbookContextBase( const WorkbookHelper& rHelper );
};
// ----------------------------------------------------------------------------
-template< typename ParentType >
-BiffWorkbookContextBase::BiffWorkbookContextBase( const ParentType& rParent ) :
- BiffContextHandler( rParent ),
- WorkbookHelper( rParent )
-{
-}
-
-// ============================================================================
-
/** Context handler derived from the WorksheetHelper helper class.
Used to import contexts in sheet fragments.
@@ -229,68 +168,48 @@ BiffWorkbookContextBase::BiffWorkbookContextBase( const ParentType& rParent ) :
class BiffWorksheetContextBase : public BiffContextHandler, public WorksheetHelperRoot
{
protected:
- template< typename ParentType >
explicit BiffWorksheetContextBase(
- const ParentType& rParent,
- ISegmentProgressBarRef xProgressBar,
+ const WorkbookHelper& rHelper,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
- template< typename ParentType >
- explicit BiffWorksheetContextBase( const ParentType& rParent );
+ explicit BiffWorksheetContextBase( const WorksheetHelper& rHelper );
};
-// ----------------------------------------------------------------------------
-
-template< typename ParentType >
-BiffWorksheetContextBase::BiffWorksheetContextBase( const ParentType& rParent,
- ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
- BiffContextHandler( rParent ),
- WorksheetHelperRoot( rParent, xProgressBar, eSheetType, nSheet )
-{
-}
-
-template< typename ParentType >
-BiffWorksheetContextBase::BiffWorksheetContextBase( const ParentType& rParent ) :
- BiffContextHandler( rParent ),
- WorksheetHelperRoot( rParent )
-{
-}
-
// ============================================================================
-namespace prv {
-
-struct BiffFragmentStreamOwner
+/** An enumeration for all types of fragments in a BIFF workbook stream. */
+enum BiffFragmentType
{
- typedef ::boost::shared_ptr< BinaryXInputStream > XInputStreamRef;
- typedef ::boost::shared_ptr< BiffInputStream > BiffInputStreamRef;
-
- XInputStreamRef mxXInStrm;
- BiffInputStreamRef mxBiffStrm;
-
- explicit BiffFragmentStreamOwner( const ::oox::core::FilterBase& rFilter, const ::rtl::OUString& rStrmName );
- virtual ~BiffFragmentStreamOwner();
+ BIFF_FRAGMENT_GLOBALS, /// Workbook globals fragment.
+ BIFF_FRAGMENT_WORKSHEET, /// Worksheet fragment.
+ BIFF_FRAGMENT_CHARTSHEET, /// Chart sheet fragment.
+ BIFF_FRAGMENT_MACROSHEET, /// Macro sheet fragment.
+ BIFF_FRAGMENT_MODULESHEET, /// BIFF5 VB module fragment.
+ BIFF_FRAGMENT_EMPTYSHEET, /// Sheet fragment of unsupported type.
+ BIFF_FRAGMENT_WORKSPACE, /// BIFF4 workspace/workbook globals.
+ BIFF_FRAGMENT_UNKNOWN /// Unknown fragment/error.
};
-} // namespace prv
-
// ----------------------------------------------------------------------------
-class BiffFragmentHandler : private prv::BiffFragmentStreamOwner, public BiffHandlerBase
+class BiffFragmentHandler
{
public:
- /** Imports the fragment, returns true, if EOF record has been reached. */
- virtual bool importFragment() = 0;
-
-protected:
/** Opens the stream with the passed full name. */
explicit BiffFragmentHandler(
const ::oox::core::FilterBase& rFilter,
const ::rtl::OUString& rStrmName );
- /** Reuses the stream of the passed fragment. */
- explicit BiffFragmentHandler( const BiffFragmentHandler& rHandler );
+ virtual ~BiffFragmentHandler();
+
+ /** Imports the fragment, returns true, if EOF record has been reached. */
+ virtual bool importFragment() = 0;
+
+protected:
+ /** Returns the BIFF input stream of this fragment. */
+ inline BiffInputStream& getInputStream() { return *mxBiffStrm; }
/** Starts a new fragment in a workbbok stream and returns the fragment type.
@@ -327,11 +246,14 @@ protected:
bool skipFragment();
private:
- /** Implementation helper for the startFragment() functions. */
- BiffFragmentType implStartFragment( BiffType eBiff );
+ typedef ::boost::shared_ptr< BinaryXInputStream > XInputStreamRef;
+ typedef ::boost::shared_ptr< BiffInputStream > BiffInputStreamRef;
+
+ XInputStreamRef mxXInStrm;
+ BiffInputStreamRef mxBiffStrm;
};
-// ============================================================================
+// ----------------------------------------------------------------------------
/** Fragment handler derived from the WorkbookHelper helper class.
@@ -346,7 +268,7 @@ protected:
bool bCloneDecoder = false );
};
-// ============================================================================
+// ----------------------------------------------------------------------------
/** Fragment handler derived from the WorksheetHelper helper class.
@@ -357,12 +279,12 @@ class BiffWorksheetFragmentBase : public BiffFragmentHandler, public WorksheetHe
protected:
explicit BiffWorksheetFragmentBase(
const BiffWorkbookFragmentBase& rParent,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
};
-// ============================================================================
+// ----------------------------------------------------------------------------
/** Special fragment handler for worksheets that have to be skipped.
*/
@@ -371,7 +293,7 @@ class BiffSkipWorksheetFragment : public BiffWorksheetFragmentBase
public:
explicit BiffSkipWorksheetFragment(
const BiffWorkbookFragmentBase& rParent,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
sal_Int16 nSheet );
virtual bool importFragment();
@@ -385,4 +307,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/excelvbaproject.hxx b/oox/inc/oox/xls/excelvbaproject.hxx
new file mode 100755
index 000000000000..016e63e7b7b0
--- /dev/null
+++ b/oox/inc/oox/xls/excelvbaproject.hxx
@@ -0,0 +1,68 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_XLS_EXCELVBAPROJECT_HXX
+#define OOX_XLS_EXCELVBAPROJECT_HXX
+
+#include "oox/ole/vbaproject.hxx"
+#include "oox/dllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace sheet { class XSpreadsheetDocument; }
+} } }
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+/** Special implementation of the VBA project for the Excel filters. */
+class OOX_DLLPUBLIC ExcelVbaProject : public ::oox::ole::VbaProject
+{
+public:
+ explicit ExcelVbaProject(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument >& rxDocument );
+
+protected:
+ /** Adds dummy modules for sheets without imported code name. */
+ virtual void prepareImport();
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument >
+ mxDocument;
+};
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/externallinkbuffer.hxx b/oox/inc/oox/xls/externallinkbuffer.hxx
index 38edd028c6d8..cb20e1987c8c 100644
--- a/oox/inc/oox/xls/externallinkbuffer.hxx
+++ b/oox/inc/oox/xls/externallinkbuffer.hxx
@@ -85,19 +85,19 @@ public:
void importOleItem( const AttributeList& rAttribs );
/** Imports the EXTERNALNAME record containing the name (only). */
- void importExternalName( RecordInputStream& rStrm );
+ void importExternalName( SequenceInputStream& rStrm );
/** Imports the EXTERNALNAMEFLAGS record containing the settings of an external name. */
- void importExternalNameFlags( RecordInputStream& rStrm );
+ void importExternalNameFlags( SequenceInputStream& rStrm );
/** Imports the DDEITEMVALUES record containing the size of the DDE result matrix. */
- void importDdeItemValues( RecordInputStream& rStrm );
+ void importDdeItemValues( SequenceInputStream& rStrm );
/** Imports the DDEITEM_BOOL record containing a boolean value in a link result. */
- void importDdeItemBool( RecordInputStream& rStrm );
+ void importDdeItemBool( SequenceInputStream& rStrm );
/** Imports the DDEITEM_DOUBLE record containing a double value in a link result. */
- void importDdeItemDouble( RecordInputStream& rStrm );
+ void importDdeItemDouble( SequenceInputStream& rStrm );
/** Imports the DDEITEM_ERROR record containing an error code in a link result. */
- void importDdeItemError( RecordInputStream& rStrm );
+ void importDdeItemError( SequenceInputStream& rStrm );
/** Imports the DDEITEM_STRING record containing a string in a link result. */
- void importDdeItemString( RecordInputStream& rStrm );
+ void importDdeItemString( SequenceInputStream& rStrm );
/** Imports the EXTERNALNAME record from the passed stream. */
void importExternalName( BiffInputStream& rStrm );
@@ -228,19 +228,19 @@ public:
ExternalNameRef importOleItem( const AttributeList& rAttribs );
/** Imports the EXTERNALBOOK record describing an externally linked document, DDE link, or OLE link. */
- void importExternalBook( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm );
+ void importExternalBook( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm );
/** Imports the EXTSHEETNAMES record containing the sheet names in an externally linked document. */
- void importExtSheetNames( RecordInputStream& rStrm );
+ void importExtSheetNames( SequenceInputStream& rStrm );
/** Imports the EXTERNALNAME record describing an external name. */
- ExternalNameRef importExternalName( RecordInputStream& rStrm );
+ ExternalNameRef importExternalName( SequenceInputStream& rStrm );
/** Imports the EXTERNALREF record from the passed stream. */
- void importExternalRef( RecordInputStream& rStrm );
+ void importExternalRef( SequenceInputStream& rStrm );
/** Imports the EXTERNALSELF record from the passed stream. */
- void importExternalSelf( RecordInputStream& rStrm );
+ void importExternalSelf( SequenceInputStream& rStrm );
/** Imports the EXTERNALSAME record from the passed stream. */
- void importExternalSame( RecordInputStream& rStrm );
+ void importExternalSame( SequenceInputStream& rStrm );
/** Imports the EXTERNALADDIN record from the passed stream. */
- void importExternalAddin( RecordInputStream& rStrm );
+ void importExternalAddin( SequenceInputStream& rStrm );
/** Imports the EXTERNSHEET record from the passed stream. */
void importExternSheet( BiffInputStream& rStrm );
@@ -249,6 +249,9 @@ public:
/** Imports the EXTERNALNAME record from the passed stream. */
void importExternalName( BiffInputStream& rStrm );
+ /** Sets the link type to 'self reference'. */
+ inline void setSelfLinkType() { meLinkType = LINKTYPE_SELF; }
+
/** Returns the type of this external link. */
inline ExternalLinkType getLinkType() const { return meLinkType; }
/** Returns true, if the link refers to the current workbook. */
@@ -315,10 +318,10 @@ typedef ::boost::shared_ptr< ExternalLink > ExternalLinkRef;
// ============================================================================
-/** Represents a REF entry in the OOBIN EXTERNALSHEETS or in the BIFF8
+/** Represents a REF entry in the BIFF12 EXTERNALSHEETS or in the BIFF8
EXTERNSHEET record.
- This struct is used to map ref identifiers to external books (OOBIN:
+ This struct is used to map ref identifiers to external books (BIFF12:
EXTERNALREF records, BIFF8: EXTERNALBOOK records), and provides sheet
indexes into the sheet list of the external document.
*/
@@ -330,7 +333,7 @@ struct RefSheetsModel
explicit RefSheetsModel();
- void readOobData( RecordInputStream& rStrm );
+ void readBiff12Data( SequenceInputStream& rStrm );
void readBiff8Data( BiffInputStream& rStrm );
};
@@ -345,15 +348,15 @@ public:
ExternalLinkRef importExternalReference( const AttributeList& rAttribs );
/** Imports the EXTERNALREF record from the passed stream. */
- ExternalLinkRef importExternalRef( RecordInputStream& rStrm );
+ ExternalLinkRef importExternalRef( SequenceInputStream& rStrm );
/** Imports the EXTERNALSELF record from the passed stream. */
- void importExternalSelf( RecordInputStream& rStrm );
+ void importExternalSelf( SequenceInputStream& rStrm );
/** Imports the EXTERNALSAME record from the passed stream. */
- void importExternalSame( RecordInputStream& rStrm );
+ void importExternalSame( SequenceInputStream& rStrm );
/** Imports the EXTERNALADDIN record from the passed stream. */
- void importExternalAddin( RecordInputStream& rStrm );
+ void importExternalAddin( SequenceInputStream& rStrm );
/** Imports the EXTERNALSHEETS record from the passed stream. */
- void importExternalSheets( RecordInputStream& rStrm );
+ void importExternalSheets( SequenceInputStream& rStrm );
/** Imports the EXTERNSHEET record from the passed stream. */
ExternalLinkRef importExternSheet( BiffInputStream& rStrm );
@@ -369,7 +372,7 @@ public:
getLinkInfos() const;
/** Returns the external link for the passed reference identifier. */
- ExternalLinkRef getExternalLink( sal_Int32 nRefId ) const;
+ ExternalLinkRef getExternalLink( sal_Int32 nRefId, bool bUseRefSheets = true ) const;
/** Returns the sheet range for the specified reference (BIFF2-BIFF5 only). */
LinkSheetRange getSheetRange( sal_Int32 nRefId, sal_Int16 nTabId1, sal_Int16 nTabId2 ) const;
@@ -387,10 +390,11 @@ private:
typedef RefVector< ExternalLink > ExternalLinkVec;
typedef ::std::vector< RefSheetsModel > RefSheetsModelVec;
+ ExternalLinkRef mxSelfRef; /// Implicit self reference at index 0.
ExternalLinkVec maLinks; /// List of link structures for all kinds of links.
ExternalLinkVec maExtLinks; /// Real external links needed for formula parser.
RefSheetsModelVec maRefSheets; /// Sheet indexes for reference ids.
- bool mbUseRefSheets; /// True = use maRefSheets list (OOBIN only).
+ bool mbUseRefSheets; /// True = use maRefSheets list (BIFF12 only).
};
// ============================================================================
@@ -400,4 +404,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/externallinkfragment.hxx b/oox/inc/oox/xls/externallinkfragment.hxx
index 8ae6e16f836f..e1fecb6703be 100644
--- a/oox/inc/oox/xls/externallinkfragment.hxx
+++ b/oox/inc/oox/xls/externallinkfragment.hxx
@@ -38,41 +38,40 @@ namespace xls {
class ExternalLink;
// ============================================================================
+// ============================================================================
/** This class implements importing the sheetData element in external sheets.
The sheetData element embedded in the externalBook element contains cached
cells from externally linked sheets.
*/
-class OoxExternalSheetDataContext : public OoxWorkbookContextBase
+class ExternalSheetDataContext : public WorkbookContextBase
{
public:
- explicit OoxExternalSheetDataContext(
- OoxWorkbookFragmentBase& rFragment,
+ explicit ExternalSheetDataContext(
+ WorkbookFragmentBase& rFragment,
const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XExternalSheetCache >& rxSheetCache );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
private:
/** Imports cell settings from a c element. */
void importCell( const AttributeList& rAttribs );
/** Imports the EXTCELL_BLANK from the passed stream. */
- void importExtCellBlank( RecordInputStream& rStrm );
+ void importExtCellBlank( SequenceInputStream& rStrm );
/** Imports the EXTCELL_BOOL from the passed stream. */
- void importExtCellBool( RecordInputStream& rStrm );
+ void importExtCellBool( SequenceInputStream& rStrm );
/** Imports the EXTCELL_DOUBLE from the passed stream. */
- void importExtCellDouble( RecordInputStream& rStrm );
+ void importExtCellDouble( SequenceInputStream& rStrm );
/** Imports the EXTCELL_ERROR from the passed stream. */
- void importExtCellError( RecordInputStream& rStrm );
+ void importExtCellError( SequenceInputStream& rStrm );
/** Imports the EXTCELL_STRING from the passed stream. */
- void importExtCellString( RecordInputStream& rStrm );
+ void importExtCellString( SequenceInputStream& rStrm );
/** Sets the passed cell value to the current position in the sheet cache. */
void setCellValue( const ::com::sun::star::uno::Any& rValue );
@@ -86,23 +85,20 @@ private:
// ============================================================================
-class OoxExternalLinkFragment : public OoxWorkbookFragmentBase
+class ExternalLinkFragment : public WorkbookFragmentBase
{
public:
- explicit OoxExternalLinkFragment(
+ explicit ExternalLinkFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath,
ExternalLink& rExtLink );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
-
- // oox.core.FragmentHandler2 interface ------------------------------------
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
@@ -117,29 +113,24 @@ private:
};
// ============================================================================
+// ============================================================================
-class BiffExternalLinkFragment : public BiffWorkbookFragmentBase
+class BiffExternalSheetDataContext : public BiffWorkbookContextBase
{
public:
- explicit BiffExternalLinkFragment( const BiffWorkbookFragmentBase& rParent, bool bImportDefNames );
- virtual ~BiffExternalLinkFragment();
-
- /** Imports all records related to external links. */
- virtual bool importFragment();
+ explicit BiffExternalSheetDataContext( const WorkbookHelper& rHelper, bool bImportDefNames );
+ virtual ~BiffExternalSheetDataContext();
/** Tries to import a record related to external links and defined names. */
- void importRecord();
-
- /** Finalizes buffers related to external links and defined names. */
- void finalizeImport();
+ virtual void importRecord( BiffInputStream& rStrm );
private:
- void importExternSheet();
- void importExternalBook();
- void importExternalName();
- void importXct();
- void importCrn();
- void importDefinedName();
+ void importExternSheet( BiffInputStream& rStrm );
+ void importExternalBook( BiffInputStream& rStrm );
+ void importExternalName( BiffInputStream& rStrm );
+ void importXct( BiffInputStream& rStrm );
+ void importCrn( BiffInputStream& rStrm );
+ void importDefinedName( BiffInputStream& rStrm );
/** Sets the passed cell value to the passed position in the sheet cache. */
void setCellValue( const BinAddress& rBinAddr, const ::com::sun::star::uno::Any& rValue );
@@ -153,9 +144,21 @@ private:
// ============================================================================
+class BiffExternalLinkFragment : public BiffWorkbookFragmentBase
+{
+public:
+ explicit BiffExternalLinkFragment( const BiffWorkbookFragmentBase& rParent );
+
+ /** Imports all records related to external links. */
+ virtual bool importFragment();
+};
+
+// ============================================================================
+// ============================================================================
+
} // namespace xls
} // namespace oox
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/formulabase.hxx b/oox/inc/oox/xls/formulabase.hxx
index 58335ed1c006..0baf98b372c7 100644
--- a/oox/inc/oox/xls/formulabase.hxx
+++ b/oox/inc/oox/xls/formulabase.hxx
@@ -29,19 +29,19 @@
#ifndef OOX_XLS_FORMULABASE_HXX
#define OOX_XLS_FORMULABASE_HXX
-#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/sheet/FormulaOpCodeMapEntry.hpp>
+#include <com/sun/star/sheet/FormulaToken.hpp>
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
-#include <com/sun/star/sheet/FormulaToken.hpp>
-#include <com/sun/star/sheet/FormulaOpCodeMapEntry.hpp>
-#include "oox/helper/containerhelper.hxx"
+#include <com/sun/star/uno/Sequence.hxx>
#include "oox/helper/propertyset.hxx"
+#include "oox/helper/refvector.hxx"
#include "oox/xls/addressconverter.hxx"
namespace com { namespace sun { namespace star {
+ namespace sheet { class XFormulaOpCodeMapper; }
namespace sheet { class XFormulaParser; }
namespace sheet { class XFormulaTokens; }
- namespace sheet { class XFormulaOpCodeMapper; }
} } }
namespace oox { template< typename Type > class Matrix; }
@@ -127,24 +127,14 @@ const sal_uInt8 BIFF_TOKID_AREAERR3D = 0x1D; /// Deleted 3D area
// specific token constants ---------------------------------------------------
-const sal_uInt8 OOBIN_TOK_ARRAY_DOUBLE = 0;
-const sal_uInt8 OOBIN_TOK_ARRAY_STRING = 1;
-const sal_uInt8 OOBIN_TOK_ARRAY_BOOL = 2;
-const sal_uInt8 OOBIN_TOK_ARRAY_ERROR = 4;
+const sal_uInt8 BIFF_TOK_ARRAY_DOUBLE = 0; /// Double value in an array.
+const sal_uInt8 BIFF_TOK_ARRAY_STRING = 1; /// String value in an array.
+const sal_uInt8 BIFF_TOK_ARRAY_BOOL = 2; /// Boolean value in an array.
+const sal_uInt8 BIFF_TOK_ARRAY_ERROR = 4; /// Error code in an array.
const sal_uInt8 BIFF_TOK_BOOL_FALSE = 0; /// FALSE value of a tBool token.
const sal_uInt8 BIFF_TOK_BOOL_TRUE = 1; /// TRUE value of a tBool token.
-const sal_uInt8 OOBIN_TOK_ATTR_VOLATILE = 0x01; /// Volatile function.
-const sal_uInt8 OOBIN_TOK_ATTR_IF = 0x02; /// Start of true condition in IF function.
-const sal_uInt8 OOBIN_TOK_ATTR_CHOOSE = 0x04; /// Jump array of CHOOSE function.
-const sal_uInt8 OOBIN_TOK_ATTR_SKIP = 0x08; /// Skip tokens.
-const sal_uInt8 OOBIN_TOK_ATTR_SUM = 0x10; /// SUM function with one parameter.
-const sal_uInt8 OOBIN_TOK_ATTR_ASSIGN = 0x20; /// BASIC style assignment.
-const sal_uInt8 OOBIN_TOK_ATTR_SPACE = 0x40; /// Spaces in formula representation.
-const sal_uInt8 OOBIN_TOK_ATTR_SPACE_VOLATILE = 0x41; /// Leading spaces and volatile formula.
-const sal_uInt8 OOBIN_TOK_ATTR_IFERROR = 0x80; /// Start of condition in IFERROR function.
-
const sal_uInt8 BIFF_TOK_ATTR_VOLATILE = 0x01; /// Volatile function.
const sal_uInt8 BIFF_TOK_ATTR_IF = 0x02; /// Start of true condition in IF function.
const sal_uInt8 BIFF_TOK_ATTR_CHOOSE = 0x04; /// Jump array of CHOOSE function.
@@ -153,6 +143,7 @@ const sal_uInt8 BIFF_TOK_ATTR_SUM = 0x10; /// SUM function wit
const sal_uInt8 BIFF_TOK_ATTR_ASSIGN = 0x20; /// BASIC style assignment.
const sal_uInt8 BIFF_TOK_ATTR_SPACE = 0x40; /// Spaces in formula representation.
const sal_uInt8 BIFF_TOK_ATTR_SPACE_VOLATILE = 0x41; /// Leading spaces and volatile formula.
+const sal_uInt8 BIFF_TOK_ATTR_IFERROR = 0x80; /// Start of condition in IFERROR function (BIFF12 only).
const sal_uInt8 BIFF_TOK_ATTR_SPACE_SP = 0x00; /// Spaces before next token.
const sal_uInt8 BIFF_TOK_ATTR_SPACE_BR = 0x01; /// Line breaks before next token.
@@ -167,27 +158,27 @@ const sal_uInt16 BIFF_TOK_FUNCVAR_FUNCIDMASK = 0x7FFF; /// Mask for functio
const sal_uInt8 BIFF_TOK_FUNCVAR_CMDPROMPT = 0x80; /// User prompt for macro commands.
const sal_uInt8 BIFF_TOK_FUNCVAR_COUNTMASK = 0x7F; /// Mask for parameter count.
-const sal_uInt16 OOBIN_TOK_REF_COLMASK = 0x3FFF; /// Mask to extract column from reference.
-const sal_Int32 OOBIN_TOK_REF_ROWMASK = 0xFFFFF; /// Mask to extract row from reference.
-const sal_uInt16 OOBIN_TOK_REF_COLREL = 0x4000; /// True = column is relative.
-const sal_uInt16 OOBIN_TOK_REF_ROWREL = 0x8000; /// True = row is relative.
+const sal_uInt16 BIFF12_TOK_REF_COLMASK = 0x3FFF; /// Mask to extract column from reference (BIFF12).
+const sal_Int32 BIFF12_TOK_REF_ROWMASK = 0xFFFFF; /// Mask to extract row from reference (BIFF12).
+const sal_uInt16 BIFF12_TOK_REF_COLREL = 0x4000; /// True = column is relative (BIFF12).
+const sal_uInt16 BIFF12_TOK_REF_ROWREL = 0x8000; /// True = row is relative (BIFF12).
const sal_uInt16 BIFF_TOK_REF_COLMASK = 0x00FF; /// Mask to extract BIFF8 column from reference.
const sal_uInt16 BIFF_TOK_REF_ROWMASK = 0x3FFF; /// Mask to extract BIFF2-BIFF5 row from reference.
const sal_uInt16 BIFF_TOK_REF_COLREL = 0x4000; /// True = column is relative.
const sal_uInt16 BIFF_TOK_REF_ROWREL = 0x8000; /// True = row is relative.
-const sal_uInt16 OOBIN_TOK_TABLE_COLUMN = 0x0001; /// Table reference: Single column.
-const sal_uInt16 OOBIN_TOK_TABLE_COLRANGE = 0x0002; /// Table reference: Range of columns.
-const sal_uInt16 OOBIN_TOK_TABLE_ALL = 0x0004; /// Table reference: Special [#All] range.
-const sal_uInt16 OOBIN_TOK_TABLE_HEADERS = 0x0008; /// Table reference: Special [#Headers] range.
-const sal_uInt16 OOBIN_TOK_TABLE_DATA = 0x0010; /// Table reference: Special [#Data] range.
-const sal_uInt16 OOBIN_TOK_TABLE_TOTALS = 0x0020; /// Table reference: Special [#Totals] range.
-const sal_uInt16 OOBIN_TOK_TABLE_THISROW = 0x0040; /// Table reference: Special [#This Row] range.
-const sal_uInt16 OOBIN_TOK_TABLE_SP_BRACKETS = 0x0080; /// Table reference: Spaces in outer brackets.
-const sal_uInt16 OOBIN_TOK_TABLE_SP_SEP = 0x0100; /// Table reference: Spaces after separators.
-const sal_uInt16 OOBIN_TOK_TABLE_ROW = 0x0200; /// Table reference: Single row.
-const sal_uInt16 OOBIN_TOK_TABLE_CELL = 0x0400; /// Table reference: Single cell.
+const sal_uInt16 BIFF12_TOK_TABLE_COLUMN = 0x0001; /// Table reference: Single column.
+const sal_uInt16 BIFF12_TOK_TABLE_COLRANGE = 0x0002; /// Table reference: Range of columns.
+const sal_uInt16 BIFF12_TOK_TABLE_ALL = 0x0004; /// Table reference: Special [#All] range.
+const sal_uInt16 BIFF12_TOK_TABLE_HEADERS = 0x0008; /// Table reference: Special [#Headers] range.
+const sal_uInt16 BIFF12_TOK_TABLE_DATA = 0x0010; /// Table reference: Special [#Data] range.
+const sal_uInt16 BIFF12_TOK_TABLE_TOTALS = 0x0020; /// Table reference: Special [#Totals] range.
+const sal_uInt16 BIFF12_TOK_TABLE_THISROW = 0x0040; /// Table reference: Special [#This Row] range.
+const sal_uInt16 BIFF12_TOK_TABLE_SP_BRACKETS = 0x0080; /// Table reference: Spaces in outer brackets.
+const sal_uInt16 BIFF12_TOK_TABLE_SP_SEP = 0x0100; /// Table reference: Spaces after separators.
+const sal_uInt16 BIFF12_TOK_TABLE_ROW = 0x0200; /// Table reference: Single row.
+const sal_uInt16 BIFF12_TOK_TABLE_CELL = 0x0400; /// Table reference: Single cell.
const sal_uInt8 BIFF_TOK_NLR_ERR = 0x01; /// NLR: Invalid/deleted.
const sal_uInt8 BIFF_TOK_NLR_ROWR = 0x02; /// NLR: Row index.
@@ -210,23 +201,21 @@ const sal_uInt32 BIFF_TOK_NLR_ADDMASK = 0x3FFFFFFF; /// Mask for num
// function constants ---------------------------------------------------------
-const sal_uInt8 OOX_MAX_PARAMCOUNT = 255; /// Maximum parameter count for OOXML/OOBIN files.
-const sal_uInt8 BIFF_MAX_PARAMCOUNT = 30; /// Maximum parameter count for BIFF files.
-
-const sal_uInt16 OOBIN_FUNC_IF = 1; /// OOBIN function id of the IF function.
-const sal_uInt16 OOBIN_FUNC_SUM = 4; /// OOBIN function id of the SUM function.
-const sal_uInt16 OOBIN_FUNC_TRUE = 34; /// OOBIN function id of the TRUE function.
-const sal_uInt16 OOBIN_FUNC_FALSE = 35; /// OOBIN function id of the FALSE function.
-const sal_uInt16 OOBIN_FUNC_ROWS = 76; /// OOBIN function id of the ROWS function.
-const sal_uInt16 OOBIN_FUNC_COLUMNS = 77; /// OOBIN function id of the COLUMNS function.
-const sal_uInt16 OOBIN_FUNC_OFFSET = 78; /// OOBIN function id of the OFFSET function.
-const sal_uInt16 OOBIN_FUNC_FLOOR = 285; /// OOBIN function id of the FLOOR function.
-const sal_uInt16 OOBIN_FUNC_CEILING = 288; /// OOBIN function id of the CEILING function.
-const sal_uInt16 OOBIN_FUNC_HYPERLINK = 359; /// OOBIN function id of the HYPERLINK function.
-const sal_uInt16 OOBIN_FUNC_WEEKNUM = 465; /// OOBIN function id of the WEEKNUM function.
-
-const sal_uInt16 BIFF_FUNC_SUM = 4; /// BIFF function id of the SUM function.
+const sal_uInt8 OOX_MAX_PARAMCOUNT = 255; /// Maximum parameter count for OOXML/BIFF12 files.
+const sal_uInt8 BIFF_MAX_PARAMCOUNT = 30; /// Maximum parameter count for BIFF2-BIFF8 files.
+
+const sal_uInt16 BIFF_FUNC_IF = 1; /// Function identifier of the IF function.
+const sal_uInt16 BIFF_FUNC_SUM = 4; /// Function identifier of the SUM function.
+const sal_uInt16 BIFF_FUNC_TRUE = 34; /// Function identifier of the TRUE function.
+const sal_uInt16 BIFF_FUNC_FALSE = 35; /// Function identifier of the FALSE function.
+const sal_uInt16 BIFF_FUNC_ROWS = 76; /// Function identifier of the ROWS function.
+const sal_uInt16 BIFF_FUNC_COLUMNS = 77; /// Function identifier of the COLUMNS function.
+const sal_uInt16 BIFF_FUNC_OFFSET = 78; /// Function identifier of the OFFSET function.
const sal_uInt16 BIFF_FUNC_EXTERNCALL = 255; /// BIFF function id of the EXTERN.CALL function.
+const sal_uInt16 BIFF_FUNC_FLOOR = 285; /// Function identifier of the FLOOR function.
+const sal_uInt16 BIFF_FUNC_CEILING = 288; /// Function identifier of the CEILING function.
+const sal_uInt16 BIFF_FUNC_HYPERLINK = 359; /// Function identifier of the HYPERLINK function.
+const sal_uInt16 BIFF_FUNC_WEEKNUM = 465; /// Function identifier of the WEEKNUM function.
// reference helpers ==========================================================
@@ -240,11 +229,11 @@ struct BinSingleRef2d
explicit BinSingleRef2d();
- void setOobData( sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset );
+ void setBiff12Data( sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset );
void setBiff2Data( sal_uInt8 nCol, sal_uInt16 nRow, bool bRelativeAsOffset );
void setBiff8Data( sal_uInt16 nCol, sal_uInt16 nRow, bool bRelativeAsOffset );
- void readOobData( RecordInputStream& rStrm, bool bRelativeAsOffset );
+ void readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset );
void readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
void readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
};
@@ -257,7 +246,7 @@ struct BinComplexRef2d
BinSingleRef2d maRef1; /// Start (top-left) cell address.
BinSingleRef2d maRef2; /// End (bottom-right) cell address.
- void readOobData( RecordInputStream& rStrm, bool bRelativeAsOffset );
+ void readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset );
void readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
void readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
};
@@ -496,8 +485,8 @@ struct FunctionInfo
::rtl::OUString maExtProgName; /// Programmatic function name for external functions.
FunctionLibraryType meFuncLibType; /// The external library this function is part of.
sal_Int32 mnApiOpCode; /// API function opcode.
- sal_uInt16 mnOobFuncId; /// OOBIN function identifier.
- sal_uInt16 mnBiffFuncId; /// BIFF function identifier.
+ sal_uInt16 mnBiff12FuncId; /// BIFF12 function identifier.
+ sal_uInt16 mnBiffFuncId; /// BIFF2-BIFF8 function identifier.
sal_uInt8 mnMinParamCount; /// Minimum number of parameters.
sal_uInt8 mnMaxParamCount; /// Maximum number of parameters.
sal_uInt8 mnRetClass; /// BIFF token class of the return value.
@@ -552,13 +541,13 @@ public:
/** Returns the function info for an ODF function name, or 0 on error. */
const FunctionInfo* getFuncInfoFromOdfFuncName( const ::rtl::OUString& rFuncName ) const;
- /** Returns the function info for an OOX function name, or 0 on error. */
+ /** Returns the function info for an OOXML function name, or 0 on error. */
const FunctionInfo* getFuncInfoFromOoxFuncName( const ::rtl::OUString& rFuncName ) const;
- /** Returns the function info for an OOBIN function index, or 0 on error. */
- const FunctionInfo* getFuncInfoFromOobFuncId( sal_uInt16 nFuncId ) const;
+ /** Returns the function info for a BIFF12 function index, or 0 on error. */
+ const FunctionInfo* getFuncInfoFromBiff12FuncId( sal_uInt16 nFuncId ) const;
- /** Returns the function info for a BIFF function index, or 0 on error. */
+ /** Returns the function info for a BIFF2-BIFF8 function index, or 0 on error. */
const FunctionInfo* getFuncInfoFromBiffFuncId( sal_uInt16 nFuncId ) const;
/** Returns the function info for a macro function referred by the
@@ -600,7 +589,7 @@ public:
/** Returns the function info for an API token, or 0 on error. */
const FunctionInfo* getFuncInfoFromApiToken( const ApiToken& rToken ) const;
- /** Returns the op-code map that is used by the OOX formula parser. */
+ /** Returns the op-code map that is used by the OOXML formula parser. */
::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaOpCodeMapEntry >
getOoxParserMap() const;
@@ -935,4 +924,4 @@ public:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/formulaparser.hxx b/oox/inc/oox/xls/formulaparser.hxx
index b9b855c6731f..843a1c3ad3f5 100644
--- a/oox/inc/oox/xls/formulaparser.hxx
+++ b/oox/inc/oox/xls/formulaparser.hxx
@@ -101,9 +101,9 @@ private:
class FormulaParserImpl;
-/** Import formula parser for OOX and BIFF filters.
+/** Import formula parser for OOXML and BIFF filters.
- This class implements formula import for the OOX and BIFF filter. One
+ This class implements formula import for the OOXML and BIFF filter. One
instance is contained in the global filter data to prevent construction and
destruction of internal buffers for every imported formula.
*/
@@ -113,17 +113,17 @@ public:
explicit FormulaParser( const WorkbookHelper& rHelper );
virtual ~FormulaParser();
- /** Converts an XML formula string. */
+ /** Converts an OOXML formula string. */
void importFormula(
FormulaContext& rContext,
const ::rtl::OUString& rFormulaString ) const;
- /** Imports and converts a OOBIN token array from the passed stream. */
+ /** Imports and converts a BIFF12 token array from the passed stream. */
void importFormula(
FormulaContext& rContext,
- RecordInputStream& rStrm ) const;
+ SequenceInputStream& rStrm ) const;
- /** Imports and converts a BIFF token array from the passed stream.
+ /** Imports and converts a BIFF2-BIFF8 token array from the passed stream.
@param pnFmlaSize Size of the token array. If null is passed, reads
it from stream (1 byte in BIFF2, 2 bytes otherwise) first. */
void importFormula(
@@ -151,13 +151,16 @@ public:
::rtl::OUString importOleTargetLink( const ::rtl::OUString& rFormulaString );
/** Imports and converts an OLE link target from the passed stream. */
- ::rtl::OUString importOleTargetLink( RecordInputStream& rStrm );
+ ::rtl::OUString importOleTargetLink( SequenceInputStream& rStrm );
/** Imports and converts an OLE link target from the passed stream. */
::rtl::OUString importOleTargetLink(
BiffInputStream& rStrm,
const sal_uInt16* pnFmlaSize = 0 ) const;
+ /** Converts the passed formula to a macro name for a drawing shape. */
+ ::rtl::OUString importMacroName( const ::rtl::OUString& rFormulaString );
+
private:
::std::auto_ptr< FormulaParserImpl > mxImpl;
};
@@ -169,4 +172,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/numberformatsbuffer.hxx b/oox/inc/oox/xls/numberformatsbuffer.hxx
index 77bebe3bfde3..431e13cfdd1f 100644
--- a/oox/inc/oox/xls/numberformatsbuffer.hxx
+++ b/oox/inc/oox/xls/numberformatsbuffer.hxx
@@ -30,7 +30,6 @@
#define OOX_XLS_NUMBERFORMATSBUFFER_HXX
#include <com/sun/star/lang/Locale.hpp>
-#include "oox/helper/containerhelper.hxx"
#include "oox/xls/workbookhelper.hxx"
namespace com { namespace sun { namespace star {
@@ -110,7 +109,7 @@ public:
/** Inserts a new number format code. */
NumberFormatRef importNumFmt( const AttributeList& rAttribs );
/** Inserts a new number format code from a NUMFMT record. */
- void importNumFmt( RecordInputStream& rStrm );
+ void importNumFmt( SequenceInputStream& rStrm );
/** Inserts a new number format code from a FORMAT record. */
void importFormat( BiffInputStream& rStrm );
@@ -139,4 +138,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/ooxformulaparser.hxx b/oox/inc/oox/xls/ooxformulaparser.hxx
index 1e92daf153b2..2eaf8cb09a33 100644
--- a/oox/inc/oox/xls/ooxformulaparser.hxx
+++ b/oox/inc/oox/xls/ooxformulaparser.hxx
@@ -111,4 +111,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/pagesettings.hxx b/oox/inc/oox/xls/pagesettings.hxx
index 23690ab62158..b122ac2d78eb 100644
--- a/oox/inc/oox/xls/pagesettings.hxx
+++ b/oox/inc/oox/xls/pagesettings.hxx
@@ -86,8 +86,8 @@ struct PageSettingsModel
explicit PageSettingsModel();
- /** Sets the OOBIN or BIFF print errors mode. */
- void setBinPrintErrors( sal_uInt8 nPrintErrors );
+ /** Sets the BIFF print errors mode. */
+ void setBiffPrintErrors( sal_uInt8 nPrintErrors );
};
// ============================================================================
@@ -113,17 +113,17 @@ public:
void importPicture( const ::oox::core::Relations& rRelations, const AttributeList& rAttribs );
/** Imports the PRINTOPTIONS record from the passed stream. */
- void importPrintOptions( RecordInputStream& rStrm );
+ void importPrintOptions( SequenceInputStream& rStrm );
/** Imports the PAGEMARGINS record from the passed stream. */
- void importPageMargins( RecordInputStream& rStrm );
+ void importPageMargins( SequenceInputStream& rStrm );
/** Imports the PAGESETUP record from the passed stream. */
- void importPageSetup( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm );
+ void importPageSetup( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm );
/** Imports the CHARTPAGESETUP record from the passed stream. */
- void importChartPageSetup( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm );
+ void importChartPageSetup( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm );
/** Imports the HEADERFOOTER record from the passed stream. */
- void importHeaderFooter( RecordInputStream& rStrm );
+ void importHeaderFooter( SequenceInputStream& rStrm );
/** Imports the PICTURE record from the passed stream. */
- void importPicture( const ::oox::core::Relations& rRelations, RecordInputStream& rStrm );
+ void importPicture( const ::oox::core::Relations& rRelations, SequenceInputStream& rStrm );
/** Imports the LEFTMARGIN record from the passed BIFF stream. */
void importLeftMargin( BiffInputStream& rStrm );
@@ -221,4 +221,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/pivotcachebuffer.hxx b/oox/inc/oox/xls/pivotcachebuffer.hxx
index 86838eb3124c..1b972c95fa3e 100644
--- a/oox/inc/oox/xls/pivotcachebuffer.hxx
+++ b/oox/inc/oox/xls/pivotcachebuffer.hxx
@@ -29,10 +29,10 @@
#ifndef OOX_XLS_PIVOTCACHEBUFFER_HXX
#define OOX_XLS_PIVOTCACHEBUFFER_HXX
-#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
-#include "oox/helper/containerhelper.hxx"
+#include <com/sun/star/util/DateTime.hpp>
+#include "oox/helper/refvector.hxx"
#include "oox/xls/workbookhelper.hxx"
namespace com { namespace sun { namespace star {
@@ -67,17 +67,17 @@ public:
void readIndex( const AttributeList& rAttribs );
/** Reads the string value from a pivot cache item. */
- void readString( RecordInputStream& rStrm );
+ void readString( SequenceInputStream& rStrm );
/** Reads the double value from a pivot cache item. */
- void readDouble( RecordInputStream& rStrm );
+ void readDouble( SequenceInputStream& rStrm );
/** Reads the date/time value from a pivot cache item. */
- void readDate( RecordInputStream& rStrm );
+ void readDate( SequenceInputStream& rStrm );
/** Reads the boolean value from a pivot cache item. */
- void readBool( RecordInputStream& rStrm );
+ void readBool( SequenceInputStream& rStrm );
/** Reads the error code value from a pivot cache item. */
- void readError( RecordInputStream& rStrm );
+ void readError( SequenceInputStream& rStrm );
/** Reads the index of a shared item. */
- void readIndex( RecordInputStream& rStrm );
+ void readIndex( SequenceInputStream& rStrm );
/** Reads the string value from a pivot cache item. */
void readString( BiffInputStream& rStrm, const WorkbookHelper& rHelper );
@@ -101,7 +101,7 @@ public:
private:
::com::sun::star::uno::Any maValue; /// Value of the item.
- sal_Int32 mnType; /// Value type (OOX token identifier).
+ sal_Int32 mnType; /// Value type (OOXML token identifier).
};
// ----------------------------------------------------------------------------
@@ -114,7 +114,7 @@ public:
/** Imports the item from the passed attribute list. */
void importItem( sal_Int32 nElement, const AttributeList& rAttribs );
/** Imports the item from the passed stream and record. */
- void importItem( sal_Int32 nRecId, RecordInputStream& rStrm );
+ void importItem( sal_Int32 nRecId, SequenceInputStream& rStrm );
/** Imports a complete item list from the passed stream. */
void importItemList( BiffInputStream& rStrm, sal_uInt16 nCount );
@@ -132,7 +132,7 @@ private:
/** Creates and returns a new item at the end of the items list. */
PivotCacheItem& createItem();
/** Imports an array of items from the PCITEM_ARRAY record */
- void importArray( RecordInputStream& rStrm );
+ void importArray( SequenceInputStream& rStrm );
private:
typedef ::std::vector< PivotCacheItem > CacheItemVector;
@@ -197,8 +197,8 @@ struct PCFieldGroupModel
explicit PCFieldGroupModel();
- /** Sets the group-by value for BIFF/OOBIN import. */
- void setBinGroupBy( sal_uInt8 nGroupBy );
+ /** Sets the group-by value for BIFF import. */
+ void setBiffGroupBy( sal_uInt8 nGroupBy );
};
// ----------------------------------------------------------------------------
@@ -238,19 +238,19 @@ public:
void importGroupItem( sal_Int32 nElement, const AttributeList& rAttribs );
/** Imports pivot cache field settings from the PCDFIELD record. */
- void importPCDField( RecordInputStream& rStrm );
+ void importPCDField( SequenceInputStream& rStrm );
/** Imports shared items settings from the PCDFSHAREDITEMS record. */
- void importPCDFSharedItems( RecordInputStream& rStrm );
+ void importPCDFSharedItems( SequenceInputStream& rStrm );
/** Imports one or more shared items from the passed record. */
- void importPCDFSharedItem( sal_Int32 nRecId, RecordInputStream& rStrm );
+ void importPCDFSharedItem( sal_Int32 nRecId, SequenceInputStream& rStrm );
/** Imports grouping settings from the PCDFIELDGROUP record. */
- void importPCDFieldGroup( RecordInputStream& rStrm );
+ void importPCDFieldGroup( SequenceInputStream& rStrm );
/** Imports numeric grouping settings from the PCDFRANGEPR record. */
- void importPCDFRangePr( RecordInputStream& rStrm );
+ void importPCDFRangePr( SequenceInputStream& rStrm );
/** Imports an item of the mapping between group items and base items from the passed record. */
- void importPCDFDiscretePrItem( sal_Int32 nRecId, RecordInputStream& rStrm );
+ void importPCDFDiscretePrItem( sal_Int32 nRecId, SequenceInputStream& rStrm );
/** Imports one or more group items from the passed record. */
- void importPCDFGroupItem( sal_Int32 nRecId, RecordInputStream& rStrm );
+ void importPCDFGroupItem( sal_Int32 nRecId, SequenceInputStream& rStrm );
/** Imports pivot cache field settings from the PCDFIELD record. */
void importPCDField( BiffInputStream& rStrm );
@@ -305,7 +305,7 @@ public:
const PivotCacheItem& rItem ) const;
/** Reads an item from the PCRECORD record and writes it to the passed sheet. */
- void importPCRecordItem( RecordInputStream& rStrm,
+ void importPCRecordItem( SequenceInputStream& rStrm,
WorksheetHelper& rSheetHelper, sal_Int32 nCol, sal_Int32 nRow ) const;
/** Reads an item index from the PCITEM_INDEXLIST record and writes the item to the passed sheet. */
void importPCItemIndex( BiffInputStream& rStrm,
@@ -393,11 +393,11 @@ public:
void importWorksheetSource( const AttributeList& rAttribs, const ::oox::core::Relations& rRelations );
/** Reads pivot cache global settings from the PCDEFINITION record. */
- void importPCDefinition( RecordInputStream& rStrm );
+ void importPCDefinition( SequenceInputStream& rStrm );
/** Reads cache source settings from the PCDSOURCE record. */
- void importPCDSource( RecordInputStream& rStrm );
+ void importPCDSource( SequenceInputStream& rStrm );
/** Reads sheet source settings from the PCDSHEETSOURCE record. */
- void importPCDSheetSource( RecordInputStream& rStrm, const ::oox::core::Relations& rRelations );
+ void importPCDSheetSource( SequenceInputStream& rStrm, const ::oox::core::Relations& rRelations );
/** Reads cache source settings from the PCDSOURCE record. */
void importPCDSource( BiffInputStream& rStrm );
@@ -435,7 +435,7 @@ public:
const PivotCacheItem& rItem ) const;
/** Reads a PCRECORD record and writes all item values to the passed sheet. */
- void importPCRecord( RecordInputStream& rStrm,
+ void importPCRecord( SequenceInputStream& rStrm,
WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const;
/** Reads a PCITEM_INDEXLIST record and writes all item values to the passed sheet. */
void importPCItemIndexList( BiffInputStream& rStrm,
@@ -480,9 +480,9 @@ class PivotCacheBuffer : public WorkbookHelper
public:
explicit PivotCacheBuffer( const WorkbookHelper& rHelper );
- /** Registers a pivot cache definition fragment. The fragment will be loaded on demand (OOX/OOBIN only). */
+ /** Registers a pivot cache definition fragment. The fragment will be loaded on demand (OOXML/BIFF12 only). */
void registerPivotCacheFragment( sal_Int32 nCacheId, const ::rtl::OUString& rFragmentPath );
- /** Reads the reference to a pivot cache stream. The stream will be loaded on demand (BIFF only). */
+ /** Reads the reference to a pivot cache stream. The stream will be loaded on demand (BIFF2-BIFF8 only). */
void importPivotCacheRef( BiffInputStream& rStrm );
/** Imports and stores a pivot cache definition fragment on first call,
@@ -510,4 +510,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/pivotcachefragment.hxx b/oox/inc/oox/xls/pivotcachefragment.hxx
index fde545a6119e..21c625b1a3bc 100644
--- a/oox/inc/oox/xls/pivotcachefragment.hxx
+++ b/oox/inc/oox/xls/pivotcachefragment.hxx
@@ -39,18 +39,18 @@ class PivotCacheField;
// ============================================================================
-class OoxPivotCacheFieldContext : public OoxWorkbookContextBase
+class PivotCacheFieldContext : public WorkbookContextBase
{
public:
- explicit OoxPivotCacheFieldContext(
- OoxWorkbookFragmentBase& rFragment,
+ explicit PivotCacheFieldContext(
+ WorkbookFragmentBase& rFragment,
PivotCacheField& rCacheField );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
private:
PivotCacheField& mrCacheField;
@@ -58,17 +58,17 @@ private:
// ============================================================================
-class OoxPivotCacheDefinitionFragment : public OoxWorkbookFragmentBase
+class PivotCacheDefinitionFragment : public WorkbookFragmentBase
{
public:
- explicit OoxPivotCacheDefinitionFragment(
+ explicit PivotCacheDefinitionFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath,
PivotCache& rPivotCache );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
virtual void finalizeImport();
@@ -78,23 +78,23 @@ private:
// ============================================================================
-class OoxPivotCacheRecordsFragment : public OoxWorksheetFragmentBase
+class PivotCacheRecordsFragment : public WorksheetFragmentBase
{
public:
- explicit OoxPivotCacheRecordsFragment(
+ explicit PivotCacheRecordsFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath,
const PivotCache& rPivotCache );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
private:
void startCacheRecord();
- void importPCRecord( RecordInputStream& rStrm );
- void importPCRecordItem( sal_Int32 nRecId, RecordInputStream& rStrm );
+ void importPCRecord( SequenceInputStream& rStrm );
+ void importPCRecordItem( sal_Int32 nRecId, SequenceInputStream& rStrm );
private:
const PivotCache& mrPivotCache;
@@ -127,12 +127,12 @@ class BiffPivotCacheRecordsContext : public BiffWorksheetContextBase
{
public:
explicit BiffPivotCacheRecordsContext(
- const BiffWorkbookFragmentBase& rFragment,
+ const WorkbookHelper& rHelper,
const PivotCache& rPivotCache );
/** Reads the current record from stream and tries to insert a cell into
the source data sheet. */
- virtual void importRecord();
+ virtual void importRecord( BiffInputStream& rStrm );
private:
void startNextRow();
@@ -155,4 +155,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/pivottablebuffer.hxx b/oox/inc/oox/xls/pivottablebuffer.hxx
index 23721784dbd5..bbdc83ffb1ae 100644
--- a/oox/inc/oox/xls/pivottablebuffer.hxx
+++ b/oox/inc/oox/xls/pivottablebuffer.hxx
@@ -30,9 +30,8 @@
#define OOX_XLS_PIVOTTABLEBUFFER_HXX
#include <com/sun/star/table/CellRangeAddress.hpp>
-#include "oox/helper/containerhelper.hxx"
#include "oox/xls/pivotcachebuffer.hxx"
-#include "oox/xls/workbookhelper.hxx"
+#include "oox/xls/stylesbuffer.hxx"
namespace com { namespace sun { namespace star {
namespace sheet { class XDataPilotDescriptor; }
@@ -55,8 +54,8 @@ struct PTFieldItemModel
explicit PTFieldItemModel();
- /** Sets item type for BIFF/OOBIN import. */
- void setBinType( sal_uInt16 nType );
+ /** Sets item type for BIFF import. */
+ void setBiffType( sal_uInt16 nType );
};
// ----------------------------------------------------------------------------
@@ -94,8 +93,8 @@ struct PTFieldModel
explicit PTFieldModel();
- /** Sets axis type for BIFF/OOBIN import. */
- void setBinAxis( sal_uInt8 nAxisFlags );
+ /** Sets axis type for BIFF import. */
+ void setBiffAxis( sal_uInt8 nAxisFlags );
};
// ----------------------------------------------------------------------------
@@ -123,10 +122,10 @@ struct PTDataFieldModel
explicit PTDataFieldModel();
- /** Sets the subtotal aggregation function for BIFF/OOBIN import. */
- void setBinSubtotal( sal_Int32 nSubtotal );
- /** Sets the 'show data as' type for BIFF/OOBIN import. */
- void setBinShowDataAs( sal_Int32 nShowDataAs );
+ /** Sets the subtotal aggregation function for BIFF import. */
+ void setBiffSubtotal( sal_Int32 nSubtotal );
+ /** Sets the 'show data as' type for BIFF import. */
+ void setBiffShowDataAs( sal_Int32 nShowDataAs );
};
// ----------------------------------------------------------------------------
@@ -146,13 +145,13 @@ public:
void importReferenceItem( const AttributeList& rAttribs );
/** Imports pivot field settings from the PTFIELD record. */
- void importPTField( RecordInputStream& rStrm );
+ void importPTField( SequenceInputStream& rStrm );
/** Imports settings of an item in this pivot field from the PTFITEM record. */
- void importPTFItem( RecordInputStream& rStrm );
+ void importPTFItem( SequenceInputStream& rStrm );
/** Imports pivot field reference settings from the PTREFERENCE record. */
- void importPTReference( RecordInputStream& rStrm );
+ void importPTReference( SequenceInputStream& rStrm );
/** Imports pivot field item reference settings from the PTREFERENCEITEM record. */
- void importPTReferenceItem( RecordInputStream& rStrm );
+ void importPTReferenceItem( SequenceInputStream& rStrm );
/** Imports pivot field settings from the PTFIELD and following records. */
void importPTField( BiffInputStream& rStrm );
@@ -236,9 +235,9 @@ public:
void importTop10( const AttributeList& rAttribs );
/** Reads the settings of a field filter from the PTFILTER record. */
- void importPTFilter( RecordInputStream& rStrm );
+ void importPTFilter( SequenceInputStream& rStrm );
/** Reads additional settings of a field filter from the TOP10FILTER record. */
- void importTop10Filter( RecordInputStream& rStrm );
+ void importTop10Filter( SequenceInputStream& rStrm );
/** Applies the filter to the associated pivot table field if possible. */
void finalizeImport();
@@ -250,7 +249,7 @@ private:
// ============================================================================
-struct PTDefinitionModel
+struct PTDefinitionModel : public AutoFormatModel
{
::rtl::OUString maName;
::rtl::OUString maDataCaption;
@@ -282,6 +281,7 @@ struct PTDefinitionModel
bool mbPrintDrill;
bool mbEnableDrill;
bool mbPreserveFormatting;
+ bool mbUseAutoFormat;
bool mbPageOverThenDown;
bool mbSubtotalHiddenItems;
bool mbRowGrandTotals;
@@ -334,17 +334,17 @@ public:
void importDataField( const AttributeList& rAttribs );
/** Reads global pivot table settings from the PTDEFINITION record. */
- void importPTDefinition( RecordInputStream& rStrm );
+ void importPTDefinition( SequenceInputStream& rStrm );
/** Reads the location of the pivot table from the PTLOCATION record. */
- void importPTLocation( RecordInputStream& rStrm, sal_Int16 nSheet );
+ void importPTLocation( SequenceInputStream& rStrm, sal_Int16 nSheet );
/** Reads the indexes of all fields located in the row dimension from a PTROWFIELDS record. */
- void importPTRowFields( RecordInputStream& rStrm );
+ void importPTRowFields( SequenceInputStream& rStrm );
/** Reads the indexes of all fields located in the column dimension from a PTCOLFIELDS record. */
- void importPTColFields( RecordInputStream& rStrm );
+ void importPTColFields( SequenceInputStream& rStrm );
/** Reads the settings of a field located in the page dimension from the PTPAGEFIELD record. */
- void importPTPageField( RecordInputStream& rStrm );
+ void importPTPageField( SequenceInputStream& rStrm );
/** Reads the settings of a field located in the data dimension from the PTDATAFIELD record. */
- void importPTDataField( RecordInputStream& rStrm );
+ void importPTDataField( SequenceInputStream& rStrm );
/** Reads global pivot table settings from the PTDEFINITION record. */
void importPTDefinition( BiffInputStream& rStrm, sal_Int16 nSheet );
@@ -404,7 +404,7 @@ private:
/** Reads a field index for the row or column dimension. */
static void importField( IndexVector& orFields, const AttributeList& rAttribs );
/** Reads an array of field indexes for the row or column dimension. */
- static void importFields( IndexVector& orFields, RecordInputStream& rStrm );
+ static void importFields( IndexVector& orFields, SequenceInputStream& rStrm );
/** Reads an array of field indexes for the row or column dimension. */
static void importFields( IndexVector& orFields, BiffInputStream& rStrm, sal_Int32 nCount );
@@ -448,4 +448,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/pivottablefragment.hxx b/oox/inc/oox/xls/pivottablefragment.hxx
index 2639f01596f4..42fe46c51d18 100644
--- a/oox/inc/oox/xls/pivottablefragment.hxx
+++ b/oox/inc/oox/xls/pivottablefragment.hxx
@@ -41,18 +41,18 @@ class PivotTableFilter;
// ============================================================================
-class OoxPivotTableFieldContext : public OoxWorksheetContextBase
+class PivotTableFieldContext : public WorksheetContextBase
{
public:
- explicit OoxPivotTableFieldContext(
- OoxWorksheetFragmentBase& rFragment,
+ explicit PivotTableFieldContext(
+ WorksheetFragmentBase& rFragment,
PivotTableField& rTableField );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
private:
PivotTableField& mrTableField;
@@ -60,18 +60,18 @@ private:
// ============================================================================
-class OoxPivotTableFilterContext : public OoxWorksheetContextBase
+class PivotTableFilterContext : public WorksheetContextBase
{
public:
- explicit OoxPivotTableFilterContext(
- OoxWorksheetFragmentBase& rFragment,
+ explicit PivotTableFilterContext(
+ WorksheetFragmentBase& rFragment,
PivotTableFilter& rTableFilter );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
private:
PivotTableFilter& mrTableFilter;
@@ -79,16 +79,16 @@ private:
// ============================================================================
-class OoxPivotTableFragment : public OoxWorksheetFragmentBase
+class PivotTableFragment : public WorksheetFragmentBase
{
public:
- explicit OoxPivotTableFragment(
+ explicit PivotTableFragment(
const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
private:
@@ -101,10 +101,10 @@ private:
class BiffPivotTableContext : public BiffWorksheetContextBase
{
public:
- explicit BiffPivotTableContext( const BiffWorksheetFragmentBase& rFragment, PivotTable& rPivotTable );
+ explicit BiffPivotTableContext( const WorksheetHelper& rHelper );
/** Imports all records related to the current pivot table. */
- virtual void importRecord();
+ virtual void importRecord( BiffInputStream& rStrm );
private:
PivotTable& mrPivotTable;
@@ -117,4 +117,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/querytablebuffer.hxx b/oox/inc/oox/xls/querytablebuffer.hxx
new file mode 100644
index 000000000000..fa67ca8874c0
--- /dev/null
+++ b/oox/inc/oox/xls/querytablebuffer.hxx
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_XLS_QUERYTABLEBUFFER_HXX
+#define OOX_XLS_QUERYTABLEBUFFER_HXX
+
+#include "oox/xls/stylesbuffer.hxx"
+#include "oox/xls/worksheethelper.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+struct QueryTableModel : public AutoFormatModel
+{
+ ::rtl::OUString maDefName; /// Defined name containing the target cell range.
+ sal_Int32 mnConnId; /// Identifier of the external connection used to query the data.
+ sal_Int32 mnGrowShrinkType; /// Behaviour when source data size changes.
+ bool mbHeaders; /// True = source data contains a header row.
+ bool mbRowNumbers; /// True = first column contains row numbers.
+ bool mbDisableRefresh; /// True = refreshing data disabled.
+ bool mbBackground; /// True = refresh asynchronously.
+ bool mbFirstBackground; /// True = first background refresh not yet finished.
+ bool mbRefreshOnLoad; /// True = refresh table after import.
+ bool mbFillFormulas; /// True = expand formulas next to range when source data grows.
+ bool mbRemoveDataOnSave; /// True = remove querried data before saving.
+ bool mbDisableEdit; /// True = connection locked for editing.
+ bool mbPreserveFormat; /// True = use existing formatting for new rows.
+ bool mbAdjustColWidth; /// True = adjust column widths after refresh.
+ bool mbIntermediate; /// True = query table defined but not built yet.
+
+ explicit QueryTableModel();
+};
+
+// ----------------------------------------------------------------------------
+
+class QueryTable : public WorksheetHelper
+{
+public:
+ explicit QueryTable( const WorksheetHelper& rHelper );
+
+ /** Imports query table settings from the queryTable element. */
+ void importQueryTable( const AttributeList& rAttribs );
+ /** Imports query table settings from the QUERYTABLE record. */
+ void importQueryTable( SequenceInputStream& rStrm );
+
+ /** Imports query table settings from the QUERYTABLE record. */
+ void importQueryTable( BiffInputStream& rStrm );
+ /** Imports query table settings from the QUERYTABLEREFRESH record. */
+ void importQueryTableRefresh( BiffInputStream& rStrm );
+ /** Imports query table settings from the QUERYTABLESETTINGS record. */
+ void importQueryTableSettings( BiffInputStream& rStrm );
+
+ /** Inserts a web query into the sheet. */
+ void finalizeImport();
+
+private:
+ QueryTableModel maModel;
+};
+
+// ============================================================================
+
+class QueryTableBuffer : public WorksheetHelper
+{
+public:
+ explicit QueryTableBuffer( const WorksheetHelper& rHelper );
+
+ /** Creates a new query table and stores it into the internal vector. */
+ QueryTable& createQueryTable();
+
+ /** Inserts all web queries into the sheet. */
+ void finalizeImport();
+
+private:
+ typedef RefVector< QueryTable > QueryTableVector;
+ QueryTableVector maQueryTables;
+};
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
+
+#endif
diff --git a/oox/inc/oox/xls/querytablefragment.hxx b/oox/inc/oox/xls/querytablefragment.hxx
index 9308c1177c48..4d810aa567a6 100644
--- a/oox/inc/oox/xls/querytablefragment.hxx
+++ b/oox/inc/oox/xls/querytablefragment.hxx
@@ -34,19 +34,39 @@
namespace oox {
namespace xls {
+class QueryTable;
+
// ============================================================================
-class OoxQueryTableFragment : public OoxWorkbookFragmentBase
+class QueryTableFragment : public WorksheetFragmentBase
{
public:
- explicit OoxQueryTableFragment(
- const WorkbookHelper& rHelper,
+ explicit QueryTableFragment(
+ const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+
+ virtual const ::oox::core::RecordInfo* getRecordInfos() const;
+
+private:
+ QueryTable& mrQueryTable;
+};
+
+// ============================================================================
+
+class BiffQueryTableContext : public BiffWorksheetContextBase
+{
+public:
+ explicit BiffQueryTableContext( const WorksheetHelper& rHelper );
+
+ /** Imports all records related to the current query table. */
+ virtual void importRecord( BiffInputStream& rStrm );
+
+private:
+ QueryTable& mrQueryTable;
};
// ============================================================================
@@ -56,4 +76,4 @@ protected:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/richstring.hxx b/oox/inc/oox/xls/richstring.hxx
index 1c56901f137a..7d4122aa4eed 100644
--- a/oox/inc/oox/xls/richstring.hxx
+++ b/oox/inc/oox/xls/richstring.hxx
@@ -29,7 +29,7 @@
#ifndef OOX_XLS_RICHSTRING_HXX
#define OOX_XLS_RICHSTRING_HXX
-#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/refvector.hxx"
#include "oox/xls/stylesbuffer.hxx"
namespace com { namespace sun { namespace star {
@@ -115,7 +115,7 @@ struct FontPortionModel
explicit inline FontPortionModel( sal_Int32 nPos, sal_Int32 nFontId ) :
mnPos( nPos ), mnFontId( nFontId ) {}
- void read( RecordInputStream& rStrm );
+ void read( SequenceInputStream& rStrm );
void read( BiffInputStream& rStrm, BiffFontPortionMode eMode );
};
@@ -130,7 +130,7 @@ public:
/** Appends a rich-string font identifier. */
void appendPortion( const FontPortionModel& rPortion );
/** Reads count and font identifiers from the passed stream. */
- void importPortions( RecordInputStream& rStrm );
+ void importPortions( SequenceInputStream& rStrm );
/** Reads nCount font identifiers from the passed stream. */
void importPortions( BiffInputStream& rStrm, sal_uInt16 nCount, BiffFontPortionMode eMode );
/** Reads count and font identifiers from the passed stream. */
@@ -148,7 +148,7 @@ struct PhoneticDataModel
explicit PhoneticDataModel();
/** Sets the passed data from binary import. */
- void setBinData( sal_Int32 nType, sal_Int32 nAlignment );
+ void setBiffData( sal_Int32 nType, sal_Int32 nAlignment );
};
// ----------------------------------------------------------------------------
@@ -161,12 +161,12 @@ public:
/** Imports phonetic settings from the phoneticPr element. */
void importPhoneticPr( const AttributeList& rAttribs );
/** Imports phonetic settings from the PHONETICPR record. */
- void importPhoneticPr( RecordInputStream& rStrm );
+ void importPhoneticPr( SequenceInputStream& rStrm );
/** Imports phonetic settings from the PHONETICPR record. */
void importPhoneticPr( BiffInputStream& rStrm );
/** Imports phonetic settings from a rich string. */
- void importStringData( RecordInputStream& rStrm );
+ void importStringData( SequenceInputStream& rStrm );
/** Imports phonetic settings from a rich string. */
void importStringData( BiffInputStream& rStrm );
@@ -211,7 +211,7 @@ struct PhoneticPortionModel
explicit inline PhoneticPortionModel( sal_Int32 nPos, sal_Int32 nBasePos, sal_Int32 nBaseLen ) :
mnPos( nPos ), mnBasePos( nBasePos ), mnBaseLen( nBaseLen ) {}
- void read( RecordInputStream& rStrm );
+ void read( SequenceInputStream& rStrm );
void read( BiffInputStream& rStrm );
};
@@ -226,7 +226,7 @@ public:
/** Appends a rich-string phonetic portion. */
void appendPortion( const PhoneticPortionModel& rPortion );
/** Reads all phonetic portions from the passed stream. */
- void importPortions( RecordInputStream& rStrm );
+ void importPortions( SequenceInputStream& rStrm );
/** Reads phonetic portion data from the passed stream. */
::rtl::OUString importPortions( BiffInputStream& rStrm, sal_Int32 nPhoneticSize );
};
@@ -249,7 +249,7 @@ public:
void importPhoneticPr( const AttributeList& rAttribs );
/** Imports a Unicode rich-string from the passed record stream. */
- void importString( RecordInputStream& rStrm, bool bRich );
+ void importString( SequenceInputStream& rStrm, bool bRich );
/** Imports a byte string from the passed BIFF stream. */
void importByteString( BiffInputStream& rStrm, rtl_TextEncoding eDefaultTextEnc, BiffStringFlags nFlags = BIFF_STR_DEFAULT );
@@ -298,4 +298,4 @@ typedef ::boost::shared_ptr< RichString > RichStringRef;
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/richstringcontext.hxx b/oox/inc/oox/xls/richstringcontext.hxx
index 7aa0e11a03b8..d8b9aa3e30aa 100644
--- a/oox/inc/oox/xls/richstringcontext.hxx
+++ b/oox/inc/oox/xls/richstringcontext.hxx
@@ -37,17 +37,15 @@ namespace xls {
// ============================================================================
-class OoxRichStringContext : public OoxWorkbookContextBase
+class RichStringContext : public WorkbookContextBase
{
public:
template< typename ParentType >
- explicit OoxRichStringContext( ParentType& rParent, RichStringRef xString );
+ explicit RichStringContext( ParentType& rParent, RichStringRef xString );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
private:
RichStringRef mxString; /// Processed string.
@@ -59,11 +57,11 @@ private:
// ----------------------------------------------------------------------------
template< typename ParentType >
-OoxRichStringContext::OoxRichStringContext( ParentType& rParent, RichStringRef xString ) :
- OoxWorkbookContextBase( rParent ),
+RichStringContext::RichStringContext( ParentType& rParent, RichStringRef xString ) :
+ WorkbookContextBase( rParent ),
mxString( xString )
{
- OSL_ENSURE( mxString.get(), "OoxRichStringContext::OoxRichStringContext - missing string object" );
+ OSL_ENSURE( mxString.get(), "RichStringContext::RichStringContext - missing string object" );
}
// ============================================================================
@@ -73,4 +71,4 @@ OoxRichStringContext::OoxRichStringContext( ParentType& rParent, RichStringRef x
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/scenariobuffer.hxx b/oox/inc/oox/xls/scenariobuffer.hxx
index 03c081393712..e3fac3cd8354 100644
--- a/oox/inc/oox/xls/scenariobuffer.hxx
+++ b/oox/inc/oox/xls/scenariobuffer.hxx
@@ -30,7 +30,8 @@
#define OOX_XLS_SCENARIOBUFFER_HXX
#include <com/sun/star/table/CellAddress.hpp>
-#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/refmap.hxx"
+#include "oox/helper/refvector.hxx"
#include "oox/xls/workbookhelper.hxx"
namespace oox {
@@ -74,9 +75,9 @@ public:
void importInputCells( const AttributeList& rAttribs );
/** Imports a scenario definition from a SCENARIO record. */
- void importScenario( RecordInputStream& rStrm );
+ void importScenario( SequenceInputStream& rStrm );
/** Imports a new cell for this scenario from a INPUTCELLS record. */
- void importInputCells( RecordInputStream& rStrm );
+ void importInputCells( SequenceInputStream& rStrm );
/** Imports a scenario definition from a SCENARIO record. */
void importScenario( BiffInputStream& rStrm );
@@ -112,7 +113,7 @@ public:
/** Imports sheet scenario settings from a scenarios element. */
void importScenarios( const AttributeList& rAttribs );
/** Imports sheet scenario settings from a SCENARIOS record. */
- void importScenarios( RecordInputStream& rStrm );
+ void importScenarios( SequenceInputStream& rStrm );
/** Imports sheet scenario settings from a SCENARIOS record. */
void importScenarios( BiffInputStream& rStrm );
@@ -154,4 +155,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/scenariocontext.hxx b/oox/inc/oox/xls/scenariocontext.hxx
index 3c1e05fab7f1..90c9466e1375 100644
--- a/oox/inc/oox/xls/scenariocontext.hxx
+++ b/oox/inc/oox/xls/scenariocontext.hxx
@@ -39,17 +39,17 @@ class SheetScenarios;
// ============================================================================
-class OoxScenarioContext : public OoxWorksheetContextBase
+class ScenarioContext : public WorksheetContextBase
{
public:
- explicit OoxScenarioContext( OoxWorksheetContextBase& rParent, SheetScenarios& rSheetScenarios );
+ explicit ScenarioContext( WorksheetContextBase& rParent, SheetScenarios& rSheetScenarios );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
private:
Scenario& mrScenario;
@@ -57,17 +57,17 @@ private:
// ============================================================================
-class OoxScenariosContext : public OoxWorksheetContextBase
+class ScenariosContext : public WorksheetContextBase
{
public:
- explicit OoxScenariosContext( OoxWorksheetFragmentBase& rFragment );
+ explicit ScenariosContext( WorksheetFragmentBase& rFragment );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
- virtual void onStartRecord( RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
+ virtual void onStartRecord( SequenceInputStream& rStrm );
private:
SheetScenarios& mrSheetScenarios;
@@ -80,4 +80,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/sharedformulabuffer.hxx b/oox/inc/oox/xls/sharedformulabuffer.hxx
index de7e4b83c075..86f29cd85de0 100644
--- a/oox/inc/oox/xls/sharedformulabuffer.hxx
+++ b/oox/inc/oox/xls/sharedformulabuffer.hxx
@@ -62,12 +62,12 @@ class SharedFormulaBuffer : public WorksheetHelper
public:
explicit SharedFormulaBuffer( const WorksheetHelper& rHelper );
- /** Imports a shared formula from a OOX formula string. */
+ /** Imports a shared formula from a OOXML formula string. */
void importSharedFmla( const ::rtl::OUString& rFormula,
const ::rtl::OUString& rSharedRange, sal_Int32 nId,
const ::com::sun::star::table::CellAddress& rBaseAddr );
/** Imports a shared formula from a SHAREDFORMULA record in the passed stream */
- void importSharedFmla( RecordInputStream& rStrm,
+ void importSharedFmla( SequenceInputStream& rStrm,
const ::com::sun::star::table::CellAddress& rBaseAddr );
/** Imports a shared formula from a SHAREDFMLA record in the passed stream. */
void importSharedFmla( BiffInputStream& rStrm,
@@ -111,4 +111,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/sharedstringsbuffer.hxx b/oox/inc/oox/xls/sharedstringsbuffer.hxx
index 6fcad02a1a2e..3f62d75ea5e4 100644
--- a/oox/inc/oox/xls/sharedstringsbuffer.hxx
+++ b/oox/inc/oox/xls/sharedstringsbuffer.hxx
@@ -29,7 +29,6 @@
#ifndef OOX_XLS_SHAREDSTRINGSBUFFER_HXX
#define OOX_XLS_SHAREDSTRINGSBUFFER_HXX
-#include "oox/helper/containerhelper.hxx"
#include "oox/xls/richstring.hxx"
namespace oox {
@@ -69,4 +68,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/sharedstringsfragment.hxx b/oox/inc/oox/xls/sharedstringsfragment.hxx
index 1f942ddd6ba5..f4a0ef46df99 100644
--- a/oox/inc/oox/xls/sharedstringsfragment.hxx
+++ b/oox/inc/oox/xls/sharedstringsfragment.hxx
@@ -36,21 +36,16 @@ namespace xls {
// ============================================================================
-class OoxSharedStringsFragment : public OoxWorkbookFragmentBase
+class SharedStringsFragment : public WorkbookFragmentBase
{
public:
- explicit OoxSharedStringsFragment(
+ explicit SharedStringsFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
-
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
-
- // oox.core.FragmentHandler2 interface ------------------------------------
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
virtual void finalizeImport();
@@ -63,4 +58,4 @@ protected:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/sheetdatacontext.hxx b/oox/inc/oox/xls/sheetdatacontext.hxx
index 8eb1e3509060..1649ed3fd71c 100644
--- a/oox/inc/oox/xls/sheetdatacontext.hxx
+++ b/oox/inc/oox/xls/sheetdatacontext.hxx
@@ -46,18 +46,17 @@ namespace xls {
The sheetData element contains all row settings and all cells in a single
sheet of a spreadsheet document.
*/
-class OoxSheetDataContext : public OoxWorksheetContextBase
+class SheetDataContext : public WorksheetContextBase
{
public:
- explicit OoxSheetDataContext( OoxWorksheetFragmentBase& rFragment );
+ explicit SheetDataContext( WorksheetFragmentBase& rFragment );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
private:
/** Different types of cell records. */
@@ -71,35 +70,35 @@ private:
void importFormula( const AttributeList& rAttribs );
/** Imports a cell address and the following XF identifier. */
- void importCellHeader( RecordInputStream& rStrm, CellType eCellType );
+ void importCellHeader( SequenceInputStream& rStrm, CellType eCellType );
/** Imports an empty cell from a CELL_BLANK or MULTCELL_BLANK record. */
- void importCellBlank( RecordInputStream& rStrm, CellType eCellType );
+ void importCellBlank( SequenceInputStream& rStrm, CellType eCellType );
/** Imports a boolean cell from a CELL_BOOL, MULTCELL_BOOL, or FORMULA_BOOL record. */
- void importCellBool( RecordInputStream& rStrm, CellType eCellType );
+ void importCellBool( SequenceInputStream& rStrm, CellType eCellType );
/** Imports a numeric cell from a CELL_DOUBLE, MULTCELL_DOUBLE, or FORMULA_DOUBLE record. */
- void importCellDouble( RecordInputStream& rStrm, CellType eCellType );
+ void importCellDouble( SequenceInputStream& rStrm, CellType eCellType );
/** Imports an error code cell from a CELL_ERROR, MULTCELL_ERROR, or FORMULA_ERROR record. */
- void importCellError( RecordInputStream& rStrm, CellType eCellType );
+ void importCellError( SequenceInputStream& rStrm, CellType eCellType );
/** Imports an encoded numeric cell from a CELL_RK or MULTCELL_RK record. */
- void importCellRk( RecordInputStream& rStrm, CellType eCellType );
+ void importCellRk( SequenceInputStream& rStrm, CellType eCellType );
/** Imports a rich-string cell from a CELL_RSTRING or MULTCELL_RSTRING record. */
- void importCellRString( RecordInputStream& rStrm, CellType eCellType );
+ void importCellRString( SequenceInputStream& rStrm, CellType eCellType );
/** Imports a string cell from a CELL_SI or MULTCELL_SI record. */
- void importCellSi( RecordInputStream& rStrm, CellType eCellType );
+ void importCellSi( SequenceInputStream& rStrm, CellType eCellType );
/** Imports a string cell from a CELL_STRING, MULTCELL_STRING, or FORMULA_STRING record. */
- void importCellString( RecordInputStream& rStrm, CellType eCellType );
+ void importCellString( SequenceInputStream& rStrm, CellType eCellType );
/** Imports a cell formula for the current cell. */
- void importCellFormula( RecordInputStream& rStrm );
+ void importCellFormula( SequenceInputStream& rStrm );
/** Imports row settings from a ROW record. */
- void importRow( RecordInputStream& rStrm );
+ void importRow( SequenceInputStream& rStrm );
/** Imports an array formula from an ARRAY record. */
- void importArray( RecordInputStream& rStrm );
+ void importArray( SequenceInputStream& rStrm );
/** Imports a shared formula from a SHAREDFORMULA record. */
- void importSharedFmla( RecordInputStream& rStrm );
+ void importSharedFmla( SequenceInputStream& rStrm );
/** Imports table operation from a DATATABLE record. */
- void importDataTable( RecordInputStream& rStrm );
+ void importDataTable( SequenceInputStream& rStrm );
private:
CellModel maCurrCell; /// Position and formatting of current imported cell.
@@ -115,49 +114,49 @@ private:
class BiffSheetDataContext : public BiffWorksheetContextBase
{
public:
- explicit BiffSheetDataContext( const BiffWorksheetFragmentBase& rParent );
+ explicit BiffSheetDataContext( const WorksheetHelper& rHelper );
/** Tries to import a sheet data record. */
- virtual void importRecord();
+ virtual void importRecord( BiffInputStream& rStrm );
private:
/** Sets current cell according to the passed address. */
void setCurrCell( const BinAddress& rAddr );
/** Imports an XF identifier and sets the mnXfId member. */
- void importXfId( bool bBiff2 );
+ void importXfId( BiffInputStream& rStrm, bool bBiff2 );
/** Imports a BIFF cell address and the following XF identifier. */
- void importCellHeader( bool bBiff2 );
+ void importCellHeader( BiffInputStream& rStrm, bool bBiff2 );
/** Imports a BLANK record describing a blank but formatted cell. */
- void importBlank();
+ void importBlank( BiffInputStream& rStrm );
/** Imports a BOOLERR record describing a boolean or error code cell. */
- void importBoolErr();
+ void importBoolErr( BiffInputStream& rStrm );
/** Imports a FORMULA record describing a formula cell. */
- void importFormula();
+ void importFormula( BiffInputStream& rStrm );
/** Imports an INTEGER record describing a BIFF2 integer cell. */
- void importInteger();
+ void importInteger( BiffInputStream& rStrm );
/** Imports a LABEL record describing an unformatted string cell. */
- void importLabel();
+ void importLabel( BiffInputStream& rStrm );
/** Imports a LABELSST record describing a string cell using the shared string list. */
- void importLabelSst();
+ void importLabelSst( BiffInputStream& rStrm );
/** Imports a MULTBLANK record describing a range of blank but formatted cells. */
- void importMultBlank();
+ void importMultBlank( BiffInputStream& rStrm );
/** Imports a MULTRK record describing a range of numeric cells. */
- void importMultRk();
+ void importMultRk( BiffInputStream& rStrm );
/** Imports a NUMBER record describing a floating-point cell. */
- void importNumber();
+ void importNumber( BiffInputStream& rStrm );
/** Imports an RK record describing a numeric cell. */
- void importRk();
+ void importRk( BiffInputStream& rStrm );
/** Imports row settings from a ROW record. */
- void importRow();
+ void importRow( BiffInputStream& rStrm );
/** Imports an ARRAY record describing an array formula of a cell range. */
- void importArray();
+ void importArray( BiffInputStream& rStrm );
/** Imports a SHAREDFMLA record describing a shared formula in a cell range. */
- void importSharedFmla();
+ void importSharedFmla( BiffInputStream& rStrm );
/** Imports table operation from a DATATABLE or DATATABLE2 record. */
- void importDataTable();
+ void importDataTable( BiffInputStream& rStrm );
private:
CellModel maCurrCell; /// Position and formatting of current imported cell.
@@ -173,4 +172,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/stylesbuffer.hxx b/oox/inc/oox/xls/stylesbuffer.hxx
index f1ce98762206..86a1552664f7 100644
--- a/oox/inc/oox/xls/stylesbuffer.hxx
+++ b/oox/inc/oox/xls/stylesbuffer.hxx
@@ -30,14 +30,15 @@
#define OOX_XLS_STYLESBUFFER_HXX
#include <com/sun/star/awt/FontDescriptor.hpp>
-#include <com/sun/star/util/CellProtection.hpp>
#include <com/sun/star/table/CellHoriJustify.hpp>
#include <com/sun/star/table/CellOrientation.hpp>
#include <com/sun/star/table/CellVertJustify.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
-#include "oox/helper/containerhelper.hxx"
-#include "oox/helper/graphichelper.hxx"
+#include <com/sun/star/util/CellProtection.hpp>
#include "oox/drawingml/color.hxx"
+#include "oox/helper/graphichelper.hxx"
+#include "oox/helper/refmap.hxx"
+#include "oox/helper/refvector.hxx"
#include "oox/xls/numberformatsbuffer.hxx"
namespace com { namespace sun { namespace star {
@@ -112,11 +113,11 @@ public:
void importColor( const AttributeList& rAttribs );
/** Imports a 64-bit color from the passed binary stream. */
- void importColor( RecordInputStream& rStrm );
- /** Imports a 32-bit palette color identifier from the passed OOBIN stream. */
- void importColorId( RecordInputStream& rStrm );
- /** Imports a 32-bit RGBA color value from the passed OOBIN stream. */
- void importColorRgb( RecordInputStream& rStrm );
+ void importColor( SequenceInputStream& rStrm );
+ /** Imports a 32-bit palette color identifier from the passed BIFF12 stream. */
+ void importColorId( SequenceInputStream& rStrm );
+ /** Imports a 32-bit RGBA color value from the passed BIFF12 stream. */
+ void importColorRgb( SequenceInputStream& rStrm );
/** Imports an 8-bit or 16-bit palette color identifier from the passed BIFF stream. */
void importColorId( BiffInputStream& rStrm, bool b16Bit = true );
@@ -129,7 +130,7 @@ public:
// ----------------------------------------------------------------------------
-RecordInputStream& operator>>( RecordInputStream& rStrm, Color& orColor );
+SequenceInputStream& operator>>( SequenceInputStream& rStrm, Color& orColor );
// ============================================================================
@@ -143,9 +144,11 @@ public:
/** Appends a new color from the passed attributes. */
void importPaletteColor( const AttributeList& rAttribs );
/** Appends a new color from the passed RGBCOLOR record. */
- void importPaletteColor( RecordInputStream& rStrm );
+ void importPaletteColor( SequenceInputStream& rStrm );
/** Imports the PALETTE record from the passed stream. */
void importPalette( BiffInputStream& rStrm );
+ /** Imports a color palette from a UNO sequence in the passed any. */
+ void importPalette( const ::com::sun::star::uno::Any& rPalette );
/** Rturns the RGB value of the color with the passed index. */
sal_Int32 getColor( sal_Int32 nPaletteIdx ) const;
@@ -180,7 +183,7 @@ struct FontModel
explicit FontModel();
- void setBinScheme( sal_uInt8 nScheme );
+ void setBiff12Scheme( sal_uInt8 nScheme );
void setBiffHeight( sal_uInt16 nHeight );
void setBiffWeight( sal_uInt16 nWeight );
void setBiffUnderline( sal_uInt16 nUnderline );
@@ -260,23 +263,23 @@ public:
void importAttribs( sal_Int32 nElement, const AttributeList& rAttribs );
/** Imports the FONT record from the passed stream. */
- void importFont( RecordInputStream& rStrm );
+ void importFont( SequenceInputStream& rStrm );
/** Imports the font name from a DXF record. */
- void importDxfName( RecordInputStream& rStrm );
+ void importDxfName( SequenceInputStream& rStrm );
/** Imports the font color from a DXF record. */
- void importDxfColor( RecordInputStream& rStrm );
+ void importDxfColor( SequenceInputStream& rStrm );
/** Imports the font scheme from a DXF record. */
- void importDxfScheme( RecordInputStream& rStrm );
+ void importDxfScheme( SequenceInputStream& rStrm );
/** Imports the font height from a DXF record. */
- void importDxfHeight( RecordInputStream& rStrm );
+ void importDxfHeight( SequenceInputStream& rStrm );
/** Imports the font weight from a DXF record. */
- void importDxfWeight( RecordInputStream& rStrm );
+ void importDxfWeight( SequenceInputStream& rStrm );
/** Imports the font underline style from a DXF record. */
- void importDxfUnderline( RecordInputStream& rStrm );
+ void importDxfUnderline( SequenceInputStream& rStrm );
/** Imports the font escapement style from a DXF record. */
- void importDxfEscapement( RecordInputStream& rStrm );
+ void importDxfEscapement( SequenceInputStream& rStrm );
/** Imports a font style flag from a DXF record. */
- void importDxfFlag( sal_Int32 nElement, RecordInputStream& rStrm );
+ void importDxfFlag( sal_Int32 nElement, SequenceInputStream& rStrm );
/** Imports the FONT record from the passed stream. */
void importFont( BiffInputStream& rStrm );
@@ -347,12 +350,12 @@ struct AlignmentModel
explicit AlignmentModel();
- /** Sets horizontal alignment from the passed OOBIN or BIFF data. */
- void setBinHorAlign( sal_uInt8 nHorAlign );
- /** Sets vertical alignment from the passed OOBIN or BIFF data. */
- void setBinVerAlign( sal_uInt8 nVerAlign );
- /** Sets rotation from the passed OOBIN or BIFF text orientation. */
- void setBinTextOrient( sal_uInt8 nTextOrient );
+ /** Sets horizontal alignment from the passed BIFF data. */
+ void setBiffHorAlign( sal_uInt8 nHorAlign );
+ /** Sets vertical alignment from the passed BIFF data. */
+ void setBiffVerAlign( sal_uInt8 nVerAlign );
+ /** Sets rotation from the passed BIFF text orientation. */
+ void setBiffTextOrient( sal_uInt8 nTextOrient );
};
// ----------------------------------------------------------------------------
@@ -389,8 +392,8 @@ public:
/** Sets all attributes from the alignment element. */
void importAlignment( const AttributeList& rAttribs );
- /** Sets the alignment attributes from the passed OOBIN XF record data. */
- void setBinData( sal_uInt32 nFlags );
+ /** Sets the alignment attributes from the passed BIFF12 XF record data. */
+ void setBiff12Data( sal_uInt32 nFlags );
/** Sets the alignment attributes from the passed BIFF2 XF record data. */
void setBiff2Data( sal_uInt8 nFlags );
/** Sets the alignment attributes from the passed BIFF3 XF record data. */
@@ -455,8 +458,8 @@ public:
/** Sets all attributes from the protection element. */
void importProtection( const AttributeList& rAttribs );
- /** Sets the protection attributes from the passed OOBIN XF record data. */
- void setBinData( sal_uInt32 nFlags );
+ /** Sets the protection attributes from the passed BIFF12 XF record data. */
+ void setBiff12Data( sal_uInt32 nFlags );
/** Sets the protection attributes from the passed BIFF2 XF record data. */
void setBiff2Data( sal_uInt8 nNumFmt );
/** Sets the protection attributes from the passed BIFF3-BIFF8 XF record data. */
@@ -491,7 +494,7 @@ struct BorderLineModel
explicit BorderLineModel( bool bDxf );
- /** Sets the passed OOBIN or BIFF line style. */
+ /** Sets the passed BIFF line style. */
void setBiffStyle( sal_Int32 nLineStyle );
/** Sets line style and line color from the passed BIFF data. */
void setBiffData( sal_uInt8 nLineStyle, sal_uInt16 nLineColor );
@@ -552,9 +555,9 @@ public:
void importColor( sal_Int32 nElement, const AttributeList& rAttribs );
/** Imports the BORDER record from the passed stream. */
- void importBorder( RecordInputStream& rStrm );
+ void importBorder( SequenceInputStream& rStrm );
/** Imports a border from a DXF record from the passed stream. */
- void importDxfBorder( sal_Int32 nElement, RecordInputStream& rStrm );
+ void importDxfBorder( sal_Int32 nElement, SequenceInputStream& rStrm );
/** Sets the border attributes from the passed BIFF2 XF record data. */
void setBiff2Data( sal_uInt8 nFlags );
@@ -611,8 +614,8 @@ struct PatternFillModel
explicit PatternFillModel( bool bDxf );
- /** Sets the passed OOBIN or BIFF pattern identifier. */
- void setBinPattern( sal_Int32 nPattern );
+ /** Sets the passed BIFF pattern identifier. */
+ void setBiffPattern( sal_Int32 nPattern );
/** Sets the pattern and pattern colors from the passed BIFF data. */
void setBiffData( sal_uInt16 nPatternColor, sal_uInt16 nFillColor, sal_uInt8 nPattern );
};
@@ -634,10 +637,10 @@ struct GradientFillModel
explicit GradientFillModel();
- /** Reads OOBIN gradient settings from a FILL or DXF record. */
- void readGradient( RecordInputStream& rStrm );
- /** Reads OOBIN gradient stop settings from a FILL or DXF record. */
- void readGradientStop( RecordInputStream& rStrm, bool bDxf );
+ /** Reads BIFF12 gradient settings from a FILL or DXF record. */
+ void readGradient( SequenceInputStream& rStrm );
+ /** Reads BIFF12 gradient stop settings from a FILL or DXF record. */
+ void readGradientStop( SequenceInputStream& rStrm, bool bDxf );
};
// ----------------------------------------------------------------------------
@@ -674,17 +677,17 @@ public:
void importColor( const AttributeList& rAttribs, double fPosition );
/** Imports the FILL record from the passed stream. */
- void importFill( RecordInputStream& rStrm );
+ void importFill( SequenceInputStream& rStrm );
/** Imports the fill pattern from a DXF record. */
- void importDxfPattern( RecordInputStream& rStrm );
+ void importDxfPattern( SequenceInputStream& rStrm );
/** Imports the pattern color from a DXF record. */
- void importDxfFgColor( RecordInputStream& rStrm );
+ void importDxfFgColor( SequenceInputStream& rStrm );
/** Imports the background color from a DXF record. */
- void importDxfBgColor( RecordInputStream& rStrm );
+ void importDxfBgColor( SequenceInputStream& rStrm );
/** Imports gradient settings from a DXF record. */
- void importDxfGradient( RecordInputStream& rStrm );
+ void importDxfGradient( SequenceInputStream& rStrm );
/** Imports gradient stop settings from a DXF record. */
- void importDxfStop( RecordInputStream& rStrm );
+ void importDxfStop( SequenceInputStream& rStrm );
/** Sets the fill attributes from the passed BIFF2 XF record data. */
void setBiff2Data( sal_uInt8 nFlags );
@@ -768,7 +771,7 @@ public:
void importProtection( const AttributeList& rAttribs );
/** Imports the XF record from the passed stream. */
- void importXf( RecordInputStream& rStrm, bool bCellXf );
+ void importXf( SequenceInputStream& rStrm, bool bCellXf );
/** Imports the XF record from the passed stream. */
void importXf( BiffInputStream& rStrm );
@@ -829,7 +832,7 @@ public:
void importProtection( const AttributeList& rAttribs );
/** Imports the DXF record from the passed stream. */
- void importDxf( RecordInputStream& rStrm );
+ void importDxf( SequenceInputStream& rStrm );
/** Imports font, border, and fill settings from the CFRULE record. */
void importCfRule( BiffInputStream& rStrm, sal_uInt32 nFlags );
@@ -884,7 +887,7 @@ public:
/** Imports passed attributes from the cellStyle element. */
void importCellStyle( const AttributeList& rAttribs );
/** Imports style settings from a CELLSTYLE record. */
- void importCellStyle( RecordInputStream& rStrm );
+ void importCellStyle( SequenceInputStream& rStrm );
/** Imports style settings from a STYLE record. */
void importStyle( BiffInputStream& rStrm );
@@ -917,7 +920,7 @@ public:
/** Appends and returns a new named cell style object. */
CellStyleRef importCellStyle( const AttributeList& rAttribs );
/** Imports the CELLSTYLE record from the passed stream. */
- CellStyleRef importCellStyle( RecordInputStream& rStrm );
+ CellStyleRef importCellStyle( SequenceInputStream& rStrm );
/** Imports the STYLE record from the passed stream. */
CellStyleRef importStyle( BiffInputStream& rStrm );
@@ -949,6 +952,21 @@ private:
// ============================================================================
+struct AutoFormatModel
+{
+ sal_Int32 mnAutoFormatId; /// Index of predefined autoformatting.
+ bool mbApplyNumFmt; /// True = apply number format from autoformatting.
+ bool mbApplyFont; /// True = apply font from autoformatting.
+ bool mbApplyAlignment; /// True = apply alignment from autoformatting.
+ bool mbApplyBorder; /// True = apply border from autoformatting.
+ bool mbApplyFill; /// True = apply fill from autoformatting.
+ bool mbApplyProtection; /// True = apply protection from autoformatting.
+
+ explicit AutoFormatModel();
+};
+
+// ============================================================================
+
class StylesBuffer : public WorkbookHelper
{
public:
@@ -983,11 +1001,11 @@ public:
CellStyleRef importCellStyle( const AttributeList& rAttribs );
/** Appends a new color to the color palette. */
- void importPaletteColor( RecordInputStream& rStrm );
+ void importPaletteColor( SequenceInputStream& rStrm );
/** Imports the NUMFMT record from the passed stream. */
- void importNumFmt( RecordInputStream& rStrm );
+ void importNumFmt( SequenceInputStream& rStrm );
/** Imports the CELLSTYLE record from the passed stream. */
- void importCellStyle( RecordInputStream& rStrm );
+ void importCellStyle( SequenceInputStream& rStrm );
/** Imports the PALETTE record from the passed stream. */
void importPalette( BiffInputStream& rStrm );
@@ -1002,6 +1020,9 @@ public:
/** Imports the STYLE record from the passed stream. */
void importStyle( BiffInputStream& rStrm );
+ /** Imports a color palette from a UNO sequence in the passed any. */
+ void importPalette( const ::com::sun::star::uno::Any& rPalette );
+
/** Final processing after import of all style settings. */
void finalizeImport();
@@ -1083,4 +1104,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/stylesfragment.hxx b/oox/inc/oox/xls/stylesfragment.hxx
index 876cbb81cf51..84e077da6d7a 100644
--- a/oox/inc/oox/xls/stylesfragment.hxx
+++ b/oox/inc/oox/xls/stylesfragment.hxx
@@ -37,24 +37,24 @@ namespace xls {
// ============================================================================
-class OoxIndexedColorsContext : public OoxWorkbookContextBase
+class IndexedColorsContext : public WorkbookContextBase
{
public:
- explicit OoxIndexedColorsContext( OoxWorkbookFragmentBase& rFragment );
+ explicit IndexedColorsContext( WorkbookFragmentBase& rFragment );
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
};
// ============================================================================
-class OoxFontContext : public OoxWorkbookContextBase
+class FontContext : public WorkbookContextBase
{
public:
template< typename ParentType >
- inline explicit OoxFontContext( ParentType& rParent, const FontRef& rxFont ) :
- OoxWorkbookContextBase( rParent ), mxFont( rxFont ) {}
+ inline explicit FontContext( ParentType& rParent, const FontRef& rxFont ) :
+ WorkbookContextBase( rParent ), mxFont( rxFont ) {}
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -65,12 +65,12 @@ private:
// ============================================================================
-class OoxBorderContext : public OoxWorkbookContextBase
+class BorderContext : public WorkbookContextBase
{
public:
template< typename ParentType >
- inline explicit OoxBorderContext( ParentType& rParent, const BorderRef& rxBorder ) :
- OoxWorkbookContextBase( rParent ), mxBorder( rxBorder ) {}
+ inline explicit BorderContext( ParentType& rParent, const BorderRef& rxBorder ) :
+ WorkbookContextBase( rParent ), mxBorder( rxBorder ) {}
protected:
virtual void onStartElement( const AttributeList& rAttribs );
@@ -82,12 +82,12 @@ private:
// ============================================================================
-class OoxFillContext : public OoxWorkbookContextBase
+class FillContext : public WorkbookContextBase
{
public:
template< typename ParentType >
- inline explicit OoxFillContext( ParentType& rParent, const FillRef& rxFill ) :
- OoxWorkbookContextBase( rParent ), mxFill( rxFill ), mfGradPos( -1.0 ) {}
+ inline explicit FillContext( ParentType& rParent, const FillRef& rxFill ) :
+ WorkbookContextBase( rParent ), mxFill( rxFill ), mfGradPos( -1.0 ) {}
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -99,12 +99,12 @@ private:
// ============================================================================
-class OoxXfContext : public OoxWorkbookContextBase
+class XfContext : public WorkbookContextBase
{
public:
template< typename ParentType >
- inline explicit OoxXfContext( ParentType& rParent, const XfRef& rxXf, bool bCellXf ) :
- OoxWorkbookContextBase( rParent ), mxXf( rxXf ), mbCellXf( bCellXf ) {}
+ inline explicit XfContext( ParentType& rParent, const XfRef& rxXf, bool bCellXf ) :
+ WorkbookContextBase( rParent ), mxXf( rxXf ), mbCellXf( bCellXf ) {}
protected:
virtual void onStartElement( const AttributeList& rAttribs );
@@ -117,12 +117,12 @@ private:
// ============================================================================
-class OoxDxfContext : public OoxWorkbookContextBase
+class DxfContext : public WorkbookContextBase
{
public:
template< typename ParentType >
- inline explicit OoxDxfContext( ParentType& rParent, const DxfRef& rxDxf ) :
- OoxWorkbookContextBase( rParent ), mxDxf( rxDxf ) {}
+ inline explicit DxfContext( ParentType& rParent, const DxfRef& rxDxf ) :
+ WorkbookContextBase( rParent ), mxDxf( rxDxf ) {}
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
@@ -133,20 +133,16 @@ private:
// ============================================================================
-class OoxStylesFragment : public OoxWorkbookFragmentBase
+class StylesFragment : public WorkbookFragmentBase
{
public:
- explicit OoxStylesFragment(
+ explicit StylesFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
-
- // oox.core.FragmentHandler2 interface ------------------------------------
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
virtual void finalizeImport();
@@ -159,4 +155,4 @@ protected:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/tablebuffer.hxx b/oox/inc/oox/xls/tablebuffer.hxx
index 3dd52a3decd7..5c0d959d195b 100644
--- a/oox/inc/oox/xls/tablebuffer.hxx
+++ b/oox/inc/oox/xls/tablebuffer.hxx
@@ -30,7 +30,7 @@
#define OOX_XLS_TABLEBUFFER_HXX
#include <com/sun/star/table/CellRangeAddress.hpp>
-#include "oox/helper/containerhelper.hxx"
+#include "oox/xls/autofilterbuffer.hxx"
#include "oox/xls/workbookhelper.hxx"
namespace oox {
@@ -62,16 +62,18 @@ public:
/** Imports a table definition from the passed attributes. */
void importTable( const AttributeList& rAttribs, sal_Int16 nSheet );
/** Imports a table definition from a TABLE record. */
- void importTable( RecordInputStream& rStrm, sal_Int16 nSheet );
+ void importTable( SequenceInputStream& rStrm, sal_Int16 nSheet );
+ /** Creates a new auto filter and stores it internally. */
+ inline AutoFilter& createAutoFilter() { return maAutoFilters.createAutoFilter(); }
/** Creates a database range from this tables. */
void finalizeImport();
- /** Returns the table identifier. */
+ /** Returns the unique table identifier. */
inline sal_Int32 getTableId() const { return maModel.mnId; }
/** Returns the token index used in API token arrays (com.sun.star.sheet.FormulaToken). */
inline sal_Int32 getTokenIndex() const { return mnTokenIndex; }
- /** Returns the display name of the table. */
+ /** Returns the original display name of the table. */
inline const ::rtl::OUString& getDisplayName() const { return maModel.maDisplayName; }
/** Returns the original (unchecked) total range of the table. */
@@ -89,6 +91,8 @@ public:
private:
TableModel maModel;
+ AutoFilterBuffer maAutoFilters; /// Filter settings for this table.
+ ::rtl::OUString maDBRangeName; /// Name of the databae range in the Calc document.
::com::sun::star::table::CellRangeAddress
maDestRange; /// Validated range of the table in the worksheet.
sal_Int32 mnTokenIndex; /// Token index used in API token array.
@@ -103,10 +107,8 @@ class TableBuffer : public WorkbookHelper
public:
explicit TableBuffer( const WorkbookHelper& rHelper );
- /** Imports a table definition from the passed attributes. */
- TableRef importTable( const AttributeList& rAttribs, sal_Int16 nSheet );
- /** Imports a table definition from a TABLE record. */
- TableRef importTable( RecordInputStream& rStrm, sal_Int16 nSheet );
+ /** Creates a new empty table. */
+ Table& createTable();
/** Creates database ranges from all imported tables. */
void finalizeImport();
@@ -117,12 +119,15 @@ public:
TableRef getTable( const ::rtl::OUString& rDispName ) const;
private:
- void insertTable( TableRef xTable );
+ /** Inserts the passed table into the maps according to its identifier and name. */
+ void insertTableToMaps( const TableRef& rxTable );
private:
+ typedef RefVector< Table > TableVector;
typedef RefMap< sal_Int32, Table > TableIdMap;
typedef RefMap< ::rtl::OUString, Table > TableNameMap;
+ TableVector maTables;
TableIdMap maIdTables;
TableNameMap maNameTables;
};
@@ -134,4 +139,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/tablefragment.hxx b/oox/inc/oox/xls/tablefragment.hxx
index 452b61d1b857..d5cb09b519a4 100644
--- a/oox/inc/oox/xls/tablefragment.hxx
+++ b/oox/inc/oox/xls/tablefragment.hxx
@@ -30,32 +30,29 @@
#define OOX_XLS_TABLEFRAGMENT_HXX
#include "oox/xls/excelhandlers.hxx"
-#include "oox/xls/tablebuffer.hxx"
namespace oox {
namespace xls {
+class Table;
+
// ============================================================================
-class OoxTableFragment : public OoxWorksheetFragmentBase
+class TableFragment : public WorksheetFragmentBase
{
public:
- explicit OoxTableFragment(
+ explicit TableFragment(
const WorksheetHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
-
- // oox.core.FragmentHandler2 interface ------------------------------------
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
private:
- TableRef mxTable; /// Current table.
+ Table& mrTable;
};
// ============================================================================
@@ -65,4 +62,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/themebuffer.hxx b/oox/inc/oox/xls/themebuffer.hxx
index e1641e740a71..eb848fcc5f12 100644
--- a/oox/inc/oox/xls/themebuffer.hxx
+++ b/oox/inc/oox/xls/themebuffer.hxx
@@ -63,4 +63,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/unitconverter.hxx b/oox/inc/oox/xls/unitconverter.hxx
index 395d6bb1a3a1..5253998433fc 100644
--- a/oox/inc/oox/xls/unitconverter.hxx
+++ b/oox/inc/oox/xls/unitconverter.hxx
@@ -29,8 +29,8 @@
#ifndef OOX_XLS_UNITCONVERTER_HXX
#define OOX_XLS_UNITCONVERTER_HXX
-#include <vector>
#include <map>
+#include <vector>
#include "oox/xls/workbookhelper.hxx"
namespace com { namespace sun { namespace star {
@@ -123,4 +123,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/viewsettings.hxx b/oox/inc/oox/xls/viewsettings.hxx
index 3e862d7b3982..401b8bb38857 100644
--- a/oox/inc/oox/xls/viewsettings.hxx
+++ b/oox/inc/oox/xls/viewsettings.hxx
@@ -31,7 +31,6 @@
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
-#include "oox/helper/containerhelper.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/stylesbuffer.hxx"
#include "oox/xls/worksheethelper.hxx"
@@ -120,13 +119,13 @@ public:
void importChartSheetView( const AttributeList& rAttribs );
/** Imports the SHEETVIEW record containing sheet view settings. */
- void importSheetView( RecordInputStream& rStrm );
+ void importSheetView( SequenceInputStream& rStrm );
/** Imports the PANE record containing sheet pane settings. */
- void importPane( RecordInputStream& rStrm );
+ void importPane( SequenceInputStream& rStrm );
/** Imports the SELECTION record containing selection settings for a pane. */
- void importSelection( RecordInputStream& rStrm );
+ void importSelection( SequenceInputStream& rStrm );
/** Imports the CHARTSHEETVIEW record containing view settings of a chart sheet. */
- void importChartSheetView( RecordInputStream& rStrm );
+ void importChartSheetView( SequenceInputStream& rStrm );
/** Imports the WINDOW2 record containing sheet view settings. */
void importWindow2( BiffInputStream& rStrm );
@@ -140,6 +139,9 @@ public:
/** Converts all imported sheet view settings. */
void finalizeImport();
+ /** Returns true, if the sheet layout is set to right-to-left. */
+ bool isSheetRightToLeft() const;
+
private:
SheetViewModelRef createSheetView();
@@ -183,9 +185,9 @@ public:
/** Imports the oleSize element containing the visible size of the workbook. */
void importOleSize( const AttributeList& rAttribs );
/** Imports the WORKBOOKVIEW record containing workbook view settings. */
- void importWorkbookView( RecordInputStream& rStrm );
+ void importWorkbookView( SequenceInputStream& rStrm );
/** Imports the OLESIZE record containing the visible size of the workbook. */
- void importOleSize( RecordInputStream& rStrm );
+ void importOleSize( SequenceInputStream& rStrm );
/** Imports the WINDOW1 record containing workbook view settings. */
void importWindow1( BiffInputStream& rStrm );
/** Imports the OLESIZE record containing the visible size of the workbook. */
@@ -230,4 +232,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/webquerybuffer.hxx b/oox/inc/oox/xls/webquerybuffer.hxx
deleted file mode 100644
index 483edf993e7c..000000000000
--- a/oox/inc/oox/xls/webquerybuffer.hxx
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef OOX_XLS_WEBQUERYBUFFER_HXX
-#define OOX_XLS_WEBQUERYBUFFER_HXX
-
-#include <vector>
-#include <boost/unordered_map.hpp>
-#include <boost/shared_ptr.hpp>
-#include <com/sun/star/table/CellRangeAddress.hpp>
-#include "oox/xls/workbookhelper.hxx"
-
-namespace oox {
-namespace xls {
-
-// ============================================================================
-
-struct QueryTable
-{
- sal_Int32 mnConnectionId;
-};
-
-// struct WebQuery
-// {
-// enum WebQueryMode
-// {
-// xlWQUnknown, /// Not specified.
-// xlWQDocument, /// Entire document.
-// xlWQAllTables, /// All tables.
-// xlWQSpecTables /// Specific tables.
-// };
-//
-// ::rtl::OUString maURL; /// Source document URL.
-// ::rtl::OUString maTables; /// List of source range names.
-// ::com::sun::star::table::CellRangeAddress maDestRange; /// Destination range.
-// WebQueryMode meMode; /// Current mode of web query.
-// sal_uInt16 mnRefresh; /// Refresh time in minutes.
-// };
-
-struct BaseProperties
-{
-};
-
-/** Stores web query properties from webPr element. */
-struct WebProperties : public BaseProperties
-{
- ::rtl::OUString maURL;
-};
-
-/** Stores text data source properties from textPr element. */
-struct TextProperties : public BaseProperties
-{
- ::rtl::OUString maSourceFile;
-};
-
-struct Connection
-{
- static const sal_Int32 CONNECTION_ODBC_SOURCE;
- static const sal_Int32 CONNECTION_DAO_SOURCE;
- static const sal_Int32 CONNECTION_FILE_SOURCE;
- static const sal_Int32 CONNECTION_WEBQUERY;
- static const sal_Int32 CONNECTION_OLEDB_SOURCE;
- static const sal_Int32 CONNECTION_TEXT_SOURCE;
- static const sal_Int32 CONNECTION_ADO_RECORD_SET;
- static const sal_Int32 CONNECTION_DSP;
-
- ::rtl::OUString maName; /// Connection name (must be unique).
- sal_Int32 mnType;
- ::boost::shared_ptr< BaseProperties > mpProperties;
-};
-
-// ============================================================================
-
-typedef ::boost::unordered_map< ::rtl::OUString, QueryTable, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > QueryTableHashMap;
-
-class WebQueryBuffer : public WorkbookHelper
-{
-public:
- explicit WebQueryBuffer( const WorkbookHelper& rHelper );
-
- void importQueryTable( const AttributeList& rAttribs );
-
- void importConnection( const AttributeList& rAttribs );
-
- void importWebPr( const AttributeList& rAttribs );
-
- /** Dumps content for debug purposes. */
- void dump() const;
-
-private:
- QueryTableHashMap maQueryTableMap;
- ::std::vector< Connection > maConnections;
-
- sal_Int32 mnCurConnId; /// Current connection ID.
-};
-
-// ============================================================================
-
-} // namespace xls
-} // namespace oox
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/xls/workbookfragment.hxx b/oox/inc/oox/xls/workbookfragment.hxx
index 4ed3cfddd19f..d6d37242b0fc 100644
--- a/oox/inc/oox/xls/workbookfragment.hxx
+++ b/oox/inc/oox/xls/workbookfragment.hxx
@@ -39,22 +39,18 @@ class ExternalLink;
// ============================================================================
-class OoxWorkbookFragment : public OoxWorkbookFragmentBase
+class WorkbookFragment : public WorkbookFragmentBase
{
public:
- explicit OoxWorkbookFragment(
+ explicit WorkbookFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
-
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
- // oox.core.FragmentHandler2 interface ------------------------------------
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
virtual void finalizeImport();
@@ -64,8 +60,8 @@ private:
void importDefinedName( const AttributeList& rAttribs );
void importPivotCache( const AttributeList& rAttribs );
- void importExternalRef( RecordInputStream& rStrm );
- void importPivotCache( RecordInputStream& rStrm );
+ void importExternalRef( SequenceInputStream& rStrm );
+ void importPivotCache( SequenceInputStream& rStrm );
void importExternalLinkFragment( ExternalLink& rExtLink );
void importPivotCacheDefFragment( const ::rtl::OUString& rRelId, sal_Int32 nCacheId );
@@ -102,4 +98,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/workbookhelper.hxx b/oox/inc/oox/xls/workbookhelper.hxx
index 80401a257656..fa32ea026fca 100644
--- a/oox/inc/oox/xls/workbookhelper.hxx
+++ b/oox/inc/oox/xls/workbookhelper.hxx
@@ -38,24 +38,21 @@ namespace com { namespace sun { namespace star {
namespace container { class XNameAccess; }
namespace container { class XNameContainer; }
namespace lang { class XMultiServiceFactory; }
- namespace awt { class XDevice; }
+ namespace sheet { class XDatabaseRange; }
+ namespace sheet { class XNamedRange; }
+ namespace sheet { class XSpreadsheet; }
+ namespace sheet { class XSpreadsheetDocument; }
+ namespace style { class XStyle; }
namespace table { struct CellAddress; }
namespace table { struct CellRangeAddress; }
namespace table { class XCell; }
namespace table { class XCellRange; }
- namespace sheet { class XSpreadsheetDocument; }
- namespace sheet { class XSpreadsheet; }
- namespace sheet { class XNamedRanges; }
- namespace sheet { class XNamedRange; }
- namespace sheet { class XDatabaseRanges; }
- namespace sheet { class XExternalDocLinks; }
- namespace style { class XStyle; }
} } }
namespace oox {
class AttributeList;
class SegmentProgressBar;
- class RecordInputStream;
+ class SequenceInputStream;
}
namespace oox { namespace core {
@@ -80,8 +77,8 @@ class ExcelBiffFilter;
/** An enumeration for all supported spreadsheet filter types. */
enum FilterType
{
- FILTER_OOX, /// MS Excel OOXML (Office Open XML) or OOBIN.
- FILTER_BIFF, /// MS Excel BIFF (Binary Interchange File Format).
+ FILTER_OOXML, /// MS Excel OOXML (Office Open XML) or BIFF12.
+ FILTER_BIFF, /// MS Excel BIFF2-BIFF8 (Binary Interchange File Format).
FILTER_UNKNOWN /// Unknown filter type.
};
@@ -90,31 +87,31 @@ enum FilterType
/** Functor for case-insensitive string comparison, usable in maps etc. */
struct IgnoreCaseCompare
{
- bool operator()( const ::rtl::OUString& rName1, const ::rtl::OUString& rName2 ) const;
+ bool operator()( const ::rtl::OUString& rName1, const ::rtl::OUString& rName2 ) const;
};
// ============================================================================
-class WorkbookData;
-class WorkbookSettings;
-class ViewSettings;
-class WorksheetBuffer;
-class ThemeBuffer;
-class StylesBuffer;
-class SharedStringsBuffer;
-class ExternalLinkBuffer;
+class AddressConverter;
+class BiffCodecHelper;
+class ConnectionsBuffer;
class DefinedNamesBuffer;
-class TableBuffer;
-class ScenarioBuffer;
-class WebQueryBuffer;
+class ExcelChartConverter;
+class ExternalLinkBuffer;
+class FormulaParser;
+class PageSettingsConverter;
class PivotCacheBuffer;
class PivotTableBuffer;
-class FormulaParser;
+class ScenarioBuffer;
+class SharedStringsBuffer;
+class StylesBuffer;
+class TableBuffer;
+class ThemeBuffer;
class UnitConverter;
-class AddressConverter;
-class ExcelChartConverter;
-class PageSettingsConverter;
-class BiffCodecHelper;
+class ViewSettings;
+class WorkbookData;
+class WorkbookSettings;
+class WorksheetBuffer;
/** Helper class to provice access to global workbook data.
@@ -164,21 +161,6 @@ public:
/** Returns a reference to the service factory of the spreadsheet document model. */
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
getDocumentFactory() const;
- /** Returns the reference device of the document. */
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice >
- getReferenceDevice() const;
- /** Returns the container for defined names from the Calc document. */
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XNamedRanges >
- getNamedRanges() const;
- /** Returns the container for database ranges from the Calc document. */
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDatabaseRanges >
- getDatabaseRanges() const;
- /** Returns the container for external documents from the Calc document. */
- ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XExternalDocLinks >
- getExternalDocLinks() const;
- /** Returns the container for DDE links from the Calc document. */
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
- getDdeLinks() const;
/** Returns a reference to the specified spreadsheet in the document model. */
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet >
@@ -204,12 +186,21 @@ public:
getStyleObject( const ::rtl::OUString& rStyleName, bool bPageStyle ) const;
/** Creates and returns a defined name on-the-fly in the Calc document.
- The name will not be buffered in this defined names buffer.
+ The name will not be buffered in the global defined names buffer.
@param orName (in/out-parameter) Returns the resulting used name. */
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XNamedRange >
createNamedRangeObject(
::rtl::OUString& orName,
sal_Int32 nNameFlags = 0 ) const;
+
+ /** Creates and returns a database range on-the-fly in the Calc document.
+ The range will not be buffered in the global table buffer.
+ @param orName (in/out-parameter) Returns the resulting used name. */
+ ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XDatabaseRange >
+ createDatabaseRangeObject(
+ ::rtl::OUString& orName,
+ const ::com::sun::star::table::CellRangeAddress& rRangeAddr ) const;
+
/** Creates and returns a com.sun.star.style.Style object for cells or pages. */
::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >
createStyleObject(
@@ -238,8 +229,8 @@ public:
TableBuffer& getTables() const;
/** Returns the scenarios collection. */
ScenarioBuffer& getScenarios() const;
- /** Returns the web queries. */
- WebQueryBuffer& getWebQueries() const;
+ /** Returns the collection of external data connections. */
+ ConnectionsBuffer& getConnections() const;
/** Returns the collection of pivot caches. */
PivotCacheBuffer& getPivotCaches() const;
/** Returns the collection of pivot tables. */
@@ -258,17 +249,17 @@ public:
/** Returns the page and print settings converter. */
PageSettingsConverter& getPageSettingsConverter() const;
- // OOX specific (MUST NOT be called in BIFF filter) -----------------------
+ // OOXML/BIFF12 specific (MUST NOT be called in BIFF filter) --------------
- /** Returns the base OOX filter object.
- Must not be called, if current filter is not the OOX filter. */
+ /** Returns the base OOXML/BIFF12 filter object.
+ Must not be called, if current filter is not the OOXML/BIFF12 filter. */
::oox::core::XmlFilterBase& getOoxFilter() const;
/** Imports a fragment using the passed fragment handler, which contains
the full path to the fragment stream. */
bool importOoxFragment( const ::rtl::Reference< ::oox::core::FragmentHandler >& rxHandler );
- // BIFF specific (MUST NOT be called in OOX filter) -----------------------
+ // BIFF2-BIFF8 specific (MUST NOT be called in OOXML/BIFF12 filter) -------
/** Returns the base BIFF filter object. */
::oox::core::BinaryFilterBase& getBiffFilter() const;
diff --git a/oox/inc/oox/xls/workbooksettings.hxx b/oox/inc/oox/xls/workbooksettings.hxx
index 82fc889d0660..eb1ac8237c81 100644
--- a/oox/inc/oox/xls/workbooksettings.hxx
+++ b/oox/inc/oox/xls/workbooksettings.hxx
@@ -63,8 +63,8 @@ struct WorkbookSettingsModel
explicit WorkbookSettingsModel();
- /** Sets OOBIN or BIFF object visibility mode. */
- void setBinObjectMode( sal_uInt16 nObjMode );
+ /** Sets BIFF object visibility mode. */
+ void setBiffObjectMode( sal_uInt16 nObjMode );
};
// ============================================================================
@@ -103,11 +103,11 @@ public:
void importCalcPr( const AttributeList& rAttribs );
/** Imports the FILESHARING record containing write protection settings. */
- void importFileSharing( RecordInputStream& rStrm );
+ void importFileSharing( SequenceInputStream& rStrm );
/** Imports the WORKBOOKPR record containing global workbook settings. */
- void importWorkbookPr( RecordInputStream& rStrm );
+ void importWorkbookPr( SequenceInputStream& rStrm );
/** Imports the CALCPR record containing workbook calculation settings. */
- void importCalcPr( RecordInputStream& rStrm );
+ void importCalcPr( SequenceInputStream& rStrm );
/** Sets the save external linked values flag, e.g. from the WSBOOL record. */
void setSaveExtLinkValues( bool bSaveExtLinks );
@@ -165,4 +165,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/worksheetbuffer.hxx b/oox/inc/oox/xls/worksheetbuffer.hxx
index 8b88a84981fb..5873ec41d9e9 100644
--- a/oox/inc/oox/xls/worksheetbuffer.hxx
+++ b/oox/inc/oox/xls/worksheetbuffer.hxx
@@ -30,7 +30,8 @@
#define OOX_XLS_WORKSHEETBUFFER_HXX
#include <utility>
-#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/refmap.hxx"
+#include "oox/helper/refvector.hxx"
#include "oox/xls/workbookhelper.hxx"
namespace com { namespace sun { namespace star {
@@ -59,8 +60,8 @@ struct SheetInfoModel
/** Stores information about all sheets in a spreadsheet document.
Information about sheets includes the sheet name, the visibility state, and
- for the OOX filter, the relation identifier of the sheet used to obtain the
- related worksheet fragment.
+ for the OOXML filter, the relation identifier of the sheet used to obtain
+ the related worksheet fragment.
*/
class WorksheetBuffer : public WorkbookHelper
{
@@ -75,8 +76,8 @@ public:
/** Imports the attributes of a sheet element. */
void importSheet( const AttributeList& rAttribs );
- /** Imports the SHEET record from the passed OOBIN stream. */
- void importSheet( RecordInputStream& rStrm );
+ /** Imports the SHEET record from the passed BIFF12 stream. */
+ void importSheet( SequenceInputStream& rStrm );
/** Imports the SHEET record from the passed BIFF stream. */
void importSheet( BiffInputStream& rStrm );
/** Inserts a new empty sheet into the document. Looks for an unused name.
@@ -85,7 +86,7 @@ public:
/** Returns the number of original sheets contained in the workbook. */
sal_Int32 getWorksheetCount() const;
- /** Returns the OOX relation identifier of the specified worksheet. */
+ /** Returns the OOXML relation identifier of the specified worksheet. */
::rtl::OUString getWorksheetRelId( sal_Int32 nWorksheet ) const;
/** Returns the BIFF record handle of the associated sheet substream. */
sal_Int64 getBiffRecordHandle( sal_Int32 nWorksheet ) const;
@@ -132,4 +133,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/worksheetfragment.hxx b/oox/inc/oox/xls/worksheetfragment.hxx
index bd78d241bc04..32970c8c8956 100644
--- a/oox/inc/oox/xls/worksheetfragment.hxx
+++ b/oox/inc/oox/xls/worksheetfragment.hxx
@@ -36,24 +36,23 @@ namespace xls {
// ============================================================================
-class OoxDataValidationsContext : public OoxWorksheetContextBase
+class DataValidationsContext : public WorksheetContextBase
{
public:
- explicit OoxDataValidationsContext( OoxWorksheetFragmentBase& rFragment );
+ explicit DataValidationsContext( WorksheetFragmentBase& rFragment );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
+ virtual void onEndElement();
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
private:
/** Imports the dataValidation element containing data validation settings. */
void importDataValidation( const AttributeList& rAttribs );
/** Imports the DATAVALIDATION record containing data validation settings. */
- void importDataValidation( RecordInputStream& rStrm );
+ void importDataValidation( SequenceInputStream& rStrm );
private:
::std::auto_ptr< ValidationModel > mxValModel;
@@ -61,25 +60,21 @@ private:
// ============================================================================
-class OoxWorksheetFragment : public OoxWorksheetFragmentBase
+class WorksheetFragment : public WorksheetFragmentBase
{
public:
- explicit OoxWorksheetFragment(
+ explicit WorksheetFragment(
const WorkbookHelper& rHelper,
const ::rtl::OUString& rFragmentPath,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
protected:
- // oox.core.ContextHandler2Helper interface -------------------------------
-
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
- virtual void onEndElement( const ::rtl::OUString& rChars );
+ virtual void onCharacters( const ::rtl::OUString& rChars );
- virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm );
-
- // oox.core.FragmentHandler2 interface ------------------------------------
+ virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual const ::oox::core::RecordInfo* getRecordInfos() const;
virtual void initializeImport();
@@ -110,25 +105,25 @@ private:
void importControl( const AttributeList& rAttribs );
/** Imports the DIMENSION record containing the used area of the sheet. */
- void importDimension( RecordInputStream& rStrm );
+ void importDimension( SequenceInputStream& rStrm );
/** Imports sheet format properties from a SHEETFORMATPR record. */
- void importSheetFormatPr( RecordInputStream& rStrm );
+ void importSheetFormatPr( SequenceInputStream& rStrm );
/** Imports column settings from a COL record. */
- void importCol( RecordInputStream& rStrm );
+ void importCol( SequenceInputStream& rStrm );
/** Imports a merged cell range from a MERGECELL record. */
- void importMergeCell( RecordInputStream& rStrm );
+ void importMergeCell( SequenceInputStream& rStrm );
/** Imports a hyperlink for a cell range from a HYPERLINK record. */
- void importHyperlink( RecordInputStream& rStrm );
+ void importHyperlink( SequenceInputStream& rStrm );
/** Imports the BRK record for an individual row or column page break. */
- void importBrk( RecordInputStream& rStrm, bool bRowBreak );
+ void importBrk( SequenceInputStream& rStrm, bool bRowBreak );
/** Imports the DRAWING record containing the relation identifier for the DrawingML part. */
- void importDrawing( RecordInputStream& rStrm );
+ void importDrawing( SequenceInputStream& rStrm );
/** Imports the LEGACYDRAWING record containing the relation identifier for the VML drawing part. */
- void importLegacyDrawing( RecordInputStream& rStrm );
+ void importLegacyDrawing( SequenceInputStream& rStrm );
/** Imports additional data for an OLE object. */
- void importOleObject( RecordInputStream& rStrm );
+ void importOleObject( SequenceInputStream& rStrm );
/** Imports additional data for an OCX form control. */
- void importControl( RecordInputStream& rStrm );
+ void importControl( SequenceInputStream& rStrm );
/** Imports the binary data of an embedded OLE object from the fragment with the passed ID. */
void importEmbeddedOleData( StreamDataSequence& orEmbeddedData, const ::rtl::OUString& rRelId );
@@ -136,14 +131,12 @@ private:
// ============================================================================
-class BiffPivotTableContext;
-
class BiffWorksheetFragment : public BiffWorksheetFragmentBase
{
public:
explicit BiffWorksheetFragment(
const BiffWorkbookFragmentBase& rParent,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
virtual ~BiffWorksheetFragment();
@@ -152,41 +145,45 @@ public:
virtual bool importFragment();
private:
+ /** Imports the AUTOFILTER and following records with auto filter settings. */
+ void importAutoFilter( BiffInputStream& rStrm );
/** Imports the COLINFO record and sets column properties and formatting. */
- void importColInfo();
+ void importColInfo( BiffInputStream& rStrm );
/** Imports the BIFF2 COLUMNDEFAULT record and sets column default formatting. */
- void importColumnDefault();
+ void importColumnDefault( BiffInputStream& rStrm );
/** Imports the BIFF2 COLWIDTH record and sets column width. */
- void importColWidth();
+ void importColWidth( BiffInputStream& rStrm );
/** Imports the DATAVALIDATION record containing cell ranges with data validation settings. */
- void importDataValidation();
+ void importDataValidation( BiffInputStream& rStrm );
/** Imports the DATAVALIDATIONS record containing global data validation settings. */
- void importDataValidations();
+ void importDataValidations( BiffInputStream& rStrm );
/** Imports the DEFCOLWIDTH record and sets default column width. */
- void importDefColWidth();
+ void importDefColWidth( BiffInputStream& rStrm );
/** Imports the DEFROWHEIGHT record and sets default row height and properties. */
- void importDefRowHeight();
+ void importDefRowHeight( BiffInputStream& rStrm );
/** Imports the DIMENSION record containing the used area of the sheet. */
- void importDimension();
+ void importDimension( BiffInputStream& rStrm );
/** Imports the HYPERLINK record and sets a cell hyperlink. */
- void importHyperlink();
+ void importHyperlink( BiffInputStream& rStrm );
/** Imports the LABELRANGES record and sets the imported label ranges. */
- void importLabelRanges();
+ void importLabelRanges( BiffInputStream& rStrm );
/** Imports the MEREDCELLS record and merges all cells in the document. */
- void importMergedCells();
+ void importMergedCells( BiffInputStream& rStrm );
/** Imports the HORPAGEBREAKS or VERPAGEBREAKS record and inserts page breaks. */
- void importPageBreaks( bool bRowBreak );
+ void importPageBreaks( BiffInputStream& rStrm, bool bRowBreak );
/** Imports a pivot table. */
- void importPTDefinition();
+ void importPTDefinition( BiffInputStream& rStrm );
+ /** Imports the QUERYTABLE and following records and inserts a web query. */
+ void importQueryTable( BiffInputStream& rStrm );
/** Imports the SCENARIOS record and the following scenarios. */
- void importScenarios();
+ void importScenarios( BiffInputStream& rStrm );
/** Imports the SHAREDFEATHEAD record. */
- void importSharedFeatHead();
+ void importSharedFeatHead( BiffInputStream& rStrm );
/** Imports the STANDARDWIDTH record and sets standard column width. */
- void importStandardWidth();
+ void importStandardWidth( BiffInputStream& rStrm );
private:
- ::boost::shared_ptr< BiffPivotTableContext > mxPTContext;
+ ::boost::shared_ptr< BiffWorksheetContextBase > mxContext;
};
// ============================================================================
@@ -196,4 +193,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/worksheethelper.hxx b/oox/inc/oox/xls/worksheethelper.hxx
index 6e45e5b71bbe..18800091f531 100644
--- a/oox/inc/oox/xls/worksheethelper.hxx
+++ b/oox/inc/oox/xls/worksheethelper.hxx
@@ -38,29 +38,31 @@ namespace com { namespace sun { namespace star {
namespace awt { struct Point; }
namespace awt { struct Rectangle; }
namespace awt { struct Size; }
- namespace util { struct DateTime; }
namespace drawing { class XDrawPage; }
- namespace table { class XTableColumns; }
- namespace table { class XTableRows; }
+ namespace sheet { class XSheetCellRanges; }
+ namespace sheet { class XSpreadsheet; }
namespace table { class XCell; }
namespace table { class XCellRange; }
- namespace sheet { class XSpreadsheet; }
- namespace sheet { class XSheetCellRanges; }
+ namespace table { class XTableColumns; }
+ namespace table { class XTableRows; }
+ namespace util { struct DateTime; }
} } }
namespace oox {
namespace xls {
+class AutoFilterBuffer;
struct BinAddress;
struct BinRange;
class BinRangeList;
-class WorksheetSettings;
-class SharedFormulaBuffer;
-class CondFormatBuffer;
class CommentsBuffer;
+class CondFormatBuffer;
class PageSettings;
+class QueryTableBuffer;
+class SharedFormulaBuffer;
class SheetViewSettings;
class VmlDrawing;
+class WorksheetSettings;
// ============================================================================
// ============================================================================
@@ -203,12 +205,12 @@ struct ValidationModel
explicit ValidationModel();
- /** Sets the passed OOBIN or BIFF validation type. */
- void setBinType( sal_uInt8 nType );
- /** Sets the passed OOBIN or BIFF operator. */
- void setBinOperator( sal_uInt8 nOperator );
- /** Sets the passed OOBIN or BIFF error style. */
- void setBinErrorStyle( sal_uInt8 nErrorStyle );
+ /** Sets the passed BIFF validation type. */
+ void setBiffType( sal_uInt8 nType );
+ /** Sets the passed BIFF operator. */
+ void setBiffOperator( sal_uInt8 nOperator );
+ /** Sets the passed BIFF error style. */
+ void setBiffErrorStyle( sal_uInt8 nErrorStyle );
};
// ============================================================================
@@ -315,6 +317,10 @@ public:
CondFormatBuffer& getCondFormats() const;
/** Returns the buffer for all cell comments in this sheet. */
CommentsBuffer& getComments() const;
+ /** Returns the auto filters for the sheet. */
+ AutoFilterBuffer& getAutoFilters() const;
+ /** Returns the buffer for all web query tables in this sheet. */
+ QueryTableBuffer& getQueryTables() const;
/** Returns the page/print settings for this sheet. */
PageSettings& getPageSettings() const;
/** Returns the view settings for this sheet. */
@@ -384,9 +390,8 @@ public:
void extendUsedArea( const ::com::sun::star::table::CellAddress& rAddress );
/** Extends the used area of this sheet by the passed cell range. */
void extendUsedArea( const ::com::sun::star::table::CellRangeAddress& rRange );
- /** Extends the shape bounding box by the position and size of the passed rectangle. */
- void extendShapeBoundingBox(
- const ::com::sun::star::awt::Rectangle& rShapeRect );
+ /** Extends the shape bounding box by the position and size of the passed rectangle (in 1/100 mm). */
+ void extendShapeBoundingBox( const ::com::sun::star::awt::Rectangle& rShapeRect );
/** Sets base width for all columns (without padding pixels). This value
is only used, if width has not been set with setDefaultColumnWidth(). */
@@ -446,7 +451,7 @@ protected:
/** Constructs from the passed data, creates and owns a new data object. */
explicit WorksheetHelperRoot(
const WorkbookHelper& rHelper,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
@@ -470,4 +475,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/inc/oox/xls/worksheetsettings.hxx b/oox/inc/oox/xls/worksheetsettings.hxx
index 3f92c4f47aea..43e73ec52e38 100644
--- a/oox/inc/oox/xls/worksheetsettings.hxx
+++ b/oox/inc/oox/xls/worksheetsettings.hxx
@@ -29,8 +29,8 @@
#ifndef OOX_XLS_WORKSHEETSETTINGS_HXX
#define OOX_XLS_WORKSHEETSETTINGS_HXX
-#include "oox/xls/worksheethelper.hxx"
#include "oox/xls/richstring.hxx"
+#include "oox/xls/worksheethelper.hxx"
namespace oox {
namespace xls {
@@ -99,16 +99,18 @@ public:
void importPhoneticPr( const AttributeList& rAttribs );
/** Imports sheet properties from the SHEETPR record. */
- void importSheetPr( RecordInputStream& rStrm );
+ void importSheetPr( SequenceInputStream& rStrm );
/** Imports sheet properties from the CHARTSHEETPR record. */
- void importChartSheetPr( RecordInputStream& rStrm );
+ void importChartSheetPr( SequenceInputStream& rStrm );
/** Imports sheet protection settings from the SHEETPROTECTION record. */
- void importSheetProtection( RecordInputStream& rStrm );
+ void importSheetProtection( SequenceInputStream& rStrm );
/** Imports chart sheet protection settings from the CHARTPROTECTION record. */
- void importChartProtection( RecordInputStream& rStrm );
+ void importChartProtection( SequenceInputStream& rStrm );
/** Imports phonetic settings from the PHONETICPR record. */
- void importPhoneticPr( RecordInputStream& rStrm );
+ void importPhoneticPr( SequenceInputStream& rStrm );
+ /** Imports sheet properties from a SHEETEXT record. */
+ void importSheetExt( BiffInputStream& rStrm );
/** Imports sheet properties from a SHEETPR record. */
void importSheetPr( BiffInputStream& rStrm );
/** Imports protection status from the PROTECT record. */
@@ -142,4 +144,4 @@ private:
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/prj/build.lst b/oox/prj/build.lst
index 57fde11e2c72..8ff9e5eda5ae 100644
--- a/oox/prj/build.lst
+++ b/oox/prj/build.lst
@@ -1,4 +1,4 @@
-oox oox : cppu cppuhelper comphelper filter sal offapi sax basegfx svx xmlscript tools vcl BOOST:boost OPENSSL:openssl NULL
+oox oox : cppu cppuhelper comphelper filter sal offapi sax basegfx svx xmlscript tools vcl BOOST:boost OPENSSL:openssl LIBXSLT:libxslt NULL
oox oox usr1 - all oox_mkout NULL
oox oox\prj get - all oox_prj NULL
oox oox\source\token nmake - all oox_token NULL
diff --git a/oox/prj/d.lst b/oox/prj/d.lst
index e2f066c4a7e6..52cc05f7cc27 100644
--- a/oox/prj/d.lst
+++ b/oox/prj/d.lst
@@ -1,11 +1,12 @@
mkdir: %_DEST%\inc%_EXT%\oox
-mkdir: %_DEST%\inc%_EXT%\oox\helper
mkdir: %_DEST%\inc%_EXT%\oox\core
mkdir: %_DEST%\inc%_EXT%\oox\drawingml
mkdir: %_DEST%\inc%_EXT%\oox\drawingml\chart
mkdir: %_DEST%\inc%_EXT%\oox\drawingml\table
mkdir: %_DEST%\inc%_EXT%\oox\export
+mkdir: %_DEST%\inc%_EXT%\oox\helper
mkdir: %_DEST%\inc%_EXT%\oox\ole
+mkdir: %_DEST%\inc%_EXT%\oox\token
mkdir: %_DEST%\inc%_EXT%\oox\vml
mkdir: %_DEST%\inc%_EXT%\oox\xls
@@ -18,15 +19,17 @@ mkdir: %_DEST%\inc%_EXT%\oox\xls
..\%__SRC%\lib\i*.lib %_DEST%\lib%_EXT%\i*.lib
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
-..\%__SRC%\inc\tokens.hxx %_DEST%\inc%_EXT%\oox\core\tokens.hxx
+..\%__SRC%\inc\oox\token\tokens.hxx %_DEST%\inc%_EXT%\oox\token\tokens.hxx
+..\%__SRC%\misc\namespaces.txt %_DEST%\inc%_EXT%\oox\namespaces.txt
..\source\token\tokens.txt %_DEST%\inc%_EXT%\oox\token.txt
-..\source\token\namespaces.txt %_DEST%\inc%_EXT%\oox\namespaces.txt
..\inc\oox\dllapi.h %_DEST%\inc%_EXT%\oox\dllapi.h
..\inc\oox\helper\binarystreambase.hxx %_DEST%\inc%_EXT%\oox\helper\binarystreambase.hxx
..\inc\oox\helper\helper.hxx %_DEST%\inc%_EXT%\oox\helper\helper.hxx
+..\inc\oox\helper\refmap.hxx %_DEST%\inc%_EXT%\oox\helper\refmap.hxx
..\inc\oox\helper\containerhelper.hxx %_DEST%\inc%_EXT%\oox\helper\containerhelper.hxx
..\inc\oox\helper\graphichelper.hxx %_DEST%\inc%_EXT%\oox\helper\graphichelper.hxx
+..\inc\oox\helper\refvector.hxx %_DEST%\inc%_EXT%\oox\helper\refvector.hxx
..\inc\oox\helper\storagebase.hxx %_DEST%\inc%_EXT%\oox\helper\storagebase.hxx
..\inc\oox\helper\zipstorage.hxx %_DEST%\inc%_EXT%\oox\helper\zipstorage.hxx
..\inc\oox\core\filterbase.hxx %_DEST%\inc%_EXT%\oox\core\filterbase.hxx
@@ -40,10 +43,11 @@ mkdir: %_DEST%\inc%_EXT%\oox\xls
..\inc\oox\vml\vmldrawing.hxx %_DEST%\inc%_EXT%\oox\vml\vmldrawing.hxx
..\inc\oox\vml\vmlshape.hxx %_DEST%\inc%_EXT%\oox\vml\vmlshape.hxx
..\inc\oox\export\*.hxx %_DEST%\inc%_EXT%\oox\export\*.hxx
+..\inc\oox\xls\excelvbaproject.hxx %_DEST%\inc%_EXT%\oox\xls\excelvbaproject.hxx
..\inc\oox\ole\oleobjecthelper.hxx %_DEST%\inc%_EXT%\oox\ole\oleobjecthelper.hxx
..\inc\oox\ole\vbaproject.hxx %_DEST%\inc%_EXT%\oox\ole\vbaproject.hxx
..\inc\oox\ole\olestorage.hxx %_DEST%\inc%_EXT%\oox\ole\olestorage.hxx
-
dos: sh -c "if test %OS% = MACOSX; then create-bundle %_DEST%\lib%_EXT%\*.dylib; fi"
..\xml\components.xml %_DEST%\xml%_EXT%\components.xml
+..\%__SRC%\misc\oox.component %_DEST%\xml%_EXT%\oox.component
diff --git a/oox/source/core/binarycodec.cxx b/oox/source/core/binarycodec.cxx
index f39a9d732e7d..d2f81d31b9ee 100644
--- a/oox/source/core/binarycodec.cxx
+++ b/oox/source/core/binarycodec.cxx
@@ -27,10 +27,16 @@
************************************************************************/
#include "oox/core/binarycodec.hxx"
+
#include <algorithm>
#include <string.h>
#include "oox/helper/attributelist.hxx"
+#include <comphelper/sequenceashashmap.hxx>
+#include <comphelper/docpasswordhelper.hxx>
+
+using namespace ::com::sun::star;
+
namespace oox {
namespace core {
@@ -177,6 +183,37 @@ void BinaryCodec_XOR::initKey( const sal_uInt8 pnPassData[ 16 ] )
}
}
+bool BinaryCodec_XOR::initCodec( const uno::Sequence< beans::NamedValue >& aData )
+{
+ bool bResult = sal_False;
+
+ ::comphelper::SequenceAsHashMap aHashData( aData );
+ uno::Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95EncryptionKey" ) ), uno::Sequence< sal_Int8 >() );
+
+ if ( aKey.getLength() == 16 )
+ {
+ (void)memcpy( mpnKey, aKey.getConstArray(), 16 );
+ bResult = sal_True;
+
+ mnBaseKey = (sal_uInt16)aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95BaseKey" ) ), (sal_Int16)0 );
+ mnHash = (sal_uInt16)aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95PasswordHash" ) ), (sal_Int16)0 );
+ }
+ else
+ OSL_ENSURE( sal_False, "Unexpected key size!\n" );
+
+ return bResult;
+}
+
+uno::Sequence< beans::NamedValue > BinaryCodec_XOR::getEncryptionData()
+{
+ ::comphelper::SequenceAsHashMap aHashData;
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95EncryptionKey" ) ) ] <<= uno::Sequence<sal_Int8>( (sal_Int8*)mpnKey, 16 );
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95BaseKey" ) ) ] <<= (sal_Int16)mnBaseKey;
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95PasswordHash" ) ) ] <<= (sal_Int16)mnHash;
+
+ return aHashData.getAsConstNamedValueList();
+}
+
bool BinaryCodec_XOR::verifyKey( sal_uInt16 nKey, sal_uInt16 nHash ) const
{
return (nKey == mnBaseKey) && (nHash == mnHash);
@@ -231,11 +268,6 @@ bool BinaryCodec_XOR::skip( sal_Int32 nBytes )
return true;
}
-sal_uInt16 BinaryCodec_XOR::getHash( const sal_uInt8* pnPassData, sal_Int32 nSize )
-{
- return lclGetHash( pnPassData, nSize );
-}
-
// ============================================================================
BinaryCodec_RCF::BinaryCodec_RCF()
@@ -247,56 +279,62 @@ BinaryCodec_RCF::BinaryCodec_RCF()
OSL_ENSURE( mhDigest != 0, "BinaryCodec_RCF::BinaryCodec_RCF - cannot create digest" );
(void)memset( mpnDigestValue, 0, sizeof( mpnDigestValue ) );
+ (void)memset (mpnUnique, 0, sizeof(mpnUnique));
}
BinaryCodec_RCF::~BinaryCodec_RCF()
{
(void)memset( mpnDigestValue, 0, sizeof( mpnDigestValue ) );
+ (void)memset (mpnUnique, 0, sizeof(mpnUnique));
rtl_digest_destroy( mhDigest );
rtl_cipher_destroy( mhCipher );
}
-void BinaryCodec_RCF::initKey( const sal_uInt16 pnPassData[ 16 ], const sal_uInt8 pnSalt[ 16 ] )
+bool BinaryCodec_RCF::initCodec( const uno::Sequence< beans::NamedValue >& aData )
{
- // create little-endian key data array from password data
- sal_uInt8 pnKeyData[ 64 ];
- (void)memset( pnKeyData, 0, sizeof( pnKeyData ) );
+ bool bResult = sal_False;
- const sal_uInt16* pnCurrPass = pnPassData;
- const sal_uInt16* pnPassEnd = pnPassData + 16;
- sal_uInt8* pnCurrKey = pnKeyData;
- size_t nPassSize = 0;
- for( ; (pnCurrPass < pnPassEnd) && (*pnCurrPass != 0); ++pnCurrPass, ++nPassSize )
+ ::comphelper::SequenceAsHashMap aHashData( aData );
+ uno::Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97EncryptionKey" ) ), uno::Sequence< sal_Int8 >() );
+
+ if ( aKey.getLength() == RTL_DIGEST_LENGTH_MD5 )
{
- *pnCurrKey++ = static_cast< sal_uInt8 >( *pnCurrPass );
- *pnCurrKey++ = static_cast< sal_uInt8 >( *pnCurrPass >> 8 );
+ (void)memcpy( mpnDigestValue, aKey.getConstArray(), RTL_DIGEST_LENGTH_MD5 );
+ uno::Sequence< sal_Int8 > aUniqueID = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97UniqueID" ) ), uno::Sequence< sal_Int8 >() );
+ if ( aUniqueID.getLength() == 16 )
+ {
+ (void)memcpy( mpnUnique, aUniqueID.getConstArray(), 16 );
+ bResult = sal_False;
+ }
+ else
+ OSL_ENSURE( sal_False, "Unexpected document ID!\n" );
}
- pnKeyData[ 2 * nPassSize ] = 0x80;
- pnKeyData[ 56 ] = static_cast< sal_uInt8 >( nPassSize << 4 );
+ else
+ OSL_ENSURE( sal_False, "Unexpected key size!\n" );
- // fill raw digest of key data into key data
- (void)rtl_digest_updateMD5( mhDigest, pnKeyData, sizeof( pnKeyData ) );
- (void)rtl_digest_rawMD5( mhDigest, pnKeyData, RTL_DIGEST_LENGTH_MD5 );
+ return bResult;
+}
- // update digest with key data and passed salt data
- for( size_t nIndex = 0; nIndex < 16; ++nIndex )
- {
- rtl_digest_updateMD5( mhDigest, pnKeyData, 5 );
- rtl_digest_updateMD5( mhDigest, pnSalt, 16 );
- }
+uno::Sequence< beans::NamedValue > BinaryCodec_RCF::getEncryptionData()
+{
+ ::comphelper::SequenceAsHashMap aHashData;
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97EncryptionKey" ) ) ] <<= uno::Sequence< sal_Int8 >( (sal_Int8*)mpnDigestValue, RTL_DIGEST_LENGTH_MD5 );
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97UniqueID" ) ) ] <<= uno::Sequence< sal_Int8 >( (sal_Int8*)mpnUnique, 16 );
- // update digest with padding
- pnKeyData[ 16 ] = 0x80;
- (void)memset( pnKeyData + 17, 0, sizeof( pnKeyData ) - 17 );
- pnKeyData[ 56 ] = 0x80;
- pnKeyData[ 57 ] = 0x0A;
- rtl_digest_updateMD5( mhDigest, pnKeyData + 16, sizeof( pnKeyData ) - 16 );
+ return aHashData.getAsConstNamedValueList();
+}
- // fill raw digest of above updates into digest value
- rtl_digest_rawMD5( mhDigest, mpnDigestValue, sizeof( mpnDigestValue ) );
+void BinaryCodec_RCF::initKey( const sal_uInt16 pnPassData[ 16 ], const sal_uInt8 pnSalt[ 16 ] )
+{
+ uno::Sequence< sal_Int8 > aKey = ::comphelper::DocPasswordHelper::GenerateStd97Key( pnPassData, uno::Sequence< sal_Int8 >( (sal_Int8*)pnSalt, 16 ) );
+ // Fill raw digest of above updates into DigestValue.
- // erase key data array and leave
- (void)memset( pnKeyData, 0, sizeof( pnKeyData ) );
+ if ( aKey.getLength() == sizeof(mpnDigestValue) )
+ (void)memcpy ( mpnDigestValue, (const sal_uInt8*)aKey.getConstArray(), sizeof(mpnDigestValue) );
+ else
+ memset( mpnDigestValue, 0, sizeof(mpnDigestValue) );
+
+ (void)memcpy( mpnUnique, pnSalt, 16 );
}
bool BinaryCodec_RCF::verifyKey( const sal_uInt8 pnVerifier[ 16 ], const sal_uInt8 pnVerifierHash[ 16 ] )
@@ -389,4 +427,4 @@ bool BinaryCodec_RCF::skip( sal_Int32 nBytes )
} // namespace core
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/core/binaryfilterbase.cxx b/oox/source/core/binaryfilterbase.cxx
index 59eb3dd77a97..12f0fde2f2ef 100644
--- a/oox/source/core/binaryfilterbase.cxx
+++ b/oox/source/core/binaryfilterbase.cxx
@@ -27,21 +27,24 @@
************************************************************************/
#include "oox/core/binaryfilterbase.hxx"
-#include "oox/ole/olestorage.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XStream;
+#include "oox/ole/olestorage.hxx"
namespace oox {
namespace core {
// ============================================================================
-BinaryFilterBase::BinaryFilterBase( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
- FilterBase( rxGlobalFactory )
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+BinaryFilterBase::BinaryFilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ FilterBase( rxContext )
{
}
@@ -53,12 +56,12 @@ BinaryFilterBase::~BinaryFilterBase()
StorageRef BinaryFilterBase::implCreateStorage( const Reference< XInputStream >& rxInStream ) const
{
- return StorageRef( new ::oox::ole::OleStorage( getGlobalFactory(), rxInStream, true ) );
+ return StorageRef( new ::oox::ole::OleStorage( getServiceFactory(), rxInStream, true ) );
}
StorageRef BinaryFilterBase::implCreateStorage( const Reference< XStream >& rxOutStream ) const
{
- return StorageRef( new ::oox::ole::OleStorage( getGlobalFactory(), rxOutStream, true ) );
+ return StorageRef( new ::oox::ole::OleStorage( getServiceFactory(), rxOutStream, true ) );
}
// ============================================================================
@@ -66,4 +69,4 @@ StorageRef BinaryFilterBase::implCreateStorage( const Reference< XStream >& rxOu
} // namespace core
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/core/contexthandler.cxx b/oox/source/core/contexthandler.cxx
index 643df8bac3a3..f83f005add1e 100644
--- a/oox/source/core/contexthandler.cxx
+++ b/oox/source/core/contexthandler.cxx
@@ -27,21 +27,21 @@
************************************************************************/
#include "oox/core/contexthandler.hxx"
-#include "oox/core/fragmenthandler.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::xml::sax::XFastAttributeList;
-using ::com::sun::star::xml::sax::XFastContextHandler;
-using ::com::sun::star::xml::sax::XLocator;
+#include "oox/core/fragmenthandler.hxx"
namespace oox {
namespace core {
// ============================================================================
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
ContextHandler::ContextHandler( ContextHandler& rParent ) :
ContextHandlerImplBase(),
mxBaseData( rParent.mxBaseData )
@@ -134,12 +134,12 @@ void ContextHandler::processingInstruction( const OUString&, const OUString& ) t
// record context interface ---------------------------------------------------
-ContextHandlerRef ContextHandler::createRecordContext( sal_Int32, RecordInputStream& )
+ContextHandlerRef ContextHandler::createRecordContext( sal_Int32, SequenceInputStream& )
{
return 0;
}
-void ContextHandler::startRecord( sal_Int32, RecordInputStream& )
+void ContextHandler::startRecord( sal_Int32, SequenceInputStream& )
{
}
@@ -152,4 +152,4 @@ void ContextHandler::endRecord( sal_Int32 )
} // namespace core
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx
index 99f58e1988ab..a995dd506f4f 100644
--- a/oox/source/core/contexthandler2.cxx
+++ b/oox/source/core/contexthandler2.cxx
@@ -29,37 +29,30 @@
#include "oox/core/contexthandler2.hxx"
#include <rtl/ustrbuf.hxx>
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::xml::sax::XFastAttributeList;
-using ::com::sun::star::xml::sax::XFastContextHandler;
-
namespace oox {
namespace core {
// ============================================================================
-/** Information about a processed context element. */
-struct ContextInfo
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
+/** Information about a processed element. */
+struct ElementInfo
{
- OUString maCurrChars; /// Collected characters from context.
- OUString maFinalChars; /// Finalized (stipped) characters.
+ OUStringBuffer maChars; /// Collected element characters.
sal_Int32 mnElement; /// The element identifier.
bool mbTrimSpaces; /// True = trims leading/trailing spaces from text data.
- explicit ContextInfo();
- ContextInfo( sal_Int32 nElement ) : mnElement( nElement ), mbTrimSpaces(false) {}
+ inline explicit ElementInfo() : mnElement( XML_TOKEN_INVALID ), mbTrimSpaces( false ) {}
+ ElementInfo( sal_Int32 nElement ) : mnElement( nElement ), mbTrimSpaces(false) {}
};
-ContextInfo::ContextInfo() :
- mnElement( XML_TOKEN_INVALID ),
- mbTrimSpaces( false )
-{
-}
-
// ============================================================================
ContextHandler2Helper::ContextHandler2Helper( bool bEnableTrimSpace ) :
@@ -67,7 +60,7 @@ ContextHandler2Helper::ContextHandler2Helper( bool bEnableTrimSpace ) :
mnRootStackSize( 0 ),
mbEnableTrimSpace( bEnableTrimSpace )
{
- pushContextInfo( XML_ROOT_CONTEXT );
+ pushElementInfo( XML_ROOT_CONTEXT );
}
ContextHandler2Helper::ContextHandler2Helper( const ContextHandler2Helper& rParent ) :
@@ -86,7 +79,7 @@ sal_Int32 ContextHandler2Helper::getCurrentElement() const
return mxContextStack->empty() ? XML_ROOT_CONTEXT : mxContextStack->back().mnElement;
}
-sal_Int32 ContextHandler2Helper::getPreviousElement( sal_Int32 nCountBack ) const
+sal_Int32 ContextHandler2Helper::getParentElement( sal_Int32 nCountBack ) const
{
if( (nCountBack < 0) || (mxContextStack->size() < static_cast< size_t >( nCountBack )) )
return XML_TOKEN_INVALID;
@@ -99,49 +92,50 @@ bool ContextHandler2Helper::isRootElement() const
return mxContextStack->size() == mnRootStackSize + 1;
}
-Reference< XFastContextHandler > ContextHandler2Helper::implCreateChildContext( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs )
+Reference< XFastContextHandler > ContextHandler2Helper::implCreateChildContext(
+ sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs )
{
- appendCollectedChars();
+ // #i76091# process collected characters (calls onCharacters() if needed)
+ processCollectedChars();
ContextHandlerRef xContext = onCreateContext( nElement, AttributeList( rxAttribs ) );
return Reference< XFastContextHandler >( xContext.get() );
}
-void ContextHandler2Helper::implStartCurrentContext( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs )
+void ContextHandler2Helper::implStartElement( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs )
{
AttributeList aAttribs( rxAttribs );
- pushContextInfo( nElement ).mbTrimSpaces = aAttribs.getToken( NMSP_XML | XML_space, XML_TOKEN_INVALID ) != XML_preserve;
+ pushElementInfo( nElement ).mbTrimSpaces = aAttribs.getToken( XML_TOKEN( space ), XML_TOKEN_INVALID ) != XML_preserve;
onStartElement( aAttribs );
}
void ContextHandler2Helper::implCharacters( const OUString& rChars )
{
- // #i76091# collect characters until context ends
+ // #i76091# collect characters until new element starts or this element ends
if( !mxContextStack->empty() )
- mxContextStack->back().maCurrChars += rChars;
+ mxContextStack->back().maChars += rChars;
}
-void ContextHandler2Helper::implEndCurrentContext( sal_Int32 nElement )
+void ContextHandler2Helper::implEndElement( sal_Int32 nElement )
{
(void)nElement; // prevent "unused parameter" warning in product build
- OSL_ENSURE( getCurrentElement() == nElement, "ContextHandler2Helper::implEndCurrentContext - context stack broken" );
+ OSL_ENSURE( getCurrentElement() == nElement, "ContextHandler2Helper::implEndElement - context stack broken" );
if( !mxContextStack->empty() )
{
- // #i76091# process collected characters
- appendCollectedChars();
- // finalize the current context and pop context info from stack
- onEndElement( mxContextStack->back().maFinalChars );
- popContextInfo();
+ // #i76091# process collected characters (calls onCharacters() if needed)
+ processCollectedChars();
+ onEndElement();
+ popElementInfo();
}
}
-ContextHandlerRef ContextHandler2Helper::implCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ContextHandler2Helper::implCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
return onCreateRecordContext( nRecId, rStrm );
}
-void ContextHandler2Helper::implStartRecord( sal_Int32 nRecId, RecordInputStream& rStrm )
+void ContextHandler2Helper::implStartRecord( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
- pushContextInfo( nRecId );
+ pushElementInfo( nRecId );
onStartRecord( rStrm );
}
@@ -151,43 +145,43 @@ void ContextHandler2Helper::implEndRecord( sal_Int32 nRecId )
OSL_ENSURE( getCurrentElement() == nRecId, "ContextHandler2Helper::implEndRecord - context stack broken" );
if( !mxContextStack->empty() )
{
- // finalize the current context and pop context info from stack
onEndRecord();
- popContextInfo();
+ popElementInfo();
}
}
-ContextInfo& ContextHandler2Helper::pushContextInfo( sal_Int32 nElement )
+ElementInfo& ContextHandler2Helper::pushElementInfo( sal_Int32 nElement )
{
ContextInfo aInfo( nElement );
- mxContextStack->push_back( aInfo );
+ ElementInfo& rInfo = mxContextStack->back();
return mxContextStack->back();
}
-void ContextHandler2Helper::popContextInfo()
+void ContextHandler2Helper::popElementInfo()
{
- OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::popContextInfo - context stack broken" );
+ OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::popElementInfo - context stack broken" );
if( !mxContextStack->empty() )
mxContextStack->pop_back();
}
-void ContextHandler2Helper::appendCollectedChars()
+void ContextHandler2Helper::processCollectedChars()
{
- OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::appendCollectedChars - no context info" );
- ContextInfo& rInfo = mxContextStack->back();
- if( rInfo.maCurrChars.getLength() > 0 )
+ OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::processCollectedChars - no context info" );
+ ElementInfo& rInfo = mxContextStack->back();
+ if( rInfo.maChars.getLength() > 0 )
{
- OUString aChars( rInfo.maCurrChars );
-
- rInfo.maCurrChars = OUString();
- rInfo.maFinalChars += ( (mbEnableTrimSpace && rInfo.mbTrimSpaces) ? aChars.trim() : aChars );
+ OUString aChars = rInfo.maChars.makeStringAndClear();
+ if( mbEnableTrimSpace && rInfo.mbTrimSpaces )
+ aChars = aChars.trim();
+ if( aChars.getLength() > 0 )
+ onCharacters( aChars );
}
}
// ============================================================================
ContextHandler2::ContextHandler2( ContextHandler2Helper& rParent ) :
- ContextHandler( rParent.queryContextHandler() ),
+ ContextHandler( dynamic_cast< ContextHandler& >( rParent ) ),
ContextHandler2Helper( rParent )
{
}
@@ -196,11 +190,6 @@ ContextHandler2::~ContextHandler2()
{
}
-ContextHandler& ContextHandler2::queryContextHandler()
-{
- return *this;
-}
-
// com.sun.star.xml.sax.XFastContextHandler interface -------------------------
Reference< XFastContextHandler > SAL_CALL ContextHandler2::createFastChildContext(
@@ -212,7 +201,7 @@ Reference< XFastContextHandler > SAL_CALL ContextHandler2::createFastChildContex
void SAL_CALL ContextHandler2::startFastElement(
sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) throw( SAXException, RuntimeException )
{
- implStartCurrentContext( nElement, rxAttribs );
+ implStartElement( nElement, rxAttribs );
}
void SAL_CALL ContextHandler2::characters( const OUString& rChars ) throw( SAXException, RuntimeException )
@@ -222,17 +211,17 @@ void SAL_CALL ContextHandler2::characters( const OUString& rChars ) throw( SAXEx
void SAL_CALL ContextHandler2::endFastElement( sal_Int32 nElement ) throw( SAXException, RuntimeException )
{
- implEndCurrentContext( nElement );
+ implEndElement( nElement );
}
// oox.core.RecordContext interface -------------------------------------------
-ContextHandlerRef ContextHandler2::createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ContextHandler2::createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
return implCreateRecordContext( nRecId, rStrm );
}
-void ContextHandler2::startRecord( sal_Int32 nRecId, RecordInputStream& rStrm )
+void ContextHandler2::startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
implStartRecord( nRecId, rStrm );
}
@@ -253,16 +242,20 @@ void ContextHandler2::onStartElement( const AttributeList& )
{
}
-void ContextHandler2::onEndElement( const OUString& )
+void ContextHandler2::onCharacters( const OUString& )
+{
+}
+
+void ContextHandler2::onEndElement()
{
}
-ContextHandlerRef ContextHandler2::onCreateRecordContext( sal_Int32, RecordInputStream& )
+ContextHandlerRef ContextHandler2::onCreateRecordContext( sal_Int32, SequenceInputStream& )
{
return 0;
}
-void ContextHandler2::onStartRecord( RecordInputStream& )
+void ContextHandler2::onStartRecord( SequenceInputStream& )
{
}
@@ -275,4 +268,4 @@ void ContextHandler2::onEndRecord()
} // namespace core
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/core/facreg.cxx b/oox/source/core/facreg.cxx
deleted file mode 100644
index 824a8dc6af99..000000000000
--- a/oox/source/core/facreg.cxx
+++ /dev/null
@@ -1,185 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "oox/dllapi.h"
-
-#include <string.h>
-
-#include <sal/config.h>
-
-#include <com/sun/star/container/XSet.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
-
-#include <cppuhelper/factory.hxx>
-#include <uno/lbnames.h>
-
-using namespace com::sun::star;
-
-using ::rtl::OUString;
-
-#define SERVICE( className ) \
-extern OUString SAL_CALL className##_getImplementationName() throw(); \
-extern uno::Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw();\
-extern uno::Reference< uno::XInterface > SAL_CALL className##_createInstance( \
- const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) \
- throw( uno::Exception )
-
-#define SERVICE2( className ) \
-extern OUString SAL_CALL className##_getImplementationName() throw(); \
-extern uno::Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw();\
-extern uno::Reference< uno::XInterface > SAL_CALL className##_createInstance( \
- const uno::Reference< uno::XComponentContext > & xContext ) \
- throw( uno::Exception )
-
-namespace oox {
- namespace core { SERVICE( FilterDetect ); }
- namespace ppt { SERVICE( PowerPointImport ); }
- namespace xls { SERVICE( BiffDetector ); }
- namespace xls { SERVICE( ExcelFilter ); }
- namespace xls { SERVICE( ExcelBiffFilter ); }
- namespace xls { SERVICE( ExcelVbaProjectFilter ); }
- namespace ole { SERVICE( WordVbaProjectFilter ); }
- namespace shape { SERVICE( ShapeContextHandler ); }
- namespace shape { SERVICE( FastTokenHandlerService ); }
- namespace docprop { SERVICE2( OOXMLDocPropImportImpl ); }
- namespace xls { SERVICE2( OOXMLFormulaParser ); }
-}
-
-//
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-OOX_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
-void SAL_CALL writeInfo( registry::XRegistryKey * pRegistryKey, const OUString& rImplementationName, const uno::Sequence< OUString >& rServices )
-{
- uno::Reference< registry::XRegistryKey > xNewKey(
- pRegistryKey->createKey(
- OUString( sal_Unicode( '/' ) ) + rImplementationName + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ) );
-
- for( sal_Int32 i = 0; i < rServices.getLength(); i++ )
- xNewKey->createKey( rServices.getConstArray()[i]);
-}
-
-#define WRITEINFO(className)\
- writeInfo( pKey, className##_getImplementationName(), className##_getSupportedServiceNames() )
-
-OOX_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void * , void * pRegistryKey )
-{
- if( pRegistryKey )
- {
- try
- {
- registry::XRegistryKey *pKey = reinterpret_cast< registry::XRegistryKey * >( pRegistryKey );
-
- WRITEINFO( ::oox::core::FilterDetect );
- WRITEINFO( ::oox::ppt::PowerPointImport );
- WRITEINFO( ::oox::xls::BiffDetector );
- WRITEINFO( ::oox::xls::ExcelFilter );
- WRITEINFO( ::oox::xls::ExcelBiffFilter );
- WRITEINFO( ::oox::xls::ExcelVbaProjectFilter );
- WRITEINFO( ::oox::ole::WordVbaProjectFilter );
- WRITEINFO( ::oox::shape::ShapeContextHandler );
- WRITEINFO( ::oox::shape::FastTokenHandlerService );
- WRITEINFO( ::oox::docprop::OOXMLDocPropImportImpl );
- WRITEINFO( ::oox::xls::OOXMLFormulaParser );
- }
- catch (registry::InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_True;
-}
-
-#define SINGLEFACTORY(classname)\
- if( classname##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )\
- {\
- xFactory = ::cppu::createSingleFactory( xMSF,\
- classname##_getImplementationName(),\
- classname##_createInstance,\
- classname##_getSupportedServiceNames() );\
- }
-
-#define SINGLEFACTORY2(classname)\
- if( classname##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )\
- {\
- xCompFactory = ::cppu::createSingleComponentFactory(\
- classname##_createInstance,\
- classname##_getImplementationName(),\
- classname##_getSupportedServiceNames() );\
- }
-
-OOX_DLLPUBLIC void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * )
-{
- void * pRet = 0;
- if( pServiceManager )
- {
- uno::Reference< lang::XMultiServiceFactory > xMSF( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) );
-
- uno::Reference< lang::XSingleServiceFactory > xFactory;
- uno::Reference< lang::XSingleComponentFactory > xCompFactory;
-
- const sal_Int32 nImplNameLen = strlen( pImplName );
-
- SINGLEFACTORY( ::oox::core::FilterDetect )
- else SINGLEFACTORY( oox::ppt::PowerPointImport )
- else SINGLEFACTORY( ::oox::xls::BiffDetector )
- else SINGLEFACTORY( ::oox::xls::ExcelFilter )
- else SINGLEFACTORY( ::oox::xls::ExcelBiffFilter )
- else SINGLEFACTORY( ::oox::xls::ExcelVbaProjectFilter )
- else SINGLEFACTORY( ::oox::ole::WordVbaProjectFilter )
- else SINGLEFACTORY( ::oox::shape::ShapeContextHandler)
- else SINGLEFACTORY( ::oox::shape::FastTokenHandlerService)
- else SINGLEFACTORY2( ::oox::docprop::OOXMLDocPropImportImpl )
- else SINGLEFACTORY2( ::oox::xls::OOXMLFormulaParser )
-
- if( xFactory.is())
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- else if ( xCompFactory.is() )
- {
- xCompFactory->acquire();
- pRet = xCompFactory.get();
- }
- }
- return pRet;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/core/fastparser.cxx b/oox/source/core/fastparser.cxx
new file mode 100755
index 000000000000..eaf8c428b92c
--- /dev/null
+++ b/oox/source/core/fastparser.cxx
@@ -0,0 +1,136 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "oox/core/fastparser.hxx"
+
+#include "oox/core/fasttokenhandler.hxx"
+#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/helper.hxx"
+#include "oox/helper/storagebase.hxx"
+#include "oox/token/namespacemap.hxx"
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+namespace {
+
+class InputStreamCloseGuard
+{
+public:
+ explicit InputStreamCloseGuard( const Reference< XInputStream >& rxInStream, bool bCloseStream );
+ ~InputStreamCloseGuard();
+private:
+ Reference< XInputStream > mxInStream;
+ bool mbCloseStream;
+};
+
+InputStreamCloseGuard::InputStreamCloseGuard( const Reference< XInputStream >& rxInStream, bool bCloseStream ) :
+ mxInStream( rxInStream ),
+ mbCloseStream( bCloseStream )
+{
+}
+
+InputStreamCloseGuard::~InputStreamCloseGuard()
+{
+ if( mxInStream.is() && mbCloseStream ) try { mxInStream->closeInput(); } catch( Exception& ) {}
+}
+
+} // namespace
+
+// ============================================================================
+
+FastParser::FastParser( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ mrNamespaceMap( StaticNamespaceMap::get() )
+{
+ // create a fast parser instance
+ Reference< XMultiComponentFactory > xFactory( rxContext->getServiceManager(), UNO_SET_THROW );
+ mxParser.set( xFactory->createInstanceWithContext( CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ), rxContext ), UNO_QUERY_THROW );
+
+ // create the fast token handler based on the OOXML token list
+ mxParser->setTokenHandler( new FastTokenHandler );
+}
+
+FastParser::~FastParser()
+{
+}
+
+void FastParser::registerNamespace( sal_Int32 nNamespaceId ) throw( IllegalArgumentException, RuntimeException )
+{
+ if( !mxParser.is() )
+ throw RuntimeException();
+
+ const OUString* pNamespaceUrl = ContainerHelper::getMapElement( mrNamespaceMap, nNamespaceId );
+ if( !pNamespaceUrl )
+ throw IllegalArgumentException();
+
+ mxParser->registerNamespace( *pNamespaceUrl, nNamespaceId );
+}
+
+void FastParser::setDocumentHandler( const Reference< XFastDocumentHandler >& rxDocHandler ) throw( RuntimeException )
+{
+ if( !mxParser.is() )
+ throw RuntimeException();
+ mxParser->setFastDocumentHandler( rxDocHandler );
+}
+
+void FastParser::parseStream( const InputSource& rInputSource, bool bCloseStream ) throw( SAXException, IOException, RuntimeException )
+{
+ // guard closing the input stream also when exceptions are thrown
+ InputStreamCloseGuard aGuard( rInputSource.aInputStream, bCloseStream );
+ if( !mxParser.is() )
+ throw RuntimeException();
+ mxParser->parseStream( rInputSource );
+}
+
+void FastParser::parseStream( const Reference< XInputStream >& rxInStream, const OUString& rStreamName, bool bCloseStream ) throw( SAXException, IOException, RuntimeException )
+{
+ InputSource aInputSource;
+ aInputSource.sSystemId = rStreamName;
+ aInputSource.aInputStream = rxInStream;
+ parseStream( aInputSource, bCloseStream );
+}
+
+void FastParser::parseStream( StorageBase& rStorage, const OUString& rStreamName, bool bCloseStream ) throw( SAXException, IOException, RuntimeException )
+{
+ parseStream( rStorage.openInputStream( rStreamName ), rStreamName, bCloseStream );
+}
+
+// ============================================================================
+
+} // namespace core
+} // namespace oox
diff --git a/oox/source/core/fasttokenhandler.cxx b/oox/source/core/fasttokenhandler.cxx
index ecf58fd3c804..83c3fed63e3d 100644
--- a/oox/source/core/fasttokenhandler.cxx
+++ b/oox/source/core/fasttokenhandler.cxx
@@ -27,29 +27,38 @@
************************************************************************/
#include "oox/core/fasttokenhandler.hxx"
-#include <osl/mutex.hxx>
-#include "oox/token/tokenmap.hxx"
-using ::rtl::OUString;
-using ::osl::Mutex;
-using ::osl::MutexGuard;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::RuntimeException;
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include "oox/helper/helper.hxx"
+#include "oox/token/tokenmap.hxx"
namespace oox {
namespace core {
// ============================================================================
-namespace {
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+OUString SAL_CALL FastTokenHandler_getImplementationName()
+{
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.core.FastTokenHandler" );
+}
-Mutex& lclGetTokenMutex()
+Sequence< OUString > SAL_CALL FastTokenHandler_getSupportedServiceNames()
{
- static Mutex aMutex;
- return aMutex;
+ Sequence< OUString > aServiceNames( 1 );
+ aServiceNames[ 0 ] = CREATE_OUSTRING( "com.sun.star.xml.sax.FastTokenHandler" );
+ return aServiceNames;
}
-} // namespace
+Reference< XInterface > SAL_CALL FastTokenHandler_createInstance( const Reference< XComponentContext >& /*rxContext*/ ) throw (Exception)
+{
+ return static_cast< ::cppu::OWeakObject* >( new FastTokenHandler );
+}
// ============================================================================
@@ -62,27 +71,46 @@ FastTokenHandler::~FastTokenHandler()
{
}
+// XServiceInfo
+
+OUString SAL_CALL FastTokenHandler::getImplementationName() throw (RuntimeException)
+{
+ return FastTokenHandler_getImplementationName();
+}
+
+sal_Bool SAL_CALL FastTokenHandler::supportsService( const OUString& rServiceName ) throw (RuntimeException)
+{
+ Sequence< OUString > aServiceNames = FastTokenHandler_getSupportedServiceNames();
+ for( sal_Int32 nIndex = 0, nLength = aServiceNames.getLength(); nIndex < nLength; ++nIndex )
+ if( aServiceNames[ nIndex ] == rServiceName )
+ return sal_True;
+ return sal_False;
+}
+
+Sequence< OUString > SAL_CALL FastTokenHandler::getSupportedServiceNames() throw (RuntimeException)
+{
+ return FastTokenHandler_getSupportedServiceNames();
+}
+
+// XFastTokenHandler
+
sal_Int32 FastTokenHandler::getToken( const OUString& rIdentifier ) throw( RuntimeException )
{
- MutexGuard aGuard( lclGetTokenMutex() );
return mrTokenMap.getTokenFromUnicode( rIdentifier );
}
OUString FastTokenHandler::getIdentifier( sal_Int32 nToken ) throw( RuntimeException )
{
- MutexGuard aGuard( lclGetTokenMutex() );
return mrTokenMap.getUnicodeTokenName( nToken );
}
Sequence< sal_Int8 > FastTokenHandler::getUTF8Identifier( sal_Int32 nToken ) throw( RuntimeException )
{
- MutexGuard aGuard( lclGetTokenMutex() );
return mrTokenMap.getUtf8TokenName( nToken );
}
sal_Int32 FastTokenHandler::getTokenFromUTF8( const Sequence< sal_Int8 >& rIdentifier ) throw( RuntimeException )
{
- MutexGuard aGuard( lclGetTokenMutex() );
return mrTokenMap.getTokenFromUtf8( rIdentifier );
}
@@ -91,4 +119,4 @@ sal_Int32 FastTokenHandler::getTokenFromUTF8( const Sequence< sal_Int8 >& rIdent
} // namespace core
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index ce2c75c01faf..70d8f46fe2a8 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -27,51 +27,43 @@
************************************************************************/
#include "oox/core/filterbase.hxx"
+
#include <set>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <comphelper/docpasswordhelper.hxx>
+#include <comphelper/mediadescriptor.hxx>
#include <osl/mutex.hxx>
#include <rtl/instance.hxx>
#include <rtl/uri.hxx>
-#include <comphelper/docpasswordhelper.hxx>
-#include <comphelper/mediadescriptor.hxx>
-#include "tokens.hxx"
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/binaryoutputstream.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/helper/modelobjecthelper.hxx"
#include "oox/ole/oleobjecthelper.hxx"
+#include "oox/ole/vbaproject.hxx"
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::graphic;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::task;
+using namespace ::com::sun::star::uno;
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::lang::IllegalArgumentException;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::lang::XComponent;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::frame::XFrame;
-using ::com::sun::star::frame::XModel;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XStream;
-using ::com::sun::star::task::XStatusIndicator;
-using ::com::sun::star::task::XInteractionHandler;
-using ::com::sun::star::graphic::XGraphic;
using ::com::sun::star::container::XNameAccess;
using ::comphelper::MediaDescriptor;
using ::comphelper::SequenceAsHashMap;
using ::oox::ole::OleObjectHelper;
-
-namespace oox {
-namespace core {
+using ::oox::ole::VbaProject;
+using ::rtl::OUString;
// ============================================================================
@@ -143,6 +135,7 @@ struct FilterBaseImpl
typedef ::boost::shared_ptr< GraphicHelper > GraphicHelperRef;
typedef ::boost::shared_ptr< ModelObjectHelper > ModelObjHelperRef;
typedef ::boost::shared_ptr< OleObjectHelper > OleObjHelperRef;
+ typedef ::boost::shared_ptr< VbaProject > VbaProjectRef;
FilterDirection meDirection;
SequenceAsHashMap maArguments;
@@ -154,8 +147,11 @@ struct FilterBaseImpl
GraphicHelperRef mxGraphicHelper; /// Graphic and graphic object handling.
ModelObjHelperRef mxModelObjHelper; /// Tables to create new named drawing objects.
OleObjHelperRef mxOleObjHelper; /// OLE object handling.
+ VbaProjectRef mxVbaProject; /// VBA project manager.
- Reference< XMultiServiceFactory > mxGlobalFactory;
+ Reference< XComponentContext > mxComponentContext;
+ Reference< XMultiComponentFactory > mxComponentFactory;
+ Reference< XMultiServiceFactory > mxServiceFactory;
Reference< XModel > mxModel;
Reference< XMultiServiceFactory > mxModelFactory;
Reference< XFrame > mxTargetFrame;
@@ -164,10 +160,9 @@ struct FilterBaseImpl
Reference< XStatusIndicator > mxStatusIndicator;
Reference< XInteractionHandler > mxInteractionHandler;
- explicit FilterBaseImpl( const Reference< XMultiServiceFactory >& rxGlobalFactory );
+ explicit FilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException );
- void setDocumentModel( const Reference< XComponent >& rxComponent );
- bool hasDocumentModel() const;
+ void setDocumentModel( const Reference< XComponent >& rxComponent ) throw( IllegalArgumentException );
void initializeFilter();
void finalizeFilter();
@@ -175,23 +170,25 @@ struct FilterBaseImpl
// ----------------------------------------------------------------------------
-FilterBaseImpl::FilterBaseImpl( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
+FilterBaseImpl::FilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
meDirection( FILTERDIRECTION_UNKNOWN ),
- meVersion( ECMA_DIALECT ),
- mxGlobalFactory( rxGlobalFactory )
-{
- OSL_ENSURE( mxGlobalFactory.is(), "FilterBaseImpl::FilterBaseImpl - missing service factory" );
-}
-
-void FilterBaseImpl::setDocumentModel( const Reference< XComponent >& rxComponent )
+ mxComponentContext( rxContext, UNO_SET_THROW ),
+ mxComponentFactory( rxContext->getServiceManager(), UNO_SET_THROW ),
+ mxServiceFactory( rxContext->getServiceManager(), UNO_QUERY_THROW )
{
- mxModel.set( rxComponent, UNO_QUERY );
- mxModelFactory.set( rxComponent, UNO_QUERY );
}
-bool FilterBaseImpl::hasDocumentModel() const
+void FilterBaseImpl::setDocumentModel( const Reference< XComponent >& rxComponent ) throw( IllegalArgumentException )
{
- return mxGlobalFactory.is() && mxModel.is() && mxModelFactory.is();
+ try
+ {
+ mxModel.set( rxComponent, UNO_QUERY_THROW );
+ mxModelFactory.set( rxComponent, UNO_QUERY_THROW );
+ }
+ catch( Exception& )
+ {
+ throw IllegalArgumentException();
+ }
}
void FilterBaseImpl::initializeFilter()
@@ -222,8 +219,8 @@ void FilterBaseImpl::finalizeFilter()
// ============================================================================
-FilterBase::FilterBase( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
- mxImpl( new FilterBaseImpl( rxGlobalFactory ) )
+FilterBase::FilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ mxImpl( new FilterBaseImpl( rxContext ) )
{
}
@@ -254,9 +251,19 @@ Any FilterBase::getArgument( const OUString& rArgName ) const
return (aIt == mxImpl->maArguments.end()) ? Any() : aIt->second;
}
-const Reference< XMultiServiceFactory >& FilterBase::getGlobalFactory() const
+const Reference< XComponentContext >& FilterBase::getComponentContext() const
+{
+ return mxImpl->mxComponentContext;
+}
+
+const Reference< XMultiComponentFactory >& FilterBase::getComponentFactory() const
{
- return mxImpl->mxGlobalFactory;
+ return mxImpl->mxComponentFactory;
+}
+
+const Reference< XMultiServiceFactory >& FilterBase::getServiceFactory() const
+{
+ return mxImpl->mxServiceFactory;
}
const Reference< XModel >& FilterBase::getModel() const
@@ -409,7 +416,14 @@ OleObjectHelper& FilterBase::getOleObjectHelper() const
return *mxImpl->mxOleObjHelper;
}
-OUString FilterBase::requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier ) const
+VbaProject& FilterBase::getVbaProject() const
+{
+ if( !mxImpl->mxVbaProject )
+ mxImpl->mxVbaProject.reset( implCreateVbaProject() );
+ return *mxImpl->mxVbaProject;
+}
+
+Sequence< NamedValue > FilterBase::requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const
{
::std::vector< OUString > aDefaultPasswords;
aDefaultPasswords.push_back( CREATE_OUSTRING( "VelvetSweatshop" ) );
@@ -474,8 +488,6 @@ void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs ) throw( Exce
void SAL_CALL FilterBase::setTargetDocument( const Reference< XComponent >& rxDocument ) throw( IllegalArgumentException, RuntimeException )
{
mxImpl->setDocumentModel( rxDocument );
- if( !mxImpl->hasDocumentModel() )
- throw IllegalArgumentException();
mxImpl->meDirection = FILTERDIRECTION_IMPORT;
}
@@ -484,8 +496,6 @@ void SAL_CALL FilterBase::setTargetDocument( const Reference< XComponent >& rxDo
void SAL_CALL FilterBase::setSourceDocument( const Reference< XComponent >& rxDocument ) throw( IllegalArgumentException, RuntimeException )
{
mxImpl->setDocumentModel( rxDocument );
- if( !mxImpl->hasDocumentModel() )
- throw IllegalArgumentException();
mxImpl->meDirection = FILTERDIRECTION_EXPORT;
}
@@ -493,35 +503,35 @@ void SAL_CALL FilterBase::setSourceDocument( const Reference< XComponent >& rxDo
sal_Bool SAL_CALL FilterBase::filter( const Sequence< PropertyValue >& rMediaDescSeq ) throw( RuntimeException )
{
+ if( !mxImpl->mxModel.is() || !mxImpl->mxModelFactory.is() || (mxImpl->meDirection == FILTERDIRECTION_UNKNOWN) )
+ throw RuntimeException();
+
sal_Bool bRet = sal_False;
- if( mxImpl->hasDocumentModel() && (mxImpl->meDirection != FILTERDIRECTION_UNKNOWN) )
+ setMediaDescriptor( rMediaDescSeq );
+ DocumentOpenedGuard aOpenedGuard( mxImpl->maFileUrl );
+ if( aOpenedGuard.isValid() || !mxImpl->maFileUrl.getLength() )
{
- setMediaDescriptor( rMediaDescSeq );
- DocumentOpenedGuard aOpenedGuard( mxImpl->maFileUrl );
- if( aOpenedGuard.isValid() || !mxImpl->maFileUrl.getLength() )
+ mxImpl->initializeFilter();
+ switch( mxImpl->meDirection )
{
- mxImpl->initializeFilter();
- switch( mxImpl->meDirection )
- {
- case FILTERDIRECTION_UNKNOWN:
- break;
- case FILTERDIRECTION_IMPORT:
- if( mxImpl->mxInStream.is() )
- {
- mxImpl->mxStorage = implCreateStorage( mxImpl->mxInStream );
- bRet = mxImpl->mxStorage.get() && importDocument();
- }
- break;
- case FILTERDIRECTION_EXPORT:
- if( mxImpl->mxOutStream.is() )
- {
- mxImpl->mxStorage = implCreateStorage( mxImpl->mxOutStream );
- bRet = mxImpl->mxStorage.get() && exportDocument();
- }
- break;
- }
- mxImpl->finalizeFilter();
+ case FILTERDIRECTION_UNKNOWN:
+ break;
+ case FILTERDIRECTION_IMPORT:
+ if( mxImpl->mxInStream.is() )
+ {
+ mxImpl->mxStorage = implCreateStorage( mxImpl->mxInStream );
+ bRet = mxImpl->mxStorage.get() && importDocument();
+ }
+ break;
+ case FILTERDIRECTION_EXPORT:
+ if( mxImpl->mxOutStream.is() )
+ {
+ mxImpl->mxStorage = implCreateStorage( mxImpl->mxOutStream );
+ bRet = mxImpl->mxStorage.get() && exportDocument();
+ }
+ break;
}
+ mxImpl->finalizeFilter();
}
return bRet;
}
@@ -592,7 +602,7 @@ void FilterBase::setMediaDescriptor( const Sequence< PropertyValue >& rMediaDesc
GraphicHelper* FilterBase::implCreateGraphicHelper() const
{
// default: return base implementation without any special behaviour
- return new GraphicHelper( mxImpl->mxGlobalFactory, mxImpl->mxTargetFrame, mxImpl->mxStorage );
+ return new GraphicHelper( mxImpl->mxComponentContext, mxImpl->mxTargetFrame, mxImpl->mxStorage );
}
// ============================================================================
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index c38c27be51a1..e36bbafba3b3 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -27,50 +27,36 @@
************************************************************************/
#include "oox/core/filterdetect.hxx"
+
#include <com/sun/star/io/XStream.hpp>
-#include <com/sun/star/xml/sax/XFastParser.hpp>
-#include <rtl/digest.h>
-#include <openssl/evp.h>
#include <comphelper/docpasswordhelper.hxx>
#include <comphelper/mediadescriptor.hxx>
+#include <openssl/evp.h>
+#include <rtl/digest.h>
+#include "oox/core/fastparser.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/binaryoutputstream.hxx"
#include "oox/helper/zipstorage.hxx"
-#include "oox/core/fasttokenhandler.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/ole/olestorage.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::uno::XInterface;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::beans::NamedValue;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XStream;
-using ::com::sun::star::xml::sax::InputSource;
-using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::xml::sax::XFastAttributeList;
-using ::com::sun::star::xml::sax::XFastContextHandler;
-using ::com::sun::star::xml::sax::XFastParser;
-using ::com::sun::star::xml::sax::XLocator;
-using ::comphelper::MediaDescriptor;
-using ::comphelper::SequenceAsHashMap;
-
namespace oox {
namespace core {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::comphelper::MediaDescriptor;
+using ::comphelper::SequenceAsHashMap;
+using ::rtl::OUString;
+
+// ============================================================================
+
FilterDetectDocHandler::FilterDetectDocHandler( OUString& rFilterName ) :
mrFilterName( rFilterName )
{
@@ -104,22 +90,22 @@ void SAL_CALL FilterDetectDocHandler::startFastElement(
switch ( nElement )
{
// cases for _rels/.rels
- case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationships:
+ case PR_TOKEN( Relationships ):
break;
- case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationship:
- if( !maContextStack.empty() && (maContextStack.back() == (NMSP_PACKAGE_RELATIONSHIPS|XML_Relationships)) )
+ case PR_TOKEN( Relationship ):
+ if( !maContextStack.empty() && (maContextStack.back() == PR_TOKEN( Relationships )) )
parseRelationship( aAttribs );
break;
// cases for [Content_Types].xml
- case NMSP_CONTENT_TYPES|XML_Types:
+ case PC_TOKEN( Types ):
break;
- case NMSP_CONTENT_TYPES|XML_Default:
- if( !maContextStack.empty() && (maContextStack.back() == (NMSP_CONTENT_TYPES|XML_Types)) )
+ case PC_TOKEN( Default ):
+ if( !maContextStack.empty() && (maContextStack.back() == PC_TOKEN( Types )) )
parseContentTypesDefault( aAttribs );
break;
- case NMSP_CONTENT_TYPES|XML_Override:
- if( !maContextStack.empty() && (maContextStack.back() == (NMSP_CONTENT_TYPES|XML_Types)) )
+ case PC_TOKEN( Override ):
+ if( !maContextStack.empty() && (maContextStack.back() == PC_TOKEN( Types )) )
parseContentTypesOverride( aAttribs );
break;
}
@@ -252,17 +238,16 @@ OUString FilterDetect_getImplementationName()
}
/* Helper for registry */
-Reference< XInterface > SAL_CALL FilterDetect_createInstance( const Reference< XMultiServiceFactory >& xServiceManager ) throw( Exception )
+Reference< XInterface > SAL_CALL FilterDetect_createInstance( const Reference< XComponentContext >& rxContext ) throw( Exception )
{
- return Reference< XInterface >( *new FilterDetect( xServiceManager ) );
+ return static_cast< ::cppu::OWeakObject* >( new FilterDetect( rxContext ) );
}
// ----------------------------------------------------------------------------
-FilterDetect::FilterDetect( const Reference< XMultiServiceFactory >& rxFactory ) :
- mxFactory( rxFactory )
+FilterDetect::FilterDetect( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ mxContext( rxContext, UNO_SET_THROW )
{
- OSL_ENSURE( mxFactory.is(), "FilterDetect::FilterDetect - no service factory" );
}
FilterDetect::~FilterDetect()
@@ -371,7 +356,49 @@ void lclDeriveKey( const sal_uInt8* pnHash, sal_uInt32 nHashLen, sal_uInt8* pnKe
// ----------------------------------------------------------------------------
-bool lclGenerateEncryptionKey( const PackageEncryptionInfo& rEncrInfo, const OUString& rPassword, sal_uInt8* pnKey, sal_uInt32 nRequiredKeyLen )
+bool lclCheckEncryptionData( const sal_uInt8* pnKey, sal_uInt32 nKeySize, const sal_uInt8* pnVerifier, sal_uInt32 nVerifierSize, const sal_uInt8* pnVerifierHash, sal_uInt32 nVerifierHashSize )
+{
+ bool bResult = false;
+
+ // the only currently supported algorithm needs key size 128
+ if ( nKeySize == 16 && nVerifierSize == 16 && nVerifierHashSize == 32 )
+ {
+ // check password
+ EVP_CIPHER_CTX aes_ctx;
+ EVP_CIPHER_CTX_init( &aes_ctx );
+ EVP_DecryptInit_ex( &aes_ctx, EVP_aes_128_ecb(), 0, pnKey, 0 );
+ EVP_CIPHER_CTX_set_padding( &aes_ctx, 0 );
+ int nOutLen = 0;
+ sal_uInt8 pnTmpVerifier[ 16 ];
+ (void) memset( pnTmpVerifier, 0, sizeof(pnTmpVerifier) );
+
+ /*int*/ EVP_DecryptUpdate( &aes_ctx, pnTmpVerifier, &nOutLen, pnVerifier, nVerifierSize );
+ EVP_CIPHER_CTX_cleanup( &aes_ctx );
+
+ EVP_CIPHER_CTX_init( &aes_ctx );
+ EVP_DecryptInit_ex( &aes_ctx, EVP_aes_128_ecb(), 0, pnKey, 0 );
+ EVP_CIPHER_CTX_set_padding( &aes_ctx, 0 );
+ sal_uInt8 pnTmpVerifierHash[ 32 ];
+ (void) memset( pnTmpVerifierHash, 0, sizeof(pnTmpVerifierHash) );
+
+ /*int*/ EVP_DecryptUpdate( &aes_ctx, pnTmpVerifierHash, &nOutLen, pnVerifierHash, nVerifierHashSize );
+ EVP_CIPHER_CTX_cleanup( &aes_ctx );
+
+ rtlDigest aDigest = rtl_digest_create( rtl_Digest_AlgorithmSHA1 );
+ rtlDigestError aError = rtl_digest_update( aDigest, pnTmpVerifier, sizeof( pnTmpVerifier ) );
+ sal_uInt8 pnSha1Hash[ RTL_DIGEST_LENGTH_SHA1 ];
+ aError = rtl_digest_get( aDigest, pnSha1Hash, RTL_DIGEST_LENGTH_SHA1 );
+ rtl_digest_destroy( aDigest );
+
+ bResult = ( memcmp( pnSha1Hash, pnTmpVerifierHash, RTL_DIGEST_LENGTH_SHA1 ) == 0 );
+ }
+
+ return bResult;
+}
+
+// ----------------------------------------------------------------------------
+
+Sequence< NamedValue > lclGenerateEncryptionKey( const PackageEncryptionInfo& rEncrInfo, const OUString& rPassword, sal_uInt8* pnKey, sal_uInt32 nRequiredKeyLen )
{
size_t nBufferSize = rEncrInfo.mnSaltSize + 2 * rPassword.getLength();
sal_uInt8* pnBuffer = new sal_uInt8[ nBufferSize ];
@@ -410,30 +437,18 @@ bool lclGenerateEncryptionKey( const PackageEncryptionInfo& rEncrInfo, const OUS
lclDeriveKey( pnHash, RTL_DIGEST_LENGTH_SHA1, pnKey, nRequiredKeyLen );
delete[] pnHash;
- // check password
- EVP_CIPHER_CTX aes_ctx;
- EVP_CIPHER_CTX_init( &aes_ctx );
- EVP_DecryptInit_ex( &aes_ctx, EVP_aes_128_ecb(), 0, pnKey, 0 );
- EVP_CIPHER_CTX_set_padding( &aes_ctx, 0 );
- int nOutLen = 0;
- sal_uInt8 pnVerifier[ 16 ] = { 0 };
- /*int*/ EVP_DecryptUpdate( &aes_ctx, pnVerifier, &nOutLen, rEncrInfo.mpnEncrVerifier, sizeof( rEncrInfo.mpnEncrVerifier ) );
- EVP_CIPHER_CTX_cleanup( &aes_ctx );
-
- EVP_CIPHER_CTX_init( &aes_ctx );
- EVP_DecryptInit_ex( &aes_ctx, EVP_aes_128_ecb(), 0, pnKey, 0 );
- EVP_CIPHER_CTX_set_padding( &aes_ctx, 0 );
- sal_uInt8 pnVerifierHash[ 32 ] = { 0 };
- /*int*/ EVP_DecryptUpdate( &aes_ctx, pnVerifierHash, &nOutLen, rEncrInfo.mpnEncrVerifierHash, sizeof( rEncrInfo.mpnEncrVerifierHash ) );
- EVP_CIPHER_CTX_cleanup( &aes_ctx );
-
- aDigest = rtl_digest_create( rtl_Digest_AlgorithmSHA1 );
- rtl_digest_update( aDigest, pnVerifier, sizeof( pnVerifier ) );
- sal_uInt8 pnSha1Hash[ RTL_DIGEST_LENGTH_SHA1 ];
- rtl_digest_get( aDigest, pnSha1Hash, RTL_DIGEST_LENGTH_SHA1 );
- rtl_digest_destroy( aDigest );
+ Sequence< NamedValue > aResult;
+ if( lclCheckEncryptionData( pnKey, nRequiredKeyLen, rEncrInfo.mpnEncrVerifier, sizeof( rEncrInfo.mpnEncrVerifier ), rEncrInfo.mpnEncrVerifierHash, sizeof( rEncrInfo.mpnEncrVerifierHash ) ) )
+ {
+ SequenceAsHashMap aEncryptionData;
+ aEncryptionData[ CREATE_OUSTRING( "AES128EncryptionKey" ) ] <<= Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( pnKey ), nRequiredKeyLen );
+ aEncryptionData[ CREATE_OUSTRING( "AES128EncryptionSalt" ) ] <<= Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( rEncrInfo.mpnSalt ), rEncrInfo.mnSaltSize );
+ aEncryptionData[ CREATE_OUSTRING( "AES128EncryptionVerifier" ) ] <<= Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( rEncrInfo.mpnEncrVerifier ), sizeof( rEncrInfo.mpnEncrVerifier ) );
+ aEncryptionData[ CREATE_OUSTRING( "AES128EncryptionVerifierHash" ) ] <<= Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( rEncrInfo.mpnEncrVerifierHash ), sizeof( rEncrInfo.mpnEncrVerifierHash ) );
+ aResult = aEncryptionData.getAsConstNamedValueList();
+ }
- return memcmp( pnSha1Hash, pnVerifierHash, RTL_DIGEST_LENGTH_SHA1 ) == 0;
+ return aResult;
}
// the password verifier ------------------------------------------------------
@@ -444,7 +459,9 @@ public:
explicit PasswordVerifier( const PackageEncryptionInfo& rEncryptInfo );
virtual ::comphelper::DocPasswordVerifierResult
- verifyPassword( const OUString& rPassword );
+ verifyPassword( const OUString& rPassword, Sequence< NamedValue >& o_rEncryptionData );
+ virtual ::comphelper::DocPasswordVerifierResult
+ verifyEncryptionData( const Sequence< NamedValue >& rEncryptionData );
inline const sal_uInt8* getKey() const { return &maKey.front(); }
@@ -459,11 +476,26 @@ PasswordVerifier::PasswordVerifier( const PackageEncryptionInfo& rEncryptInfo )
{
}
-::comphelper::DocPasswordVerifierResult PasswordVerifier::verifyPassword( const OUString& rPassword )
+::comphelper::DocPasswordVerifierResult PasswordVerifier::verifyPassword( const OUString& rPassword, Sequence< NamedValue >& o_rEncryptionData )
{
// verifies the password and writes the related decryption key into maKey
- return lclGenerateEncryptionKey( mrEncryptInfo, rPassword, &maKey.front(), maKey.size() ) ?
- ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
+ o_rEncryptionData = lclGenerateEncryptionKey( mrEncryptInfo, rPassword, &maKey.front(), maKey.size() );
+ return o_rEncryptionData.hasElements() ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
+}
+
+::comphelper::DocPasswordVerifierResult PasswordVerifier::verifyEncryptionData( const Sequence< NamedValue >& rEncryptionData )
+{
+ SequenceAsHashMap aHashData( rEncryptionData );
+ Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault( CREATE_OUSTRING( "AES128EncryptionKey" ), Sequence< sal_Int8 >() );
+ Sequence< sal_Int8 > aVerifier = aHashData.getUnpackedValueOrDefault( CREATE_OUSTRING( "AES128EncryptionVerifier" ), Sequence< sal_Int8 >() );
+ Sequence< sal_Int8 > aVerifierHash = aHashData.getUnpackedValueOrDefault( CREATE_OUSTRING( "AES128EncryptionVerifierHash" ), Sequence< sal_Int8 >() );
+
+ bool bResult = lclCheckEncryptionData(
+ reinterpret_cast< const sal_uInt8* >( aKey.getConstArray() ), aKey.getLength(),
+ reinterpret_cast< const sal_uInt8* >( aVerifier.getConstArray() ), aVerifier.getLength(),
+ reinterpret_cast< const sal_uInt8* >( aVerifierHash.getConstArray() ), aVerifierHash.getLength() );
+
+ return bResult ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
}
} // namespace
@@ -472,11 +504,12 @@ PasswordVerifier::PasswordVerifier( const PackageEncryptionInfo& rEncryptInfo )
Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescriptor& rMediaDesc ) const
{
- if( mxFactory.is() )
+ Reference< XMultiServiceFactory > xFactory( mxContext->getServiceManager(), UNO_QUERY );
+ if( xFactory.is() )
{
// try the plain input stream
Reference< XInputStream > xInStrm( rMediaDesc[ MediaDescriptor::PROP_INPUTSTREAM() ], UNO_QUERY );
- if( !xInStrm.is() || lclIsZipPackage( mxFactory, xInStrm ) )
+ if( !xInStrm.is() || lclIsZipPackage( xFactory, xInStrm ) )
return xInStrm;
// check if a temporary file is passed in the 'ComponentData' property
@@ -484,12 +517,12 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript
if( xDecrypted.is() )
{
Reference< XInputStream > xDecrInStrm = xDecrypted->getInputStream();
- if( lclIsZipPackage( mxFactory, xDecrInStrm ) )
+ if( lclIsZipPackage( xFactory, xDecrInStrm ) )
return xDecrInStrm;
}
// try to decrypt an encrypted OLE package
- ::oox::ole::OleStorage aOleStorage( mxFactory, xInStrm, false );
+ ::oox::ole::OleStorage aOleStorage( xFactory, xInStrm, false );
if( aOleStorage.isStorage() ) try
{
// open the required input streams in the encrypted package
@@ -525,17 +558,17 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript
(according to the verifier), or with an empty string if
user has cancelled the password input dialog. */
PasswordVerifier aVerifier( aEncryptInfo );
- OUString aPassword = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
+ Sequence< NamedValue > aEncryptionData = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
aVerifier, rMediaDesc, ::comphelper::DocPasswordRequestType_MS, &aDefaultPasswords );
- if( aPassword.getLength() == 0 )
+ if( aEncryptionData.getLength() == 0 )
{
rMediaDesc[ MediaDescriptor::PROP_ABORTED() ] <<= true;
}
else
{
// create temporary file for unencrypted package
- Reference< XStream > xTempFile( mxFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TempFile" ) ), UNO_QUERY_THROW );
+ Reference< XStream > xTempFile( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TempFile" ) ), UNO_QUERY_THROW );
Reference< XOutputStream > xDecryptedPackage( xTempFile->getOutputStream(), UNO_SET_THROW );
BinaryXOutputStream aDecryptedPackage( xDecryptedPackage, true );
BinaryXInputStream aEncryptedPackage( xEncryptedPackage, true );
@@ -566,7 +599,7 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript
rMediaDesc.setComponentDataEntry( CREATE_OUSTRING( "DecryptedPackage" ), Any( xTempFile ) );
Reference< XInputStream > xDecrInStrm = xTempFile->getInputStream();
- if( lclIsZipPackage( mxFactory, xDecrInStrm ) )
+ if( lclIsZipPackage( xFactory, xDecrInStrm ) )
return xDecrInStrm;
}
}
@@ -605,12 +638,13 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq
{
OUString aFilterName;
MediaDescriptor aMediaDesc( rMediaDescSeq );
+ Reference< XMultiServiceFactory > xFactory( mxContext->getServiceManager(), UNO_QUERY_THROW );
/* Check that the user has not choosen to abort detection, e.g. by hitting
'Cancel' in the password input dialog. This may happen because this
filter detection is used by different filters. */
bool bAborted = aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_ABORTED(), false );
- if( !bAborted && mxFactory.is() ) try
+ if( !bAborted ) try
{
aMediaDesc.addInputStream();
@@ -620,30 +654,21 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq
descriptor. */
Reference< XInputStream > xInStrm( extractUnencryptedPackage( aMediaDesc ), UNO_SET_THROW );
- // try to detect the file type, must be a ZIP package
- ZipStorage aZipStorage( mxFactory, xInStrm );
+ // stream must be a ZIP package
+ ZipStorage aZipStorage( xFactory, xInStrm );
if( aZipStorage.isStorage() )
{
- Reference< XFastParser > xParser( mxFactory->createInstance(
- CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ) ), UNO_QUERY_THROW );
-
- xParser->setFastDocumentHandler( new FilterDetectDocHandler( aFilterName ) );
- xParser->setTokenHandler( new FastTokenHandler );
-
- xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships" ), NMSP_PACKAGE_RELATIONSHIPS );
- xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships" ), NMSP_RELATIONSHIPS );
- xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/content-types" ), NMSP_CONTENT_TYPES );
-
- // Parse _rels/.rels to get the target path.
- InputSource aParserInput;
- aParserInput.sSystemId = CREATE_OUSTRING( "_rels/.rels" );
- aParserInput.aInputStream = aZipStorage.openInputStream( aParserInput.sSystemId );
- xParser->parseStream( aParserInput );
-
- // Parse [Content_Types].xml to determine the content type of the part at the target path.
- aParserInput.sSystemId = CREATE_OUSTRING( "[Content_Types].xml" );
- aParserInput.aInputStream = aZipStorage.openInputStream( aParserInput.sSystemId );
- xParser->parseStream( aParserInput );
+ // create the fast parser, register the XML namespaces, set document handler
+ FastParser aParser( mxContext );
+ aParser.registerNamespace( NMSP_packageRel );
+ aParser.registerNamespace( NMSP_officeRel );
+ aParser.registerNamespace( NMSP_packageContentTypes );
+ aParser.setDocumentHandler( new FilterDetectDocHandler( aFilterName ) );
+
+ /* Parse '_rels/.rels' to get the target path and '[Content_Types].xml'
+ to determine the content type of the part at the target path. */
+ aParser.parseStream( aZipStorage, CREATE_OUSTRING( "_rels/.rels" ) );
+ aParser.parseStream( aZipStorage, CREATE_OUSTRING( "[Content_Types].xml" ) );
}
}
catch( Exception& )
@@ -660,4 +685,4 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq
} // namespace core
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/core/fragmenthandler.cxx b/oox/source/core/fragmenthandler.cxx
index 634f4c7edf30..c745257c64f2 100644
--- a/oox/source/core/fragmenthandler.cxx
+++ b/oox/source/core/fragmenthandler.cxx
@@ -27,22 +27,22 @@
************************************************************************/
#include "oox/core/fragmenthandler.hxx"
-#include "oox/core/xmlfilterbase.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::xml::sax::XFastAttributeList;
-using ::com::sun::star::xml::sax::XFastContextHandler;
-using ::com::sun::star::xml::sax::XLocator;
+#include "oox/core/xmlfilterbase.hxx"
namespace oox {
namespace core {
// ============================================================================
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
FragmentBaseData::FragmentBaseData( XmlFilterBase& rFilter, const OUString& rFragmentPath, RelationsRef xRelations ) :
mrFilter( rFilter ),
maFragmentPath( rFragmentPath ),
@@ -141,4 +141,4 @@ const RecordInfo* FragmentHandler::getRecordInfos() const
} // namespace core
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/core/fragmenthandler2.cxx b/oox/source/core/fragmenthandler2.cxx
index 7f73b663953a..03fc3f144848 100644
--- a/oox/source/core/fragmenthandler2.cxx
+++ b/oox/source/core/fragmenthandler2.cxx
@@ -28,18 +28,18 @@
#include "oox/core/fragmenthandler2.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::xml::sax::XFastAttributeList;
-using ::com::sun::star::xml::sax::XFastContextHandler;
-
namespace oox {
namespace core {
// ============================================================================
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
FragmentHandler2::FragmentHandler2( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEnableTrimSpace ) :
FragmentHandler( rFilter, rFragmentPath ),
ContextHandler2Helper( bEnableTrimSpace )
@@ -50,11 +50,6 @@ FragmentHandler2::~FragmentHandler2()
{
}
-ContextHandler& FragmentHandler2::queryContextHandler()
-{
- return *this;
-}
-
// com.sun.star.xml.sax.XFastDocumentHandler interface --------------------
void SAL_CALL FragmentHandler2::startDocument() throw( SAXException, RuntimeException )
@@ -78,7 +73,7 @@ Reference< XFastContextHandler > SAL_CALL FragmentHandler2::createFastChildConte
void SAL_CALL FragmentHandler2::startFastElement(
sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) throw( SAXException, RuntimeException )
{
- implStartCurrentContext( nElement, rxAttribs );
+ implStartElement( nElement, rxAttribs );
}
void SAL_CALL FragmentHandler2::characters( const OUString& rChars ) throw( SAXException, RuntimeException )
@@ -88,17 +83,17 @@ void SAL_CALL FragmentHandler2::characters( const OUString& rChars ) throw( SAXE
void SAL_CALL FragmentHandler2::endFastElement( sal_Int32 nElement ) throw( SAXException, RuntimeException )
{
- implEndCurrentContext( nElement );
+ implEndElement( nElement );
}
// oox.core.ContextHandler interface ------------------------------------------
-ContextHandlerRef FragmentHandler2::createRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef FragmentHandler2::createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
return implCreateRecordContext( nRecId, rStrm );
}
-void FragmentHandler2::startRecord( sal_Int32 nRecId, RecordInputStream& rStrm )
+void FragmentHandler2::startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
implStartRecord( nRecId, rStrm );
}
@@ -119,16 +114,20 @@ void FragmentHandler2::onStartElement( const AttributeList& )
{
}
-void FragmentHandler2::onEndElement( const OUString& )
+void FragmentHandler2::onCharacters( const OUString& )
+{
+}
+
+void FragmentHandler2::onEndElement()
{
}
-ContextHandlerRef FragmentHandler2::onCreateRecordContext( sal_Int32, RecordInputStream& )
+ContextHandlerRef FragmentHandler2::onCreateRecordContext( sal_Int32, SequenceInputStream& )
{
return 0;
}
-void FragmentHandler2::onStartRecord( RecordInputStream& )
+void FragmentHandler2::onStartRecord( SequenceInputStream& )
{
}
@@ -151,4 +150,4 @@ void FragmentHandler2::finalizeImport()
} // namespace core
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/core/makefile.mk b/oox/source/core/makefile.mk
index 2e29cf01543a..2b58b95777df 100644
--- a/oox/source/core/makefile.mk
+++ b/oox/source/core/makefile.mk
@@ -49,7 +49,7 @@ SLOFILES = \
$(SLO)$/binaryfilterbase.obj \
$(SLO)$/contexthandler.obj \
$(SLO)$/contexthandler2.obj \
- $(SLO)$/facreg.obj \
+ $(SLO)$/fastparser.obj \
$(SLO)$/fasttokenhandler.obj \
$(SLO)$/filterbase.obj \
$(SLO)$/filterdetect.obj \
@@ -58,6 +58,7 @@ SLOFILES = \
$(SLO)$/recordparser.obj \
$(SLO)$/relations.obj \
$(SLO)$/relationshandler.obj \
+ $(SLO)$/services.obj \
$(SLO)$/xmlfilterbase.obj
# --- Targets -------------------------------------------------------
diff --git a/oox/source/core/recordparser.cxx b/oox/source/core/recordparser.cxx
index dea09f03e2b4..c7d45e034880 100644
--- a/oox/source/core/recordparser.cxx
+++ b/oox/source/core/recordparser.cxx
@@ -27,27 +27,27 @@
************************************************************************/
#include "oox/core/recordparser.hxx"
+
#include <vector>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/xml/sax/XLocator.hpp>
#include <cppuhelper/implbase1.hxx>
-#include "oox/helper/recordinputstream.hxx"
#include "oox/core/fragmenthandler.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::lang::DisposedException;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::IOException;
-using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::xml::sax::XLocator;
-
namespace oox {
namespace core {
// ============================================================================
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace prv {
class Locator : public ::cppu::WeakImplHelper1< XLocator >
@@ -274,7 +274,7 @@ void RecordParser::parseStream( const RecordInputSource& rInputSource ) throw( S
while( lclReadNextRecord( nRecId, aRecData, *maSource.mxInStream ) )
{
// create record stream object from imported record data
- RecordInputStream aRecStrm( aRecData );
+ SequenceInputStream aRecStrm( aRecData );
// try to leave a context, there may be other incomplete contexts on the stack
if( const RecordInfo* pEndRecInfo = getEndRecordInfo( nRecId ) )
{
@@ -350,4 +350,4 @@ const RecordInfo* RecordParser::getEndRecordInfo( sal_Int32 nRecId ) const
} // namespace core
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/core/relations.cxx b/oox/source/core/relations.cxx
index 9ca04cac16ea..194259149864 100644
--- a/oox/source/core/relations.cxx
+++ b/oox/source/core/relations.cxx
@@ -27,17 +27,20 @@
************************************************************************/
#include "oox/core/relations.hxx"
+
#include <rtl/ustrbuf.hxx>
#include "oox/helper/helper.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-
namespace oox {
namespace core {
// ============================================================================
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
OUString lclRemoveFileName( const OUString& rPath )
@@ -69,7 +72,7 @@ const Relation* Relations::getRelationFromRelId( const OUString& rId ) const
const Relation* Relations::getRelationFromFirstType( const OUString& rType ) const
{
for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt )
- if( aIt->second.maType == rType )
+ if( aIt->second.maType.equalsIgnoreAsciiCase( rType ) )
return &aIt->second;
return 0;
}
@@ -78,7 +81,7 @@ RelationsRef Relations::getRelationsFromType( const OUString& rType ) const
{
RelationsRef xRelations( new Relations( maFragmentPath ) );
for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt )
- if( aIt->second.maType == rType )
+ if( aIt->second.maType.equalsIgnoreAsciiCase( rType ) )
(*xRelations)[ aIt->first ] = aIt->second;
return xRelations;
}
@@ -145,4 +148,4 @@ OUString Relations::getFragmentPathFromFirstType( const OUString& rType ) const
} // namespace core
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/core/relationshandler.cxx b/oox/source/core/relationshandler.cxx
index ae762536a695..a2a76ca16c74 100644
--- a/oox/source/core/relationshandler.cxx
+++ b/oox/source/core/relationshandler.cxx
@@ -27,18 +27,20 @@
************************************************************************/
#include "oox/core/relationshandler.hxx"
+
#include <rtl/ustrbuf.hxx>
-#include "tokens.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
+namespace oox {
+namespace core {
+
+// ============================================================================
+
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
-namespace oox {
-namespace core {
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
// ============================================================================
@@ -77,7 +79,7 @@ Reference< XFastContextHandler > RelationsFragment::createFastChildContext(
AttributeList aAttribs( rxAttribs );
switch( nElement )
{
- case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationship:
+ case PR_TOKEN( Relationship ):
{
Relation aRelation;
aRelation.maId = aAttribs.getString( XML_Id, OUString() );
@@ -96,7 +98,7 @@ Reference< XFastContextHandler > RelationsFragment::createFastChildContext(
}
}
break;
- case NMSP_PACKAGE_RELATIONSHIPS|XML_Relationships:
+ case PR_TOKEN( Relationships ):
xRet = getFastContextHandler();
break;
}
@@ -108,4 +110,4 @@ Reference< XFastContextHandler > RelationsFragment::createFastChildContext(
} // namespace core
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx
new file mode 100644
index 000000000000..f05524f4d046
--- /dev/null
+++ b/oox/source/core/services.cxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <cppuhelper/implementationentry.hxx>
+
+using ::rtl::OUString;
+using namespace ::com::sun::star::uno;
+
+// Declare static functions providing service information =====================
+
+#define DECLARE_FUNCTIONS( className ) \
+extern OUString SAL_CALL className##_getImplementationName() throw(); \
+extern Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw(); \
+extern Reference< XInterface > SAL_CALL className##_createInstance( \
+ const Reference< XComponentContext >& rxContext ) throw (Exception)
+
+namespace oox {
+ namespace core { DECLARE_FUNCTIONS( FastTokenHandler ); }
+ namespace core { DECLARE_FUNCTIONS( FilterDetect ); }
+ namespace docprop { DECLARE_FUNCTIONS( DocumentPropertiesImport ); }
+ namespace ole { DECLARE_FUNCTIONS( WordVbaProjectFilter ); }
+ namespace ppt { DECLARE_FUNCTIONS( PowerPointImport ); }
+ namespace shape { DECLARE_FUNCTIONS( ShapeContextHandler ); }
+ namespace xls { DECLARE_FUNCTIONS( BiffDetector ); }
+ namespace xls { DECLARE_FUNCTIONS( ExcelFilter ); }
+ namespace xls { DECLARE_FUNCTIONS( ExcelBiffFilter ); }
+ namespace xls { DECLARE_FUNCTIONS( ExcelVbaProjectFilter ); }
+ namespace xls { DECLARE_FUNCTIONS( OOXMLFormulaParser ); }
+}
+
+#undef DECLARE_FUNCTIONS
+
+// ============================================================================
+
+namespace {
+
+#define IMPLEMENTATION_ENTRY( className ) \
+ { &className##_createInstance, &className##_getImplementationName, &className##_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 }
+
+static ::cppu::ImplementationEntry const spServices[] =
+{
+ IMPLEMENTATION_ENTRY( ::oox::core::FastTokenHandler ),
+ IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ),
+ IMPLEMENTATION_ENTRY( ::oox::docprop::DocumentPropertiesImport ),
+ IMPLEMENTATION_ENTRY( ::oox::ole::WordVbaProjectFilter ),
+ IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ),
+ IMPLEMENTATION_ENTRY( ::oox::shape::ShapeContextHandler ),
+ IMPLEMENTATION_ENTRY( ::oox::xls::BiffDetector ),
+ IMPLEMENTATION_ENTRY( ::oox::xls::ExcelFilter ),
+ IMPLEMENTATION_ENTRY( ::oox::xls::ExcelBiffFilter ),
+ IMPLEMENTATION_ENTRY( ::oox::xls::ExcelVbaProjectFilter ),
+ IMPLEMENTATION_ENTRY( ::oox::xls::OOXMLFormulaParser ),
+ { 0, 0, 0, 0, 0, 0 }
+};
+
+#undef IMPLEMENTATION_ENTRY
+
+} // namespace
+
+// ----------------------------------------------------------------------------
+
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
+ const sal_Char** ppEnvironmentTypeName, uno_Environment** /*ppEnvironment*/ )
+{
+ *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const char* pImplName, void* pServiceManager, void* pRegistryKey )
+{
+ return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices );
+}
+
+// ============================================================================
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index aad41b0d5f47..0eb1eb898ad3 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -29,9 +29,6 @@
#include "oox/core/xmlfilterbase.hxx"
#include <cstdio>
-
-#include <rtl/strbuf.hxx>
-#include <rtl/ustrbuf.hxx>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/embed/XRelationshipAccess.hpp>
#include <com/sun/star/xml/sax/InputSource.hpp>
@@ -39,48 +36,38 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <comphelper/mediadescriptor.hxx>
#include <sax/fshelper.hxx>
-#include "properties.hxx"
-#include "tokens.hxx"
-#include "oox/helper/containerhelper.hxx"
-#include "oox/helper/propertyset.hxx"
-#include "oox/helper/zipstorage.hxx"
-#include "oox/core/fasttokenhandler.hxx"
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
+#include "oox/core/fastparser.hxx"
#include "oox/core/filterdetect.hxx"
#include "oox/core/fragmenthandler.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/recordparser.hxx"
#include "oox/core/relationshandler.hxx"
+#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/propertyset.hxx"
+#include "oox/helper/zipstorage.hxx"
+
+namespace oox {
+namespace core {
+
+// ============================================================================
+
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::embed;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+using namespace ::com::sun::star::xml::sax;
+using ::comphelper::MediaDescriptor;
using ::rtl::OStringBuffer;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::beans::StringPair;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::lang::Locale;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::embed::XRelationshipAccess;
-using ::com::sun::star::embed::XStorage;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XStream;
-using ::com::sun::star::container::XNameContainer;
-using ::com::sun::star::xml::sax::XFastParser;
-using ::com::sun::star::xml::sax::XFastTokenHandler;
-using ::com::sun::star::xml::sax::XFastDocumentHandler;
-using ::com::sun::star::xml::sax::InputSource;
-using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::document::XDocumentProperties;
-using ::com::sun::star::util::DateTime;
-using ::comphelper::MediaDescriptor;
-using ::sax_fastparser::FastSerializerHelper;
using ::sax_fastparser::FSHelperPtr;
-
+using ::sax_fastparser::FastSerializerHelper;
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XOOXMLDocumentPropertiesImporter.hpp>
@@ -97,8 +84,6 @@ using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::lang::XComponent;
-namespace oox {
-namespace core {
// ============================================================================
@@ -118,23 +103,22 @@ struct XmlFilterBaseImpl
{
typedef RefMap< OUString, Relations > RelationsMap;
- Reference< XFastParser > mxFastParser;
- OUString maBinSuffix;
- OUString maVmlSuffix;
+ FastParser maFastParser;
+ const OUString maBinSuffix;
+ const OUString maVmlSuffix;
RelationsMap maRelationsMap;
TextFieldStack maTextFieldStack;
- explicit XmlFilterBaseImpl();
+
+ explicit XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException );
};
// ----------------------------------------------------------------------------
-XmlFilterBaseImpl::XmlFilterBaseImpl() :
+XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ maFastParser( rxContext ),
maBinSuffix( CREATE_OUSTRING( ".bin" ) ),
maVmlSuffix( CREATE_OUSTRING( ".vml" ) )
{
-}
-
-// ============================================================================
static Reference< XComponentContext > lcl_getComponentContext(Reference< XMultiServiceFactory > aFactory)
{
Reference< XComponentContext > xContext;
@@ -151,45 +135,38 @@ static Reference< XComponentContext > lcl_getComponentContext(Reference< XMultiS
}
// ============================================================================
+ // register XML namespaces
+ maFastParser.registerNamespace( NMSP_xml );
+ maFastParser.registerNamespace( NMSP_packageRel );
+ maFastParser.registerNamespace( NMSP_officeRel );
+
+ maFastParser.registerNamespace( NMSP_dml );
+ maFastParser.registerNamespace( NMSP_dmlDiagram );
+ maFastParser.registerNamespace( NMSP_dmlChart );
+ maFastParser.registerNamespace( NMSP_dmlChartDr );
+ maFastParser.registerNamespace( NMSP_dmlSpreadDr );
+
+ maFastParser.registerNamespace( NMSP_vml );
+ maFastParser.registerNamespace( NMSP_vmlOffice );
+ maFastParser.registerNamespace( NMSP_vmlWord );
+ maFastParser.registerNamespace( NMSP_vmlExcel );
+ maFastParser.registerNamespace( NMSP_vmlPowerpoint );
+
+ maFastParser.registerNamespace( NMSP_xls );
+ maFastParser.registerNamespace( NMSP_ppt );
+
+ maFastParser.registerNamespace( NMSP_ax );
+ maFastParser.registerNamespace( NMSP_xm );
+}
+
+// ============================================================================
-XmlFilterBase::XmlFilterBase( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
- FilterBase( rxGlobalFactory ),
- mxImpl( new XmlFilterBaseImpl ),
+XmlFilterBase::XmlFilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ FilterBase( rxContext ),
+ mxImpl( new XmlFilterBaseImpl( rxContext ) ),
mnRelId( 1 ),
mnMaxDocId( 0 )
{
- try
- {
- // create the fast parser
- mxImpl->mxFastParser.set( rxGlobalFactory->createInstance( CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ) ), UNO_QUERY_THROW );
- mxImpl->mxFastParser->setTokenHandler( new FastTokenHandler );
-
- // register XML namespaces
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://www.w3.org/XML/1998/namespace" ), NMSP_XML );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships" ), NMSP_PACKAGE_RELATIONSHIPS );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships" ), NMSP_RELATIONSHIPS );
-
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/main" ), NMSP_DRAWINGML );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/diagram" ), NMSP_DIAGRAM );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chart" ), NMSP_CHART );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing" ), NMSP_CDR );
-
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:vml" ), NMSP_VML );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:office" ), NMSP_OFFICE );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:word" ), NMSP_VML_DOC );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:excel" ), NMSP_VML_XLS );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:powerpoint" ), NMSP_VML_PPT );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.microsoft.com/office/2006/activeX" ), NMSP_AX );
-
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/spreadsheetml/2006/main"), NMSP_XLS );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" ), NMSP_XDR );
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.microsoft.com/office/excel/2006/main" ), NMSP_XM );
-
- mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/presentationml/2006/main"), NMSP_PPT );
- }
- catch( Exception& )
- {
- }
}
XmlFilterBase::~XmlFilterBase()
@@ -265,25 +242,20 @@ bool XmlFilterBase::importFragment( const ::rtl::Reference< FragmentHandler >& r
if( !xDocHandler.is() )
return false;
- // check that the fast parser exists
- if( !mxImpl->mxFastParser.is() )
- return false;
-
// try to import XML stream
try
{
- // try to open the fragment stream (this may fail - do not assert)
- Reference< XInputStream > xInStrm( rxHandler->openFragmentStream(), UNO_SET_THROW );
+ /* Try to open the fragment stream (may fail, do not throw/assert).
+ Using the virtual function openFragmentStream() allows a document
+ handler to create specialized input streams, e.g. VML streams that
+ have to preprocess the raw input data. */
+ Reference< XInputStream > xInStrm = rxHandler->openFragmentStream();
- // create the input source and parse the stream
- InputSource aSource;
- aSource.aInputStream = xInStrm;
- aSource.sSystemId = aFragmentPath;
// own try/catch block for showing parser failure assertion with fragment path
- try
+ if( xInStrm.is() ) try
{
- mxImpl->mxFastParser->setFastDocumentHandler( xDocHandler );
- mxImpl->mxFastParser->parseStream( aSource );
+ mxImpl->maFastParser.setDocumentHandler( xDocHandler );
+ mxImpl->maFastParser.parseStream( xInStrm, aFragmentPath );
return true;
}
catch( Exception& )
@@ -576,7 +548,7 @@ Reference< XInputStream > XmlFilterBase::implGetInputStream( MediaDescriptor& rM
/* Get the input stream directly from the media descriptor, or decrypt the
package again. The latter is needed e.g. when the document is reloaded.
All this is implemented in the detector service. */
- FilterDetect aDetector( getGlobalFactory() );
+ FilterDetect aDetector( getComponentContext() );
return aDetector.extractUnencryptedPackage( rMediaDesc );
}
@@ -584,12 +556,12 @@ Reference< XInputStream > XmlFilterBase::implGetInputStream( MediaDescriptor& rM
StorageRef XmlFilterBase::implCreateStorage( const Reference< XInputStream >& rxInStream ) const
{
- return StorageRef( new ZipStorage( getGlobalFactory(), rxInStream ) );
+ return StorageRef( new ZipStorage( getServiceFactory(), rxInStream ) );
}
StorageRef XmlFilterBase::implCreateStorage( const Reference< XStream >& rxOutStream ) const
{
- return StorageRef( new ZipStorage( getGlobalFactory(), rxOutStream ) );
+ return StorageRef( new ZipStorage( getServiceFactory(), rxOutStream ) );
}
// ============================================================================
@@ -597,4 +569,4 @@ StorageRef XmlFilterBase::implCreateStorage( const Reference< XStream >& rxOutSt
} // namespace core
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx
index 3d2be51ef625..242d83b8e0fb 100644
--- a/oox/source/docprop/docprophandler.cxx
+++ b/oox/source/docprop/docprophandler.cxx
@@ -34,9 +34,7 @@
#include <osl/time.h>
-#include "tokens.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
using namespace ::com::sun::star;
@@ -227,19 +225,19 @@ void OOXMLDocPropHandler::UpdateDocStatistic( const ::rtl::OUString& aChars )
switch( m_nBlock )
{
- case XML_Characters|NMSP_EXTPR:
+ case EXTPR_TOKEN( Characters ):
aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CharacterCount" ) );
break;
- case XML_Pages|NMSP_EXTPR:
+ case EXTPR_TOKEN( Pages ):
aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageCount" ) );
break;
- case XML_Words|NMSP_EXTPR:
+ case EXTPR_TOKEN( Words ):
aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WordCount" ) );
break;
- case XML_Paragraphs|NMSP_EXTPR:
+ case EXTPR_TOKEN( Paragraphs ):
aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParagraphCount" ) );
break;
@@ -300,9 +298,9 @@ void SAL_CALL OOXMLDocPropHandler::startFastElement( ::sal_Int32 nElement, const
{
if ( !m_nInBlock && !m_nState )
{
- if ( nElement == ( XML_coreProperties|NMSP_COREPR )
- || nElement == ( XML_Properties|NMSP_EXTPR )
- || nElement == ( XML_Properties|NMSP_CUSTPR ) )
+ if ( nElement == COREPR_TOKEN( coreProperties )
+ || nElement == EXTPR_TOKEN( Properties )
+ || nElement == CUSTPR_TOKEN( Properties ) )
{
m_nState = nElement;
}
@@ -321,7 +319,7 @@ void SAL_CALL OOXMLDocPropHandler::startFastElement( ::sal_Int32 nElement, const
if ( xAttribs.is() && xAttribs->hasAttribute( XML_name ) )
m_aCustomPropertyName = xAttribs->getValue( XML_name );
}
- else if ( m_nState && m_nInBlock && m_nInBlock == 2 && ( nElement >> 16 ) == ( NMSP_VT >> 16 ) )
+ else if ( m_nState && m_nInBlock && m_nInBlock == 2 && getNamespace( nElement ) == NMSP_officeDocPropsVT )
{
m_nType = nElement;
}
@@ -403,72 +401,72 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars )
{
if ( (m_nInBlock == 2) || ((m_nInBlock == 3) && m_nType) )
{
- if ( m_nState == ( XML_coreProperties|NMSP_COREPR ) )
+ if ( m_nState == COREPR_TOKEN( coreProperties ) )
{
switch( m_nBlock )
{
- case XML_category|NMSP_COREPR:
+ case COREPR_TOKEN( category ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "category" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_contentStatus|NMSP_COREPR:
+ case COREPR_TOKEN( contentStatus ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "contentStatus" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_contentType|NMSP_COREPR:
+ case COREPR_TOKEN( contentType ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "contentType" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_identifier|NMSP_COREPR:
+ case COREPR_TOKEN( identifier ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "identifier" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_version|NMSP_COREPR:
+ case COREPR_TOKEN( version ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "version" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_created|NMSP_DCTERMS:
+ case DCT_TOKEN( created ):
if ( aChars.getLength() >= 4 )
m_xDocProp->setCreationDate( GetDateTimeFromW3CDTF( aChars ) );
break;
- case XML_creator|NMSP_DC:
+ case DC_TOKEN( creator ):
m_xDocProp->setAuthor( aChars );
break;
- case XML_description|NMSP_DC:
+ case DC_TOKEN( description ):
m_xDocProp->setDescription( aChars );
break;
- case XML_keywords|NMSP_COREPR:
+ case COREPR_TOKEN( keywords ):
m_xDocProp->setKeywords( GetKeywordsSet( aChars ) );
break;
- case XML_language|NMSP_DC:
+ case DC_TOKEN( language ):
if ( aChars.getLength() >= 2 )
m_xDocProp->setLanguage( GetLanguage( aChars ) );
break;
- case XML_lastModifiedBy|NMSP_COREPR:
+ case COREPR_TOKEN( lastModifiedBy ):
m_xDocProp->setModifiedBy( aChars );
break;
- case XML_lastPrinted|NMSP_COREPR:
+ case COREPR_TOKEN( lastPrinted ):
if ( aChars.getLength() >= 4 )
m_xDocProp->setPrintDate( GetDateTimeFromW3CDTF( aChars ) );
break;
- case XML_modified|NMSP_DCTERMS:
+ case DCT_TOKEN( modified ):
if ( aChars.getLength() >= 4 )
m_xDocProp->setModificationDate( GetDateTimeFromW3CDTF( aChars ) );
break;
- case XML_revision|NMSP_COREPR:
+ case COREPR_TOKEN( revision ):
try
{
m_xDocProp->setEditingCycles(
@@ -480,11 +478,11 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars )
}
break;
- case XML_subject|NMSP_DC:
+ case DC_TOKEN( subject ):
m_xDocProp->setSubject( aChars );
break;
- case XML_title|NMSP_DC:
+ case DC_TOKEN( title ):
m_xDocProp->setTitle( aChars );
break;
@@ -492,19 +490,19 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars )
OSL_FAIL( "Unexpected core property!" );
}
}
- else if ( m_nState == ( XML_Properties|NMSP_EXTPR ) )
+ else if ( m_nState == EXTPR_TOKEN( Properties ) )
{
switch( m_nBlock )
{
- case XML_Application|NMSP_EXTPR:
+ case EXTPR_TOKEN( Application ):
m_xDocProp->setGenerator( aChars );
break;
- case XML_Template|NMSP_EXTPR:
+ case EXTPR_TOKEN( Template ):
m_xDocProp->setTemplateName( aChars );
break;
- case XML_TotalTime|NMSP_EXTPR:
+ case EXTPR_TOKEN( TotalTime ):
try
{
m_xDocProp->setEditingDuration( aChars.toInt32() );
@@ -515,89 +513,89 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars )
}
break;
- case XML_Characters|NMSP_EXTPR:
- case XML_Pages|NMSP_EXTPR:
- case XML_Words|NMSP_EXTPR:
- case XML_Paragraphs|NMSP_EXTPR:
+ case EXTPR_TOKEN( Characters ):
+ case EXTPR_TOKEN( Pages ):
+ case EXTPR_TOKEN( Words ):
+ case EXTPR_TOKEN( Paragraphs ):
UpdateDocStatistic( aChars );
break;
- case XML_HyperlinksChanged|NMSP_EXTPR:
+ case EXTPR_TOKEN( HyperlinksChanged ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HyperlinksChanged" ) );
AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type
break;
- case XML_LinksUpToDate|NMSP_EXTPR:
+ case EXTPR_TOKEN( LinksUpToDate ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LinksUpToDate" ) );
AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type
break;
- case XML_ScaleCrop|NMSP_EXTPR:
+ case EXTPR_TOKEN( ScaleCrop ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ScaleCrop" ) );
AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type
break;
- case XML_SharedDoc|NMSP_EXTPR:
+ case EXTPR_TOKEN( SharedDoc ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ShareDoc" ) );
AddCustomProperty( uno::makeAny( aChars.toBoolean() ) ); // the property has boolean type
break;
- case XML_DocSecurity|NMSP_EXTPR:
+ case EXTPR_TOKEN( DocSecurity ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DocSecurity" ) );
AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type
break;
- case XML_HiddenSlides|NMSP_EXTPR:
+ case EXTPR_TOKEN( HiddenSlides ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HiddenSlides" ) );
AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type
break;
- case XML_MMClips|NMSP_EXTPR:
+ case EXTPR_TOKEN( MMClips ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MMClips" ) );
AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type
break;
- case XML_Notes|NMSP_EXTPR:
+ case EXTPR_TOKEN( Notes ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Notes" ) );
AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type
break;
- case XML_Slides|NMSP_EXTPR:
+ case EXTPR_TOKEN( Slides ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Slides" ) );
AddCustomProperty( uno::makeAny( aChars.toInt32() ) ); // the property has sal_Int32 type
break;
- case XML_AppVersion|NMSP_EXTPR:
+ case EXTPR_TOKEN( AppVersion ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AppVersion" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_Company|NMSP_EXTPR:
+ case EXTPR_TOKEN( Company ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Company" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_HyperlinkBase|NMSP_EXTPR:
+ case EXTPR_TOKEN( HyperlinkBase ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HyperlinkBase" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_Manager|NMSP_EXTPR:
+ case EXTPR_TOKEN( Manager ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Manager" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_PresentationFormat|NMSP_EXTPR:
+ case EXTPR_TOKEN( PresentationFormat ):
m_aCustomPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PresentationFormat" ) );
AddCustomProperty( uno::makeAny( aChars ) ); // the property has string type
break;
- case XML_CharactersWithSpaces|NMSP_EXTPR:
- case XML_Lines|NMSP_EXTPR:
- case XML_DigSig|NMSP_EXTPR:
- case XML_HeadingPairs|NMSP_EXTPR:
- case XML_HLinks|NMSP_EXTPR:
- case XML_TitlesOfParts|NMSP_EXTPR:
+ case EXTPR_TOKEN( CharactersWithSpaces ):
+ case EXTPR_TOKEN( Lines ):
+ case EXTPR_TOKEN( DigSig ):
+ case EXTPR_TOKEN( HeadingPairs ):
+ case EXTPR_TOKEN( HLinks ):
+ case EXTPR_TOKEN( TitlesOfParts ):
// ignored during the import currently
break;
@@ -605,46 +603,46 @@ void SAL_CALL OOXMLDocPropHandler::characters( const ::rtl::OUString& aChars )
OSL_FAIL( "Unexpected extended property!" );
}
}
- else if ( m_nState == ( XML_Properties|NMSP_CUSTPR ) )
+ else if ( m_nState == CUSTPR_TOKEN( Properties ) )
{
- if ( m_nBlock == ( XML_property|NMSP_CUSTPR ) )
+ if ( m_nBlock == CUSTPR_TOKEN( property ) )
{
// this is a custom property
switch( m_nType )
{
- case XML_bool|NMSP_VT:
+ case VT_TOKEN( bool ):
AddCustomProperty( uno::makeAny( aChars.toBoolean() ) );
break;
- case XML_bstr|NMSP_VT:
- case XML_lpstr|NMSP_VT:
- case XML_lpwstr|NMSP_VT:
+ case VT_TOKEN( bstr ):
+ case VT_TOKEN( lpstr ):
+ case VT_TOKEN( lpwstr ):
AddCustomProperty( uno::makeAny( AttributeConversion::decodeXString( aChars ) ) ); // the property has string type
break;
- case XML_date|NMSP_VT:
- case XML_filetime|NMSP_VT:
+ case VT_TOKEN( date ):
+ case VT_TOKEN( filetime ):
AddCustomProperty( uno::makeAny( GetDateTimeFromW3CDTF( aChars ) ) );
- case XML_i1|NMSP_VT:
- case XML_i2|NMSP_VT:
+ case VT_TOKEN( i1 ):
+ case VT_TOKEN( i2 ):
AddCustomProperty( uno::makeAny( (sal_Int16)aChars.toInt32() ) );
break;
- case XML_i4|NMSP_VT:
- case XML_int|NMSP_VT:
+ case VT_TOKEN( i4 ):
+ case VT_TOKEN( int ):
AddCustomProperty( uno::makeAny( aChars.toInt32() ) );
break;
- case XML_i8|NMSP_VT:
+ case VT_TOKEN( i8 ):
AddCustomProperty( uno::makeAny( aChars.toInt64() ) );
break;
- case XML_r4|NMSP_VT:
+ case VT_TOKEN( r4 ):
AddCustomProperty( uno::makeAny( aChars.toFloat() ) );
break;
- case XML_r8|NMSP_VT:
+ case VT_TOKEN( r8 ):
AddCustomProperty( uno::makeAny( aChars.toDouble() ) );
break;
diff --git a/oox/source/docprop/docprophandler.hxx b/oox/source/docprop/docprophandler.hxx
index 5f4baf8be17a..47f34f77e740 100644
--- a/oox/source/docprop/docprophandler.hxx
+++ b/oox/source/docprop/docprophandler.hxx
@@ -35,9 +35,19 @@
#include <cppuhelper/implbase1.hxx>
+#include "oox/token/namespaces.hxx"
+#include "oox/token/tokens.hxx"
+
namespace oox {
namespace docprop {
+#define COREPR_TOKEN( token ) (::oox::NMSP_packageMetaCorePr | XML_##token)
+#define CUSTPR_TOKEN( token ) (::oox::NMSP_officeCustomPr | XML_##token)
+#define EXTPR_TOKEN( token ) (::oox::NMSP_officeExtPr | XML_##token)
+#define VT_TOKEN( token ) (::oox::NMSP_officeDocPropsVT | XML_##token)
+#define DC_TOKEN( token ) (::oox::NMSP_dc | XML_##token)
+#define DCT_TOKEN( token ) (::oox::NMSP_dcTerms | XML_##token)
+
class OOXMLDocPropHandler : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastDocumentHandler >
{
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx
index a8b4559327d7..7e826d51a83b 100644
--- a/oox/source/docprop/ooxmldocpropimport.cxx
+++ b/oox/source/docprop/ooxmldocpropimport.cxx
@@ -26,204 +26,167 @@
*
************************************************************************/
-#include <com/sun/star/embed/XStorage.hpp>
+#include "ooxmldocpropimport.hxx"
+
+#include <vector>
+#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XHierarchicalStorageAccess.hpp>
#include <com/sun/star/embed/XRelationshipAccess.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
-#include <com/sun/star/xml/sax/XFastParser.hpp>
-#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
-#include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
-
-#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implementationentry.hxx>
-
-#include <oox/core/namespaces.hxx>
+#include <com/sun/star/embed/XStorage.hpp>
+#include "oox/core/fastparser.hxx"
+#include "oox/core/relations.hxx"
+#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/helper.hxx"
#include "docprophandler.hxx"
-#include "ooxmldocpropimport.hxx"
-
-using namespace ::com::sun::star;
namespace oox {
namespace docprop {
-// -----------------------------------------------------------
-::rtl::OUString SAL_CALL OOXMLDocPropImportImpl_getImplementationName()
+// ============================================================================
+
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::embed;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+OUString SAL_CALL DocumentPropertiesImport_getImplementationName()
{
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.oox.docprop.OOXMLDocumentPropertiesImporter"));
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.docprop.DocumentPropertiesImporter" );
}
-// -----------------------------------------------------------
-uno::Sequence< ::rtl::OUString > SAL_CALL OOXMLDocPropImportImpl_getSupportedServiceNames()
+Sequence< OUString > SAL_CALL DocumentPropertiesImport_getSupportedServiceNames()
{
- uno::Sequence< ::rtl::OUString > s(1);
- s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.document.OOXMLDocumentPropertiesImporter"));
- return s;
+ Sequence< OUString > aServices( 1 );
+ aServices[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.OOXMLDocumentPropertiesImporter" );
+ return aServices;
}
-// -----------------------------------------------------------
-uno::Reference< uno::XInterface > SAL_CALL OOXMLDocPropImportImpl_createInstance(
- const uno::Reference< uno::XComponentContext > & context)
- SAL_THROW((uno::Exception))
+Reference< XInterface > SAL_CALL DocumentPropertiesImport_createInstance( const Reference< XComponentContext >& rxContext ) SAL_THROW((Exception))
{
- return static_cast< ::cppu::OWeakObject * >(new OOXMLDocPropImportImpl(context));
+ return static_cast< ::cppu::OWeakObject* >( new DocumentPropertiesImport( rxContext ) );
}
+// ============================================================================
-// -----------------------------------------------------------
-OOXMLDocPropImportImpl::OOXMLDocPropImportImpl(uno::Reference< uno::XComponentContext > const & xContext) :
- m_xContext( xContext )
-{}
+namespace {
-// -----------------------------------------------------------
-uno::Sequence< xml::sax::InputSource > OOXMLDocPropImportImpl::GetRelatedStreams( const uno::Reference< embed::XStorage > xStorage, const ::rtl::OUString& aStreamType )
+Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxStorage, const OUString& rStreamType ) throw (RuntimeException)
{
- if ( !xStorage.is() )
- throw uno::RuntimeException();
+ Reference< XRelationshipAccess > xRelation( rxStorage, UNO_QUERY_THROW );
+ Reference< XHierarchicalStorageAccess > xHierarchy( rxStorage, UNO_QUERY_THROW );
- uno::Reference< embed::XRelationshipAccess > xRelation( xStorage, uno::UNO_QUERY_THROW );
- uno::Reference< embed::XHierarchicalStorageAccess > xHierarchy( xStorage, uno::UNO_QUERY_THROW );
+ Sequence< Sequence< StringPair > > aPropsInfo = xRelation->getRelationshipsByType( rStreamType );
- uno::Sequence< uno::Sequence< beans::StringPair > > aPropsInfo = xRelation->getRelationshipsByType( aStreamType );
+ ::std::vector< InputSource > aResult;
- uno::Sequence< xml::sax::InputSource > aResult( aPropsInfo.getLength() );
- if ( aPropsInfo.getLength() )
+ for( sal_Int32 nIndex = 0, nLength = aPropsInfo.getLength(); nIndex < nLength; ++nIndex )
{
- sal_Int32 nLength = 0;
- for ( sal_Int32 nInd = 0; nInd < aPropsInfo.getLength(); nInd++ )
- for ( sal_Int32 nEntryInd = 0; nEntryInd < aPropsInfo[nInd].getLength(); nEntryInd++ )
- if ( aPropsInfo[nInd][nEntryInd].First.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Target" ) ) ) )
+ const Sequence< StringPair >& rEntries = aPropsInfo[ nIndex ];
+ for( sal_Int32 nEntryIndex = 0, nEntryLength = rEntries.getLength(); nEntryIndex < nEntryLength; ++nEntryIndex )
+ {
+ const StringPair& rEntry = rEntries[ nEntryIndex ];
+ if( rEntry.First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Target" ) ) )
+ {
+ Reference< XExtendedStorageStream > xExtStream(
+ xHierarchy->openStreamElementByHierarchicalName( rEntry.Second, ElementModes::READ ), UNO_QUERY_THROW );
+ Reference< XInputStream > xInStream = xExtStream->getInputStream();
+ if( xInStream.is() )
{
- uno::Reference< embed::XExtendedStorageStream > xExtStream = xHierarchy->openStreamElementByHierarchicalName( aPropsInfo[nInd][nEntryInd].Second, embed::ElementModes::READ );
- if ( !xExtStream.is() )
- throw uno::RuntimeException();
-
- aResult[nLength].sSystemId = aPropsInfo[nInd][nEntryInd].Second;
- aResult[nLength++].aInputStream = xExtStream->getInputStream();
- break;
+ aResult.resize( aResult.size() + 1 );
+ aResult.back().sSystemId = rEntry.Second;
+ aResult.back().aInputStream = xExtStream->getInputStream();
}
-
- aResult.realloc( nLength );
+ break;
+ }
+ }
}
- return aResult;
+ return ContainerHelper::vectorToSequence( aResult );
}
-// com.sun.star.uno.XServiceInfo:
-// -----------------------------------------------------------
-::rtl::OUString SAL_CALL OOXMLDocPropImportImpl::getImplementationName() throw (uno::RuntimeException)
+} // namespace
+
+// ============================================================================
+
+DocumentPropertiesImport::DocumentPropertiesImport( const Reference< XComponentContext >& rxContext ) :
+ mxContext( rxContext )
{
- return OOXMLDocPropImportImpl_getImplementationName();
}
-// -----------------------------------------------------------
-::sal_Bool SAL_CALL OOXMLDocPropImportImpl::supportsService(::rtl::OUString const & serviceName) throw (uno::RuntimeException)
-{
- uno::Sequence< ::rtl::OUString > serviceNames = OOXMLDocPropImportImpl_getSupportedServiceNames();
- for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i)
- {
- if (serviceNames[i] == serviceName)
- return sal_True;
- }
+// XServiceInfo
- return sal_False;
+OUString SAL_CALL DocumentPropertiesImport::getImplementationName() throw (RuntimeException)
+{
+ return DocumentPropertiesImport_getImplementationName();
}
-// -----------------------------------------------------------
-uno::Sequence< ::rtl::OUString > SAL_CALL OOXMLDocPropImportImpl::getSupportedServiceNames() throw (uno::RuntimeException)
+sal_Bool SAL_CALL DocumentPropertiesImport::supportsService( const OUString& rServiceName ) throw (RuntimeException)
{
- return OOXMLDocPropImportImpl_getSupportedServiceNames();
+ Sequence< OUString > aServiceNames = DocumentPropertiesImport_getSupportedServiceNames();
+ for( sal_Int32 nIndex = 0, nLength = aServiceNames.getLength(); nIndex < nLength; ++nIndex )
+ if( aServiceNames[ nIndex ] == rServiceName )
+ return sal_True;
+ return sal_False;
}
-// -----------------------------------------------------------
-// ::com::sun::star::document::XOOXMLDocumentPropertiesImporter:
-void SAL_CALL OOXMLDocPropImportImpl::importProperties(const uno::Reference< embed::XStorage > & xSource, const uno::Reference< document::XDocumentProperties > & xDocumentProperties) throw (uno::RuntimeException, lang::IllegalArgumentException, xml::sax::SAXException, uno::Exception)
+Sequence< OUString > SAL_CALL DocumentPropertiesImport::getSupportedServiceNames() throw (RuntimeException)
{
- // TODO: Insert your implementation for "importProperties" here.
- if ( !m_xContext.is() )
- throw uno::RuntimeException();
+ return DocumentPropertiesImport_getSupportedServiceNames();
+}
- if ( !xSource.is() || !xDocumentProperties.is() )
- throw lang::IllegalArgumentException();
+// XOOXMLDocumentPropertiesImporter
- // the MS Office seems to have a bug, so we have to do similar handling
- ::rtl::OUString aCoreType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officedocument/2006/relationships/metadata/core-properties" ) );
- ::rtl::OUString aCoreWorkaroundType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" ) );
+void SAL_CALL DocumentPropertiesImport::importProperties(
+ const Reference< XStorage >& rxSource, const Reference< XDocumentProperties >& rxDocumentProperties )
+ throw (RuntimeException, IllegalArgumentException, SAXException, Exception)
+{
+ if( !mxContext.is() )
+ throw RuntimeException();
- ::rtl::OUString aExtType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officedocument/2006/relationships/extended-properties" ) );
- ::rtl::OUString aCustomType( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officedocument/2006/relationships/custom-properties" ) );
+ if( !rxSource.is() || !rxDocumentProperties.is() )
+ throw IllegalArgumentException();
- uno::Sequence< xml::sax::InputSource > aCoreStreams = GetRelatedStreams( xSource, aCoreType );
- if ( !aCoreStreams.getLength() )
- aCoreStreams = GetRelatedStreams( xSource, aCoreWorkaroundType );
+ Sequence< InputSource > aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "metadata/core-properties" ) );
+ // MS Office seems to have a bug, so we have to do similar handling
+ if( !aCoreStreams.hasElements() )
+ aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_PACKAGE_RELATION_TYPE( "metadata/core-properties" ) );
- uno::Sequence< xml::sax::InputSource > aExtStreams = GetRelatedStreams( xSource, aExtType );
- uno::Sequence< xml::sax::InputSource > aCustomStreams = GetRelatedStreams( xSource, aCustomType );
+ Sequence< InputSource > aExtStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "extended-properties" ) );
+ Sequence< InputSource > aCustomStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "custom-properties" ) );
- if ( aCoreStreams.getLength() || aExtStreams.getLength() || aCustomStreams.getLength() )
+ if( aCoreStreams.hasElements() || aExtStreams.hasElements() || aCustomStreams.hasElements() )
{
- if ( aCoreStreams.getLength() > 1 )
- throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unexpected core properties stream!" ) ), uno::Reference< uno::XInterface >() );
-
- uno::Reference< lang::XMultiComponentFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_QUERY_THROW );
-
- uno::Reference< xml::sax::XFastParser > xParser(
- xFactory->createInstanceWithContext(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.FastParser" ) ),
- m_xContext ),
- uno::UNO_QUERY_THROW );
-
- uno::Reference< xml::sax::XFastTokenHandler > xTokenHandler(
- xFactory->createInstanceWithContext(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.oox.FastTokenHandlerService" ) ),
- m_xContext ),
- uno::UNO_QUERY_THROW );
-
- uno::Reference< xml::sax::XFastDocumentHandler > xDocHandler( static_cast< xml::sax::XFastDocumentHandler* >( new OOXMLDocPropHandler( m_xContext, xDocumentProperties ) ) );
-
- xParser->setFastDocumentHandler( xDocHandler );
- xParser->setTokenHandler( xTokenHandler );
-
- xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/package/2006/metadata/core-properties" ) ), NMSP_COREPR );
- xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://purl.org/dc/elements/1.1/" ) ), NMSP_DC );
- xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://purl.org/dc/terms/" ) ), NMSP_DCTERMS );
- xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" ) ), NMSP_EXTPR );
- xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" ) ), NMSP_CUSTPR );
- xParser->registerNamespace( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes" ) ), NMSP_VT );
-
- // #158414# XFastParser::parseStream() throws on invalid XML
- if ( aCoreStreams.getLength() ) try
- {
- if ( aCoreStreams[0].aInputStream.is() )
- {
- xParser->parseStream( aCoreStreams[0] );
- aCoreStreams[0].aInputStream->closeInput();
- }
- }
- catch( uno::Exception& )
- {
- }
-
- sal_Int32 nInd = 0;
- for ( nInd = 0; nInd < aExtStreams.getLength(); nInd++ )
- {
- xParser->parseStream( aExtStreams[nInd] );
- if ( aExtStreams[nInd].aInputStream.is() )
- aExtStreams[nInd].aInputStream->closeInput();
- }
-
- for ( nInd = 0; nInd < aCustomStreams.getLength(); nInd++ )
- {
- xParser->parseStream( aCustomStreams[nInd] );
- if ( aCustomStreams[nInd].aInputStream.is() )
- aCustomStreams[nInd].aInputStream->closeInput();
- }
+ if( aCoreStreams.getLength() > 1 )
+ throw IOException( CREATE_OUSTRING( "Unexpected core properties stream!" ), Reference< XInterface >() );
+
+ ::oox::core::FastParser aParser( mxContext );
+ aParser.registerNamespace( NMSP_packageMetaCorePr );
+ aParser.registerNamespace( NMSP_dc );
+ aParser.registerNamespace( NMSP_dcTerms );
+ aParser.registerNamespace( NMSP_officeExtPr );
+ aParser.registerNamespace( NMSP_officeCustomPr );
+ aParser.registerNamespace( NMSP_officeDocPropsVT );
+ aParser.setDocumentHandler( new OOXMLDocPropHandler( mxContext, rxDocumentProperties ) );
+
+ if( aCoreStreams.hasElements() )
+ aParser.parseStream( aCoreStreams[ 0 ], true );
+ for( sal_Int32 nIndex = 0; nIndex < aExtStreams.getLength(); ++nIndex )
+ aParser.parseStream( aExtStreams[ nIndex ], true );
+ for( sal_Int32 nIndex = 0; nIndex < aCustomStreams.getLength(); ++nIndex )
+ aParser.parseStream( aCustomStreams[ nIndex ], true );
}
}
+// ============================================================================
+
} // namespace docprop
} // namespace oox
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/docprop/ooxmldocpropimport.hxx b/oox/source/docprop/ooxmldocpropimport.hxx
index 438442c3e1a7..7c52d2e8c242 100644
--- a/oox/source/docprop/ooxmldocpropimport.hxx
+++ b/oox/source/docprop/ooxmldocpropimport.hxx
@@ -29,45 +29,46 @@
#ifndef OOX_DOCPROP_OOXMLDOCPROPIMPORT_HXX
#define OOX_DOCPROP_OOXMLDOCPROPIMPORT_HXX
-#include <sal/config.h>
-#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/document/XOOXMLDocumentPropertiesImporter.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/xml/sax/InputSource.hpp>
-#include <com/sun/star/document/XOOXMLDocumentPropertiesImporter.hpp>
+#include <cppuhelper/implbase2.hxx>
namespace oox {
namespace docprop {
-class OOXMLDocPropImportImpl:
+// ============================================================================
+
+class DocumentPropertiesImport :
public ::cppu::WeakImplHelper2<
::com::sun::star::lang::XServiceInfo,
- ::com::sun::star::document::XOOXMLDocumentPropertiesImporter>
+ ::com::sun::star::document::XOOXMLDocumentPropertiesImporter >
{
-private:
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
-
- OOXMLDocPropImportImpl(const OOXMLDocPropImportImpl &); // not defined
- OOXMLDocPropImportImpl& operator=(const OOXMLDocPropImportImpl &); // not defined
-
public:
- explicit OOXMLDocPropImportImpl(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context);
- virtual ~OOXMLDocPropImportImpl() {}
-
- ::com::sun::star::uno::Sequence< ::com::sun::star::xml::sax::InputSource > GetRelatedStreams( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > xStorage, const ::rtl::OUString& aStreamType );
+ explicit DocumentPropertiesImport(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
- // ::com::sun::star::lang::XServiceInfo:
+ // XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString & ServiceName) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
- // ::com::sun::star::document::XOOXMLDocumentPropertiesImporter:
- virtual void SAL_CALL importProperties(const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > & xSource, const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > & xDocumentProperties) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::Exception);
+ // XOOXMLDocumentPropertiesImporter
+ virtual void SAL_CALL importProperties(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxSource,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties >& rxDocumentProperties )
+ throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::Exception);
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
};
+// ============================================================================
+
} // namespace docprop
} // namespace oox
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/axiscontext.cxx b/oox/source/drawingml/chart/axiscontext.cxx
index 6ae29d841fd4..0445fbafe5ca 100644
--- a/oox/source/drawingml/chart/axiscontext.cxx
+++ b/oox/source/drawingml/chart/axiscontext.cxx
@@ -27,21 +27,24 @@
************************************************************************/
#include "oox/drawingml/chart/axiscontext.hxx"
+
#include "oox/drawingml/shapepropertiescontext.hxx"
#include "oox/drawingml/textbodycontext.hxx"
#include "oox/drawingml/chart/axismodel.hxx"
#include "oox/drawingml/chart/titlecontext.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::ContextHandler2Helper;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using ::oox::core::ContextHandlerRef;
+using ::oox::core::ContextHandler2Helper;
+using ::rtl::OUString;
+
+// ============================================================================
+
AxisDispUnitsContext::AxisDispUnitsContext( ContextHandler2Helper& rParent, AxisDispUnitsModel& rModel ) :
ContextBase< AxisDispUnitsModel >( rParent, rModel )
{
@@ -235,7 +238,7 @@ ContextHandlerRef DateAxisContext::onCreateContext( sal_Int32 nElement, const At
mrModel.mbAuto = rAttribs.getBool( XML_val, false );
return 0;
case C_TOKEN( baseTimeUnit ):
- mrModel.mnBaseTimeUnit = rAttribs.getToken( XML_val, XML_days );
+ mrModel.monBaseTimeUnit = rAttribs.getToken( XML_val, XML_days );
return 0;
case C_TOKEN( lblOffset ):
mrModel.mnLabelOffset = rAttribs.getInteger( XML_val, 100 );
@@ -317,4 +320,4 @@ ContextHandlerRef ValAxisContext::onCreateContext( sal_Int32 nElement, const Att
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx
index 921111a8cd7d..5cd68f751d66 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -27,36 +27,22 @@
************************************************************************/
#include "oox/drawingml/chart/axisconverter.hxx"
+
#include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp>
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
-#include <com/sun/star/chart2/TickmarkStyle.hpp>
+#include <com/sun/star/chart/TimeInterval.hpp>
+#include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/chart2/TickmarkStyle.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XCoordinateSystem.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
-#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/chart/axismodel.hxx"
#include "oox/drawingml/chart/titleconverter.hxx"
#include "oox/drawingml/chart/typegroupconverter.hxx"
-#include "properties.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::chart2::IncrementData;
-using ::com::sun::star::chart2::ScaleData;
-using ::com::sun::star::chart2::SubIncrement;
-using ::com::sun::star::chart2::XAxis;
-using ::com::sun::star::chart2::XCoordinateSystem;
-using ::com::sun::star::chart2::XScaling;
-using ::com::sun::star::chart2::XTitled;
+#include "oox/drawingml/lineproperties.hxx"
namespace oox {
namespace drawingml {
@@ -64,25 +50,45 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
-template< typename Type >
-inline void lclSetValueOrClearAny( Any& orAny, const OptValue< Type >& roValue )
+inline void lclSetValueOrClearAny( Any& orAny, const OptValue< double >& rofValue )
{
- if( roValue.has() ) orAny <<= roValue.get(); else orAny.clear();
+ if( rofValue.has() ) orAny <<= rofValue.get(); else orAny.clear();
}
-void lclSetScaledValueOrClearAny( Any& orAny, const OptValue< double >& rofValue, const Reference< XScaling >& rxScaling )
+bool lclIsLogarithmicScale( const AxisModel& rAxisModel )
{
- if( rofValue.has() && rxScaling.is() )
- orAny <<= rxScaling->doScaling( rofValue.get() );
- else
- lclSetValueOrClearAny( orAny, rofValue );
+ return rAxisModel.mofLogBase.has() && (2.0 <= rAxisModel.mofLogBase.get()) && (rAxisModel.mofLogBase.get() <= 1000.0);
}
-bool lclIsLogarithmicScale( const AxisModel& rAxisModel )
+sal_Int32 lclGetApiTimeUnit( sal_Int32 nTimeUnit )
{
- return rAxisModel.mofLogBase.has() && (2.0 <= rAxisModel.mofLogBase.get()) && (rAxisModel.mofLogBase.get() <= 1000.0);
+ using namespace ::com::sun::star::chart;
+ switch( nTimeUnit )
+ {
+ case XML_days: return TimeUnit::DAY;
+ case XML_months: return TimeUnit::MONTH;
+ case XML_years: return TimeUnit::YEAR;
+ default: OSL_ENSURE( false, "lclGetApiTimeUnit - unexpected time unit" );
+ }
+ return TimeUnit::DAY;
+}
+
+void lclConvertTimeInterval( Any& orInterval, const OptValue< double >& rofUnit, sal_Int32 nTimeUnit )
+{
+ if( rofUnit.has() && (1.0 <= rofUnit.get()) && (rofUnit.get() <= SAL_MAX_INT32) )
+ orInterval <<= ::com::sun::star::chart::TimeInterval( static_cast< sal_Int32 >( rofUnit.get() ), lclGetApiTimeUnit( nTimeUnit ) );
+ else
+ orInterval.clear();
}
::com::sun::star::chart::ChartAxisLabelPosition lclGetLabelPosition( sal_Int32 nToken )
@@ -184,8 +190,13 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
if( rTypeInfo.mbCategoryAxis )
{
OSL_ENSURE( (mrModel.mnTypeId == C_TOKEN( catAx )) || (mrModel.mnTypeId == C_TOKEN( dateAx )),
- "AxisConverter::convertFromModel - unexpected axis model type (must: c:catAx or c:dateEx)" );
- aScaleData.AxisType = cssc2::AxisType::CATEGORY;
+ "AxisConverter::convertFromModel - unexpected axis model type (must: c:catAx or c:dateAx)" );
+ bool bDateAxis = mrModel.mnTypeId == C_TOKEN( dateAx );
+ /* Chart2 requires axis type CATEGORY for automatic
+ category/date axis (even if it is a date axis
+ currently). */
+ aScaleData.AxisType = (bDateAxis && !mrModel.mbAuto) ? cssc2::AxisType::DATE : cssc2::AxisType::CATEGORY;
+ aScaleData.AutoDateAxis = mrModel.mbAuto;
aScaleData.Categories = rTypeGroup.createCategorySequence();
}
else
@@ -211,14 +222,37 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
{
case cssc2::AxisType::CATEGORY:
case cssc2::AxisType::SERIES:
+ case cssc2::AxisType::DATE:
{
- // do not overlap text unless all labels are visible
- aAxisProp.setProperty( PROP_TextOverlap, mrModel.mnTickLabelSkip == 1 );
- // do not break text into several lines
- aAxisProp.setProperty( PROP_TextBreak, false );
- // do not stagger labels in two lines
- aAxisProp.setProperty( PROP_ArrangeOrder, cssc::ChartAxisArrangeOrderType_SIDE_BY_SIDE );
- //! TODO #i58731# show n-th category
+ /* Determine date axis type from XML type identifier, and not
+ via aScaleData.AxisType, as this value sticks to CATEGORY
+ for automatic category/date axes). */
+ if( mrModel.mnTypeId == C_TOKEN( dateAx ) )
+ {
+ // scaling algorithm
+ aScaleData.Scaling.set( createInstance( CREATE_OUSTRING( "com.sun.star.chart2.LinearScaling" ) ), UNO_QUERY );
+ // min/max
+ lclSetValueOrClearAny( aScaleData.Minimum, mrModel.mofMin );
+ lclSetValueOrClearAny( aScaleData.Maximum, mrModel.mofMax );
+ // major/minor increment
+ lclConvertTimeInterval( aScaleData.TimeIncrement.MajorTimeInterval, mrModel.mofMajorUnit, mrModel.mnMajorTimeUnit );
+ lclConvertTimeInterval( aScaleData.TimeIncrement.MinorTimeInterval, mrModel.mofMinorUnit, mrModel.mnMinorTimeUnit );
+ // base time unit
+ if( mrModel.monBaseTimeUnit.has() )
+ aScaleData.TimeIncrement.TimeResolution <<= lclGetApiTimeUnit( mrModel.monBaseTimeUnit.get() );
+ else
+ aScaleData.TimeIncrement.TimeResolution.clear();
+ }
+ else
+ {
+ // do not overlap text unless all labels are visible
+ aAxisProp.setProperty( PROP_TextOverlap, mrModel.mnTickLabelSkip == 1 );
+ // do not break text into several lines
+ aAxisProp.setProperty( PROP_TextBreak, false );
+ // do not stagger labels in two lines
+ aAxisProp.setProperty( PROP_ArrangeOrder, cssc::ChartAxisArrangeOrderType_SIDE_BY_SIDE );
+ //! TODO #i58731# show n-th category
+ }
}
break;
case cssc2::AxisType::REALNUMBER:
@@ -235,26 +269,25 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
lclSetValueOrClearAny( aScaleData.Maximum, mrModel.mofMax );
// major increment
IncrementData& rIncrementData = aScaleData.IncrementData;
- lclSetScaledValueOrClearAny( rIncrementData.Distance, mrModel.mofMajorUnit, aScaleData.Scaling );
+ if( mrModel.mofMajorUnit.has() && aScaleData.Scaling.is() )
+ rIncrementData.Distance <<= aScaleData.Scaling->doScaling( mrModel.mofMajorUnit.get() );
+ else
+ lclSetValueOrClearAny( rIncrementData.Distance, mrModel.mofMajorUnit );
// minor increment
Sequence< SubIncrement >& rSubIncrementSeq = rIncrementData.SubIncrements;
rSubIncrementSeq.realloc( 1 );
Any& rIntervalCount = rSubIncrementSeq[ 0 ].IntervalCount;
+ rIntervalCount.clear();
if( bLogScale )
{
if( mrModel.mofMinorUnit.has() )
rIntervalCount <<= sal_Int32( 9 );
}
- else
+ else if( mrModel.mofMajorUnit.has() && mrModel.mofMinorUnit.has() && (0.0 < mrModel.mofMinorUnit.get()) && (mrModel.mofMinorUnit.get() <= mrModel.mofMajorUnit.get()) )
{
- OptValue< sal_Int32 > onCount;
- if( mrModel.mofMajorUnit.has() && mrModel.mofMinorUnit.has() && (0.0 < mrModel.mofMinorUnit.get()) && (mrModel.mofMinorUnit.get() <= mrModel.mofMajorUnit.get()) )
- {
- double fCount = mrModel.mofMajorUnit.get() / mrModel.mofMinorUnit.get() + 0.5;
- if( (1.0 <= fCount) && (fCount < 1001.0) )
- onCount = static_cast< sal_Int32 >( fCount );
- }
- lclSetValueOrClearAny( rIntervalCount, onCount );
+ double fCount = mrModel.mofMajorUnit.get() / mrModel.mofMinorUnit.get() + 0.5;
+ if( (1.0 <= fCount) && (fCount < 1001.0) )
+ rIntervalCount <<= static_cast< sal_Int32 >( fCount );
}
}
break;
@@ -332,4 +365,4 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/axismodel.cxx b/oox/source/drawingml/chart/axismodel.cxx
index 1a5e44875992..85fdc1308e31 100644
--- a/oox/source/drawingml/chart/axismodel.cxx
+++ b/oox/source/drawingml/chart/axismodel.cxx
@@ -49,7 +49,6 @@ AxisDispUnitsModel::~AxisDispUnitsModel()
AxisModel::AxisModel( sal_Int32 nTypeId ) :
mnAxisId( -1 ),
mnAxisPos( XML_TOKEN_INVALID ),
- mnBaseTimeUnit( XML_days ),
mnCrossAxisId( -1 ),
mnCrossBetween( XML_between ),
mnCrossMode( XML_autoZero ),
@@ -80,4 +79,4 @@ AxisModel::~AxisModel()
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/chartcontextbase.cxx b/oox/source/drawingml/chart/chartcontextbase.cxx
index 07feba76eddd..4d31816cdc5b 100644
--- a/oox/source/drawingml/chart/chartcontextbase.cxx
+++ b/oox/source/drawingml/chart/chartcontextbase.cxx
@@ -27,11 +27,9 @@
************************************************************************/
#include "oox/drawingml/chart/chartcontextbase.hxx"
-#include "oox/drawingml/shapepropertiescontext.hxx"
-#include "oox/drawingml/chart/modelbase.hxx"
-using ::oox::core::ContextHandler2Helper;
-using ::oox::core::ContextHandlerRef;
+#include "oox/drawingml/chart/modelbase.hxx"
+#include "oox/drawingml/shapepropertiescontext.hxx"
namespace oox {
namespace drawingml {
@@ -39,6 +37,11 @@ namespace chart {
// ============================================================================
+using ::oox::core::ContextHandler2Helper;
+using ::oox::core::ContextHandlerRef;
+
+// ============================================================================
+
ShapePrWrapperContext::ShapePrWrapperContext( ContextHandler2Helper& rParent, Shape& rModel ) :
ContextBase< Shape >( rParent, rModel )
{
@@ -119,4 +122,4 @@ ContextHandlerRef LayoutContext::onCreateContext( sal_Int32 nElement, const Attr
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/chartconverter.cxx b/oox/source/drawingml/chart/chartconverter.cxx
index c99ac6d82bbc..da8bf26527fa 100644
--- a/oox/source/drawingml/chart/chartconverter.cxx
+++ b/oox/source/drawingml/chart/chartconverter.cxx
@@ -27,30 +27,31 @@
************************************************************************/
#include "oox/drawingml/chart/chartconverter.hxx"
+
#include <com/sun/star/chart2/XChartDocument.hpp>
#include "oox/drawingml/chart/chartspaceconverter.hxx"
#include "oox/drawingml/chart/chartspacemodel.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::drawing::XShapes;
-using ::com::sun::star::chart2::XChartDocument;
-using ::com::sun::star::chart2::data::XDataProvider;
-using ::com::sun::star::chart2::data::XDataSequence;
-using ::oox::core::XmlFilterBase;
using ::oox::drawingml::chart::DataSequenceModel;
using ::com::sun::star::uno::Any;
using ::rtl::OUStringBuffer;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::XmlFilterBase;
+using ::rtl::OUString;
+
+// ============================================================================
+
static const sal_Unicode API_TOKEN_ARRAY_OPEN = '{';
static const sal_Unicode API_TOKEN_ARRAY_CLOSE = '}';
static const sal_Unicode API_TOKEN_ARRAY_ROWSEP = '|';
@@ -166,4 +167,4 @@ Reference< XDataSequence > ChartConverter::createDataSequence( const Reference<
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx
index 14bcce4a65fe..6e70e8c2ed93 100644
--- a/oox/source/drawingml/chart/chartdrawingfragment.cxx
+++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx
@@ -27,28 +27,28 @@
************************************************************************/
#include "oox/drawingml/chart/chartdrawingfragment.hxx"
+
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/connectorshapecontext.hxx"
#include "oox/drawingml/graphicshapecontext.hxx"
#include "oox/drawingml/shapecontext.hxx"
#include "oox/drawingml/shapegroupcontext.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::drawing::XShapes;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::FragmentHandler2;
-using ::oox::core::XmlFilterBase;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::uno;
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
ShapeAnchor::ShapeAnchor( bool bRelSize ) :
mbRelSize( bRelSize )
{
@@ -176,7 +176,7 @@ ContextHandlerRef ChartDrawingFragment::onCreateContext( sal_Int32 nElement, con
case CDR_TOKEN( graphicFrame ):
if( !mbOleSupport )
return 0;
- mxShape.reset( new Shape( "com.sun.star.drawing.OLE2Shape" ) );
+ mxShape.reset( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) );
return new GraphicalObjectFrameContext( *this, ShapePtr(), mxShape, true );
case CDR_TOKEN( grpSp ):
mxShape.reset( new Shape( "com.sun.star.drawing.GroupShape" ) );
@@ -205,26 +205,24 @@ ContextHandlerRef ChartDrawingFragment::onCreateContext( sal_Int32 nElement, con
return 0;
}
-void ChartDrawingFragment::onEndElement( const OUString& rChars )
+void ChartDrawingFragment::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
- {
- case CDR_TOKEN( x ):
- case CDR_TOKEN( y ):
- if( mxAnchor.get() ) mxAnchor->setPos( getCurrentElement(), getPreviousElement(), rChars );
- break;
+ if( isCurrentElement( CDR_TOKEN( x ), CDR_TOKEN( y ) ) && mxAnchor.get() )
+ mxAnchor->setPos( getCurrentElement(), getParentElement(), rChars );
+}
- case CDR_TOKEN( absSizeAnchor ):
- case CDR_TOKEN( relSizeAnchor ):
- if( mxDrawPage.is() && mxShape.get() && mxAnchor.get() )
- {
- Rectangle aLoc = mxAnchor->calcEmuLocation( maEmuChartRect );
- if( (aLoc.X >= 0) && (aLoc.Y >= 0) && (aLoc.Width >= 0) && (aLoc.Height >= 0) )
- mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), mxDrawPage, &aLoc );
- }
- mxShape.reset();
- mxAnchor.reset();
- break;
+void ChartDrawingFragment::onEndElement()
+{
+ if( isCurrentElement( CDR_TOKEN( absSizeAnchor ), CDR_TOKEN( relSizeAnchor ) ) )
+ {
+ if( mxDrawPage.is() && mxShape.get() && mxAnchor.get() )
+ {
+ Rectangle aLoc = mxAnchor->calcEmuLocation( maEmuChartRect );
+ if( (aLoc.X >= 0) && (aLoc.Y >= 0) && (aLoc.Width >= 0) && (aLoc.Height >= 0) )
+ mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), mxDrawPage, &aLoc );
+ }
+ mxShape.reset();
+ mxAnchor.reset();
}
}
@@ -234,4 +232,4 @@ void ChartDrawingFragment::onEndElement( const OUString& rChars )
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx
index 33b823f676ae..cf02cbe32e87 100644
--- a/oox/source/drawingml/chart/chartspaceconverter.cxx
+++ b/oox/source/drawingml/chart/chartspaceconverter.cxx
@@ -27,6 +27,7 @@
************************************************************************/
#include "oox/drawingml/chart/chartspaceconverter.hxx"
+
#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -39,7 +40,6 @@
#include "oox/drawingml/chart/chartspacemodel.hxx"
#include "oox/drawingml/chart/plotareaconverter.hxx"
#include "oox/drawingml/chart/titleconverter.hxx"
-#include "properties.hxx"
using ::rtl::OUString;
using ::com::sun::star::awt::Point;
@@ -47,12 +47,14 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::makeAny;
using ::com::sun::star::util::XNumberFormatsSupplier;
using ::com::sun::star::drawing::XDrawPageSupplier;
using ::com::sun::star::drawing::XShapes;
using ::com::sun::star::chart2::XDiagram;
using ::com::sun::star::chart2::XTitled;
using ::com::sun::star::chart2::data::XDataReceiver;
+using ::com::sun::star::beans::XPropertySet;
namespace oox {
namespace drawingml {
@@ -60,6 +62,17 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
ChartSpaceConverter::ChartSpaceConverter( const ConverterRoot& rParent, ChartSpaceModel& rModel ) :
ConverterBase< ChartSpaceModel >( rParent, rModel )
{
@@ -200,6 +213,14 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern
catch( Exception& )
{
}
+
+ // pivot chart
+ if ( mrModel.mbPivotChart )
+ {
+ PropertySet aProps( getChartDocument() );
+ aProps.setProperty( PROP_DisableDataTableDialog , true );
+ aProps.setProperty( PROP_DisableComplexChartTypes , true );
+ }
}
// ============================================================================
@@ -208,4 +229,4 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx
index ea772ac75445..baa690993dcb 100644
--- a/oox/source/drawingml/chart/chartspacefragment.cxx
+++ b/oox/source/drawingml/chart/chartspacefragment.cxx
@@ -27,22 +27,25 @@
************************************************************************/
#include "oox/drawingml/chart/chartspacefragment.hxx"
+
#include "oox/drawingml/shapepropertiescontext.hxx"
#include "oox/drawingml/textbodycontext.hxx"
#include "oox/drawingml/chart/chartspacemodel.hxx"
#include "oox/drawingml/chart/plotareacontext.hxx"
#include "oox/drawingml/chart/titlecontext.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::XmlFilterBase;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
ChartSpaceFragment::ChartSpaceFragment( XmlFilterBase& rFilter, const OUString& rFragmentPath, ChartSpaceModel& rModel ) :
FragmentBase< ChartSpaceModel >( rFilter, rFragmentPath, rModel )
{
@@ -79,6 +82,9 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const
case C_TOKEN( userShapes ):
mrModel.maDrawingPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) );
return 0;
+ case C_TOKEN( pivotSource ):
+ mrModel.mbPivotChart = true;
+ return 0;
}
break;
@@ -126,4 +132,4 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/chartspacemodel.cxx b/oox/source/drawingml/chart/chartspacemodel.cxx
index 89f76e227d30..956fb54f8cee 100644
--- a/oox/source/drawingml/chart/chartspacemodel.cxx
+++ b/oox/source/drawingml/chart/chartspacemodel.cxx
@@ -39,7 +39,8 @@ ChartSpaceModel::ChartSpaceModel() :
mnStyle( 2 ),
mbAutoTitleDel( false ),
mbPlotVisOnly( false ),
- mbShowLabelsOverMax( false )
+ mbShowLabelsOverMax( false ),
+ mbPivotChart( false )
{
}
@@ -53,4 +54,4 @@ ChartSpaceModel::~ChartSpaceModel()
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx
index 52bd978cd3b8..95ec0dd3b7ec 100644
--- a/oox/source/drawingml/chart/converterbase.cxx
+++ b/oox/source/drawingml/chart/converterbase.cxx
@@ -27,48 +27,42 @@
************************************************************************/
#include "oox/drawingml/chart/converterbase.hxx"
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/drawing/FillStyle.hpp>
-#include <com/sun/star/drawing/LineStyle.hpp>
+
#include <com/sun/star/chart/XAxisXSupplier.hpp>
#include <com/sun/star/chart/XAxisYSupplier.hpp>
#include <com/sun/star/chart/XAxisZSupplier.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
+#include <com/sun/star/chart2/RelativeSize.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <tools/solar.h> // for F_PI180
-#include "properties.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/theme.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::XInterface;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::frame::XModel;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::chart2::RelativePosition;
-using ::com::sun::star::chart2::XChartDocument;
-using ::com::sun::star::chart2::XTitle;
-using ::com::sun::star::drawing::XShape;
-using ::oox::core::XmlFilterBase;
-
-namespace cssc = ::com::sun::star::chart;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+namespace cssc = ::com::sun::star::chart;
+
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::XmlFilterBase;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
struct TitleKey : public ::std::pair< ObjectType, ::std::pair< sal_Int32, sal_Int32 > >
@@ -86,8 +80,7 @@ struct TitleLayoutInfo
{
typedef Reference< XShape > (*GetShapeFunc)( const Reference< cssc::XChartDocument >& );
- ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTitle >
- mxTitle; /// The API title object.
+ Reference< XTitle > mxTitle; /// The API title object.
ModelRef< LayoutModel > mxLayout; /// The layout model, if existing.
GetShapeFunc mpGetShape; /// Helper function to receive the title shape.
@@ -248,7 +241,7 @@ Reference< XInterface > ConverterRoot::createInstance( const OUString& rServiceN
Reference< XInterface > xInt;
try
{
- xInt = mxData->mrFilter.getGlobalFactory()->createInstance( rServiceName );
+ xInt = mxData->mrFilter.getServiceFactory()->createInstance( rServiceName );
}
catch( Exception& )
{
@@ -331,9 +324,9 @@ sal_Int32 lclCalcSize( sal_Int32 nPos, sal_Int32 nChartSize, double fSize, sal_I
sal_Int32 nValue = getLimitedValue< sal_Int32, double >( nChartSize * fSize + 0.5, 0, nChartSize );
switch( nSizeMode )
{
- case XML_factor: // size as factor of chart size
+ case XML_factor: // passed value is width/height
return nValue;
- case XML_edge: // absolute end position as factor of chart size
+ case XML_edge: // passed value is right/bottom position
return nValue - nPos + 1;
};
@@ -341,6 +334,23 @@ sal_Int32 lclCalcSize( sal_Int32 nPos, sal_Int32 nChartSize, double fSize, sal_I
return -1;
}
+/** Returns a relative size value in the chart area. */
+double lclCalcRelSize( double fPos, double fSize, sal_Int32 nSizeMode )
+{
+ switch( nSizeMode )
+ {
+ case XML_factor: // passed value is width/height
+ break;
+ case XML_edge: // passed value is right/bottom position
+ fSize -= fPos;
+ break;
+ default:
+ OSL_ENSURE( false, "lclCalcRelSize - unknown size mode" );
+ fSize = 0.0;
+ };
+ return getLimitedValue< double, double >( fSize, 0.0, 1.0 - fPos );
+}
+
} // namespace
// ----------------------------------------------------------------------------
@@ -377,12 +387,20 @@ bool LayoutConverter::convertFromModel( PropertySet& rPropSet )
(mrModel.mnXMode == XML_edge) && (mrModel.mfX >= 0.0) &&
(mrModel.mnYMode == XML_edge) && (mrModel.mfY >= 0.0) )
{
- RelativePosition aPos;
- aPos.Primary = getLimitedValue< double, double >( mrModel.mfX, 0.0, 1.0 );
- aPos.Secondary = getLimitedValue< double, double >( mrModel.mfY, 0.0, 1.0 );
- aPos.Anchor = ::com::sun::star::drawing::Alignment_TOP_LEFT;
+ RelativePosition aPos(
+ getLimitedValue< double, double >( mrModel.mfX, 0.0, 1.0 ),
+ getLimitedValue< double, double >( mrModel.mfY, 0.0, 1.0 ),
+ Alignment_TOP_LEFT );
rPropSet.setProperty( PROP_RelativePosition, aPos );
- return true;
+
+ RelativeSize aSize(
+ lclCalcRelSize( aPos.Primary, mrModel.mfW, mrModel.mnWMode ),
+ lclCalcRelSize( aPos.Secondary, mrModel.mfH, mrModel.mnHMode ) );
+ if( (aSize.Primary > 0.0) && (aSize.Secondary > 0.0) )
+ {
+ rPropSet.setProperty( PROP_RelativeSize, aSize );
+ return true;
+ }
}
return false;
}
@@ -421,4 +439,4 @@ bool LayoutConverter::convertFromModel( const Reference< XShape >& rxShape, doub
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/datasourcecontext.cxx b/oox/source/drawingml/chart/datasourcecontext.cxx
index 6a750286d2d6..a34119a27a7f 100644
--- a/oox/source/drawingml/chart/datasourcecontext.cxx
+++ b/oox/source/drawingml/chart/datasourcecontext.cxx
@@ -27,11 +27,8 @@
************************************************************************/
#include "oox/drawingml/chart/datasourcecontext.hxx"
-#include "oox/drawingml/chart/datasourcemodel.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandler2Helper;
-using ::oox::core::ContextHandlerRef;
+#include "oox/drawingml/chart/datasourcemodel.hxx"
namespace oox {
namespace drawingml {
@@ -39,6 +36,12 @@ namespace chart {
// ============================================================================
+using ::oox::core::ContextHandler2Helper;
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
+
DoubleSequenceContext::DoubleSequenceContext( ContextHandler2Helper& rParent, DataSequenceModel& rModel ) :
DataSequenceContextBase( rParent, rModel ),
mnPtIndex( -1 )
@@ -88,7 +91,7 @@ ContextHandlerRef DoubleSequenceContext::onCreateContext( sal_Int32 nElement, co
return 0;
}
-void DoubleSequenceContext::onEndElement( const OUString& rChars )
+void DoubleSequenceContext::onCharacters( const OUString& rChars )
{
switch( getCurrentElement() )
{
@@ -171,7 +174,7 @@ ContextHandlerRef StringSequenceContext::onCreateContext( sal_Int32 nElement, co
return 0;
}
-void StringSequenceContext::onEndElement( const OUString& rChars )
+void StringSequenceContext::onCharacters( const OUString& rChars )
{
switch( getCurrentElement() )
{
@@ -240,4 +243,4 @@ ContextHandlerRef DataSourceContext::onCreateContext( sal_Int32 nElement, const
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/datasourceconverter.cxx b/oox/source/drawingml/chart/datasourceconverter.cxx
index 4c76b27b982e..b0bfc5aa9113 100644
--- a/oox/source/drawingml/chart/datasourceconverter.cxx
+++ b/oox/source/drawingml/chart/datasourceconverter.cxx
@@ -27,14 +27,10 @@
************************************************************************/
#include "oox/drawingml/chart/datasourceconverter.hxx"
+
#include <com/sun/star/chart2/XChartDocument.hpp>
#include "oox/drawingml/chart/chartconverter.hxx"
#include "oox/drawingml/chart/datasourcemodel.hxx"
-#include "properties.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::chart2::data::XDataSequence;
namespace oox {
namespace drawingml {
@@ -42,6 +38,13 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
DataSequenceConverter::DataSequenceConverter( const ConverterRoot& rParent, DataSequenceModel& rModel ) :
ConverterBase< DataSequenceModel >( rParent, rModel )
{
@@ -91,4 +94,4 @@ Reference< XDataSequence > DataSourceConverter::createDataSequence( const OUStri
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/datasourcemodel.cxx b/oox/source/drawingml/chart/datasourcemodel.cxx
index b3535358231b..bc4c4f52bf4c 100644
--- a/oox/source/drawingml/chart/datasourcemodel.cxx
+++ b/oox/source/drawingml/chart/datasourcemodel.cxx
@@ -59,4 +59,4 @@ DataSourceModel::~DataSourceModel()
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/modelbase.cxx b/oox/source/drawingml/chart/modelbase.cxx
index 8ed15cac3425..d5fb42ba4dbe 100644
--- a/oox/source/drawingml/chart/modelbase.cxx
+++ b/oox/source/drawingml/chart/modelbase.cxx
@@ -27,9 +27,8 @@
************************************************************************/
#include "oox/drawingml/chart/modelbase.hxx"
-#include "oox/helper/attributelist.hxx"
-using ::rtl::OUString;
+#include "oox/helper/attributelist.hxx"
namespace oox {
namespace drawingml {
@@ -37,6 +36,10 @@ namespace chart {
// ============================================================================
+using ::rtl::OUString;
+
+// ============================================================================
+
NumberFormat::NumberFormat() :
mbSourceLinked( true )
{
@@ -75,4 +78,4 @@ LayoutModel::~LayoutModel()
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx
index 0dc5c2b24b40..0cfc314055f8 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -27,13 +27,11 @@
************************************************************************/
#include "oox/drawingml/chart/objectformatter.hxx"
-#include <rtl/strbuf.hxx>
-#include <osl/thread.h>
+
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/util/XNumberFormatTypes.hpp>
-#include "properties.hxx"
-#include "tokens.hxx"
-#include "oox/helper/modelobjecthelper.hxx"
+#include <osl/thread.h>
+#include <rtl/strbuf.hxx>
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/fillproperties.hxx"
#include "oox/drawingml/lineproperties.hxx"
@@ -41,24 +39,7 @@
#include "oox/drawingml/textparagraph.hxx"
#include "oox/drawingml/theme.hxx"
#include "oox/drawingml/chart/chartspacemodel.hxx"
-
-using ::rtl::OStringBuffer;
-using ::rtl::OUString;
-using ::rtl::OUStringToOString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::lang::Locale;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::frame::XModel;
-using ::com::sun::star::chart2::XChartDocument;
-using ::com::sun::star::graphic::XGraphic;
-using ::com::sun::star::util::XNumberFormats;
-using ::com::sun::star::util::XNumberFormatsSupplier;
-using ::com::sun::star::util::XNumberFormatTypes;
-using ::oox::core::XmlFilterBase;
+#include "oox/helper/modelobjecthelper.hxx"
namespace oox {
namespace drawingml {
@@ -66,6 +47,20 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::graphic;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::oox::core::XmlFilterBase;
+using ::rtl::OStringBuffer;
+using ::rtl::OUString;
+using ::rtl::OUStringToOString;
+
+// ============================================================================
+
namespace {
struct AutoFormatPatternEntry
@@ -1213,4 +1208,4 @@ void ObjectFormatter::convertAutomaticFill( PropertySet& rPropSet, ObjectType eO
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/plotareacontext.cxx b/oox/source/drawingml/chart/plotareacontext.cxx
index 53ef3af9568d..8139d86645c6 100644
--- a/oox/source/drawingml/chart/plotareacontext.cxx
+++ b/oox/source/drawingml/chart/plotareacontext.cxx
@@ -27,6 +27,7 @@
************************************************************************/
#include "oox/drawingml/chart/plotareacontext.hxx"
+
#include "oox/drawingml/shapepropertiescontext.hxx"
#include "oox/drawingml/chart/axiscontext.hxx"
#include "oox/drawingml/chart/plotareamodel.hxx"
@@ -34,15 +35,17 @@
#include "oox/drawingml/chart/titlecontext.hxx"
#include "oox/drawingml/chart/typegroupcontext.hxx"
-using ::oox::core::ContextHandler2Helper;
-using ::oox::core::ContextHandlerRef;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using ::oox::core::ContextHandler2Helper;
+using ::oox::core::ContextHandlerRef;
+
+// ============================================================================
+
View3DContext::View3DContext( ContextHandler2Helper& rParent, View3DModel& rModel ) :
ContextBase< View3DModel >( rParent, rModel )
{
@@ -184,4 +187,4 @@ ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const At
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx
index 2a866bb2f9fb..83910029c64b 100644
--- a/oox/source/drawingml/chart/plotareaconverter.cxx
+++ b/oox/source/drawingml/chart/plotareaconverter.cxx
@@ -27,28 +27,18 @@
************************************************************************/
#include "oox/drawingml/chart/plotareaconverter.hxx"
-#include <com/sun/star/drawing/Direction3D.hpp>
-#include <com/sun/star/drawing/ProjectionMode.hpp>
-#include <com/sun/star/drawing/ShadeMode.hpp>
+
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/XDiagramPositioning.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
+#include <com/sun/star/drawing/Direction3D.hpp>
+#include <com/sun/star/drawing/ProjectionMode.hpp>
+#include <com/sun/star/drawing/ShadeMode.hpp>
#include "oox/drawingml/chart/axisconverter.hxx"
#include "oox/drawingml/chart/plotareamodel.hxx"
#include "oox/drawingml/chart/typegroupconverter.hxx"
-#include "properties.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::chart2::XCoordinateSystem;
-using ::com::sun::star::chart2::XCoordinateSystemContainer;
-using ::com::sun::star::chart2::XDiagram;
namespace oox {
namespace drawingml {
@@ -56,6 +46,14 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
/** Axes set model. This is a helper for the plot area converter collecting all
@@ -454,4 +452,4 @@ void PlotAreaConverter::convertPositionFromModel()
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index 93aae6a898c0..807f3cab50fb 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -27,27 +27,30 @@
************************************************************************/
#include "oox/drawingml/chart/seriescontext.hxx"
+
#include "oox/drawingml/shapepropertiescontext.hxx"
#include "oox/drawingml/textbodycontext.hxx"
#include "oox/drawingml/chart/datasourcecontext.hxx"
#include "oox/drawingml/chart/seriesmodel.hxx"
#include "oox/drawingml/chart/titlecontext.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandler2;
-using ::oox::core::ContextHandler2Helper;
-using ::oox::core::ContextHandlerRef;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using ::oox::core::ContextHandler2;
+using ::oox::core::ContextHandler2Helper;
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
-ContextHandlerRef lclDataLabelSharedCreateContext(
- ContextHandler2& rContext, sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel )
+ContextHandlerRef lclDataLabelSharedCreateContext( ContextHandler2& rContext,
+ sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel )
{
if( rContext.isRootElement() ) switch( nElement )
{
@@ -80,7 +83,7 @@ ContextHandlerRef lclDataLabelSharedCreateContext(
orModel.mobShowVal = rAttribs.getBool( XML_val );
return 0;
case C_TOKEN( separator ):
- // collect separator text in onEndElement()
+ // collect separator text in onCharacters()
return &rContext;
case C_TOKEN( spPr ):
return new ShapePropertiesContext( rContext, orModel.mxShapeProp.create() );
@@ -90,14 +93,10 @@ ContextHandlerRef lclDataLabelSharedCreateContext(
return 0;
}
-void lclDataLabelSharedEndElement( ContextHandler2& rContext, const OUString& rChars, DataLabelModelBase& orModel )
+void lclDataLabelSharedCharacters( ContextHandler2& rContext, const OUString& rChars, DataLabelModelBase& orModel )
{
- switch( rContext.getCurrentElement() )
- {
- case C_TOKEN( separator ):
- orModel.moaSeparator = rChars;
- break;
- }
+ if( rContext.isCurrentElement( C_TOKEN( separator ) ) )
+ orModel.moaSeparator = rChars;
}
} // namespace
@@ -128,9 +127,9 @@ ContextHandlerRef DataLabelContext::onCreateContext( sal_Int32 nElement, const A
return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel );
}
-void DataLabelContext::onEndElement( const OUString& rChars )
+void DataLabelContext::onCharacters( const OUString& rChars )
{
- lclDataLabelSharedEndElement( *this, rChars, mrModel );
+ lclDataLabelSharedCharacters( *this, rChars, mrModel );
}
// ============================================================================
@@ -160,9 +159,9 @@ ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const
return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel );
}
-void DataLabelsContext::onEndElement( const OUString& rChars )
+void DataLabelsContext::onCharacters( const OUString& rChars )
{
- lclDataLabelSharedEndElement( *this, rChars, mrModel );
+ lclDataLabelSharedCharacters( *this, rChars, mrModel );
}
// ============================================================================
@@ -306,7 +305,7 @@ ContextHandlerRef TrendlineContext::onCreateContext( sal_Int32 nElement, const A
mrModel.mfIntercept = rAttribs.getDouble( XML_val, 0.0 );
return 0;
case C_TOKEN( name ):
- return this; // collect name in onEndElement()
+ return this; // collect name in onCharacters()
case C_TOKEN( order ):
mrModel.mnOrder = rAttribs.getInteger( XML_val, 2 );
return 0;
@@ -324,14 +323,10 @@ ContextHandlerRef TrendlineContext::onCreateContext( sal_Int32 nElement, const A
return 0;
}
-void TrendlineContext::onEndElement( const ::rtl::OUString& rChars )
+void TrendlineContext::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
- {
- case C_TOKEN( name ):
- mrModel.maName = rChars;
- break;
- }
+ if( isCurrentElement( C_TOKEN( name ) ) )
+ mrModel.maName = rChars;
}
// ============================================================================
@@ -759,4 +754,4 @@ ContextHandlerRef SurfaceSeriesContext::onCreateContext( sal_Int32 nElement, con
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index d717413e6976..cc1256b5ee05 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -27,6 +27,7 @@
************************************************************************/
#include "oox/drawingml/chart/seriesconverter.hxx"
+
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
@@ -39,21 +40,7 @@
#include "oox/drawingml/chart/titleconverter.hxx"
#include "oox/drawingml/chart/typegroupconverter.hxx"
#include "oox/drawingml/chart/typegroupmodel.hxx"
-#include "properties.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::chart2::DataPointLabel;
-using ::com::sun::star::chart2::XDataSeries;
-using ::com::sun::star::chart2::XRegressionCurve;
-using ::com::sun::star::chart2::XRegressionCurveContainer;
-using ::com::sun::star::chart2::data::XDataSequence;
-using ::com::sun::star::chart2::data::XDataSink;
-using ::com::sun::star::chart2::data::XLabeledDataSequence;
+#include "oox/helper/containerhelper.hxx"
namespace oox {
namespace drawingml {
@@ -61,6 +48,15 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
Reference< XLabeledDataSequence > lclCreateLabeledDataSequence(
@@ -623,4 +619,4 @@ Reference< XLabeledDataSequence > SeriesConverter::createLabeledDataSequence(
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/seriesmodel.cxx b/oox/source/drawingml/chart/seriesmodel.cxx
index 9db26a7225b2..16c302324cbc 100644
--- a/oox/source/drawingml/chart/seriesmodel.cxx
+++ b/oox/source/drawingml/chart/seriesmodel.cxx
@@ -156,4 +156,4 @@ SeriesModel::~SeriesModel()
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/titlecontext.cxx b/oox/source/drawingml/chart/titlecontext.cxx
index da314bf396c0..33bb914b6d99 100644
--- a/oox/source/drawingml/chart/titlecontext.cxx
+++ b/oox/source/drawingml/chart/titlecontext.cxx
@@ -27,21 +27,24 @@
************************************************************************/
#include "oox/drawingml/chart/titlecontext.hxx"
+
#include "oox/drawingml/shapepropertiescontext.hxx"
#include "oox/drawingml/textbodycontext.hxx"
#include "oox/drawingml/chart/datasourcecontext.hxx"
#include "oox/drawingml/chart/titlemodel.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandler2Helper;
-using ::oox::core::ContextHandlerRef;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using ::oox::core::ContextHandler2Helper;
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
+
TextContext::TextContext( ContextHandler2Helper& rParent, TextModel& rModel ) :
ContextBase< TextModel >( rParent, rModel )
{
@@ -53,34 +56,28 @@ TextContext::~TextContext()
ContextHandlerRef TextContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
{
- switch( getCurrentElement() )
+ // this context handler is used for <c:tx> and embedded <c:v> elements
+ if( isCurrentElement( C_TOKEN( tx ) ) ) switch( nElement )
{
- case C_TOKEN( tx ):
- switch( nElement )
- {
- case C_TOKEN( rich ):
- return new TextBodyContext( *this, mrModel.mxTextBody.create() );
- case C_TOKEN( strRef ):
- OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" );
- return new StringSequenceContext( *this, mrModel.mxDataSeq.create() );
- case C_TOKEN( v ):
- OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" );
- return this; // collect value in onEndElement()
- }
- break;
+ case C_TOKEN( rich ):
+ return new TextBodyContext( *this, mrModel.mxTextBody.create() );
+
+ case C_TOKEN( strRef ):
+ OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" );
+ return new StringSequenceContext( *this, mrModel.mxDataSeq.create() );
+
+ case C_TOKEN( v ):
+ OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" );
+ return this; // collect value in onCharacters()
}
return 0;
}
-void TextContext::onEndElement( const OUString& rChars )
+void TextContext::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
- {
- case C_TOKEN( v ):
- // store as single string sequence element
- mrModel.mxDataSeq.create().maData[ 0 ] <<= rChars;
- break;
- }
+ // store as single string sequence element
+ if( isCurrentElement( C_TOKEN( v ) ) )
+ mrModel.mxDataSeq.create().maData[ 0 ] <<= rChars;
}
// ============================================================================
@@ -96,25 +93,25 @@ TitleContext::~TitleContext()
ContextHandlerRef TitleContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- switch( getCurrentElement() )
+ // this context handler is used for <c:title> only
+ switch( nElement )
{
- case C_TOKEN( title ):
- switch( nElement )
- {
- case C_TOKEN( layout ):
- return new LayoutContext( *this, mrModel.mxLayout.create() );
- case C_TOKEN( overlay ):
- // default is 'false', not 'true' as specified
- mrModel.mbOverlay = rAttribs.getBool( XML_val, false );
- return 0;
- case C_TOKEN( spPr ):
- return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
- case C_TOKEN( tx ):
- return new TextContext( *this, mrModel.mxText.create() );
- case C_TOKEN( txPr ):
- return new TextBodyContext( *this, mrModel.mxTextProp.create() );
- }
- break;
+ case C_TOKEN( layout ):
+ return new LayoutContext( *this, mrModel.mxLayout.create() );
+
+ case C_TOKEN( overlay ):
+ // default is 'false', not 'true' as specified
+ mrModel.mbOverlay = rAttribs.getBool( XML_val, false );
+ return 0;
+
+ case C_TOKEN( spPr ):
+ return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
+
+ case C_TOKEN( tx ):
+ return new TextContext( *this, mrModel.mxText.create() );
+
+ case C_TOKEN( txPr ):
+ return new TextBodyContext( *this, mrModel.mxTextProp.create() );
}
return 0;
}
@@ -132,26 +129,26 @@ LegendContext::~LegendContext()
ContextHandlerRef LegendContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- switch( getCurrentElement() )
+ // this context handler is used for <c:legend> only
+ switch( nElement )
{
- case C_TOKEN( legend ):
- switch( nElement )
- {
- case C_TOKEN( layout ):
- return new LayoutContext( *this, mrModel.mxLayout.create() );
- case C_TOKEN( legendPos ):
- mrModel.mnPosition = rAttribs.getToken( XML_val, XML_r );
- return 0;
- case C_TOKEN( overlay ):
- // default is 'false', not 'true' as specified
- mrModel.mbOverlay = rAttribs.getBool( XML_val, false );
- return 0;
- case C_TOKEN( spPr ):
- return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
- case C_TOKEN( txPr ):
- return new TextBodyContext( *this, mrModel.mxTextProp.create() );
- }
- break;
+ case C_TOKEN( layout ):
+ return new LayoutContext( *this, mrModel.mxLayout.create() );
+
+ case C_TOKEN( legendPos ):
+ mrModel.mnPosition = rAttribs.getToken( XML_val, XML_r );
+ return 0;
+
+ case C_TOKEN( overlay ):
+ // default is 'false', not 'true' as specified
+ mrModel.mbOverlay = rAttribs.getBool( XML_val, false );
+ return 0;
+
+ case C_TOKEN( spPr ):
+ return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
+
+ case C_TOKEN( txPr ):
+ return new TextBodyContext( *this, mrModel.mxTextProp.create() );
}
return 0;
}
@@ -162,4 +159,4 @@ ContextHandlerRef LegendContext::onCreateContext( sal_Int32 nElement, const Attr
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx
index 1fe1556fd09a..b3134c283ce0 100644
--- a/oox/source/drawingml/chart/titleconverter.cxx
+++ b/oox/source/drawingml/chart/titleconverter.cxx
@@ -27,32 +27,19 @@
************************************************************************/
#include "oox/drawingml/chart/titleconverter.hxx"
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XFormattedString.hpp>
#include <com/sun/star/chart2/XLegend.hpp>
#include <com/sun/star/chart2/XTitle.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
-#include "properties.hxx"
#include "oox/drawingml/textbody.hxx"
#include "oox/drawingml/textparagraph.hxx"
#include "oox/drawingml/chart/datasourceconverter.hxx"
#include "oox/drawingml/chart/titlemodel.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::chart2::XDiagram;
-using ::com::sun::star::chart2::XFormattedString;
-using ::com::sun::star::chart2::XLegend;
-using ::com::sun::star::chart2::XTitle;
-using ::com::sun::star::chart2::XTitled;
-using ::com::sun::star::chart2::data::XDataSequence;
-using ::oox::core::XmlFilterBase;
+#include "oox/helper/containerhelper.hxx"
namespace oox {
namespace drawingml {
@@ -60,6 +47,16 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::XmlFilterBase;
+using ::rtl::OUString;
+
+// ============================================================================
+
TextConverter::TextConverter( const ConverterRoot& rParent, TextModel& rModel ) :
ConverterBase< TextModel >( rParent, rModel )
{
@@ -202,6 +199,7 @@ void LegendConverter::convertFromModel( const Reference< XDiagram >& rxDiagram )
{
if( rxDiagram.is() ) try
{
+ namespace cssc = ::com::sun::star::chart;
namespace cssc2 = ::com::sun::star::chart2;
// create the legend
@@ -215,46 +213,35 @@ void LegendConverter::convertFromModel( const Reference< XDiagram >& rxDiagram )
// predefined legend position and expansion
cssc2::LegendPosition eLegendPos = cssc2::LegendPosition_CUSTOM;
- cssc2::LegendExpansion eLegendExpand = cssc2::LegendExpansion_HIGH;
+ cssc::ChartLegendExpansion eLegendExpand = cssc::ChartLegendExpansion_CUSTOM;
switch( mrModel.mnPosition )
{
case XML_l:
eLegendPos = cssc2::LegendPosition_LINE_START;
- eLegendExpand = cssc2::LegendExpansion_HIGH;
+ eLegendExpand = cssc::ChartLegendExpansion_HIGH;
break;
case XML_r:
+ case XML_tr: // top-right not supported
eLegendPos = cssc2::LegendPosition_LINE_END;
- eLegendExpand = cssc2::LegendExpansion_HIGH;
+ eLegendExpand = cssc::ChartLegendExpansion_HIGH;
break;
case XML_t:
eLegendPos = cssc2::LegendPosition_PAGE_START;
- eLegendExpand = cssc2::LegendExpansion_WIDE;
+ eLegendExpand = cssc::ChartLegendExpansion_WIDE;
break;
case XML_b:
eLegendPos = cssc2::LegendPosition_PAGE_END;
- eLegendExpand = cssc2::LegendExpansion_WIDE;
- break;
- case XML_tr:
- eLegendPos = cssc2::LegendPosition_LINE_END; // top-right not supported
- eLegendExpand = cssc2::LegendExpansion_HIGH;
+ eLegendExpand = cssc::ChartLegendExpansion_WIDE;
break;
}
- // manual positioning
- LayoutModel& rLayout = mrModel.mxLayout.getOrCreate();
- LayoutConverter aLayoutConv( *this, rLayout );
- aLayoutConv.convertFromModel( aPropSet );
- Rectangle aLegendRect;
- if( aLayoutConv.calcAbsRectangle( aLegendRect ) )
+ // manual positioning and size
+ if( mrModel.mxLayout.get() )
{
- // #i71697# it is not possible to set the size directly, do some magic here
- double fRatio = static_cast< double >( aLegendRect.Width ) / aLegendRect.Height;
- if( fRatio > 1.5 )
- eLegendExpand = cssc2::LegendExpansion_WIDE;
- else if( fRatio < 0.75 )
- eLegendExpand = cssc2::LegendExpansion_HIGH;
- else
- eLegendExpand = cssc2::LegendExpansion_BALANCED;
+ LayoutConverter aLayoutConv( *this, *mrModel.mxLayout );
+ // manual size needs ChartLegendExpansion_CUSTOM
+ if( aLayoutConv.convertFromModel( aPropSet ) )
+ eLegendExpand = cssc::ChartLegendExpansion_CUSTOM;
}
// set position and expansion properties
@@ -272,4 +259,4 @@ void LegendConverter::convertFromModel( const Reference< XDiagram >& rxDiagram )
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/titlemodel.cxx b/oox/source/drawingml/chart/titlemodel.cxx
index 8a6d433fab9f..aef5bb02ce5f 100644
--- a/oox/source/drawingml/chart/titlemodel.cxx
+++ b/oox/source/drawingml/chart/titlemodel.cxx
@@ -71,4 +71,4 @@ LegendModel::~LegendModel()
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx
index 62892a3ab1b9..932cc1f09969 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -27,18 +27,21 @@
************************************************************************/
#include "oox/drawingml/chart/typegroupcontext.hxx"
+
#include "oox/drawingml/chart/seriescontext.hxx"
#include "oox/drawingml/chart/typegroupmodel.hxx"
-using ::oox::core::ContextHandler2Helper;
-using ::oox::core::ContextHandlerRef;
-
namespace oox {
namespace drawingml {
namespace chart {
// ============================================================================
+using ::oox::core::ContextHandler2Helper;
+using ::oox::core::ContextHandlerRef;
+
+// ============================================================================
+
UpDownBarsContext::UpDownBarsContext( ContextHandler2Helper& rParent, UpDownBarsModel& rModel ) :
ContextBase< UpDownBarsModel >( rParent, rModel )
{
@@ -401,4 +404,4 @@ ContextHandlerRef SurfaceTypeGroupContext::onCreateContext( sal_Int32 nElement,
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx
index 5be7af68ba38..d4ca5d9cc65d 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -27,6 +27,7 @@
************************************************************************/
#include "oox/drawingml/chart/typegroupconverter.hxx"
+
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart2/CurveStyle.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
@@ -40,23 +41,7 @@
#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/chart/seriesconverter.hxx"
#include "oox/drawingml/chart/typegroupmodel.hxx"
-#include "properties.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::chart2::XChartType;
-using ::com::sun::star::chart2::XChartTypeContainer;
-using ::com::sun::star::chart2::XCoordinateSystem;
-using ::com::sun::star::chart2::XDataSeries;
-using ::com::sun::star::chart2::XDataSeriesContainer;
-using ::com::sun::star::chart2::XDiagram;
-using ::com::sun::star::chart2::data::XDataSink;
-using ::com::sun::star::chart2::data::XLabeledDataSequence;
+#include "oox/helper/containerhelper.hxx"
namespace oox {
namespace drawingml {
@@ -64,6 +49,15 @@ namespace chart {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
// chart type service names
@@ -572,4 +566,4 @@ void TypeGroupConverter::insertDataSeries( const Reference< XChartType >& rxChar
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/chart/typegroupmodel.cxx b/oox/source/drawingml/chart/typegroupmodel.cxx
index 8ddc70704917..bba55670ac29 100644
--- a/oox/source/drawingml/chart/typegroupmodel.cxx
+++ b/oox/source/drawingml/chart/typegroupmodel.cxx
@@ -82,4 +82,4 @@ TypeGroupModel::~TypeGroupModel()
} // namespace drawingml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/drawingml/clrscheme.cxx b/oox/source/drawingml/clrscheme.cxx
index b7e558266372..776cbb1f7045 100644
--- a/oox/source/drawingml/clrscheme.cxx
+++ b/oox/source/drawingml/clrscheme.cxx
@@ -27,7 +27,7 @@
************************************************************************/
#include "oox/drawingml/clrscheme.hxx"
-#include "tokens.hxx"
+#include "oox/token/tokens.hxx"
namespace oox { namespace drawingml {
diff --git a/oox/source/drawingml/clrschemecontext.cxx b/oox/source/drawingml/clrschemecontext.cxx
index 7f90cc4aa263..3355b95e8e04 100644
--- a/oox/source/drawingml/clrschemecontext.cxx
+++ b/oox/source/drawingml/clrschemecontext.cxx
@@ -27,9 +27,7 @@
************************************************************************/
#include "oox/drawingml/clrschemecontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
-#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
@@ -100,7 +98,7 @@ Reference< XFastContextHandler > clrSchemeContext::createFastChildContext(
case A_TOKEN( accent6 ):
case A_TOKEN( hlink ):
case A_TOKEN( folHlink ):
- return new clrSchemeColorContext( *this, mrClrScheme, getToken( nElement ) );
+ return new clrSchemeColorContext( *this, mrClrScheme, getBaseToken( nElement ) );
}
return 0;
}
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index 70f4d54e99ca..b305e65ce083 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -29,11 +29,11 @@
#include "oox/drawingml/color.hxx"
#include <algorithm>
#include <math.h>
-#include "tokens.hxx"
#include "oox/helper/containerhelper.hxx"
#include "oox/helper/graphichelper.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/token/namespaces.hxx"
+#include "oox/token/tokens.hxx"
using ::rtl::OUString;
@@ -315,7 +315,7 @@ void Color::addTransformation( sal_Int32 nElement, sal_Int32 nValue )
/* Execute alpha transformations directly, store other transformations in
a vector, they may depend on a scheme base color which will be resolved
in Color::getColor(). */
- sal_Int32 nToken = getToken( nElement );
+ sal_Int32 nToken = getBaseToken( nElement );
switch( nToken )
{
case XML_alpha: lclSetValue( mnAlpha, nValue ); break;
@@ -337,7 +337,7 @@ void Color::addChartTintTransformation( double fTint )
void Color::addExcelTintTransformation( double fTint )
{
sal_Int32 nValue = getLimitedValue< sal_Int32, double >( fTint * MAX_PERCENT + 0.5, -MAX_PERCENT, MAX_PERCENT );
- maTransforms.push_back( Transformation( NMSP_XLS | XML_tint, nValue ) );
+ maTransforms.push_back( Transformation( XLS_TOKEN( tint ), nValue ) );
}
void Color::clearTransformations()
diff --git a/oox/source/drawingml/colorchoicecontext.cxx b/oox/source/drawingml/colorchoicecontext.cxx
index d2d3ddbf40e9..3bc48cbba4e3 100644
--- a/oox/source/drawingml/colorchoicecontext.cxx
+++ b/oox/source/drawingml/colorchoicecontext.cxx
@@ -28,7 +28,6 @@
#include "oox/drawingml/colorchoicecontext.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/color.hxx"
using ::com::sun::star::uno::Reference;
diff --git a/oox/source/drawingml/connectorshapecontext.cxx b/oox/source/drawingml/connectorshapecontext.cxx
index 33a2331e334d..3028608d4f11 100644
--- a/oox/source/drawingml/connectorshapecontext.cxx
+++ b/oox/source/drawingml/connectorshapecontext.cxx
@@ -36,8 +36,6 @@
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/customshapegeometry.hxx"
#include "oox/drawingml/textbodycontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace oox::core;
@@ -64,7 +62,7 @@ Reference< XFastContextHandler > ConnectorShapeContext::createFastChildContext(
{
Reference< XFastContextHandler > xRet;
- switch( getToken( aElementToken ) )
+ switch( getBaseToken( aElementToken ) )
{
case XML_nvCxnSpPr :
break;
diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx
index 1691aae3af25..1c1b824da7de 100644
--- a/oox/source/drawingml/customshapegeometry.cxx
+++ b/oox/source/drawingml/customshapegeometry.cxx
@@ -33,10 +33,7 @@
#include <boost/unordered_map.hpp>
#include "oox/helper/helper.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/token/tokenmap.hxx"
#include "oox/helper/propertymap.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -244,7 +241,7 @@ static EnhancedCustomShapeParameter GetAdjCoordinate( CustomShapeProperties& rCu
sal_Char nVal = 0;
// first check if its a constant value
- switch( StaticTokenMap::get().getTokenFromUnicode( rValue ) )
+ switch( AttributeConversion::decodeToken( rValue ) )
{
case XML_3cd4 : nConstant = 270 * 60000; break;
case XML_3cd8 : nConstant = 135 * 60000; break;
@@ -632,7 +629,7 @@ static rtl::OUString convertToOOEquation( CustomShapeProperties& rCustomShapePro
Reference< XFastContextHandler > GeomGuideListContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
- if ( aElementToken == ( NMSP_DRAWINGML | XML_gd ) ) // CT_GeomGuide
+ if ( aElementToken == A_TOKEN( gd ) ) // CT_GeomGuide
{
CustomShapeGuide aGuide;
aGuide.maName = xAttribs->getOptionalValue( XML_name );
@@ -713,7 +710,7 @@ XYAdjustHandleContext::XYAdjustHandleContext( ContextHandler& rParent, const Ref
Reference< XFastContextHandler > XYAdjustHandleContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_pos ) )
+ if ( aElementToken == A_TOKEN( pos ) )
xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjustHandle.pos ); // CT_AdjPoint2D
return xContext;
}
@@ -767,7 +764,7 @@ PolarAdjustHandleContext::PolarAdjustHandleContext( ContextHandler& rParent, con
Reference< XFastContextHandler > PolarAdjustHandleContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_pos ) )
+ if ( aElementToken == A_TOKEN( pos ) )
xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjustHandle.pos ); // CT_AdjPoint2D
return xContext;
}
@@ -795,13 +792,13 @@ AdjustHandleListContext::AdjustHandleListContext( ContextHandler& rParent, Custo
Reference< XFastContextHandler > AdjustHandleListContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_ahXY ) ) // CT_XYAdjustHandle
+ if ( aElementToken == A_TOKEN( ahXY ) ) // CT_XYAdjustHandle
{
AdjustHandle aAdjustHandle( sal_False );
mrAdjustHandleList.push_back( aAdjustHandle );
xContext = new XYAdjustHandleContext( *this, xAttribs, mrCustomShapeProperties, mrAdjustHandleList.back() );
}
- else if ( aElementToken == ( NMSP_DRAWINGML | XML_ahPolar ) ) // CT_PolarAdjustHandle
+ else if ( aElementToken == A_TOKEN( ahPolar ) ) // CT_PolarAdjustHandle
{
AdjustHandle aAdjustHandle( sal_True );
mrAdjustHandleList.push_back( aAdjustHandle );
@@ -834,7 +831,7 @@ ConnectionSiteContext::ConnectionSiteContext( ContextHandler& rParent, const Ref
Reference< XFastContextHandler > ConnectionSiteContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_pos ) )
+ if ( aElementToken == A_TOKEN( pos ) )
xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrConnectionSite.pos ); // CT_AdjPoint2D
return xContext;
}
@@ -862,7 +859,7 @@ Path2DMoveToContext::Path2DMoveToContext( ContextHandler& rParent, CustomShapePr
Reference< XFastContextHandler > Path2DMoveToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) )
+ if ( aElementToken == A_TOKEN( pt ) )
xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjPoint2D ); // CT_AdjPoint2D
return xContext;
}
@@ -890,7 +887,7 @@ Path2DLineToContext::Path2DLineToContext( ContextHandler& rParent, CustomShapePr
Reference< XFastContextHandler > Path2DLineToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) )
+ if ( aElementToken == A_TOKEN( pt ) )
xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, mrAdjPoint2D ); // CT_AdjPoint2D
return xContext;
}
@@ -925,7 +922,7 @@ Path2DQuadBezierToContext::Path2DQuadBezierToContext( ContextHandler& rParent,
Reference< XFastContextHandler > Path2DQuadBezierToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) )
+ if ( aElementToken == A_TOKEN( pt ) )
xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties, nCount++ ? mrPt2 : mrPt1 ); // CT_AdjPoint2D
return xContext;
}
@@ -963,7 +960,7 @@ Path2DCubicBezierToContext::Path2DCubicBezierToContext( ContextHandler& rParent,
Reference< XFastContextHandler > Path2DCubicBezierToContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_pt ) )
+ if ( aElementToken == A_TOKEN( pt ) )
xContext = new AdjPoint2DContext( *this, xAttribs, mrCustomShapeProperties,
nCount++ ? nCount == 2 ? mrControlPt2 : mrEndPt : mrControlPt1 ); // CT_AdjPoint2D
return xContext;
@@ -1022,7 +1019,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3
Reference< XFastContextHandler > xContext;
switch( aElementToken )
{
- case NMSP_DRAWINGML | XML_close :
+ case A_TOKEN( close ) :
{
EnhancedCustomShapeSegment aNewSegment;
aNewSegment.Command = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH;
@@ -1030,7 +1027,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3
mrSegments.push_back( aNewSegment );
}
break;
- case NMSP_DRAWINGML | XML_moveTo :
+ case A_TOKEN( moveTo ) :
{
EnhancedCustomShapeSegment aNewSegment;
aNewSegment.Command = EnhancedCustomShapeSegmentCommand::MOVETO;
@@ -1042,7 +1039,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3
xContext = new Path2DMoveToContext( *this, mrCustomShapeProperties, mrPath2D.parameter.back() );
}
break;
- case NMSP_DRAWINGML | XML_lnTo :
+ case A_TOKEN( lnTo ) :
{
if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::LINETO ) )
@@ -1059,7 +1056,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3
xContext = new Path2DLineToContext( *this, mrCustomShapeProperties, mrPath2D.parameter.back() );
}
break;
- case NMSP_DRAWINGML | XML_arcTo : // CT_Path2DArcTo
+ case A_TOKEN( arcTo ) : // CT_Path2DArcTo
{
if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::ARCTO ) )
mrSegments.back().Count++;
@@ -1085,7 +1082,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3
mrPath2D.parameter.push_back( aPt );
}
break;
- case NMSP_DRAWINGML | XML_quadBezTo :
+ case A_TOKEN( quadBezTo ) :
{
if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::QUADRATICCURVETO ) )
mrSegments.back().Count++;
@@ -1105,7 +1102,7 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3
mrPath2D.parameter.back() );
}
break;
- case NMSP_DRAWINGML | XML_cubicBezTo :
+ case A_TOKEN( cubicBezTo ) :
{
if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::CURVETO ) )
mrSegments.back().Count++;
@@ -1161,7 +1158,7 @@ Path2DListContext::Path2DListContext( ContextHandler& rParent, CustomShapeProper
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL Path2DListContext::createFastChildContext( sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
{
Reference< XFastContextHandler > xContext;
- if ( aElementToken == ( NMSP_DRAWINGML | XML_path ) )
+ if ( aElementToken == A_TOKEN( path ) )
{
Path2D aPath2D;
mrPath2DList.push_back( aPath2D );
@@ -1984,19 +1981,19 @@ Reference< XFastContextHandler > CustomShapeGeometryContext::createFastChildCont
Reference< XFastContextHandler > xContext;
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_avLst: // CT_GeomGuideList adjust value list
+ case A_TOKEN( avLst ): // CT_GeomGuideList adjust value list
xContext = new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() );
break;
- case NMSP_DRAWINGML|XML_gdLst: // CT_GeomGuideList guide list
+ case A_TOKEN( gdLst ): // CT_GeomGuideList guide list
xContext = new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getGuideList() );
break;
- case NMSP_DRAWINGML|XML_ahLst: // CT_AdjustHandleList adjust handle list
+ case A_TOKEN( ahLst ): // CT_AdjustHandleList adjust handle list
xContext = new AdjustHandleListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustHandleList() );
break;
- case NMSP_DRAWINGML|XML_cxnLst: // CT_ConnectionSiteList connection site list
+ case A_TOKEN( cxnLst ): // CT_ConnectionSiteList connection site list
xContext = this;
break;
- case NMSP_DRAWINGML|XML_rect: // CT_GeomRectList geometry rect list
+ case A_TOKEN( rect ): // CT_GeomRectList geometry rect list
{
GeomRect aGeomRect;
aGeomRect.l = GetAdjCoordinate( mrCustomShapeProperties, xAttribs->getOptionalValue( XML_l ), sal_True );
@@ -2006,12 +2003,12 @@ Reference< XFastContextHandler > CustomShapeGeometryContext::createFastChildCont
mrCustomShapeProperties.getTextRect() = aGeomRect;
}
break;
- case NMSP_DRAWINGML|XML_pathLst: // CT_Path2DList 2d path list
+ case A_TOKEN( pathLst ): // CT_Path2DList 2d path list
xContext = new Path2DListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getSegments(), mrCustomShapeProperties.getPath2DList() );
break;
// from cxnLst:
- case NMSP_DRAWINGML|XML_cxn: // CT_ConnectionSite
+ case A_TOKEN( cxn ): // CT_ConnectionSite
{
ConnectionSite aConnectionSite;
mrCustomShapeProperties.getConnectionSiteList().push_back( aConnectionSite );
@@ -2038,7 +2035,7 @@ PresetShapeGeometryContext::PresetShapeGeometryContext( ContextHandler& rParent,
Reference< XFastContextHandler > PresetShapeGeometryContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& ) throw (SAXException, RuntimeException)
{
- if ( aElementToken == ( NMSP_DRAWINGML | XML_avLst ) )
+ if ( aElementToken == A_TOKEN( avLst ) )
return new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() );
else
return this;
@@ -2060,7 +2057,7 @@ PresetTextShapeContext::PresetTextShapeContext( ContextHandler& rParent, const R
Reference< XFastContextHandler > PresetTextShapeContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& ) throw (SAXException, RuntimeException)
{
- if ( aElementToken == ( NMSP_DRAWINGML | XML_avLst ) )
+ if ( aElementToken == A_TOKEN( avLst ) )
return new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() );
else
return this;
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index c1bd6324462a..c1178e307b54 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -30,9 +30,6 @@
#include "oox/helper/helper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/core/namespaces.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
diff --git a/oox/source/drawingml/diagram/datamodelcontext.cxx b/oox/source/drawingml/diagram/datamodelcontext.cxx
index d7c88b69af89..230edf59ea67 100644
--- a/oox/source/drawingml/diagram/datamodelcontext.cxx
+++ b/oox/source/drawingml/diagram/datamodelcontext.cxx
@@ -28,7 +28,6 @@
#include "oox/drawingml/diagram/datamodelcontext.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/shapepropertiescontext.hxx"
#include "oox/drawingml/textbodycontext.hxx"
@@ -40,8 +39,6 @@ using ::rtl::OUString;
namespace oox { namespace drawingml {
-
-
// CL_Cxn
class CxnContext
: public ContextHandler
@@ -74,7 +71,7 @@ public:
switch( aElementToken )
{
- case NMSP_DIAGRAM|XML_extLst:
+ case DGM_TOKEN( extLst ):
return xRet;
default:
break;
@@ -107,7 +104,7 @@ public:
switch( aElementToken )
{
- case NMSP_DIAGRAM|XML_cxn:
+ case DGM_TOKEN( cxn ):
{
dgm::ConnectionPtr pConnection( new dgm::Connection() );
maConnections.push_back( pConnection );
@@ -162,17 +159,17 @@ public:
switch( aElementToken )
{
- case NMSP_DIAGRAM|XML_extLst:
+ case DGM_TOKEN( extLst ):
return xRet;
- case NMSP_DIAGRAM|XML_prSet:
+ case DGM_TOKEN( prSet ):
// TODO
// CT_ElemPropSet
break;
- case NMSP_DIAGRAM|XML_spPr:
+ case DGM_TOKEN( spPr ):
OSL_TRACE( "shape props for point");
xRet = new ShapePropertiesContext( *this, *mpPoint->getShape() );
break;
- case NMSP_DIAGRAM|XML_t:
+ case DGM_TOKEN( t ):
{
OSL_TRACE( "shape text body for point");
TextBodyPtr xTextBody( new TextBody );
@@ -213,7 +210,7 @@ public:
switch( aElementToken )
{
- case NMSP_DIAGRAM|XML_pt:
+ case DGM_TOKEN( pt ):
{
// CT_Pt
dgm::PointPtr pPoint( new dgm::Point() );
@@ -254,18 +251,18 @@ public:
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_blipFill:
- case NMSP_DRAWINGML|XML_gradFill:
- case NMSP_DRAWINGML|XML_grpFill:
- case NMSP_DRAWINGML|XML_noFill:
- case NMSP_DRAWINGML|XML_pattFill:
- case NMSP_DRAWINGML|XML_solidFill:
+ case A_TOKEN( blipFill ):
+ case A_TOKEN( gradFill ):
+ case A_TOKEN( grpFill ):
+ case A_TOKEN( noFill ):
+ case A_TOKEN( pattFill ):
+ case A_TOKEN( solidFill ):
// EG_FillProperties
xRet.set( FillPropertiesContext::createFillContext(
*this, aElementToken, xAttribs, *mpDataModel->getFillProperties() ) );
break;
- case NMSP_DRAWINGML|XML_effectDag:
- case NMSP_DRAWINGML|XML_effectLst:
+ case A_TOKEN( effectDag ):
+ case A_TOKEN( effectLst ):
// TODO
// EG_EffectProperties
break;
@@ -307,23 +304,23 @@ DataModelContext::createFastChildContext( ::sal_Int32 aElement,
switch( aElement )
{
- case NMSP_DIAGRAM|XML_cxnLst:
+ case DGM_TOKEN( cxnLst ):
// CT_CxnList
xRet.set( new CxnListContext( *this, mpDataModel->getConnections() ) );
break;
- case NMSP_DIAGRAM|XML_ptLst:
+ case DGM_TOKEN( ptLst ):
// CT_PtList
xRet.set( new PtListContext( *this, mpDataModel->getPoints() ) );
break;
- case NMSP_DIAGRAM|XML_bg:
+ case DGM_TOKEN( bg ):
// CT_BackgroundFormatting
xRet.set( new BackgroundFormattingContext( *this, mpDataModel ) );
break;
- case NMSP_DIAGRAM|XML_whole:
+ case DGM_TOKEN( whole ):
// CT_WholeE2oFormatting
// TODO
return xRet;
- case NMSP_DIAGRAM|XML_extLst:
+ case DGM_TOKEN( extLst ):
return xRet;
default:
break;
diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx
index 2a37b41fbb09..30c6e5b78134 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -34,8 +34,6 @@
#include <com/sun/star/awt/Size.hpp>
#include "oox/drawingml/diagram/diagram.hxx"
#include "oox/drawingml/fillproperties.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::com::sun::star;
diff --git a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx
index d14535df509b..a405926761c1 100644
--- a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx
+++ b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx
@@ -27,11 +27,9 @@
************************************************************************/
#include "diagramdefinitioncontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/helper.hxx"
#include "layoutnodecontext.hxx"
#include "oox/drawingml/diagram/datamodelcontext.hxx"
-#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
@@ -81,29 +79,29 @@ DiagramDefinitionContext::createFastChildContext( ::sal_Int32 aElement,
switch( aElement )
{
- case NMSP_DIAGRAM|XML_title:
+ case DGM_TOKEN( title ):
mpLayout->setTitle( xAttribs->getOptionalValue( XML_val ) );
break;
- case NMSP_DIAGRAM|XML_desc:
+ case DGM_TOKEN( desc ):
mpLayout->setDesc( xAttribs->getOptionalValue( XML_val ) );
break;
- case NMSP_DIAGRAM|XML_layoutNode:
+ case DGM_TOKEN( layoutNode ):
mpLayout->getNode().reset( new LayoutNode() );
xRet.set( new LayoutNodeContext( *this, xAttribs, mpLayout->getNode() ) );
break;
- case NMSP_DIAGRAM|XML_clrData:
+ case DGM_TOKEN( clrData ):
// TODO, does not matter for the UI. skip.
return xRet;
- case NMSP_DIAGRAM|XML_sampData:
+ case DGM_TOKEN( sampData ):
mpLayout->getSampData().reset( new DiagramData );
xRet.set( new DataModelContext( *this, mpLayout->getSampData() ) );
break;
- case NMSP_DIAGRAM|XML_styleData:
+ case DGM_TOKEN( styleData ):
mpLayout->getStyleData().reset( new DiagramData );
xRet.set( new DataModelContext( *this, mpLayout->getStyleData() ) );
break;
- case NMSP_DIAGRAM|XML_cat:
- case NMSP_DIAGRAM|XML_catLst:
+ case DGM_TOKEN( cat ):
+ case DGM_TOKEN( catLst ):
// TODO, does not matter for the UI
default:
break;
diff --git a/oox/source/drawingml/diagram/diagramfragmenthandler.cxx b/oox/source/drawingml/diagram/diagramfragmenthandler.cxx
index a739a0095a5f..5d905bcbf384 100644
--- a/oox/source/drawingml/diagram/diagramfragmenthandler.cxx
+++ b/oox/source/drawingml/diagram/diagramfragmenthandler.cxx
@@ -30,9 +30,7 @@
#include "oox/drawingml/diagram/diagramfragmenthandler.hxx"
#include "oox/drawingml/diagram/datamodelcontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "diagramdefinitioncontext.hxx"
-#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::xml::sax;
@@ -71,7 +69,7 @@ DiagramDataFragmentHandler::createFastChildContext( ::sal_Int32 aElement,
switch( aElement )
{
- case NMSP_DIAGRAM|XML_dataModel:
+ case DGM_TOKEN( dataModel ):
xRet.set( new DataModelContext( *this, mpDataPtr ) );
break;
default:
@@ -116,7 +114,7 @@ DiagramLayoutFragmentHandler::createFastChildContext( ::sal_Int32 aElement,
switch( aElement )
{
- case NMSP_DIAGRAM|XML_layoutDef:
+ case DGM_TOKEN( layoutDef ):
xRet.set( new DiagramDefinitionContext( *this, xAttribs, mpDataPtr ) );
break;
default:
@@ -161,7 +159,7 @@ DiagramQStylesFragmentHandler::createFastChildContext( ::sal_Int32 aElement,
switch( aElement )
{
- case NMSP_DIAGRAM|XML_styleDef:
+ case DGM_TOKEN( styleDef ):
// TODO
break;
default:
@@ -206,7 +204,7 @@ DiagramColorsFragmentHandler::createFastChildContext( ::sal_Int32 aElement,
switch( aElement )
{
- case NMSP_DIAGRAM|XML_colorsDef:
+ case DGM_TOKEN( colorsDef ):
// TODO
break;
default:
diff --git a/oox/source/drawingml/diagram/layoutnodecontext.cxx b/oox/source/drawingml/diagram/layoutnodecontext.cxx
index 61213b5afa4c..45bd03024c94 100644
--- a/oox/source/drawingml/diagram/layoutnodecontext.cxx
+++ b/oox/source/drawingml/diagram/layoutnodecontext.cxx
@@ -29,7 +29,6 @@
#include "layoutnodecontext.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/diagram/diagram.hxx"
#include "oox/drawingml/shapecontext.hxx"
#include "diagramdefinitioncontext.hxx"
@@ -179,7 +178,7 @@ public:
{
Reference< XFastContextHandler > xRet;
- sal_Int32 nIdx = LayoutNodeContext::tagToVarIdx( getToken( aElement ) );
+ sal_Int32 nIdx = LayoutNodeContext::tagToVarIdx( getBaseToken( aElement ) );
if( nIdx != -1 )
{
mVariables[ nIdx ] = makeAny( xAttribs->getOptionalValue( XML_val ) );
@@ -230,31 +229,31 @@ sal_Int32 LayoutNodeContext::tagToVarIdx( sal_Int32 aTag )
sal_Int32 nIdx = -1;
switch( aTag )
{
- case NMSP_DIAGRAM|XML_animLvl:
+ case DGM_TOKEN( animLvl ):
nIdx = LayoutNode::VAR_animLvl;
break;
- case NMSP_DIAGRAM|XML_animOne:
+ case DGM_TOKEN( animOne ):
nIdx = LayoutNode::VAR_animOne;
break;
- case NMSP_DIAGRAM|XML_bulletEnabled:
+ case DGM_TOKEN( bulletEnabled ):
nIdx = LayoutNode::VAR_bulletEnabled;
break;
- case NMSP_DIAGRAM|XML_chMax:
+ case DGM_TOKEN( chMax ):
nIdx = LayoutNode::VAR_chMax;
break;
- case NMSP_DIAGRAM|XML_chPref:
+ case DGM_TOKEN( chPref ):
nIdx = LayoutNode::VAR_chPref;
break;
- case NMSP_DIAGRAM|XML_dir:
+ case DGM_TOKEN( dir ):
nIdx = LayoutNode::VAR_dir;
break;
- case NMSP_DIAGRAM|XML_hierBranch:
+ case DGM_TOKEN( hierBranch ):
nIdx = LayoutNode::VAR_hierBranch;
break;
- case NMSP_DIAGRAM|XML_orgChart:
+ case DGM_TOKEN( orgChart ):
nIdx = LayoutNode::VAR_orgChart;
break;
- case NMSP_DIAGRAM|XML_resizeHandles:
+ case DGM_TOKEN( resizeHandles ):
nIdx = LayoutNode::VAR_resizeHandles;
break;
default:
@@ -273,22 +272,22 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement,
switch( aElement )
{
- case NMSP_DIAGRAM|XML_layoutNode:
+ case DGM_TOKEN( layoutNode ):
{
LayoutNodePtr pNode( new LayoutNode() );
mpNode->addChild( pNode );
xRet.set( new LayoutNodeContext( *this, xAttribs, pNode ) );
break;
}
- case NMSP_DIAGRAM|XML_shape:
+ case DGM_TOKEN( shape ):
{
ShapePtr pShape( new Shape() );
xRet.set( new ShapeContext( *this, ShapePtr(), pShape ) );
break;
}
- case NMSP_DIAGRAM|XML_extLst:
+ case DGM_TOKEN( extLst ):
return xRet;
- case NMSP_DIAGRAM|XML_alg:
+ case DGM_TOKEN( alg ):
{
// CT_Algorithm
LayoutAtomPtr pAtom( new AlgAtom );
@@ -296,7 +295,7 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement,
xRet.set( new AlgorithmContext( *this, xAttribs, pAtom ) );
break;
}
- case NMSP_DIAGRAM|XML_choose:
+ case DGM_TOKEN( choose ):
{
// CT_Choose
LayoutAtomPtr pAtom( new ChooseAtom );
@@ -304,7 +303,7 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement,
xRet.set( new ChooseContext( *this, xAttribs, pAtom ) );
break;
}
- case NMSP_DIAGRAM|XML_forEach:
+ case DGM_TOKEN( forEach ):
{
// CT_ForEach
LayoutAtomPtr pAtom( new ForEachAtom );
@@ -312,11 +311,11 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement,
xRet.set( new ForEachContext( *this, xAttribs, pAtom ) );
break;
}
- case NMSP_DIAGRAM|XML_constrLst:
+ case DGM_TOKEN( constrLst ):
// CT_Constraints
// TODO
break;
- case NMSP_DIAGRAM|XML_presOf:
+ case DGM_TOKEN( presOf ):
{
// CT_PresentationOf
// TODO
@@ -328,11 +327,11 @@ LayoutNodeContext::createFastChildContext( ::sal_Int32 aElement,
xAttribs->getOptionalValue( XML_step );
break;
}
- case NMSP_DIAGRAM|XML_ruleLst:
+ case DGM_TOKEN( ruleLst ):
// CT_Rules
// TODO
break;
- case NMSP_DIAGRAM|XML_varLst:
+ case DGM_TOKEN( varLst ):
{
LayoutNodePtr pNode( boost::dynamic_pointer_cast< LayoutNode >( mpNode ) );
if( pNode )
diff --git a/oox/source/drawingml/drawingmltypes.cxx b/oox/source/drawingml/drawingmltypes.cxx
index 2b0eeae3273f..915a3146dd3d 100644
--- a/oox/source/drawingml/drawingmltypes.cxx
+++ b/oox/source/drawingml/drawingmltypes.cxx
@@ -32,7 +32,7 @@
#include <com/sun/star/style/CaseMap.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <sax/tools/converter.hxx>
-#include "tokens.hxx"
+#include "oox/token/tokens.hxx"
using ::rtl::OUString;
using ::com::sun::star::uno::Reference;
diff --git a/oox/source/drawingml/embeddedwavaudiofile.cxx b/oox/source/drawingml/embeddedwavaudiofile.cxx
index b3ee74f37d72..2edea7949711 100644
--- a/oox/source/drawingml/embeddedwavaudiofile.cxx
+++ b/oox/source/drawingml/embeddedwavaudiofile.cxx
@@ -28,9 +28,6 @@
#include "oox/drawingml/embeddedwavaudiofile.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
-
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -47,7 +44,7 @@ namespace oox { namespace drawingml {
{
AttributeList attribs(xAttribs);
- OUString sId = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_embed );
+ OUString sId = xAttribs->getOptionalValue( R_TOKEN( embed ) );
aAudio.msEmbed = rRelations.getFragmentPathFromRelId( sId );
aAudio.mbBuiltIn = attribs.getBool( XML_builtIn, false );
aAudio.msName = xAttribs->getOptionalValue( XML_name );
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index e7351424d924..f1abd70f0a09 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -30,19 +30,19 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/Gradient.hpp>
+#include <com/sun/star/text/GraphicCrop.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/drawing/BitmapMode.hpp>
#include <com/sun/star/drawing/ColorMode.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/RectanglePoint.hpp>
#include <com/sun/star/graphic/XGraphicTransformer.hpp>
-#include "properties.hxx"
-#include "tokens.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/helper/modelobjecthelper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/token/tokens.hxx"
using namespace ::com::sun::star;
using namespace ::com::sun::star::drawing;
@@ -436,6 +436,26 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe
OUString aGraphicUrl = rGraphicHelper.createGraphicObject( xGraphic );
if( aGraphicUrl.getLength() > 0 )
rPropMap[ PROP_GraphicURL ] <<= aGraphicUrl;
+
+ // cropping
+ if ( maBlipProps.moClipRect.has() )
+ {
+ geometry::IntegerRectangle2D oClipRect( maBlipProps.moClipRect.get() );
+ awt::Size aOriginalSize( rGraphicHelper.getOriginalSize( xGraphic ) );
+ if ( aOriginalSize.Width && aOriginalSize.Height )
+ {
+ text::GraphicCrop aGraphCrop( 0, 0, 0, 0 );
+ if ( oClipRect.X1 )
+ aGraphCrop.Left = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Width ) * oClipRect.X1 ) / 100000 );
+ if ( oClipRect.Y1 )
+ aGraphCrop.Top = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Height ) * oClipRect.Y1 ) / 100000 );
+ if ( oClipRect.X2 )
+ aGraphCrop.Right = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Width ) * oClipRect.X2 ) / 100000 );
+ if ( oClipRect.Y2 )
+ aGraphCrop.Bottom = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Height ) * oClipRect.Y2 ) / 100000 );
+ rPropMap[ PROP_GraphicCrop ] <<= aGraphCrop;
+ }
+ }
}
// color effect
diff --git a/oox/source/drawingml/fillpropertiesgroupcontext.cxx b/oox/source/drawingml/fillpropertiesgroupcontext.cxx
index ea2b9f30ce54..82a2f5906923 100644
--- a/oox/source/drawingml/fillpropertiesgroupcontext.cxx
+++ b/oox/source/drawingml/fillpropertiesgroupcontext.cxx
@@ -29,7 +29,6 @@
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/graphichelper.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/fillproperties.hxx"
@@ -191,7 +190,7 @@ Reference< XFastContextHandler > BlipContext::createFastChildContext(
{
case A_TOKEN( biLevel ):
case A_TOKEN( grayscl ):
- mrBlipProps.moColorEffect = getToken( nElement );
+ mrBlipProps.moColorEffect = getBaseToken( nElement );
break;
case A_TOKEN( clrChange ):
@@ -226,11 +225,19 @@ Reference< XFastContextHandler > BlipFillContext::createFastChildContext(
return new BlipContext( *this, rxAttribs, mrBlipProps );
case A_TOKEN( srcRect ):
- // TODO
+ {
+ rtl::OUString aDefault( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "0" ) ) );
+ ::com::sun::star::geometry::IntegerRectangle2D aClipRect;
+ aClipRect.X1 = GetPercent( aAttribs.getString( XML_l, aDefault ) );
+ aClipRect.Y1 = GetPercent( aAttribs.getString( XML_t, aDefault ) );
+ aClipRect.X2 = GetPercent( aAttribs.getString( XML_r, aDefault ) );
+ aClipRect.Y2 = GetPercent( aAttribs.getString( XML_b, aDefault ) );
+ mrBlipProps.moClipRect = aClipRect;
+ }
break;
case A_TOKEN( tile ):
- mrBlipProps.moBitmapMode = getToken( nElement );
+ mrBlipProps.moBitmapMode = getBaseToken( nElement );
mrBlipProps.moTileOffsetX = aAttribs.getInteger( XML_tx );
mrBlipProps.moTileOffsetY = aAttribs.getInteger( XML_ty );
mrBlipProps.moTileScaleX = aAttribs.getInteger( XML_sx );
@@ -240,7 +247,7 @@ Reference< XFastContextHandler > BlipFillContext::createFastChildContext(
break;
case A_TOKEN( stretch ):
- mrBlipProps.moBitmapMode = getToken( nElement );
+ mrBlipProps.moBitmapMode = getBaseToken( nElement );
return this; // for fillRect element
case A_TOKEN( fillRect ):
@@ -272,12 +279,12 @@ Reference< XFastContextHandler > FillPropertiesContext::createFastChildContext(
{
switch( nElement )
{
- case A_TOKEN( noFill ): { rFillProps.moFillType = getToken( nElement ); return 0; };
- case A_TOKEN( solidFill ): { rFillProps.moFillType = getToken( nElement ); return new SolidFillContext( rParent, rxAttribs, rFillProps ); };
- case A_TOKEN( gradFill ): { rFillProps.moFillType = getToken( nElement ); return new GradientFillContext( rParent, rxAttribs, rFillProps.maGradientProps ); };
- case A_TOKEN( pattFill ): { rFillProps.moFillType = getToken( nElement ); return new PatternFillContext( rParent, rxAttribs, rFillProps.maPatternProps ); };
- case A_TOKEN( blipFill ): { rFillProps.moFillType = getToken( nElement ); return new BlipFillContext( rParent, rxAttribs, rFillProps.maBlipProps ); };
- case A_TOKEN( grpFill ): { rFillProps.moFillType = getToken( nElement ); return 0; }; // TODO
+ case A_TOKEN( noFill ): { rFillProps.moFillType = getBaseToken( nElement ); return 0; };
+ case A_TOKEN( solidFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new SolidFillContext( rParent, rxAttribs, rFillProps ); };
+ case A_TOKEN( gradFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new GradientFillContext( rParent, rxAttribs, rFillProps.maGradientProps ); };
+ case A_TOKEN( pattFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new PatternFillContext( rParent, rxAttribs, rFillProps.maPatternProps ); };
+ case A_TOKEN( blipFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new BlipFillContext( rParent, rxAttribs, rFillProps.maBlipProps ); };
+ case A_TOKEN( grpFill ): { rFillProps.moFillType = getBaseToken( nElement ); return 0; }; // TODO
}
return 0;
}
diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx
index bf29d6078192..5df5c45de1c3 100644
--- a/oox/source/drawingml/graphicshapecontext.cxx
+++ b/oox/source/drawingml/graphicshapecontext.cxx
@@ -28,13 +28,11 @@
#include "oox/drawingml/graphicshapecontext.hxx"
#include <osl/diagnose.h>
-#include <com/sun/star/chart2/XChartDocument.hpp>
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/customshapeproperties.hxx"
#include "oox/drawingml/diagram/diagramfragmenthandler.hxx"
#include "oox/drawingml/table/tablecontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/graphichelper.hxx"
@@ -42,14 +40,8 @@
#include "oox/vml/vmldrawing.hxx"
#include "oox/vml/vmlshape.hxx"
#include "oox/vml/vmlshapecontainer.hxx"
-#include "oox/ole/oleobjecthelper.hxx"
#include "oox/drawingml/fillproperties.hxx"
#include "oox/drawingml/transform2dcontext.hxx"
-#include "oox/drawingml/chart/chartconverter.hxx"
-#include "oox/drawingml/chart/chartspacefragment.hxx"
-#include "oox/drawingml/chart/chartspacemodel.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -59,7 +51,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::xml::sax;
using namespace ::oox::core;
-using ::oox::vml::OleObjectInfo;
namespace oox {
namespace drawingml {
@@ -76,7 +67,7 @@ Reference< XFastContextHandler > GraphicShapeContext::createFastChildContext( sa
{
Reference< XFastContextHandler > xRet;
- switch( getToken( aElementToken ) )
+ switch( getBaseToken( aElementToken ) )
{
// CT_ShapeProperties
case XML_xfrm:
@@ -87,13 +78,13 @@ Reference< XFastContextHandler > GraphicShapeContext::createFastChildContext( sa
break;
}
- if (getNamespace( aElementToken ) == NMSP_VML && mpShapePtr)
+ if ((getNamespace( aElementToken ) == NMSP_vml) && mpShapePtr)
{
mpShapePtr->setServiceName("com.sun.star.drawing.CustomShape");
CustomShapePropertiesPtr pCstmShpProps
(mpShapePtr->getCustomShapeProperties());
- sal_uInt32 nType = aElementToken & (~ NMSP_MASK);
+ sal_uInt32 nType = getBaseToken( aElementToken );
OUString sType(GetShapeType(nType));
if (sType.getLength() > 0)
@@ -119,7 +110,7 @@ Reference< XFastContextHandler > GraphicalObjectFrameContext::createFastChildCon
{
Reference< XFastContextHandler > xRet;
- switch( aElementToken &(~NMSP_MASK) )
+ switch( getBaseToken( aElementToken ) )
{
// CT_ShapeProperties
case XML_nvGraphicFramePr: // CT_GraphicalObjectFrameNonVisual
@@ -158,65 +149,19 @@ Reference< XFastContextHandler > GraphicalObjectFrameContext::createFastChildCon
// ============================================================================
-class CreateOleObjectCallback : public CreateShapeCallback
-{
-public:
- explicit CreateOleObjectCallback( XmlFilterBase& rFilter, const ::boost::shared_ptr< OleObjectInfo >& rxOleObjectInfo );
- virtual OUString onCreateXShape( const OUString& rServiceName, const awt::Rectangle& rShapeRect );
-
-private:
- ::boost::shared_ptr< OleObjectInfo > mxOleObjectInfo;
-};
-
-// ----------------------------------------------------------------------------
-
-CreateOleObjectCallback::CreateOleObjectCallback( XmlFilterBase& rFilter, const ::boost::shared_ptr< OleObjectInfo >& rxOleObjectInfo ) :
- CreateShapeCallback( rFilter ),
- mxOleObjectInfo( rxOleObjectInfo )
-{
-}
-
-OUString CreateOleObjectCallback::onCreateXShape( const OUString&, const awt::Rectangle& rShapeRect )
-{
- awt::Size aOleSize( rShapeRect.Width, rShapeRect.Height );
- bool bSuccess = mrFilter.getOleObjectHelper().importOleObject( maShapeProps, *mxOleObjectInfo, aOleSize );
- OUString aServiceName = bSuccess ? CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" ) : CREATE_OUSTRING( "com.sun.star.drawing.GraphicObjectShape" );
-
- // get the path to the representation graphic
- OUString aGraphicPath;
- if( mxOleObjectInfo->maShapeId.getLength() > 0 )
- if( ::oox::vml::Drawing* pVmlDrawing = mrFilter.getVmlDrawing() )
- if( const ::oox::vml::ShapeBase* pVmlShape = pVmlDrawing->getShapes().getShapeById( mxOleObjectInfo->maShapeId, true ) )
- aGraphicPath = pVmlShape->getGraphicPath();
-
- // import and store the graphic
- if( aGraphicPath.getLength() > 0 )
- {
- Reference< graphic::XGraphic > xGraphic = mrFilter.getGraphicHelper().importEmbeddedGraphic( aGraphicPath );
- if( xGraphic.is() )
- maShapeProps[ PROP_Graphic ] <<= xGraphic;
- }
-
- return aServiceName;
-}
-
-// ============================================================================
-
OleObjectGraphicDataContext::OleObjectGraphicDataContext( ContextHandler& rParent, ShapePtr xShape ) :
ShapeContext( rParent, ShapePtr(), xShape ),
- mxOleObjectInfo( new OleObjectInfo( true ) )
+ mrOleObjectInfo( xShape->setOleObjectType() )
{
- CreateShapeCallbackRef xCallback( new CreateOleObjectCallback( getFilter(), mxOleObjectInfo ) );
- xShape->setCreateShapeCallback( xCallback );
}
OleObjectGraphicDataContext::~OleObjectGraphicDataContext()
{
/* Register the OLE shape at the VML drawing, this prevents that the
related VML shape converts the OLE object by itself. */
- if( mxOleObjectInfo->maShapeId.getLength() > 0 )
+ if( mrOleObjectInfo.maShapeId.getLength() > 0 )
if( ::oox::vml::Drawing* pVmlDrawing = getFilter().getVmlDrawing() )
- pVmlDrawing->registerOleObject( *mxOleObjectInfo );
+ pVmlDrawing->registerOleObject( mrOleObjectInfo );
}
Reference< XFastContextHandler > OleObjectGraphicDataContext::createFastChildContext( sal_Int32 nElement, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
@@ -228,37 +173,37 @@ Reference< XFastContextHandler > OleObjectGraphicDataContext::createFastChildCon
{
case PPT_TOKEN( oleObj ):
{
- mxOleObjectInfo->maShapeId = aAttribs.getXString( XML_spid, OUString() );
+ mrOleObjectInfo.maShapeId = aAttribs.getXString( XML_spid, OUString() );
const Relation* pRelation = getRelations().getRelationFromRelId( aAttribs.getString( R_TOKEN( id ), OUString() ) );
OSL_ENSURE( pRelation, "OleObjectGraphicDataContext::createFastChildContext - missing relation for OLE object" );
if( pRelation )
{
- mxOleObjectInfo->mbLinked = pRelation->mbExternal;
+ mrOleObjectInfo.mbLinked = pRelation->mbExternal;
if( pRelation->mbExternal )
{
- mxOleObjectInfo->maTargetLink = getFilter().getAbsoluteUrl( pRelation->maTarget );
+ mrOleObjectInfo.maTargetLink = getFilter().getAbsoluteUrl( pRelation->maTarget );
}
else
{
OUString aFragmentPath = getFragmentPathFromRelation( *pRelation );
if( aFragmentPath.getLength() > 0 )
- getFilter().importBinaryData( mxOleObjectInfo->maEmbeddedData, aFragmentPath );
+ getFilter().importBinaryData( mrOleObjectInfo.maEmbeddedData, aFragmentPath );
}
}
- mxOleObjectInfo->maName = aAttribs.getXString( XML_name, OUString() );
- mxOleObjectInfo->maProgId = aAttribs.getXString( XML_progId, OUString() );
- mxOleObjectInfo->mbShowAsIcon = aAttribs.getBool( XML_showAsIcon, false );
+ mrOleObjectInfo.maName = aAttribs.getXString( XML_name, OUString() );
+ mrOleObjectInfo.maProgId = aAttribs.getXString( XML_progId, OUString() );
+ mrOleObjectInfo.mbShowAsIcon = aAttribs.getBool( XML_showAsIcon, false );
xRet.set( this );
}
break;
case PPT_TOKEN( embed ):
- OSL_ENSURE( !mxOleObjectInfo->mbLinked, "OleObjectGraphicDataContext::createFastChildContext - unexpected child element" );
+ OSL_ENSURE( !mrOleObjectInfo.mbLinked, "OleObjectGraphicDataContext::createFastChildContext - unexpected child element" );
break;
case PPT_TOKEN( link ):
- OSL_ENSURE( mxOleObjectInfo->mbLinked, "OleObjectGraphicDataContext::createFastChildContext - unexpected child element" );
- mxOleObjectInfo->mbAutoUpdate = aAttribs.getBool( XML_updateAutomatic, false );
+ OSL_ENSURE( mrOleObjectInfo.mbLinked, "OleObjectGraphicDataContext::createFastChildContext - unexpected child element" );
+ mrOleObjectInfo.mbAutoUpdate = aAttribs.getBool( XML_updateAutomatic, false );
break;
}
return xRet;
@@ -269,8 +214,7 @@ Reference< XFastContextHandler > OleObjectGraphicDataContext::createFastChildCon
DiagramGraphicDataContext::DiagramGraphicDataContext( ContextHandler& rParent, ShapePtr pShapePtr )
: ShapeContext( rParent, ShapePtr(), pShapePtr )
{
- pShapePtr->setServiceName( "com.sun.star.drawing.GroupShape" );
- pShapePtr->setSubType( 0 );
+ pShapePtr->setDiagramType();
}
DiagramGraphicDataContext::~DiagramGraphicDataContext()
@@ -326,12 +270,12 @@ Reference< XFastContextHandler > DiagramGraphicDataContext::createFastChildConte
switch( aElementToken )
{
- case NMSP_DIAGRAM|XML_relIds:
+ case DGM_TOKEN( relIds ):
{
- msDm = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_dm );
- msLo = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_lo );
- msQs = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_qs );
- msCs = xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_cs );
+ msDm = xAttribs->getOptionalValue( R_TOKEN( dm ) );
+ msLo = xAttribs->getOptionalValue( R_TOKEN( lo ) );
+ msQs = xAttribs->getOptionalValue( R_TOKEN( qs ) );
+ msCs = xAttribs->getOptionalValue( R_TOKEN( cs ) );
DiagramPtr pDiagram = loadDiagram();
pDiagram->addTo( mpShapePtr );
OSL_TRACE("diagram added shape %s of type %s", OUSTRING_TO_CSTR( mpShapePtr->getName() ),
@@ -350,62 +294,10 @@ Reference< XFastContextHandler > DiagramGraphicDataContext::createFastChildConte
// ============================================================================
-class CreateChartCallback : public CreateShapeCallback
-{
-public:
- explicit CreateChartCallback( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEmbedShapes );
- virtual void onXShapeCreated( const Reference< drawing::XShape >& rxShape, const Reference< drawing::XShapes >& rxShapes ) const;
-
-private:
- OUString maFragmentPath;
- bool mbEmbedShapes;
-};
-
-// ----------------------------------------------------------------------------
-
-CreateChartCallback::CreateChartCallback( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEmbedShapes ) :
- CreateShapeCallback( rFilter ),
- maFragmentPath( rFragmentPath ),
- mbEmbedShapes( bEmbedShapes )
-{
-}
-
-void CreateChartCallback::onXShapeCreated( const Reference< drawing::XShape >& rxShape, const Reference< drawing::XShapes >& rxShapes ) const
-{
- OSL_ENSURE( maFragmentPath.getLength() > 0, "CreateChartCallback::onXShapeCreated - missing chart fragment" );
- if( maFragmentPath.getLength() > 0 ) try
- {
- // set the chart2 OLE class ID at the OLE shape
- PropertySet aShapeProp( rxShape );
- aShapeProp.setProperty( PROP_CLSID, CREATE_OUSTRING( "12dcae26-281f-416f-a234-c3086127382e" ) );
-
- // get the XModel interface of the embedded object from the OLE shape
- Reference< frame::XModel > xDocModel;
- aShapeProp.getProperty( xDocModel, PROP_Model );
- Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW );
-
- // load the chart data from the XML fragment
- chart::ChartSpaceModel aModel;
- mrFilter.importFragment( new chart::ChartSpaceFragment( mrFilter, maFragmentPath, aModel ) );
-
- // convert imported chart model to chart document
- Reference< drawing::XShapes > xExternalPage;
- if( !mbEmbedShapes )
- xExternalPage = rxShapes;
- mrFilter.getChartConverter().convertFromModel( mrFilter, aModel, xChartDoc, xExternalPage, rxShape->getPosition(), rxShape->getSize() );
- }
- catch( Exception& )
- {
- }
-}
-
-// ============================================================================
-
ChartGraphicDataContext::ChartGraphicDataContext( ContextHandler& rParent, const ShapePtr& rxShape, bool bEmbedShapes ) :
ShapeContext( rParent, ShapePtr(), rxShape ),
- mbEmbedShapes( bEmbedShapes )
+ mrChartShapeInfo( rxShape->setChartType( bEmbedShapes ) )
{
- rxShape->setServiceName( "com.sun.star.drawing.OLE2Shape" );
}
Reference< XFastContextHandler > ChartGraphicDataContext::createFastChildContext( ::sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs )
@@ -414,9 +306,7 @@ Reference< XFastContextHandler > ChartGraphicDataContext::createFastChildContext
if( nElement == C_TOKEN( chart ) )
{
AttributeList aAttribs( rxAttribs );
- OUString aFragmentPath = getFragmentPathFromRelId( aAttribs.getString( R_TOKEN( id ), OUString() ) );
- CreateShapeCallbackRef xCallback( new CreateChartCallback( getFilter(), aFragmentPath, mbEmbedShapes ) );
- mpShapePtr->setCreateShapeCallback( xCallback );
+ mrChartShapeInfo.maFragmentPath = getFragmentPathFromRelId( aAttribs.getString( R_TOKEN( id ), OUString() ) );
}
return 0;
}
diff --git a/oox/source/drawingml/guidcontext.cxx b/oox/source/drawingml/guidcontext.cxx
index d621152a139c..83665c5c2922 100644
--- a/oox/source/drawingml/guidcontext.cxx
+++ b/oox/source/drawingml/guidcontext.cxx
@@ -26,10 +26,7 @@
*
************************************************************************/
-#include <rtl/ustring.hxx>
#include "oox/drawingml/guidcontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
diff --git a/oox/source/drawingml/hyperlinkcontext.cxx b/oox/source/drawingml/hyperlinkcontext.cxx
index e41eb6386ded..1975561ab808 100644
--- a/oox/source/drawingml/hyperlinkcontext.cxx
+++ b/oox/source/drawingml/hyperlinkcontext.cxx
@@ -28,17 +28,12 @@
#include "hyperlinkcontext.hxx"
-#include <rtl/ustring.hxx>
-
#include <com/sun/star/xml/sax/XFastContextHandler.hpp>
#include "oox/helper/propertymap.hxx"
#include "oox/core/relations.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/embeddedwavaudiofile.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -54,7 +49,7 @@ HyperLinkContext::HyperLinkContext( ContextHandler& rParent,
, maProperties(aProperties)
{
OUString sURL, sHref;
- OUString aRelId = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_id );
+ OUString aRelId = xAttributes->getOptionalValue( R_TOKEN( id ) );
if ( aRelId.getLength() )
{
OSL_TRACE("OOX: URI rId %s", ::rtl::OUStringToOString (aRelId, RTL_TEXTENCODING_UTF8).pData->buffer);
@@ -65,10 +60,10 @@ HyperLinkContext::HyperLinkContext( ContextHandler& rParent,
sURL = getFilter().getAbsoluteUrl( sHref );
}
}
- OUString sTooltip = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_tooltip );
+ OUString sTooltip = xAttributes->getOptionalValue( R_TOKEN( tooltip ) );
if ( sTooltip.getLength() )
maProperties[ PROP_Representation ] <<= sTooltip;
- OUString sFrame = xAttributes->getOptionalValue( NMSP_RELATIONSHIPS|XML_tgtFrame );
+ OUString sFrame = xAttributes->getOptionalValue( R_TOKEN( tgtFrame ) );
if( sFrame.getLength() )
maProperties[ PROP_TargetFrame ] <<= sFrame;
OUString aAction = xAttributes->getOptionalValue( XML_action );
@@ -165,9 +160,9 @@ Reference< XFastContextHandler > HyperLinkContext::createFastChildContext(
Reference< XFastContextHandler > xRet;
switch( aElement )
{
- case NMSP_DRAWINGML|XML_extLst:
+ case A_TOKEN( extLst ):
return xRet;
- case NMSP_DRAWINGML|XML_snd:
+ case A_TOKEN( snd ):
EmbeddedWAVAudioFile aAudio;
getEmbeddedWAVAudioFile( getRelations(), xAttribs, aAudio );
break;
diff --git a/oox/source/drawingml/lineproperties.cxx b/oox/source/drawingml/lineproperties.cxx
index 7bc60f026665..7141f83e1574 100644
--- a/oox/source/drawingml/lineproperties.cxx
+++ b/oox/source/drawingml/lineproperties.cxx
@@ -36,14 +36,13 @@
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/drawing/PointSequence.hpp>
#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
-#include "properties.hxx"
-#include "tokens.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/helper/modelobjecthelper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/token/tokens.hxx"
using namespace ::com::sun::star::drawing;
diff --git a/oox/source/drawingml/linepropertiescontext.cxx b/oox/source/drawingml/linepropertiescontext.cxx
index 5a7947e01ec2..d9cf4b684640 100644
--- a/oox/source/drawingml/linepropertiescontext.cxx
+++ b/oox/source/drawingml/linepropertiescontext.cxx
@@ -31,8 +31,6 @@
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/lineproperties.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -89,7 +87,7 @@ Reference< XFastContextHandler > LinePropertiesContext::createFastChildContext(
case A_TOKEN( round ):
case A_TOKEN( bevel ):
case A_TOKEN( miter ):
- mrLineProperties.moLineJoint = getToken( nElement );
+ mrLineProperties.moLineJoint = getBaseToken( nElement );
break;
case A_TOKEN( headEnd ): // CT_LineEndProperties
diff --git a/oox/source/drawingml/objectdefaultcontext.cxx b/oox/source/drawingml/objectdefaultcontext.cxx
index 2daad3ab9b77..7c29cc06b273 100644
--- a/oox/source/drawingml/objectdefaultcontext.cxx
+++ b/oox/source/drawingml/objectdefaultcontext.cxx
@@ -29,8 +29,6 @@
#include "oox/drawingml/objectdefaultcontext.hxx"
#include "oox/drawingml/spdefcontext.hxx"
#include "oox/drawingml/theme.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::oox::core;
@@ -49,11 +47,11 @@ Reference< XFastContextHandler > objectDefaultContext::createFastChildContext( s
{
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_spDef:
+ case A_TOKEN( spDef ):
return new spDefContext( *this, mrTheme.getSpDef() );
- case NMSP_DRAWINGML|XML_lnDef:
+ case A_TOKEN( lnDef ):
return new spDefContext( *this, mrTheme.getLnDef() );
- case NMSP_DRAWINGML|XML_txDef:
+ case A_TOKEN( txDef ):
return new spDefContext( *this, mrTheme.getTxDef() );
}
return 0;
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 081b48ab781d..18965ed78d1c 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -33,11 +33,15 @@
#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/textbody.hxx"
#include "oox/drawingml/table/tableproperties.hxx"
-#include "oox/core/namespaces.hxx"
+#include "oox/drawingml/chart/chartconverter.hxx"
+#include "oox/drawingml/chart/chartspacefragment.hxx"
+#include "oox/drawingml/chart/chartspacemodel.hxx"
+#include "oox/vml/vmldrawing.hxx"
+#include "oox/vml/vmlshape.hxx"
+#include "oox/vml/vmlshapecontainer.hxx"
#include "oox/core/xmlfilterbase.hxx"
+#include "oox/helper/graphichelper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
#include <tools/solar.h> // for the F_PI180 define
#include <com/sun/star/graphic/XGraphic.hpp>
@@ -47,6 +51,7 @@
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
@@ -68,26 +73,6 @@ namespace oox { namespace drawingml {
// ============================================================================
-CreateShapeCallback::CreateShapeCallback( XmlFilterBase& rFilter ) :
- mrFilter( rFilter )
-{
-}
-
-CreateShapeCallback::~CreateShapeCallback()
-{
-}
-
-OUString CreateShapeCallback::onCreateXShape( const OUString& rServiceName, const Rectangle& )
-{
- return rServiceName;
-}
-
-void CreateShapeCallback::onXShapeCreated( const Reference< XShape >&, const Reference< XShapes >& ) const
-{
-}
-
-// ============================================================================
-
Shape::Shape( const sal_Char* pServiceName )
: mbIsChild( false )
, mpLinePropertiesPtr( new LineProperties )
@@ -97,6 +82,7 @@ Shape::Shape( const sal_Char* pServiceName )
, mpMasterTextListStyle( new TextListStyle )
, mnSubType( 0 )
, mnSubTypeIndex( -1 )
+, meFrameType( FRAMETYPE_GENERIC )
, mnRotation( 0 )
, mbFlipH( false )
, mbFlipV( false )
@@ -106,6 +92,7 @@ Shape::Shape( const sal_Char* pServiceName )
msServiceName = OUString::createFromAscii( pServiceName );
setDefaults();
}
+
Shape::~Shape()
{
}
@@ -130,6 +117,39 @@ void Shape::setDefaults()
maDefaultShapeProperties[ PROP_ParaAdjust ] <<= static_cast< sal_Int16 >( ParagraphAdjust_LEFT ); // check for RTL?
}
+::oox::vml::OleObjectInfo& Shape::setOleObjectType()
+{
+ OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setOleObjectType - multiple frame types" );
+ meFrameType = FRAMETYPE_OLEOBJECT;
+ mxOleObjectInfo.reset( new ::oox::vml::OleObjectInfo( true ) );
+ return *mxOleObjectInfo;
+}
+
+ChartShapeInfo& Shape::setChartType( bool bEmbedShapes )
+{
+ OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setChartType - multiple frame types" );
+ meFrameType = FRAMETYPE_CHART;
+ msServiceName = CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" );
+ mxChartShapeInfo.reset( new ChartShapeInfo( bEmbedShapes ) );
+ return *mxChartShapeInfo;
+}
+
+void Shape::setDiagramType()
+{
+ OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setDiagramType - multiple frame types" );
+ meFrameType = FRAMETYPE_DIAGRAM;
+ msServiceName = CREATE_OUSTRING( "com.sun.star.drawing.GroupShape" );
+ mnSubType = 0;
+}
+
+void Shape::setTableType()
+{
+ OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setTableType - multiple frame types" );
+ meFrameType = FRAMETYPE_TABLE;
+ msServiceName = CREATE_OUSTRING( "com.sun.star.drawing.TableShape" );
+ mnSubType = 0;
+}
+
void Shape::setServiceName( const sal_Char* pServiceName )
{
if ( pServiceName )
@@ -144,7 +164,7 @@ const ShapeStyleRef* Shape::getShapeStyleRef( sal_Int32 nRefType ) const
}
void Shape::addShape(
- const ::oox::core::XmlFilterBase& rFilterBase,
+ ::oox::core::XmlFilterBase& rFilterBase,
const Theme* pTheme,
const Reference< XShapes >& rxShapes,
const awt::Rectangle* pShapeRect,
@@ -196,7 +216,7 @@ void Shape::applyShapeReference( const Shape& rReferencedShape )
// for group shapes, the following method is also adding each child
void Shape::addChildren(
- const ::oox::core::XmlFilterBase& rFilterBase,
+ XmlFilterBase& rFilterBase,
Shape& rMaster,
const Theme* pTheme,
const Reference< XShapes >& rxShapes,
@@ -233,7 +253,7 @@ void Shape::addChildren(
}
Reference< XShape > Shape::createAndInsert(
- const ::oox::core::XmlFilterBase& rFilterBase,
+ ::oox::core::XmlFilterBase& rFilterBase,
const rtl::OUString& rServiceName,
const Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
@@ -242,11 +262,10 @@ Reference< XShape > Shape::createAndInsert(
{
awt::Size aSize( pShapeRect ? awt::Size( pShapeRect->Width, pShapeRect->Height ) : maSize );
awt::Point aPosition( pShapeRect ? awt::Point( pShapeRect->X, pShapeRect->Y ) : maPosition );
+ awt::Rectangle aShapeRectHmm( aPosition.X / 360, aPosition.Y / 360, aSize.Width / 360, aSize.Height / 360 );
- OUString aServiceName = rServiceName;
- if( mxCreateCallback.get() )
- aServiceName = mxCreateCallback->onCreateXShape( aServiceName, awt::Rectangle( aPosition.X / 360, aPosition.Y / 360, aSize.Width / 360, aSize.Height / 360 ) );
- sal_Bool bIsCustomShape = aServiceName == OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape"));
+ OUString aServiceName = finalizeServiceName( rFilterBase, rServiceName, aShapeRectHmm );
+ sal_Bool bIsCustomShape = aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.CustomShape" ) );
basegfx::B2DHomMatrix aTransformation;
if( aSize.Width != 1 || aSize.Height != 1)
@@ -418,13 +437,6 @@ Reference< XShape > Shape::createAndInsert(
PropertyMap aShapeProperties;
PropertyMap::const_iterator aShapePropIter;
- if( mxCreateCallback.get() )
- {
- for ( aShapePropIter = mxCreateCallback->getShapeProperties().begin();
- aShapePropIter != mxCreateCallback->getShapeProperties().end(); ++aShapePropIter )
- aShapeProperties[ (*aShapePropIter).first ] = (*aShapePropIter).second;
- }
-
// add properties from textbody to shape properties
if( mpTextBody.get() )
{
@@ -490,9 +502,8 @@ Reference< XShape > Shape::createAndInsert(
xLockable->removeActionLock();
}
- // use a callback for further processing on the XShape (e.g. charts)
- if( mxShape.is() && mxCreateCallback.get() )
- mxCreateCallback->onXShapeCreated( mxShape, rxShapes );
+ if( mxShape.is() )
+ finalizeXShape( rFilterBase, rxShapes );
return mxShape;
}
@@ -525,6 +536,78 @@ void Shape::setMasterTextListStyle( const TextListStylePtr& pMasterTextListStyle
mpMasterTextListStyle = pMasterTextListStyle;
}
+OUString Shape::finalizeServiceName( XmlFilterBase& rFilter, const OUString& rServiceName, const Rectangle& rShapeRect )
+{
+ OUString aServiceName = rServiceName;
+ switch( meFrameType )
+ {
+ case FRAMETYPE_OLEOBJECT:
+ {
+ Size aOleSize( rShapeRect.Width, rShapeRect.Height );
+ if( rFilter.getOleObjectHelper().importOleObject( maShapeProperties, *mxOleObjectInfo, aOleSize ) )
+ aServiceName = CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" );
+
+ // get the path to the representation graphic
+ OUString aGraphicPath;
+ if( mxOleObjectInfo->maShapeId.getLength() > 0 )
+ if( ::oox::vml::Drawing* pVmlDrawing = rFilter.getVmlDrawing() )
+ if( const ::oox::vml::ShapeBase* pVmlShape = pVmlDrawing->getShapes().getShapeById( mxOleObjectInfo->maShapeId, true ) )
+ aGraphicPath = pVmlShape->getGraphicPath();
+
+ // import and store the graphic
+ if( aGraphicPath.getLength() > 0 )
+ {
+ Reference< graphic::XGraphic > xGraphic = rFilter.getGraphicHelper().importEmbeddedGraphic( aGraphicPath );
+ if( xGraphic.is() )
+ maShapeProperties[ PROP_Graphic ] <<= xGraphic;
+ }
+ }
+ break;
+
+ default:;
+ }
+ return aServiceName;
+}
+
+void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >& rxShapes )
+{
+ switch( meFrameType )
+ {
+ case FRAMETYPE_CHART:
+ {
+ OSL_ENSURE( mxChartShapeInfo->maFragmentPath.getLength() > 0, "Shape::finalizeXShape - missing chart fragment" );
+ if( mxShape.is() && (mxChartShapeInfo->maFragmentPath.getLength() > 0) ) try
+ {
+ // set the chart2 OLE class ID at the OLE shape
+ PropertySet aShapeProp( mxShape );
+ aShapeProp.setProperty( PROP_CLSID, CREATE_OUSTRING( "12dcae26-281f-416f-a234-c3086127382e" ) );
+
+ // get the XModel interface of the embedded object from the OLE shape
+ Reference< frame::XModel > xDocModel;
+ aShapeProp.getProperty( xDocModel, PROP_Model );
+ Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW );
+
+ // load the chart data from the XML fragment
+ chart::ChartSpaceModel aModel;
+ rFilter.importFragment( new chart::ChartSpaceFragment( rFilter, mxChartShapeInfo->maFragmentPath, aModel ) );
+
+ // convert imported chart model to chart document
+ Reference< drawing::XShapes > xExternalPage;
+ if( !mxChartShapeInfo->mbEmbedShapes )
+ xExternalPage = rxShapes;
+ rFilter.getChartConverter().convertFromModel( rFilter, aModel, xChartDoc, xExternalPage, mxShape->getPosition(), mxShape->getSize() );
+ }
+ catch( Exception& )
+ {
+ }
+ }
+ break;
+
+ default:;
+ }
+}
+
+// ============================================================================
} }
diff --git a/oox/source/drawingml/shapecontext.cxx b/oox/source/drawingml/shapecontext.cxx
index 6c9769bb8f72..f613e89ce6a9 100644
--- a/oox/source/drawingml/shapecontext.cxx
+++ b/oox/source/drawingml/shapecontext.cxx
@@ -35,14 +35,12 @@
#include "oox/helper/attributelist.hxx"
#include "oox/drawingml/shapecontext.hxx"
#include "oox/drawingml/shapestylecontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/customshapegeometry.hxx"
#include "oox/drawingml/textbodycontext.hxx"
#include "hyperlinkcontext.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace oox::core;
@@ -82,7 +80,7 @@ Reference< XFastContextHandler > ShapeContext::createFastChildContext( sal_Int32
{
Reference< XFastContextHandler > xRet;
- switch( getToken( aElementToken ) )
+ switch( getBaseToken( aElementToken ) )
{
// nvSpPr CT_ShapeNonVisual begin
// case XML_drElemPr:
diff --git a/oox/source/drawingml/shapegroupcontext.cxx b/oox/source/drawingml/shapegroupcontext.cxx
index 57aeccdb33ef..81c396b170ef 100644
--- a/oox/source/drawingml/shapegroupcontext.cxx
+++ b/oox/source/drawingml/shapegroupcontext.cxx
@@ -38,8 +38,6 @@
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/customshapegeometry.hxx"
#include "oox/drawingml/textbodycontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace oox::core;
@@ -69,7 +67,7 @@ Reference< XFastContextHandler > ShapeGroupContext::createFastChildContext( sal_
{
Reference< XFastContextHandler > xRet;
- switch( getToken( aElementToken ) )
+ switch( getBaseToken( aElementToken ) )
{
case XML_cNvPr:
{
@@ -110,7 +108,7 @@ Reference< XFastContextHandler > ShapeGroupContext::createFastChildContext( sal_
xRet.set( new GraphicShapeContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ) ) );
break;
case XML_graphicFrame: // CT_GraphicalObjectFrame
- xRet.set( new GraphicalObjectFrameContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.OLE2Shape" ) ), true ) );
+ xRet.set( new GraphicalObjectFrameContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ), true ) );
break;
}
if( !xRet.is() )
diff --git a/oox/source/drawingml/shapepropertiescontext.cxx b/oox/source/drawingml/shapepropertiescontext.cxx
index 470433af0556..2cc1874a29bb 100644
--- a/oox/source/drawingml/shapepropertiescontext.cxx
+++ b/oox/source/drawingml/shapepropertiescontext.cxx
@@ -34,12 +34,10 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNamed.hpp>
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/linepropertiescontext.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/transform2dcontext.hxx"
#include "oox/drawingml/customshapegeometry.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace oox::core;
@@ -69,17 +67,17 @@ Reference< XFastContextHandler > ShapePropertiesContext::createFastChildContext(
switch( aElementToken )
{
// CT_Transform2D
- case NMSP_DRAWINGML|XML_xfrm:
+ case A_TOKEN( xfrm ):
xRet.set( new Transform2DContext( *this, xAttribs, mrShape ) );
break;
// GeometryGroup
- case NMSP_DRAWINGML|XML_custGeom: // custom geometry "CT_CustomGeometry2D"
+ case A_TOKEN( custGeom ): // custom geometry "CT_CustomGeometry2D"
xRet.set( new CustomShapeGeometryContext( *this, xAttribs, *(mrShape.getCustomShapeProperties()) ) );
break;
- case NMSP_DRAWINGML|XML_prstGeom: // preset geometry "CT_PresetGeometry2D"
+ case A_TOKEN( prstGeom ): // preset geometry "CT_PresetGeometry2D"
{
sal_Int32 nToken = xAttribs->getOptionalValueToken( XML_prst, 0 );
if ( nToken == XML_line )
@@ -91,24 +89,24 @@ Reference< XFastContextHandler > ShapePropertiesContext::createFastChildContext(
}
break;
- case NMSP_DRAWINGML|XML_prstTxWarp:
+ case A_TOKEN( prstTxWarp ):
xRet.set( new PresetTextShapeContext( *this, xAttribs, *(mrShape.getCustomShapeProperties()) ) );
break;
// CT_LineProperties
- case NMSP_DRAWINGML|XML_ln:
+ case A_TOKEN( ln ):
xRet.set( new LinePropertiesContext( *this, xAttribs, mrShape.getLineProperties() ) );
break;
// EffectPropertiesGroup
// todo not supported by core
- case NMSP_DRAWINGML|XML_effectLst: // CT_EffectList
- case NMSP_DRAWINGML|XML_effectDag: // CT_EffectContainer
+ case A_TOKEN( effectLst ): // CT_EffectList
+ case A_TOKEN( effectDag ): // CT_EffectContainer
break;
// todo
- case NMSP_DRAWINGML|XML_scene3d: // CT_Scene3D
- case NMSP_DRAWINGML|XML_sp3d: // CT_Shape3D
+ case A_TOKEN( scene3d ): // CT_Scene3D
+ case A_TOKEN( sp3d ): // CT_Shape3D
break;
}
diff --git a/oox/source/drawingml/shapestylecontext.cxx b/oox/source/drawingml/shapestylecontext.cxx
index f0831234029e..e0ba3dc7f4c0 100644
--- a/oox/source/drawingml/shapestylecontext.cxx
+++ b/oox/source/drawingml/shapestylecontext.cxx
@@ -29,9 +29,7 @@
#include "oox/drawingml/shapestylecontext.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/colorchoicecontext.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -68,12 +66,12 @@ Reference< XFastContextHandler > ShapeStyleContext::createFastChildContext( sal_
AttributeList aAttribs( rxAttributes );
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_lnRef : // CT_StyleMatrixReference
- case NMSP_DRAWINGML|XML_fillRef : // CT_StyleMatrixReference
- case NMSP_DRAWINGML|XML_effectRef : // CT_StyleMatrixReference
- case NMSP_DRAWINGML|XML_fontRef : // CT_FontReference
+ case A_TOKEN( lnRef ) : // CT_StyleMatrixReference
+ case A_TOKEN( fillRef ) : // CT_StyleMatrixReference
+ case A_TOKEN( effectRef ) : // CT_StyleMatrixReference
+ case A_TOKEN( fontRef ) : // CT_FontReference
{
- sal_Int32 nToken = getToken( aElementToken );
+ sal_Int32 nToken = getBaseToken( aElementToken );
ShapeStyleRef& rStyleRef = mrShape.getShapeStyleRefs()[ nToken ];
rStyleRef.mnThemedIdx = (nToken == XML_fontRef) ? aAttribs.getToken( XML_idx, XML_none ) : aAttribs.getInteger( XML_idx, 0 );
xRet.set( new ColorContext( *this, rStyleRef.maPhClr ) );
diff --git a/oox/source/drawingml/spdefcontext.cxx b/oox/source/drawingml/spdefcontext.cxx
index 09a894d2af6f..387cddd0b83b 100644
--- a/oox/source/drawingml/spdefcontext.cxx
+++ b/oox/source/drawingml/spdefcontext.cxx
@@ -31,8 +31,6 @@
#include "oox/drawingml/textbody.hxx"
#include "oox/drawingml/textbodypropertiescontext.hxx"
#include "oox/drawingml/textliststylecontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::oox::core;
@@ -52,22 +50,22 @@ Reference< XFastContextHandler > spDefContext::createFastChildContext( sal_Int32
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_spPr:
+ case A_TOKEN( spPr ):
{
xRet = new ShapePropertiesContext( *this, mrDefaultObject );
break;
}
- case NMSP_DRAWINGML|XML_bodyPr:
+ case A_TOKEN( bodyPr ):
{
TextBodyPtr xTextBody( new TextBody );
mrDefaultObject.setTextBody( xTextBody );
xRet = new TextBodyPropertiesContext( *this, xAttribs, xTextBody->getTextProperties() );
break;
}
- case NMSP_DRAWINGML|XML_lstStyle:
+ case A_TOKEN( lstStyle ):
xRet.set( new TextListStyleContext( *this, *mrDefaultObject.getMasterTextListStyle() ) );
break;
- case NMSP_DRAWINGML|XML_style:
+ case A_TOKEN( style ):
break;
}
if( !xRet.is() )
diff --git a/oox/source/drawingml/table/tablebackgroundstylecontext.cxx b/oox/source/drawingml/table/tablebackgroundstylecontext.cxx
index 73c50b8c0645..ea23e72fdf3e 100644
--- a/oox/source/drawingml/table/tablebackgroundstylecontext.cxx
+++ b/oox/source/drawingml/table/tablebackgroundstylecontext.cxx
@@ -30,9 +30,8 @@
#include "oox/drawingml/table/tablebackgroundstylecontext.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
+
using namespace ::oox::core;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -61,14 +60,14 @@ TableBackgroundStyleContext::createFastChildContext( ::sal_Int32 aElementToken,
switch( aElementToken )
{
// EG_ThemeableFillStyle (choice)
- case NMSP_DRAWINGML|XML_fill: // CT_FillProperties
+ case A_TOKEN( fill ): // CT_FillProperties
{
boost::shared_ptr< FillProperties >& rxFillProperties = mrTableStyle.getBackgroundFillProperties();
rxFillProperties.reset( new FillProperties );
xRet.set( new FillPropertiesContext( *this, *rxFillProperties ) );
}
break;
- case NMSP_DRAWINGML|XML_fillRef: // CT_StyleMatrixReference
+ case A_TOKEN( fillRef ): // CT_StyleMatrixReference
{
ShapeStyleRef& rStyleRef = mrTableStyle.getBackgroundFillStyleRef();
rStyleRef.mnThemedIdx = aAttribs.getInteger( XML_idx, 0 );
@@ -77,9 +76,9 @@ TableBackgroundStyleContext::createFastChildContext( ::sal_Int32 aElementToken,
break;
// EG_ThemeableEffectStyle (choice)
- case NMSP_DRAWINGML|XML_effect: // CT_EffectProperties
+ case A_TOKEN( effect ): // CT_EffectProperties
break;
- case NMSP_DRAWINGML|XML_effectRef: // CT_StyleMatrixReference
+ case A_TOKEN( effectRef ): // CT_StyleMatrixReference
break;
}
if( !xRet.is() )
diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx
index 08d4f4d310a7..a8053139208e 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -29,10 +29,7 @@
#include "oox/drawingml/table/tablecell.hxx"
#include "oox/drawingml/table/tableproperties.hxx"
#include "oox/drawingml/textbody.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
#include "oox/helper/propertyset.hxx"
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
diff --git a/oox/source/drawingml/table/tablecellcontext.cxx b/oox/source/drawingml/table/tablecellcontext.cxx
index 732fefc27eeb..608c1572e215 100644
--- a/oox/source/drawingml/table/tablecellcontext.cxx
+++ b/oox/source/drawingml/table/tablecellcontext.cxx
@@ -32,7 +32,6 @@
#include "oox/drawingml/textbodycontext.hxx"
#include "oox/drawingml/linepropertiescontext.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
using namespace ::oox::core;
@@ -67,7 +66,7 @@ TableCellContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_txBody: // CT_TextBody
+ case A_TOKEN( txBody ): // CT_TextBody
{
oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody );
mrTableCell.setTextBody( xTextBody );
@@ -75,7 +74,7 @@ TableCellContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::
}
break;
- case NMSP_DRAWINGML|XML_tcPr: // CT_TableCellProperties
+ case A_TOKEN( tcPr ): // CT_TableCellProperties
{
AttributeList aAttribs( xAttribs );
mrTableCell.setLeftMargin( aAttribs.getInteger( XML_marL, 91440 ) );
@@ -88,28 +87,28 @@ TableCellContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::
mrTableCell.setHorzOverflowToken( xAttribs->getOptionalValueToken( XML_horzOverflow, XML_clip ) ); // ST_TextHorzOverflowType
}
break;
- case NMSP_DRAWINGML|XML_lnL:
+ case A_TOKEN( lnL ):
xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesLeft ) );
break;
- case NMSP_DRAWINGML|XML_lnR:
+ case A_TOKEN( lnR ):
xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesRight ) );
break;
- case NMSP_DRAWINGML|XML_lnT:
+ case A_TOKEN( lnT ):
xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesTop ) );
break;
- case NMSP_DRAWINGML|XML_lnB:
+ case A_TOKEN( lnB ):
xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesBottom ) );
break;
- case NMSP_DRAWINGML|XML_lnTlToBr:
+ case A_TOKEN( lnTlToBr ):
xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesTopLeftToBottomRight ) );
break;
- case NMSP_DRAWINGML|XML_lnBlToTr:
+ case A_TOKEN( lnBlToTr ):
xRet.set( new oox::drawingml::LinePropertiesContext( *this, xAttribs, mrTableCell.maLinePropertiesBottomLeftToTopRight ) );
break;
- case NMSP_DRAWINGML|XML_cell3D: // CT_Cell3D
+ case A_TOKEN( cell3D ): // CT_Cell3D
break;
- case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList
+ case A_TOKEN( extLst ): // CT_OfficeArtExtensionList
break;
default:
diff --git a/oox/source/drawingml/table/tablecontext.cxx b/oox/source/drawingml/table/tablecontext.cxx
index 419aef5d8307..30968e052c62 100644
--- a/oox/source/drawingml/table/tablecontext.cxx
+++ b/oox/source/drawingml/table/tablecontext.cxx
@@ -33,7 +33,6 @@
#include "oox/drawingml/table/tableproperties.hxx"
#include "oox/drawingml/table/tablestylecontext.hxx"
#include "oox/drawingml/table/tablerowcontext.hxx"
-#include "oox/core/namespaces.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star;
@@ -45,8 +44,7 @@ TableContext::TableContext( ContextHandler& rParent, ShapePtr pShapePtr )
: ShapeContext( rParent, ShapePtr(), pShapePtr )
, mrTableProperties( *pShapePtr->getTableProperties().get() )
{
- pShapePtr->setServiceName( "com.sun.star.drawing.TableShape" );
- pShapePtr->setSubType( 0 );
+ pShapePtr->setTableType();
}
TableContext::~TableContext()
@@ -61,7 +59,7 @@ TableContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::Refe
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_tblPr: // CT_TableProperties
+ case A_TOKEN( tblPr ): // CT_TableProperties
{
AttributeList aAttribs( xAttribs );
mrTableProperties.isRtl() = aAttribs.getBool( XML_rtl, sal_False );
@@ -73,26 +71,26 @@ TableContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::Refe
mrTableProperties.isBandCol() = aAttribs.getBool( XML_bandCol, sal_False );
}
break;
- case NMSP_DRAWINGML|XML_tableStyle: // CT_TableStyle
+ case A_TOKEN( tableStyle ): // CT_TableStyle
{
boost::shared_ptr< TableStyle >& rTableStyle = mrTableProperties.getTableStyle();
rTableStyle.reset( new TableStyle() );
xRet = new TableStyleContext( *this, xAttribs, *rTableStyle );
}
break;
- case NMSP_DRAWINGML|XML_tableStyleId: // ST_Guid
+ case A_TOKEN( tableStyleId ): // ST_Guid
xRet.set( new oox::drawingml::GuidContext( *this, mrTableProperties.getStyleId() ) );
break;
- case NMSP_DRAWINGML|XML_tblGrid: // CT_TableGrid
+ case A_TOKEN( tblGrid ): // CT_TableGrid
break;
- case NMSP_DRAWINGML|XML_gridCol: // CT_TableCol
+ case A_TOKEN( gridCol ): // CT_TableCol
{
std::vector< sal_Int32 >& rvTableGrid( mrTableProperties.getTableGrid() );
rvTableGrid.push_back( xAttribs->getOptionalValue( XML_w ).toInt32() );
}
break;
- case NMSP_DRAWINGML|XML_tr: // CT_TableRow
+ case A_TOKEN( tr ): // CT_TableRow
{
std::vector< TableRow >& rvTableRows( mrTableProperties.getTableRows() );
rvTableRows.resize( rvTableRows.size() + 1 );
diff --git a/oox/source/drawingml/table/tablepartstylecontext.cxx b/oox/source/drawingml/table/tablepartstylecontext.cxx
index edbe76ff4b76..4a7a8e390efb 100644
--- a/oox/source/drawingml/table/tablepartstylecontext.cxx
+++ b/oox/source/drawingml/table/tablepartstylecontext.cxx
@@ -31,8 +31,7 @@
#include "oox/drawingml/table/tablepartstylecontext.hxx"
#include "oox/drawingml/table/tablestyletextstylecontext.hxx"
#include "oox/drawingml/table/tablestylecellstylecontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
+
using namespace ::oox::core;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -60,10 +59,10 @@ TablePartStyleContext::createFastChildContext( ::sal_Int32 aElementToken, const
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_tcTxStyle: // CT_TableStyleTextStyle
+ case A_TOKEN( tcTxStyle ): // CT_TableStyleTextStyle
xRet.set( new TableStyleTextStyleContext( *this, xAttribs, mrTableStylePart ) );
break;
- case NMSP_DRAWINGML|XML_tcStyle: // CT_TableStyleCellStyle
+ case A_TOKEN( tcStyle ): // CT_TableStyleCellStyle
xRet.set( new TableStyleCellStyleContext( *this, mrTableStylePart ) );
break;
}
diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx
index 592af5868463..87e882dbee0f 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -34,10 +34,8 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/table/XMergeableCellRange.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/helper/propertyset.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::oox::core;
diff --git a/oox/source/drawingml/table/tablerow.cxx b/oox/source/drawingml/table/tablerow.cxx
index 915a76a57c2a..fd2c305ed008 100644
--- a/oox/source/drawingml/table/tablerow.cxx
+++ b/oox/source/drawingml/table/tablerow.cxx
@@ -28,8 +28,6 @@
#include "oox/drawingml/table/tablerow.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include "oox/helper/propertyset.hxx"
diff --git a/oox/source/drawingml/table/tablerowcontext.cxx b/oox/source/drawingml/table/tablerowcontext.cxx
index 84c9d3aad4b2..4c812ea4cc3f 100644
--- a/oox/source/drawingml/table/tablerowcontext.cxx
+++ b/oox/source/drawingml/table/tablerowcontext.cxx
@@ -31,8 +31,6 @@
#include "oox/drawingml/table/tablerowcontext.hxx"
#include "oox/drawingml/table/tablecellcontext.hxx"
#include "oox/drawingml/table/tablerow.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star;
@@ -59,14 +57,14 @@ TableRowContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::R
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_tc: // CT_TableCell
+ case A_TOKEN( tc ): // CT_TableCell
{
std::vector< TableCell >& rvTableCells = mrTableRow.getTableCells();
rvTableCells.resize( rvTableCells.size() + 1 );
xRet.set( new TableCellContext( *this, xAttribs, rvTableCells.back() ) );
}
break;
- case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList
+ case A_TOKEN( extLst ): // CT_OfficeArtExtensionList
default:
break;
}
diff --git a/oox/source/drawingml/table/tablestylecellstylecontext.cxx b/oox/source/drawingml/table/tablestylecellstylecontext.cxx
index bad3a7191903..76042663d20d 100644
--- a/oox/source/drawingml/table/tablestylecellstylecontext.cxx
+++ b/oox/source/drawingml/table/tablestylecellstylecontext.cxx
@@ -31,9 +31,8 @@
#include "oox/drawingml/table/tablestylecellstylecontext.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/linepropertiescontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
+
using namespace ::oox::core;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -62,20 +61,20 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c
AttributeList aAttribs( xAttribs );
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_tcBdr: // CT_TableCellBorderStyle
+ case A_TOKEN( tcBdr ): // CT_TableCellBorderStyle
break;
- case NMSP_DRAWINGML|XML_left: // CT_ThemeableLineStyle
- case NMSP_DRAWINGML|XML_right:
- case NMSP_DRAWINGML|XML_top:
- case NMSP_DRAWINGML|XML_bottom:
- case NMSP_DRAWINGML|XML_insideH:
- case NMSP_DRAWINGML|XML_insideV:
- case NMSP_DRAWINGML|XML_tl2br:
- case NMSP_DRAWINGML|XML_tr2bl:
- mnLineType = getToken( aElementToken );
+ case A_TOKEN( left ): // CT_ThemeableLineStyle
+ case A_TOKEN( right ):
+ case A_TOKEN( top ):
+ case A_TOKEN( bottom ):
+ case A_TOKEN( insideH ):
+ case A_TOKEN( insideV ):
+ case A_TOKEN( tl2br ):
+ case A_TOKEN( tr2bl ):
+ mnLineType = getBaseToken( aElementToken );
break;
- case NMSP_DRAWINGML|XML_ln:
+ case A_TOKEN( ln ):
{
if ( mnLineType != XML_none )
{
@@ -86,7 +85,7 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c
}
}
break;
- case NMSP_DRAWINGML|XML_lnRef:
+ case A_TOKEN( lnRef ):
{
if ( mnLineType != XML_none )
{
@@ -98,14 +97,14 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c
break;
// EG_ThemeableFillStyle (choice)
- case NMSP_DRAWINGML|XML_fill: // CT_FillProperties
+ case A_TOKEN( fill ): // CT_FillProperties
{
FillPropertiesPtr& rxFillProperties = mrTableStylePart.getFillProperties();
rxFillProperties.reset( new FillProperties );
xRet.set( new FillPropertiesContext( *this, *rxFillProperties ) );
}
break;
- case NMSP_DRAWINGML|XML_fillRef: // CT_StyleMatrixReference
+ case A_TOKEN( fillRef ): // CT_StyleMatrixReference
{
ShapeStyleRef& rStyleRef = mrTableStylePart.getStyleRefs()[ XML_fillRef ];
rStyleRef.mnThemedIdx = aAttribs.getInteger( XML_idx, 0 );
@@ -113,7 +112,7 @@ TableStyleCellStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c
}
break;
- case NMSP_DRAWINGML|XML_cell3D: // CT_Cell3D
+ case A_TOKEN( cell3D ): // CT_Cell3D
break;
}
if( !xRet.is() )
diff --git a/oox/source/drawingml/table/tablestylecontext.cxx b/oox/source/drawingml/table/tablestylecontext.cxx
index 037ec22d22fc..b63008c8f45e 100644
--- a/oox/source/drawingml/table/tablestylecontext.cxx
+++ b/oox/source/drawingml/table/tablestylecontext.cxx
@@ -31,8 +31,7 @@
#include "oox/drawingml/table/tablestylecontext.hxx"
#include "oox/drawingml/table/tablebackgroundstylecontext.hxx"
#include "oox/drawingml/table/tablepartstylecontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
+
using namespace ::oox::core;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -62,49 +61,49 @@ TableStyleContext::createFastChildContext( ::sal_Int32 aElementToken, const uno:
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_tblBg: // CT_TableBackgroundStyle
+ case A_TOKEN( tblBg ): // CT_TableBackgroundStyle
xRet = new TableBackgroundStyleContext( *this, mrTableStyle );
break;
- case NMSP_DRAWINGML|XML_wholeTbl: // CT_TablePartStyle
+ case A_TOKEN( wholeTbl ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getWholeTbl() );
break;
- case NMSP_DRAWINGML|XML_band1H: // CT_TablePartStyle
+ case A_TOKEN( band1H ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getBand1H() );
break;
- case NMSP_DRAWINGML|XML_band2H: // CT_TablePartStyle
+ case A_TOKEN( band2H ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getBand2H() );
break;
- case NMSP_DRAWINGML|XML_band1V: // CT_TablePartStyle
+ case A_TOKEN( band1V ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getBand1V() );
break;
- case NMSP_DRAWINGML|XML_band2V: // CT_TablePartStyle
+ case A_TOKEN( band2V ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getBand2V() );
break;
- case NMSP_DRAWINGML|XML_lastCol: // CT_TablePartStyle
+ case A_TOKEN( lastCol ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getLastCol() );
break;
- case NMSP_DRAWINGML|XML_firstCol: // CT_TablePartStyle
+ case A_TOKEN( firstCol ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getFirstCol() );
break;
- case NMSP_DRAWINGML|XML_lastRow: // CT_TablePartStyle
+ case A_TOKEN( lastRow ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getLastRow() );
break;
- case NMSP_DRAWINGML|XML_seCell: // CT_TablePartStyle
+ case A_TOKEN( seCell ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getSeCell() );
break;
- case NMSP_DRAWINGML|XML_swCell: // CT_TablePartStyle
+ case A_TOKEN( swCell ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getSwCell() );
break;
- case NMSP_DRAWINGML|XML_firstRow: // CT_TablePartStyle
+ case A_TOKEN( firstRow ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getFirstRow() );
break;
- case NMSP_DRAWINGML|XML_neCell: // CT_TablePartStyle
+ case A_TOKEN( neCell ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getNeCell() );
break;
- case NMSP_DRAWINGML|XML_nwCell: // CT_TablePartStyle
+ case A_TOKEN( nwCell ): // CT_TablePartStyle
xRet = new TablePartStyleContext( *this, mrTableStyle.getNwCell() );
break;
- case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList
+ case A_TOKEN( extLst ): // CT_OfficeArtExtensionList
break;
}
if( !xRet.is() )
diff --git a/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx b/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx
index d257a4e00a0d..3b366163256e 100644
--- a/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx
+++ b/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx
@@ -63,10 +63,10 @@ Reference< XFastContextHandler > TableStyleListFragmentHandler::createFastChildC
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_tblStyleLst: // CT_TableStyleList
+ case A_TOKEN( tblStyleLst ): // CT_TableStyleList
mrTableStyleList.getDefaultStyleId() = xAttribs->getOptionalValue( XML_def );
break;
- case NMSP_DRAWINGML|XML_tblStyle: // CT_TableStyle
+ case A_TOKEN( tblStyle ): // CT_TableStyle
std::vector< TableStyle >& rTableStyles = mrTableStyleList.getTableStyles();
rTableStyles.resize( rTableStyles.size() + 1 );
xRet = new TableStyleContext( *this, xAttribs, rTableStyles.back() );
diff --git a/oox/source/drawingml/table/tablestylepart.cxx b/oox/source/drawingml/table/tablestylepart.cxx
index 8372dd93ef48..9a17973d6b81 100644
--- a/oox/source/drawingml/table/tablestylepart.cxx
+++ b/oox/source/drawingml/table/tablestylepart.cxx
@@ -28,8 +28,6 @@
#include "oox/drawingml/table/tablestylepart.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::oox::core;
diff --git a/oox/source/drawingml/table/tablestyletextstylecontext.cxx b/oox/source/drawingml/table/tablestyletextstylecontext.cxx
index 2e94e57df66a..28f134070493 100644
--- a/oox/source/drawingml/table/tablestyletextstylecontext.cxx
+++ b/oox/source/drawingml/table/tablestyletextstylecontext.cxx
@@ -30,9 +30,8 @@
#include "oox/drawingml/table/tablestyletextstylecontext.hxx"
#include "oox/drawingml/colorchoicecontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
+
using namespace ::oox::core;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -78,23 +77,23 @@ TableStyleTextStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c
switch( aElementToken )
{
// EG_ThemeableFontStyles (choice)
- case NMSP_DRAWINGML|XML_font: // CT_FontCollection
+ case A_TOKEN( font ): // CT_FontCollection
xRet.set( this );
break;
- case NMSP_DRAWINGML|XML_ea: // CT_TextFont
+ case A_TOKEN( ea ): // CT_TextFont
mrTableStylePart.getAsianFont().setAttributes( aAttribs );
return 0;
- case NMSP_DRAWINGML|XML_cs: // CT_TextFont
+ case A_TOKEN( cs ): // CT_TextFont
mrTableStylePart.getComplexFont().setAttributes( aAttribs );
return 0;
- case NMSP_DRAWINGML|XML_sym: // CT_TextFont
+ case A_TOKEN( sym ): // CT_TextFont
mrTableStylePart.getSymbolFont().setAttributes( aAttribs );
return 0;
- case NMSP_DRAWINGML|XML_latin: // CT_TextFont
+ case A_TOKEN( latin ): // CT_TextFont
mrTableStylePart.getLatinFont().setAttributes( aAttribs );
return 0;
- case NMSP_DRAWINGML|XML_fontRef: // CT_FontReference
+ case A_TOKEN( fontRef ): // CT_FontReference
{
ShapeStyleRef& rFontStyle = mrTableStylePart.getStyleRefs()[ XML_fontRef ];
rFontStyle.mnThemedIdx = aAttribs.getToken( XML_idx, XML_none );
@@ -102,7 +101,7 @@ TableStyleTextStyleContext::createFastChildContext( ::sal_Int32 aElementToken, c
}
break;
- case NMSP_DRAWINGML|XML_extLst: // CT_OfficeArtExtensionList
+ case A_TOKEN( extLst ): // CT_OfficeArtExtensionList
break;
}
if( !xRet.is() )
diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx
index aa7d2d45e01a..5c7e96ac7e5c 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -34,8 +34,6 @@
#include "oox/drawingml/textliststylecontext.hxx"
#include "oox/drawingml/textfield.hxx"
#include "oox/drawingml/textfieldcontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -70,7 +68,7 @@ TextParagraphContext::TextParagraphContext( ContextHandler& rParent, TextParagra
// --------------------------------------------------------------------
void TextParagraphContext::endFastElement( sal_Int32 aElementToken ) throw (SAXException, RuntimeException)
{
- if( aElementToken == (NMSP_DRAWINGML|XML_p) )
+ if( aElementToken == (A_TOKEN( p )) )
{
}
}
@@ -84,14 +82,14 @@ Reference< XFastContextHandler > TextParagraphContext::createFastChildContext( s
// EG_TextRun
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_r: // "CT_RegularTextRun" Regular Text Run.
+ case A_TOKEN( r ): // "CT_RegularTextRun" Regular Text Run.
{
TextRunPtr pRun( new TextRun );
mrParagraph.addRun( pRun );
xRet.set( new RegularTextRunContext( *this, pRun ) );
break;
}
- case NMSP_DRAWINGML|XML_br: // "CT_TextLineBreak" Soft return line break (vertical tab).
+ case A_TOKEN( br ): // "CT_TextLineBreak" Soft return line break (vertical tab).
{
TextRunPtr pRun( new TextRun );
pRun->setLineBreak();
@@ -99,17 +97,17 @@ Reference< XFastContextHandler > TextParagraphContext::createFastChildContext( s
xRet.set( new RegularTextRunContext( *this, pRun ) );
break;
}
- case NMSP_DRAWINGML|XML_fld: // "CT_TextField" Text Field.
+ case A_TOKEN( fld ): // "CT_TextField" Text Field.
{
TextFieldPtr pField( new TextField );
mrParagraph.addRun( pField );
xRet.set( new TextFieldContext( *this, xAttribs, *pField ) );
break;
}
- case NMSP_DRAWINGML|XML_pPr:
+ case A_TOKEN( pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, xAttribs, mrParagraph.getProperties() ) );
break;
- case NMSP_DRAWINGML|XML_endParaRPr:
+ case A_TOKEN( endParaRPr ):
xRet.set( new TextCharacterPropertiesContext( *this, xAttribs, mrParagraph.getEndProperties() ) );
break;
}
@@ -131,12 +129,12 @@ void RegularTextRunContext::endFastElement( sal_Int32 aElementToken ) throw (SAX
{
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_t:
+ case A_TOKEN( t ):
{
mbIsInText = false;
break;
}
- case NMSP_DRAWINGML|XML_r:
+ case A_TOKEN( r ):
{
break;
}
@@ -162,10 +160,10 @@ Reference< XFastContextHandler > RegularTextRunContext::createFastChildContext(
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_rPr: // "CT_TextCharPropertyBag" The text char properties of this text run.
+ case A_TOKEN( rPr ): // "CT_TextCharPropertyBag" The text char properties of this text run.
xRet.set( new TextCharacterPropertiesContext( *this, xAttribs, mpRunPtr->getTextCharacterProperties() ) );
break;
- case NMSP_DRAWINGML|XML_t: // "xsd:string" minOccurs="1" The actual text string.
+ case A_TOKEN( t ): // "xsd:string" minOccurs="1" The actual text string.
mbIsInText = true;
break;
}
@@ -195,13 +193,13 @@ Reference< XFastContextHandler > TextBodyContext::createFastChildContext( sal_In
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_bodyPr: // CT_TextBodyPropertyBag
+ case A_TOKEN( bodyPr ): // CT_TextBodyPropertyBag
xRet.set( new TextBodyPropertiesContext( *this, xAttribs, mrTextBody.getTextProperties() ) );
break;
- case NMSP_DRAWINGML|XML_lstStyle: // CT_TextListStyle
+ case A_TOKEN( lstStyle ): // CT_TextListStyle
xRet.set( new TextListStyleContext( *this, mrTextBody.getTextListStyle() ) );
break;
- case NMSP_DRAWINGML|XML_p: // CT_TextParagraph
+ case A_TOKEN( p ): // CT_TextParagraph
xRet.set( new TextParagraphContext( *this, mrTextBody.addParagraph() ) );
break;
}
diff --git a/oox/source/drawingml/textbodyproperties.cxx b/oox/source/drawingml/textbodyproperties.cxx
index dc829c1b2c62..7a7461064096 100644
--- a/oox/source/drawingml/textbodyproperties.cxx
+++ b/oox/source/drawingml/textbodyproperties.cxx
@@ -28,8 +28,7 @@
#include "oox/drawingml/textbodyproperties.hxx"
#include <com/sun/star/text/WritingMode.hpp>
-#include "properties.hxx"
-#include "tokens.hxx"
+#include "oox/token/tokens.hxx"
namespace oox {
namespace drawingml {
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx
index 937af3de4920..7cc7affbbb24 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -38,9 +38,6 @@
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/propertymap.hxx"
-#include "oox/core/namespaces.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -163,27 +160,27 @@ Reference< XFastContextHandler > TextBodyPropertiesContext::createFastChildConte
switch( aElementToken )
{
// Sequence
- case NMSP_DRAWINGML|XML_prstTxWarp: // CT_PresetTextShape
- case NMSP_DRAWINGML|XML_prot: // CT_TextProtectionProperty
+ case A_TOKEN( prstTxWarp ): // CT_PresetTextShape
+ case A_TOKEN( prot ): // CT_TextProtectionProperty
break;
// EG_TextAutofit
- case NMSP_DRAWINGML|XML_noAutofit:
+ case A_TOKEN( noAutofit ):
mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= false; // CT_TextNoAutofit
break;
- case NMSP_DRAWINGML|XML_normAutofit: // CT_TextNormalAutofit
+ case A_TOKEN( normAutofit ): // CT_TextNormalAutofit
mrTextBodyProp.maPropertyMap[ PROP_TextFitToSize ] <<= TextFitToSizeType_AUTOFIT;
mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= false;
break;
- case NMSP_DRAWINGML|XML_spAutoFit:
+ case A_TOKEN( spAutoFit ):
mrTextBodyProp.maPropertyMap[ PROP_TextAutoGrowHeight ] <<= true;
break;
- case NMSP_DRAWINGML|XML_scene3d: // CT_Scene3D
+ case A_TOKEN( scene3d ): // CT_Scene3D
// EG_Text3D
- case NMSP_DRAWINGML|XML_sp3d: // CT_Shape3D
- case NMSP_DRAWINGML|XML_flatTx: // CT_FlatText
+ case A_TOKEN( sp3d ): // CT_Shape3D
+ case A_TOKEN( flatTx ): // CT_FlatText
break;
}
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index feda383cf444..fb4b0690bc80 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -34,8 +34,7 @@
#include "oox/helper/propertyset.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
+#include "oox/token/tokens.hxx"
using ::rtl::OUString;
using ::oox::core::XmlFilterBase;
@@ -97,7 +96,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource
rPropMap[ PROP_CharFontFamilyComplex ] <<= nFontFamily;
}
- // symbol font not supported
+ // symbolfont, will now be ... textrun.cxx ... ausgewertet !!!i#113673
if( maCharColor.isUsed() )
rPropMap[ PROP_CharColor ] <<= maCharColor.getColor( rFilter.getGraphicHelper() );
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index 76872af57d50..7fffb56fa317 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -33,10 +33,8 @@
#include "oox/drawingml/colorchoicecontext.hxx"
#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/textparagraphproperties.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/relations.hxx"
#include "hyperlinkcontext.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -79,21 +77,21 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext(
// ST_TextNonNegativePoint
const OUString sCharKerning( CREATE_OUSTRING( "CharKerning" ) );
- //case NMSP_DRAWINGML|XML_kern:
+ //case A_TOKEN( kern ):
// ST_TextLanguageID
OUString sAltLang = rXAttributes->getOptionalValue( XML_altLang );
- case NMSP_DRAWINGML|XML_kumimoji: // xsd:boolean
+ case A_TOKEN( kumimoji ): // xsd:boolean
break;
- case NMSP_DRAWINGML|XML_spc: // ST_TextPoint
- case NMSP_DRAWINGML|XML_normalizeH: // xsd:boolean
- case NMSP_DRAWINGML|XML_baseline: // ST_Percentage
- case NMSP_DRAWINGML|XML_noProof: // xsd:boolean
- case NMSP_DRAWINGML|XML_dirty: // xsd:boolean
- case NMSP_DRAWINGML|XML_err: // xsd:boolean
- case NMSP_DRAWINGML|XML_smtClean: // xsd:boolean
- case NMSP_DRAWINGML|XML_smtId: // xsd:unsignedInt
+ case A_TOKEN( spc ): // ST_TextPoint
+ case A_TOKEN( normalizeH ): // xsd:boolean
+ case A_TOKEN( baseline ): // ST_Percentage
+ case A_TOKEN( noProof ): // xsd:boolean
+ case A_TOKEN( dirty ): // xsd:boolean
+ case A_TOKEN( err ): // xsd:boolean
+ case A_TOKEN( smtClean ): // xsd:boolean
+ case A_TOKEN( smtId ): // xsd:unsignedInt
break;
*/
@@ -118,56 +116,56 @@ Reference< XFastContextHandler > TextCharacterPropertiesContext::createFastChild
switch( aElementToken )
{
// TODO unsupported yet
-// case NMSP_DRAWINGML|XML_ln: // CT_LineProperties
+// case A_TOKEN( ln ): // CT_LineProperties
// xRet.set( new LinePropertiesContext( getHandler(), xAttributes, maTextOutlineProperties ) );
// break;
- case NMSP_DRAWINGML|XML_solidFill: // EG_FillProperties
+ case A_TOKEN( solidFill ): // EG_FillProperties
xRet.set( new ColorContext( *this, mrTextCharacterProperties.maCharColor ) );
break;
// EG_EffectProperties
- case NMSP_DRAWINGML|XML_effectDag: // CT_EffectContainer 5.1.10.25
- case NMSP_DRAWINGML|XML_effectLst: // CT_EffectList 5.1.10.26
+ case A_TOKEN( effectDag ): // CT_EffectContainer 5.1.10.25
+ case A_TOKEN( effectLst ): // CT_EffectList 5.1.10.26
break;
- case NMSP_DRAWINGML|XML_highlight: // CT_Color
+ case A_TOKEN( highlight ): // CT_Color
xRet.set( new ColorContext( *this, mrTextCharacterProperties.maHighlightColor ) );
break;
// EG_TextUnderlineLine
- case NMSP_DRAWINGML|XML_uLnTx: // CT_TextUnderlineLineFollowText
+ case A_TOKEN( uLnTx ): // CT_TextUnderlineLineFollowText
mrTextCharacterProperties.moUnderlineLineFollowText = true;
break;
// TODO unsupported yet
-// case NMSP_DRAWINGML|XML_uLn: // CT_LineProperties
+// case A_TOKEN( uLn ): // CT_LineProperties
// xRet.set( new LinePropertiesContext( getHandler(), xAttributes, maUnderlineProperties ) );
// break;
// EG_TextUnderlineFill
- case NMSP_DRAWINGML|XML_uFillTx: // CT_TextUnderlineFillFollowText
+ case A_TOKEN( uFillTx ): // CT_TextUnderlineFillFollowText
mrTextCharacterProperties.moUnderlineFillFollowText = true;
break;
- case NMSP_DRAWINGML|XML_uFill: // CT_TextUnderlineFillGroupWrapper->EG_FillProperties (not supported)
+ case A_TOKEN( uFill ): // CT_TextUnderlineFillGroupWrapper->EG_FillProperties (not supported)
xRet.set( new SimpleFillPropertiesContext( *this, mrTextCharacterProperties.maUnderlineColor ) );
break;
// CT_FontCollection
- case NMSP_DRAWINGML|XML_latin: // CT_TextFont
+ case A_TOKEN( latin ): // CT_TextFont
mrTextCharacterProperties.maLatinFont.setAttributes( aAttribs );
break;
- case NMSP_DRAWINGML|XML_ea: // CT_TextFont
+ case A_TOKEN( ea ): // CT_TextFont
mrTextCharacterProperties.maAsianFont.setAttributes( aAttribs );
break;
- case NMSP_DRAWINGML|XML_cs: // CT_TextFont
+ case A_TOKEN( cs ): // CT_TextFont
mrTextCharacterProperties.maComplexFont.setAttributes( aAttribs );
break;
- case NMSP_DRAWINGML|XML_sym: // CT_TextFont
+ case A_TOKEN( sym ): // CT_TextFont
mrTextCharacterProperties.maSymbolFont.setAttributes( aAttribs );
break;
- case NMSP_DRAWINGML|XML_hlinkClick: // CT_Hyperlink
- case NMSP_DRAWINGML|XML_hlinkMouseOver: // CT_Hyperlink
+ case A_TOKEN( hlinkClick ): // CT_Hyperlink
+ case A_TOKEN( hlinkMouseOver ): // CT_Hyperlink
xRet.set( new HyperLinkContext( *this, xAttributes, mrTextCharacterProperties.maHyperlinkPropertyMap ) );
break;
}
diff --git a/oox/source/drawingml/textfieldcontext.cxx b/oox/source/drawingml/textfieldcontext.cxx
index 9629172cb2e7..53cc02525592 100644
--- a/oox/source/drawingml/textfieldcontext.cxx
+++ b/oox/source/drawingml/textfieldcontext.cxx
@@ -30,8 +30,6 @@
#include "oox/drawingml/textparagraphpropertiescontext.hxx"
#include "oox/drawingml/textcharacterpropertiescontext.hxx"
#include "oox/drawingml/textfield.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -53,7 +51,7 @@ TextFieldContext::TextFieldContext( ContextHandler& rParent,
void TextFieldContext::endFastElement( sal_Int32 aElementToken ) throw (SAXException, RuntimeException)
{
- if( aElementToken == (NMSP_DRAWINGML|XML_t) )
+ if( aElementToken == (A_TOKEN( t )) )
{
mbIsInText = false;
}
@@ -73,13 +71,13 @@ Reference< XFastContextHandler > TextFieldContext::createFastChildContext( sal_I
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_rPr:
+ case A_TOKEN( rPr ):
xRet.set( new TextCharacterPropertiesContext( *this, xAttribs, mrTextField.getTextCharacterProperties() ) );
break;
- case NMSP_DRAWINGML|XML_pPr:
+ case A_TOKEN( pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, xAttribs, mrTextField.getTextParagraphProperties() ) );
break;
- case NMSP_DRAWINGML|XML_t:
+ case A_TOKEN( t ):
mbIsInText = true;
break;
}
diff --git a/oox/source/drawingml/textfont.cxx b/oox/source/drawingml/textfont.cxx
index 52af8d187549..a2909be5a6be 100644
--- a/oox/source/drawingml/textfont.cxx
+++ b/oox/source/drawingml/textfont.cxx
@@ -32,7 +32,6 @@
#include "oox/drawingml/theme.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using ::oox::core::XmlFilterBase;
diff --git a/oox/source/drawingml/textliststyle.cxx b/oox/source/drawingml/textliststyle.cxx
index 193ddaf48eaa..520c5d6b73d1 100644
--- a/oox/source/drawingml/textliststyle.cxx
+++ b/oox/source/drawingml/textliststyle.cxx
@@ -66,17 +66,6 @@ void TextListStyle::apply( const TextListStyle& rTextListStyle )
applyStyleList( rTextListStyle.getListStyle(), getListStyle() );
}
-#if OSL_DEBUG_LEVEL > 0
-void TextListStyle::dump( int nLevels ) const
-{
- for ( int i = 0; i < nLevels; i++ )
- {
- OSL_TRACE("level: %d", i);
- maListStyle[ i ]->dump();
- }
-}
-#endif
-
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/textliststylecontext.cxx b/oox/source/drawingml/textliststylecontext.cxx
index 1a972519f3a0..d32c6089989c 100644
--- a/oox/source/drawingml/textliststylecontext.cxx
+++ b/oox/source/drawingml/textliststylecontext.cxx
@@ -28,9 +28,7 @@
#include "oox/drawingml/textliststylecontext.hxx"
#include "oox/drawingml/textparagraphpropertiescontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -65,40 +63,40 @@ Reference< XFastContextHandler > TextListStyleContext::createFastChildContext( s
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_defPPr: // CT_TextParagraphProperties
+ case A_TOKEN( defPPr ): // CT_TextParagraphProperties
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 0 ] ) );
break;
- case NMSP_DRAWINGML|XML_outline1pPr:
+ case A_TOKEN( outline1pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getAggregationListStyle()[ 0 ] ) );
break;
- case NMSP_DRAWINGML|XML_outline2pPr:
+ case A_TOKEN( outline2pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getAggregationListStyle()[ 1 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl1pPr:
+ case A_TOKEN( lvl1pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 0 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl2pPr:
+ case A_TOKEN( lvl2pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 1 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl3pPr:
+ case A_TOKEN( lvl3pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 2 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl4pPr:
+ case A_TOKEN( lvl4pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 3 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl5pPr:
+ case A_TOKEN( lvl5pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 4 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl6pPr:
+ case A_TOKEN( lvl6pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 5 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl7pPr:
+ case A_TOKEN( lvl7pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 6 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl8pPr:
+ case A_TOKEN( lvl8pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 7 ] ) );
break;
- case NMSP_DRAWINGML|XML_lvl9pPr:
+ case A_TOKEN( lvl9pPr ):
xRet.set( new TextParagraphPropertiesContext( *this, rxAttributes, *mrTextListStyle.getListStyle()[ 8 ] ) );
break;
}
diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx
index 4851af4a78f0..dbcc6f0194aa 100644
--- a/oox/source/drawingml/textparagraphproperties.cxx
+++ b/oox/source/drawingml/textparagraphproperties.cxx
@@ -38,11 +38,8 @@
#include "oox/helper/helper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
#if OSL_DEBUG_LEVEL > 0
#include <vcl/unohelp.hxx>
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index 827498c6c657..0bee2766e673 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -35,11 +35,8 @@
#include "oox/drawingml/textcharacterpropertiescontext.hxx"
#include "oox/drawingml/fillproperties.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
-#include "properties.hxx"
#include "textspacingcontext.hxx"
#include "texttabstoplistcontext.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -188,49 +185,49 @@ Reference< XFastContextHandler > TextParagraphPropertiesContext::createFastChild
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_lnSpc: // CT_TextSpacing
+ case A_TOKEN( lnSpc ): // CT_TextSpacing
xRet.set( new TextSpacingContext( *this, maLineSpacing ) );
break;
- case NMSP_DRAWINGML|XML_spcBef: // CT_TextSpacing
+ case A_TOKEN( spcBef ): // CT_TextSpacing
xRet.set( new TextSpacingContext( *this, mrSpaceBefore ) );
break;
- case NMSP_DRAWINGML|XML_spcAft: // CT_TextSpacing
+ case A_TOKEN( spcAft ): // CT_TextSpacing
xRet.set( new TextSpacingContext( *this, mrSpaceAfter ) );
break;
// EG_TextBulletColor
- case NMSP_DRAWINGML|XML_buClrTx: // CT_TextBulletColorFollowText ???
+ case A_TOKEN( buClrTx ): // CT_TextBulletColorFollowText ???
mrBulletList.mbBulletColorFollowText <<= sal_True;
break;
- case NMSP_DRAWINGML|XML_buClr: // CT_Color
+ case A_TOKEN( buClr ): // CT_Color
xRet.set( new ColorContext( *this, *mrBulletList.maBulletColorPtr ) );
break;
// EG_TextBulletSize
- case NMSP_DRAWINGML|XML_buSzTx: // CT_TextBulletSizeFollowText
+ case A_TOKEN( buSzTx ): // CT_TextBulletSizeFollowText
mrBulletList.setBulletSize(100);
break;
- case NMSP_DRAWINGML|XML_buSzPct: // CT_TextBulletSizePercent
+ case A_TOKEN( buSzPct ): // CT_TextBulletSizePercent
mrBulletList.setBulletSize( static_cast<sal_Int16>( GetPercent( rXAttributes->getOptionalValue( XML_val ) ) / 1000 ) );
break;
- case NMSP_DRAWINGML|XML_buSzPts: // CT_TextBulletSizePoint
+ case A_TOKEN( buSzPts ): // CT_TextBulletSizePoint
mrBulletList.setBulletSize(0);
mrBulletList.setFontSize( static_cast<sal_Int16>(GetTextSize( rXAttributes->getOptionalValue( XML_val ) ) ) );
break;
// EG_TextBulletTypeface
- case NMSP_DRAWINGML|XML_buFontTx: // CT_TextBulletTypefaceFollowText
+ case A_TOKEN( buFontTx ): // CT_TextBulletTypefaceFollowText
mrBulletList.mbBulletFontFollowText <<= sal_True;
break;
- case NMSP_DRAWINGML|XML_buFont: // CT_TextFont
+ case A_TOKEN( buFont ): // CT_TextFont
mrBulletList.maBulletFont.setAttributes( aAttribs );
break;
// EG_TextBullet
- case NMSP_DRAWINGML|XML_buNone: // CT_TextNoBullet
+ case A_TOKEN( buNone ): // CT_TextNoBullet
mrBulletList.setNone();
break;
- case NMSP_DRAWINGML|XML_buAutoNum: // CT_TextAutonumberBullet
+ case A_TOKEN( buAutoNum ): // CT_TextAutonumberBullet
{
AttributeList attribs( rXAttributes );
try {
@@ -253,7 +250,7 @@ Reference< XFastContextHandler > TextParagraphPropertiesContext::createFastChild
}
break;
}
- case NMSP_DRAWINGML|XML_buChar: // CT_TextCharBullet
+ case A_TOKEN( buChar ): // CT_TextCharBullet
try {
mrBulletList.setBulletChar( rXAttributes->getValue( XML_char ) );
}
@@ -262,17 +259,17 @@ Reference< XFastContextHandler > TextParagraphPropertiesContext::createFastChild
OSL_TRACE("OOX: SAXException in XML_buChar");
}
break;
- case NMSP_DRAWINGML|XML_buBlip: // CT_TextBlipBullet
+ case A_TOKEN( buBlip ): // CT_TextBlipBullet
{
mxBlipProps.reset( new BlipFillProperties );
xRet.set( new BlipFillContext( *this, rXAttributes, *mxBlipProps ) );
}
break;
- case NMSP_DRAWINGML|XML_tabLst: // CT_TextTabStopList
+ case A_TOKEN( tabLst ): // CT_TextTabStopList
xRet.set( new TextTabStopListContext( *this, maTabList ) );
break;
- case NMSP_DRAWINGML|XML_defRPr: // CT_TextCharacterProperties
+ case A_TOKEN( defRPr ): // CT_TextCharacterProperties
xRet.set( new TextCharacterPropertiesContext( *this, rXAttributes, mrTextParagraphProperties.getTextCharacterProperties() ) );
break;
}
diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx
index bd5ba0003118..89fa6d832db8 100644
--- a/oox/source/drawingml/textrun.cxx
+++ b/oox/source/drawingml/textrun.cxx
@@ -36,7 +36,6 @@
#include "oox/helper/helper.hxx"
#include "oox/helper/propertyset.hxx"
#include "oox/core/xmlfilterbase.hxx"
-#include "properties.hxx"
using ::rtl::OUString;
using namespace ::com::sun::star::uno;
@@ -79,7 +78,55 @@ void TextRun::insertAt(
}
else
{
- xText->insertString( xStart, getText(), sal_False );
+ OUString aLatinFontName, aSymbolFontName;
+ sal_Int16 nLatinFontPitch = 0, nSymbolFontPitch = 0;
+ sal_Int16 nLatinFontFamily = 0, nSymbolFontFamily = 0;
+
+ if ( !aTextCharacterProps.maSymbolFont.getFontData( aSymbolFontName, nSymbolFontPitch, nSymbolFontFamily, rFilterBase ) )
+ xText->insertString( xStart, getText(), sal_False );
+ else if ( getText().getLength() )
+ { // !!#i113673<<<
+ aTextCharacterProps.maLatinFont.getFontData( aLatinFontName, nLatinFontPitch, nLatinFontFamily, rFilterBase );
+
+ sal_Int32 nIndex = 0;
+ while ( sal_True )
+ {
+ sal_Int32 nCount = 0;
+ sal_Bool bSymbol = ( getText()[ nIndex ] & 0xff00 ) == 0xf000;
+ if ( bSymbol )
+ {
+ do
+ {
+ nCount++;
+ }
+ while( ( ( nCount + nIndex ) < getText().getLength() ) && ( ( getText()[ nCount + nIndex ] & 0xff00 ) == 0xf000 ) );
+ aPropSet.setAnyProperty( PROP_CharFontName, Any( aSymbolFontName ) );
+ aPropSet.setAnyProperty( PROP_CharFontPitch, Any( nSymbolFontPitch ) );
+ aPropSet.setAnyProperty( PROP_CharFontFamily, Any( nSymbolFontFamily ) );
+ }
+ else
+ {
+ do
+ {
+ nCount++;
+ }
+ while( ( ( nCount + nIndex ) < getText().getLength() ) && ( ( getText()[ nCount + nIndex ] & 0xff00 ) != 0xf000 ) );
+ aPropSet.setAnyProperty( PROP_CharFontName, Any( aLatinFontName ) );
+ aPropSet.setAnyProperty( PROP_CharFontPitch, Any( nLatinFontPitch ) );
+ aPropSet.setAnyProperty( PROP_CharFontFamily, Any( nLatinFontFamily ) );
+ }
+ rtl::OUString aSubString( getText().copy( nIndex, nCount ) );
+ xText->insertString( xStart, aSubString, sal_False );
+ nIndex += nCount;
+
+ if ( nIndex >= getText().getLength() )
+ break;
+
+ xStart = Reference< XTextRange >( xAt, UNO_QUERY );
+ aPropSet = PropertySet( xStart );
+ aTextCharacterProps.pushToPropSet( aPropSet, rFilterBase );
+ }
+ }
}
}
else
diff --git a/oox/source/drawingml/textspacingcontext.cxx b/oox/source/drawingml/textspacingcontext.cxx
index eed34e2a368a..6ba72137e18a 100644
--- a/oox/source/drawingml/textspacingcontext.cxx
+++ b/oox/source/drawingml/textspacingcontext.cxx
@@ -28,10 +28,7 @@
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/textspacing.hxx"
-#include "oox/core/namespaces.hxx"
#include "textspacingcontext.hxx"
-#include "tokens.hxx"
-
using namespace ::oox::core;
using namespace ::com::sun::star::xml::sax;
@@ -53,17 +50,17 @@ namespace oox { namespace drawingml {
}
Reference< XFastContextHandler > TextSpacingContext::createFastChildContext( ::sal_Int32 aElement,
- const Reference< XFastAttributeList >& xAttribs )
+ const Reference< XFastAttributeList >& xAttribs )
throw ( SAXException, RuntimeException )
{
Reference< XFastContextHandler > xRet;
switch( aElement )
{
- case NMSP_DRAWINGML|XML_spcPct:
+ case A_TOKEN( spcPct ):
maSpacing.nUnit = TextSpacing::PERCENT;
maSpacing.nValue = GetPercent( xAttribs->getValue( XML_val ) );
break;
- case NMSP_DRAWINGML|XML_spcPts:
+ case A_TOKEN( spcPts ):
maSpacing.nUnit = TextSpacing::POINTS;
maSpacing.nValue = GetTextSpacingPoint( xAttribs->getValue( XML_val ) );
break;
diff --git a/oox/source/drawingml/texttabstoplistcontext.cxx b/oox/source/drawingml/texttabstoplistcontext.cxx
index 16f9c330532c..4e3340f7f192 100644
--- a/oox/source/drawingml/texttabstoplistcontext.cxx
+++ b/oox/source/drawingml/texttabstoplistcontext.cxx
@@ -31,10 +31,8 @@
#include <rtl/ustring.hxx>
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "texttabstoplistcontext.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -67,7 +65,7 @@ namespace oox { namespace drawingml {
Reference< XFastContextHandler > xRet;
switch( aElement )
{
- case NMSP_DRAWINGML|XML_tab:
+ case A_TOKEN( tab ):
{
OUString sValue;
TabStop aTabStop;
diff --git a/oox/source/drawingml/theme.cxx b/oox/source/drawingml/theme.cxx
index 430aabcb1b2a..47a7d30bc470 100644
--- a/oox/source/drawingml/theme.cxx
+++ b/oox/source/drawingml/theme.cxx
@@ -27,7 +27,6 @@
************************************************************************/
#include "oox/drawingml/theme.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
diff --git a/oox/source/drawingml/themeelementscontext.cxx b/oox/source/drawingml/themeelementscontext.cxx
index 03b4c51e4c29..9d6573b8e20e 100644
--- a/oox/source/drawingml/themeelementscontext.cxx
+++ b/oox/source/drawingml/themeelementscontext.cxx
@@ -33,9 +33,7 @@
#include "oox/drawingml/fillproperties.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/theme.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -68,12 +66,12 @@ Reference< XFastContextHandler > FillStyleListContext::createFastChildContext( s
{
switch( nElement )
{
- case NMSP_DRAWINGML|XML_noFill:
- case NMSP_DRAWINGML|XML_solidFill:
- case NMSP_DRAWINGML|XML_gradFill:
- case NMSP_DRAWINGML|XML_blipFill:
- case NMSP_DRAWINGML|XML_pattFill:
- case NMSP_DRAWINGML|XML_grpFill:
+ case A_TOKEN( noFill ):
+ case A_TOKEN( solidFill ):
+ case A_TOKEN( gradFill ):
+ case A_TOKEN( blipFill ):
+ case A_TOKEN( pattFill ):
+ case A_TOKEN( grpFill ):
mrFillStyleList.push_back( FillPropertiesPtr( new FillProperties ) );
return FillPropertiesContext::createFillContext( *this, nElement, xAttribs, *mrFillStyleList.back() );
}
@@ -103,7 +101,7 @@ Reference< XFastContextHandler > LineStyleListContext::createFastChildContext( s
{
switch( nElement )
{
- case NMSP_DRAWINGML|XML_ln:
+ case A_TOKEN( ln ):
mrLineStyleList.push_back( LinePropertiesPtr( new LineProperties ) );
return new LinePropertiesContext( *this, xAttribs, *mrLineStyleList.back() );
}
@@ -132,7 +130,7 @@ Reference< XFastContextHandler > EffectStyleListContext::createFastChildContext(
{
switch( nElement )
{
- case NMSP_DRAWINGML|XML_effectStyle:
+ case A_TOKEN( effectStyle ):
mrEffectStyleList.push_back( EffectStyleList::value_type( new PropertyMap ) );
// TODO: import effect styles
return 0;
@@ -166,24 +164,24 @@ Reference< XFastContextHandler > FontSchemeContext::createFastChildContext( sal_
AttributeList aAttribs( rxAttribs );
switch( nElement )
{
- case NMSP_DRAWINGML|XML_majorFont:
+ case A_TOKEN( majorFont ):
mxCharProps.reset( new TextCharacterProperties );
mrFontScheme[ XML_major ] = mxCharProps;
return this;
- case NMSP_DRAWINGML|XML_minorFont:
+ case A_TOKEN( minorFont ):
mxCharProps.reset( new TextCharacterProperties );
mrFontScheme[ XML_minor ] = mxCharProps;
return this;
- case NMSP_DRAWINGML|XML_latin:
+ case A_TOKEN( latin ):
if( mxCharProps.get() )
mxCharProps->maLatinFont.setAttributes( aAttribs );
break;
- case NMSP_DRAWINGML|XML_ea:
+ case A_TOKEN( ea ):
if( mxCharProps.get() )
mxCharProps->maAsianFont.setAttributes( aAttribs );
break;
- case NMSP_DRAWINGML|XML_cs:
+ case A_TOKEN( cs ):
if( mxCharProps.get() )
mxCharProps->maComplexFont.setAttributes( aAttribs );
break;
@@ -195,8 +193,8 @@ void FontSchemeContext::endFastElement( sal_Int32 nElement ) throw (SAXException
{
switch( nElement )
{
- case NMSP_DRAWINGML|XML_majorFont:
- case NMSP_DRAWINGML|XML_minorFont:
+ case A_TOKEN( majorFont ):
+ case A_TOKEN( minorFont ):
mxCharProps.reset();
break;
}
@@ -216,22 +214,22 @@ Reference< XFastContextHandler > ThemeElementsContext::createFastChildContext( s
Reference< XFastContextHandler > xRet;
switch( nElement )
{
- case NMSP_DRAWINGML|XML_clrScheme: // CT_ColorScheme
+ case A_TOKEN( clrScheme ): // CT_ColorScheme
return new clrSchemeContext( *this, mrTheme.getClrScheme() );
- case NMSP_DRAWINGML|XML_fontScheme: // CT_FontScheme
+ case A_TOKEN( fontScheme ): // CT_FontScheme
return new FontSchemeContext( *this, mrTheme.getFontScheme() );
- case NMSP_DRAWINGML|XML_fmtScheme: // CT_StyleMatrix
+ case A_TOKEN( fmtScheme ): // CT_StyleMatrix
mrTheme.setStyleName( xAttribs->getOptionalValue( XML_name ) );
return this;
- case NMSP_DRAWINGML|XML_fillStyleLst: // CT_FillStyleList
+ case A_TOKEN( fillStyleLst ): // CT_FillStyleList
return new FillStyleListContext( *this, mrTheme.getFillStyleList() );
- case NMSP_DRAWINGML|XML_lnStyleLst: // CT_LineStyleList
+ case A_TOKEN( lnStyleLst ): // CT_LineStyleList
return new LineStyleListContext( *this, mrTheme.getLineStyleList() );
- case NMSP_DRAWINGML|XML_effectStyleLst: // CT_EffectStyleList
+ case A_TOKEN( effectStyleLst ): // CT_EffectStyleList
return new EffectStyleListContext( *this, mrTheme.getEffectStyleList() );
- case NMSP_DRAWINGML|XML_bgFillStyleLst: // CT_BackgroundFillStyleList
+ case A_TOKEN( bgFillStyleLst ): // CT_BackgroundFillStyleList
return new FillStyleListContext( *this, mrTheme.getBgFillStyleList() );
}
return 0;
diff --git a/oox/source/drawingml/themefragmenthandler.cxx b/oox/source/drawingml/themefragmenthandler.cxx
index 0d8973d5748a..2068c8af0abd 100644
--- a/oox/source/drawingml/themefragmenthandler.cxx
+++ b/oox/source/drawingml/themefragmenthandler.cxx
@@ -57,23 +57,23 @@ ContextHandlerRef ThemeFragmentHandler::onCreateContext( sal_Int32 nElement, con
case XML_ROOT_CONTEXT:
switch( nElement )
{
- case NMSP_DRAWINGML|XML_theme:
+ case A_TOKEN( theme ):
return this;
}
break;
- case NMSP_DRAWINGML|XML_theme:
+ case A_TOKEN( theme ):
switch( nElement )
{
- case NMSP_DRAWINGML|XML_themeElements: // CT_BaseStyles
+ case A_TOKEN( themeElements ): // CT_BaseStyles
return new ThemeElementsContext( *this, mrTheme );
- case NMSP_DRAWINGML|XML_objectDefaults: // CT_ObjectStyleDefaults
+ case A_TOKEN( objectDefaults ): // CT_ObjectStyleDefaults
return new objectDefaultContext( *this, mrTheme );
- case NMSP_DRAWINGML|XML_extraClrSchemeLst: // CT_ColorSchemeList
+ case A_TOKEN( extraClrSchemeLst ): // CT_ColorSchemeList
return 0;
- case NMSP_DRAWINGML|XML_custClrLst: // CustomColorList
+ case A_TOKEN( custClrLst ): // CustomColorList
return 0;
- case NMSP_DRAWINGML|XML_ext: // CT_OfficeArtExtension
+ case A_TOKEN( ext ): // CT_OfficeArtExtension
return 0;
}
break;
diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx
index 0dc8bd805605..1d4501890beb 100644
--- a/oox/source/drawingml/transform2dcontext.cxx
+++ b/oox/source/drawingml/transform2dcontext.cxx
@@ -27,7 +27,6 @@
************************************************************************/
#include "oox/drawingml/transform2dcontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/drawingml/shape.hxx"
@@ -59,16 +58,16 @@ Reference< XFastContextHandler > Transform2DContext::createFastChildContext( sal
{
switch( aElementToken )
{
- case NMSP_DRAWINGML|XML_off: // horz/vert translation
+ case A_TOKEN( off ): // horz/vert translation
mrShape.setPosition( Point( xAttribs->getOptionalValue( XML_x ).toInt32(), xAttribs->getOptionalValue( XML_y ).toInt32() ) );
break;
- case NMSP_DRAWINGML|XML_ext: // horz/vert size
+ case A_TOKEN( ext ): // horz/vert size
mrShape.setSize( Size( xAttribs->getOptionalValue( XML_cx ).toInt32(), xAttribs->getOptionalValue( XML_cy ).toInt32() ) );
break;
- case NMSP_DRAWINGML|XML_chOff: // horz/vert translation of children
+ case A_TOKEN( chOff ): // horz/vert translation of children
mrShape.setChildPosition( Point( xAttribs->getOptionalValue( XML_x ).toInt32(), xAttribs->getOptionalValue( XML_y ).toInt32() ) );
break;
- case NMSP_DRAWINGML|XML_chExt: // horz/vert size of children
+ case A_TOKEN( chExt ): // horz/vert size of children
mrShape.setChildSize( Size( xAttribs->getOptionalValue( XML_cx ).toInt32(), xAttribs->getOptionalValue( XML_cy ).toInt32() ) );
break;
}
diff --git a/oox/source/dump/biffdumper.cxx b/oox/source/dump/biffdumper.cxx
index d8bfccc46610..fd7c3ac0193f 100644
--- a/oox/source/dump/biffdumper.cxx
+++ b/oox/source/dump/biffdumper.cxx
@@ -30,8 +30,8 @@
#include <osl/thread.h>
#include <rtl/tencinfo.h>
-#include "oox/dump/oledumper.hxx"
#include "oox/core/filterbase.hxx"
+#include "oox/dump/oledumper.hxx"
#include "oox/ole/olestorage.hxx"
#include "oox/xls/biffdetector.hxx"
#include "oox/xls/biffinputstream.hxx"
@@ -39,23 +39,27 @@
#if OOX_INCLUDE_DUMPER
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
+namespace oox {
+namespace dump {
+namespace biff {
+
+// ============================================================================
+
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+using namespace ::oox::xls;
+
+using ::comphelper::MediaDescriptor;
+using ::oox::core::FilterBase;
using ::rtl::OString;
using ::rtl::OStringBuffer;
using ::rtl::OStringToOUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::io::XInputStream;
-using ::comphelper::MediaDescriptor;
-using ::oox::core::FilterBase;
-
-using namespace ::oox::xls;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
-namespace oox {
-namespace dump {
-namespace biff {
+// ============================================================================
namespace {
@@ -94,12 +98,7 @@ const sal_uInt16 BIFF_STYLE_BUILTIN = 0x8000;
const sal_uInt16 BIFF_PT_NOSTRING = 0xFFFF;
-} // namespace
-
-// ============================================================================
-// ============================================================================
-
-namespace {
+// ----------------------------------------------------------------------------
void lclDumpDffClientPos( const OutputRef& rxOut, const BinaryInputStreamRef& rxStrm, const String& rName, sal_uInt16 nSubScale )
{
@@ -129,7 +128,8 @@ void lclDumpDffClientRect( const OutputRef& rxOut, const BinaryInputStreamRef& r
} // namespace
-// ----------------------------------------------------------------------------
+// ============================================================================
+// ============================================================================
BiffDffStreamObject::BiffDffStreamObject( const OutputObjectBase& rParent, const BinaryInputStreamRef& rxStrm )
{
@@ -538,6 +538,26 @@ OUString BiffObjectBase::dumpString( const String& rName, BiffStringFlags nByteF
return (getBiff() == BIFF8) ? dumpUniString( rName, nUniFlags ) : dumpByteString( rName, nByteFlags, eDefaultTextEnc );
}
+OUString BiffObjectBase::dumpSegmentedUniString( const String& rName )
+{
+ sal_Int32 nLength = mxBiffStrm->readInt32();
+ OUStringBuffer aBuffer;
+ while( !mxBiffStrm->isEof() && (aBuffer.getLength() < nLength) )
+ aBuffer.append( mxBiffStrm->readUniString() );
+ OUString aString = aBuffer.makeStringAndClear();
+ writeStringItem( rName, aString );
+ return aString;
+}
+
+void BiffObjectBase::dumpSegmentedUniStringArray( const String& rName )
+{
+ writeEmptyItem( rName );
+ IndentGuard aIndGuard( mxOut );
+ mxOut->resetItemIndex();
+ for( sal_uInt16 nIndex = 0, nCount = dumpDec< sal_uInt16 >( "count" ); !mxBiffStrm->isEof() && (nIndex < nCount); ++nIndex )
+ dumpSegmentedUniString( "#entry" );
+}
+
sal_uInt8 BiffObjectBase::dumpBoolean( const String& rName )
{
sal_uInt8 nBool;
@@ -1736,6 +1756,18 @@ void WorkbookStreamObject::implDumpRecordBody()
if( eBiff >= BIFF5 ) dumpHex< sal_uInt16 >( "flags", "CHDATAFORMAT-FLAGS" );
break;
+ case BIFF_ID_CHDATERANGE:
+ dumpDec< sal_uInt16 >( "minimum-date" );
+ dumpDec< sal_uInt16 >( "maximum-date" );
+ dumpDec< sal_uInt16 >( "major-unit-value" );
+ dumpDec< sal_uInt16 >( "major-unit", "CHDATERANGE-UNIT" );
+ dumpDec< sal_uInt16 >( "minor-unit-value" );
+ dumpDec< sal_uInt16 >( "minor-unit", "CHDATERANGE-UNIT" );
+ dumpDec< sal_uInt16 >( "base-unit", "CHDATERANGE-UNIT" );
+ dumpDec< sal_uInt16 >( "axis-crossing-date" );
+ dumpHex< sal_uInt16 >( "flags", "CHDATERANGE-FLAGS" );
+ break;
+
case BIFF_ID_CHECKCOMPAT:
dumpFrHeader( true, true );
dumpBool< sal_uInt32 >( "check-compatibility" );
@@ -1865,18 +1897,6 @@ void WorkbookStreamObject::implDumpRecordBody()
dumpHex< sal_uInt16 >( "flags", "CHLABELRANGE-FLAGS" );
break;
- case BIFF_ID_CHLABELRANGE2:
- dumpDec< sal_uInt16 >( "minimum-categ" );
- dumpDec< sal_uInt16 >( "maximum-categ" );
- dumpDec< sal_uInt16 >( "major-unit-value" );
- dumpDec< sal_uInt16 >( "major-unit" );
- dumpDec< sal_uInt16 >( "minor-unit-value" );
- dumpDec< sal_uInt16 >( "minor-unit" );
- dumpDec< sal_uInt16 >( "base-unit" );
- dumpDec< sal_uInt16 >( "axis-crossing-date" );
- dumpHex< sal_uInt16 >( "flags", "CHLABELRANGE2-FLAGS" );
- break;
-
case BIFF_ID_CHLEGEND:
dumpRect< sal_Int32 >( "position", (eBiff <= BIFF4) ? "CONV-TWIP-TO-CM" : "" );
dumpDec< sal_uInt8 >( "docked-pos", "CHLEGEND-DOCKPOS" );
@@ -2067,6 +2087,69 @@ void WorkbookStreamObject::implDumpRecordBody()
dumpBool< sal_uInt32 >( "recommend-compress-pics" );
break;
+ case BIFF_ID_CONNECTION:
+ {
+ dumpFrHeader( true, false );
+ sal_uInt16 nType = dumpDec< sal_uInt16 >( "data-source-type", "CONNECTION-SOURCETYPE" );
+ sal_uInt16 nFlags1 = dumpHex< sal_uInt16 >( "flags", "CONNECTION-FLAGS" );
+ dumpDec< sal_uInt16 >( "param-count" );
+ dumpUnused( 2 );
+ dumpHex< sal_uInt16 >( "querytable-flags", "QUERYTABLESETTINGS-FLAGS" );
+ switch( nType )
+ {
+ case 4: dumpHex< sal_uInt16 >( "html-flags", "QUERYTABLESETTINGS-HTML-FLAGS" ); break;
+ case 5: dumpHex< sal_uInt16 >( "oledb-flags", "QUERYTABLESETTINGS-OLEDB-FLAGS" ); break;
+ case 7: dumpHex< sal_uInt16 >( "ado-flags", "QUERYTABLESETTINGS-ADO-FLAGS" ); break;
+ default: dumpUnused( 2 );
+ }
+ dumpDec< sal_uInt8 >( "edited-version" );
+ dumpDec< sal_uInt8 >( "refreshed-version" );
+ dumpDec< sal_uInt8 >( "min-refresh-version" );
+ dumpDec< sal_uInt16 >( "refresh-interval", "QUERYTABLESETTINGS-INTERVAL" );
+ dumpDec< sal_uInt16 >( "html-format", "QUERYTABLESETTINGS-HTMLFORMAT" );
+ dumpDec< sal_Int32 >( "reconnect-type", "CONNECTION-RECONNECTTYPE" );
+ dumpDec< sal_uInt8 >( "credentials", "CONNECTION-CREDENTIALS" );
+ dumpUnused( 1 );
+ dumpSegmentedUniString( "source-file" );
+ dumpSegmentedUniString( "source-conn-file" );
+ dumpSegmentedUniString( "name" );
+ dumpSegmentedUniString( "description" );
+ dumpSegmentedUniString( "sso-id" );
+ if( nFlags1 & 0x0004 ) dumpSegmentedUniString( "table-names" );
+ if( nFlags1 & 0x0010 )
+ {
+ break; // TODO: parameter array structure
+ }
+ bool bEscape = false;
+ switch( nType )
+ {
+ case 1:
+ dumpSegmentedUniString( "connection-string" );
+ break;
+ case 4:
+ dumpSegmentedUniStringArray( "urls" );
+ dumpSegmentedUniStringArray( "post-method" );
+ break;
+ case 5:
+ bEscape = true;
+ break;
+ case 6:
+ bEscape = true;
+ break;
+ }
+ if( bEscape )
+ break;
+ dumpSegmentedUniStringArray( "sql-command" );
+ dumpSegmentedUniStringArray( "orig-sql-command" );
+ dumpSegmentedUniStringArray( "webquery-dialog-url" );
+ switch( dumpDec< sal_uInt8 >( "linked-object-type", "CONNECTION-LINKEDOBJECTTYPE" ) )
+ {
+ case 1: dumpSegmentedUniString( "defined-name" ); break;
+ case 2: dumpHex< sal_uInt16 >( "cache-id" ); break;
+ }
+ }
+ break;
+
case BIFF_ID_CONT:
if( (eBiff == BIFF8) && (getLastRecId() == BIFF_ID_OBJ) )
dumpEmbeddedDff();
@@ -2178,6 +2261,21 @@ void WorkbookStreamObject::implDumpRecordBody()
dumpDec< sal_uInt16 >( "#cell-offset" );
break;
+ case BIFF_ID_DBQUERY:
+ if( eBiff == BIFF8 )
+ {
+ if( (getLastRecId() != BIFF_ID_PCITEM_STRING) && (getLastRecId() != BIFF_ID_DBQUERY) )
+ {
+ dumpHex< sal_uInt16 >( "flags", "DBQUERY-FLAGS" );
+ dumpDec< sal_uInt16 >( "sql-param-count" );
+ dumpDec< sal_uInt16 >( "command-count" );
+ dumpDec< sal_uInt16 >( "post-method-count" );
+ dumpDec< sal_uInt16 >( "server-sql-count" );
+ dumpDec< sal_uInt16 >( "odbc-connection-count" );
+ }
+ }
+ break;
+
case BIFF2_ID_DEFINEDNAME:
case BIFF3_ID_DEFINEDNAME:
{
@@ -2325,7 +2423,7 @@ void WorkbookStreamObject::implDumpRecordBody()
rStrm.seekToStart();
BiffDecoderRef xDecoder = BiffCodecHelper::implReadFilePass( rStrm, eBiff );
if( xDecoder.get() )
- cfg().requestPassword( *xDecoder );
+ cfg().requestEncryptionData( *xDecoder );
setBinaryOnlyMode( !xDecoder || !xDecoder->isValid() );
}
break;
@@ -2336,6 +2434,19 @@ void WorkbookStreamObject::implDumpRecordBody()
dumpString( "password-creator", BIFF_STR_8BITLENGTH, BIFF_STR_SMARTFLAGS );
break;
+ case BIFF_ID_FILTERCOLUMN:
+ {
+ dumpDec< sal_uInt16 >( "column-index" );
+ dumpHex< sal_uInt16 >( "flags", "FILTERCOLUMN-FLAGS" );
+ sal_uInt8 nStrLen1 = dumpFilterColumnOperator( "operator-1" );
+ sal_uInt8 nStrLen2 = dumpFilterColumnOperator( "operator-2" );
+ bool bBiff8 = eBiff == BIFF8;
+ rtl_TextEncoding eTextEnc = getBiffData().getTextEncoding();
+ if( nStrLen1 > 0 ) writeStringItem( "string-1", bBiff8 ? rStrm.readUniStringBody( nStrLen1, true ) : rStrm.readCharArrayUC( nStrLen1, eTextEnc, true ) );
+ if( nStrLen2 > 0 ) writeStringItem( "string-2", bBiff8 ? rStrm.readUniStringBody( nStrLen2, true ) : rStrm.readCharArrayUC( nStrLen2, eTextEnc, true ) );
+ }
+ break;
+
case BIFF2_ID_FONT:
case BIFF3_ID_FONT:
dumpFontRec();
@@ -2716,6 +2827,58 @@ void WorkbookStreamObject::implDumpRecordBody()
}
break;
+ case BIFF_ID_QUERYTABLE:
+ dumpHex< sal_uInt16 >( "flags", "QUERYTABLE-FLAGS" );
+ dumpDec< sal_uInt16 >( "autoformat-id" );
+ dumpHex< sal_uInt16 >( "autoformat-flags", "QUERYTABLE-AUTOFORMAT-FLAGS" );
+ dumpUnused( 4 );
+ dumpUniString( "defined-name" );
+ dumpUnused( 2 );
+ break;
+
+ case BIFF_ID_QUERYTABLEREFRESH:
+ {
+ dumpFrHeader( true, false );
+ bool bPivot = dumpBool< sal_uInt16 >( "pivot-table" );
+ dumpHex< sal_uInt16 >( "flags", "QUERYTABLEREFRESH-FLAGS" );
+ dumpHex< sal_uInt32 >( bPivot ? "pivottable-flags" : "querytable-flags", bPivot ? "QUERYTABLEREFRESH-PTFLAGS" : "QUERYTABLEREFRESH-QTFLAGS" );
+ dumpDec< sal_uInt8 >( "refreshed-version" );
+ dumpDec< sal_uInt8 >( "min-refresh-version" );
+ dumpUnused( 2 );
+ dumpUniString( "table-name" );
+ dumpUnused( 2 );
+ }
+ break;
+
+ case BIFF_ID_QUERYTABLESETTINGS:
+ {
+ dumpFrHeader( true, false );
+ sal_uInt16 nType = dumpDec< sal_uInt16 >( "data-source-type", "CONNECTION-SOURCETYPE" );
+ dumpHex< sal_uInt16 >( "flags-1", "QUERYTABLESETTINGS-FLAGS" );
+ switch( nType )
+ {
+ case 4: dumpHex< sal_uInt16 >( "html-flags", "QUERYTABLESETTINGS-HTML-FLAGS" ); break;
+ case 5: dumpHex< sal_uInt16 >( "oledb-flags", "QUERYTABLESETTINGS-OLEDB-FLAGS" ); break;
+ case 7: dumpHex< sal_uInt16 >( "ado-flags", "QUERYTABLESETTINGS-ADO-FLAGS" ); break;
+ default: dumpUnused( 2 );
+ }
+ dumpHex< sal_uInt16 >( "ext-flags", "QUERYTABLESETTINGS-EXT-FLAGS" );
+ dumpDec< sal_uInt8 >( "edited-version" );
+ dumpDec< sal_uInt8 >( "refreshed-version" );
+ dumpDec< sal_uInt8 >( "min-refresh-version" );
+ dumpUnused( 3 );
+ dumpDec< sal_uInt16 >( "oledb-count" );
+ dumpDec< sal_uInt16 >( "future-data-size" );
+ dumpDec< sal_uInt16 >( "refresh-interval", "QUERYTABLESETTINGS-INTERVAL" );
+ dumpDec< sal_uInt16 >( "html-format", "QUERYTABLESETTINGS-HTMLFORMAT" );
+ }
+ break;
+
+ case BIFF_ID_QUERYTABLESTRING:
+ dumpFrHeader( true, false );
+ dumpUniString( "connection-string" );
+ break;
+
case BIFF_ID_RECALCID:
dumpFrHeader( true, false );
dumpDec< sal_uInt32 >( "recalc-engine-id" );
@@ -2897,18 +3060,6 @@ void WorkbookStreamObject::implDumpRecordBody()
dumpDxfProp();
break;
- case BIFF_ID_SXEXT:
- if( eBiff == BIFF8 )
- {
- dumpHex< sal_uInt16 >( "flags", "SXEXT-FLAGS" );
- dumpDec< sal_uInt16 >( "param-string-count" );
- dumpDec< sal_uInt16 >( "sql-statement-string-count" );
- dumpDec< sal_uInt16 >( "webquery-postmethod-string-count" );
- dumpDec< sal_uInt16 >( "server-pagefields-string-count" );
- dumpDec< sal_uInt16 >( "odbc-connection-string-count" );
- }
- break;
-
case BIFF_ID_TABLESTYLES:
{
dumpFrHeader( true, true );
@@ -3123,6 +3274,38 @@ void WorkbookStreamObject::dumpExtGradientHead()
dumpDec< double >( "pos-bottom" );
}
+sal_uInt8 WorkbookStreamObject::dumpFilterColumnOperator( const String& rName )
+{
+ sal_uInt8 nStrLen = 0;
+ writeEmptyItem( rName );
+ IndentGuard aIndGuard( mxOut );
+ sal_uInt8 nType = dumpDec< sal_uInt8 >( "data-type", "FILTERCOLUMN-DATATYPE" );
+ dumpDec< sal_uInt8 >( "operator", "FILTERCOLUMN-OPERATOR" );
+ switch( nType )
+ {
+ case 2:
+ dumpRk( "value" );
+ dumpUnused( 4 );
+ break;
+ case 4:
+ dumpDec< double >( "value" );
+ break;
+ case 6:
+ dumpUnused( 4 );
+ nStrLen = dumpDec< sal_uInt8 >( "length" );
+ dumpBoolean( "simple" );
+ dumpUnused( 2 );
+ break;
+ case 8:
+ dumpBoolErr();
+ dumpUnused( 6 );
+ break;
+ default:
+ dumpUnused( 8 );
+ }
+ return nStrLen;
+}
+
OUString WorkbookStreamObject::dumpPivotString( const String& rName, sal_uInt16 nStrLen )
{
OUString aString;
@@ -3152,9 +3335,9 @@ void WorkbookStreamObject::dumpBoolErr()
{
MultiItemsGuard aMultiGuard( mxOut );
sal_uInt8 nValue = dumpHex< sal_uInt8 >( "value" );
- bool bErrCode = dumpBool< sal_uInt8 >( "is-errorcode" );
+ bool bErrCode = dumpBool< sal_uInt8 >( "is-error-code" );
if( bErrCode )
- writeErrorCodeItem( "errorcode", nValue );
+ writeErrorCodeItem( "error-code", nValue );
else
writeBooleanItem( "boolean", nValue );
}
@@ -4363,6 +4546,7 @@ void Dumper::implDump()
}
// ============================================================================
+// ============================================================================
} // namespace biff
} // namespace dump
@@ -4370,4 +4554,4 @@ void Dumper::implDump()
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/dump/biffdumper.ini b/oox/source/dump/biffdumper.ini
index d4b862825b3c..2e25ff81c890 100644
--- a/oox/source/dump/biffdumper.ini
+++ b/oox/source/dump/biffdumper.ini
@@ -344,14 +344,14 @@ multilist=RECORD-NAMES-BIFF5
0x0018=DEFINEDNAME
0x0023=EXTERNALNAME
0x0031=FONT
- 0x0098=,,,FILTERMODE,,AUTOFILTERINFO,AUTOFILTER,
+ 0x0098=,,,FILTERMODE,,AUTOFILTER,FILTERCOLUMN,
0x00A8=,,,,,,SCENARIOS,SCENARIO
0x00B0=PTDEFINITION,PTFIELD,PTFITEM,,PTROWCOLFIELDS,PTROWCOLITEMS,PTPAGEFIELDS,
0x00B8=DOCROUTE,RECIPNAME,,,,MULTRK,MULTBLANK,TOOLBARHDR
0x00C0=TOOLBAREND,MMS,ADDMENU,DELMENU,,PTDATAFIELD,PCDEFINITION,PCDFIELD
0x00C8=PCITEM_INDEXLIST,PCITEM_DOUBLE,PCITEM_BOOL,PCITEM_ERROR,PCITEM_INTEGER,PCITEM_STRING,PCITEM_DATE,PCITEM_MISSING
0x00D0=SXTBL,SXTBRGITEM,SXTBPG,VBAPROJECT,,PIVOTCACHE,RSTRING,DBCELL
- 0x00D8=PCDFRANGEPR,PCDFDISCRETEPR,BOOKBOOL,REVERT,SXEXT|PARAMQRY,SCENPROTECT,OLESIZE,UDDESC
+ 0x00D8=PCDFRANGEPR,PCDFDISCRETEPR,BOOKBOOL,REVERT,DBORPARAMQUERY,SCENPROTECT,OLESIZE,UDDESC
0x00E0=XF,INTERFACEHDR,INTERFACEEND,PCDSOURCE,,,,
0x0206=FORMULA
0x04BC=SHAREDFMLA
@@ -379,24 +379,25 @@ multilist=RECORD-NAMES-BIFF8
0x0158=,,,,,,,LABELRANGES
0x0160=USESELFS,DSF,XL5MODIFY,,,,,
0x0190=,,,,,,CHTRHEADER,
- 0x01A8=,USERBVIEW,USERSVIEWBEGIN,USERSVIEWEND,,QSI,EXTERNALBOOK,PROT4REV
+ 0x01A8=,USERBVIEW,USERSVIEWBEGIN,USERSVIEWEND,,QUERYTABLE,EXTERNALBOOK,PROT4REV
0x01B0=CFHEADER,CFRULE,DATAVALIDATIONS,,,DCONBINAME,TXO,REFRESHALL
0x01B8=HYPERLINK,NLRDELNAME,CODENAME,PCDFSQLTYPE,PROT4REVPASS,VBAPROJECTEMPTY,DATAVALIDATION,
0x01C0=XL9FILE,RECALCID,INTCACHEDDATA,,,,,
# future records
- 0x0800=SCREENTIP,,,WEBQRYSETTINGS,WEBQRYTABLES,,,
+ 0x0800=SCREENTIP,,QUERYTABLEREFRESH,QUERYTABLESETTINGS,QUERYTABLESTRING,,,
0x0850=CHFRINFO,CHFRWRAPPER,CHFRBLOCKBEGIN,CHFRBLOCKEND,,,CHFRCATEGORYPROPS,CHFRUNITPROPS
0x0858=CHPIVOTREF,CHPIVOTFLAGS,,,,,,
0x0860=,,SHEETEXT,BOOKEXT,,,,SHAREDFEATHEAD
0x0868=,,,CHFRLABELPROPS,,,,
- 0x0878=,,CFRULE12,CFRULEEXT,XFCRC,XFEXT,,
+ 0x0870=,,,,,,CONNECTION,
+ 0x0878=,,CFRULE12,CFRULEEXT,XFCRC,XFEXT,FILTERCOLUMN12,CONTINUE12
0x0888=,,,PAGELAYOUTVIEW,CHECKCOMPAT,DXF,TABLESTYLES,
0x0890=,,STYLEEXT,,,,THEME,
0x0898=,,MTHREADSETTINGS,COMPRESSPICS,HEADERFOOTER,CHFRLAYOUT,CHFREXTPROPS,CHFREXTPROPSCONT
0x08A0=,,,FORCEFULLCALC,CHFRSHAPEPROPS,CHFRTEXTPROPS,,CHFRPLOTAREALAYOUT
# chart records
0x1058=,,,,,,,CH3DDATAFORMAT
- 0x1060=CHFONTBASE,CHPIEEXT,CHLABELRANGE2,CHDATATABLE,CHPLOTGROWTH,CHSERINDEX,CHESCHERFORMAT,CHPIEEXTSETT
+ 0x1060=CHFONTBASE,CHPIEEXT,CHDATERANGE,CHDATATABLE,CHPLOTGROWTH,CHSERINDEX,CHESCHERFORMAT,CHPIEEXTSETT
end
# simple records -------------------------------------------------------------
@@ -464,6 +465,7 @@ end
constlist=SIMPLE-RECORDS-BIFF5
include=SIMPLE-RECORDS-BIFF4
+ 0x009D=uint16,dec,column-count
0x00C9=double,dec,value
0x00CA=uint16,bool,value
0x00CB=uint16,hex,error-code,ERRORCODES
@@ -819,6 +821,21 @@ flagslist=CHDATAFORMAT-FLAGS
0x0001=excel4-colors
end
+# CHDATERANGE ----------------------------------------------------------------
+
+shortlist=CHDATERANGE-UNIT,0,days,months,years
+
+flagslist=CHDATERANGE-FLAGS
+ 0x0001=auto-minimum
+ 0x0002=auto-maximum
+ 0x0004=auto-major
+ 0x0008=auto-minor
+ 0x0010=date-axis
+ 0x0020=auto-base
+ 0x0040=auto-axis-cross
+ 0x0080=auto-date
+end
+
# CHFRAME --------------------------------------------------------------------
shortlist=CHFRAME-FORMAT,0,standard,,,,shadow
@@ -975,19 +992,6 @@ flagslist=CHLABELRANGE-FLAGS
0x0004=reverse-order
end
-# CHLABELRANGE2 --------------------------------------------------------------
-
-flagslist=CHLABELRANGE2-FLAGS
- 0x0001=auto-minimum
- 0x0002=auto-maximum
- 0x0004=auto-major
- 0x0008=auto-minor
- 0x0010=date-axis
- 0x0020=auto-base
- 0x0040=auto-axis-cross
- 0x0080=auto-date
-end
-
# CHLEGEND -------------------------------------------------------------------
shortlist=CHLEGEND-DOCKPOS,0,bottom,top-right,top,right,left,,,manual
@@ -1229,6 +1233,26 @@ combilist=COLINFO-FLAGS
0x1000=outline-collapsed
end
+# CONNECTION -----------------------------------------------------------------
+
+shortlist=CONNECTION-SOURCETYPE,1,odbc,dao,file,html,ole-db,text,ado,dsp
+
+flagslist=CONNECTION-FLAGS
+ 0x0001=save-password
+ 0x0002=html-tables
+ 0x0004=table-names
+ 0x0008=deleted
+ 0x0010=stand-alone
+ 0x0020=only-use-conn-file
+ 0x0040=background
+ 0x0080=refresh-on-load
+ 0x0100=save-data
+end
+
+shortlist=CONNECTION-RECONNECTTYPE,0,as-required,always,never
+shortlist=CONNECTION-CREDENTIALS,0,integrated,none,stored-sso,prompt
+shortlist=CONNECTION-LINKEDOBJECTTYPE,0,none,query-table,pivot-cache
+
# DATATABLE ------------------------------------------------------------------
flagslist=DATATABLE-FLAGS-BIFF3
@@ -1273,6 +1297,18 @@ end
shortlist=DATEMODE,0,1899-12-31,1904-01-01
+# DBQUERY --------------------------------------------------------------------
+
+combilist=DBQUERY-FLAGS
+ 0x0007=uint8,dec,source-type,CONNECTION-SOURCETYPE
+ 0x0008=odbc-connection
+ 0x0010=sql-query
+ 0x0020=server-sql
+ 0x0040=html-query
+ 0x0080=save-password
+ 0x0100=html-tables
+end
+
# DEFINEDNAME ----------------------------------------------------------------
flagslist=DEFINEDNAME-FLAGS-BIFF2
@@ -1380,6 +1416,30 @@ end
shortlist=FILEPASS-TYPE,0,xor,rc4
shortlist=FILEPASS-MAJOR,1,rc4,crypto-api-2003,crypto-api-2007
+# FILTERCOLUMN ---------------------------------------------------------------
+
+combilist=FILTERCOLUMN-FLAGS
+ 0x0001=!and!or
+ 0x0004=op-1-simple
+ 0x0008=op-2-simple
+ 0x0010=top-10
+ 0x0020=!bottom!top
+ 0x0040=percent
+ 0xFF80=uint16,dec,top-10-count
+end
+
+constlist=FILTERCOLUMN-DATATYPE
+ 0=none
+ 2=rk
+ 4=double
+ 6=string
+ 8=boolean
+ 12=blank
+ 14=not-blank
+end
+
+shortlist=FILTERCOLUMN-OPERATOR,0,none,less,equal,less-equal,greater,not-equal,greater-equal
+
# FONT -----------------------------------------------------------------------
flagslist=FONT-FLAGS
@@ -1874,6 +1934,101 @@ combilist=PTROWCOLITEMS-FLAGS
0x1000=multi-data
end
+# QUERYTABLE -----------------------------------------------------------------
+
+combilist=QUERYTABLE-FLAGS
+ 0x0001=headers
+ 0x0002=row-numbers
+ 0x0004=disable-refresh
+ 0x0008=background
+ 0x0010=first-background
+ 0x0020=refresh-on-load
+ 0x0040=delete-unused
+ 0x0080=fill-formulas
+ 0x0100=adjust-column-width
+ 0x0200=save-data
+ 0x0400=disable-edit
+ 0x2000=overwrite-existing
+end
+
+combilist=QUERYTABLE-AUTOFORMAT-FLAGS
+ 0x0001=apply-num-fmt
+ 0x0002=apply-font
+ 0x0004=apply-alignment
+ 0x0008=apply-border
+ 0x0010=apply-fill
+ 0x0020=apply-protection
+end
+
+# QUERYTABLEREFRESH ----------------------------------------------------------
+
+flagslist=QUERYTABLEREFRESH-FLAGS
+ 0x0001=enable-refresh
+ 0x0002=pivot-cache-invalid
+ 0x0004=olap-pivot-table
+end
+
+flagslist=QUERYTABLEREFRESH-PTFLAGS
+ 0x00000001=disable-draw-drop
+ 0x00000002=hide-totals-annotation
+ 0x00000008=include-empty-rows
+ 0x00000010=include-empty-columns
+end
+
+flagslist=QUERYTABLEREFRESH-QTFLAGS
+ 0x00000001=preserve-formatting
+ 0x00000002=adjust-column-width
+ 0x00000010=ext-data-list
+ 0x00000040=create-table-list
+ 0x00000080=create-dummy-list
+end
+
+# QUERYTABLESETTINGS ---------------------------------------------------------
+
+flagslist=QUERYTABLESETTINGS-FLAGS
+ 0x0001=keep-alive
+ 0x0002=new
+ 0x0004=source-data
+ 0x0008=web-based-prov
+ 0x0010=reinit-list
+ 0x0080=xml
+end
+
+flagslist=QUERYTABLESETTINGS-HTML-FLAGS
+ 0x0001=parse-pre
+ 0x0002=consecutive-delimiters
+ 0x0004=first-row
+ 0x0008=xl97-created
+ 0x0010=text-dates
+ 0x0020=xl2000-refreshed
+end
+
+combilist=QUERYTABLESETTINGS-OLEDB-FLAGS
+ 0x0007=uint8,dec,command-type,QUERYTABLESETTINGS-OLEDB-COMMANDTYPE
+ 0x0008=alt-connection-string
+ 0x0010=no-refresh-cube
+ 0x0020=olap-has-locale
+ 0x0040=server-num-fmt
+ 0x0080=server-fill-color
+ 0x0100=server-font-color
+ 0x0200=server-font-format
+ 0x0400=olap-member-l10n
+end
+
+shortlist=QUERYTABLESETTINGS-OLEDB-COMMANDTYPE,0,none,cube,sql,table,default,list
+
+flagslist=QUERYTABLESETTINGS-ADO-FLAGS
+ 0x0100=ado-refreshable
+end
+
+flagslist=QUERYTABLESETTINGS-EXT-FLAGS
+ 0x0001=text-query
+ 0x0002=table-names
+end
+
+unitconverter=QUERYTABLESETTINGS-INTERVAL,60,sec
+shortlist=QUERYTABLESETTINGS-HTMLFORMAT,1,none,rtf,all
+
# REFMODE --------------------------------------------------------------------
shortlist=REFMODE,0,R1C1,A1
@@ -1998,20 +2153,6 @@ multilist=STYLEEXT-BUILTIN
50=20%-accent6,40%-accent6,60%-accent6,explanatory-text
end
-# SXEXT ----------------------------------------------------------------------
-
-combilist=SXEXT-FLAGS
- 0x0007=uint8,dec,source-type,SXEXT-SOURCETYPE
- 0x0008=odbc-connection
- 0x0010=odbc-sql
- 0x0020=server-pagefields
- 0x0040=webquery
- 0x0080=save-password
- 0x0100=tables-html-only
-end
-
-shortlist=SXEXT-SOURCETYPE,1,odbc,dao,,webquery
-
# THEME ----------------------------------------------------------------------
constlist=THEME-VERSION
@@ -2235,4 +2376,3 @@ multilist=XFEXT-SUBREC
end
# ============================================================================
-
diff --git a/oox/source/dump/dffdumper.cxx b/oox/source/dump/dffdumper.cxx
index fce6ba9a0766..53e32347105f 100644
--- a/oox/source/dump/dffdumper.cxx
+++ b/oox/source/dump/dffdumper.cxx
@@ -30,13 +30,15 @@
#if OOX_INCLUDE_DUMPER
-using ::rtl::OUString;
-
namespace oox {
namespace dump {
// ============================================================================
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
const sal_uInt16 DFF_ID_BSE = 0xF007; /// BLIP store entry.
@@ -322,4 +324,4 @@ sal_uInt16 DffStreamObject::dumpDffOptPropHeader()
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/dump/dffdumper.ini b/oox/source/dump/dffdumper.ini
index c33d733c6bd8..5526663e0e15 100644
--- a/oox/source/dump/dffdumper.ini
+++ b/oox/source/dump/dffdumper.ini
@@ -648,4 +648,3 @@ combilist=DFFSPLITMENUC-RECORD-INST
end
# ============================================================================
-
diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx
index d06734cc974c..9eb999bcdbdb 100644
--- a/oox/source/dump/dumperbase.cxx
+++ b/oox/source/dump/dumperbase.cxx
@@ -30,44 +30,45 @@
#include <algorithm>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/io/XActiveDataSink.hpp>
#include <com/sun/star/io/XActiveDataSource.hpp>
#include <com/sun/star/io/XTextInputStream.hpp>
#include <com/sun/star/io/XTextOutputStream.hpp>
-#include <rtl/math.hxx>
-#include <osl/file.hxx>
+#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <comphelper/docpasswordhelper.hxx>
+#include <osl/file.hxx>
+#include <rtl/math.hxx>
+#include "oox/core/filterbase.hxx"
#include "oox/helper/binaryoutputstream.hxx"
#include "oox/helper/textinputstream.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/biffhelper.hxx"
#if OOX_INCLUDE_DUMPER
+namespace oox {
+namespace dump {
+
+// ============================================================================
+
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::ucb;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::comphelper::MediaDescriptor;
+using ::oox::core::FilterBase;
using ::rtl::OString;
using ::rtl::OStringBuffer;
using ::rtl::OStringToOUString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
using ::rtl::OUStringToOString;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::ucb::XSimpleFileAccess;
-using ::com::sun::star::io::XActiveDataSink;
-using ::com::sun::star::io::XActiveDataSource;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XTextInputStream;
-using ::com::sun::star::io::XTextOutputStream;
-using ::comphelper::MediaDescriptor;
-using ::oox::core::FilterBase;
-namespace oox {
-namespace dump {
+// ============================================================================
+
+namespace {
const sal_Unicode OOX_DUMP_BOM = 0xFEFF;
const sal_Int32 OOX_DUMP_MAXSTRLEN = 80;
@@ -80,6 +81,8 @@ const sal_Unicode OOX_DUMP_ITEMSEP = '=';
const sal_Int32 OOX_DUMP_BYTESPERLINE = 16;
const sal_Int64 OOX_DUMP_MAXARRAY = 16;
+} // namespace
+
// ============================================================================
// ============================================================================
@@ -1582,18 +1585,18 @@ NameListRef SharedConfigData::getNameList( const OUString& rListName ) const
return xList;
}
-OUString SharedConfigData::requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier )
+Sequence< NamedValue > SharedConfigData::requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier )
{
- OUString aPassword;
+ Sequence< NamedValue > aEncryptionData;
if( !mbPwCancelled )
{
::std::vector< OUString > aDefaultPasswords;
aDefaultPasswords.push_back( CREATE_OUSTRING( "VelvetSweatshop" ) );
- aPassword = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
+ aEncryptionData = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
rVerifier, mrMediaDesc, ::comphelper::DocPasswordRequestType_MS, &aDefaultPasswords );
- mbPwCancelled = aPassword.getLength() == 0;
+ mbPwCancelled = !aEncryptionData.hasElements();
}
- return aPassword;
+ return aEncryptionData;
}
bool SharedConfigData::implIsValid() const
@@ -1713,7 +1716,7 @@ void Config::construct( const Config& rParent )
void Config::construct( const sal_Char* pcEnvVar, const FilterBase& rFilter )
{
if( rFilter.getFileUrl().getLength() > 0 )
- construct( pcEnvVar, rFilter.getGlobalFactory(), rFilter.getStorage(), rFilter.getFileUrl(), rFilter.getMediaDescriptor() );
+ construct( pcEnvVar, rFilter.getServiceFactory(), rFilter.getStorage(), rFilter.getFileUrl(), rFilter.getMediaDescriptor() );
}
void Config::construct( const sal_Char* pcEnvVar, const Reference< XMultiServiceFactory >& rxFactory, const StorageRef& rxRootStrg, const OUString& rSysFileName, MediaDescriptor& rMediaDesc )
@@ -1765,9 +1768,9 @@ NameListRef Config::getNameList( const String& rListName ) const
return implGetNameList( rListName );
}
-OUString Config::requestPassword( ::comphelper::IDocPasswordVerifier& rVerifier )
+Sequence< NamedValue > Config::requestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier )
{
- return mxCfgData->requestPassword( rVerifier );
+ return mxCfgData->requestEncryptionData( rVerifier );
}
bool Config::isPasswordCancelled() const
@@ -3214,4 +3217,4 @@ void DumperBase::construct( const ConfigRef& rxConfig )
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/dump/dumperbase.ini b/oox/source/dump/dumperbase.ini
index 34ef302c784c..28aa59a03b81 100644
--- a/oox/source/dump/dumperbase.ini
+++ b/oox/source/dump/dumperbase.ini
@@ -393,4 +393,3 @@ multilist=SYSTEMCOLOR
end
# ============================================================================
-
diff --git a/oox/source/dump/oledumper.cxx b/oox/source/dump/oledumper.cxx
index 61874f1ad767..b2ac450bf667 100644
--- a/oox/source/dump/oledumper.cxx
+++ b/oox/source/dump/oledumper.cxx
@@ -27,30 +27,33 @@
************************************************************************/
#include "oox/dump/oledumper.hxx"
+
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
-#include <osl/thread.h>
#include <osl/file.hxx>
+#include <osl/thread.h>
#include <rtl/tencinfo.h>
-#include "oox/helper/binaryoutputstream.hxx"
#include "oox/core/filterbase.hxx"
+#include "oox/helper/binaryoutputstream.hxx"
#include "oox/ole/olestorage.hxx"
#include "oox/ole/vbainputstream.hxx"
#if OOX_INCLUDE_DUMPER
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::rtl::OString;
-using ::rtl::OStringToOUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-
namespace oox {
namespace dump {
// ============================================================================
+
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OString;
+using ::rtl::OStringToOUString;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
// ============================================================================
OUString OleInputObjectBase::dumpAnsiString32( const String& rName )
@@ -303,28 +306,32 @@ namespace {
const sal_Int32 OLEPROP_ID_DICTIONARY = 0;
const sal_Int32 OLEPROP_ID_CODEPAGE = 1;
-const sal_Int32 OLEPROP_TYPE_INT16 = 2;
-const sal_Int32 OLEPROP_TYPE_INT32 = 3;
-const sal_Int32 OLEPROP_TYPE_FLOAT = 4;
-const sal_Int32 OLEPROP_TYPE_DOUBLE = 5;
-const sal_Int32 OLEPROP_TYPE_DATE = 7;
-const sal_Int32 OLEPROP_TYPE_STRING = 8;
-const sal_Int32 OLEPROP_TYPE_STATUS = 10;
-const sal_Int32 OLEPROP_TYPE_BOOL = 11;
-const sal_Int32 OLEPROP_TYPE_VARIANT = 12;
-const sal_Int32 OLEPROP_TYPE_INT8 = 16;
-const sal_Int32 OLEPROP_TYPE_UINT8 = 17;
-const sal_Int32 OLEPROP_TYPE_UINT16 = 18;
-const sal_Int32 OLEPROP_TYPE_UINT32 = 19;
-const sal_Int32 OLEPROP_TYPE_INT64 = 20;
-const sal_Int32 OLEPROP_TYPE_UINT64 = 21;
-const sal_Int32 OLEPROP_TYPE_STRING8 = 30;
-const sal_Int32 OLEPROP_TYPE_STRING16 = 31;
-const sal_Int32 OLEPROP_TYPE_FILETIME = 64;
-const sal_Int32 OLEPROP_TYPE_BLOB = 65;
-const sal_Int32 OLEPROP_TYPE_STREAM = 66;
-const sal_Int32 OLEPROP_TYPE_STORAGE = 67;
-const sal_Int32 OLEPROP_TYPE_CLIPFMT = 71;
+const sal_uInt16 OLEPROP_TYPE_INT16 = 2;
+const sal_uInt16 OLEPROP_TYPE_INT32 = 3;
+const sal_uInt16 OLEPROP_TYPE_FLOAT = 4;
+const sal_uInt16 OLEPROP_TYPE_DOUBLE = 5;
+const sal_uInt16 OLEPROP_TYPE_DATE = 7;
+const sal_uInt16 OLEPROP_TYPE_STRING = 8;
+const sal_uInt16 OLEPROP_TYPE_STATUS = 10;
+const sal_uInt16 OLEPROP_TYPE_BOOL = 11;
+const sal_uInt16 OLEPROP_TYPE_VARIANT = 12;
+const sal_uInt16 OLEPROP_TYPE_INT8 = 16;
+const sal_uInt16 OLEPROP_TYPE_UINT8 = 17;
+const sal_uInt16 OLEPROP_TYPE_UINT16 = 18;
+const sal_uInt16 OLEPROP_TYPE_UINT32 = 19;
+const sal_uInt16 OLEPROP_TYPE_INT64 = 20;
+const sal_uInt16 OLEPROP_TYPE_UINT64 = 21;
+const sal_uInt16 OLEPROP_TYPE_STRING8 = 30;
+const sal_uInt16 OLEPROP_TYPE_STRING16 = 31;
+const sal_uInt16 OLEPROP_TYPE_FILETIME = 64;
+const sal_uInt16 OLEPROP_TYPE_BLOB = 65;
+const sal_uInt16 OLEPROP_TYPE_STREAM = 66;
+const sal_uInt16 OLEPROP_TYPE_STORAGE = 67;
+const sal_uInt16 OLEPROP_TYPE_CLIPFMT = 71;
+
+const sal_uInt16 OLEPROP_TYPE_SIMPLE = 0x0000;
+const sal_uInt16 OLEPROP_TYPE_VECTOR = 0x1000;
+const sal_uInt16 OLEPROP_TYPE_ARRAY = 0x2000;
const sal_uInt16 CODEPAGE_UNICODE = 1200;
@@ -459,7 +466,7 @@ void OlePropertyStreamObject::dumpCodePageProperty( sal_uInt32 nStartPos )
IndentGuard aIndGuard( mxOut );
if( startElement( nStartPos ) )
{
- sal_Int32 nType = dumpPropertyType();
+ sal_uInt16 nType = dumpPropertyType();
if( nType == OLEPROP_TYPE_INT16 )
{
sal_uInt16 nCodePage = dumpDec< sal_uInt16 >( "codepage", "CODEPAGES" );
@@ -494,28 +501,21 @@ void OlePropertyStreamObject::dumpDictionaryProperty( sal_uInt32 nStartPos )
mxOut->emptyLine();
}
-void OlePropertyStreamObject::dumpPropertyContents( sal_Int32 nPropId )
+sal_uInt16 OlePropertyStreamObject::dumpPropertyContents( sal_Int32 nPropId )
{
- sal_Int32 nType = dumpPropertyType();
- if( getFlag< sal_Int32 >( nType, 0x1000 ) ) // vector
- {
- sal_Int32 nBaseType = nType & 0x0FFF;
- sal_Int32 nElemCount = dumpDec< sal_Int32 >( "element-count" );
- for( sal_Int32 nElemIdx = 0; !mxStrm->isEof() && (nElemIdx < nElemCount); ++nElemIdx )
- {
- mxOut->resetItemIndex( nElemIdx );
- writeEmptyItem( "#element" );
- IndentGuard aIndGuard( mxOut );
- dumpPropertyValue( nPropId, nBaseType );
- }
- }
- else if( !getFlag< sal_Int32 >( nType, 0x7000 ) )
+ sal_uInt16 nType = dumpPropertyType();
+ sal_uInt16 nBaseType = static_cast< sal_uInt16 >( nType & 0x0FFF );
+ sal_uInt16 nArrayType = static_cast< sal_uInt16 >( nType & 0xF000 );
+ switch( nArrayType )
{
- dumpPropertyValue( nPropId, nType );
+ case OLEPROP_TYPE_SIMPLE: dumpPropertyValue( nPropId, nBaseType ); break;
+ case OLEPROP_TYPE_VECTOR: dumpPropertyVector( nPropId, nBaseType ); break;
+ case OLEPROP_TYPE_ARRAY: dumpPropertyArray( nPropId, nBaseType ); break;
}
+ return nType;
}
-void OlePropertyStreamObject::dumpPropertyValue( sal_Int32 nPropId, sal_Int32 nBaseType )
+void OlePropertyStreamObject::dumpPropertyValue( sal_Int32 nPropId, sal_uInt16 nBaseType )
{
switch( nBaseType )
{
@@ -537,23 +537,46 @@ void OlePropertyStreamObject::dumpPropertyValue( sal_Int32 nPropId, sal_Int32 nB
case OLEPROP_TYPE_STRING8: dumpString8( "value" ); break;
case OLEPROP_TYPE_STRING16: dumpString16( "value" ); break;
case OLEPROP_TYPE_FILETIME: dumpFileTime( "file-time" ); break;
- case OLEPROP_TYPE_BLOB: dumpBlob( "data" ); break;
+ case OLEPROP_TYPE_BLOB: dumpBlob( nPropId, "data" ); break;
case OLEPROP_TYPE_STREAM: dumpString8( "stream-name" ); break;
case OLEPROP_TYPE_STORAGE: dumpString8( "storage-name" ); break;
- case OLEPROP_TYPE_CLIPFMT: dumpBlob( "clip-data" ); break;
+ case OLEPROP_TYPE_CLIPFMT: dumpBlob( nPropId, "clip-data" ); break;
}
}
-sal_Int32 OlePropertyStreamObject::dumpPropertyType()
+void OlePropertyStreamObject::dumpPropertyVector( sal_Int32 nPropId, sal_uInt16 nBaseType )
{
- return dumpHex< sal_Int32 >( "type", "OLEPROP-TYPE" );
+ sal_Int32 nElemCount = dumpDec< sal_Int32 >( "element-count" );
+ for( sal_Int32 nElemIdx = 0; !mxStrm->isEof() && (nElemIdx < nElemCount); ++nElemIdx )
+ {
+ mxOut->resetItemIndex( nElemIdx );
+ writeEmptyItem( "#element" );
+ IndentGuard aIndGuard( mxOut );
+ dumpPropertyValue( nPropId, nBaseType );
+ }
+}
+
+void OlePropertyStreamObject::dumpPropertyArray( sal_Int32 /*nPropId*/, sal_uInt16 /*nBaseType*/ )
+{
+ // TODO
}
-void OlePropertyStreamObject::dumpBlob( const String& rName )
+sal_uInt16 OlePropertyStreamObject::dumpPropertyType()
+{
+ return static_cast< sal_uInt16 >( dumpHex< sal_Int32 >( "type", "OLEPROP-TYPE" ) & 0xFFFF );
+}
+
+void OlePropertyStreamObject::dumpBlob( sal_Int32 nPropId, const String& rName )
{
sal_Int32 nSize = dumpDec< sal_Int32 >( "data-size" );
if( nSize > 0 )
- dumpBinary( rName, nSize );
+ {
+ OUString aPropName = mxPropIds->getName( cfg(), nPropId );
+ if( aPropName == CREATE_OUSTRING( "'_PID_HLINKS'" ) )
+ dumpHlinks( nSize );
+ else
+ dumpBinary( rName, nSize );
+ }
}
OUString OlePropertyStreamObject::dumpString8( const String& rName )
@@ -597,6 +620,33 @@ OUString OlePropertyStreamObject::dumpCharArray16( const String& rName, sal_Int3
return aData;
}
+bool OlePropertyStreamObject::dumpTypedProperty( const String& rName, sal_uInt16 nExpectedType )
+{
+ writeEmptyItem( rName );
+ IndentGuard aIndGuard( mxOut );
+ return (dumpPropertyContents( -1 ) == nExpectedType) && !mxStrm->isEof();
+}
+
+void OlePropertyStreamObject::dumpHlinks( sal_Int32 nSize )
+{
+ sal_Int64 nEndPos = mxStrm->tell() + nSize;
+ sal_Int32 nCount = dumpDec< sal_Int32 >( "property-count" );
+ bool bValid = true;
+ for( sal_Int32 nHlinkIndex = 0, nHlinkCount = nCount / 6; bValid && !mxStrm->isEof() && (nHlinkIndex < nHlinkCount); ++nHlinkIndex )
+ {
+ writeEmptyItem( "HYPERLINK" );
+ IndentGuard aIndGuard( mxOut );
+ bValid =
+ dumpTypedProperty( "hash", OLEPROP_TYPE_INT32 ) &&
+ dumpTypedProperty( "app", OLEPROP_TYPE_INT32 ) &&
+ dumpTypedProperty( "shape-id", OLEPROP_TYPE_INT32 ) &&
+ dumpTypedProperty( "info", OLEPROP_TYPE_INT32 ) &&
+ dumpTypedProperty( "target", OLEPROP_TYPE_STRING16 ) &&
+ dumpTypedProperty( "location", OLEPROP_TYPE_STRING16 );
+ }
+ dumpRemainingTo( nEndPos );
+}
+
bool OlePropertyStreamObject::startElement( sal_uInt32 nStartPos )
{
mxStrm->seek( nStartPos );
@@ -2314,4 +2364,4 @@ void ActiveXStorageObject::implDumpBaseStream( const BinaryInputStreamRef& rxStr
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/dump/oledumper.ini b/oox/source/dump/oledumper.ini
index 13478464e6b3..c8461d4b28a7 100644
--- a/oox/source/dump/oledumper.ini
+++ b/oox/source/dump/oledumper.ini
@@ -885,4 +885,3 @@ end
shortlist=VBA-DIR-PROJECTSYSKIND-PLATFORM,0,16-bit-windows,32-bit-windows,macintosh
# ============================================================================
-
diff --git a/oox/source/dump/pptxdumper.cxx b/oox/source/dump/pptxdumper.cxx
index 3bcfd20dc434..4ed747ad792b 100644
--- a/oox/source/dump/pptxdumper.cxx
+++ b/oox/source/dump/pptxdumper.cxx
@@ -27,27 +27,31 @@
************************************************************************/
#include "oox/dump/pptxdumper.hxx"
-#include "oox/helper/zipstorage.hxx"
-#include "oox/ole/olestorage.hxx"
+
#include "oox/dump/biffdumper.hxx"
#include "oox/dump/oledumper.hxx"
#include "oox/dump/xlsbdumper.hxx"
+#include "oox/helper/zipstorage.hxx"
+#include "oox/ole/olestorage.hxx"
#if OOX_INCLUDE_DUMPER
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::io::XInputStream;
-using ::comphelper::MediaDescriptor;
-using ::oox::core::FilterBase;
-
namespace oox {
namespace dump {
namespace pptx {
// ============================================================================
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::comphelper::MediaDescriptor;
+using ::oox::core::FilterBase;
+using ::rtl::OUString;
+
+// ============================================================================
+
RootStorageObject::RootStorageObject( const DumperBase& rParent )
{
StorageObjectBase::construct( rParent );
@@ -146,4 +150,4 @@ void Dumper::implDump()
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/dump/pptxdumper.ini b/oox/source/dump/pptxdumper.ini
index fa03953b7113..f3c058ecfbf5 100644
--- a/oox/source/dump/pptxdumper.ini
+++ b/oox/source/dump/pptxdumper.ini
@@ -16,4 +16,3 @@ include-config-file=dumperbase.ini
# enable-import=1
# ============================================================================
-
diff --git a/oox/source/dump/xlsbdumper.cxx b/oox/source/dump/xlsbdumper.cxx
index 74390046737e..b511fd43562c 100644
--- a/oox/source/dump/xlsbdumper.cxx
+++ b/oox/source/dump/xlsbdumper.cxx
@@ -27,12 +27,13 @@
************************************************************************/
#include "oox/dump/xlsbdumper.hxx"
+
#include <com/sun/star/io/XTextInputStream.hpp>
+#include "oox/core/filterbase.hxx"
#include "oox/dump/biffdumper.hxx"
#include "oox/dump/oledumper.hxx"
#include "oox/dump/pptxdumper.hxx"
#include "oox/helper/zipstorage.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/ole/olestorage.hxx"
#include "oox/xls/biffhelper.hxx"
#include "oox/xls/formulabase.hxx"
@@ -40,34 +41,31 @@
#if OOX_INCLUDE_DUMPER
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::io::XInputStream;
-using ::comphelper::MediaDescriptor;
-using ::oox::core::FilterBase;
-
-using namespace ::oox::xls;
-
namespace oox {
namespace dump {
namespace xlsb {
// ============================================================================
-namespace {
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+using namespace ::oox::xls;
-const sal_uInt8 OOBIN_STRINGFLAG_FONTS = 0x01;
-const sal_uInt8 OOBIN_STRINGFLAG_PHONETICS = 0x02;
+using ::comphelper::MediaDescriptor;
+using ::oox::core::FilterBase;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
+namespace {
-const sal_uInt8 OOBIN_TOK_ARRAY_DOUBLE = 0;
-const sal_uInt8 OOBIN_TOK_ARRAY_STRING = 1;
-const sal_uInt8 OOBIN_TOK_ARRAY_BOOL = 2;
-const sal_uInt8 OOBIN_TOK_ARRAY_ERROR = 4;
+const sal_uInt8 BIFF12_STRINGFLAG_FONTS = 0x01;
+const sal_uInt8 BIFF12_STRINGFLAG_PHONETICS = 0x02;
-const sal_uInt16 OOBIN_OLEOBJECT_LINKED = 0x0001;
+const sal_uInt16 BIFF12_OLEOBJECT_LINKED = 0x0001;
} // namespace
@@ -83,7 +81,7 @@ RecordObjectBase::~RecordObjectBase()
void RecordObjectBase::construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName )
{
- mxBiffStrm.reset( new RecordInputStream( getRecordDataSequence() ) );
+ mxBiffStrm.reset( new SequenceInputStream( getRecordDataSequence() ) );
SequenceRecordObjectBase::construct( rParent, rxStrm, rSysFileName, mxBiffStrm, "RECORD-NAMES", "SIMPLE-RECORDS" );
if( SequenceRecordObjectBase::implIsValid() )
mxErrCodes = cfg().getNameList( "ERRORCODES" );
@@ -201,11 +199,11 @@ OUString RecordObjectBase::dumpString( const String& rName, bool bRich, bool b32
{
sal_uInt8 nFlags = bRich ? dumpHex< sal_uInt8 >( "flags", "STRING-FLAGS" ) : 0;
- OUString aString = mxBiffStrm->readString( b32BitLen );
+ OUString aString = BiffHelper::readString( *mxBiffStrm, b32BitLen );
writeStringItem( rName( "text" ), aString );
// --- formatting ---
- if( getFlag( nFlags, OOBIN_STRINGFLAG_FONTS ) )
+ if( getFlag( nFlags, BIFF12_STRINGFLAG_FONTS ) )
{
IndentGuard aIndGuard( mxOut );
FontPortionModelList aPortions;
@@ -214,7 +212,7 @@ OUString RecordObjectBase::dumpString( const String& rName, bool bRich, bool b32
}
// --- phonetic text ---
- if( getFlag( nFlags, OOBIN_STRINGFLAG_PHONETICS ) )
+ if( getFlag( nFlags, BIFF12_STRINGFLAG_PHONETICS ) )
{
IndentGuard aIndGuard( mxOut );
dumpString( "phonetic-text" );
@@ -490,7 +488,7 @@ void FormulaObject::constructFmlaObj()
{
if( RecordObjectBase::implIsValid() )
{
- mxFuncProv.reset( new FunctionProvider( FILTER_OOX, BIFF_UNKNOWN, true ) );
+ mxFuncProv.reset( new FunctionProvider( FILTER_OOXML, BIFF_UNKNOWN, true ) );
Config& rCfg = cfg();
mxClasses = rCfg.getNameList( "TOKENCLASSES" );
@@ -568,7 +566,7 @@ OUString FormulaObject::writeFuncIdItem( sal_uInt16 nFuncId, const FunctionInfo*
ItemGuard aItem( mxOut, "func-id" );
writeHexItem( EMPTY_STRING, nFuncId, "FUNCID" );
OUStringBuffer aBuffer;
- const FunctionInfo* pFuncInfo = mxFuncProv->getFuncInfoFromOobFuncId( nFuncId );
+ const FunctionInfo* pFuncInfo = mxFuncProv->getFuncInfoFromBiff12FuncId( nFuncId );
if( pFuncInfo )
aBuffer.append( pFuncInfo->maOoxFuncName );
else
@@ -589,9 +587,9 @@ OUString FormulaObject::writeFuncIdItem( sal_uInt16 nFuncId, const FunctionInfo*
sal_Int32 FormulaObject::dumpTokenCol( const String& rName, bool& rbRelC, bool& rbRelR )
{
sal_uInt16 nCol = dumpHex< sal_uInt16 >( rName, mxRelFlags );
- rbRelC = getFlag( nCol, OOBIN_TOK_REF_COLREL );
- rbRelR = getFlag( nCol, OOBIN_TOK_REF_ROWREL );
- nCol &= OOBIN_TOK_REF_COLMASK;
+ rbRelC = getFlag( nCol, BIFF12_TOK_REF_COLREL );
+ rbRelR = getFlag( nCol, BIFF12_TOK_REF_ROWREL );
+ nCol &= BIFF12_TOK_REF_COLMASK;
return nCol;
}
@@ -822,17 +820,17 @@ bool FormulaObject::dumpTableToken()
StringHelper::appendIndex( aColRange, mxOut->getLastItemValue() );
OUStringBuffer aParams;
size_t nParams = 0;
- if( getFlag( nFlags, OOBIN_TOK_TABLE_ALL ) && ++nParams )
+ if( getFlag( nFlags, BIFF12_TOK_TABLE_ALL ) && ++nParams )
StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#All]" ) );
- if( getFlag( nFlags, OOBIN_TOK_TABLE_HEADERS ) && ++nParams )
+ if( getFlag( nFlags, BIFF12_TOK_TABLE_HEADERS ) && ++nParams )
StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#Headers]" ) );
- if( getFlag( nFlags, OOBIN_TOK_TABLE_DATA ) && ++nParams )
+ if( getFlag( nFlags, BIFF12_TOK_TABLE_DATA ) && ++nParams )
StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#Data]" ) );
- if( getFlag( nFlags, OOBIN_TOK_TABLE_TOTALS ) && ++nParams )
+ if( getFlag( nFlags, BIFF12_TOK_TABLE_TOTALS ) && ++nParams )
StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#Totals]" ) );
- if( getFlag( nFlags, OOBIN_TOK_TABLE_THISROW ) && ++nParams )
+ if( getFlag( nFlags, BIFF12_TOK_TABLE_THISROW ) && ++nParams )
StringHelper::appendToken( aParams, CREATE_OUSTRING( "[#This Row]" ) );
- if( (getFlag( nFlags, OOBIN_TOK_TABLE_COLUMN ) || getFlag( nFlags, OOBIN_TOK_TABLE_COLRANGE )) && ++nParams )
+ if( (getFlag( nFlags, BIFF12_TOK_TABLE_COLUMN ) || getFlag( nFlags, BIFF12_TOK_TABLE_COLRANGE )) && ++nParams )
StringHelper::appendToken( aParams, aColRange.makeStringAndClear() );
OUStringBuffer aOp;
StringHelper::appendIndexedText( aOp, CREATE_OUSTRING( "TABLE" ), nTabId );
@@ -850,13 +848,13 @@ bool FormulaObject::dumpAttrToken()
sal_uInt8 nType = dumpHex< sal_uInt8 >( "type", mxAttrTypes );
switch( nType )
{
- case OOBIN_TOK_ATTR_VOLATILE:
+ case BIFF_TOK_ATTR_VOLATILE:
dumpUnused( 2 );
break;
- case OOBIN_TOK_ATTR_IF:
+ case BIFF_TOK_ATTR_IF:
dumpDec< sal_uInt16 >( "skip" );
break;
- case OOBIN_TOK_ATTR_CHOOSE:
+ case BIFF_TOK_ATTR_CHOOSE:
{
sal_uInt16 nCount = dumpDec< sal_uInt16 >( "choices" );
mxOut->resetItemIndex();
@@ -865,22 +863,22 @@ bool FormulaObject::dumpAttrToken()
dumpDec< sal_uInt16 >( "skip-err" );
}
break;
- case OOBIN_TOK_ATTR_SKIP:
+ case BIFF_TOK_ATTR_SKIP:
dumpDec< sal_uInt16 >( "skip" );
break;
- case OOBIN_TOK_ATTR_SUM:
+ case BIFF_TOK_ATTR_SUM:
dumpUnused( 2 );
mxStack->pushFuncOp( CREATE_OUSTRING( "SUM" ), OUString( OOX_DUMP_BASECLASS ), 1 );
break;
- case OOBIN_TOK_ATTR_ASSIGN:
+ case BIFF_TOK_ATTR_ASSIGN:
dumpUnused( 2 );
break;
- case OOBIN_TOK_ATTR_SPACE:
- case OOBIN_TOK_ATTR_SPACE | BIFF_TOK_ATTR_VOLATILE:
+ case BIFF_TOK_ATTR_SPACE:
+ case BIFF_TOK_ATTR_SPACE | BIFF_TOK_ATTR_VOLATILE:
dumpDec< sal_uInt8 >( "char-type", mxSpTypes );
dumpDec< sal_uInt8 >( "char-count" );
break;
- case OOBIN_TOK_ATTR_IFERROR:
+ case BIFF_TOK_ATTR_IFERROR:
dumpDec< sal_uInt16 >( "skip" );
break;
default:
@@ -968,19 +966,19 @@ OUString FormulaObject::dumpaddDataArrayValue()
OUStringBuffer aValue;
switch( dumpDec< sal_uInt8 >( "type", "ARRAYVALUE-TYPE" ) )
{
- case OOBIN_TOK_ARRAY_DOUBLE:
+ case BIFF_TOK_ARRAY_DOUBLE:
dumpDec< double >( "value" );
aValue.append( mxOut->getLastItemValue() );
break;
- case OOBIN_TOK_ARRAY_STRING:
+ case BIFF_TOK_ARRAY_STRING:
aValue.append( dumpString( "value", false, false ) );
StringHelper::enclose( aValue, OOX_DUMP_STRQUOTE );
break;
- case OOBIN_TOK_ARRAY_BOOL:
+ case BIFF_TOK_ARRAY_BOOL:
dumpBoolean( "value" );
aValue.append( mxOut->getLastItemValue() );
break;
- case OOBIN_TOK_ARRAY_ERROR:
+ case BIFF_TOK_ARRAY_ERROR:
dumpErrorCode( "value" );
aValue.append( mxOut->getLastItemValue() );
dumpUnused( 3 );
@@ -1007,18 +1005,22 @@ void RecordStreamObject::implDumpRecordBody()
{
switch( getRecId() )
{
- case OOBIN_ID_ARRAY:
+ case BIFF12_ID_ARRAY:
dumpRange( "array-range" );
dumpHex< sal_uInt8 >( "flags", "ARRAY-FLAGS" );
mxFmlaObj->dumpCellFormula();
break;
- case OOBIN_ID_BINARYINDEXBLOCK:
+ case BIFF12_ID_AUTOFILTER:
+ dumpRange( "filter-range" );
+ break;
+
+ case BIFF12_ID_BINARYINDEXBLOCK:
dumpRowRange( "row-range" );
dumpUnknown( 12 );
break;
- case OOBIN_ID_BINARYINDEXROWS:
+ case BIFF12_ID_BINARYINDEXROWS:
{
sal_uInt32 nUsedRows = dumpBin< sal_uInt32 >( "used-rows" );
dumpDec< sal_Int64 >( "stream-offset" );
@@ -1028,7 +1030,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_BORDER:
+ case BIFF12_ID_BORDER:
dumpHex< sal_uInt8 >( "flags", "BORDER-FLAGS" );
dumpDec< sal_uInt16 >( "top-style", "BORDERSTYLES" );
dumpColor( "top-color" );
@@ -1042,7 +1044,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpColor( "diag-color" );
break;
- case OOBIN_ID_BRK:
+ case BIFF12_ID_BRK:
dumpDec< sal_Int32 >( "id" );
dumpDec< sal_Int32 >( "min" );
dumpDec< sal_Int32 >( "max" );
@@ -1050,7 +1052,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< sal_Int32 >( "pivot-break", "BOOLEAN" );
break;
- case OOBIN_ID_CALCPR:
+ case BIFF12_ID_CALCPR:
dumpDec< sal_Int32 >( "calc-id" );
dumpDec< sal_Int32 >( "calc-mode", "CALCPR-CALCMODE" );
dumpDec< sal_Int32 >( "iteration-count" );
@@ -1059,46 +1061,46 @@ void RecordStreamObject::implDumpRecordBody()
dumpHex< sal_uInt16 >( "flags", "CALCPR-FLAGS" );
break;
- case OOBIN_ID_CELL_BLANK:
+ case BIFF12_ID_CELL_BLANK:
dumpCellHeader( true );
break;
- case OOBIN_ID_CELL_BOOL:
+ case BIFF12_ID_CELL_BOOL:
dumpCellHeader( true );
dumpBoolean();
break;
- case OOBIN_ID_CELL_DOUBLE:
+ case BIFF12_ID_CELL_DOUBLE:
dumpCellHeader( true );
dumpDec< double >( "value" );
break;
- case OOBIN_ID_CELL_ERROR:
+ case BIFF12_ID_CELL_ERROR:
dumpCellHeader( true );
dumpErrorCode();
break;
- case OOBIN_ID_CELL_RK:
+ case BIFF12_ID_CELL_RK:
dumpCellHeader( true );
dumpRk( "value" );
break;
- case OOBIN_ID_CELL_RSTRING:
+ case BIFF12_ID_CELL_RSTRING:
dumpCellHeader( true );
dumpString( "value", true );
break;
- case OOBIN_ID_CELL_SI:
+ case BIFF12_ID_CELL_SI:
dumpCellHeader( true );
dumpDec< sal_Int32 >( "string-id" );
break;
- case OOBIN_ID_CELL_STRING:
+ case BIFF12_ID_CELL_STRING:
dumpCellHeader( true );
dumpString( "value" );
break;
- case OOBIN_ID_CELLSTYLE:
+ case BIFF12_ID_CELLSTYLE:
dumpDec< sal_Int32 >( "xf-id" );
dumpHex< sal_uInt16 >( "flags", "CELLSTYLE-FLAGS" );
dumpDec< sal_uInt8 >( "builtin-id", "CELLSTYLE-BUILTIN" );
@@ -1106,11 +1108,11 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "name" );
break;
- case OOBIN_ID_CFCOLOR:
+ case BIFF12_ID_CFCOLOR:
dumpColor();
break;
- case OOBIN_ID_CFRULE:
+ case BIFF12_ID_CFRULE:
{
// type/subtype/operator is a mess...
dumpDec< sal_Int32 >( "type", "CFRULE-TYPE" );
@@ -1154,7 +1156,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_CHARTPAGESETUP:
+ case BIFF12_ID_CHARTPAGESETUP:
dumpDec< sal_Int32 >( "paper-size", "PAGESETUP-PAPERSIZE" );
dumpDec< sal_Int32 >( "horizontal-res", "PAGESETUP-DPI" );
dumpDec< sal_Int32 >( "vertical-res", "PAGESETUP-DPI" );
@@ -1164,75 +1166,110 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "printer-settings-rel-id" );
break;
- case OOBIN_ID_CHARTPROTECTION:
+ case BIFF12_ID_CHARTPROTECTION:
dumpHex< sal_uInt16 >( "password-hash" );
// no flags field for the boolean flags?!?
dumpDec< sal_Int32 >( "content-locked", "BOOLEAN" );
dumpDec< sal_Int32 >( "objects-locked", "BOOLEAN" );
break;
- case OOBIN_ID_CHARTSHEETPR:
+ case BIFF12_ID_CHARTSHEETPR:
dumpHex< sal_uInt16 >( "flags", "CHARTSHEETPR-FLAGS" );
dumpColor( "tab-color" );
dumpString( "codename" );
break;
- case OOBIN_ID_CHARTSHEETVIEW:
+ case BIFF12_ID_CHARTSHEETVIEW:
dumpHex< sal_uInt16 >( "flags", "CHARTSHEETVIEW-FLAGS" );
dumpDec< sal_Int32 >( "zoom-scale", "CONV-PERCENT" );
dumpDec< sal_Int32 >( "workbookview-id" );
break;
- case OOBIN_ID_COL:
+ case BIFF12_ID_COL:
dumpColRange();
dumpDec< sal_Int32 >( "col-width", "CONV-COLWIDTH" );
dumpDec< sal_Int32 >( "custom-xf-id" );
dumpHex< sal_uInt16 >( "flags", "COL-FLAGS" );
break;
- case OOBIN_ID_COLBREAKS:
+ case BIFF12_ID_COLBREAKS:
dumpDec< sal_Int32 >( "count" );
dumpDec< sal_Int32 >( "manual-count" );
break;
- case OOBIN_ID_COLOR:
+ case BIFF12_ID_COLOR:
dumpColor();
break;
- case OOBIN_ID_COMMENT:
+ case BIFF12_ID_COMMENT:
dumpDec< sal_Int32 >( "author-id" );
dumpRange( "ref" );
dumpGuid();
break;
- case OOBIN_ID_COMMENTAUTHOR:
+ case BIFF12_ID_COMMENTAUTHOR:
dumpString( "author" );
break;
- case OOBIN_ID_COMMENTTEXT:
+ case BIFF12_ID_COMMENTTEXT:
dumpString( "text", true );
break;
- case OOBIN_ID_CONDFORMATTING:
+ case BIFF12_ID_CONDFORMATTING:
dumpDec< sal_Int32 >( "cfrule-count" );
dumpDec< sal_Int32 >( "pivot-table", "BOOLEAN" );
dumpRangeList();
break;
- case OOBIN_ID_CONTROL:
+ case BIFF12_ID_CONNECTION:
+ {
+ dumpDec< sal_uInt8 >( "refreshed-version" );
+ dumpDec< sal_uInt8 >( "min-refresh-version" );
+ dumpDec< sal_uInt8 >( "save-password", "CONNECTION-SAVEPASSWORD" );
+ dumpUnused( 1 );
+ dumpDec< sal_uInt16 >( "refresh-interval", "CONNECTION-INTERVAL" );
+ dumpHex< sal_uInt16 >( "flags", "CONNECTION-FLAGS" );
+ sal_uInt16 nStrFlags = dumpHex< sal_uInt16 >( "string-flags", "CONNECTION-STRINGFLAGS" );
+ dumpDec< sal_Int32 >( "data-source-type", "CONNECTION-SOURCETYPE" );
+ dumpDec< sal_Int32 >( "reconnect-type", "CONNECTION-RECONNECTTYPE" );
+ dumpDec< sal_Int32 >( "id" );
+ dumpDec< sal_uInt8 >( "credentials", "CONNECTION-CREDENTIALS" );
+ if( nStrFlags & 0x0001 ) dumpString( "source-file" );
+ if( nStrFlags & 0x0002 ) dumpString( "source-conn-file" );
+ if( nStrFlags & 0x0004 ) dumpString( "description" );
+ if( nStrFlags & 0x0008 ) dumpString( "name" );
+ if( nStrFlags & 0x0010 ) dumpString( "sso-id" );
+ }
+ break;
+
+ case BIFF12_ID_CONTROL:
dumpDec< sal_Int32 >( "shape-id" );
dumpString( "rel-id" );
dumpString( "name" );
break;
- case OOBIN_ID_DATATABLE:
+ case BIFF12_ID_CUSTOMFILTER:
+ {
+ sal_uInt8 nType = dumpDec< sal_uInt8 >( "data-type", "CUSTOMFILTER-DATATYPE" );
+ dumpDec< sal_uInt8 >( "operator", "CUSTOMFILTER-OPERATOR" );
+ switch( nType )
+ {
+ case 4: dumpDec< double >( "value" ); break;
+ case 6: dumpUnused( 8 ); dumpString( "value" ); break;
+ case 8: dumpBoolean( "value" ); dumpUnused( 7 ); break;
+ default: dumpUnused( 8 );
+ }
+ }
+ break;
+
+ case BIFF12_ID_DATATABLE:
dumpRange( "table-range" );
dumpAddress( "ref1" );
dumpAddress( "ref2" );
dumpHex< sal_uInt8 >( "flags", "DATATABLE-FLAGS" );
break;
- case OOBIN_ID_DATAVALIDATION:
+ case BIFF12_ID_DATAVALIDATION:
dumpHex< sal_uInt32 >( "flags", "DATAVALIDATION-FLAGS" );
dumpRangeList();
dumpString( "error-title" );
@@ -1243,7 +1280,7 @@ void RecordStreamObject::implDumpRecordBody()
mxFmlaObj->dumpNameFormula( "formula2" );
break;
- case OOBIN_ID_DATAVALIDATIONS:
+ case BIFF12_ID_DATAVALIDATIONS:
dumpHex< sal_uInt16 >( "flags", "DATAVALIDATIONS-FLAGS" );
dumpDec< sal_Int32 >( "input-x" );
dumpDec< sal_Int32 >( "input-y" );
@@ -1251,16 +1288,16 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< sal_Int32 >( "count" );
break;
- case OOBIN_ID_DDEITEMVALUES:
+ case BIFF12_ID_DDEITEMVALUES:
dumpDec< sal_Int32 >( "rows" );
dumpDec< sal_Int32 >( "columns" );
break;
- case OOBIN_ID_DDEITEM_STRING:
+ case BIFF12_ID_DDEITEM_STRING:
dumpString( "value" );
break;
- case OOBIN_ID_DEFINEDNAME:
+ case BIFF12_ID_DEFINEDNAME:
dumpHex< sal_uInt32 >( "flags", "DEFINEDNAME-FLAGS" );
dumpChar( "accelerator", RTL_TEXTENCODING_ISO_8859_1 );
dumpDec< sal_Int32 >( "sheet-id", "DEFINEDNAME-SHEETID" );
@@ -1273,15 +1310,24 @@ void RecordStreamObject::implDumpRecordBody()
if( mxStrm->getRemaining() >= 4 ) dumpString( "statusbar-text" );
break;
- case OOBIN_ID_DIMENSION:
+ case BIFF12_ID_DIMENSION:
dumpRange( "used-range" );
break;
- case OOBIN_ID_DRAWING:
+ case BIFF12_ID_DISCRETEFILTER:
+ dumpString( "value" );
+ break;
+
+ case BIFF12_ID_DISCRETEFILTERS:
+ dumpBool< sal_Int32 >( "show-blank" );
+ dumpDec< sal_Int32 >( "calendar-type", "DISCRETEFILTERS-CALTYPE" );
+ break;
+
+ case BIFF12_ID_DRAWING:
dumpString( "rel-id" );
break;
- case OOBIN_ID_DXF:
+ case BIFF12_ID_DXF:
dumpHex< sal_uInt32 >( "flags", "DXF-FLAGS" );
for( sal_uInt16 nIndex = 0, nCount = dumpDec< sal_uInt16 >( "subrec-count" ); !mxStrm->isEof() && (nIndex < nCount); ++nIndex )
{
@@ -1378,27 +1424,27 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_EXTCELL_BOOL:
+ case BIFF12_ID_EXTCELL_BOOL:
dumpColIndex();
dumpBoolean();
break;
- case OOBIN_ID_EXTCELL_DOUBLE:
+ case BIFF12_ID_EXTCELL_DOUBLE:
dumpColIndex();
dumpDec< double >( "value" );
break;
- case OOBIN_ID_EXTCELL_ERROR:
+ case BIFF12_ID_EXTCELL_ERROR:
dumpColIndex();
dumpErrorCode();
break;
- case OOBIN_ID_EXTCELL_STRING:
+ case BIFF12_ID_EXTCELL_STRING:
dumpColIndex();
dumpString( "value" );
break;
- case OOBIN_ID_EXTERNALBOOK:
+ case BIFF12_ID_EXTERNALBOOK:
switch( dumpDec< sal_uInt16 >( "type", "EXTERNALBOOK-TYPE" ) )
{
case 0:
@@ -1416,21 +1462,21 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_EXTERNALNAME:
+ case BIFF12_ID_EXTERNALNAME:
dumpString( "name" );
break;
- case OOBIN_ID_EXTERNALNAMEFLAGS:
+ case BIFF12_ID_EXTERNALNAMEFLAGS:
dumpHex< sal_uInt16 >( "flags", "EXTERNALNAMEFLAGS-FLAGS" );
dumpDec< sal_Int32 >( "sheet-id" );
dumpBoolean( "is-dde-ole" );
break;
- case OOBIN_ID_EXTERNALREF:
+ case BIFF12_ID_EXTERNALREF:
dumpString( "rel-id" );
break;
- case OOBIN_ID_EXTERNALSHEETS:
+ case BIFF12_ID_EXTERNALSHEETS:
{
sal_Int32 nCount = dumpDec< sal_Int32 >( "ref-count" );
TableGuard aTabGuard( mxOut, 13, 17, 24 );
@@ -1446,28 +1492,28 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_EXTROW:
+ case BIFF12_ID_EXTROW:
dumpRowIndex();
break;
- case OOBIN_ID_EXTSHEETDATA:
+ case BIFF12_ID_EXTSHEETDATA:
dumpDec< sal_Int32 >( "sheet-id" );
dumpHex< sal_uInt8 >( "flags", "EXTSHEETDATA-FLAGS" );
break;
- case OOBIN_ID_EXTSHEETNAMES:
+ case BIFF12_ID_EXTSHEETNAMES:
mxOut->resetItemIndex();
for( sal_Int32 nSheet = 0, nCount = dumpDec< sal_Int32 >( "sheet-count" ); !mxStrm->isEof() && (nSheet < nCount); ++nSheet )
dumpString( "#sheet-name" );
break;
- case OOBIN_ID_FILESHARING:
+ case BIFF12_ID_FILESHARING:
dumpBool< sal_uInt16 >( "recommend-read-only" );
dumpHex< sal_uInt16 >( "password-hash" );
dumpString( "password-creator" );
break;
- case OOBIN_ID_FILL:
+ case BIFF12_ID_FILL:
dumpDec< sal_Int32 >( "fill-pattern", "FILLPATTERNS" );
dumpColor( "fg-color" );
dumpColor( "bg-color" );
@@ -1482,7 +1528,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_FILEVERSION:
+ case BIFF12_ID_FILEVERSION:
dumpGuid( "codename" );
dumpString( "app-name" );
dumpString( "last-edited" );
@@ -1490,7 +1536,12 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "build-version" );
break;
- case OOBIN_ID_FONT:
+ case BIFF12_ID_FILTERCOLUMN:
+ dumpDec< sal_Int32 >( "column-index" );
+ dumpHex< sal_uInt16 >( "flags", "FILTERCOLUMN-FLAGS" );
+ break;
+
+ case BIFF12_ID_FONT:
dumpDec< sal_uInt16 >( "height", "CONV-TWIP-TO-PT" );
dumpHex< sal_uInt16 >( "flags", "FONT-FLAGS" );
dumpDec< sal_uInt16 >( "weight", "FONT-WEIGHT" );
@@ -1504,39 +1555,39 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "name" );
break;
- case OOBIN_ID_FORMULA_BOOL:
+ case BIFF12_ID_FORMULA_BOOL:
dumpCellHeader( true );
dumpBoolean();
dumpHex< sal_uInt16 >( "flags", "FORMULA-FLAGS" );
mxFmlaObj->dumpCellFormula();
break;
- case OOBIN_ID_FORMULA_DOUBLE:
+ case BIFF12_ID_FORMULA_DOUBLE:
dumpCellHeader( true );
dumpDec< double >( "value" );
dumpHex< sal_uInt16 >( "flags", "FORMULA-FLAGS" );
mxFmlaObj->dumpCellFormula();
break;
- case OOBIN_ID_FORMULA_ERROR:
+ case BIFF12_ID_FORMULA_ERROR:
dumpCellHeader( true );
dumpErrorCode();
dumpHex< sal_uInt16 >( "flags", "FORMULA-FLAGS" );
mxFmlaObj->dumpCellFormula();
break;
- case OOBIN_ID_FORMULA_STRING:
+ case BIFF12_ID_FORMULA_STRING:
dumpCellHeader( true );
dumpString( "value" );
dumpHex< sal_uInt16 >( "flags", "FORMULA-FLAGS" );
mxFmlaObj->dumpCellFormula();
break;
- case OOBIN_ID_FUNCTIONGROUP:
+ case BIFF12_ID_FUNCTIONGROUP:
dumpString( "name" );
break;
- case OOBIN_ID_HEADERFOOTER:
+ case BIFF12_ID_HEADERFOOTER:
dumpHex< sal_uInt16 >( "flags", "HEADERFOOTER-FLAGS" );
dumpString( "odd-header" );
dumpString( "odd-footer" );
@@ -1546,7 +1597,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "first-footer" );
break;
- case OOBIN_ID_HYPERLINK:
+ case BIFF12_ID_HYPERLINK:
dumpRange();
dumpString( "rel-id" );
dumpString( "location" );
@@ -1554,84 +1605,84 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "display" );
break;
- case OOBIN_ID_INPUTCELLS:
+ case BIFF12_ID_INPUTCELLS:
dumpAddress( "pos" );
dumpUnused( 8 );
dumpDec< sal_uInt16 >( "numfmt-id" );
dumpString( "value" );
break;
- case OOBIN_ID_LEGACYDRAWING:
+ case BIFF12_ID_LEGACYDRAWING:
dumpString( "rel-id" );
break;
- case OOBIN_ID_MERGECELL:
+ case BIFF12_ID_MERGECELL:
dumpRange();
break;
- case OOBIN_ID_MULTCELL_BLANK:
+ case BIFF12_ID_MULTCELL_BLANK:
dumpCellHeader( false );
break;
- case OOBIN_ID_MULTCELL_BOOL:
+ case BIFF12_ID_MULTCELL_BOOL:
dumpCellHeader( false );
dumpBoolean();
break;
- case OOBIN_ID_MULTCELL_DOUBLE:
+ case BIFF12_ID_MULTCELL_DOUBLE:
dumpCellHeader( false );
dumpDec< double >( "value" );
break;
- case OOBIN_ID_MULTCELL_ERROR:
+ case BIFF12_ID_MULTCELL_ERROR:
dumpCellHeader( false );
dumpErrorCode();
break;
- case OOBIN_ID_MULTCELL_RK:
+ case BIFF12_ID_MULTCELL_RK:
dumpCellHeader( false );
dumpRk( "value" );
break;
- case OOBIN_ID_MULTCELL_RSTRING:
+ case BIFF12_ID_MULTCELL_RSTRING:
dumpCellHeader( false );
dumpString( "value", true );
break;
- case OOBIN_ID_MULTCELL_SI:
+ case BIFF12_ID_MULTCELL_SI:
dumpCellHeader( false );
dumpDec< sal_Int32 >( "string-id" );
break;
- case OOBIN_ID_MULTCELL_STRING:
+ case BIFF12_ID_MULTCELL_STRING:
dumpCellHeader( false );
dumpString( "value" );
break;
- case OOBIN_ID_NUMFMT:
+ case BIFF12_ID_NUMFMT:
dumpDec< sal_uInt16 >( "numfmt-id" );
dumpString( "format" );
break;
- case OOBIN_ID_OLEOBJECT:
+ case BIFF12_ID_OLEOBJECT:
{
dumpDec< sal_Int32 >( "aspect", "OLEOBJECT-ASPECT" );
dumpDec< sal_Int32 >( "update", "OLEOBJECT-UPDATE" );
dumpDec< sal_Int32 >( "shape-id" );
sal_uInt16 nFlags = dumpHex< sal_uInt16 >( "flags", "OLEOBJECT-FLAGS" );
dumpString( "prog-id" );
- if( getFlag( nFlags, OOBIN_OLEOBJECT_LINKED ) )
+ if( getFlag( nFlags, BIFF12_OLEOBJECT_LINKED ) )
mxFmlaObj->dumpNameFormula( "link" );
else
dumpString( "rel-id" );
}
break;
- case OOBIN_ID_OLESIZE:
+ case BIFF12_ID_OLESIZE:
dumpRange( "visible-range" );
break;
- case OOBIN_ID_PAGEMARGINS:
+ case BIFF12_ID_PAGEMARGINS:
dumpDec< double >( "left-margin" );
dumpDec< double >( "right-margin" );
dumpDec< double >( "top-margin" );
@@ -1640,7 +1691,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< double >( "footer-margin" );
break;
- case OOBIN_ID_PAGESETUP:
+ case BIFF12_ID_PAGESETUP:
dumpDec< sal_Int32 >( "paper-size", "PAGESETUP-PAPERSIZE" );
dumpDec< sal_Int32 >( "scaling", "CONV-PERCENT" );
dumpDec< sal_Int32 >( "horizontal-res", "PAGESETUP-DPI" );
@@ -1653,7 +1704,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "printer-settings-rel-id" );
break;
- case OOBIN_ID_PANE:
+ case BIFF12_ID_PANE:
dumpDec< double >( "x-split-pos" );
dumpDec< double >( "y-split-pos" );
dumpAddress( "second-top-left" );
@@ -1661,7 +1712,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpHex< sal_uInt8 >( "flags", "PANE-FLAGS" );
break;
- case OOBIN_ID_PCDEFINITION:
+ case BIFF12_ID_PCDEFINITION:
{
dumpDec< sal_uInt8 >( "refreshed-version" );
dumpDec< sal_uInt8 >( "min-refresh-version" );
@@ -1676,7 +1727,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PCDFIELD:
+ case BIFF12_ID_PCDFIELD:
{
sal_uInt16 nFlags = dumpHex< sal_uInt16 >( "flags", "PCDFIELD-FLAGS" );
dumpDec< sal_Int32 >( "numfmt-id" );
@@ -1696,12 +1747,12 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PCDFIELDGROUP:
+ case BIFF12_ID_PCDFIELDGROUP:
dumpDec< sal_Int32 >( "parent-field" );
dumpDec< sal_Int32 >( "base-field" );
break;
- case OOBIN_ID_PCDFRANGEPR:
+ case BIFF12_ID_PCDFRANGEPR:
dumpDec< sal_uInt8 >( "group-by", "PCDFRANGEPR-GROUPBY" );
dumpHex< sal_uInt8 >( "flags", "PCDFRANGEPR-FLAGS" );
dumpDec< double >( "start-value" );
@@ -1709,7 +1760,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< double >( "interval" );
break;
- case OOBIN_ID_PCDFSHAREDITEMS:
+ case BIFF12_ID_PCDFSHAREDITEMS:
{
sal_uInt16 nFlags = dumpHex< sal_uInt16 >( "flags", "PCDFSHAREDITEMS-FLAGS" );
dumpDec< sal_Int32 >( "count" );
@@ -1718,7 +1769,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PCDSHEETSOURCE:
+ case BIFF12_ID_PCDSHEETSOURCE:
{
sal_uInt8 nIsDefName = dumpBoolean( "is-def-name" );
dumpBoolean( "is-builtin-def-name" );
@@ -1729,12 +1780,12 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PCDSOURCE:
+ case BIFF12_ID_PCDSOURCE:
dumpDec< sal_Int32 >( "source-type", "PCDSOURCE-TYPE" );
dumpDec< sal_Int32 >( "connection-id" );
break;
- case OOBIN_ID_PCITEM_ARRAY:
+ case BIFF12_ID_PCITEM_ARRAY:
{
sal_uInt16 nType = dumpDec< sal_uInt16 >( "type", "PCITEM_ARRAY-TYPE" );
sal_Int32 nCount = dumpDec< sal_Int32 >( "count" );
@@ -1753,97 +1804,97 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PCITEM_BOOL:
+ case BIFF12_ID_PCITEM_BOOL:
dumpBoolean( "value" );
break;
- case OOBIN_ID_PCITEM_DATE:
+ case BIFF12_ID_PCITEM_DATE:
dumpPivotDateTime( "value" );
break;
- case OOBIN_ID_PCITEM_DOUBLE:
+ case BIFF12_ID_PCITEM_DOUBLE:
dumpDec< double >( "value" );
// TODO: server formatting
break;
- case OOBIN_ID_PCITEM_ERROR:
+ case BIFF12_ID_PCITEM_ERROR:
dumpErrorCode( "value" );
// TODO: server formatting
break;
- case OOBIN_ID_PCITEM_INDEX:
+ case BIFF12_ID_PCITEM_INDEX:
dumpDec< sal_Int32 >( "index" );
break;
- case OOBIN_ID_PCITEM_MISSING:
+ case BIFF12_ID_PCITEM_MISSING:
// TODO: server formatting
break;
- case OOBIN_ID_PCITEM_STRING:
+ case BIFF12_ID_PCITEM_STRING:
dumpString( "value" );
// TODO: server formatting
break;
- case OOBIN_ID_PCITEMA_BOOL:
+ case BIFF12_ID_PCITEMA_BOOL:
dumpBoolean( "value" );
// TODO: additional info
break;
- case OOBIN_ID_PCITEMA_DATE:
+ case BIFF12_ID_PCITEMA_DATE:
dumpPivotDateTime( "value" );
// TODO: additional info
break;
- case OOBIN_ID_PCITEMA_DOUBLE:
+ case BIFF12_ID_PCITEMA_DOUBLE:
dumpDec< double >( "value" );
// TODO: additional info
break;
- case OOBIN_ID_PCITEMA_ERROR:
+ case BIFF12_ID_PCITEMA_ERROR:
dumpErrorCode( "value" );
// TODO: additional info
break;
- case OOBIN_ID_PCITEMA_MISSING:
+ case BIFF12_ID_PCITEMA_MISSING:
// TODO: additional info
break;
- case OOBIN_ID_PCITEMA_STRING:
+ case BIFF12_ID_PCITEMA_STRING:
dumpString( "value" );
// TODO: additional info
break;
- case OOBIN_ID_PHONETICPR:
+ case BIFF12_ID_PHONETICPR:
dumpDec< sal_uInt16 >( "font-id", "FONTNAMES" );
dumpDec< sal_Int32 >( "type", "PHONETICPR-TYPE" );
dumpDec< sal_Int32 >( "alignment", "PHONETICPR-ALIGNMENT" );
break;
- case OOBIN_ID_PICTURE:
+ case BIFF12_ID_PICTURE:
dumpString( "rel-id" );
break;
- case OOBIN_ID_PIVOTAREA:
+ case BIFF12_ID_PIVOTAREA:
dumpDec< sal_Int32 >( "field" );
dumpDec< sal_uInt8 >( "type", "PIVOTAREA-TYPE" );
dumpHex< sal_uInt8 >( "flags-1", "PIVOTAREA-FLAGS1" );
dumpHex< sal_uInt16 >( "flags-2", "PIVOTAREA-FLAGS2" );
break;
- case OOBIN_ID_PIVOTCACHE:
+ case BIFF12_ID_PIVOTCACHE:
dumpDec< sal_Int32 >( "cache-id" );
dumpString( "rel-id" );
break;
- case OOBIN_ID_PTCOLFIELDS:
+ case BIFF12_ID_PTCOLFIELDS:
dumpDec< sal_Int32 >( "count" );
mxOut->resetItemIndex();
while( mxStrm->getRemaining() >= 4 )
dumpDec< sal_Int32 >( "#field", "PT-FIELDINDEX" );
break;
- case OOBIN_ID_PTDATAFIELD:
+ case BIFF12_ID_PTDATAFIELD:
dumpDec< sal_Int32 >( "field" );
dumpDec< sal_Int32 >( "subtotal", "PTDATAFIELD-SUBTOTAL" );
dumpDec< sal_Int32 >( "show-data-as", "PTDATAFIELD-SHOWDATAAS" );
@@ -1854,7 +1905,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "name" );
break;
- case OOBIN_ID_PTDEFINITION:
+ case BIFF12_ID_PTDEFINITION:
{
dumpDec< sal_uInt8 >( "created-version" );
dumpHex< sal_uInt8 >( "flags-1", "PTDEFINITION-FLAGS1" );
@@ -1884,7 +1935,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PTFIELD:
+ case BIFF12_ID_PTFIELD:
dumpHex< sal_uInt32 >( "flags-1", "PTFIELD-FLAGS1" );
dumpDec< sal_Int32 >( "num-fmt" );
dumpHex< sal_uInt32 >( "flags-2", "PTFIELD-FLAGS2" );
@@ -1892,7 +1943,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< sal_Int32 >( "autoshow-datafield-idx" );
break;
- case OOBIN_ID_PTFILTER:
+ case BIFF12_ID_PTFILTER:
{
dumpDec< sal_Int32 >( "field" );
dumpDec< sal_Int32 >( "member-prop-field" );
@@ -1909,7 +1960,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PTFITEM:
+ case BIFF12_ID_PTFITEM:
{
dumpDec< sal_uInt8 >( "type", "PTFITEM-TYPE" );
sal_uInt16 nFlags = dumpHex< sal_uInt16 >( "flags", "PTFITEM-FLAGS" );
@@ -1918,7 +1969,7 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PTLOCATION:
+ case BIFF12_ID_PTLOCATION:
dumpRange( "location" );
dumpDec< sal_Int32 >( "first-header-row" );
dumpDec< sal_Int32 >( "first-data-row" );
@@ -1927,7 +1978,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< sal_Int32 >( "page-col-count" );
break;
- case OOBIN_ID_PTPAGEFIELD:
+ case BIFF12_ID_PTPAGEFIELD:
{
dumpDec< sal_Int32 >( "field" );
dumpDec< sal_Int32 >( "cache-item", "PTPAGEFIELD-ITEM" );
@@ -1938,21 +1989,28 @@ void RecordStreamObject::implDumpRecordBody()
}
break;
- case OOBIN_ID_PTREFERENCE:
+ case BIFF12_ID_PTREFERENCE:
dumpDec< sal_Int32 >( "field", "PT-FIELDINDEX" );
dumpDec< sal_Int32 >( "item-count" );
dumpHex< sal_uInt16 >( "flags-1", "PTREFERENCE-FLAGS1" );
dumpHex< sal_uInt8 >( "flags-2", "PTREFERENCE-FLAGS2" );
break;
- case OOBIN_ID_PTROWFIELDS:
+ case BIFF12_ID_PTROWFIELDS:
dumpDec< sal_Int32 >( "count" );
mxOut->resetItemIndex();
while( mxStrm->getRemaining() >= 4 )
dumpDec< sal_Int32 >( "#field", "PT-FIELDINDEX" );
break;
- case OOBIN_ID_ROW:
+ case BIFF12_ID_QUERYTABLE:
+ dumpHex< sal_uInt32 >( "flags", "QUERYTABLE-FLAGS" );
+ dumpDec< sal_uInt16 >( "autoformat-id" );
+ dumpDec< sal_Int32 >( "connection-id" );
+ dumpString( "defined-name" );
+ break;
+
+ case BIFF12_ID_ROW:
dumpRowIndex();
dumpDec< sal_Int32 >( "custom-xf-id" );
dumpDec< sal_uInt16 >( "height", "CONV-TWIP-TO-PT" );
@@ -1963,12 +2021,12 @@ void RecordStreamObject::implDumpRecordBody()
dumpRowRange( "#row-spans" );
break;
- case OOBIN_ID_ROWBREAKS:
+ case BIFF12_ID_ROWBREAKS:
dumpDec< sal_Int32 >( "count" );
dumpDec< sal_Int32 >( "manual-count" );
break;
- case OOBIN_ID_SCENARIO:
+ case BIFF12_ID_SCENARIO:
dumpDec< sal_uInt16 >( "cell-count" );
// two longs instead of flag field
dumpDec< sal_Int32 >( "locked", "BOOLEAN" );
@@ -1978,32 +2036,32 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "user" );
break;
- case OOBIN_ID_SCENARIOS:
+ case BIFF12_ID_SCENARIOS:
dumpDec< sal_uInt16 >( "selected" );
dumpDec< sal_uInt16 >( "shown" );
dumpRangeList( "result-cells" );
break;
- case OOBIN_ID_SELECTION:
+ case BIFF12_ID_SELECTION:
dumpDec< sal_Int32 >( "pane", "PANE-ID" );
dumpAddress( "active-cell" );
dumpDec< sal_Int32 >( "active-cell-id" );
dumpRangeList( "selection" );
break;
- case OOBIN_ID_SHAREDFMLA:
+ case BIFF12_ID_SHAREDFMLA:
dumpRange( "formula-range" );
mxFmlaObj->dumpCellFormula();
break;
- case OOBIN_ID_SHEET:
+ case BIFF12_ID_SHEET:
dumpDec< sal_Int32 >( "sheet-state", "SHEET-STATE" );
dumpDec< sal_Int32 >( "sheet-id" );
dumpString( "rel-id" );
dumpString( "sheet-name" );
break;
- case OOBIN_ID_SHEETFORMATPR:
+ case BIFF12_ID_SHEETFORMATPR:
dumpDec< sal_Int32 >( "default-col-width", "CONV-COLWIDTH" );
dumpDec< sal_uInt16 >( "base-col-width" );
dumpDec< sal_uInt16 >( "default-row-height", "CONV-TWIP-TO-PT" );
@@ -2012,7 +2070,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< sal_uInt8 >( "max-col-outline" );
break;
- case OOBIN_ID_SHEETPR:
+ case BIFF12_ID_SHEETPR:
dumpHex< sal_uInt16 >( "flags1", "SHEETPR-FLAGS1" );
dumpHex< sal_uInt8 >( "flags2", "SHEETPR-FLAGS2" );
dumpColor( "tab-color" );
@@ -2020,7 +2078,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "codename" );
break;
- case OOBIN_ID_SHEETPROTECTION:
+ case BIFF12_ID_SHEETPROTECTION:
dumpHex< sal_uInt16 >( "password-hash" );
// no flags field for all these boolean flags?!?
dumpDec< sal_Int32 >( "sheet-locked", "BOOLEAN" );
@@ -2041,7 +2099,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< sal_Int32 >( "select-unlocked-cells-locked", "BOOLEAN" );
break;
- case OOBIN_ID_SHEETVIEW:
+ case BIFF12_ID_SHEETVIEW:
dumpHex< sal_uInt16 >( "flags", "SHEETVIEW-FLAGS" );
dumpDec< sal_Int32 >( "view-type", "SHEETVIEW-TYPE" );
dumpAddress( "top-left" );
@@ -2053,16 +2111,16 @@ void RecordStreamObject::implDumpRecordBody()
dumpDec< sal_Int32 >( "workbookview-id" );
break;
- case OOBIN_ID_SI:
+ case BIFF12_ID_SI:
dumpString( "string", true );
break;
- case OOBIN_ID_SST:
+ case BIFF12_ID_SST:
dumpDec< sal_Int32 >( "string-cell-count" );
dumpDec< sal_Int32 >( "sst-size" );
break;
- case OOBIN_ID_TABLE:
+ case BIFF12_ID_TABLE:
dumpRange();
dumpDec< sal_Int32 >( "type", "TABLE-TYPE" );
dumpDec< sal_Int32 >( "id" );
@@ -2084,41 +2142,51 @@ void RecordStreamObject::implDumpRecordBody()
dumpString( "totalsrow-cell-style" );
break;
- case OOBIN_ID_TABLEPART:
+ case BIFF12_ID_TABLEPART:
dumpString( "rel-id" );
break;
- case OOBIN_ID_TABLESTYLEINFO:
+ case BIFF12_ID_TABLESTYLEINFO:
dumpHex< sal_uInt16 >( "flags", "TABLESTYLEINFO-FLAGS" );
dumpString( "style-name" );
break;
- case OOBIN_ID_TOP10FILTER:
+ case BIFF12_ID_TOP10FILTER:
dumpHex< sal_uInt8 >( "flags", "TOP10FILTER-FLAGS" );
dumpDec< double >( "value" );
dumpDec< double >( "cell-value" );
break;
- case OOBIN_ID_VOLTYPEMAIN:
+ case BIFF12_ID_VOLTYPEMAIN:
dumpString( "first" );
break;
- case OOBIN_ID_VOLTYPESTP:
+ case BIFF12_ID_VOLTYPESTP:
dumpString( "topic-value" );
break;
- case OOBIN_ID_VOLTYPETR:
+ case BIFF12_ID_VOLTYPETR:
dumpAddress( "ref" );
dumpDec< sal_Int32 >( "sheet-id" );
break;
- case OOBIN_ID_WORKBOOKPR:
+ case BIFF12_ID_WEBPR:
+ {
+ dumpHex< sal_uInt32 >( "flags", "WEBPR-FLAGS" );
+ sal_uInt8 nStrFlags = dumpHex< sal_uInt8 >( "string-flags", "WEBPR-STRINGFLAGS" );
+ if( nStrFlags & 0x04 ) dumpString( "url" );
+ if( nStrFlags & 0x01 ) dumpString( "post-method" );
+ if( nStrFlags & 0x02 ) dumpString( "edit-page" );
+ }
+ break;
+
+ case BIFF12_ID_WORKBOOKPR:
dumpHex< sal_uInt32 >( "flags", "WORKBBOKPR-FLAGS" );
dumpDec< sal_Int32 >( "default-theme-version" );
dumpString( "codename" );
break;
- case OOBIN_ID_WORKBOOKVIEW:
+ case BIFF12_ID_WORKBOOKVIEW:
dumpDec< sal_Int32 >( "x-window" );
dumpDec< sal_Int32 >( "y-window" );
dumpDec< sal_Int32 >( "win-width" );
@@ -2129,7 +2197,7 @@ void RecordStreamObject::implDumpRecordBody()
dumpHex< sal_uInt8 >( "flags", "WORKBOOKVIEW-FLAGS" );
break;
- case OOBIN_ID_XF:
+ case BIFF12_ID_XF:
dumpDec< sal_uInt16 >( "parent-xf-id" );
dumpDec< sal_uInt16 >( "numfmt-id" );
dumpDec< sal_uInt16 >( "font-id", "FONTNAMES" );
@@ -2220,6 +2288,7 @@ void RootStorageObject::implDumpStream( const BinaryInputStreamRef& rxStrm, cons
rStrgPath.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "xl/macrosheets" ) ) ||
rStrgPath.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "xl/pivotCache" ) ) ||
rStrgPath.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "xl/pivotTables" ) ) ||
+ rStrgPath.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "xl/queryTables" ) ) ||
rStrgPath.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "xl/tables" ) ) ||
rStrgPath.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "xl/worksheets" ) ) )
{
@@ -2271,4 +2340,4 @@ void Dumper::implDump()
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/dump/xlsbdumper.ini b/oox/source/dump/xlsbdumper.ini
index f2ac3b49b4d6..3490111c4ba5 100644
--- a/oox/source/dump/xlsbdumper.ini
+++ b/oox/source/dump/xlsbdumper.ini
@@ -174,18 +174,20 @@ multilist=RECORD-NAMES
0x0088=BOOKVIEWS_END,SHEETVIEW,SHEETVIEW_END,CHARTSHEETVIEWS,CHARTSHEETVIEWS_END,CHARTSHEETVIEW,CHARTSHEETVIEW_END,SHEETS
0x0090=SHEETS_END,SHEETDATA,SHEETDATA_END,SHEETPR,DIMENSION,,,PANE
0x0098=SELECTION,WORKBOOKPR,SMARTTAGPR,FILERECOVERYPR,SHEET,CALCPR,WORKBOOKVIEW,SST
- 0x00A0=SST_END,AUTOFILTER,AUTOFILTER_END,FILTERCOLUMN,FILTERCOLUMN_END,FILTERS,FILTERS_END,FILTER
- 0x00A8=COLORFILTER,ICONFILTER,TOP10FILTER,DYNAMICFILTER,CUSTOMFILTERS,CUSTOMFILTERS_END,CUSTOMFILTER,AUTOFILTERDATEGROUPITEM
+ 0x00A0=SST_END,AUTOFILTER,AUTOFILTER_END,FILTERCOLUMN,FILTERCOLUMN_END,DISCRETEFILTERS,DISCRETEFILTERS_END,DISCRETEFILTER
+ 0x00A8=COLORFILTER,ICONFILTER,TOP10FILTER,DYNAMICFILTER,CUSTOMFILTERS,CUSTOMFILTERS_END,CUSTOMFILTER,AFDATEGROUPITEM
0x00B0=MERGECELL,MERGECELLS,MERGECELLS_END,PCDEFINITION,PCDEFINITION_END,PCDFIELDS,PCDFIELDS_END,PCDFIELD
0x00B8=PCDFIELD_END,PCDSOURCE,PCDSOURCE_END,PCDSHEETSOURCE,PCDSHEETSOURCE_END,PCDFSHAREDITEMS,PCDFSHAREDITEMS_END,PCITEM_ARRAY
0x00C0=PCITEM_ARRAY_END,PCRECORDS,PCRECORDS_END,,,,,
+ 0x00C8=,CONNECTION,CONNECTION_END,,,,,
0x00D8=,,,PCDFIELDGROUP,PCDFIELDGROUP_END,PCDFGROUPITEMS,PCDFGROUPITEMS_END,PCDFRANGEPR
0x00E0=PCDFRANGEPR_END,PCDFDISCRETEPR,PCDFDISCRETEPR_END,,,,,
0x00F0=,,,,,,,PIVOTAREA
0x00F8=PIVOTAREA_END,PTREFERENCES,PTREFERENCES_END,PTREFERENCE,PTREFERENCE_END,,,
-
+ 0x0100=,,,,,WEBPR,WEBPR_END,WEBPRTABLES
+ 0x0108=WEBPRTABLES_END,,,,,,,
0x0110=,,,,,BINARYINDEX_END,STYLESHEET,STYLESHEET_END
0x0118=PTDEFINITION,PTFITEM_END,PTFITEM,PTFITEMS,PTFITEMS_END,PTFIELD,PTFIELD_END,PTFIELDS
0x0120=PTFIELDS_END,PTPAGEFIELD,PTPAGEFIELD_END,PTPAGEFIELDS,PTPAGEFIELDS_END,PTDATAFIELD,PTDATAFIELD_END,PTDATAFIELDS
@@ -203,8 +205,10 @@ multilist=RECORD-NAMES
0x0188=ROWBREAKS,ROWBREAKS_END,COLBREAKS,COLBREAKS_END,BRK,CUSTOMWORKBOOKVIEW,,
0x01A0=,,,,,,CUSTOMSHEETVIEWS,CUSTOMSHEETVIEW
- 0x01A8=CUSTOMSHEETVIEW_END,CUSTOMSHEETVIEWS_END,ARRAY,SHAREDFMLA,DATATABLE,,,
+ 0x01A8=CUSTOMSHEETVIEW_END,CUSTOMSHEETVIEWS_END,ARRAY,SHAREDFMLA,DATATABLE,CONNECTIONS,CONNECTIONS_END,
+ 0x01B8=,,,,,,,QUERYTABLE
+ 0x01C0=QUERYTABLE_END,QUERYTABLEREFRESH,QUERYTABLEREFRESH_END,,,,,
0x01C8=,,,AUTOSORTSCOPE,AUTOSORTSCOPE_END,CONDFORMATTING,CONDFORMATTING_END,CFRULE
0x01D0=CFRULE_END,ICONSET,ICONSET_END,DATABAR,DATABAR_END,COLORSCALE,COLORSCALE_END,CFVO
0x01D8=,COLORS,COLORS_END,RGBCOLOR,PAGEMARGINS,PRINTOPTIONS,PAGESETUP,HEADERFOOTER
@@ -238,11 +242,13 @@ end
constlist=SIMPLE-RECORDS
0x001A=int32,dec,item-index
+ 0x00AC=int32,dec,relation,CUSTOMFILTERS-RELATION
0x00B5=int32,dec,count
0x00C1=int32,dec,count
0x00DD=int32,dec,count
0x00E1=int32,dec,count
0x00F9=int32,dec,count
+ 0x0107=int32,dec,count
0x011B=int32,dec,count
0x011F=int32,dec,count
0x0123=int32,dec,count
@@ -374,6 +380,48 @@ combilist=COL-FLAGS
0x1000=outline-collapsed
end
+# CONNECTION -----------------------------------------------------------------
+
+shortlist=CONNECTION-SAVEPASSWORD,1,on,off
+unitconverter=CONNECTION-INTERVAL,60,sec
+shortlist=CONNECTION-SOURCETYPE,1,odbc,dao,file,html,ole-db,text,ado,dsp
+shortlist=CONNECTION-RECONNECTTYPE,1,as-required,always,never
+shortlist=CONNECTION-CREDENTIALS,0,integrated,none,stored-sso,prompt
+
+flagslist=CONNECTION-FLAGS
+ 0x0001=keep-alive
+ 0x0002=new
+ 0x0004=deleted
+ 0x0008=only-use-conn-file
+ 0x0010=background
+ 0x0020=refresh-on-load
+ 0x0040=save-data
+end
+
+flagslist=CONNECTION-STRINGFLAGS
+ 0x0001=has-source-file
+ 0x0002=has-source-conn-file
+ 0x0004=has-description
+ 0x0008=has-name
+ 0x0010=has-sso-id
+end
+
+# CUSTOMFILTER ---------------------------------------------------------------
+
+constlist=CUSTOMFILTER-DATATYPE
+ 4=double
+ 6=string
+ 8=boolean
+ 12=blank
+ 14=not-blank
+end
+
+shortlist=CUSTOMFILTER-OPERATOR,1,less,equal,less-equal,greater,not-equal,greater-equal
+
+# CUSTOMFILTERS --------------------------------------------------------------
+
+shortlist=CUSTOMFILTERS-RELATION,0,and,or
+
# DATATABLE ------------------------------------------------------------------
flagslist=DATATABLE-FLAGS
@@ -428,6 +476,10 @@ constlist=DEFINEDNAME-SHEETID
-1=global
end
+# DISCRETEFILTERS --------------------------------------------------------------------
+
+shortlist=DISCRETEFILTERS-CALTYPE,0,none,gregorian,gregorian-us,japan,taiwan,korea,hijri,thai,hebrew,gregorian-mideast-fr,gregorian-ar,gregorian-xlit-en,gregorian-xlit-fr
+
# DXF ------------------------------------------------------------------------
flagslist=DXF-FLAGS
@@ -478,6 +530,13 @@ end
shortlist=FILL-GRADIENTTYPE,0,linear,path
+# FILTERCOLUMN ---------------------------------------------------------------
+
+flagslist=FILTERCOLUMN-FLAGS
+ 0x0001=hidden-button
+ 0x0002=show-button
+end
+
# FONT -----------------------------------------------------------------------
flagslist=FONT-FLAGS
@@ -741,7 +800,7 @@ flagslist=PTDEFINITION-FLAGS3
0x00004000=col-grand-totals
0x00008000=field-print-titles
0x00020000=item-print-titles
- 0x00040000=merge-labels
+ 0x00040000=merge-item
0x00080000=has-data-caption
0x00100000=has-grand-total-caption
0x00200000=has-page-field-style
@@ -751,8 +810,8 @@ flagslist=PTDEFINITION-FLAGS3
0x02000000=apply-font
0x04000000=apply-alignment
0x08000000=apply-border
- 0x10000000=apply-pattern
- 0x20000000=protected
+ 0x10000000=apply-fill
+ 0x20000000=apply-protection
0x40000000=has-tag
end
@@ -905,6 +964,32 @@ flagslist=PTREFERENCE-FLAGS2
0x01=selected
end
+# QUERYTABLE -----------------------------------------------------------------
+
+combilist=QUERYTABLE-FLAGS
+ 0x00000001=headers
+ 0x00000002=row-numbers
+ 0x00000004=disable-refresh
+ 0x00000008=background
+ 0x00000010=first-background
+ 0x00000020=refresh-on-load
+ 0x000000C0=uint8,dec,grow-shrink,QUERYTABLE-GROWSHRINK
+ 0x00000100=fill-formulas
+ 0x00000200=save-data
+ 0x00000400=disable-edit
+ 0x00000800=preserve-formatting
+ 0x00001000=adjust-column-width
+ 0x00002000=intermediate
+ 0x00004000=apply-num-fmt
+ 0x00008000=apply-font
+ 0x00010000=apply-alignment
+ 0x00020000=apply-border
+ 0x00040000=apply-fill
+ 0x00080000=apply-protection
+end
+
+shortlist=QUERYTABLE-GROWSHRINK,0,insert-clear,insert-delete,overwrite-clear
+
# ROW ------------------------------------------------------------------------
combilist=ROW-FLAGS1
@@ -1012,6 +1097,29 @@ end
shortlist=VOLTYPE-TYPE,0,realtime-data,olap-functions
+# WEBPR ----------------------------------------------------------------------
+
+combilist=WEBPR-FLAGS
+ 0x000000FF=uint8,dec,html-format,WEBPR-HTMLFORMAT
+ 0x00000100=xml
+ 0x00000200=source-data
+ 0x00000400=parse-pre
+ 0x00000800=consecutive-delimiters
+ 0x00001000=first-row
+ 0x00002000=xl97-created
+ 0x00004000=text-dates
+ 0x00008000=xl2000-refreshed
+ 0x00010000=html-tables
+end
+
+shortlist=WEBPR-HTMLFORMAT,0,none,rtf,all
+
+flagslist=WEBPR-STRINGFLAGS
+ 0x01=has-post-method
+ 0x02=has-edit-page
+ 0x04=has-url
+end
+
# WORKBBOKPR -----------------------------------------------------------------
combilist=WORKBBOKPR-FLAGS
@@ -1076,4 +1184,3 @@ flagslist=XF-USEDFLAGS
end
# ============================================================================
-
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 2b606956004a..8630ee0a8841 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -26,7 +26,6 @@
*
************************************************************************/
-#include "tokens.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/export/drawingml.hxx"
#include "oox/export/utils.hxx"
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 3950f293a280..0c034c72526e 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -26,7 +26,6 @@
*
************************************************************************/
-#include "tokens.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/export/shapes.hxx"
#include "oox/export/utils.hxx"
diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx
index a72eeb797315..bb25789826c7 100644
--- a/oox/source/helper/attributelist.cxx
+++ b/oox/source/helper/attributelist.cxx
@@ -27,17 +27,21 @@
************************************************************************/
#include "oox/helper/attributelist.hxx"
+
#include <osl/diagnose.h>
#include <rtl/ustrbuf.hxx>
+#include "oox/token/tokenmap.hxx"
+
+namespace oox {
+
+// ============================================================================
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+using namespace ::com::sun::star::xml::sax;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::xml::sax::XFastAttributeList;
-
-namespace oox {
// ============================================================================
@@ -75,6 +79,11 @@ sal_Unicode lclGetXChar( const sal_Unicode*& rpcStr, const sal_Unicode* pcEnd )
// ----------------------------------------------------------------------------
+sal_Int32 AttributeConversion::decodeToken( const OUString& rValue )
+{
+ return StaticTokenMap::get().getTokenFromUnicode( rValue );
+}
+
OUString AttributeConversion::decodeXString( const OUString& rValue )
{
// string shorter than one encoded character - no need to decode
@@ -316,4 +325,4 @@ DateTime AttributeList::getDateTime( sal_Int32 nAttrToken, const DateTime& rDefa
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/helper/binaryinputstream.cxx b/oox/source/helper/binaryinputstream.cxx
index 80f50d5521e7..051dff310037 100644
--- a/oox/source/helper/binaryinputstream.cxx
+++ b/oox/source/helper/binaryinputstream.cxx
@@ -27,27 +27,32 @@
************************************************************************/
#include "oox/helper/binaryinputstream.hxx"
+
#include <string.h>
#include <vector>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include "oox/helper/binaryoutputstream.hxx"
+namespace oox {
+
+// ============================================================================
+
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
using ::rtl::OString;
using ::rtl::OStringBuffer;
using ::rtl::OStringToOUString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XSeekable;
-namespace oox {
+namespace {
const sal_Int32 INPUTSTREAM_BUFFERSIZE = 0x8000;
+} // namespace
+
// ============================================================================
OString BinaryInputStream::readNulCharArray()
@@ -332,4 +337,4 @@ void RelativeInputStream::skip( sal_Int32 nBytes )
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/helper/binaryoutputstream.cxx b/oox/source/helper/binaryoutputstream.cxx
index c9bf31879907..fafabc468a2a 100644
--- a/oox/source/helper/binaryoutputstream.cxx
+++ b/oox/source/helper/binaryoutputstream.cxx
@@ -27,19 +27,23 @@
************************************************************************/
#include "oox/helper/binaryoutputstream.hxx"
+
#include <osl/diagnose.h>
#include <string.h>
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XSeekable;
-
namespace oox {
+// ============================================================================
+
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
+namespace {
+
const sal_Int32 OUTPUTSTREAM_BUFFERSIZE = 0x8000;
+} // namespace
+
// ============================================================================
void BinaryOutputStream::writeAtom( const void* pMem, sal_uInt8 nSize )
diff --git a/oox/source/helper/binarystreambase.cxx b/oox/source/helper/binarystreambase.cxx
index 6f7c77d9de20..0abff066d7fb 100644
--- a/oox/source/helper/binarystreambase.cxx
+++ b/oox/source/helper/binarystreambase.cxx
@@ -27,16 +27,18 @@
************************************************************************/
#include "oox/helper/binarystreambase.hxx"
-#include <osl/diagnose.h>
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::io::XSeekable;
+#include <osl/diagnose.h>
namespace oox {
// ============================================================================
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
+// ============================================================================
+
BinaryStreamBase::~BinaryStreamBase()
{
}
@@ -160,4 +162,4 @@ void SequenceSeekableStream::seek( sal_Int64 nPos )
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/helper/containerhelper.cxx b/oox/source/helper/containerhelper.cxx
index efc39f5e9be6..d756367ce22a 100644
--- a/oox/source/helper/containerhelper.cxx
+++ b/oox/source/helper/containerhelper.cxx
@@ -27,25 +27,23 @@
************************************************************************/
#include "oox/helper/containerhelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <rtl/ustrbuf.hxx>
#include "oox/helper/helper.hxx"
+namespace oox {
+
+// ============================================================================
+
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::container::XIndexContainer;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNameContainer;
-
-namespace oox {
// ============================================================================
@@ -163,64 +161,6 @@ OUString ContainerHelper::insertByUnusedName(
// ============================================================================
-ObjectContainer::ObjectContainer( const Reference< XMultiServiceFactory >& rxFactory, const OUString& rServiceName ) :
- mxFactory( rxFactory ),
- maServiceName( rServiceName ),
- mnIndex( 0 )
-{
- OSL_ENSURE( mxFactory.is(), "ObjectContainer::ObjectContainer - missing service factory" );
-}
-
-ObjectContainer::~ObjectContainer()
-{
-}
-
-bool ObjectContainer::hasObject( const OUString& rObjName ) const
-{
- createContainer();
- return mxContainer.is() && mxContainer->hasByName( rObjName );
-}
-
-Any ObjectContainer::getObject( const OUString& rObjName ) const
-{
- createContainer();
- if( mxContainer.is() ) try
- {
- return mxContainer->getByName( rObjName );
- }
- catch( Exception& )
- {
- }
- return Any();
-}
-
-OUString ObjectContainer::insertObject( const OUString& rObjName, const Any& rObj, bool bInsertByUnusedName )
-{
- createContainer();
- if( mxContainer.is() )
- {
- if( bInsertByUnusedName )
- return ContainerHelper::insertByUnusedName( mxContainer, rObjName + OUString::valueOf( ++mnIndex ), ' ', rObj );
- if( ContainerHelper::insertByName( mxContainer, rObjName, rObj ) )
- return rObjName;
- }
- return OUString();
-}
-
-void ObjectContainer::createContainer() const
-{
- if( !mxContainer.is() && mxFactory.is() ) try
- {
- mxContainer.set( mxFactory->createInstance( maServiceName ), UNO_QUERY_THROW );
- }
- catch( Exception& )
- {
- }
- OSL_ENSURE( mxContainer.is(), "ObjectContainer::createContainer - container not found" );
-}
-
-// ============================================================================
-
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx
index 17cee4eabf32..a6774fdcc3e8 100644..100755
--- a/oox/source/helper/graphichelper.cxx
+++ b/oox/source/helper/graphichelper.cxx
@@ -27,45 +27,37 @@
************************************************************************/
#include "oox/helper/graphichelper.hxx"
+
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/awt/XUnitConversion.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XFramesSupplier.hpp>
#include <com/sun/star/graphic/GraphicObject.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <com/sun/star/util/MeasureUnit.hpp>
-#include <comphelper/componentcontext.hxx>
#include <comphelper/seqstream.hxx>
-#include "tokens.hxx"
#include "oox/helper/containerhelper.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::awt::DeviceInfo;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::awt::XDevice;
-using ::com::sun::star::awt::XUnitConversion;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::frame::XFrame;
-using ::com::sun::star::frame::XFramesSupplier;
-using ::com::sun::star::graphic::GraphicObject;
-using ::com::sun::star::graphic::XGraphic;
-using ::com::sun::star::graphic::XGraphicObject;
-using ::com::sun::star::graphic::XGraphicProvider;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
+#include "oox/helper/propertyset.hxx"
+#include "oox/token/tokens.hxx"
namespace oox {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::graphic;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
inline sal_Int32 lclConvertScreenPixelToHmm( double fPixel, double fPixelPerHmm )
@@ -77,13 +69,17 @@ inline sal_Int32 lclConvertScreenPixelToHmm( double fPixel, double fPixelPerHmm
// ============================================================================
-GraphicHelper::GraphicHelper( const Reference< XMultiServiceFactory >& rxGlobalFactory, const Reference< XFrame >& rxTargetFrame, const StorageRef& rxStorage ) :
- mxGraphicProvider( rxGlobalFactory->createInstance( CREATE_OUSTRING( "com.sun.star.graphic.GraphicProvider" ) ), UNO_QUERY ),
+GraphicHelper::GraphicHelper( const Reference< XComponentContext >& rxContext, const Reference< XFrame >& rxTargetFrame, const StorageRef& rxStorage ) :
+ mxCompContext( rxContext ),
mxStorage( rxStorage ),
maGraphicObjScheme( CREATE_OUSTRING( "vnd.sun.star.GraphicObject:" ) )
{
- ::comphelper::ComponentContext aContext( rxGlobalFactory );
- mxCompContext = aContext.getUNOContext();
+ OSL_ENSURE( mxCompContext.is(), "GraphicHelper::GraphicHelper - missing component context" );
+ Reference< XMultiServiceFactory > xFactory( mxCompContext->getServiceManager(), UNO_QUERY_THROW );
+ OSL_ENSURE( xFactory.is(), "GraphicHelper::GraphicHelper - missing service factory" );
+
+ if( xFactory.is() )
+ mxGraphicProvider.set( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.graphic.GraphicProvider" ) ), UNO_QUERY );
//! TODO: get colors from system
maSystemPalette[ XML_3dDkShadow ] = 0x716F64;
@@ -120,9 +116,9 @@ GraphicHelper::GraphicHelper( const Reference< XMultiServiceFactory >& rxGlobalF
// if no target frame has been passed (e.g. OLE objects), try to fallback to the active frame
// TODO: we need some mechanism to keep and pass the parent frame
Reference< XFrame > xFrame = rxTargetFrame;
- if( !xFrame.is() && rxGlobalFactory.is() ) try
+ if( !xFrame.is() && xFactory.is() ) try
{
- Reference< XFramesSupplier > xFramesSupp( rxGlobalFactory->createInstance( CREATE_OUSTRING( "com.sun.star.frame.Desktop" ) ), UNO_QUERY_THROW );
+ Reference< XFramesSupplier > xFramesSupp( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.frame.Desktop" ) ), UNO_QUERY_THROW );
xFrame = xFramesSupp->getActiveFrame();
}
catch( Exception& )
@@ -353,8 +349,21 @@ OUString GraphicHelper::importEmbeddedGraphicObject( const OUString& rStreamName
return xGraphic.is() ? createGraphicObject( xGraphic ) : OUString();
}
+Size GraphicHelper::getOriginalSize( const Reference< XGraphic >& xGraphic ) const
+{
+ Size aSizeHmm;
+ PropertySet aPropSet( xGraphic );
+ if( aPropSet.getProperty( aSizeHmm, PROP_Size100thMM ) && (aSizeHmm.Width == 0) && (aSizeHmm.Height == 0) ) // MAPMODE_PIXEL used?
+ {
+ Size aSizePixel( 0, 0 );
+ if( aPropSet.getProperty( aSizePixel, PROP_SizePixel ) )
+ aSizeHmm = convertScreenPixelToHmm( aSizePixel );
+ }
+ return aSizeHmm;
+}
+
// ============================================================================
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/helper/makefile.mk b/oox/source/helper/makefile.mk
index 3518db0c6d7c..f31736faac8d 100644
--- a/oox/source/helper/makefile.mk
+++ b/oox/source/helper/makefile.mk
@@ -51,7 +51,6 @@ SLOFILES = \
$(SLO)$/progressbar.obj \
$(SLO)$/propertymap.obj \
$(SLO)$/propertyset.obj \
- $(SLO)$/recordinputstream.obj \
$(SLO)$/storagebase.obj \
$(SLO)$/textinputstream.obj \
$(SLO)$/zipstorage.obj
diff --git a/oox/source/helper/modelobjecthelper.cxx b/oox/source/helper/modelobjecthelper.cxx
index 8c397d4aa56c..f1c8ef8d9291 100644
--- a/oox/source/helper/modelobjecthelper.cxx
+++ b/oox/source/helper/modelobjecthelper.cxx
@@ -27,21 +27,83 @@
************************************************************************/
#include "oox/helper/modelobjecthelper.hxx"
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
#include <com/sun/star/awt/Gradient.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/drawing/LineDash.hpp>
#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/helper.hxx"
+namespace oox {
+
+// ============================================================================
+
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::awt::Gradient;
-using ::com::sun::star::drawing::LineDash;
-using ::com::sun::star::drawing::PolyPolygonBezierCoords;
-namespace oox {
+// ============================================================================
+
+ObjectContainer::ObjectContainer( const Reference< XMultiServiceFactory >& rxFactory, const OUString& rServiceName ) :
+ mxFactory( rxFactory ),
+ maServiceName( rServiceName ),
+ mnIndex( 0 )
+{
+ OSL_ENSURE( mxFactory.is(), "ObjectContainer::ObjectContainer - missing service factory" );
+}
+
+ObjectContainer::~ObjectContainer()
+{
+}
+
+bool ObjectContainer::hasObject( const OUString& rObjName ) const
+{
+ createContainer();
+ return mxContainer.is() && mxContainer->hasByName( rObjName );
+}
+
+Any ObjectContainer::getObject( const OUString& rObjName ) const
+{
+ createContainer();
+ if( mxContainer.is() ) try
+ {
+ return mxContainer->getByName( rObjName );
+ }
+ catch( Exception& )
+ {
+ }
+ return Any();
+}
+
+OUString ObjectContainer::insertObject( const OUString& rObjName, const Any& rObj, bool bInsertByUnusedName )
+{
+ createContainer();
+ if( mxContainer.is() )
+ {
+ if( bInsertByUnusedName )
+ return ContainerHelper::insertByUnusedName( mxContainer, rObjName + OUString::valueOf( ++mnIndex ), ' ', rObj );
+ if( ContainerHelper::insertByName( mxContainer, rObjName, rObj ) )
+ return rObjName;
+ }
+ return OUString();
+}
+
+void ObjectContainer::createContainer() const
+{
+ if( !mxContainer.is() && mxFactory.is() ) try
+ {
+ mxContainer.set( mxFactory->createInstance( maServiceName ), UNO_QUERY_THROW );
+ }
+ catch( Exception& )
+ {
+ }
+ OSL_ENSURE( mxContainer.is(), "ObjectContainer::createContainer - container not found" );
+}
// ============================================================================
@@ -90,4 +152,4 @@ OUString ModelObjectHelper::insertFillBitmap( const OUString& rGraphicUrl )
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/helper/progressbar.cxx b/oox/source/helper/progressbar.cxx
index 8950cff57c44..2700760b1dbf 100644
--- a/oox/source/helper/progressbar.cxx
+++ b/oox/source/helper/progressbar.cxx
@@ -27,17 +27,19 @@
************************************************************************/
#include "oox/helper/progressbar.hxx"
+
#include <com/sun/star/task/XStatusIndicator.hpp>
#include "oox/helper/helper.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::task::XStatusIndicator;
-
namespace oox {
// ============================================================================
+using namespace ::com::sun::star::task;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
namespace {
const sal_Int32 PROGRESS_RANGE = 1000000;
@@ -184,4 +186,4 @@ ISegmentProgressBarRef SegmentProgressBar::createSegment( double fLength )
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx
index 22ad90d7fdf1..221799a41c53 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -27,69 +27,44 @@
************************************************************************/
#include "oox/helper/propertymap.hxx"
-#include <osl/mutex.hxx>
-#include <cppuhelper/implbase2.hxx>
+
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/container/XIndexReplace.hpp>
-#include "properties.hxx"
-#include "oox/token/propertylist.hxx"
+#include <cppuhelper/implbase2.hxx>
+#include <osl/mutex.hxx>
+#include "oox/token/propertynames.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::lang::IllegalArgumentException;
-using ::com::sun::star::lang::WrappedTargetException;
-using ::com::sun::star::beans::Property;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::beans::PropertyVetoException;
-using ::com::sun::star::beans::UnknownPropertyException;
-using ::com::sun::star::beans::XPropertyChangeListener;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::beans::XPropertySetInfo;
-using ::com::sun::star::beans::XVetoableChangeListener;
+namespace oox {
using ::com::sun::star::container::XIndexReplace;
-#if OSL_DEBUG_LEVEL > 0
-#include <cstdio>
-#include <com/sun/star/style/LineSpacing.hpp>
-#include <com/sun/star/style/LineSpacingMode.hpp>
-#include <com/sun/star/text/WritingMode.hpp>
+// ============================================================================
+
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::lang;
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
-#define USS(x) OUStringToOString( x, RTL_TEXTENCODING_UTF8 ).getStr()
-using namespace ::com::sun::star;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::uno;
-using ::rtl::OString;
-using ::com::sun::star::style::LineSpacing;
-using ::com::sun::star::text::WritingMode;
using ::com::sun::star::drawing::TextHorizontalAdjust;
using ::com::sun::star::drawing::TextVerticalAdjust;
-#endif
-namespace oox {
+using ::rtl::OString;
+using ::rtl::OUString;
// ============================================================================
namespace {
-/** Thread-save singleton of a vector of all supported property names. */
-struct StaticPropertyList : public ::rtl::Static< PropertyList, StaticPropertyList > {};
-
-// ----------------------------------------------------------------------------
-
-typedef ::cppu::WeakImplHelper2< XPropertySet, XPropertySetInfo > GenericPropertySetImplBase;
+typedef ::cppu::WeakImplHelper2< XPropertySet, XPropertySetInfo > GenericPropertySetBase;
/** This class implements a generic XPropertySet.
Properties of all names and types can be set and later retrieved.
TODO: move this to comphelper or better find an existing implementation
*/
-class GenericPropertySet : public GenericPropertySetImplBase, private ::osl::Mutex
+class GenericPropertySet : public GenericPropertySetBase, private ::osl::Mutex
{
public:
explicit GenericPropertySet();
@@ -122,7 +97,7 @@ GenericPropertySet::GenericPropertySet()
GenericPropertySet::GenericPropertySet( const PropertyMap& rPropMap )
{
- const PropertyList& rPropNames = StaticPropertyList::get();
+ const PropertyNameVector& rPropNames = StaticPropertyNameVector::get();
for( PropertyMap::const_iterator aIt = rPropMap.begin(), aEnd = rPropMap.end(); aIt != aEnd; ++aIt )
maPropMap[ rPropNames[ aIt->first ] ] = aIt->second;
}
@@ -190,7 +165,7 @@ sal_Bool SAL_CALL GenericPropertySet::hasPropertyByName( const OUString& rProper
// ============================================================================
PropertyMap::PropertyMap() :
- mpPropNames( &StaticPropertyList::get() )
+ mpPropNames( &StaticPropertyNameVector::get() ) // pointer instead reference to get compiler generated copy c'tor and operator=
{
}
@@ -201,7 +176,7 @@ PropertyMap::~PropertyMap()
/*static*/ const OUString& PropertyMap::getPropertyName( sal_Int32 nPropId )
{
OSL_ENSURE( (0 <= nPropId) && (nPropId < PROP_COUNT), "PropertyMap::getPropertyName - invalid property identifier" );
- return StaticPropertyList::get()[ nPropId ];
+ return StaticPropertyNameVector::get()[ nPropId ];
}
const Any* PropertyMap::getProperty( sal_Int32 nPropId ) const
@@ -374,4 +349,4 @@ void PropertyMap::dump()
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/helper/propertyset.cxx b/oox/source/helper/propertyset.cxx
index 25249ffc44ad..5f0ef0acb122 100644
--- a/oox/source/helper/propertyset.cxx
+++ b/oox/source/helper/propertyset.cxx
@@ -27,21 +27,21 @@
************************************************************************/
#include "oox/helper/propertyset.hxx"
-#include <rtl/strbuf.hxx>
+
#include <osl/diagnose.h>
+#include <rtl/strbuf.hxx>
#include "oox/helper/propertymap.hxx"
-using ::rtl::OUString;
+namespace oox {
+
+// ============================================================================
+
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::uno;
+
using ::rtl::OStringBuffer;
+using ::rtl::OUString;
using ::rtl::OUStringToOString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::beans::XPropertySet;
-
-namespace oox {
// ============================================================================
@@ -173,15 +173,8 @@ void PropertySet::setAnyProperty( const OUString& rPropName, const Any& rValue )
}
}
-#if OSL_DEBUG_LEVEL > 0
-void PropertySet::dump()
-{
- PropertyMap::dump( Reference< XPropertySet >( getXPropertySet(), UNO_QUERY ) );
-}
-#endif
-
// ============================================================================
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/helper/storagebase.cxx b/oox/source/helper/storagebase.cxx
index 3abd50f81628..2201320fad1a 100644
--- a/oox/source/helper/storagebase.cxx
+++ b/oox/source/helper/storagebase.cxx
@@ -27,24 +27,23 @@
************************************************************************/
#include "oox/helper/storagebase.hxx"
-#include <com/sun/star/io/XStream.hpp>
+
#include <com/sun/star/embed/XTransactedObject.hpp>
+#include <com/sun/star/io/XStream.hpp>
#include <rtl/ustrbuf.hxx>
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/binaryoutputstream.hxx"
+namespace oox {
+
+// ============================================================================
+
+using namespace ::com::sun::star::embed;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::embed::XStorage;
-using ::com::sun::star::embed::XTransactedObject;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XStream;
-
-namespace oox {
// ============================================================================
diff --git a/oox/source/helper/textinputstream.cxx b/oox/source/helper/textinputstream.cxx
index df1565ad8682..8296144d73ec 100644
--- a/oox/source/helper/textinputstream.cxx
+++ b/oox/source/helper/textinputstream.cxx
@@ -27,17 +27,20 @@
************************************************************************/
#include "oox/helper/textinputstream.hxx"
+
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include "oox/helper/binaryinputstream.hxx"
+namespace oox {
+
+// ============================================================================
+
using ::rtl::OStringBuffer;
using ::rtl::OStringToOUString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-namespace oox {
-
// ============================================================================
namespace {
@@ -127,4 +130,4 @@ OUString TextInputStream::readLine()
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/helper/zipstorage.cxx b/oox/source/helper/zipstorage.cxx
index 333c3f21c4da..7891c70fb214 100644
--- a/oox/source/helper/zipstorage.cxx
+++ b/oox/source/helper/zipstorage.cxx
@@ -27,6 +27,7 @@
************************************************************************/
#include "oox/helper/zipstorage.hxx"
+
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
@@ -36,25 +37,20 @@
#include <comphelper/storagehelper.hxx>
#include "oox/helper/helper.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::container::NoSuchElementException;
-using ::com::sun::star::embed::XStorage;
-using ::com::sun::star::embed::XTransactedObject;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XStream;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-
namespace oox {
// ============================================================================
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::embed;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
ZipStorage::ZipStorage(
const Reference< XMultiServiceFactory >& rxFactory,
const Reference< XInputStream >& rxInStream ) :
@@ -74,8 +70,10 @@ ZipStorage::ZipStorage(
TODO: #i105410# switch to 'OFOPXMLFormat' and use its
implementation of relations handling. */
+
mxStorage = ::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(
- ZIP_STORAGE_FORMAT_STRING, rxInStream, rxFactory, sal_True );
+ ZIP_STORAGE_FORMAT_STRING, rxInStream, rxFactory,
+ sal_False /* DEV300_m80: Was sal_True, but DOCX and others did not load */ );
}
catch( Exception& )
{
diff --git a/oox/source/ole/axbinaryreader.cxx b/oox/source/ole/axbinaryreader.cxx
index e36021f28429..d6780b17eb39 100644
--- a/oox/source/ole/axbinaryreader.cxx
+++ b/oox/source/ole/axbinaryreader.cxx
@@ -27,15 +27,18 @@
************************************************************************/
#include "oox/ole/axbinaryreader.hxx"
-#include "oox/ole/olehelper.hxx"
-using ::rtl::OUString;
+#include "oox/ole/olehelper.hxx"
namespace oox {
namespace ole {
// ============================================================================
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
const sal_uInt32 AX_STRING_SIZEMASK = 0x7FFFFFFF;
@@ -94,7 +97,8 @@ AxFontData::AxFontData() :
mnFontEffects( 0 ),
mnFontHeight( 160 ),
mnFontCharSet( WINDOWS_CHARSET_DEFAULT ),
- mnHorAlign( AX_FONTDATA_LEFT )
+ mnHorAlign( AX_FONTDATA_LEFT ),
+ mbDblUnderline( false )
{
}
@@ -122,6 +126,7 @@ bool AxFontData::importBinaryModel( BinaryInputStream& rInStrm )
aReader.skipIntProperty< sal_uInt8 >(); // font pitch/family
aReader.readIntProperty< sal_uInt8 >( mnHorAlign );
aReader.skipIntProperty< sal_uInt16 >(); // font weight
+ mbDblUnderline = false;
return aReader.finalizeImport();
}
@@ -136,6 +141,7 @@ bool AxFontData::importStdFont( BinaryInputStream& rInStrm )
setFlag( mnFontEffects, AX_FONTDATA_ITALIC, getFlag( aFontInfo.mnFlags, OLE_STDFONT_ITALIC ) );
setFlag( mnFontEffects, AX_FONTDATA_UNDERLINE, getFlag( aFontInfo.mnFlags, OLE_STDFONT_UNDERLINE ) );
setFlag( mnFontEffects, AX_FONTDATA_STRIKEOUT, getFlag( aFontInfo.mnFlags,OLE_STDFONT_STRIKE ) );
+ mbDblUnderline = false;
// StdFont stores font height in 1/10,000 of points
setHeightPoints( getLimitedValue< sal_Int16, sal_Int32 >( aFontInfo.mnHeight / 10000, 0, SAL_MAX_INT16 ) );
mnFontCharSet = aFontInfo.mnCharSet;
@@ -148,7 +154,7 @@ bool AxFontData::importStdFont( BinaryInputStream& rInStrm )
bool AxFontData::importGuidAndFont( BinaryInputStream& rInStrm )
{
OUString aGuid = OleHelper::importGuid( rInStrm );
- if( aGuid.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "{AFC20920-DA4E-11CE-B943-00AA006887B4}" ) ) )
+ if( aGuid.equalsAscii( AX_GUID_CFONT ) )
return importBinaryModel( rInStrm );
if( aGuid.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(OLE_GUID_STDFONT) ) )
return importStdFont( rInStrm );
@@ -342,4 +348,4 @@ bool AxBinaryPropertyReader::startNextProperty()
} // namespace ole
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index 39bc7272210a..87334529bc15 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -58,10 +58,9 @@
#include <rtl/tencinfo.h>
#include "oox/helper/attributelist.hxx"
#include "oox/helper/binaryinputstream.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/helper/propertymap.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
namespace oox {
namespace ole {
@@ -77,6 +76,7 @@ using namespace ::com::sun::star::form::binding;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::style;
using namespace ::com::sun::star::table;
using namespace ::com::sun::star::uno;
@@ -109,28 +109,6 @@ const sal_uInt32 COMCTL_ID_PROGRESSBAR_60 = 0x97AB8A01;
// ----------------------------------------------------------------------------
-const sal_uInt32 AX_FLAGS_ENABLED = 0x00000002;
-const sal_uInt32 AX_FLAGS_LOCKED = 0x00000004;
-const sal_uInt32 AX_FLAGS_OPAQUE = 0x00000008;
-const sal_uInt32 AX_FLAGS_COLUMNHEADS = 0x00000400;
-const sal_uInt32 AX_FLAGS_ENTIREROWS = 0x00000800;
-const sal_uInt32 AX_FLAGS_EXISTINGENTRIES = 0x00001000;
-const sal_uInt32 AX_FLAGS_CAPTIONLEFT = 0x00002000;
-const sal_uInt32 AX_FLAGS_EDITABLE = 0x00004000;
-const sal_uInt32 AX_FLAGS_IMEMODE_MASK = 0x00078000;
-const sal_uInt32 AX_FLAGS_DRAGENABLED = 0x00080000;
-const sal_uInt32 AX_FLAGS_ENTERASNEWLINE = 0x00100000;
-const sal_uInt32 AX_FLAGS_KEEPSELECTION = 0x00200000;
-const sal_uInt32 AX_FLAGS_TABASCHARACTER = 0x00400000;
-const sal_uInt32 AX_FLAGS_WORDWRAP = 0x00800000;
-const sal_uInt32 AX_FLAGS_BORDERSSUPPRESSED = 0x02000000;
-const sal_uInt32 AX_FLAGS_SELECTLINE = 0x04000000;
-const sal_uInt32 AX_FLAGS_SINGLECHARSELECT = 0x08000000;
-const sal_uInt32 AX_FLAGS_AUTOSIZE = 0x10000000;
-const sal_uInt32 AX_FLAGS_HIDESELECTION = 0x20000000;
-const sal_uInt32 AX_FLAGS_MAXLENAUTOTAB = 0x40000000;
-const sal_uInt32 AX_FLAGS_MULTILINE = 0x80000000;
-
const sal_uInt32 AX_CMDBUTTON_DEFFLAGS = 0x0000001B;
const sal_uInt32 AX_LABEL_DEFFLAGS = 0x0080001B;
const sal_uInt32 AX_IMAGE_DEFFLAGS = 0x0000001B;
@@ -165,30 +143,10 @@ const sal_uInt32 AX_PICPOS_BELOWRIGHT = AX_PICPOS_IMPL( TOPRIGHT, BOTTO
const sal_uInt32 AX_PICPOS_CENTER = AX_PICPOS_IMPL( CENTER, CENTER );
#undef AX_PICPOS_IMPL
-const sal_Int32 AX_DISPLAYSTYLE_TEXT = 1;
-const sal_Int32 AX_DISPLAYSTYLE_LISTBOX = 2;
-const sal_Int32 AX_DISPLAYSTYLE_COMBOBOX = 3;
-const sal_Int32 AX_DISPLAYSTYLE_CHECKBOX = 4;
-const sal_Int32 AX_DISPLAYSTYLE_OPTBUTTON = 5;
-const sal_Int32 AX_DISPLAYSTYLE_TOGGLE = 6;
-const sal_Int32 AX_DISPLAYSTYLE_DROPDOWN = 7;
-
-const sal_Int32 AX_SELCTION_SINGLE = 0;
-const sal_Int32 AX_SELCTION_MULTI = 1;
-const sal_Int32 AX_SELCTION_EXTENDED = 2;
-
-const sal_Int32 AX_SCROLLBAR_NONE = 0x00;
-const sal_Int32 AX_SCROLLBAR_HORIZONTAL = 0x01;
-const sal_Int32 AX_SCROLLBAR_VERTICAL = 0x02;
-
const sal_Int32 AX_MATCHENTRY_FIRSTLETTER = 0;
const sal_Int32 AX_MATCHENTRY_COMPLETE = 1;
const sal_Int32 AX_MATCHENTRY_NONE = 2;
-const sal_Int32 AX_SHOWDROPBUTTON_NEVER = 0;
-const sal_Int32 AX_SHOWDROPBUTTON_FOCUS = 1;
-const sal_Int32 AX_SHOWDROPBUTTON_ALWAYS = 2;
-
const sal_Int32 AX_ORIENTATION_AUTO = -1;
const sal_Int32 AX_ORIENTATION_VERTICAL = 0;
const sal_Int32 AX_ORIENTATION_HORIZONTAL = 1;
@@ -334,11 +292,22 @@ void ControlConverter::convertPicture( PropertyMap& rPropMap, const StreamDataSe
void ControlConverter::convertOrientation( PropertyMap& rPropMap, bool bHorizontal ) const
{
- namespace AwtScrollBarOrient = ::com::sun::star::awt::ScrollBarOrientation;
- sal_Int32 nScrollOrient = bHorizontal ? AwtScrollBarOrient::HORIZONTAL : AwtScrollBarOrient::VERTICAL;
+ sal_Int32 nScrollOrient = bHorizontal ? ScrollBarOrientation::HORIZONTAL : ScrollBarOrientation::VERTICAL;
rPropMap.setProperty( PROP_Orientation, nScrollOrient );
}
+void ControlConverter::convertVerticalAlign( PropertyMap& rPropMap, sal_Int32 nVerticalAlign ) const
+{
+ VerticalAlignment eAlign = VerticalAlignment_TOP;
+ switch( nVerticalAlign )
+ {
+ case XML_Top: eAlign = VerticalAlignment_TOP; break;
+ case XML_Center: eAlign = VerticalAlignment_MIDDLE; break;
+ case XML_Bottom: eAlign = VerticalAlignment_BOTTOM; break;
+ }
+ rPropMap.setProperty( PROP_VerticalAlign, eAlign );
+}
+
void ControlConverter::convertScrollBar( PropertyMap& rPropMap,
sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nPosition,
sal_Int32 nSmallChange, sal_Int32 nLargeChange, bool bAwtModel ) const
@@ -452,8 +421,7 @@ void ControlConverter::convertAxBorder( PropertyMap& rPropMap,
void ControlConverter::convertAxVisualEffect( PropertyMap& rPropMap, sal_Int32 nSpecialEffect ) const
{
- namespace AwtVisualEffect = ::com::sun::star::awt::VisualEffect;
- sal_Int16 nVisualEffect = (nSpecialEffect == AX_SPECIALEFFECT_FLAT) ? AwtVisualEffect::FLAT : AwtVisualEffect::LOOK3D;
+ sal_Int16 nVisualEffect = (nSpecialEffect == AX_SPECIALEFFECT_FLAT) ? VisualEffect::FLAT : VisualEffect::LOOK3D;
rPropMap.setProperty( PROP_VisualEffect, nVisualEffect );
}
@@ -463,23 +431,22 @@ void ControlConverter::convertAxPicture( PropertyMap& rPropMap, const StreamData
convertPicture( rPropMap, rPicData );
// picture position
- namespace AwtImagePos = ::com::sun::star::awt::ImagePosition;
- sal_Int16 nImagePos = AwtImagePos::LeftCenter;
+ sal_Int16 nImagePos = ImagePosition::LeftCenter;
switch( nPicPos )
{
- case AX_PICPOS_LEFTTOP: nImagePos = AwtImagePos::LeftTop; break;
- case AX_PICPOS_LEFTCENTER: nImagePos = AwtImagePos::LeftCenter; break;
- case AX_PICPOS_LEFTBOTTOM: nImagePos = AwtImagePos::LeftBottom; break;
- case AX_PICPOS_RIGHTTOP: nImagePos = AwtImagePos::RightTop; break;
- case AX_PICPOS_RIGHTCENTER: nImagePos = AwtImagePos::RightCenter; break;
- case AX_PICPOS_RIGHTBOTTOM: nImagePos = AwtImagePos::RightBottom; break;
- case AX_PICPOS_ABOVELEFT: nImagePos = AwtImagePos::AboveLeft; break;
- case AX_PICPOS_ABOVECENTER: nImagePos = AwtImagePos::AboveCenter; break;
- case AX_PICPOS_ABOVERIGHT: nImagePos = AwtImagePos::AboveRight; break;
- case AX_PICPOS_BELOWLEFT: nImagePos = AwtImagePos::BelowLeft; break;
- case AX_PICPOS_BELOWCENTER: nImagePos = AwtImagePos::BelowCenter; break;
- case AX_PICPOS_BELOWRIGHT: nImagePos = AwtImagePos::BelowRight; break;
- case AX_PICPOS_CENTER: nImagePos = AwtImagePos::Centered; break;
+ case AX_PICPOS_LEFTTOP: nImagePos = ImagePosition::LeftTop; break;
+ case AX_PICPOS_LEFTCENTER: nImagePos = ImagePosition::LeftCenter; break;
+ case AX_PICPOS_LEFTBOTTOM: nImagePos = ImagePosition::LeftBottom; break;
+ case AX_PICPOS_RIGHTTOP: nImagePos = ImagePosition::RightTop; break;
+ case AX_PICPOS_RIGHTCENTER: nImagePos = ImagePosition::RightCenter; break;
+ case AX_PICPOS_RIGHTBOTTOM: nImagePos = ImagePosition::RightBottom; break;
+ case AX_PICPOS_ABOVELEFT: nImagePos = ImagePosition::AboveLeft; break;
+ case AX_PICPOS_ABOVECENTER: nImagePos = ImagePosition::AboveCenter; break;
+ case AX_PICPOS_ABOVERIGHT: nImagePos = ImagePosition::AboveRight; break;
+ case AX_PICPOS_BELOWLEFT: nImagePos = ImagePosition::BelowLeft; break;
+ case AX_PICPOS_BELOWCENTER: nImagePos = ImagePosition::BelowCenter; break;
+ case AX_PICPOS_BELOWRIGHT: nImagePos = ImagePosition::BelowRight; break;
+ case AX_PICPOS_CENTER: nImagePos = ImagePosition::Centered; break;
default: OSL_ENSURE( false, "ControlConverter::convertAxPicture - unknown picture position" );
}
rPropMap.setProperty( PROP_ImagePosition, nImagePos );
@@ -492,13 +459,12 @@ void ControlConverter::convertAxPicture( PropertyMap& rPropMap, const StreamData
convertPicture( rPropMap, rPicData );
// picture scale mode
- namespace AwtScaleMode = ::com::sun::star::awt::ImageScaleMode;
- sal_Int16 nScaleMode = AwtScaleMode::None;
+ sal_Int16 nScaleMode = ImageScaleMode::None;
switch( nPicSizeMode )
{
- case AX_PICSIZE_CLIP: nScaleMode = AwtScaleMode::None; break;
- case AX_PICSIZE_STRETCH: nScaleMode = AwtScaleMode::Anisotropic; break;
- case AX_PICSIZE_ZOOM: nScaleMode = AwtScaleMode::Isotropic; break;
+ case AX_PICSIZE_CLIP: nScaleMode = ImageScaleMode::None; break;
+ case AX_PICSIZE_STRETCH: nScaleMode = ImageScaleMode::Anisotropic; break;
+ case AX_PICSIZE_ZOOM: nScaleMode = ImageScaleMode::Isotropic; break;
default: OSL_ENSURE( false, "ControlConverter::convertAxPicture - unknown picture size mode" );
}
rPropMap.setProperty( PROP_ScaleMode, nScaleMode );
@@ -566,6 +532,7 @@ OUString ControlModelBase::getServiceName() const
case API_CONTROL_CHECKBOX: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlCheckBoxModel" );
case API_CONTROL_RADIOBUTTON: return CREATE_OUSTRING( "com.sun.star.form.component.RadioButton" );
case API_CONTROL_EDIT: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlEditModel" );
+ case API_CONTROL_NUMERIC: return CREATE_OUSTRING( "com.sun.star.awt.UnoControlNumericFieldModel" );
case API_CONTROL_LISTBOX: return CREATE_OUSTRING( "com.sun.star.form.component.ListBox" );
case API_CONTROL_COMBOBOX: return CREATE_OUSTRING( "com.sun.star.form.component.ComboBox" );
case API_CONTROL_SPINBUTTON: return CREATE_OUSTRING( "com.sun.star.form.component.SpinButton" );
@@ -585,6 +552,7 @@ OUString ControlModelBase::getServiceName() const
case API_CONTROL_CHECKBOX: return CREATE_OUSTRING( "com.sun.star.form.component.CheckBox" );
case API_CONTROL_RADIOBUTTON: return CREATE_OUSTRING( "com.sun.star.form.component.RadioButton" );
case API_CONTROL_EDIT: return CREATE_OUSTRING( "com.sun.star.form.component.TextField" );
+ case API_CONTROL_NUMERIC: return CREATE_OUSTRING( "com.sun.star.form.component.NumericField" );
case API_CONTROL_LISTBOX: return CREATE_OUSTRING( "com.sun.star.form.component.ListBox" );
case API_CONTROL_COMBOBOX: return CREATE_OUSTRING( "com.sun.star.form.component.ComboBox" );
case API_CONTROL_SPINBUTTON: return CREATE_OUSTRING( "com.sun.star.form.component.SpinButton" );
@@ -665,8 +633,8 @@ sal_uInt32 ComCtlModelBase::getDataPartId() const
{
switch( mnVersion )
{
- case 5: return mnDataPartId5;
- case 6: return mnDataPartId6;
+ case COMCTL_VERSION_50: return mnDataPartId5;
+ case COMCTL_VERSION_60: return mnDataPartId6;
}
OSL_ENSURE( false, "ComCtlObjectBase::getDataPartId - unxpected version" );
return SAL_MAX_UINT32;
@@ -787,7 +755,7 @@ void ComCtlProgressBarModel::convertProperties( PropertyMap& rPropMap, const Con
void ComCtlProgressBarModel::importControlData( BinaryInputStream& rInStrm )
{
rInStrm >> mfMin >> mfMax;
- if( mnVersion == 6 )
+ if( mnVersion == COMCTL_VERSION_60 )
rInStrm >> mnVertical >> mnSmooth;
}
@@ -843,17 +811,15 @@ bool AxFontDataModel::importBinaryModel( BinaryInputStream& rInStrm )
void AxFontDataModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const
{
- namespace cssa = ::com::sun::star::awt;
-
// font name
if( maFontData.maFontName.getLength() > 0 )
rPropMap.setProperty( PROP_FontName, maFontData.maFontName );
// font effects
- rPropMap.setProperty( PROP_FontWeight, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_BOLD, cssa::FontWeight::BOLD, cssa::FontWeight::NORMAL ) );
- rPropMap.setProperty( PROP_FontSlant, getFlagValue< sal_Int16 >( maFontData.mnFontEffects, AX_FONTDATA_ITALIC, cssa::FontSlant_ITALIC, cssa::FontSlant_NONE ) );
- rPropMap.setProperty( PROP_FontUnderline, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_UNDERLINE, cssa::FontUnderline::SINGLE, cssa::FontUnderline::NONE ) );
- rPropMap.setProperty( PROP_FontStrikeout, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_STRIKEOUT, cssa::FontStrikeout::SINGLE, cssa::FontStrikeout::NONE ) );
+ rPropMap.setProperty( PROP_FontWeight, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_BOLD, FontWeight::BOLD, FontWeight::NORMAL ) );
+ rPropMap.setProperty( PROP_FontSlant, getFlagValue< sal_Int16 >( maFontData.mnFontEffects, AX_FONTDATA_ITALIC, FontSlant_ITALIC, FontSlant_NONE ) );
+ rPropMap.setProperty( PROP_FontUnderline, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_UNDERLINE, maFontData.mbDblUnderline ? FontUnderline::DOUBLE : FontUnderline::SINGLE, FontUnderline::NONE ) );
+ rPropMap.setProperty( PROP_FontStrikeout, getFlagValue( maFontData.mnFontEffects, AX_FONTDATA_STRIKEOUT, FontStrikeout::SINGLE, FontStrikeout::NONE ) );
rPropMap.setProperty( PROP_FontHeight, maFontData.getHeightPoints() );
// font character set
@@ -866,12 +832,12 @@ void AxFontDataModel::convertProperties( PropertyMap& rPropMap, const ControlCon
// text alignment
if( mbSupportsAlign )
{
- sal_Int32 nAlign = cssa::TextAlign::LEFT;
+ sal_Int32 nAlign = TextAlign::LEFT;
switch( maFontData.mnHorAlign )
{
- case AX_FONTDATA_LEFT: nAlign = cssa::TextAlign::LEFT; break;
- case AX_FONTDATA_RIGHT: nAlign = cssa::TextAlign::RIGHT; break;
- case AX_FONTDATA_CENTER: nAlign = cssa::TextAlign::CENTER; break;
+ case AX_FONTDATA_LEFT: nAlign = TextAlign::LEFT; break;
+ case AX_FONTDATA_RIGHT: nAlign = TextAlign::RIGHT; break;
+ case AX_FONTDATA_CENTER: nAlign = TextAlign::CENTER; break;
default: OSL_ENSURE( false, "AxFontDataModel::convertProperties - unknown text alignment" );
}
// form controls expect short value
@@ -889,6 +855,7 @@ AxCommandButtonModel::AxCommandButtonModel() :
mnBackColor( AX_SYSCOLOR_BUTTONFACE ),
mnFlags( AX_CMDBUTTON_DEFFLAGS ),
mnPicturePos( AX_PICPOS_ABOVECENTER ),
+ mnVerticalAlign( XML_Center ),
mbFocusOnClick( true )
{
}
@@ -944,8 +911,8 @@ void AxCommandButtonModel::convertProperties( PropertyMap& rPropMap, const Contr
rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) );
rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
rPropMap.setProperty( PROP_FocusOnClick, mbFocusOnClick );
- rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_MIDDLE );
rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor );
+ rConv.convertVerticalAlign( rPropMap, mnVerticalAlign );
rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_NOTSUPPORTED );
rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos );
AxFontDataModel::convertProperties( rPropMap, rConv );
@@ -959,7 +926,8 @@ AxLabelModel::AxLabelModel() :
mnFlags( AX_LABEL_DEFFLAGS ),
mnBorderColor( AX_SYSCOLOR_WINDOWFRAME ),
mnBorderStyle( AX_BORDERSTYLE_NONE ),
- mnSpecialEffect( AX_SPECIALEFFECT_FLAT )
+ mnSpecialEffect( AX_SPECIALEFFECT_FLAT ),
+ mnVerticalAlign( XML_Top )
{
}
@@ -1007,8 +975,8 @@ void AxLabelModel::convertProperties( PropertyMap& rPropMap, const ControlConver
rPropMap.setProperty( PROP_Label, maCaption );
rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) );
rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
- rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_TOP );
rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor );
+ rConv.convertVerticalAlign( rPropMap, mnVerticalAlign );
rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_VOID );
rConv.convertAxBorder( rPropMap, mnBorderColor, mnBorderStyle, mnSpecialEffect );
AxFontDataModel::convertProperties( rPropMap, rConv );
@@ -1105,7 +1073,8 @@ AxMorphDataModelBase::AxMorphDataModelBase() :
mnShowDropButton( AX_SHOWDROPBUTTON_NEVER ),
mnMaxLength( 0 ),
mnPasswordChar( 0 ),
- mnListRows( 8 )
+ mnListRows( 8 ),
+ mnVerticalAlign( XML_Center )
{
}
@@ -1194,6 +1163,7 @@ void AxMorphDataModelBase::convertProperties( PropertyMap& rPropMap, const Contr
AxToggleButtonModel::AxToggleButtonModel()
{
+ mnDisplayStyle = AX_DISPLAYSTYLE_TOGGLE;
}
ApiControlType AxToggleButtonModel::getControlType() const
@@ -1206,8 +1176,8 @@ void AxToggleButtonModel::convertProperties( PropertyMap& rPropMap, const Contro
{
rPropMap.setProperty( PROP_Label, maCaption );
rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
- rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_MIDDLE );
rPropMap.setProperty( PROP_Toggle, true );
+ rConv.convertVerticalAlign( rPropMap, mnVerticalAlign );
rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_NOTSUPPORTED );
rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos );
rConv.convertAxState( rPropMap, maValue, mnMultiSelect, API_DEFAULTSTATE_BOOLEAN, mbAwtModel );
@@ -1218,6 +1188,7 @@ void AxToggleButtonModel::convertProperties( PropertyMap& rPropMap, const Contro
AxCheckBoxModel::AxCheckBoxModel()
{
+ mnDisplayStyle = AX_DISPLAYSTYLE_CHECKBOX;
}
ApiControlType AxCheckBoxModel::getControlType() const
@@ -1230,7 +1201,7 @@ void AxCheckBoxModel::convertProperties( PropertyMap& rPropMap, const ControlCon
{
rPropMap.setProperty( PROP_Label, maCaption );
rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
- rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_MIDDLE );
+ rConv.convertVerticalAlign( rPropMap, mnVerticalAlign );
rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_VOID );
rConv.convertAxVisualEffect( rPropMap, mnSpecialEffect );
rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos );
@@ -1242,6 +1213,7 @@ void AxCheckBoxModel::convertProperties( PropertyMap& rPropMap, const ControlCon
AxOptionButtonModel::AxOptionButtonModel()
{
+ mnDisplayStyle = AX_DISPLAYSTYLE_OPTBUTTON;
}
ApiControlType AxOptionButtonModel::getControlType() const
@@ -1254,7 +1226,7 @@ void AxOptionButtonModel::convertProperties( PropertyMap& rPropMap, const Contro
{
rPropMap.setProperty( PROP_Label, maCaption );
rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) );
- rPropMap.setProperty( PROP_VerticalAlign, ::com::sun::star::style::VerticalAlignment_MIDDLE );
+ rConv.convertVerticalAlign( rPropMap, mnVerticalAlign );
rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_VOID );
rConv.convertAxVisualEffect( rPropMap, mnSpecialEffect );
rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos );
@@ -1266,6 +1238,7 @@ void AxOptionButtonModel::convertProperties( PropertyMap& rPropMap, const Contro
AxTextBoxModel::AxTextBoxModel()
{
+ mnDisplayStyle = AX_DISPLAYSTYLE_TEXT;
}
ApiControlType AxTextBoxModel::getControlType() const
@@ -1291,8 +1264,34 @@ void AxTextBoxModel::convertProperties( PropertyMap& rPropMap, const ControlConv
// ============================================================================
+AxNumericFieldModel::AxNumericFieldModel()
+{
+ mnDisplayStyle = AX_DISPLAYSTYLE_TEXT;
+}
+
+ApiControlType AxNumericFieldModel::getControlType() const
+{
+ OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_TEXT, "AxNumericFieldModel::getControlType - invalid control type" );
+ return API_CONTROL_NUMERIC;
+}
+
+void AxNumericFieldModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const
+{
+ rPropMap.setProperty( PROP_HideInactiveSelection, getFlag( mnFlags, AX_FLAGS_HIDESELECTION ) );
+ // TODO: OUString::toDouble() does not handle local decimal separator
+ rPropMap.setProperty( mbAwtModel ? PROP_Value : PROP_DefaultValue, maValue.toDouble() );
+ rPropMap.setProperty( PROP_Spin, getFlag( mnScrollBars, AX_SCROLLBAR_VERTICAL ) );
+ rPropMap.setProperty( PROP_Repeat, true );
+ rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, API_TRANSPARENCY_VOID );
+ rConv.convertAxBorder( rPropMap, mnBorderColor, mnBorderStyle, mnSpecialEffect );
+ AxMorphDataModelBase::convertProperties( rPropMap, rConv );
+}
+
+// ============================================================================
+
AxListBoxModel::AxListBoxModel()
{
+ mnDisplayStyle = AX_DISPLAYSTYLE_LISTBOX;
}
ApiControlType AxListBoxModel::getControlType() const
@@ -1315,6 +1314,7 @@ void AxListBoxModel::convertProperties( PropertyMap& rPropMap, const ControlConv
AxComboBoxModel::AxComboBoxModel()
{
+ mnDisplayStyle = AX_DISPLAYSTYLE_COMBOBOX;
}
ApiControlType AxComboBoxModel::getControlType() const
@@ -1503,7 +1503,7 @@ void AxScrollBarModel::convertProperties( PropertyMap& rPropMap, const ControlCo
// ============================================================================
AxTabStripModel::AxTabStripModel() :
- AxFontDataModel( false ), // no support for Align property
+ AxFontDataModel( false ), // no support for alignment properties
mnBackColor( AX_SYSCOLOR_BUTTONFACE ),
mnTextColor( AX_SYSCOLOR_BUTTONTEXT ),
mnFlags( AX_TABSTRIP_DEFFLAGS ),
@@ -1566,7 +1566,7 @@ OUString AxTabStripModel::getCaption( sal_Int32 nIndex ) const
// ============================================================================
AxContainerModelBase::AxContainerModelBase( bool bFontSupport ) :
- AxFontDataModel( false ), // no support for Align property
+ AxFontDataModel( false ), // no support for alignment properties
maLogicalSize( AX_CONTAINER_DEFWIDTH, AX_CONTAINER_DEFHEIGHT ),
maScrollPos( 0, 0 ),
mnBackColor( AX_SYSCOLOR_BUTTONFACE ),
@@ -1759,43 +1759,26 @@ EmbeddedControl::~EmbeddedControl()
{
}
-ControlModelRef EmbeddedControl::createModel( const OUString& rClassId )
+ControlModelBase* EmbeddedControl::createModelFromGuid( const OUString& rClassId )
{
OUString aClassId = rClassId.toAsciiUpperCase();
- if( aClassId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(AX_GUID_COMMANDBUTTON)) )
- mxModel.reset( new AxCommandButtonModel );
- else if( aClassId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(AX_GUID_LABEL)) )
- mxModel.reset( new AxLabelModel );
- else if( aClassId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(AX_GUID_IMAGE)) )
- mxModel.reset( new AxImageModel );
- else if( aClassId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(AX_GUID_TOGGLEBUTTON)) )
- mxModel.reset( new AxToggleButtonModel );
- else if( aClassId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(AX_GUID_CHECKBOX)) )
- mxModel.reset( new AxCheckBoxModel );
- else if( aClassId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(AX_GUID_OPTIONBUTTON)) )
- mxModel.reset( new AxOptionButtonModel );
- else if( aClassId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(AX_GUID_TEXTBOX)) )
- mxModel.reset( new AxTextBoxModel );
- else if( aClassId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(AX_GUID_LISTBOX)) )
- mxModel.reset( new AxListBoxModel );
- else if( aClassId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(AX_GUID_COMBOBOX)) )
- mxModel.reset( new AxComboBoxModel );
- else if( aClassId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(AX_GUID_SPINBUTTON)) )
- mxModel.reset( new AxSpinButtonModel );
- else if( aClassId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(AX_GUID_SCROLLBAR)) )
- mxModel.reset( new AxScrollBarModel );
- else if( aClassId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(AX_GUID_FRAME)) )
- mxModel.reset( new AxFrameModel );
- else if( aClassId.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(COMCTL_GUID_SCROLLBAR_60)) )
- mxModel.reset( new ComCtlScrollBarModel( 6 ) );
- else
- mxModel.reset();
- // embedded controls are form component instances
- if( mxModel.get() )
- mxModel->setFormComponentMode();
+ if( aClassId.equalsAscii( AX_GUID_COMMANDBUTTON ) ) return &createModel< AxCommandButtonModel >();
+ if( aClassId.equalsAscii( AX_GUID_LABEL ) ) return &createModel< AxLabelModel >();
+ if( aClassId.equalsAscii( AX_GUID_IMAGE ) ) return &createModel< AxImageModel >();
+ if( aClassId.equalsAscii( AX_GUID_TOGGLEBUTTON ) ) return &createModel< AxToggleButtonModel >();
+ if( aClassId.equalsAscii( AX_GUID_CHECKBOX ) ) return &createModel< AxCheckBoxModel >();
+ if( aClassId.equalsAscii( AX_GUID_OPTIONBUTTON ) ) return &createModel< AxOptionButtonModel >();
+ if( aClassId.equalsAscii( AX_GUID_TEXTBOX ) ) return &createModel< AxTextBoxModel >();
+ if( aClassId.equalsAscii( AX_GUID_LISTBOX ) ) return &createModel< AxListBoxModel >();
+ if( aClassId.equalsAscii( AX_GUID_COMBOBOX ) ) return &createModel< AxComboBoxModel >();
+ if( aClassId.equalsAscii( AX_GUID_SPINBUTTON ) ) return &createModel< AxSpinButtonModel >();
+ if( aClassId.equalsAscii( AX_GUID_SCROLLBAR ) ) return &createModel< AxScrollBarModel >();
+ if( aClassId.equalsAscii( AX_GUID_FRAME ) ) return &createModel< AxFrameModel >();
+ if( aClassId.equalsAscii( COMCTL_GUID_SCROLLBAR_60 ) ) return &createModel< ComCtlScrollBarModel >( COMCTL_VERSION_60 );
- return mxModel;
+ mxModel.reset();
+ return 0;
}
OUString EmbeddedControl::getServiceName() const
@@ -1821,14 +1804,14 @@ bool EmbeddedControl::convertProperties( const Reference< XControlModel >& rxCtr
EmbeddedForm::EmbeddedForm( const Reference< XModel >& rxDocModel,
const Reference< XDrawPage >& rxDrawPage, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) :
- ControlConverter( rxDocModel, rGraphicHelper, bDefaultColorBgr ),
+ maControlConv( rxDocModel, rGraphicHelper, bDefaultColorBgr ),
mxModelFactory( rxDocModel, UNO_QUERY ),
mxFormsSupp( rxDrawPage, UNO_QUERY )
{
OSL_ENSURE( mxModelFactory.is(), "EmbeddedForm::EmbeddedForm - missing service factory" );
}
-Reference< XControlModel > EmbeddedForm::convertAndInsert( const EmbeddedControl& rControl )
+Reference< XControlModel > EmbeddedForm::convertAndInsert( const EmbeddedControl& rControl, sal_Int32& rnCtrlIndex )
{
if( mxModelFactory.is() && rControl.hasModel() ) try
{
@@ -1838,12 +1821,12 @@ Reference< XControlModel > EmbeddedForm::convertAndInsert( const EmbeddedControl
Reference< XControlModel > xCtrlModel( xFormComp, UNO_QUERY_THROW );
// insert the control into the form
- Reference< XIndexContainer > xFormIC( createForm(), UNO_SET_THROW );
- sal_Int32 nNewIndex = xFormIC->getCount();
- xFormIC->insertByIndex( nNewIndex, Any( xFormComp ) );
+ Reference< XIndexContainer > xFormIC( createXForm(), UNO_SET_THROW );
+ rnCtrlIndex = xFormIC->getCount();
+ xFormIC->insertByIndex( rnCtrlIndex, Any( xFormComp ) );
// convert the control properties
- if( rControl.convertProperties( xCtrlModel, *this ) )
+ if( rControl.convertProperties( xCtrlModel, maControlConv ) )
return xCtrlModel;
}
catch( Exception& )
@@ -1852,7 +1835,7 @@ Reference< XControlModel > EmbeddedForm::convertAndInsert( const EmbeddedControl
return Reference< XControlModel >();
}
-Reference< XIndexContainer > EmbeddedForm::createForm()
+Reference< XIndexContainer > EmbeddedForm::createXForm()
{
if( mxFormsSupp.is() )
{
diff --git a/oox/source/ole/axcontrolfragment.cxx b/oox/source/ole/axcontrolfragment.cxx
index ff5f13ef90d8..88ef35886b88 100644
--- a/oox/source/ole/axcontrolfragment.cxx
+++ b/oox/source/ole/axcontrolfragment.cxx
@@ -27,23 +27,27 @@
************************************************************************/
#include "oox/ole/axcontrolfragment.hxx"
+
+#include "oox/core/xmlfilterbase.hxx"
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/binaryoutputstream.hxx"
-#include "oox/core/xmlfilterbase.hxx"
#include "oox/ole/axcontrol.hxx"
#include "oox/ole/olehelper.hxx"
#include "oox/ole/olestorage.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::uno::Reference;
+namespace oox {
+namespace ole {
+
+// ============================================================================
+
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
using ::oox::core::ContextHandler2;
using ::oox::core::ContextHandlerRef;
using ::oox::core::FragmentHandler2;
using ::oox::core::XmlFilterBase;
-
-namespace oox {
-namespace ole {
+using ::rtl::OUString;
// ============================================================================
@@ -106,7 +110,7 @@ ContextHandlerRef AxControlFragment::onCreateContext( sal_Int32 nElement, const
switch( rAttribs.getToken( AX_TOKEN( persistence ), XML_TOKEN_INVALID ) )
{
case XML_persistPropertyBag:
- if( ControlModelBase* pModel = mrControl.createModel( aClassId ).get() )
+ if( ControlModelBase* pModel = mrControl.createModelFromGuid( aClassId ) )
return new AxControlPropertyContext( *this, *pModel );
break;
@@ -122,7 +126,7 @@ ContextHandlerRef AxControlFragment::onCreateContext( sal_Int32 nElement, const
OUString aStrmClassId = OleHelper::importGuid( aInStrm );
OSL_ENSURE( aClassId.equalsIgnoreAsciiCase( aStrmClassId ),
"AxControlFragment::importBinaryControl - form control class ID mismatch" );
- if( ControlModelBase* pModel = mrControl.createModel( aStrmClassId ).get() )
+ if( ControlModelBase* pModel = mrControl.createModelFromGuid( aStrmClassId ) )
pModel->importBinaryModel( aInStrm );
}
}
@@ -137,10 +141,10 @@ ContextHandlerRef AxControlFragment::onCreateContext( sal_Int32 nElement, const
Reference< XInputStream > xStrgStrm = getFilter().openInputStream( aFragmentPath );
if( xStrgStrm.is() )
{
- OleStorage aStorage( getFilter().getGlobalFactory(), xStrgStrm, false );
+ OleStorage aStorage( getFilter().getServiceFactory(), xStrgStrm, false );
BinaryXInputStream aInStrm( aStorage.openInputStream( CREATE_OUSTRING( "f" ) ), true );
if( !aInStrm.isEof() )
- if( AxContainerModelBase* pModel = dynamic_cast< AxContainerModelBase* >( mrControl.createModel( aClassId ).get() ) )
+ if( AxContainerModelBase* pModel = dynamic_cast< AxContainerModelBase* >( mrControl.createModelFromGuid( aClassId ) ) )
pModel->importBinaryModel( aInStrm );
}
}
diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx
index 37948dad0f0a..eaabd69c8c5b 100644
--- a/oox/source/ole/olehelper.cxx
+++ b/oox/source/ole/olehelper.cxx
@@ -27,19 +27,22 @@
************************************************************************/
#include "oox/ole/olehelper.hxx"
+
#include <rtl/ustrbuf.hxx>
-#include "tokens.hxx"
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/graphichelper.hxx"
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
+#include "oox/token/tokens.hxx"
namespace oox {
namespace ole {
// ============================================================================
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
const sal_uInt32 OLE_COLORTYPE_MASK = 0xFF000000;
@@ -52,10 +55,16 @@ const sal_uInt32 OLE_PALETTECOLOR_MASK = 0x0000FFFF;
const sal_uInt32 OLE_BGRCOLOR_MASK = 0x00FFFFFF;
const sal_uInt32 OLE_SYSTEMCOLOR_MASK = 0x0000FFFF;
+/** Swaps the red and blue component of the passed color. */
+inline sal_uInt32 lclSwapRedBlue( sal_uInt32 nColor )
+{
+ return static_cast< sal_uInt32 >( (nColor & 0xFF00FF00) | ((nColor & 0x0000FF) << 16) | ((nColor & 0xFF0000) >> 16) );
+}
+
/** Returns the UNO RGB color from the passed encoded OLE BGR color. */
inline sal_Int32 lclDecodeBgrColor( sal_uInt32 nOleColor )
{
- return static_cast< sal_Int32 >( ((nOleColor & 0x0000FF) << 16) | (nOleColor & 0x00FF00) | ((nOleColor & 0xFF0000) >> 16) );
+ return static_cast< sal_Int32 >( lclSwapRedBlue( nOleColor ) & 0xFFFFFF );
}
// ----------------------------------------------------------------------------
@@ -162,6 +171,11 @@ StdFontInfo::StdFontInfo( const ::rtl::OUString& rName, sal_uInt32 nHeight,
return API_RGB_BLACK;
}
+/*static*/ sal_uInt32 OleHelper::encodeOleColor( sal_Int32 nRgbColor )
+{
+ return OLE_COLORTYPE_BGR | lclSwapRedBlue( static_cast< sal_uInt32 >( nRgbColor & 0xFFFFFF ) );
+}
+
/*static*/ OUString OleHelper::importGuid( BinaryInputStream& rInStrm )
{
OUStringBuffer aBuffer;
@@ -299,4 +313,4 @@ StdFontInfo::StdFontInfo( const ::rtl::OUString& rName, sal_uInt32 nHeight,
} // namespace ole
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/ole/oleobjecthelper.cxx b/oox/source/ole/oleobjecthelper.cxx
index 74bf4310cd85..db73b8a24ff6 100644
--- a/oox/source/ole/oleobjecthelper.cxx
+++ b/oox/source/ole/oleobjecthelper.cxx
@@ -27,34 +27,32 @@
************************************************************************/
#include "oox/ole/oleobjecthelper.hxx"
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/io/XOutputStream.hpp>
+
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
#include <com/sun/star/embed/Aspects.hpp>
-#include "properties.hxx"
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include "oox/helper/propertymap.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::lang::XComponent;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::awt::Size;
-
namespace oox {
namespace ole {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
OleObjectInfo::OleObjectInfo() :
mbLinked( false ),
mbShowAsIcon( false ),
@@ -140,4 +138,4 @@ bool OleObjectHelper::importOleObject( PropertyMap& rPropMap, const OleObjectInf
} // namespace ole
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/ole/olestorage.cxx b/oox/source/ole/olestorage.cxx
index ca028f6ab3ba..c87393fda890 100644
--- a/oox/source/ole/olestorage.cxx
+++ b/oox/source/ole/olestorage.cxx
@@ -27,6 +27,7 @@
************************************************************************/
#include "oox/ole/olestorage.hxx"
+
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
@@ -36,38 +37,27 @@
#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <cppuhelper/implbase2.hxx>
-#include "oox/helper/helper.hxx"
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/binaryoutputstream.hxx"
-
-using ::rtl::OUString;
-using ::com::sun::star::container::XNameContainer;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::embed::XStorage;
-using ::com::sun::star::embed::XTransactedObject;
-using ::com::sun::star::io::BufferSizeExceededException;
-using ::com::sun::star::io::IOException;
-using ::com::sun::star::io::NotConnectedException;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::io::XOutputStream;
-using ::com::sun::star::io::XSeekable;
-using ::com::sun::star::io::XStream;
-using ::com::sun::star::lang::IllegalArgumentException;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
+#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/helper.hxx"
namespace oox {
namespace ole {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::embed;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
typedef ::cppu::WeakImplHelper2< XSeekable, XOutputStream > OleOutputStreamBase;
diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx
index 1630b787f3f1..5b4a6346397d 100644
--- a/oox/source/ole/vbacontrol.cxx
+++ b/oox/source/ole/vbacontrol.cxx
@@ -39,13 +39,12 @@
#include <xmlscript/xmldlg_imexp.hxx>
#include "oox/helper/attributelist.hxx"
#include "oox/helper/binaryinputstream.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
#include "oox/helper/storagebase.hxx"
#include "oox/helper/textinputstream.hxx"
#include "oox/ole/vbahelper.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
namespace oox {
namespace ole {
@@ -795,20 +794,21 @@ bool lclEatKeyword( OUString& rCodeLine, const OUString& rKeyword )
// ----------------------------------------------------------------------------
-VbaUserForm::VbaUserForm( const Reference< XMultiServiceFactory >& rxGlobalFactory,
+VbaUserForm::VbaUserForm( const Reference< XComponentContext >& rxContext,
const Reference< XModel >& rxDocModel, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) :
- mxGlobalFactory( rxGlobalFactory ),
+ mxCompContext( rxContext ),
mxDocModel( rxDocModel ),
maConverter( rxDocModel, rGraphicHelper, bDefaultColorBgr )
{
- OSL_ENSURE( mxGlobalFactory.is(), "VbaUserForm::VbaUserForm - missing service factory" );
+ OSL_ENSURE( mxCompContext.is(), "VbaUserForm::VbaUserForm - missing component context" );
+ OSL_ENSURE( mxDocModel.is(), "VbaUserForm::VbaUserForm - missing document model" );
}
-void VbaUserForm::importForm( const Reference< XModel >& rxDocModel, const Reference< XNameContainer >& rxDialogLib,
+void VbaUserForm::importForm( const Reference< XNameContainer >& rxDialogLib,
StorageBase& rVbaFormStrg, const OUString& rModuleName, rtl_TextEncoding eTextEnc )
{
OSL_ENSURE( rxDialogLib.is(), "VbaUserForm::importForm - missing dialog library" );
- if( !mxGlobalFactory.is() || !mxDocModel.is() || !rxDialogLib.is() )
+ if( !mxCompContext.is() || !mxDocModel.is() || !rxDialogLib.is() )
return;
// check that the '03VBFrame' stream exists, this is required for forms
@@ -866,15 +866,14 @@ void VbaUserForm::importForm( const Reference< XModel >& rxDocModel, const Refer
{
// create the dialog model
OUString aServiceName = mxCtrlModel->getServiceName();
- Reference< XControlModel > xDialogModel( mxGlobalFactory->createInstance( aServiceName ), UNO_QUERY_THROW );
+ Reference< XMultiServiceFactory > xFactory( mxCompContext->getServiceManager(), UNO_QUERY_THROW );
+ Reference< XControlModel > xDialogModel( xFactory->createInstance( aServiceName ), UNO_QUERY_THROW );
Reference< XNameContainer > xDialogNC( xDialogModel, UNO_QUERY_THROW );
// convert properties and embedded controls
if( convertProperties( xDialogModel, maConverter, 0 ) )
{
// export the dialog to XML and insert it into the dialog library
- PropertySet aFactoryProps( mxGlobalFactory );
- Reference< XComponentContext > xCompContext( aFactoryProps.getAnyProperty( PROP_DefaultContext ), UNO_QUERY_THROW );
Reference< XInputStreamProvider > xDialogSource( ::xmlscript::exportDialogModel( xDialogNC, xCompContext, rxDocModel ), UNO_SET_THROW );
OSL_ENSURE( !rxDialogLib->hasByName( aFormName ), "VbaUserForm::importForm - multiple dialogs with equal name" );
ContainerHelper::insertByName( rxDialogLib, aFormName, Any( xDialogSource ) );
diff --git a/oox/source/ole/vbahelper.cxx b/oox/source/ole/vbahelper.cxx
index 143ede218803..47bbacb40bae 100644
--- a/oox/source/ole/vbahelper.cxx
+++ b/oox/source/ole/vbahelper.cxx
@@ -33,9 +33,12 @@
namespace oox {
namespace ole {
+// ============================================================================
+
+using namespace ::com::sun::star::uno;
+
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using namespace ::com::sun::star::uno;
// ============================================================================
diff --git a/oox/source/ole/vbainputstream.cxx b/oox/source/ole/vbainputstream.cxx
index c4414663a6e8..e93625bf8cd1 100644
--- a/oox/source/ole/vbainputstream.cxx
+++ b/oox/source/ole/vbainputstream.cxx
@@ -32,6 +32,8 @@
namespace oox {
namespace ole {
+// ============================================================================
+
namespace {
const sal_uInt8 VBASTREAM_SIGNATURE = 1;
diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx
index 1043b59b65f4..992ae517b3da 100644
--- a/oox/source/ole/vbamodule.cxx
+++ b/oox/source/ole/vbamodule.cxx
@@ -214,6 +214,11 @@ void VbaModule::createEmptyModule( const Reference< XNameContainer >& rxBasicLib
}
// private --------------------------------------------------------------------
+{
+ createModule( OUString(), rxBasicLib, rxDocObjectNA );
+}
+
+void VbaModule::createEmptyModule( const Reference< XNameContainer >& rxBasicLib, const Reference< XNameAccess >& rxDocObjectNA ) const
OUString VbaModule::readSourceCode( StorageBase& rVbaStrg, const Reference< XNameContainer >& rxOleNameOverrides ) const
{
@@ -303,7 +308,7 @@ void VbaModule::createModule( const OUString& rVBASourceCode,
break;
case ModuleType::DOCUMENT:
aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VBADocumentModule" ) );
- // get the VBA object associated to the document module
+ // get the VBA implementation object associated to the document module
if( rxDocObjectNA.is() ) try
{
aModuleInfo.ModuleObject.set( rxDocObjectNA->getByName( maName ), UNO_QUERY );
diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx
index f8acf017135b..430e10b404f3 100644
--- a/oox/source/ole/vbaproject.cxx
+++ b/oox/source/ole/vbaproject.cxx
@@ -27,19 +27,21 @@
************************************************************************/
#include "oox/ole/vbaproject.hxx"
+
#include <com/sun/star/document/XStorageBasedDocument.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
+#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/script/ModuleType.hpp>
#include <com/sun/star/script/XLibraryContainer.hpp>
#include <com/sun/star/script/vba/XVBACompatibility.hpp>
-#include <rtl/tencinfo.h>
-#include <rtl/ustrbuf.h>
+#include <com/sun/star/script/vba/XVBAMacroResolver.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <comphelper/configurationhelper.hxx>
#include <comphelper/string.hxx>
-#include "properties.hxx"
-#include "tokens.hxx"
+#include <rtl/tencinfo.h>
+#include <rtl/ustrbuf.h>
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
@@ -50,9 +52,10 @@
#include "oox/ole/vbainputstream.hxx"
#include "oox/ole/vbamodule.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::comphelper::ConfigurationHelper;
+namespace oox {
+namespace ole {
+
+// ============================================================================
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::document;
@@ -64,8 +67,9 @@ using namespace ::com::sun::star::script;
using namespace ::com::sun::star::script::vba;
using namespace ::com::sun::star::uno;
-namespace oox {
-namespace ole {
+using ::comphelper::ConfigurationHelper;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
// ============================================================================
@@ -89,14 +93,15 @@ bool lclReadConfigItem( const Reference< XInterface >& rxConfigAccess, const OUS
// ----------------------------------------------------------------------------
-VbaFilterConfig::VbaFilterConfig( const Reference< XMultiServiceFactory >& rxGlobalFactory, const OUString& rConfigCompName )
+VbaFilterConfig::VbaFilterConfig( const Reference< XComponentContext >& rxContext, const OUString& rConfigCompName )
{
- OSL_ENSURE( rxGlobalFactory.is(), "VbaFilterConfig::VbaFilterConfig - missing service factory" );
- try
+ OSL_ENSURE( rxContext.is(), "VbaFilterConfig::VbaFilterConfig - missing component context" );
+ if( rxContext.is() ) try
{
OSL_ENSURE( rConfigCompName.getLength() > 0, "VbaFilterConfig::VbaFilterConfig - invalid configuration component name" );
OUString aConfigPackage = CREATE_OUSTRING( "org.openoffice.Office." ) + rConfigCompName;
- mxConfigAccess = ConfigurationHelper::openConfig( rxGlobalFactory, aConfigPackage, ConfigurationHelper::E_READONLY );
+ Reference< XMultiServiceFactory > xFactory( rxContext->getServiceManager(), UNO_QUERY_THROW );
+ mxConfigAccess = ConfigurationHelper::openConfig( xFactory, aConfigPackage, ConfigurationHelper::E_READONLY );
}
catch( Exception& )
{
@@ -125,13 +130,37 @@ bool VbaFilterConfig::isExportVba() const
// ============================================================================
-VbaProject::VbaProject( const Reference< XMultiServiceFactory >& rxGlobalFactory,
+VbaMacroAttacherBase::VbaMacroAttacherBase( const OUString& rMacroName ) :
+ maMacroName( rMacroName )
+{
+ OSL_ENSURE( maMacroName.getLength() > 0, "VbaMacroAttacherBase::VbaMacroAttacherBase - empty macro name" );
+}
+
+VbaMacroAttacherBase::~VbaMacroAttacherBase()
+{
+}
+
+void VbaMacroAttacherBase::resolveAndAttachMacro( const Reference< XVBAMacroResolver >& rxResolver )
+{
+ try
+ {
+ attachMacro( rxResolver->resolveVBAMacroToScriptURL( maMacroName ) );
+ }
+ catch( Exception& )
+ {
+ }
+}
+
+// ============================================================================
+
+VbaProject::VbaProject( const Reference< XComponentContext >& rxContext,
const Reference< XModel >& rxDocModel, const OUString& rConfigCompName ) :
- VbaFilterConfig( rxGlobalFactory, rConfigCompName ),
- mxGlobalFactory( rxGlobalFactory ),
+ VbaFilterConfig( rxContext, rConfigCompName ),
+ mxCompContext( rxContext ),
mxDocModel( rxDocModel ),
maPrjName( CREATE_OUSTRING( "Standard" ) )
{
+ OSL_ENSURE( mxCompContext.is(), "VbaProject::VbaProject - missing component context" );
OSL_ENSURE( mxDocModel.is(), "VbaProject::VbaProject - missing document model" );
}
@@ -152,6 +181,12 @@ void VbaProject::importVbaProject( StorageBase& rVbaPrjStrg, const GraphicHelper
}
}
+void VbaProject::registerMacroAttacher( const VbaMacroAttacherRef& rxAttacher )
+{
+ OSL_ENSURE( rxAttacher.get(), "VbaProject::registerMacroAttacher - unexpected empty reference" );
+ maMacroAttachers.push_back( rxAttacher );
+}
+
bool VbaProject::hasModules() const
{
return mxBasicLib.is() && mxBasicLib->hasElements();
@@ -180,7 +215,11 @@ void VbaProject::addDummyModule( const OUString& rName, sal_Int32 nType )
maDummyModules[ rName ] = nType;
}
-void VbaProject::prepareModuleImport()
+void VbaProject::prepareImport()
+{
+}
+
+void VbaProject::finalizeImport()
{
}
@@ -243,7 +282,7 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap
return;
// virtual call, derived classes may do some preparations
- prepareModuleImport();
+ prepareImport();
// read all records of the directory
rtl_TextEncoding eTextEnc = RTL_TEXTENCODING_MS_1252;
@@ -387,7 +426,9 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap
Reference< XMultiServiceFactory > xModelFactory( mxDocModel, UNO_QUERY_THROW );
Reference< XNameContainer > xBasicLib( createBasicLibrary(), UNO_SET_THROW );
- // set library container to VBA compatibility mode
+ /* Set library container to VBA compatibility mode. This will create
+ the VBA Globals object and store it in the Basic manager of the
+ document. */
try
{
Reference< XVBACompatibility > xVBACompat( getLibraryContainer( PROP_BasicLibraries ), UNO_QUERY_THROW );
@@ -399,15 +440,6 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap
{
}
- // create the VBAGlobals object, the model will store it in the Basic manager
- try
- {
- xModelFactory->createInstance( CREATE_OUSTRING( "ooo.vba.VBAGlobals" ) );
- }
- catch( Exception& )
- {
- }
-
// try to get access to document objects related to code modules
Reference< XNameAccess > xDocObjectNA;
try
@@ -444,7 +476,7 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap
for( ::std::vector< OUString >::iterator aIt = aElements.begin(), aEnd = aElements.end(); aIt != aEnd; ++aIt )
{
// try to open the element as storage
- if( !aIt->equals( CREATE_OUSTRING( "VBA" ) ) )
+ if( !aIt->equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "VBA" ) ) )
{
StorageRef xSubStrg = rVbaPrjStrg.openSubStorage( *aIt, false );
if( xSubStrg.get() ) try
@@ -459,7 +491,7 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap
// create and import the form
Reference< XNameContainer > xDialogLib( createDialogLibrary(), UNO_SET_THROW );
- VbaUserForm aForm( mxGlobalFactory, mxDocModel, rGraphicHelper, bDefaultColorBgr );
+ VbaUserForm aForm( mxCompContext, mxDocModel, rGraphicHelper, bDefaultColorBgr );
aForm.importForm( mxDocModel, xDialogLib, *xSubStrg, aModuleName, eTextEnc );
}
catch( Exception& )
@@ -467,18 +499,41 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap
}
}
}
+
+ // attach macros to registered objects
+ attachMacros();
+ // virtual call, derived classes may do some more processing
+ finalizeImport();
+}
+
+void VbaProject::attachMacros()
+{
+ if( !maMacroAttachers.empty() && mxCompContext.is() ) try
+ {
+ Reference< XMultiComponentFactory > xFactory( mxCompContext->getServiceManager(), UNO_SET_THROW );
+ Sequence< Any > aArgs( 2 );
+ aArgs[ 0 ] <<= mxDocModel;
+ aArgs[ 1 ] <<= maPrjName;
+ Reference< XVBAMacroResolver > xResolver( xFactory->createInstanceWithArgumentsAndContext(
+ CREATE_OUSTRING( "com.sun.star.script.vba.VBAMacroResolver" ), aArgs, mxCompContext ), UNO_QUERY_THROW );
+ maMacroAttachers.forEachMem( &VbaMacroAttacherBase::resolveAndAttachMacro, ::boost::cref( xResolver ) );
+ }
+ catch( Exception& )
+ {
+ }
}
void VbaProject::copyStorage( StorageBase& rVbaPrjStrg )
{
- try
+ if( mxCompContext.is() ) try
{
+ Reference< XMultiServiceFactory > xFactory( mxCompContext->getServiceManager(), UNO_QUERY_THROW );
Reference< XStorageBasedDocument > xStorageBasedDoc( mxDocModel, UNO_QUERY_THROW );
Reference< XStorage > xDocStorage( xStorageBasedDoc->getDocumentStorage(), UNO_QUERY_THROW );
{
using namespace ::com::sun::star::embed::ElementModes;
Reference< XStream > xDocStream( xDocStorage->openStreamElement( CREATE_OUSTRING( "_MS_VBA_Macros" ), SEEKABLE | WRITE | TRUNCATE ), UNO_SET_THROW );
- OleStorage aDestStorage( mxGlobalFactory, xDocStream, false );
+ OleStorage aDestStorage( xFactory, xDocStream, false );
rVbaPrjStrg.copyStorageToStorage( aDestStorage );
aDestStorage.commit();
}
diff --git a/oox/source/ole/vbaprojectfilter.cxx b/oox/source/ole/vbaprojectfilter.cxx
index 7cb883b506d4..e1525984149f 100644
--- a/oox/source/ole/vbaprojectfilter.cxx
+++ b/oox/source/ole/vbaprojectfilter.cxx
@@ -42,9 +42,9 @@ using ::rtl::OUString;
// ============================================================================
-VbaProjectFilterBase::VbaProjectFilterBase( const Reference< XMultiServiceFactory >& rxGlobalFactory,
- const OUString& rAppName, const OUString& rStorageName ) :
- BinaryFilterBase( rxGlobalFactory ),
+VbaProjectFilterBase::VbaProjectFilterBase( const Reference< XComponentContext >& rxContext,
+ const OUString& rAppName, const OUString& rStorageName ) throw( RuntimeException ) :
+ BinaryFilterBase( rxContext ),
maAppName( rAppName ),
maStorageName( rStorageName )
{
@@ -53,13 +53,11 @@ VbaProjectFilterBase::VbaProjectFilterBase( const Reference< XMultiServiceFactor
bool VbaProjectFilterBase::importDocument() throw()
{
StorageRef xVbaPrjStrg = openSubStorage( maStorageName, false );
- if( xVbaPrjStrg.get() && xVbaPrjStrg->isStorage() )
- {
- VbaProject aVbaProject( getGlobalFactory(), getModel(), maAppName );
- aVbaProject.importVbaProject( *xVbaPrjStrg, getGraphicHelper() );
- return true;
- }
- return false;
+ if( !xVbaPrjStrg || !xVbaPrjStrg->isStorage() )
+ return false;
+
+ getVbaProject().importVbaProject( *xVbaPrjStrg, getGraphicHelper() );
+ return true;
}
bool VbaProjectFilterBase::exportDocument() throw()
@@ -67,6 +65,11 @@ bool VbaProjectFilterBase::exportDocument() throw()
return false;
}
+VbaProject* VbaProjectFilterBase::implCreateVbaProject() const
+{
+ return new VbaProject( getComponentContext(), getModel(), maAppName );
+}
+
// ============================================================================
OUString SAL_CALL WordVbaProjectFilter_getImplementationName() throw()
@@ -77,20 +80,20 @@ OUString SAL_CALL WordVbaProjectFilter_getImplementationName() throw()
Sequence< OUString > SAL_CALL WordVbaProjectFilter_getSupportedServiceNames() throw()
{
Sequence< OUString > aSeq( 1 );
- aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.comp.oox.WordVBAProjectFilter" );
+ aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" );
return aSeq;
}
Reference< XInterface > SAL_CALL WordVbaProjectFilter_createInstance(
- const Reference< XMultiServiceFactory >& rxGlobalFactory ) throw( Exception )
+ const Reference< XComponentContext >& rxContext ) throw( Exception )
{
- return static_cast< ::cppu::OWeakObject* >( new WordVbaProjectFilter( rxGlobalFactory ) );
+ return static_cast< ::cppu::OWeakObject* >( new WordVbaProjectFilter( rxContext ) );
}
// ----------------------------------------------------------------------------
-WordVbaProjectFilter::WordVbaProjectFilter( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
- VbaProjectFilterBase( rxGlobalFactory, CREATE_OUSTRING( "Writer" ), CREATE_OUSTRING( "Macros" ) )
+WordVbaProjectFilter::WordVbaProjectFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ VbaProjectFilterBase( rxContext, CREATE_OUSTRING( "Writer" ), CREATE_OUSTRING( "Macros" ) )
{
}
diff --git a/oox/source/ppt/animationspersist.cxx b/oox/source/ppt/animationspersist.cxx
index 7283a05a25c8..03557e5fefab 100644
--- a/oox/source/ppt/animationspersist.cxx
+++ b/oox/source/ppt/animationspersist.cxx
@@ -26,8 +26,6 @@
*
************************************************************************/
-
-
#include "oox/ppt/animationspersist.hxx"
#include <rtl/ustring.hxx>
@@ -39,8 +37,6 @@
#include "oox/drawingml/shape.hxx"
-#include "tokens.hxx"
-
using rtl::OUString;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::presentation;
diff --git a/oox/source/ppt/animationtypes.cxx b/oox/source/ppt/animationtypes.cxx
index ec5a7d945d84..764468785016 100644
--- a/oox/source/ppt/animationtypes.cxx
+++ b/oox/source/ppt/animationtypes.cxx
@@ -33,8 +33,6 @@
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
-
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::animations;
using namespace ::com::sun::star::xml::sax;
diff --git a/oox/source/ppt/animvariantcontext.cxx b/oox/source/ppt/animvariantcontext.cxx
index 092f513bdd10..7d0c9a6c153e 100644
--- a/oox/source/ppt/animvariantcontext.cxx
+++ b/oox/source/ppt/animvariantcontext.cxx
@@ -36,12 +36,10 @@
#include <rtl/ustring.hxx>
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/fragmenthandler.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/colorchoicecontext.hxx"
#include "pptfilterhelpers.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -81,29 +79,29 @@ namespace oox { namespace ppt {
switch( aElementToken )
{
- case NMSP_PPT|XML_boolVal:
+ case PPT_TOKEN( boolVal ):
{
bool val = attribs.getBool( XML_val, false );
maValue = makeAny( val );
break;
}
- case NMSP_PPT|XML_clrVal:
+ case PPT_TOKEN( clrVal ):
xRet.set( new ::oox::drawingml::ColorContext( *this, maColor ) );
// we'll defer setting the Any until the end.
break;
- case NMSP_PPT|XML_fltVal:
+ case PPT_TOKEN( fltVal ):
{
double val = attribs.getDouble( XML_val, 0.0 );
maValue = makeAny( val );
break;
}
- case NMSP_PPT|XML_intVal:
+ case PPT_TOKEN( intVal ):
{
sal_Int32 val = attribs.getInteger( XML_val, 0 );
maValue = makeAny( val );
break;
}
- case NMSP_PPT|XML_strVal:
+ case PPT_TOKEN( strVal ):
{
OUString val = attribs.getString( XML_val, OUString() );
convertMeasure( val ); // ignore success or failure if it fails, use as is
diff --git a/oox/source/ppt/backgroundproperties.cxx b/oox/source/ppt/backgroundproperties.cxx
index 7c2ab941c447..e3a3714417ff 100644
--- a/oox/source/ppt/backgroundproperties.cxx
+++ b/oox/source/ppt/backgroundproperties.cxx
@@ -29,8 +29,6 @@
#include "oox/ppt/backgroundproperties.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using ::rtl::OUString;
using namespace ::oox::core;
@@ -52,7 +50,7 @@ Reference< XFastContextHandler > BackgroundPropertiesContext::createFastChildCon
switch( aElementToken )
{
- case NMSP_PPT|XML_fill: // a:CT_FillEffect
+ case PPT_TOKEN( fill ): // a:CT_FillEffect
break;
}
diff --git a/oox/source/ppt/buildlistcontext.cxx b/oox/source/ppt/buildlistcontext.cxx
index 5b4ff5923e93..11c07c484a91 100644
--- a/oox/source/ppt/buildlistcontext.cxx
+++ b/oox/source/ppt/buildlistcontext.cxx
@@ -29,7 +29,6 @@
#include "buildlistcontext.hxx"
#include <rtl/ustring.hxx>
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
using namespace ::oox::core;
@@ -57,7 +56,7 @@ namespace oox { namespace ppt {
{
switch( aElement )
{
- case NMSP_PPT|XML_bldGraphic:
+ case PPT_TOKEN( bldGraphic ):
mbInBldGraphic = false;
break;
default:
@@ -73,18 +72,18 @@ namespace oox { namespace ppt {
switch( aElementToken )
{
- case NMSP_PPT|XML_bldAsOne:
+ case PPT_TOKEN( bldAsOne ):
if( mbInBldGraphic )
{
mbBuildAsOne = true;
}
break;
- case NMSP_PPT|XML_bldSub:
+ case PPT_TOKEN( bldSub ):
if( mbInBldGraphic )
{
}
break;
- case NMSP_PPT|XML_bldGraphic:
+ case PPT_TOKEN( bldGraphic ):
{
mbInBldGraphic = true;
AttributeList attribs( xAttribs );
@@ -95,9 +94,9 @@ namespace oox { namespace ppt {
// sal_uInt32 nGroupId = attribs.getUnsignedInteger( XML_grpId, 0 );
break;
}
- case NMSP_DRAWINGML|XML_bldDgm:
- case NMSP_DRAWINGML|XML_bldOleChart:
- case NMSP_DRAWINGML|XML_bldP:
+ case A_TOKEN( bldDgm ):
+ case A_TOKEN( bldOleChart ):
+ case A_TOKEN( bldP ):
break;
default:
diff --git a/oox/source/ppt/commonbehaviorcontext.cxx b/oox/source/ppt/commonbehaviorcontext.cxx
index 5135469d80c4..72c59f730053 100644
--- a/oox/source/ppt/commonbehaviorcontext.cxx
+++ b/oox/source/ppt/commonbehaviorcontext.cxx
@@ -35,14 +35,12 @@
#include <com/sun/star/animations/XAnimationNode.hpp>
#include <com/sun/star/animations/XAnimate.hpp>
-#include "oox/core/namespaces.hxx"
#include "oox/core/fragmenthandler.hxx"
#include "commonbehaviorcontext.hxx"
#include "commontimenodecontext.hxx"
#include "timetargetelementcontext.hxx"
#include "pptfilterhelpers.hxx"
-#include "tokens.hxx"
#include <string.h>
@@ -58,7 +56,7 @@ namespace oox { namespace ppt {
CommonBehaviorContext::CommonBehaviorContext( ContextHandler& rParent,
const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode )
- : TimeNodeContext( rParent, NMSP_PPT|XML_cBhvr, xAttribs, pNode )
+ : TimeNodeContext( rParent, PPT_TOKEN( cBhvr ), xAttribs, pNode )
, mbInAttrList( false )
, mbIsInAttrName( false )
{
@@ -76,7 +74,7 @@ namespace oox { namespace ppt {
{
switch( aElement )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
{
if( !maAttributes.empty() )
{
@@ -95,10 +93,10 @@ namespace oox { namespace ppt {
}
break;
}
- case NMSP_PPT|XML_attrNameLst:
+ case PPT_TOKEN( attrNameLst ):
mbInAttrList = false;
break;
- case NMSP_PPT|XML_attrName:
+ case PPT_TOKEN( attrName ):
if( mbIsInAttrName )
{
const ImplAttributeNameConversion *attrConv = gImplConversionList;
@@ -146,16 +144,16 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cTn:
+ case PPT_TOKEN( cTn ):
xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_tgtEl:
+ case PPT_TOKEN( tgtEl ):
xRet.set( new TimeTargetElementContext( *this, mpNode->getTarget() ) );
break;
- case NMSP_PPT|XML_attrNameLst:
+ case PPT_TOKEN( attrNameLst ):
mbInAttrList = true;
break;
- case NMSP_PPT|XML_attrName:
+ case PPT_TOKEN( attrName ):
{
if( mbInAttrList )
{
diff --git a/oox/source/ppt/commontimenodecontext.cxx b/oox/source/ppt/commontimenodecontext.cxx
index 0e24493232a5..ac88c8c67a1a 100644
--- a/oox/source/ppt/commontimenodecontext.cxx
+++ b/oox/source/ppt/commontimenodecontext.cxx
@@ -43,13 +43,11 @@
#include <com/sun/star/presentation/EffectNodeType.hpp>
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/fragmenthandler.hxx"
#include "oox/ppt/pptimport.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "animationtypes.hxx"
-#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
@@ -618,7 +616,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId
void SAL_CALL CommonTimeNodeContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException)
{
- if( aElement == ( NMSP_PPT|XML_iterate ) )
+ if( aElement == ( PPT_TOKEN( iterate ) ) )
{
mbIterate = false;
}
@@ -631,22 +629,22 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId
switch ( aElementToken )
{
- case NMSP_PPT|XML_childTnLst:
- case NMSP_PPT|XML_subTnLst:
+ case PPT_TOKEN( childTnLst ):
+ case PPT_TOKEN( subTnLst ):
xRet.set( new TimeNodeListContext( *this, mpNode->getChildren() ) );
break;
- case NMSP_PPT|XML_stCondLst:
+ case PPT_TOKEN( stCondLst ):
xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getStartCondition() ) );
break;
- case NMSP_PPT|XML_endCondLst:
+ case PPT_TOKEN( endCondLst ):
xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getEndCondition() ) );
break;
- case NMSP_PPT|XML_endSync:
+ case PPT_TOKEN( endSync ):
xRet.set( new CondContext( *this, xAttribs, mpNode, mpNode->getEndSyncValue() ) );
break;
- case NMSP_PPT|XML_iterate:
+ case PPT_TOKEN( iterate ):
{
sal_Int32 nVal = xAttribs->getOptionalValueToken( XML_type, XML_el );
if( nVal != 0 )
@@ -679,7 +677,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId
mbIterate = true;
break;
}
- case NMSP_PPT|XML_tmAbs:
+ case PPT_TOKEN( tmAbs ):
if( mbIterate )
{
AttributeList attribs( xAttribs );
@@ -688,7 +686,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId
mpNode->getNodeProperties()[ NP_ITERATEINTERVAL ] <<= fTime;
}
break;
- case NMSP_PPT|XML_tmPct:
+ case PPT_TOKEN( tmPct ):
if( mbIterate )
{
AttributeList attribs( xAttribs );
diff --git a/oox/source/ppt/conditioncontext.cxx b/oox/source/ppt/conditioncontext.cxx
index 0a8e220f72c5..97dd7f9bfcd5 100644
--- a/oox/source/ppt/conditioncontext.cxx
+++ b/oox/source/ppt/conditioncontext.cxx
@@ -38,13 +38,11 @@
#include <com/sun/star/animations/EventTrigger.hpp>
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/contexthandler.hxx"
#include "oox/ppt/animationspersist.hxx"
#include "animationtypes.hxx"
#include "timetargetelementcontext.hxx"
-#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
@@ -55,7 +53,7 @@ namespace oox { namespace ppt {
CondContext::CondContext( ContextHandler& rParent, const Reference< XFastAttributeList >& xAttribs,
const TimeNodePtr & pNode, AnimationCondition & aValue )
- : TimeNodeContext( rParent, NMSP_PPT|XML_cond, xAttribs, pNode )
+ : TimeNodeContext( rParent, PPT_TOKEN( cond ), xAttribs, pNode )
, maCond( aValue )
{
maEvent.Trigger = EventTrigger::NONE;
@@ -124,7 +122,7 @@ namespace oox { namespace ppt {
switch( aElementToken )
{
- case NMSP_PPT|XML_rtn:
+ case PPT_TOKEN( rtn ):
{
// ST_TLTriggerRuntimeNode { first, last, all }
sal_Int32 aTok;
@@ -148,7 +146,7 @@ namespace oox { namespace ppt {
maCond.maValue = makeAny( nEnum );
break;
}
- case NMSP_PPT|XML_tn:
+ case PPT_TOKEN( tn ):
{
maCond.mnType = aElementToken;
AttributeList attribs( xAttribs );
@@ -156,7 +154,7 @@ namespace oox { namespace ppt {
maCond.maValue = makeAny( nId );
break;
}
- case NMSP_PPT|XML_tgtEl:
+ case PPT_TOKEN( tgtEl ):
// CT_TLTimeTargetElement
xRet.set( new TimeTargetElementContext( *this, maCond.getTarget() ) );
break;
@@ -195,7 +193,7 @@ namespace oox { namespace ppt {
switch( aElement )
{
- case NMSP_PPT|XML_cond:
+ case PPT_TOKEN( cond ):
// add a condition to the list
maConditions.push_back( AnimationCondition() );
xRet.set( new CondContext( *this, xAttribs, mpNode, maConditions.back() ) );
diff --git a/oox/source/ppt/customshowlistcontext.cxx b/oox/source/ppt/customshowlistcontext.cxx
index e243b18607bf..76bac5b7467c 100644
--- a/oox/source/ppt/customshowlistcontext.cxx
+++ b/oox/source/ppt/customshowlistcontext.cxx
@@ -27,9 +27,6 @@
************************************************************************/
#include "oox/ppt/customshowlistcontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
-
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
@@ -72,8 +69,8 @@ Reference< XFastContextHandler > SAL_CALL CustomShowContext::createFastChildCont
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_PPT|XML_sld :
- mrCustomShow.maSldLst.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS | XML_id ) );
+ case PPT_TOKEN( sld ) :
+ mrCustomShow.maSldLst.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) );
default:
break;
}
@@ -103,7 +100,7 @@ Reference< XFastContextHandler > SAL_CALL CustomShowListContext::createFastChild
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_PPT|XML_custShow :
+ case PPT_TOKEN( custShow ) :
{
CustomShow aCustomShow;
mrCustomShowList.push_back( aCustomShow );
diff --git a/oox/source/ppt/headerfootercontext.cxx b/oox/source/ppt/headerfootercontext.cxx
index 4ba4972a4df8..88a1e7c60894 100644
--- a/oox/source/ppt/headerfootercontext.cxx
+++ b/oox/source/ppt/headerfootercontext.cxx
@@ -27,9 +27,7 @@
************************************************************************/
#include "headerfootercontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/helper/attributelist.hxx"
-#include "tokens.hxx"
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
diff --git a/oox/source/ppt/layoutfragmenthandler.cxx b/oox/source/ppt/layoutfragmenthandler.cxx
index e4dbe297df80..19a9e6ead026 100644
--- a/oox/source/ppt/layoutfragmenthandler.cxx
+++ b/oox/source/ppt/layoutfragmenthandler.cxx
@@ -35,8 +35,6 @@
#include "headerfootercontext.hxx"
#include "oox/ppt/layoutfragmenthandler.hxx"
#include "oox/drawingml/shapegroupcontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::com::sun::star;
@@ -68,10 +66,10 @@ Reference< XFastContextHandler > LayoutFragmentHandler::createFastChildContext(
Reference< XFastContextHandler > xRet = getFastContextHandler();
switch( aElementToken )
{
- case NMSP_PPT|XML_sldLayout: // CT_SlideLayout
+ case PPT_TOKEN( sldLayout ): // CT_SlideLayout
mpSlidePersistPtr->setLayoutValueToken( xAttribs->getOptionalValueToken( XML_type, 0 ) ); // CT_SlideLayoutType
break;
- case NMSP_PPT|XML_hf: // CT_HeaderFooter
+ case PPT_TOKEN( hf ): // CT_HeaderFooter
xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) );
break;
default:
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index 67c4ba1aff22..2672170d2131 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -31,6 +31,7 @@
#include "oox/dump/pptxdumper.hxx"
#include "oox/drawingml/table/tablestylelistfragmenthandler.hxx"
#include "oox/helper/graphichelper.hxx"
+#include "oox/ole/vbaproject.hxx"
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -45,28 +46,30 @@ namespace oox { namespace ppt {
OUString SAL_CALL PowerPointImport_getImplementationName() throw()
{
- return CREATE_OUSTRING( "com.sun.star.comp.Impress.oox.PowerPointImport" );
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.ppt.PowerPointImport" );
}
uno::Sequence< OUString > SAL_CALL PowerPointImport_getSupportedServiceNames() throw()
{
- const OUString aServiceName = CREATE_OUSTRING( "com.sun.star.comp.ooxpptx" );
- const Sequence< OUString > aSeq( &aServiceName, 1 );
+ Sequence< OUString > aSeq( 2 );
+ aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" );
+ aSeq[ 1 ] = CREATE_OUSTRING( "com.sun.star.document.ExportFilter" );
return aSeq;
}
-uno::Reference< uno::XInterface > SAL_CALL PowerPointImport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception )
+uno::Reference< uno::XInterface > SAL_CALL PowerPointImport_createInstance( const Reference< XComponentContext >& rxContext ) throw( Exception )
{
- return (cppu::OWeakObject*)new PowerPointImport( rSMgr );
+ return static_cast< ::cppu::OWeakObject* >( new PowerPointImport( rxContext ) );
}
#if OSL_DEBUG_LEVEL > 0
XmlFilterBase* PowerPointImport::mpDebugFilterBase = NULL;
#endif
-PowerPointImport::PowerPointImport( const uno::Reference< lang::XMultiServiceFactory > & rSMgr )
- : XmlFilterBase( rSMgr )
- , mxChartConv( new ::oox::drawingml::chart::ChartConverter )
+PowerPointImport::PowerPointImport( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ XmlFilterBase( rxContext ),
+ mxChartConv( new ::oox::drawingml::chart::ChartConverter )
+
{
#if OSL_DEBUG_LEVEL > 0
mpDebugFilterBase = this;
@@ -84,9 +87,9 @@ bool PowerPointImport::importDocument() throw()
file:///<path-to-oox-module>/source/dump/pptxdumper.ini. */
OOX_DUMP_FILE( ::oox::dump::pptx::Dumper );
- OUString aFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "officeDocument" ) );
+ OUString aFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "officeDocument" ) );
FragmentHandlerRef xPresentationFragmentHandler( new PresentationFragmentHandler( *this, aFragmentPath ) );
- maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "tableStyles" ) );
+ maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "tableStyles" ) );
return importFragment( xPresentationFragmentHandler );
@@ -147,7 +150,7 @@ sal_Bool SAL_CALL PowerPointImport::filter( const Sequence< PropertyValue >& rDe
return true;
if( isExportFilter() ) {
- Reference< XExporter > xExporter( getGlobalFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.comp.Impress.oox.PowerPointExport" ) ), UNO_QUERY );
+ Reference< XExporter > xExporter( getServiceFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.comp.Impress.oox.PowerPointExport" ) ), UNO_QUERY );
if( xExporter.is() ) {
Reference< XComponent > xDocument( getModel(), UNO_QUERY );
@@ -197,7 +200,7 @@ private:
};
PptGraphicHelper::PptGraphicHelper( const PowerPointImport& rFilter ) :
- GraphicHelper( rFilter.getGlobalFactory(), rFilter.getTargetFrame(), rFilter.getStorage() ),
+ GraphicHelper( rFilter.getComponentContext(), rFilter.getTargetFrame(), rFilter.getStorage() ),
mrFilter( rFilter )
{
}
@@ -214,6 +217,11 @@ GraphicHelper* PowerPointImport::implCreateGraphicHelper() const
return new PptGraphicHelper( *this );
}
+::oox::ole::VbaProject* PowerPointImport::implCreateVbaProject() const
+{
+ return new ::oox::ole::VbaProject( getComponentContext(), getModel(), CREATE_OUSTRING( "Impress" ) );
+}
+
OUString PowerPointImport::implGetImplementationName() const
{
return PowerPointImport_getImplementationName();
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 87997f1215a8..208a6a0981a3 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -27,10 +27,8 @@
************************************************************************/
#include "oox/ppt/pptshape.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/textbody.hxx"
-#include "tokens.hxx"
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
@@ -120,7 +118,7 @@ oox::drawingml::TextListStylePtr PPTShape::getSubTypeTextListStyle( const SlideP
}
void PPTShape::addShape(
- const oox::core::XmlFilterBase& rFilterBase,
+ oox::core::XmlFilterBase& rFilterBase,
const SlidePersist& rSlidePersist,
const oox::drawingml::Theme* pTheme,
const Reference< XShapes >& rxShapes,
diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx
index 76ed71781dbc..cde75734b258 100644
--- a/oox/source/ppt/pptshapecontext.cxx
+++ b/oox/source/ppt/pptshapecontext.cxx
@@ -38,14 +38,11 @@
#include "oox/ppt/pptshapepropertiescontext.hxx"
#include "oox/ppt/slidepersist.hxx"
#include "oox/drawingml/shapestylecontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/customshapegeometry.hxx"
#include "oox/drawingml/textbodycontext.hxx"
-#include "tokens.hxx"
-#include "properties.hxx"
using rtl::OUString;
using namespace oox::core;
@@ -103,9 +100,9 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
switch( aElementToken )
{
// nvSpPr CT_ShapeNonVisual begin
- // case NMSP_PPT|XML_drElemPr:
+ // case PPT_TOKEN( drElemPr ):
// break;
- case NMSP_PPT|XML_cNvPr:
+ case PPT_TOKEN( cNvPr ):
{
AttributeList aAttribs( xAttribs );
mpShapePtr->setHidden( aAttribs.getBool( XML_hidden, false ) );
@@ -113,7 +110,7 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
mpShapePtr->setName( xAttribs->getOptionalValue( XML_name ) );
break;
}
- case NMSP_PPT|XML_ph:
+ case PPT_TOKEN( ph ):
{
sal_Int32 nSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) );
mpShapePtr->setSubType( nSubType );
@@ -203,15 +200,15 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
// nvSpPr CT_ShapeNonVisual end
- case NMSP_PPT|XML_spPr:
+ case PPT_TOKEN( spPr ):
xRet = new PPTShapePropertiesContext( *this, *mpShapePtr );
break;
- case NMSP_PPT|XML_style:
+ case PPT_TOKEN( style ):
xRet = new oox::drawingml::ShapeStyleContext( *this, *mpShapePtr );
break;
- case NMSP_PPT|XML_txBody:
+ case PPT_TOKEN( txBody ):
{
oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody( mpShapePtr->getTextBody() ) );
xTextBody->getTextProperties().maPropertyMap[ PROP_FontIndependentLineSpacing ] <<= static_cast< sal_Bool >( sal_True );
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index f7f11feaef42..0a03e44f03f8 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -41,8 +41,6 @@
#include "oox/drawingml/customshapegeometry.hxx"
#include "oox/drawingml/textbodycontext.hxx"
#include "oox/drawingml/connectorshapecontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace oox::core;
@@ -73,7 +71,7 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s
switch( aElementToken )
{
- case NMSP_PPT|XML_cNvPr:
+ case PPT_TOKEN( cNvPr ):
{
AttributeList aAttribs( xAttribs );
mpGroupShapePtr->setHidden( aAttribs.getBool( XML_hidden, false ) );
@@ -81,37 +79,37 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s
mpGroupShapePtr->setName( xAttribs->getOptionalValue( XML_name ) );
break;
}
- case NMSP_PPT|XML_ph:
+ case PPT_TOKEN( ph ):
mpGroupShapePtr->setSubType( xAttribs->getOptionalValueToken( XML_type, FastToken::DONTKNOW ) );
if( xAttribs->hasAttribute( XML_idx ) )
mpGroupShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
break;
// nvSpPr CT_ShapeNonVisual end
- case NMSP_PPT|XML_grpSpPr:
+ case PPT_TOKEN( grpSpPr ):
xRet = new oox::drawingml::ShapePropertiesContext( *this, *mpGroupShapePtr );
break;
- case NMSP_PPT|XML_spPr:
+ case PPT_TOKEN( spPr ):
xRet = new oox::drawingml::ShapePropertiesContext( *this, *mpGroupShapePtr );
break;
/*
- case NMSP_PPT|XML_style:
+ case PPT_TOKEN( style ):
xRet = new ShapeStyleContext( getParser() );
break;
*/
- case NMSP_PPT|XML_cxnSp: // connector shape
+ case PPT_TOKEN( cxnSp ): // connector shape
xRet.set( new oox::drawingml::ConnectorShapeContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.ConnectorShape" ) ) ) );
break;
- case NMSP_PPT|XML_grpSp: // group shape
+ case PPT_TOKEN( grpSp ): // group shape
xRet.set( new PPTShapeGroupContext( *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ) ) );
break;
- case NMSP_PPT|XML_sp: // Shape
+ case PPT_TOKEN( sp ): // Shape
xRet.set( new PPTShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.CustomShape" ) ) ) );
break;
- case NMSP_PPT|XML_pic: // CT_Picture
+ case PPT_TOKEN( pic ): // CT_Picture
xRet.set( new PPTGraphicShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GraphicObjectShape" ) ) ) );
break;
- case NMSP_PPT|XML_graphicFrame: // CT_GraphicalObjectFrame
+ case PPT_TOKEN( graphicFrame ): // CT_GraphicalObjectFrame
xRet.set( new oox::drawingml::GraphicalObjectFrameContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.OLE2Shape" ) ), true ) );
break;
diff --git a/oox/source/ppt/pptshapepropertiescontext.cxx b/oox/source/ppt/pptshapepropertiescontext.cxx
index 48f2a4c3717b..46e776cb62d4 100644
--- a/oox/source/ppt/pptshapepropertiescontext.cxx
+++ b/oox/source/ppt/pptshapepropertiescontext.cxx
@@ -36,14 +36,11 @@
#include "oox/ppt/pptshapepropertiescontext.hxx"
#include "oox/ppt/slidepersist.hxx"
#include "oox/drawingml/shapestylecontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/customshapegeometry.hxx"
#include "oox/drawingml/textbodycontext.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace oox::core;
@@ -69,7 +66,7 @@ Reference< XFastContextHandler > PPTShapePropertiesContext::createFastChildConte
switch( aElementToken )
{
- case NMSP_DRAWINGML | XML_xfrm:
+ case A_TOKEN( xfrm ):
{
mrShape.getShapeProperties()[ PROP_IsPlaceholderDependent ] <<= sal_False;
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index 88a004038bfc..7448d430ef08 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -47,8 +47,6 @@
#include "oox/ppt/slidefragmenthandler.hxx"
#include "oox/ppt/layoutfragmenthandler.hxx"
#include "oox/ppt/pptimport.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::com::sun::star;
@@ -183,12 +181,12 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce
FragmentHandlerRef xSlideFragmentHandler( new SlideFragmentHandler( rFilter, aSlideFragmentPath, pSlidePersistPtr, Slide ) );
// importing the corresponding masterpage/layout
- OUString aLayoutFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "slideLayout" ) );
+ OUString aLayoutFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "slideLayout" ) );
if ( aLayoutFragmentPath.getLength() > 0 )
{
// importing layout
RelationsRef xLayoutRelations = rFilter.importRelations( aLayoutFragmentPath );
- OUString aMasterFragmentPath = xLayoutRelations->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "slideMaster" ) );
+ OUString aMasterFragmentPath = xLayoutRelations->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "slideMaster" ) );
if( aMasterFragmentPath.getLength() )
{
// check if the corresponding masterpage+layout has already been imported
@@ -222,7 +220,7 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce
FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, aMasterFragmentPath, pMasterPersistPtr, Master ) );
// set the correct theme
- OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "theme" ) );
+ OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "theme" ) );
if( aThemeFragmentPath.getLength() > 0 )
{
std::map< OUString, oox::drawingml::ThemePtr >& rThemes( rFilter.getThemes() );
@@ -260,7 +258,7 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce
pSlidePersistPtr->createXShapes( rFilter );
// now importing the notes page
- OUString aNotesFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "notesSlide" ) );
+ OUString aNotesFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "notesSlide" ) );
if( aNotesFragmentPath.getLength() > 0 )
{
Reference< XPresentationPage > xPresentationPage( xSlide, UNO_QUERY );
@@ -306,30 +304,30 @@ Reference< XFastContextHandler > PresentationFragmentHandler::createFastChildCon
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_PPT|XML_presentation:
- case NMSP_PPT|XML_sldMasterIdLst:
- case NMSP_PPT|XML_notesMasterIdLst:
- case NMSP_PPT|XML_sldIdLst:
+ case PPT_TOKEN( presentation ):
+ case PPT_TOKEN( sldMasterIdLst ):
+ case PPT_TOKEN( notesMasterIdLst ):
+ case PPT_TOKEN( sldIdLst ):
break;
- case NMSP_PPT|XML_sldMasterId:
- maSlideMasterVector.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_id ) );
+ case PPT_TOKEN( sldMasterId ):
+ maSlideMasterVector.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) );
break;
- case NMSP_PPT|XML_sldId:
- maSlidesVector.push_back( xAttribs->getOptionalValue( NMSP_RELATIONSHIPS|XML_id ) );
+ case PPT_TOKEN( sldId ):
+ maSlidesVector.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) );
break;
- case NMSP_PPT|XML_notesMasterId:
- maNotesMasterVector.push_back( xAttribs->getOptionalValue(NMSP_RELATIONSHIPS|XML_id ) );
+ case PPT_TOKEN( notesMasterId ):
+ maNotesMasterVector.push_back( xAttribs->getOptionalValue(R_TOKEN( id ) ) );
break;
- case NMSP_PPT|XML_sldSz:
+ case PPT_TOKEN( sldSz ):
maSlideSize = GetSize2D( xAttribs );
break;
- case NMSP_PPT|XML_notesSz:
+ case PPT_TOKEN( notesSz ):
maNotesSize = GetSize2D( xAttribs );
break;
- case NMSP_PPT|XML_custShowLst:
+ case PPT_TOKEN( custShowLst ):
xRet.set( new CustomShowListContext( *this, maCustomShowList ) );
break;
- case NMSP_PPT|XML_defaultTextStyle:
+ case PPT_TOKEN( defaultTextStyle ):
xRet.set( new TextListStyleContext( *this, *mpTextListStyle ) );
break;
}
diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx
index 411be7b28690..e2ba21c9912b 100644
--- a/oox/source/ppt/slidefragmenthandler.cxx
+++ b/oox/source/ppt/slidefragmenthandler.cxx
@@ -32,10 +32,7 @@
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/container/XNamed.hpp>
-#include "tokens.hxx"
-#include "properties.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "headerfootercontext.hxx"
#include "oox/ppt/backgroundproperties.hxx"
@@ -66,7 +63,7 @@ SlideFragmentHandler::SlideFragmentHandler( XmlFilterBase& rFilter, const OUStri
, mpSlidePersistPtr( pPersistPtr )
, meShapeLocation( eShapeLocation )
{
- OUString aVMLDrawingFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "vmlDrawing" ) );
+ OUString aVMLDrawingFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "vmlDrawing" ) );
if( aVMLDrawingFragmentPath.getLength() > 0 )
getFilter().importFragment( new oox::vml::DrawingFragment(
getFilter(), aVMLDrawingFragmentPath, *pPersistPtr->getDrawing() ) );
@@ -85,9 +82,9 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s
switch( aElementToken )
{
- case NMSP_PPT|XML_sldMaster: // CT_SlideMaster
- case NMSP_PPT|XML_handoutMaster: // CT_HandoutMaster
- case NMSP_PPT|XML_sld: // CT_CommonSlideData
+ case PPT_TOKEN( sldMaster ): // CT_SlideMaster
+ case PPT_TOKEN( handoutMaster ): // CT_HandoutMaster
+ case PPT_TOKEN( sld ): // CT_CommonSlideData
{
AttributeList attribs( xAttribs );
@@ -100,14 +97,14 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s
break;
}
- case NMSP_PPT|XML_notes: // CT_NotesSlide
- case NMSP_PPT|XML_notesMaster: // CT_NotesMaster
+ case PPT_TOKEN( notes ): // CT_NotesSlide
+ case PPT_TOKEN( notesMaster ): // CT_NotesMaster
break;
- case NMSP_PPT|XML_cSld: // CT_CommonSlideData
+ case PPT_TOKEN( cSld ): // CT_CommonSlideData
maSlideName = xAttribs->getOptionalValue(XML_name);
break;
- case NMSP_PPT|XML_spTree: // CT_GroupShape
+ case PPT_TOKEN( spTree ): // CT_GroupShape
{
xRet.set( new PPTShapeGroupContext(
*this, mpSlidePersistPtr, meShapeLocation, mpSlidePersistPtr->getShapes(),
@@ -115,10 +112,10 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s
}
break;
- case NMSP_PPT|XML_controls:
+ case PPT_TOKEN( controls ):
xRet = getFastContextHandler();
break;
- case NMSP_PPT|XML_control:
+ case PPT_TOKEN( control ):
{
::oox::vml::ControlInfo aInfo;
aInfo.setShapeId( aAttribs.getInteger( XML_spid, 0 ) );
@@ -128,42 +125,49 @@ Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( s
}
return xRet;
- case NMSP_PPT|XML_timing: // CT_SlideTiming
+ case PPT_TOKEN( timing ): // CT_SlideTiming
xRet.set( new SlideTimingContext( *this, mpSlidePersistPtr->getTimeNodeList() ) );
break;
- case NMSP_PPT|XML_transition: // CT_SlideTransition
+ case PPT_TOKEN( transition ): // CT_SlideTransition
xRet.set( new SlideTransitionContext( *this, xAttribs, maSlideProperties ) );
break;
- case NMSP_PPT|XML_hf:
+ case PPT_TOKEN( hf ):
xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) );
break;
// BackgroundGroup
- case NMSP_PPT|XML_bgPr: // CT_BackgroundProperties
+ case PPT_TOKEN( bgPr ): // CT_BackgroundProperties
{
FillPropertiesPtr pFillPropertiesPtr( new FillProperties );
xRet.set( new BackgroundPropertiesContext( *this, *pFillPropertiesPtr ) );
mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr );
}
break;
- case NMSP_PPT|XML_bgRef: // a:CT_StyleMatrixReference
+
+ case PPT_TOKEN( bgRef ): // a:CT_StyleMatrixReference
+ {
+ FillPropertiesPtr pFillPropertiesPtr( new FillProperties(
+ *mpSlidePersistPtr->getTheme()->getFillStyle( xAttribs->getOptionalValue( XML_idx ).toInt32() ) ) );
+ xRet.set( new ColorContext( *this, mpSlidePersistPtr->getBackgroundColorRef() ) );
+ mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr );
+ }
break;
- case NMSP_PPT|XML_clrMap: // CT_ColorMapping
+ case PPT_TOKEN( clrMap ): // CT_ColorMapping
{
oox::drawingml::ClrMapPtr pClrMapPtr( new oox::drawingml::ClrMap() );
xRet.set( new oox::drawingml::clrMapContext( *this, xAttribs, *pClrMapPtr ) );
mpSlidePersistPtr->setClrMap( pClrMapPtr );
}
break;
- case NMSP_PPT|XML_clrMapOvr: // CT_ColorMappingOverride
- case NMSP_PPT|XML_sldLayoutIdLst: // CT_SlideLayoutIdList
+ case PPT_TOKEN( clrMapOvr ): // CT_ColorMappingOverride
+ case PPT_TOKEN( sldLayoutIdLst ): // CT_SlideLayoutIdList
break;
- case NMSP_PPT|XML_txStyles: // CT_SlideMasterTextStyles
+ case PPT_TOKEN( txStyles ): // CT_SlideMasterTextStyles
xRet.set( new SlideMasterTextStylesContext( *this, mpSlidePersistPtr ) );
break;
- case NMSP_PPT|XML_custDataLst: // CT_CustomerDataList
- case NMSP_PPT|XML_tagLst: // CT_TagList
+ case PPT_TOKEN( custDataLst ): // CT_CustomerDataList
+ case PPT_TOKEN( tagLst ): // CT_TagList
break;
}
diff --git a/oox/source/ppt/slidemastertextstylescontext.cxx b/oox/source/ppt/slidemastertextstylescontext.cxx
index 9baae25e67e1..08b7aaf4af7c 100644
--- a/oox/source/ppt/slidemastertextstylescontext.cxx
+++ b/oox/source/ppt/slidemastertextstylescontext.cxx
@@ -29,8 +29,6 @@
#include "oox/drawingml/textliststyle.hxx"
#include "oox/drawingml/textliststylecontext.hxx"
#include "oox/ppt/slidemastertextstylescontext.hxx"
-#include "oox/core/namespaces.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::oox::core;
@@ -55,22 +53,22 @@ Reference< XFastContextHandler > SlideMasterTextStylesContext::createFastChildCo
Reference< XFastContextHandler > xRet;
switch( aElementToken )
{
- case NMSP_PPT|XML_titleStyle:
+ case PPT_TOKEN( titleStyle ):
{
aTextListStylePtr = mpSlidePersistPtr->getTitleTextStyle();
break;
}
- case NMSP_PPT|XML_bodyStyle:
+ case PPT_TOKEN( bodyStyle ):
{
aTextListStylePtr = mpSlidePersistPtr->getBodyTextStyle();
break;
}
- case NMSP_PPT|XML_notesStyle:
+ case PPT_TOKEN( notesStyle ):
{
aTextListStylePtr = mpSlidePersistPtr->getNotesTextStyle();
break;
}
- case NMSP_PPT|XML_otherStyle:
+ case PPT_TOKEN( otherStyle ):
{
aTextListStylePtr = mpSlidePersistPtr->getOtherTextStyle();
break;
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 1bcbed7d8f29..f2f812a456e8 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -32,9 +32,7 @@
#include "oox/ppt/slidepersist.hxx"
#include "oox/drawingml/fillproperties.hxx"
#include "oox/vml/vmldrawing.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
-#include "tokens.hxx"
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
@@ -137,7 +135,7 @@ sal_Int16 SlidePersist::getLayoutFromValueToken()
return nLayout;
}
-void SlidePersist::createXShapes( const XmlFilterBase& rFilterBase )
+void SlidePersist::createXShapes( XmlFilterBase& rFilterBase )
{
applyTextStyles( rFilterBase );
@@ -181,12 +179,17 @@ void SlidePersist::createBackground( const XmlFilterBase& rFilterBase )
{
try
{
+ sal_Int32 nPhClr = API_RGB_TRANSPARENT;
+ if ( maBackgroundColorRef.isUsed() )
+ nPhClr = maBackgroundColorRef.getColor( rFilterBase.getGraphicHelper() );
+
PropertyMap aPropMap;
static const rtl::OUString sBackground( RTL_CONSTASCII_USTRINGPARAM( "Background" ) );
uno::Reference< beans::XPropertySet > xPagePropSet( mxPage, uno::UNO_QUERY_THROW );
uno::Reference< beans::XPropertySet > xPropertySet( aPropMap.makePropertySet() );
PropertySet aPropSet( xPropertySet );
- mpBackgroundPropertiesPtr->pushToPropSet( aPropSet, rFilterBase.getModelObjectHelper(), rFilterBase.getGraphicHelper() );
+ mpBackgroundPropertiesPtr->pushToPropSet( aPropSet, rFilterBase.getModelObjectHelper(),
+ rFilterBase.getGraphicHelper(), oox::drawingml::FillProperties::DEFAULT_IDS, 0, nPhClr );
xPagePropSet->setPropertyValue( sBackground, Any( xPropertySet ) );
}
catch( Exception )
diff --git a/oox/source/ppt/slidetimingcontext.cxx b/oox/source/ppt/slidetimingcontext.cxx
index 7e55d72dc3a5..6c4fcf76a9d2 100644
--- a/oox/source/ppt/slidetimingcontext.cxx
+++ b/oox/source/ppt/slidetimingcontext.cxx
@@ -35,10 +35,8 @@
#include "oox/ppt/slidefragmenthandler.hxx"
#include "oox/drawingml/shapegroupcontext.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/ppt/timenodelistcontext.hxx"
#include "buildlistcontext.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::com::sun::star;
@@ -73,12 +71,12 @@ Reference< XFastContextHandler > SlideTimingContext::createFastChildContext( sal
switch( aElementToken )
{
- case NMSP_PPT|XML_bldLst:
+ case PPT_TOKEN( bldLst ):
xRet.set( new BuildListContext( *this, xAttribs, maTimeNodeList ) );
break;
- case NMSP_PPT|XML_extLst:
+ case PPT_TOKEN( extLst ):
return xRet;
- case NMSP_PPT|XML_tnLst:
+ case PPT_TOKEN( tnLst ):
// timing nodes
{
xRet.set( new TimeNodeListContext( *this, maTimeNodeList ) );
diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx
index 29f009e6277e..879a28a7662b 100644
--- a/oox/source/ppt/slidetransition.cxx
+++ b/oox/source/ppt/slidetransition.cxx
@@ -36,10 +36,9 @@
#include "oox/helper/helper.hxx"
#include "oox/helper/propertymap.hxx"
-#include "oox/core/namespaces.hxx"
+#include "oox/token/namespaces.hxx"
+#include "oox/token/tokens.hxx"
#include "pptfilterhelpers.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::com::sun::star::uno;
@@ -261,11 +260,11 @@ namespace oox { namespace ppt {
{
switch( OoxType )
{
- case NMSP_PPT|XML_blinds:
+ case PPT_TOKEN( blinds ):
mnTransitionType = TransitionType::BLINDSWIPE;
mnTransitionSubType = ooxToOdpDirection( param1 );
break;
- case NMSP_PPT|XML_checker:
+ case PPT_TOKEN( checker ):
mnTransitionType = TransitionType::CHECKERBOARDWIPE;
switch ( param1 )
{
@@ -279,7 +278,7 @@ namespace oox { namespace ppt {
break;
}
break;
- case NMSP_PPT|XML_comb:
+ case PPT_TOKEN( comb ):
mnTransitionType = TransitionType::PUSHWIPE;
switch( param1 )
{
@@ -293,16 +292,16 @@ namespace oox { namespace ppt {
break;
}
break;
- case NMSP_PPT|XML_cover:
+ case PPT_TOKEN( cover ):
mnTransitionType = TransitionType::SLIDEWIPE;
mnTransitionSubType = ooxToOdpEightDirections( param1 );
break;
- case NMSP_PPT|XML_pull: // uncover
+ case PPT_TOKEN( pull ): // uncover
mnTransitionType = TransitionType::SLIDEWIPE;
mnTransitionSubType = ooxToOdpEightDirections( param1 );
mbTransitionDirectionNormal = false;
break;
- case NMSP_PPT|XML_cut:
+ case PPT_TOKEN( cut ):
// The binfilter seems to ignore this transition.
// Fade to black instead if thrBlk is true.
if( param1 )
@@ -312,7 +311,7 @@ namespace oox { namespace ppt {
}
OSL_TRACE( "OOX: cut transition fallback." );
break;
- case NMSP_PPT|XML_fade:
+ case PPT_TOKEN( fade ):
mnTransitionType = TransitionType::FADE;
if( param1 )
{
@@ -323,16 +322,16 @@ namespace oox { namespace ppt {
mnTransitionSubType = TransitionSubType::CROSSFADE;
}
break;
- case NMSP_PPT|XML_push:
+ case PPT_TOKEN( push ):
mnTransitionType = TransitionType::PUSHWIPE;
mnTransitionSubType = ooxToOdpBorderDirections( param1 );
break;
- case NMSP_PPT|XML_wipe:
+ case PPT_TOKEN( wipe ):
mnTransitionType = TransitionType::BARWIPE;
mnTransitionSubType = ooxToOdpSideDirections( param1 );
mbTransitionDirectionNormal = ooxToOdpSideDirectionsDirectionNormal( param1 );
break;
- case NMSP_PPT|XML_split:
+ case PPT_TOKEN( split ):
mnTransitionType = TransitionType::BARNDOORWIPE;
mnTransitionSubType = ooxToOdpDirection( param1 );
if( param2 == XML_in )
@@ -341,7 +340,7 @@ namespace oox { namespace ppt {
mbTransitionDirectionNormal = false;
}
break;
- case NMSP_PPT|XML_wheel:
+ case PPT_TOKEN( wheel ):
mnTransitionType = TransitionType::PINWHEELWIPE;
switch( param1 )
{
@@ -377,40 +376,40 @@ namespace oox { namespace ppt {
break;
}
break;
- case NMSP_PPT|XML_randomBar:
+ case PPT_TOKEN( randomBar ):
mnTransitionType = TransitionType::RANDOMBARWIPE;
mnTransitionSubType = ooxToOdpDirection( param1 );
break;
- case NMSP_PPT|XML_circle:
+ case PPT_TOKEN( circle ):
mnTransitionType = TransitionType::ELLIPSEWIPE;
mnTransitionSubType = TransitionSubType::CIRCLE;
break;
- case NMSP_PPT|XML_diamond:
+ case PPT_TOKEN( diamond ):
mnTransitionType = TransitionType::IRISWIPE;
mnTransitionSubType = TransitionSubType::DIAMOND;
break;
- case NMSP_PPT|XML_dissolve:
+ case PPT_TOKEN( dissolve ):
mnTransitionType = TransitionType::DISSOLVE;
mnTransitionSubType = TransitionSubType::DEFAULT;
break;
- case NMSP_PPT|XML_newsflash:
+ case PPT_TOKEN( newsflash ):
// this is what the PPT binary filter does.... not sure I agree.
mnTransitionType = TransitionType::FOURBOXWIPE;
mnTransitionSubType = TransitionSubType::CORNERSOUT;
break;
- case NMSP_PPT|XML_plus:
+ case PPT_TOKEN( plus ):
mnTransitionType = TransitionType::FOURBOXWIPE;
mnTransitionSubType = TransitionSubType::CORNERSOUT;
break;
- case NMSP_PPT|XML_random:
+ case PPT_TOKEN( random ):
mnTransitionType = TransitionType::RANDOM;
mnTransitionSubType = TransitionSubType::DEFAULT;
break;
- case NMSP_PPT|XML_wedge:
+ case PPT_TOKEN( wedge ):
mnTransitionType = TransitionType::FANWIPE;
mnTransitionSubType = TransitionSubType::CENTERTOP;
break;
- case NMSP_PPT|XML_zoom:
+ case PPT_TOKEN( zoom ):
mnTransitionType = TransitionType::ZOOM;
mnTransitionSubType = TransitionSubType::DEFAULT;
break;
diff --git a/oox/source/ppt/slidetransitioncontext.cxx b/oox/source/ppt/slidetransitioncontext.cxx
index a21771000de8..c7f61912f44e 100644
--- a/oox/source/ppt/slidetransitioncontext.cxx
+++ b/oox/source/ppt/slidetransitioncontext.cxx
@@ -39,9 +39,6 @@
#include "oox/ppt/soundactioncontext.hxx"
#include "oox/drawingml/shapegroupcontext.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
-
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::com::sun::star;
@@ -84,10 +81,10 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
switch( aElementToken )
{
- case NMSP_PPT|XML_blinds:
- case NMSP_PPT|XML_checker:
- case NMSP_PPT|XML_comb:
- case NMSP_PPT|XML_randomBar:
+ case PPT_TOKEN( blinds ):
+ case PPT_TOKEN( checker ):
+ case PPT_TOKEN( comb ):
+ case PPT_TOKEN( randomBar ):
if (!mbHasTransition)
{
mbHasTransition = true;
@@ -95,8 +92,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
// ST_Direction { XML_horz, XML_vert }
}
break;
- case NMSP_PPT|XML_cover:
- case NMSP_PPT|XML_pull:
+ case PPT_TOKEN( cover ):
+ case PPT_TOKEN( pull ):
if (!mbHasTransition)
{
mbHasTransition = true;
@@ -107,8 +104,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
// XML_ld, XML_lu, XML_rd, XML_ru }
}
break;
- case NMSP_PPT|XML_cut:
- case NMSP_PPT|XML_fade:
+ case PPT_TOKEN( cut ):
+ case PPT_TOKEN( fade ):
if (!mbHasTransition)
{
mbHasTransition = true;
@@ -117,8 +114,8 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
maTransition.setOoxTransitionType( aElementToken, attribs.getBool( XML_thruBlk, false ), 0);
}
break;
- case NMSP_PPT|XML_push:
- case NMSP_PPT|XML_wipe:
+ case PPT_TOKEN( push ):
+ case PPT_TOKEN( wipe ):
if (!mbHasTransition)
{
mbHasTransition = true;
@@ -126,7 +123,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
// ST_TransitionSideDirectionType { XML_d, XML_l, XML_r, XML_u }
}
break;
- case NMSP_PPT|XML_split:
+ case PPT_TOKEN( split ):
if (!mbHasTransition)
{
mbHasTransition = true;
@@ -135,7 +132,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
// ST_TransitionInOutDirectionType { XML_out, XML_in }
}
break;
- case NMSP_PPT|XML_zoom:
+ case PPT_TOKEN( zoom ):
if (!mbHasTransition)
{
mbHasTransition = true;
@@ -143,7 +140,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
// ST_TransitionInOutDirectionType { XML_out, XML_in }
}
break;
- case NMSP_PPT|XML_wheel:
+ case PPT_TOKEN( wheel ):
if (!mbHasTransition)
{
mbHasTransition = true;
@@ -152,13 +149,13 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
// unsignedInt
}
break;
- case NMSP_PPT|XML_circle:
- case NMSP_PPT|XML_diamond:
- case NMSP_PPT|XML_dissolve:
- case NMSP_PPT|XML_newsflash:
- case NMSP_PPT|XML_plus:
- case NMSP_PPT|XML_random:
- case NMSP_PPT|XML_wedge:
+ case PPT_TOKEN( circle ):
+ case PPT_TOKEN( diamond ):
+ case PPT_TOKEN( dissolve ):
+ case PPT_TOKEN( newsflash ):
+ case PPT_TOKEN( plus ):
+ case PPT_TOKEN( random ):
+ case PPT_TOKEN( wedge ):
// CT_Empty
if (!mbHasTransition)
{
@@ -168,11 +165,11 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
break;
- case NMSP_PPT|XML_sndAc: // CT_TransitionSoundAction
+ case PPT_TOKEN( sndAc ): // CT_TransitionSoundAction
//"Sound"
xRet.set( new SoundActionContext ( *this, maSlideProperties ) );
break;
- case NMSP_PPT|XML_extLst: // CT_OfficeArtExtensionList
+ case PPT_TOKEN( extLst ): // CT_OfficeArtExtensionList
return xRet;
default:
break;
@@ -186,7 +183,7 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
void SlideTransitionContext::endFastElement( sal_Int32 aElement ) throw (::com::sun::star::xml::sax::SAXException, RuntimeException)
{
- if( aElement == (NMSP_PPT|XML_transition) )
+ if( aElement == (PPT_TOKEN( transition )) )
{
if( mbHasTransition )
{
diff --git a/oox/source/ppt/soundactioncontext.cxx b/oox/source/ppt/soundactioncontext.cxx
index 5b49bf5662be..64a24963ab66 100644
--- a/oox/source/ppt/soundactioncontext.cxx
+++ b/oox/source/ppt/soundactioncontext.cxx
@@ -33,10 +33,7 @@
#include "oox/helper/attributelist.hxx"
#include "oox/helper/propertymap.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/embeddedwavaudiofile.hxx"
-#include "properties.hxx"
-#include "tokens.hxx"
using rtl::OUString;
using namespace ::oox::core;
@@ -64,7 +61,7 @@ namespace oox { namespace ppt {
void SoundActionContext::endFastElement( sal_Int32 aElement ) throw (SAXException, RuntimeException)
{
- if ( aElement == ( NMSP_PPT|XML_sndAc ) )
+ if ( aElement == PPT_TOKEN( sndAc ) )
{
if( mbHasStartSound )
{
@@ -107,7 +104,7 @@ namespace oox { namespace ppt {
switch( aElement )
{
- case NMSP_PPT|XML_snd:
+ case PPT_TOKEN( snd ):
if( mbHasStartSound )
{
drawingml::EmbeddedWAVAudioFile aAudio;
@@ -116,11 +113,11 @@ namespace oox { namespace ppt {
msSndName = ( aAudio.mbBuiltIn ? aAudio.msName : aAudio.msEmbed );
}
break;
- case NMSP_PPT|XML_endSnd:
+ case PPT_TOKEN( endSnd ):
// CT_Empty
mbStopSound = true;
break;
- case NMSP_PPT|XML_stSnd:
+ case PPT_TOKEN( stSnd ):
mbHasStartSound = true;
mbLoopSound = attribs.getBool( XML_loop, false );
default:
diff --git a/oox/source/ppt/timeanimvaluecontext.cxx b/oox/source/ppt/timeanimvaluecontext.cxx
index 9f3fc2a768da..fd247de41a86 100644
--- a/oox/source/ppt/timeanimvaluecontext.cxx
+++ b/oox/source/ppt/timeanimvaluecontext.cxx
@@ -28,12 +28,8 @@
#include "timeanimvaluecontext.hxx"
-#include "oox/core/namespaces.hxx"
#include "animvariantcontext.hxx"
-#include "tokens.hxx"
-
-
using namespace ::oox::core;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
@@ -58,7 +54,7 @@ namespace oox { namespace ppt {
void SAL_CALL TimeAnimValueListContext::endFastElement( sal_Int32 aElement )
throw ( SAXException, RuntimeException)
{
- if( aElement == ( NMSP_PPT|XML_tav ) )
+ if( aElement == PPT_TOKEN( tav ) )
{
mbInValue = false;
}
@@ -73,7 +69,7 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_tav:
+ case PPT_TOKEN( tav ):
{
mbInValue = true;
TimeAnimationValue val;
@@ -82,7 +78,7 @@ namespace oox { namespace ppt {
maTavList.push_back( val );
break;
}
- case NMSP_PPT|XML_val:
+ case PPT_TOKEN( val ):
if( mbInValue )
{
// CT_TLAnimVariant
diff --git a/oox/source/ppt/timenode.cxx b/oox/source/ppt/timenode.cxx
index a1d9694f5fa2..fc28f72e7028 100644
--- a/oox/source/ppt/timenode.cxx
+++ b/oox/source/ppt/timenode.cxx
@@ -589,7 +589,7 @@ namespace oox { namespace ppt {
const Reference< XAnimationNode >& rxNode )
{
try {
- Reference< XAnimationNode > xNode ( rFilter.getGlobalFactory()->createInstance(rServiceName ), UNO_QUERY_THROW );
+ Reference< XAnimationNode > xNode ( rFilter.getServiceFactory()->createInstance( rServiceName ), UNO_QUERY_THROW );
Reference< XTimeContainer > xParentContainer( rxNode, UNO_QUERY_THROW );
xParentContainer->appendChild( xNode );
diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx
index 51e804c01680..fac6d04863ad 100644
--- a/oox/source/ppt/timenodelistcontext.cxx
+++ b/oox/source/ppt/timenodelistcontext.cxx
@@ -48,12 +48,10 @@
#include <com/sun/star/beans/NamedValue.hpp>
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/colorchoicecontext.hxx"
#include "oox/ppt/slidetransition.hxx"
-#include "tokens.hxx"
#include "animvariantcontext.hxx"
#include "commonbehaviorcontext.hxx"
@@ -130,10 +128,10 @@ namespace oox { namespace ppt {
switch( aElement )
{
- case NMSP_PPT|XML_audio:
+ case PPT_TOKEN( audio ):
mbIsNarration = attribs.getBool( XML_isNarration, false );
break;
- case NMSP_PPT|XML_video:
+ case PPT_TOKEN( video ):
mbFullScrn = attribs.getBool( XML_fullScrn, false );
break;
default:
@@ -144,11 +142,11 @@ namespace oox { namespace ppt {
virtual void SAL_CALL endFastElement( sal_Int32 aElement )
throw ( SAXException, RuntimeException)
{
- if( aElement == ( NMSP_PPT|XML_audio ) )
+ if( aElement == PPT_TOKEN( audio ) )
{
// TODO deal with mbIsNarration
}
- else if( aElement == ( NMSP_PPT|XML_video ) )
+ else if( aElement == PPT_TOKEN( video ) )
{
// TODO deal with mbFullScrn
}
@@ -162,7 +160,7 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
default:
@@ -228,10 +226,10 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_to:
+ case PPT_TOKEN( to ):
// CT_TLAnimVariant
xRet.set( new AnimVariantContext( *this, aElementToken, maTo ) );
break;
@@ -262,7 +260,7 @@ namespace oox { namespace ppt {
{
switch ( aElement )
{
- case NMSP_PPT|XML_cmd:
+ case PPT_TOKEN( cmd ):
msCommand = xAttribs->getOptionalValue( XML_cmd );
maType = xAttribs->getOptionalValueToken( XML_type, 0 );
break;
@@ -278,7 +276,7 @@ namespace oox { namespace ppt {
virtual void SAL_CALL endFastElement( sal_Int32 aElement )
throw ( SAXException, RuntimeException)
{
- if( aElement == ( NMSP_PPT|XML_cmd ) )
+ if( aElement == PPT_TOKEN( cmd ) )
{
try {
// see sd/source/filter/ppt/pptinanimations.cxx
@@ -357,7 +355,7 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
default:
@@ -410,14 +408,14 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cTn:
+ case PPT_TOKEN( cTn ):
xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_nextCondLst:
+ case PPT_TOKEN( nextCondLst ):
xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode,
mpNode->getNextCondition() ) );
break;
- case NMSP_PPT|XML_prevCondLst:
+ case PPT_TOKEN( prevCondLst ):
xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode,
mpNode->getPrevCondition() ) );
break;
@@ -458,7 +456,7 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cTn:
+ case PPT_TOKEN( cTn ):
xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) );
break;
default:
@@ -522,7 +520,7 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_hsl:
+ case PPT_TOKEN( hsl ):
// CT_TLByHslColorTransform
{
if( mbHasByColor )
@@ -535,7 +533,7 @@ namespace oox { namespace ppt {
xRet.set(this);
break;
}
- case NMSP_PPT|XML_rgb:
+ case PPT_TOKEN( rgb ):
{
if( mbHasByColor )
{
@@ -548,19 +546,19 @@ namespace oox { namespace ppt {
xRet.set(this);
break;
}
- case NMSP_PPT|XML_by:
+ case PPT_TOKEN( by ):
// CT_TLByAnimateColorTransform
mbHasByColor = true;
xRet.set(this);
break;
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_to:
+ case PPT_TOKEN( to ):
// CT_Color
xRet.set( new ColorContext( *this, maToClr ) );
break;
- case NMSP_PPT|XML_from:
+ case PPT_TOKEN( from ):
// CT_Color
xRet.set( new ColorContext( *this, maFromClr ) );
break;
@@ -679,10 +677,10 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_tavLst:
+ case PPT_TOKEN( tavLst ):
xRet.set( new TimeAnimValueListContext ( *this, xAttribs, maTavList ) );
break;
default:
@@ -749,10 +747,10 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_to:
+ case PPT_TOKEN( to ):
{
// CT_TLPoint
Point p = GetPointPercent( xAttribs );
@@ -760,7 +758,7 @@ namespace oox { namespace ppt {
maTo <<= p.Y;
break;
}
- case NMSP_PPT|XML_from:
+ case PPT_TOKEN( from ):
{
// CT_TLPoint
Point p = GetPointPercent( xAttribs );
@@ -768,7 +766,7 @@ namespace oox { namespace ppt {
maFrom <<= p.Y;
break;
}
- case NMSP_PPT|XML_by:
+ case PPT_TOKEN( by ):
{
// CT_TLPoint
Point p = GetPointPercent( xAttribs );
@@ -835,7 +833,7 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
default:
@@ -903,10 +901,10 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_to:
+ case PPT_TOKEN( to ):
{
// CT_TLPoint
Point p = GetPointPercent( xAttribs );
@@ -916,7 +914,7 @@ namespace oox { namespace ppt {
mpNode->setTo( rAny );
break;
}
- case NMSP_PPT|XML_from:
+ case PPT_TOKEN( from ):
{
// CT_TLPoint
Point p = GetPointPercent( xAttribs );
@@ -926,7 +924,7 @@ namespace oox { namespace ppt {
mpNode->setFrom( rAny );
break;
}
- case NMSP_PPT|XML_by:
+ case PPT_TOKEN( by ):
{
// CT_TLPoint
Point p = GetPointPercent( xAttribs );
@@ -936,7 +934,7 @@ namespace oox { namespace ppt {
mpNode->setBy( rAny );
break;
}
- case NMSP_PPT|XML_rCtr:
+ case PPT_TOKEN( rCtr ):
{
// CT_TLPoint
Point p = GetPointPercent( xAttribs );
@@ -995,10 +993,10 @@ namespace oox { namespace ppt {
switch ( aElementToken )
{
- case NMSP_PPT|XML_cBhvr:
+ case PPT_TOKEN( cBhvr ):
xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
break;
- case NMSP_PPT|XML_progress:
+ case PPT_TOKEN( progress ):
xRet.set( new AnimVariantContext( *this, aElementToken, maProgress ) );
// TODO handle it.
break;
@@ -1027,41 +1025,41 @@ namespace oox { namespace ppt {
TimeNodeContext *pCtx = NULL;
switch( aElement )
{
- case NMSP_PPT|XML_animClr:
+ case PPT_TOKEN( animClr ):
pCtx = new AnimColorContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_par:
+ case PPT_TOKEN( par ):
pCtx = new ParallelExclTimeNodeContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_seq:
+ case PPT_TOKEN( seq ):
pCtx = new SequenceTimeNodeContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_excl:
+ case PPT_TOKEN( excl ):
pCtx = new ParallelExclTimeNodeContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_anim:
+ case PPT_TOKEN( anim ):
pCtx = new AnimContext ( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_animEffect:
+ case PPT_TOKEN( animEffect ):
pCtx = new AnimEffectContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_animMotion:
+ case PPT_TOKEN( animMotion ):
pCtx = new AnimMotionContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_animRot:
+ case PPT_TOKEN( animRot ):
pCtx = new AnimRotContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_animScale:
+ case PPT_TOKEN( animScale ):
pCtx = new AnimScaleContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_cmd:
+ case PPT_TOKEN( cmd ):
pCtx = new CmdTimeNodeContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_set:
+ case PPT_TOKEN( set ):
pCtx = new SetTimeNodeContext( rParent, aElement, xAttribs, pNode );
break;
- case NMSP_PPT|XML_audio:
- case NMSP_PPT|XML_video:
+ case PPT_TOKEN( audio ):
+ case PPT_TOKEN( video ):
pCtx = new MediaNodeContext( rParent, aElement, xAttribs, pNode );
break;
default:
@@ -1108,43 +1106,43 @@ namespace oox { namespace ppt {
switch( aElementToken )
{
- case NMSP_PPT|XML_par:
+ case PPT_TOKEN( par ):
nNodeType = AnimationNodeType::PAR;
break;
- case NMSP_PPT|XML_seq:
+ case PPT_TOKEN( seq ):
nNodeType = AnimationNodeType::SEQ;
break;
- case NMSP_PPT|XML_excl:
+ case PPT_TOKEN( excl ):
// TODO pick the right type. We choose parallel for now as
// there does not seem to be an "Exclusive"
nNodeType = AnimationNodeType::PAR;
break;
- case NMSP_PPT|XML_anim:
+ case PPT_TOKEN( anim ):
nNodeType = AnimationNodeType::ANIMATE;
break;
- case NMSP_PPT|XML_animClr:
+ case PPT_TOKEN( animClr ):
nNodeType = AnimationNodeType::ANIMATECOLOR;
break;
- case NMSP_PPT|XML_animEffect:
+ case PPT_TOKEN( animEffect ):
nNodeType = AnimationNodeType::TRANSITIONFILTER;
break;
- case NMSP_PPT|XML_animMotion:
+ case PPT_TOKEN( animMotion ):
nNodeType = AnimationNodeType::ANIMATEMOTION;
break;
- case NMSP_PPT|XML_animRot:
- case NMSP_PPT|XML_animScale:
+ case PPT_TOKEN( animRot ):
+ case PPT_TOKEN( animScale ):
nNodeType = AnimationNodeType::ANIMATETRANSFORM;
break;
- case NMSP_PPT|XML_cmd:
+ case PPT_TOKEN( cmd ):
nNodeType = AnimationNodeType::COMMAND;
break;
- case NMSP_PPT|XML_set:
+ case PPT_TOKEN( set ):
nNodeType = AnimationNodeType::SET;
break;
- case NMSP_PPT|XML_audio:
+ case PPT_TOKEN( audio ):
nNodeType = AnimationNodeType::AUDIO;
break;
- case NMSP_PPT|XML_video:
+ case PPT_TOKEN( video ):
nNodeType = AnimationNodeType::AUDIO;
OSL_TRACE( "OOX: video requested, gave Audio instead" );
break;
diff --git a/oox/source/ppt/timetargetelementcontext.cxx b/oox/source/ppt/timetargetelementcontext.cxx
index 9ce47b1b59ca..2a0f61c0c4a3 100644
--- a/oox/source/ppt/timetargetelementcontext.cxx
+++ b/oox/source/ppt/timetargetelementcontext.cxx
@@ -35,9 +35,7 @@
#include <com/sun/star/uno/Any.hxx>
#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
#include "oox/drawingml/embeddedwavaudiofile.hxx"
-#include "tokens.hxx"
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
@@ -68,29 +66,29 @@ namespace oox { namespace ppt {
switch( aElementToken )
{
- case NMSP_PPT|XML_bg:
+ case PPT_TOKEN( bg ):
bTargetSet = true;
maShapeTarget.mnType = XML_bg;
break;
- case NMSP_PPT|XML_txEl:
+ case PPT_TOKEN( txEl ):
bTargetSet = true;
maShapeTarget.mnType = XML_txEl;
break;
- case NMSP_PPT|XML_subSp:
+ case PPT_TOKEN( subSp ):
bTargetSet = true;
maShapeTarget.mnType = XML_subSp;
maShapeTarget.msSubShapeId = xAttribs->getOptionalValue( XML_spid );
break;
- case NMSP_PPT|XML_graphicEl:
- case NMSP_PPT|XML_oleChartEl:
+ case PPT_TOKEN( graphicEl ):
+ case PPT_TOKEN( oleChartEl ):
bTargetSet = true;
// TODO
break;
- case NMSP_PPT|XML_charRg:
- case NMSP_PPT|XML_pRg:
+ case PPT_TOKEN( charRg ):
+ case PPT_TOKEN( pRg ):
if( bTargetSet && maShapeTarget.mnType == XML_txEl )
{
- maShapeTarget.mnRangeType = getToken( aElementToken );
+ maShapeTarget.mnRangeType = getBaseToken( aElementToken );
maShapeTarget.maRange = drawingml::GetIndexRange( xAttribs );
}
break;
@@ -131,7 +129,7 @@ namespace oox { namespace ppt {
switch( aElementToken )
{
- case NMSP_PPT|XML_inkTgt:
+ case PPT_TOKEN( inkTgt ):
{
mpTarget->mnType = XML_inkTgt;
OUString aId = xAttribs->getOptionalValue( XML_spid );
@@ -141,10 +139,10 @@ namespace oox { namespace ppt {
}
break;
}
- case NMSP_PPT|XML_sldTgt:
+ case PPT_TOKEN( sldTgt ):
mpTarget->mnType = XML_sldTgt;
break;
- case NMSP_PPT|XML_sndTgt:
+ case PPT_TOKEN( sndTgt ):
{
mpTarget->mnType = XML_sndTgt;
drawingml::EmbeddedWAVAudioFile aAudio;
@@ -154,7 +152,7 @@ namespace oox { namespace ppt {
mpTarget->msValue = sSndName;
break;
}
- case NMSP_PPT|XML_spTgt:
+ case PPT_TOKEN( spTgt ):
{
mpTarget->mnType = XML_spTgt;
OUString aId = xAttribs->getOptionalValue( XML_spid );
@@ -163,7 +161,7 @@ namespace oox { namespace ppt {
break;
}
default:
- OSL_TRACE( "OOX: unhandled tag %ld in TL_TimeTargetElement.", getToken( aElementToken ) );
+ OSL_TRACE( "OOX: unhandled tag %ld in TL_TimeTargetElement.", getBaseToken( aElementToken ) );
break;
}
diff --git a/oox/source/shape/FastTokenHandlerService.cxx b/oox/source/shape/FastTokenHandlerService.cxx
deleted file mode 100644
index 7ced7d531a1f..000000000000
--- a/oox/source/shape/FastTokenHandlerService.cxx
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include "FastTokenHandlerService.hxx"
-
-namespace oox {
-namespace shape {
-
-using namespace ::com::sun::star;
-
-FastTokenHandlerService::FastTokenHandlerService(uno::Reference< uno::XComponentContext > const & context) :
- m_xContext(context)
-{}
-
-// com.sun.star.uno.XServiceInfo:
-::rtl::OUString SAL_CALL FastTokenHandlerService::getImplementationName() throw (uno::RuntimeException)
-{
- return FastTokenHandlerService_getImplementationName();
-}
-
-::sal_Bool SAL_CALL FastTokenHandlerService::supportsService(::rtl::OUString const & serviceName) throw (uno::RuntimeException)
-{
- uno::Sequence< ::rtl::OUString > serviceNames = FastTokenHandlerService_getSupportedServiceNames();
- for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {
- if (serviceNames[i] == serviceName)
- return sal_True;
- }
- return sal_False;
-}
-
-uno::Sequence< ::rtl::OUString > SAL_CALL FastTokenHandlerService::getSupportedServiceNames() throw (uno::RuntimeException)
-{
- return FastTokenHandlerService_getSupportedServiceNames();
-}
-
-::sal_Int32 SAL_CALL FastTokenHandlerService::getToken(const ::rtl::OUString & Identifier) throw (::com::sun::star::uno::RuntimeException)
-{
- return mFastTokenHandler.getToken(Identifier);
-}
-
-::rtl::OUString SAL_CALL FastTokenHandlerService::getIdentifier(::sal_Int32 Token) throw (::com::sun::star::uno::RuntimeException)
-{
- return mFastTokenHandler.getIdentifier(Token);
-}
-
-::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL FastTokenHandlerService::getUTF8Identifier( ::sal_Int32 Token ) throw (::com::sun::star::uno::RuntimeException)
-{
- return mFastTokenHandler.getUTF8Identifier(Token);
-}
-
-::sal_Int32 SAL_CALL FastTokenHandlerService::getTokenFromUTF8(const ::com::sun::star::uno::Sequence< ::sal_Int8 > & Identifier) throw (::com::sun::star::uno::RuntimeException)
-{
- return mFastTokenHandler.getTokenFromUTF8(Identifier);
-}
-
-::rtl::OUString SAL_CALL FastTokenHandlerService_getImplementationName() {
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.oox.FastTokenHandlerService"));
-}
-
-uno::Sequence< ::rtl::OUString > SAL_CALL FastTokenHandlerService_getSupportedServiceNames()
-{
- uno::Sequence< ::rtl::OUString > s(1);
- s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.xml.sax.FastTokenHandler"));
- return s;
-}
-
-uno::Reference< uno::XInterface > SAL_CALL FastTokenHandlerService_create(
- const uno::Reference< uno::XComponentContext > & context)
- SAL_THROW((uno::Exception))
-{
- return static_cast< ::cppu::OWeakObject * >(new FastTokenHandlerService(context));
-}
-
-uno::Reference< uno::XInterface > SAL_CALL
-FastTokenHandlerService_createInstance
-( const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
-throw( uno::Exception )
-{
- uno::Reference<beans::XPropertySet>
- xPropertySet(rSMgr, uno::UNO_QUERY_THROW);
- uno::Any aDefaultContext = xPropertySet->getPropertyValue
- (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")));
-
- uno::Reference<uno::XComponentContext> xContext;
- aDefaultContext >>= xContext;
-
- return FastTokenHandlerService_create(xContext);
-}
-
-}}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/shape/FastTokenHandlerService.hxx b/oox/source/shape/FastTokenHandlerService.hxx
deleted file mode 100644
index 925f1f512531..000000000000
--- a/oox/source/shape/FastTokenHandlerService.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef OOX_SHAPE_FASTTOKENHANDLERSERVICE_HXX
-#define OOX_SHAPE_FASTTOKENHANDLERSERVICE_HXX
-
-#include <sal/config.h>
-#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implementationentry.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include "oox/core/fasttokenhandler.hxx"
-
-namespace css = ::com::sun::star;
-
-namespace oox {
-namespace shape {
-
-class FastTokenHandlerService:
- public ::cppu::WeakImplHelper2<
- css::lang::XServiceInfo,
- css::xml::sax::XFastTokenHandler>
-{
-public:
- explicit FastTokenHandlerService(css::uno::Reference< css::uno::XComponentContext > const & context);
-
- // ::com::sun::star::lang::XServiceInfo:
- virtual ::rtl::OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString & ServiceName) throw (css::uno::RuntimeException);
- virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException);
-
- // ::com::sun::star::xml::sax::XFastTokenHandler:
- virtual ::sal_Int32 SAL_CALL getToken(const ::rtl::OUString & Identifier) throw (css::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getIdentifier(::sal_Int32 Token) throw (css::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getUTF8Identifier( ::sal_Int32 Token ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL getTokenFromUTF8(const css::uno::Sequence< ::sal_Int8 > & Identifier) throw (css::uno::RuntimeException);
-
-private:
- FastTokenHandlerService(FastTokenHandlerService &); // not defined
- void operator =(FastTokenHandlerService &); // not defined
-
- virtual ~FastTokenHandlerService() {}
-
- css::uno::Reference< css::uno::XComponentContext > m_xContext;
- ::oox::core::FastTokenHandler mFastTokenHandler;
-};
-
-::rtl::OUString SAL_CALL FastTokenHandlerService_getImplementationName();
-
-css::uno::Sequence< ::rtl::OUString > SAL_CALL FastTokenHandlerService_getSupportedServiceNames();
-
-css::uno::Reference< css::uno::XInterface > SAL_CALL _FastTokenHandlerService_create(
- const css::uno::Reference< css::uno::XComponentContext > & context)
- SAL_THROW((css::uno::Exception));
-
-}}
-#endif // OOX_SHAPE_FAST_TOKEN_HANDLER_SERVICE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 41102616566f..0c50a13d9c33 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -30,7 +30,6 @@
#include "oox/vml/vmldrawingfragment.hxx"
#include "oox/vml/vmlshape.hxx"
#include "oox/vml/vmlshapecontainer.hxx"
-#include "tokens.hxx"
namespace oox { namespace shape {
@@ -38,15 +37,34 @@ using namespace ::com::sun::star;
using namespace core;
using namespace drawingml;
+::rtl::OUString SAL_CALL ShapeContextHandler_getImplementationName()
+{
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.ShapeContextHandler" );
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL
+ShapeContextHandler_getSupportedServiceNames()
+{
+ uno::Sequence< ::rtl::OUString > s(1);
+ s[0] = CREATE_OUSTRING( "com.sun.star.xml.sax.FastShapeContextHandler" );
+ return s;
+}
+
+uno::Reference< uno::XInterface > SAL_CALL
+ShapeContextHandler_createInstance( const uno::Reference< uno::XComponentContext > & context)
+ SAL_THROW((uno::Exception))
+{
+ return static_cast< ::cppu::OWeakObject* >( new ShapeContextHandler(context) );
+}
+
+
ShapeContextHandler::ShapeContextHandler
(uno::Reference< uno::XComponentContext > const & context) :
mnStartToken(0), m_xContext(context)
{
try
{
- uno::Reference<lang::XMultiServiceFactory>
- xFactory(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW);
- mxFilterBase.set( new ShapeFilterBase(xFactory) );
+ mxFilterBase.set( new ShapeFilterBase(context) );
}
catch( uno::Exception& )
{
@@ -69,7 +87,7 @@ ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element )
switch (Element & 0xffff)
{
case XML_graphic:
- mpShape.reset(new Shape("com.sun.star.drawing.OLE2Shape" ));
+ mpShape.reset(new Shape("com.sun.star.drawing.GraphicObjectShape" ));
mxGraphicShapeContext.set
(new GraphicalObjectFrameContext(*rFragmentHandler, pMasterShape, mpShape, true));
break;
@@ -106,10 +124,10 @@ ShapeContextHandler::getContextHandler()
{
uno::Reference<xml::sax::XFastContextHandler> xResult;
- switch (mnStartToken & NMSP_MASK)
+ switch (getNamespace( mnStartToken ))
{
- case NMSP_DOC:
- case NMSP_VML:
+ case NMSP_doc:
+ case NMSP_vml:
xResult.set(getDrawingShapeContext());
break;
default:
@@ -324,11 +342,6 @@ uno::Sequence< ::rtl::OUString > ShapeContextHandler::getSupportedServiceNames()
return ShapeContextHandler_getSupportedServiceNames();
}
-::rtl::OUString SAL_CALL ShapeContextHandler_getImplementationName() {
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.oox.ShapeContextHandler"));
-}
-
::sal_Bool SAL_CALL ShapeContextHandler::supportsService
(const ::rtl::OUString & ServiceName) throw (css::uno::RuntimeException)
{
@@ -340,40 +353,6 @@ uno::Sequence< ::rtl::OUString > ShapeContextHandler::getSupportedServiceNames()
return sal_False;
}
-uno::Sequence< ::rtl::OUString > SAL_CALL
-ShapeContextHandler_getSupportedServiceNames()
-{
- uno::Sequence< ::rtl::OUString > s(1);
- s[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.xml.sax.FastShapeContextHandler"));
- return s;
-}
-
-uno::Reference< uno::XInterface > SAL_CALL
-ShapeContextHandler_create(
- const uno::Reference< uno::XComponentContext > & context)
- SAL_THROW((uno::Exception))
-{
- return static_cast< ::cppu::OWeakObject * >
- (new ShapeContextHandler(context));
-}
-
-uno::Reference< uno::XInterface > SAL_CALL
-ShapeContextHandler_createInstance
-( const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
-throw( uno::Exception )
-{
- uno::Reference<beans::XPropertySet>
- xPropertySet(rSMgr, uno::UNO_QUERY_THROW);
- uno::Any aDefaultContext = xPropertySet->getPropertyValue
- (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")));
-
- uno::Reference<uno::XComponentContext> xContext;
- aDefaultContext >>= xContext;
-
- return ShapeContextHandler_create(xContext);
-}
-
}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/shape/ShapeContextHandler.hxx b/oox/source/shape/ShapeContextHandler.hxx
index face8b131adb..df9c3987a2c9 100644
--- a/oox/source/shape/ShapeContextHandler.hxx
+++ b/oox/source/shape/ShapeContextHandler.hxx
@@ -29,10 +29,9 @@
#define OOX_SHAPE_SHAPE_CONTEXT_HANDLER_HXX
#include <boost/shared_ptr.hpp>
-#include "sal/config.h"
-#include "com/sun/star/uno/XComponentContext.hpp"
-#include "cppuhelper/implbase1.hxx"
-#include "com/sun/star/xml/sax/XFastShapeContextHandler.hpp"
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/xml/sax/XFastShapeContextHandler.hpp>
#include "oox/drawingml/graphicshapecontext.hxx"
#include "oox/drawingml/shape.hxx"
#include "oox/drawingml/theme.hxx"
@@ -44,21 +43,6 @@ namespace css = ::com::sun::star;
namespace oox { namespace shape {
-// component and service helper functions:
-::rtl::OUString SAL_CALL ShapeContextHandler_getImplementationName();
-
-css::uno::Sequence< ::rtl::OUString > SAL_CALL
-ShapeContextHandler_getSupportedServiceNames();
-
-css::uno::Reference< css::uno::XInterface > SAL_CALL
-ShapeContextHandler_create
-( css::uno::Reference< css::uno::XComponentContext > const & context );
-
-css::uno::Reference< css::uno::XInterface > SAL_CALL
-ShapeContextHandler_createInstance
-( const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr)
-throw( css::uno::Exception );
-
class ShapeFragmentHandler : public core::FragmentHandler
{
public:
diff --git a/oox/source/shape/ShapeFilterBase.cxx b/oox/source/shape/ShapeFilterBase.cxx
index b390669a18ba..f67be3d0de23 100644
--- a/oox/source/shape/ShapeFilterBase.cxx
+++ b/oox/source/shape/ShapeFilterBase.cxx
@@ -28,17 +28,16 @@
#include "ShapeFilterBase.hxx"
#include "oox/drawingml/chart/chartconverter.hxx"
+#include "oox/ole/vbaproject.hxx"
namespace oox {
namespace shape {
using namespace ::com::sun::star;
-ShapeFilterBase::ShapeFilterBase
-(const uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
- rxFactory)
-: XmlFilterBase(rxFactory)
-, mxChartConv( new ::oox::drawingml::chart::ChartConverter )
+ShapeFilterBase::ShapeFilterBase( const uno::Reference< uno::XComponentContext >& rxContext ) throw( uno::RuntimeException ) :
+ XmlFilterBase( rxContext ),
+ mxChartConv( new ::oox::drawingml::chart::ChartConverter )
{
}
@@ -66,6 +65,11 @@ const ::oox::drawingml::table::TableStyleListPtr ShapeFilterBase::getTableStyles
return *mxChartConv;
}
+::oox::ole::VbaProject* ShapeFilterBase::implCreateVbaProject() const
+{
+ return new ::oox::ole::VbaProject( getComponentContext(), getModel(), CREATE_OUSTRING( "Writer" ) );
+}
+
::rtl::OUString ShapeFilterBase::implGetImplementationName() const
{
return ::rtl::OUString();
diff --git a/oox/source/shape/ShapeFilterBase.hxx b/oox/source/shape/ShapeFilterBase.hxx
index 3bf367185805..e49e98913ff3 100644
--- a/oox/source/shape/ShapeFilterBase.hxx
+++ b/oox/source/shape/ShapeFilterBase.hxx
@@ -46,7 +46,8 @@ public:
typedef boost::shared_ptr<ShapeFilterBase> Pointer_t;
explicit ShapeFilterBase(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ~ShapeFilterBase();
@@ -61,12 +62,13 @@ public:
virtual ::oox::drawingml::chart::ChartConverter& getChartConverter();
- virtual rtl::OUString implGetImplementationName() const;
-
virtual bool importDocument() { return true; }
virtual bool exportDocument() { return true; }
private:
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
+ virtual rtl::OUString implGetImplementationName() const;
+
::boost::shared_ptr< ::oox::drawingml::chart::ChartConverter > mxChartConv;
};
diff --git a/oox/source/shape/makefile.mk b/oox/source/shape/makefile.mk
index f5a3af5542c0..c6534b3a8a6f 100644
--- a/oox/source/shape/makefile.mk
+++ b/oox/source/shape/makefile.mk
@@ -42,8 +42,7 @@ ENABLE_EXCEPTIONS=TRUE
SLOFILES = \
$(SLO)$/ShapeContextHandler.obj \
- $(SLO)$/ShapeFilterBase.obj \
- $(SLO)$/FastTokenHandlerService.obj
+ $(SLO)$/ShapeFilterBase.obj
# --- Targets -------------------------------------------------------
diff --git a/oox/source/token/gennamespaces.pl b/oox/source/token/gennamespaces.pl
deleted file mode 100644
index 2a7f2e2423bb..000000000000
--- a/oox/source/token/gennamespaces.pl
+++ /dev/null
@@ -1,66 +0,0 @@
-$ARGV0 = shift @ARGV;
-$ARGV1 = shift @ARGV;
-
-open ( NAMESPACES, $ARGV0 ) || die "can't open namespaces file: $!";
-
-
-open ( HXX, ">$ARGV1" ) or die "can't open namespaces.hxx file: $!";
-
-print ( HXX "#ifndef OOX_NAMESPACES_HXX\n" );
-print ( HXX "#define OOX_NAMESPACES_HXX\n\n" );
-print ( HXX "#include <sal/types.h>\n\n" );
-print ( HXX "namespace oox {\n\n" );
-
-$group = 0;
-$i = 1;
-while ( <NAMESPACES> )
-{
- chomp( $_ );
- $_ =~ s/\s*//g;
- if ( $_ =~ m/^$/ )
- {
- # Start a new group
- print ( HXX "\n" );
- $i = 0;
- $group++;
- }
- elsif ( $_ =~ m/^[^#]/ )
- {
- # Neither an empty line nor a comment
- $_ =~ /^[a-zA-Z0-9-_]+$/ or die "Invalid namespace token $_";
- $id = "NMSP_$_";
- $id =~ s/-/_/g;
- $no = $group*10 + $i;
- print ( HXX "const sal_Int32 $id = $no << 16;\n" );
- ++$i;
- }
-}
-close ( NAMESPACES );
-
-print ( HXX "\nconst sal_Int32 TOKEN_MASK = SAL_MAX_UINT16;\n" );
-print ( HXX "const sal_Int32 NMSP_MASK = SAL_MAX_INT16 << 16;\n" );
-
-print ( HXX "/** Returns the token identifier of the passed element without namespace. */\n" );
-print ( HXX "inline sal_Int32 getToken( sal_Int32 nElement ) { return nElement & TOKEN_MASK; }\n\n" );
-
-print ( HXX "/** Returns the namespace of the passed element without token identifier. */\n" );
-print ( HXX "inline sal_Int32 getNamespace( sal_Int32 nElement ) { return nElement & NMSP_MASK; }\n\n" );
-
-print ( HXX "// defines for tokens with specific namespaces, can be used in switch/cases\n\n" );
-print ( HXX "#define A_TOKEN( token ) (::oox::NMSP_DRAWINGML | XML_##token)\n" );
-print ( HXX "#define AX_TOKEN( token ) (::oox::NMSP_AX | XML_##token)\n" );
-print ( HXX "#define C_TOKEN( token ) (::oox::NMSP_CHART | XML_##token)\n" );
-print ( HXX "#define CDR_TOKEN( token ) (::oox::NMSP_CDR | XML_##token)\n" );
-print ( HXX "#define O_TOKEN( token ) (::oox::NMSP_OFFICE | XML_##token)\n" );
-print ( HXX "#define PPT_TOKEN( token ) (::oox::NMSP_PPT | XML_##token)\n" );
-print ( HXX "#define R_TOKEN( token ) (::oox::NMSP_RELATIONSHIPS | XML_##token)\n" );
-print ( HXX "#define VML_TOKEN( token ) (::oox::NMSP_VML | XML_##token)\n" );
-print ( HXX "#define VMLX_TOKEN( token ) (::oox::NMSP_VML_XLS | XML_##token)\n" );
-print ( HXX "#define XDR_TOKEN( token ) (::oox::NMSP_XDR | XML_##token)\n" );
-print ( HXX "#define XLS_TOKEN( token ) (::oox::NMSP_XLS | XML_##token)\n" );
-print ( HXX "#define XM_TOKEN( token ) (::oox::NMSP_XM | XML_##token)\n" );
-print ( HXX "#define XML_TOKEN( token ) (::oox::NMSP_XML | XML_##token)\n" );
-
-
-print ( HXX "} // namespace oox\n\n" );
-print ( HXX "#endif // OOX_NAMESPACES_HXX\n" );
diff --git a/oox/source/token/genproperties.pl b/oox/source/token/genproperties.pl
deleted file mode 100644
index 9dbe15c8ac12..000000000000
--- a/oox/source/token/genproperties.pl
+++ /dev/null
@@ -1,46 +0,0 @@
-$ARGV0 = shift @ARGV;
-$ARGV1 = shift @ARGV;
-$ARGV2 = shift @ARGV;
-
-open ( PROPS, $ARGV0 ) || die "can't open properties source file: $!";
-my %props;
-
-while ( <PROPS> )
-{
- chomp( $_ );
- $_ =~ s/\s*//g;
- $_ =~ /^[A-Z][a-zA-Z0-9]*$/ or die "invalid character in property '$_'";
- $id = "PROP_$_";
- $props{$_} = $id;
-}
-close ( TOKENS );
-
-open ( HXX, ">$ARGV1" ) or die "can't open properties.hxx file: $!";
-open ( WORDS, ">$ARGV2" ) or die "can't open propertynames.inc file: $!";
-
-print ( HXX "#ifndef OOX_PROPERTIES_HXX\n" );
-print ( HXX "#define OOX_PROPERTIES_HXX\n\n" );
-print ( HXX "#include <sal/types.h>\n" );
-print ( HXX "namespace oox {\n\n" );
-
-print ( WORDS "static const sal_Char* propertywordlist[] = {\n" );
-
-$i = 0;
-foreach( sort( keys( %props ) ) )
-{
- print ( HXX "const sal_Int32 $props{$_} = $i;\n" );
- print ( WORDS " \"$_\",\n" );
- ++$i;
-}
-
-print ( HXX "const sal_Int32 PROP_COUNT = $i;\n" );
-print ( HXX "const sal_Int32 PROP_INVALID = -1;\n\n" );
-print ( HXX "} // namespace oox\n" );
-print ( HXX "#endif\n" );
-
-print ( WORDS " \"\"\n" );
-print ( WORDS "};\n" );
-
-close ( HXX );
-close ( WORDS );
-
diff --git a/oox/source/token/gentoken.pl b/oox/source/token/gentoken.pl
deleted file mode 100644
index 196ac37ebb5c..000000000000
--- a/oox/source/token/gentoken.pl
+++ /dev/null
@@ -1,61 +0,0 @@
-$ARGV0 = shift @ARGV;
-$ARGV1 = shift @ARGV;
-$ARGV2 = shift @ARGV;
-$ARGV3 = shift @ARGV;
-
-open ( TOKENS, $ARGV0 ) || die "can't open $ARGV0 file: $!";
-my %tokens;
-
-while ( <TOKENS> )
-{
- chomp( $_ );
- $_ =~ s/\s*//g;
- $_ =~ /^[a-zA-Z0-9-_]+$/ or die "invalid character in token '$_'";
- $id = "XML_$_";
- $id =~ s/-/_/g;
- $tokens{$_} = $id;
-}
-close ( TOKENS );
-
-open ( HXX, ">$ARGV1" ) or die "can't open $ARGV1 file: $!";
-open ( WORDS, ">$ARGV2" ) or die "can't open $ARGV2 file: $!";
-open ( GPERF, ">$ARGV3" ) or die "can't open $ARGV3 file: $!";
-
-print ( HXX "#ifndef OOX_TOKENS_HXX\n" );
-print ( HXX "#define OOX_TOKENS_HXX\n\n" );
-print ( HXX "#include <com/sun/star/xml/sax/FastToken.hpp>\n" );
-
-print ( WORDS "static const sal_Char* xmltokenwordlist[] = {\n" );
-
-print ( GPERF "%language=C++\n" );
-print ( GPERF "%global-table\n" );
-print ( GPERF "%null-strings\n" );
-print ( GPERF "%struct-type\n" );
-print ( GPERF "struct xmltoken {\n" );
-print ( GPERF " const sal_Char *name;\n" );
-print ( GPERF " sal_Int32 nToken;\n" );
-print ( GPERF "};\n" );
-print ( GPERF "%%\n" );
-
-$i = 0;
-foreach( sort( keys( %tokens ) ) )
-{
- print ( HXX "const sal_Int32 $tokens{$_} = $i;\n" );
- print ( WORDS " \"$_\",\n" );
- print ( GPERF "$_,$tokens{$_}\n" );
- ++$i;
-}
-
-print ( HXX "const sal_Int32 XML_TOKEN_COUNT = $i;\n" );
-print ( HXX "const sal_Int32 XML_TOKEN_INVALID = ::com::sun::star::xml::sax::FastToken::DONTKNOW;\n\n" );
-print ( HXX "const sal_Int32 XML_ROOT_CONTEXT = SAL_MAX_INT32;\n\n" );
-print ( HXX "#endif\n" );
-
-print ( WORDS " \"\"\n" );
-print ( WORDS "};\n" );
-
-print ( GPERF "%%\n" );
-
-close ( HXX );
-close ( WORDS );
-close ( GPERF );
diff --git a/oox/source/token/makefile.mk b/oox/source/token/makefile.mk
index 07822f698205..ff42967f0bb1 100644
--- a/oox/source/token/makefile.mk
+++ b/oox/source/token/makefile.mk
@@ -39,40 +39,40 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
-SLOFILES = \
- $(SLO)$/propertylist.obj \
- $(SLO)$/tokenmap.obj
+SLOFILES = \
+ $(SLO)$/namespacemap.obj \
+ $(SLO)$/propertynames.obj \
+ $(SLO)$/tokenmap.obj
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
-$(MISC)$/tokens.gperf $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx $(INCCOM)$/propertywords.inc $(INCCOM)$/properties.hxx $(INCCOM)$/oox$/core$/namespaces.hxx :
- @@noop $(assign do_phony:=.PHONY)
+GENHEADERPATH = $(INCCOM)$/oox$/token
-$(MISC)$/do_tokens $(do_phony) : tokens.txt gentoken.pl $(MISC)$/tokens.gperf $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx
- @@-$(RM) $@
- $(PERL) gentoken.pl tokens.txt $(INCCOM)$/tokens.hxx $(INCCOM)$/tokenwords.inc $(MISC)$/tokens.gperf && $(TOUCH) $@
+$(MISC)$/tokenhash.gperf $(INCCOM)$/tokennames.inc $(GENHEADERPATH)$/tokens.hxx $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt $(GENHEADERPATH)$/namespaces.hxx $(INCCOM)$/propertynames.inc $(GENHEADERPATH)$/properties.hxx :
+ @@noop $(assign do_phony:=.PHONY)
-$(INCCOM)$/oox:
- $(MKDIR) $(INCCOM)$/oox
+$(SLO)$/tokenmap.obj : $(INCCOM)$/tokenhash.inc $(INCCOM)$/tokennames.inc $(GENHEADERPATH)$/tokens.hxx $(MISC)$/do_tokens
-$(INCCOM)$/oox$/core: $(INCCOM)$/oox
- $(MKDIR) $(INCCOM)$/oox$/core
+$(INCCOM)$/tokenhash.inc : $(MISC)$/tokenhash.gperf $(MISC)$/do_tokens
+ $(AUGMENT_LIBRARY_PATH) gperf --compare-strncmp $(MISC)$/tokenhash.gperf | $(SED) -e "s/(char\*)0/(char\*)0, 0/g" | $(GREP) -v "^#line" >$(INCCOM)$/tokenhash.inc
-$(MISC)$/do_namespaces $(do_phony) : namespaces.txt gennamespaces.pl
+$(MISC)$/do_tokens $(do_phony) : tokens.txt tokens.pl tokens.hxx.head tokens.hxx.tail $(GENHEADERPATH)$/tokens.hxx $(INCCOM)$/tokennames.inc $(MISC)$/tokenhash.gperf
@@-$(RM) $@
- $(MKDIRHIER) $(INCCOM)$/oox$/core
- $(PERL) gennamespaces.pl namespaces.txt $(INCCOM)$/oox$/core$/namespaces.hxx && $(TOUCH) $@
+ $(MKDIRHIER) $(GENHEADERPATH)
+ $(PERL) tokens.pl tokens.txt $(MISC)$/tokenids.inc $(INCCOM)$/tokennames.inc $(MISC)$/tokenhash.gperf && $(TYPE) tokens.hxx.head $(MISC)$/tokenids.inc tokens.hxx.tail > $(GENHEADERPATH)$/tokens.hxx && $(TOUCH) $@
-$(INCCOM)$/tokens.inc : $(MISC)$/tokens.gperf $(MISC)$/do_tokens
- $(AUGMENT_LIBRARY_PATH) $(GPERF) --compare-strncmp $(MISC)$/tokens.gperf | $(SED) -e "s/(char\*)0/(char\*)0, 0/g" | $(GREP) -v "^#line" >$(INCCOM)$/tokens.inc
+$(SLO)$/namespacemap.obj : $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt $(GENHEADERPATH)$/namespaces.hxx $(MISC)$/do_namespaces
-$(SLO)$/tokenmap.obj : $(INCCOM)$/tokens.inc $(INCCOM)$/tokenwords.inc $(INCCOM)$/tokens.hxx $(INCCOM)$/oox$/core$/namespaces.hxx $(MISC)$/do_tokens $(MISC)$/do_namespaces
-
-$(MISC)$/do_properties $(do_phony) : properties.txt genproperties.pl $(INCCOM)$/properties.hxx $(INCCOM)$/propertywords.inc
+$(MISC)$/do_namespaces $(do_phony) : namespaces.txt namespaces.pl namespaces.hxx.head namespaces.hxx.tail $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt $(GENHEADERPATH)$/namespaces.hxx
@@-$(RM) $@
- $(PERL) genproperties.pl properties.txt $(INCCOM)$/properties.hxx $(INCCOM)$/propertywords.inc && $(TOUCH) $@
+ $(MKDIRHIER) $(GENHEADERPATH)
+ $(PERL) namespaces.pl namespaces.txt $(MISC)$/namespaceids.inc $(INCCOM)$/namespacenames.inc $(MISC)$/namespaces.txt && $(TYPE) namespaces.hxx.head $(MISC)$/namespaceids.inc namespaces.hxx.tail > $(GENHEADERPATH)$/namespaces.hxx && $(TOUCH) $@
-$(SLO)$/propertylist.obj : $(INCCOM)$/propertywords.inc $(INCCOM)$/properties.hxx $(MISC)$/do_properties
+$(SLO)$/propertynames.obj : $(INCCOM)$/propertynames.inc $(GENHEADERPATH)$/properties.hxx $(MISC)$/do_properties
+$(MISC)$/do_properties $(do_phony) : properties.txt properties.pl properties.hxx.head properties.hxx.tail $(INCCOM)$/propertynames.inc $(GENHEADERPATH)$/properties.hxx
+ @@-$(RM) $@
+ $(MKDIRHIER) $(GENHEADERPATH)
+ $(PERL) properties.pl properties.txt $(MISC)$/propertyids.inc $(INCCOM)$/propertynames.inc && $(TYPE) properties.hxx.head $(MISC)$/propertyids.inc properties.hxx.tail > $(GENHEADERPATH)$/properties.hxx && $(TOUCH) $@
diff --git a/oox/source/token/propertylist.cxx b/oox/source/token/namespacemap.cxx
index 805ec748295c..a919876489b2 100644..100755
--- a/oox/source/token/propertylist.cxx
+++ b/oox/source/token/namespacemap.cxx
@@ -26,33 +26,25 @@
*
************************************************************************/
-#include "oox/token/propertylist.hxx"
-#include "properties.hxx"
+#include "oox/token/namespacemap.hxx"
namespace oox {
-namespace {
-
-// include auto-generated property name lists
-#include "propertywords.inc"
-
-} // namespace
-
// ============================================================================
-PropertyList::PropertyList()
-{
- reserve( static_cast< size_t >( PROP_COUNT ) );
- for( sal_Int32 nIdx = 0; nIdx < PROP_COUNT; ++nIdx )
- push_back( ::rtl::OUString::createFromAscii( propertywordlist[ nIdx ] ) );
-}
-
-PropertyList::~PropertyList()
+NamespaceMap::NamespaceMap()
{
+ static const struct NamespaceUrl { sal_Int32 mnId; const sal_Char* mpcUrl; } spNamespaceUrls[] =
+ {
+// include auto-generated C array with namespace URLs as C strings
+#include "namespacenames.inc"
+ { -1, "" }
+ };
+
+ for( const NamespaceUrl* pNamespaceUrl = spNamespaceUrls; pNamespaceUrl->mnId != -1; ++pNamespaceUrl )
+ operator[]( pNamespaceUrl->mnId ) = ::rtl::OUString::createFromAscii( pNamespaceUrl->mpcUrl );
}
// ============================================================================
-} // namespace oox
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/token/namespaces.hxx.head b/oox/source/token/namespaces.hxx.head
new file mode 100755
index 000000000000..351bf2558303
--- /dev/null
+++ b/oox/source/token/namespaces.hxx.head
@@ -0,0 +1,36 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_TOKEN_NAMESPACES_HXX
+#define OOX_TOKEN_NAMESPACES_HXX
+
+#include <sal/types.h>
+
+namespace oox {
+
+// ============================================================================
+
diff --git a/oox/source/token/namespaces.hxx.tail b/oox/source/token/namespaces.hxx.tail
new file mode 100755
index 000000000000..651fc38511d4
--- /dev/null
+++ b/oox/source/token/namespaces.hxx.tail
@@ -0,0 +1,35 @@
+
+// ============================================================================
+
+const sal_Int32 TOKEN_MASK = static_cast< sal_Int32 >( (1 << NMSP_SHIFT) - 1 );
+const sal_Int32 NMSP_MASK = static_cast< sal_Int32 >( SAL_MAX_INT16 & ~TOKEN_MASK );
+
+/** Returns the raw token identifier without namespace of the passed token. */
+inline sal_Int32 getBaseToken( sal_Int32 nToken ) { return nToken & TOKEN_MASK; }
+
+/** Returns the namespace without token identifier of the passed token. */
+inline sal_Int32 getNamespace( sal_Int32 nToken ) { return nToken & NMSP_MASK; }
+
+// defines for tokens with specific namespaces
+#define A_TOKEN( token ) (::oox::NMSP_dml | XML_##token)
+#define AX_TOKEN( token ) (::oox::NMSP_ax | XML_##token)
+#define C_TOKEN( token ) (::oox::NMSP_dmlChart | XML_##token)
+#define CDR_TOKEN( token ) (::oox::NMSP_dmlChartDr | XML_##token)
+#define DGM_TOKEN( token ) (::oox::NMSP_dmlDiagram | XML_##token)
+#define O_TOKEN( token ) (::oox::NMSP_vmlOffice | XML_##token)
+#define PC_TOKEN( token ) (::oox::NMSP_packageContentTypes | XML_##token)
+#define PPT_TOKEN( token ) (::oox::NMSP_ppt | XML_##token)
+#define PR_TOKEN( token ) (::oox::NMSP_packageRel | XML_##token)
+#define R_TOKEN( token ) (::oox::NMSP_officeRel | XML_##token)
+#define VML_TOKEN( token ) (::oox::NMSP_vml | XML_##token)
+#define VMLX_TOKEN( token ) (::oox::NMSP_vmlExcel | XML_##token)
+#define XDR_TOKEN( token ) (::oox::NMSP_dmlSpreadDr | XML_##token)
+#define XLS_TOKEN( token ) (::oox::NMSP_xls | XML_##token)
+#define XM_TOKEN( token ) (::oox::NMSP_xm | XML_##token)
+#define XML_TOKEN( token ) (::oox::NMSP_xml | XML_##token)
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
diff --git a/oox/source/token/namespaces.pl b/oox/source/token/namespaces.pl
new file mode 100644
index 000000000000..3c741fa7b2af
--- /dev/null
+++ b/oox/source/token/namespaces.pl
@@ -0,0 +1,79 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+$ARGV0 = shift @ARGV;
+$ARGV1 = shift @ARGV;
+$ARGV2 = shift @ARGV;
+$ARGV3 = shift @ARGV;
+
+# parse input file
+
+open( INFILE, $ARGV0 ) or die "cannot open input file: $!";
+my %namespaces;
+while( <INFILE> )
+{
+ # trim newline
+ chomp( $_ );
+ # trim leading/trailing whitespace
+ $_ =~ s/^\s*//g;
+ $_ =~ s/\s*$//g;
+ # trim comments
+ $_ =~ s/^#.*//;
+ # skip empty lines
+ if( $_ )
+ {
+ # check for valid characters
+ $_ =~ /^([a-zA-Z]+)\s+([a-zA-Z0-9-.:\/]+)\s*$/ or die "Error: invalid character in input data";
+ $namespaces{$1} = $2;
+ }
+}
+close( INFILE );
+
+# generate output files
+
+open( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!";
+open( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!";
+open( TXTFILE, ">$ARGV3" ) or die "Error: cannot open output file: $!";
+
+# number of bits to shift the namespace identifier
+$shift = 16;
+
+print ( IDFILE "const size_t NMSP_SHIFT = $shift;\n" );
+
+$i = 1;
+foreach( keys( %namespaces ) )
+{
+ print( IDFILE "const sal_Int32 NMSP_$_ = $i << NMSP_SHIFT;\n" );
+ $id = $i << $shift;
+ print( NAMEFILE "{ $id, \"$namespaces{$_}\" },\n" );
+ print( TXTFILE "$id $_ $namespaces{$_}\n" );
+ ++$i;
+}
+
+close( IDFILE );
+close( nameFILE );
+close( TXTFILE );
diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt
index 45bb59541b1b..81b568067470 100644
--- a/oox/source/token/namespaces.txt
+++ b/oox/source/token/namespaces.txt
@@ -1,49 +1,52 @@
-# Relations, XML
-XML
-PACKAGE_RELATIONSHIPS
-RELATIONSHIPS
-CONTENT_TYPES
-
-# Office global
-THEME
-ACTIVATION
-MATH
-
-#DrawingML
-DRAWINGML
-PICTURE
-DIAGRAM
-CHART
-CDR
-DOC_DRAWINGML
-
-# VML
-VML
-OFFICE
-VML_DOC
-VML_XLS
-VML_PPT
-AX
-
-#SpreadsheetML
-XLS
-XDR
-XM
-
-#PresentationML
-PPT
-
-#WordprocessingML
-DOC
-SML
-
-# Document properties
-COREPR
-DC
-DCTERMS
-EXTPR
-CUSTPR
-VT
-
-# Other elements: used by writerfilter
-SPRM
+
+# generic XML -----------------------------------------------------------------
+
+xml http://www.w3.org/XML/1998/namespace
+schema http://schemas.openxmlformats.org/schemaLibrary/2006/main
+
+# package ---------------------------------------------------------------------
+
+packageContentTypes http://schemas.openxmlformats.org/package/2006/content-types
+packageMetaCorePr http://schemas.openxmlformats.org/package/2006/metadata/core-properties
+packageRel http://schemas.openxmlformats.org/package/2006/relationships
+
+# office shared ---------------------------------------------------------------
+
+officeCustomPr http://schemas.openxmlformats.org/officeDocument/2006/custom-properties
+officeDocPropsVT http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes
+officeExtPr http://schemas.openxmlformats.org/officeDocument/2006/extended-properties
+officeMath http://schemas.openxmlformats.org/officeDocument/2006/math
+officeRel http://schemas.openxmlformats.org/officeDocument/2006/relationships
+officeRelTheme http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme
+
+# applications ----------------------------------------------------------------
+
+doc http://schemas.openxmlformats.org/wordprocessingml/2006/main
+xls http://schemas.openxmlformats.org/spreadsheetml/2006/main
+ppt http://schemas.openxmlformats.org/presentationml/2006/main
+
+# drawing ---------------------------------------------------------------------
+
+dml http://schemas.openxmlformats.org/drawingml/2006/main
+dmlChart http://schemas.openxmlformats.org/drawingml/2006/chart
+dmlChartDr http://schemas.openxmlformats.org/drawingml/2006/chartDrawing
+dmlDiagram http://schemas.openxmlformats.org/drawingml/2006/diagram
+dmlPicture http://schemas.openxmlformats.org/drawingml/2006/picture
+dmlSpreadDr http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing
+dmlWordDr http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
+
+# VML -------------------------------------------------------------------------
+
+vml urn:schemas-microsoft-com:vml
+vmlExcel urn:schemas-microsoft-com:office:excel
+vmlOffice urn:schemas-microsoft-com:office:office
+vmlPowerpoint urn:schemas-microsoft-com:office:powerpoint
+vmlWord urn:schemas-microsoft-com:office:word
+
+# other -----------------------------------------------------------------------
+
+ax http://schemas.microsoft.com/office/2006/activeX
+dc http://purl.org/dc/elements/1.1/
+dcTerms http://purl.org/dc/terms/
+xm http://schemas.microsoft.com/office/excel/2006/main
+sprm http://sprm
diff --git a/oox/source/token/parsexsd.pl b/oox/source/token/parsexsd.pl
index 3b6745121e4c..8fed059bbc44 100644
--- a/oox/source/token/parsexsd.pl
+++ b/oox/source/token/parsexsd.pl
@@ -1,3 +1,30 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
$ARGV = shift @ARGV;
my %tokens;
diff --git a/oox/source/token/properties.hxx.head b/oox/source/token/properties.hxx.head
new file mode 100755
index 000000000000..25817b5e72f3
--- /dev/null
+++ b/oox/source/token/properties.hxx.head
@@ -0,0 +1,36 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_TOKEN_PROPERTIES_HXX
+#define OOX_TOKEN_PROPERTIES_HXX
+
+#include <sal/types.h>
+
+namespace oox {
+
+// ============================================================================
+
diff --git a/oox/source/token/properties.hxx.tail b/oox/source/token/properties.hxx.tail
new file mode 100755
index 000000000000..f647337e529c
--- /dev/null
+++ b/oox/source/token/properties.hxx.tail
@@ -0,0 +1,6 @@
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
diff --git a/oox/source/token/properties.pl b/oox/source/token/properties.pl
new file mode 100644
index 000000000000..f341924bbb90
--- /dev/null
+++ b/oox/source/token/properties.pl
@@ -0,0 +1,67 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+$ARGV0 = shift @ARGV;
+$ARGV1 = shift @ARGV;
+$ARGV2 = shift @ARGV;
+
+# parse input file
+
+open( INFILE, $ARGV0 ) or die "Error: cannot open input file: $!";
+my %props;
+while( <INFILE> )
+{
+ # trim newline
+ chomp( $_ );
+ # trim leading/trailing whitespace
+ $_ =~ s/^\s*//g;
+ $_ =~ s/\s*$//g;
+ # check for valid characters
+ $_ =~ /^[A-Z][a-zA-Z0-9]*$/ or die "Error: invalid character in property '$_'";
+ $id = "PROP_$_";
+ $props{$_} = $id;
+}
+close( INFILE );
+
+# generate output files
+
+open( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!";
+open( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!";
+
+$i = 0;
+foreach( sort( keys( %props ) ) )
+{
+ print( IDFILE "const sal_Int32 $props{$_} = $i;\n" );
+ print( NAMEFILE "/* $i */ \"$_\",\n" );
+ ++$i;
+}
+
+print( IDFILE "const sal_Int32 PROP_COUNT = $i;\n" );
+print( IDFILE "const sal_Int32 PROP_INVALID = -1;\n" );
+
+close( IDFILE );
+close( NAMEFILE );
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index e8c33b4fc71a..f8447b64a4a7 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -2,6 +2,7 @@ AbsoluteName
Action
ActiveSplitRange
ActiveTable
+Address
Adjust
AdjustContrast
AdjustLuminance
@@ -9,6 +10,8 @@ AdjustmentValues
Address
Align
AnchorPosition
+ApplyFormDesignMode
+AreaLinks
ArrangeOrder
Aspect
AttachedAxisIndex
@@ -89,6 +92,7 @@ ContainsHeader
Coordinates
CopyBack
CopyFormulas
+CopyOutputData
CopyStyles
CrossoverPosition
CrossoverValue
@@ -106,14 +110,16 @@ D3DSceneShadeMode
DDELinks
DatabaseRanges
Decoration
-DefaultContext
DefaultScrollValue
DefaultSpinValue
DefaultState
DefaultText
+DefaultValue
DiagonalBLTR
DiagonalTLBR
DialogLibraries
+DisableComplexChartTypes
+DisableDataTableDialog
DisplayLabels
DrillDownOnDoubleClick
Dropdown
@@ -146,6 +152,9 @@ FillGradient
FillGradientName
FillStyle
FillTransparence
+Filter
+FilterCriteriaSource
+FilterOptions
FirstLineOffset
FirstPageNumber
FocusOnClick
@@ -169,6 +178,7 @@ Geometry3D
GradientName
Graphic
GraphicColorMode
+GraphicCrop
GraphicSize
GraphicURL
GridColor
@@ -211,6 +221,7 @@ InputMessage
InputTitle
IsActive
IsAdjustHeightEnabled
+IsCaseSensitive
IsCellBackgroundTransparent
IsChangeReadOnlyEnabled
IsDate
@@ -284,6 +295,7 @@ NumberingType
Offset
OpCodeMap
Orientation
+OutputPosition
OverlapSequence
PageScale
PageStyle
@@ -336,10 +348,12 @@ RefY
Reference
ReferenceDevice
ReferenceSheet
+RefreshPeriod
RegularExpressions
RelId
RelativeHorizontalTabbarWidth
RelativePosition
+RelativeSize
Repeat
RepeatDelay
Representation
@@ -355,6 +369,7 @@ RotationHorizontal
RotationVertical
RowGrand
RowLabelRanges
+SaveOutputPosition
ScaleMode
ScaleToPages
ScaleToPagesX
@@ -387,11 +402,15 @@ ShowPositiveError
ShowZeroValues
ShrinkToFit
Size
+Size100thMM
+SizePixel
SizeProtect
+SkipDuplicates
SortInfo
Sound
SoundOn
Speed
+Spin
SpinIncrement
SpinValue
SpinValueMax
@@ -445,11 +464,14 @@ Transparency
TriState
Type
URL
+Url
+UseFilterCriteriaSource
UseRegularExpressions
UseRings
UseSelectedPage
VScroll
Validation
+Value
VaryColorsByPoint
VertJustify
VertJustifyMethod
diff --git a/oox/inc/oox/helper/recordinputstream.hxx b/oox/source/token/propertynames.cxx
index 4fe8f0d21bfa..3ee69fc7728b 100644
--- a/oox/inc/oox/helper/recordinputstream.hxx
+++ b/oox/source/token/propertynames.cxx
@@ -26,35 +26,29 @@
*
************************************************************************/
-#ifndef OOX_HELPER_RECORDINPUTSTREAM_HXX
-#define OOX_HELPER_RECORDINPUTSTREAM_HXX
-
-#include "oox/helper/binaryinputstream.hxx"
+#include "oox/token/propertynames.hxx"
namespace oox {
// ============================================================================
-/** Reads the contents of a record from a binary OOBIN stream. */
-class RecordInputStream : public SequenceInputStream
+PropertyNameVector::PropertyNameVector()
{
-public:
- explicit RecordInputStream( const StreamDataSequence& rData );
-
- /** Reads a string with leading 16-bit or 32-bit length field. */
- ::rtl::OUString readString( bool b32BitLen = true );
-
- /** Stream operator for integral types. */
- template< typename Type >
- inline RecordInputStream& operator>>( Type& ornValue ) { readValue( ornValue ); return *this; }
- /** Stream operator for an ::rtl::OUString, reads 32-bit string length and Unicode array. */
- inline RecordInputStream& operator>>( ::rtl::OUString& orString ) { orString = readString(); return *this; }
-};
+ static const sal_Char* sppcPropertyNames[] =
+ {
+ // include auto-generated C array with property names as C strings
+#include "propertynames.inc"
+ ""
+ };
+
+ size_t nArraySize = (sizeof( sppcPropertyNames ) / sizeof( *sppcPropertyNames )) - 1;
+ reserve( nArraySize );
+ for( size_t nIndex = 0; nIndex < nArraySize; ++nIndex )
+ push_back( ::rtl::OUString::createFromAscii( sppcPropertyNames[ nIndex ] ) );
+}
// ============================================================================
} // namespace oox
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/token/tokenmap.cxx b/oox/source/token/tokenmap.cxx
index c62fe2277b52..4b79d9279432 100644
--- a/oox/source/token/tokenmap.cxx
+++ b/oox/source/token/tokenmap.cxx
@@ -27,26 +27,24 @@
************************************************************************/
#include "oox/token/tokenmap.hxx"
+
#include <string.h>
#include <rtl/strbuf.hxx>
#include <rtl/string.hxx>
-#include "tokens.hxx"
-#include "oox/helper/containerhelper.hxx"
+#include "oox/token/tokens.hxx"
+
+namespace oox {
+// ============================================================================
+using ::com::sun::star::uno::Sequence;
using ::rtl::OString;
using ::rtl::OUString;
-using ::com::sun::star::uno::Sequence;
-
-namespace oox {
// ============================================================================
namespace {
-
-// include auto-generated token lists
-#include "tokens.inc"
-#include "tokenwords.inc"
-
+// include auto-generated Perfect_Hash
+#include "tokenhash.inc"
} // namespace
// ============================================================================
@@ -54,10 +52,17 @@ namespace {
TokenMap::TokenMap() :
maTokenNames( static_cast< size_t >( XML_TOKEN_COUNT ) )
{
- const sal_Char* const* ppcTokenWord = xmltokenwordlist;
- for( TokenNameVector::iterator aIt = maTokenNames.begin(), aEnd = maTokenNames.end(); aIt != aEnd; ++aIt, ++ppcTokenWord )
+ static const sal_Char* sppcTokenNames[] =
+ {
+// include auto-generated C array with token names as C strings
+#include "tokennames.inc"
+ ""
+ };
+
+ const sal_Char* const* ppcTokenName = sppcTokenNames;
+ for( TokenNameVector::iterator aIt = maTokenNames.begin(), aEnd = maTokenNames.end(); aIt != aEnd; ++aIt, ++ppcTokenName )
{
- OString aUtf8Token( *ppcTokenWord );
+ OString aUtf8Token( *ppcTokenName );
aIt->maUniName = OStringToOUString( aUtf8Token, RTL_TEXTENCODING_UTF8 );
aIt->maUtf8Name = Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aUtf8Token.getStr() ), aUtf8Token.getLength() );
}
@@ -71,7 +76,7 @@ TokenMap::TokenMap() :
OString aUtf8Name = OUStringToOString( maTokenNames[ nToken ].maUniName, RTL_TEXTENCODING_UTF8 );
struct xmltoken* pToken = Perfect_Hash::in_word_set( aUtf8Name.getStr(), aUtf8Name.getLength() );
bOk = pToken && (pToken->nToken == nToken);
- OSL_ENSURE( bOk, ::rtl::OStringBuffer( "FastTokenHandler::FastTokenHandler - token list broken, #" ).
+ OSL_ENSURE( bOk, ::rtl::OStringBuffer( "TokenMap::TokenMap - token list broken, #" ).
append( nToken ).append( ", '" ).append( aUtf8Name ).append( '\'' ).getStr() );
}
#endif
@@ -83,8 +88,9 @@ TokenMap::~TokenMap()
OUString TokenMap::getUnicodeTokenName( sal_Int32 nToken ) const
{
- const TokenName* pTokenName = ContainerHelper::getVectorElement( maTokenNames, nToken );
- return pTokenName ? pTokenName->maUniName : OUString();
+ if( (0 <= nToken) && (static_cast< size_t >( nToken ) < maTokenNames.size()) )
+ return maTokenNames[ static_cast< size_t >( nToken ) ].maUniName;
+ return OUString();
}
sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const
@@ -96,8 +102,9 @@ sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const
Sequence< sal_Int8 > TokenMap::getUtf8TokenName( sal_Int32 nToken ) const
{
- const TokenName* pTokenName = ContainerHelper::getVectorElement( maTokenNames, nToken );
- return pTokenName ? pTokenName->maUtf8Name : Sequence< sal_Int8 >();
+ if( (0 <= nToken) && (static_cast< size_t >( nToken ) < maTokenNames.size()) )
+ return maTokenNames[ static_cast< size_t >( nToken ) ].maUtf8Name;
+ return Sequence< sal_Int8 >();
}
sal_Int32 TokenMap::getTokenFromUtf8( const Sequence< sal_Int8 >& rUtf8Name ) const
@@ -111,4 +118,4 @@ sal_Int32 TokenMap::getTokenFromUtf8( const Sequence< sal_Int8 >& rUtf8Name ) co
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/token/tokens.hxx.head b/oox/source/token/tokens.hxx.head
new file mode 100755
index 000000000000..dd201caeb1d9
--- /dev/null
+++ b/oox/source/token/tokens.hxx.head
@@ -0,0 +1,36 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef OOX_TOKEN_TOKENS_HXX
+#define OOX_TOKEN_TOKENS_HXX
+
+#include <com/sun/star/xml/sax/FastToken.hpp>
+
+namespace oox {
+
+// ============================================================================
+
diff --git a/oox/source/token/tokens.hxx.tail b/oox/source/token/tokens.hxx.tail
new file mode 100755
index 000000000000..df4b5ef1a955
--- /dev/null
+++ b/oox/source/token/tokens.hxx.tail
@@ -0,0 +1,8 @@
+
+const sal_Int32 XML_TOKEN_INVALID = ::com::sun::star::xml::sax::FastToken::DONTKNOW;
+
+// ============================================================================
+
+} // namespace oox
+
+#endif
diff --git a/oox/source/token/tokens.pl b/oox/source/token/tokens.pl
new file mode 100644
index 000000000000..a951cee80db2
--- /dev/null
+++ b/oox/source/token/tokens.pl
@@ -0,0 +1,80 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+$ARGV0 = shift @ARGV;
+$ARGV1 = shift @ARGV;
+$ARGV2 = shift @ARGV;
+$ARGV3 = shift @ARGV;
+
+open( INFILE, $ARGV0 ) or die "Error: cannot open input file: $!";
+my %tokens;
+while ( <INFILE> )
+{
+ # trim newline
+ chomp( $_ );
+ # trim leading/trailing whitespace
+ $_ =~ s/^\s*//g;
+ $_ =~ s/\s*$//g;
+ # check for valid characters
+ $_ =~ /^[a-zA-Z0-9-_]+$/ or die "Error: invalid character in token '$_'";
+ $id = "XML_$_";
+ $id =~ s/-/_/g;
+ $tokens{$_} = $id;
+}
+close ( INFILE );
+
+# generate output files
+
+open ( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!";
+open ( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!";
+open ( GPERFFILE, ">$ARGV3" ) or die "Error: cannot open output file: $!";
+
+print( GPERFFILE "%language=C++\n" );
+print( GPERFFILE "%global-table\n" );
+print( GPERFFILE "%null-strings\n" );
+print( GPERFFILE "%struct-type\n" );
+print( GPERFFILE "struct xmltoken {\n" );
+print( GPERFFILE " const sal_Char *name;\n" );
+print( GPERFFILE " sal_Int32 nToken;\n" );
+print( GPERFFILE "};\n" );
+print( GPERFFILE "%%\n" );
+
+$i = 0;
+foreach( sort( keys( %tokens ) ) )
+{
+ print( IDFILE "const sal_Int32 $tokens{$_} = $i;\n" );
+ print( NAMEFILE "\"$_\",\n" );
+ print( GPERFFILE "$_,$tokens{$_}\n" );
+ ++$i;
+}
+
+print( IDFILE "const sal_Int32 XML_TOKEN_COUNT = $i;\n" );
+print( GPERFFILE "%%\n" );
+
+close( IDFILE );
+close( NAMEFILE );
+close( GPERFFILE );
diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt
index 34c447825c10..ab0332163cd7 100644
--- a/oox/source/token/tokens.txt
+++ b/oox/source/token/tokens.txt
@@ -63,6 +63,7 @@ BookSection
BookTitle
BorderColor
BorderStyle
+Bottom
BroadcastTitle
Broadcaster
Button
@@ -72,6 +73,7 @@ Cancel
Caption
Case
CaseNumber
+Center
ChapterNumber
Characters
CharactersWithSpaces
@@ -82,6 +84,8 @@ ClientData
ColHidden
Colored
Column
+Combo
+ComboEdit
Comments
Company
Compiler
@@ -116,6 +120,7 @@ Director
Disabled
Dismiss
DisplayStyle
+Distributed
Distributor
DocSecurity
DocumentFromInternetSite
@@ -134,6 +139,7 @@ Editor
ElectronicSource
Embed
EnhancedMetaFile
+Extend
Extension
External
False
@@ -190,11 +196,13 @@ Issue
JournalArticle
JournalName
JustLastX
+Justify
LCID
LCT
Label
LargeChange
Last
+Left
LineA
Lines
Link
@@ -239,6 +247,7 @@ MouseIcon
MousePointer
MoveWithCells
Movie
+Multi
MultiLine
MultiSel
MultiSelect
@@ -315,6 +324,7 @@ Relationships
RelationshipsGroupReference
Report
Reporter
+Right
RootElement
Row
RowHidden
@@ -340,6 +350,8 @@ ShortTitle
ShowDropButtonWhen
ShowImportExportValidationErrors
SignatureTime
+Simple
+Single
Size
SizeMode
SizeWithCells
@@ -367,6 +379,7 @@ Theater
ThesisType
Title
TitlesOfParts
+Top
TotalTime
Translator
True
@@ -2098,6 +2111,7 @@ fNode
fPr
fPrintsWithSheet
fPublished
+face
facet
fact
factor
@@ -2260,6 +2274,7 @@ followColorScheme
followSib
followedHyperlink
font
+font4
fontAlgn
fontColor
fontId
diff --git a/oox/source/vml/makefile.mk b/oox/source/vml/makefile.mk
index 2b47a1c930db..094d37cd8c1c 100644
--- a/oox/source/vml/makefile.mk
+++ b/oox/source/vml/makefile.mk
@@ -41,13 +41,15 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
SLOFILES = \
- $(SLO)$/vmldrawing.obj \
- $(SLO)$/vmldrawingfragment.obj \
- $(SLO)$/vmlformatting.obj \
- $(SLO)$/vmlinputstream.obj \
- $(SLO)$/vmlshape.obj \
- $(SLO)$/vmlshapecontainer.obj \
- $(SLO)$/vmlshapecontext.obj
+ $(SLO)$/vmldrawing.obj \
+ $(SLO)$/vmldrawingfragment.obj \
+ $(SLO)$/vmlformatting.obj \
+ $(SLO)$/vmlinputstream.obj \
+ $(SLO)$/vmlshape.obj \
+ $(SLO)$/vmlshapecontainer.obj \
+ $(SLO)$/vmlshapecontext.obj \
+ $(SLO)$/vmltextbox.obj \
+ $(SLO)$/vmltextboxcontext.obj
# --- Targets -------------------------------------------------------
diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx
index 61dfd4b6c362..ca2d362d11d8 100644
--- a/oox/source/vml/vmldrawing.cxx
+++ b/oox/source/vml/vmldrawing.cxx
@@ -27,28 +27,32 @@
************************************************************************/
#include "oox/vml/vmldrawing.hxx"
+
+#include <algorithm>
+#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
-#include "tokens.hxx"
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include "oox/core/xmlfilterbase.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/ole/axcontrol.hxx"
#include "oox/vml/vmlshape.hxx"
#include "oox/vml/vmlshapecontainer.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::awt::XControlModel;
-using ::com::sun::star::drawing::XDrawPage;
-using ::com::sun::star::drawing::XShape;
-using ::com::sun::star::drawing::XShapes;
-using ::oox::core::XmlFilterBase;
-
namespace oox {
namespace vml {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::XmlFilterBase;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
/** Returns the textual representation of a numeric VML shape identifier. */
@@ -58,6 +62,13 @@ OUString lclGetShapeId( sal_Int32 nShapeId )
return CREATE_OUSTRING( "\0s" ) + OUString::valueOf( nShapeId );
}
+/** Returns the numeric VML shape identifier from its textual representation. */
+sal_Int32 lclGetShapeId( const OUString& rShapeId )
+{
+ // identifier consists of a literal NUL character, a lowercase 's', and the id
+ return ((rShapeId.getLength() >= 3) && (rShapeId[ 0 ] == '\0') && (rShapeId[ 1 ] == 's')) ? rShapeId.copy( 2 ).toInt32() : -1;
+}
+
} // namespace
// ============================================================================
@@ -107,6 +118,18 @@ Drawing::~Drawing()
return *mxCtrlForm;
}
+void Drawing::registerBlockId( sal_Int32 nBlockId )
+{
+ OSL_ENSURE( nBlockId > 0, "Drawing::registerBlockId - invalid block index" );
+ if( nBlockId > 0 )
+ {
+ // lower_bound() returns iterator pointing to element equal to nBlockId, if existing
+ BlockIdVector::iterator aIt = ::std::lower_bound( maBlockIds.begin(), maBlockIds.end(), nBlockId );
+ if( (aIt == maBlockIds.end()) || (nBlockId != *aIt) )
+ maBlockIds.insert( aIt, nBlockId );
+ }
+}
+
void Drawing::registerOleObject( const OleObjectInfo& rOleObject )
{
OSL_ENSURE( rOleObject.maShapeId.getLength() > 0, "Drawing::registerOleObject - missing OLE object shape id" );
@@ -133,6 +156,47 @@ void Drawing::convertAndInsert() const
mxShapes->convertAndInsert( xShapes );
}
+sal_Int32 Drawing::getLocalShapeIndex( const OUString& rShapeId ) const
+{
+ sal_Int32 nShapeId = lclGetShapeId( rShapeId );
+ if( nShapeId <= 0 ) return -1;
+
+ /* Shapes in a drawing are counted per registered shape identifier blocks
+ as stored in the o:idmap element. The contents of this element have
+ been stored in our member maBlockIds. Each block represents 1024 shape
+ identifiers, starting with identifier 1 for the block #0. This means,
+ block #0 represents the identifiers 1-1024, block #1 represents the
+ identifiers 1025-2048, and so on. The local shape index has to be
+ calculated according to all blocks registered for this drawing.
+
+ Example:
+ Registered for this drawing are blocks #1 and #3 (shape identifiers
+ 1025-2048 and 3073-4096).
+ Shape identifier 1025 -> local shape index 1.
+ Shape identifier 1026 -> local shape index 2.
+ ...
+ Shape identifier 2048 -> local shape index 1024.
+ Shape identifier 3073 -> local shape index 1025.
+ ...
+ Shape identifier 4096 -> local shape index 2048.
+ */
+
+ // get block id from shape id and find its index in the list of used blocks
+ sal_Int32 nBlockId = (nShapeId - 1) / 1024;
+ BlockIdVector::iterator aIt = ::std::lower_bound( maBlockIds.begin(), maBlockIds.end(), nBlockId );
+ sal_Int32 nIndex = static_cast< sal_Int32 >( aIt - maBlockIds.begin() );
+
+ // block id not found in set -> register it now (value of nIndex remains valid)
+ if( (aIt == maBlockIds.end()) || (*aIt != nBlockId) )
+ maBlockIds.insert( aIt, nBlockId );
+
+ // get one-based offset of shape id in its block
+ sal_Int32 nBlockOffset = (nShapeId - 1) % 1024 + 1;
+
+ // calculate the local shape index
+ return 1024 * nIndex + nBlockOffset;
+}
+
const OleObjectInfo* Drawing::getOleObjectInfo( const OUString& rShapeId ) const
{
return ContainerHelper::getMapElement( maOleObjects, rShapeId );
@@ -143,21 +207,72 @@ const ControlInfo* Drawing::getControlInfo( const OUString& rShapeId ) const
return ContainerHelper::getMapElement( maControls, rShapeId );
}
+Reference< XShape > Drawing::createAndInsertXShape( const OUString& rService,
+ const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect ) const
+{
+ OSL_ENSURE( rService.getLength() > 0, "Drawing::createAndInsertXShape - missing UNO shape service name" );
+ OSL_ENSURE( rxShapes.is(), "Drawing::createAndInsertXShape - missing XShapes container" );
+ Reference< XShape > xShape;
+ if( (rService.getLength() > 0) && rxShapes.is() ) try
+ {
+ Reference< XMultiServiceFactory > xFactory( mrFilter.getModelFactory(), UNO_SET_THROW );
+ xShape.set( xFactory->createInstance( rService ), UNO_QUERY_THROW );
+ // insert shape into passed shape collection (maybe drawpage or group shape)
+ rxShapes->add( xShape );
+ xShape->setPosition( Point( rShapeRect.X, rShapeRect.Y ) );
+ xShape->setSize( Size( rShapeRect.Width, rShapeRect.Height ) );
+ }
+ catch( Exception& )
+ {
+ }
+ OSL_ENSURE( xShape.is(), "Drawing::createAndInsertXShape - cannot instanciate shape object" );
+ return xShape;
+}
+
+Reference< XShape > Drawing::createAndInsertXControlShape( const ::oox::ole::EmbeddedControl& rControl,
+ const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect, sal_Int32& rnCtrlIndex ) const
+{
+ Reference< XShape > xShape;
+ try
+ {
+ // create control model and insert it into the form of the draw page
+ Reference< XControlModel > xCtrlModel( getControlForm().convertAndInsert( rControl, rnCtrlIndex ), UNO_SET_THROW );
+
+ // create the control shape
+ xShape = createAndInsertXShape( CREATE_OUSTRING( "com.sun.star.drawing.ControlShape" ), rxShapes, rShapeRect );
+
+ // set the control model at the shape
+ Reference< XControlShape >( xShape, UNO_QUERY_THROW )->setControl( xCtrlModel );
+ }
+ catch( Exception& )
+ {
+ }
+ return xShape;
+}
+
bool Drawing::isShapeSupported( const ShapeBase& /*rShape*/ ) const
{
return true;
}
-bool Drawing::convertShapeClientAnchor( Rectangle& /*orShapeRect*/, const OUString& /*rShapeAnchor*/ ) const
+OUString Drawing::getShapeBaseName( const ShapeBase& /*rShape*/ ) const
+{
+ return OUString();
+}
+
+bool Drawing::convertClientAnchor( Rectangle& /*orShapeRect*/, const OUString& /*rShapeAnchor*/ ) const
{
return false;
}
-void Drawing::convertControlClientData( const Reference< XControlModel >& /*rxCtrlModel*/, const ShapeClientData& /*rClientData*/ ) const
+Reference< XShape > Drawing::createAndInsertClientXShape( const ShapeBase& /*rShape*/,
+ const Reference< XShapes >& /*rxShapes*/, const Rectangle& /*rShapeRect*/ ) const
{
+ return Reference< XShape >();
}
-void Drawing::notifyShapeInserted( const Reference< XShape >& /*rxShape*/, const Rectangle& /*rShapeRect*/ )
+void Drawing::notifyXShapeInserted( const Reference< XShape >& /*rxShape*/,
+ const Rectangle& /*rShapeRect*/, const ShapeBase& /*rShape*/, bool /*bGroupChild*/ )
{
}
@@ -166,4 +281,4 @@ void Drawing::notifyShapeInserted( const Reference< XShape >& /*rxShape*/, const
} // namespace vml
} // namespave oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/vml/vmldrawingfragment.cxx b/oox/source/vml/vmldrawingfragment.cxx
index f2d6eeae30be..259db7e7b0c0 100644
--- a/oox/source/vml/vmldrawingfragment.cxx
+++ b/oox/source/vml/vmldrawingfragment.cxx
@@ -27,24 +27,26 @@
************************************************************************/
#include "oox/vml/vmldrawingfragment.hxx"
+
#include "oox/vml/vmldrawing.hxx"
#include "oox/vml/vmlinputstream.hxx"
#include "oox/vml/vmlshapecontext.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::io::XInputStream;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::FragmentHandler2;
-using ::oox::core::XmlFilterBase;
-
namespace oox {
namespace vml {
// ============================================================================
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
DrawingFragment::DrawingFragment( XmlFilterBase& rFilter, const OUString& rFragmentPath, Drawing& rDrawing ) :
- FragmentHandler2( rFilter, rFragmentPath ),
+ FragmentHandler2( rFilter, rFragmentPath, false ), // do not trim whitespace, has been preprocessed by the input stream
mrDrawing( rDrawing )
{
}
@@ -62,7 +64,7 @@ ContextHandlerRef DrawingFragment::onCreateContext( sal_Int32 nElement, const At
// DOCX filter handles plain shape elements with this fragment handler
case VMLDRAWING_WORD:
if ( getNamespace( nElement ) == NMSP_VML )
- return ShapeContextBase::createShapeContext( *this, nElement, rAttribs, mrDrawing.getShapes() );
+ return ShapeContextBase::createShapeContext( *this, mrDrawing.getShapes(), nElement, rAttribs );
break;
// XLSX and PPTX filters load the entire VML fragment
@@ -74,7 +76,7 @@ ContextHandlerRef DrawingFragment::onCreateContext( sal_Int32 nElement, const At
if( nElement == XML_xml ) return this;
break;
case XML_xml:
- return ShapeContextBase::createShapeContext( *this, nElement, rAttribs, mrDrawing.getShapes() );
+ return ShapeContextBase::createShapeContext( *this, mrDrawing.getShapes(), nElement, rAttribs );
}
break;
}
@@ -92,4 +94,4 @@ void DrawingFragment::finalizeImport()
} // namespace vml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index 7d57939ff2db..b695f7b42519 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -27,26 +27,29 @@
************************************************************************/
#include "oox/vml/vmlformatting.hxx"
+
#include <rtl/strbuf.hxx>
-#include "tokens.hxx"
-#include "oox/token/tokenmap.hxx"
-#include "oox/helper/graphichelper.hxx"
-#include "oox/helper/propertymap.hxx"
#include "oox/drawingml/color.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/fillproperties.hxx"
#include "oox/drawingml/lineproperties.hxx"
+#include "oox/helper/attributelist.hxx"
+#include "oox/helper/graphichelper.hxx"
+#include "oox/helper/propertymap.hxx"
+
+namespace oox {
+namespace vml {
+
+// ============================================================================
+
+using namespace ::com::sun::star::geometry;
-using ::rtl::OStringBuffer;
-using ::rtl::OUString;
-using ::com::sun::star::geometry::IntegerRectangle2D;
using ::oox::drawingml::Color;
using ::oox::drawingml::FillProperties;
using ::oox::drawingml::LineArrowProperties;
using ::oox::drawingml::LineProperties;
-
-namespace oox {
-namespace vml {
+using ::rtl::OStringBuffer;
+using ::rtl::OUString;
// ============================================================================
@@ -82,8 +85,9 @@ bool lclExtractDouble( double& orfValue, sal_Int32& ornEndPos, const OUString& r
/*static*/ bool ConversionHelper::decodeBool( const OUString& rValue )
{
+ sal_Int32 nToken = AttributeConversion::decodeToken( rValue );
// anything else than 't' or 'true' is considered to be false, as specified
- return ((rValue.getLength() == 1) && (rValue[ 0 ] == 't')) || (rValue == CREATE_OUSTRING( "true" ));
+ return (nToken == XML_t) || (nToken == XML_true);
}
/*static*/ double ConversionHelper::decodePercent( const OUString& rValue, double fDefValue )
@@ -172,58 +176,35 @@ bool lclExtractDouble( double& orfValue, sal_Int32& ornEndPos, const OUString& r
return (decodeMeasureToEmu( rGraphicHelper, rValue, nRefValue, bPixelX, bDefaultAsPixel ) + 180) / 360;
}
-// ============================================================================
-
-namespace {
-
-/** Converts a VML color attribute to a DrawingML color.
-
- @param orDmlColor (out-parameter) The destination DrawingML color.
-
- @param roVmlColor The VML string representation of the color. If existing,
- this can be a 6-digit hexadecimal RGB value with leading '#' character,
- a predefined color name (e.g. 'black', 'red', etc.), the index into an
- application defined color palette in brackets with leading color name
- (e.g. 'red [9]' or 'windowColor [64]'), or a color modifier used in
- one-color gradients (e.g. 'fill darken(128)' or 'fill lighten(0)'.
-
- @param roVmlOpacity The opacity of the color. If existing, this should be
- a floating-point value in the range [0.0;1.0].
-
- @param nDefaultRgb Deafult RGB color used if the parameter roVmlColor is
- empty.
-
- @param nPrimaryRgb If set to something else than API_RGB_TRANSPARENT,
- specifies the color to be used to resolve the color modifiers used in
- one-color gradients.
- */
-void lclGetColor( Color& orDmlColor, const GraphicHelper& rGraphicHelper,
+/*static*/ Color ConversionHelper::decodeColor( const GraphicHelper& rGraphicHelper,
const OptValue< OUString >& roVmlColor, const OptValue< double >& roVmlOpacity,
- sal_Int32 nDefaultRgb, sal_Int32 nPrimaryRgb = API_RGB_TRANSPARENT )
+ sal_Int32 nDefaultRgb, sal_Int32 nPrimaryRgb )
{
+ Color aDmlColor;
+
// convert opacity
const sal_Int32 DML_FULL_OPAQUE = ::oox::drawingml::MAX_PERCENT;
double fOpacity = roVmlOpacity.get( 1.0 );
sal_Int32 nOpacity = getLimitedValue< sal_Int32, double >( fOpacity * DML_FULL_OPAQUE, 0, DML_FULL_OPAQUE );
if( nOpacity < DML_FULL_OPAQUE )
- orDmlColor.addTransformation( XML_alpha, nOpacity );
+ aDmlColor.addTransformation( XML_alpha, nOpacity );
// color attribute not present - set passed default color
if( !roVmlColor.has() )
{
- orDmlColor.setSrgbClr( nDefaultRgb );
- return;
+ aDmlColor.setSrgbClr( nDefaultRgb );
+ return aDmlColor;
}
// separate leading color name or RGB value from following palette index
OUString aColorName, aColorIndex;
- ConversionHelper::separatePair( aColorName, aColorIndex, roVmlColor.get(), ' ' );
+ separatePair( aColorName, aColorIndex, roVmlColor.get(), ' ' );
// RGB colors in the format '#RRGGBB'
if( (aColorName.getLength() == 7) && (aColorName[ 0 ] == '#') )
{
- orDmlColor.setSrgbClr( aColorName.copy( 1 ).toInt32( 16 ) );
- return;
+ aDmlColor.setSrgbClr( aColorName.copy( 1 ).toInt32( 16 ) );
+ return aDmlColor;
}
// RGB colors in the format '#RGB'
@@ -232,27 +213,27 @@ void lclGetColor( Color& orDmlColor, const GraphicHelper& rGraphicHelper,
sal_Int32 nR = aColorName.copy( 1, 1 ).toInt32( 16 ) * 0x11;
sal_Int32 nG = aColorName.copy( 2, 1 ).toInt32( 16 ) * 0x11;
sal_Int32 nB = aColorName.copy( 3, 1 ).toInt32( 16 ) * 0x11;
- orDmlColor.setSrgbClr( (nR << 16) | (nG << 8) | nB );
- return;
+ aDmlColor.setSrgbClr( (nR << 16) | (nG << 8) | nB );
+ return aDmlColor;
}
/* Predefined color names or system color names (resolve to RGB to detect
valid color name). */
- sal_Int32 nColorToken = StaticTokenMap::get().getTokenFromUnicode( aColorName );
+ sal_Int32 nColorToken = AttributeConversion::decodeToken( aColorName );
sal_Int32 nRgbValue = Color::getVmlPresetColor( nColorToken, API_RGB_TRANSPARENT );
if( nRgbValue == API_RGB_TRANSPARENT )
nRgbValue = rGraphicHelper.getSystemColor( nColorToken, API_RGB_TRANSPARENT );
if( nRgbValue != API_RGB_TRANSPARENT )
{
- orDmlColor.setSrgbClr( nRgbValue );
- return;
+ aDmlColor.setSrgbClr( nRgbValue );
+ return aDmlColor;
}
// try palette colors enclosed in brackets
if( (aColorIndex.getLength() >= 3) && (aColorIndex[ 0 ] == '[') && (aColorIndex[ aColorIndex.getLength() - 1 ] == ']') )
{
- orDmlColor.setPaletteClr( aColorIndex.copy( 1, aColorIndex.getLength() - 2 ).toInt32() );
- return;
+ aDmlColor.setPaletteClr( aColorIndex.copy( 1, aColorIndex.getLength() - 2 ).toInt32() );
+ return aDmlColor;
}
// try fill gradient modificator 'fill <modifier>(<amount>)'
@@ -263,7 +244,7 @@ void lclGetColor( Color& orDmlColor, const GraphicHelper& rGraphicHelper,
if( (2 <= nOpenParen) && (nOpenParen + 1 < nCloseParen) && (nCloseParen + 1 == aColorIndex.getLength()) )
{
sal_Int32 nModToken = XML_TOKEN_INVALID;
- switch( StaticTokenMap::get().getTokenFromUnicode( aColorIndex.copy( 0, nOpenParen ) ) )
+ switch( AttributeConversion::decodeToken( aColorIndex.copy( 0, nOpenParen ) ) )
{
case XML_darken: nModToken = XML_shade;
case XML_lighten: nModToken = XML_tint;
@@ -274,18 +255,23 @@ void lclGetColor( Color& orDmlColor, const GraphicHelper& rGraphicHelper,
/* Simulate this modifier color by a color with related transformation.
The modifier amount has to be converted from the range [0;255] to
percentage [0;100000] used by DrawingML. */
- orDmlColor.setSrgbClr( nPrimaryRgb );
- orDmlColor.addTransformation( nModToken, static_cast< sal_Int32 >( nValue * ::oox::drawingml::MAX_PERCENT / 255 ) );
- return;
+ aDmlColor.setSrgbClr( nPrimaryRgb );
+ aDmlColor.addTransformation( nModToken, static_cast< sal_Int32 >( nValue * ::oox::drawingml::MAX_PERCENT / 255 ) );
+ return aDmlColor;
}
}
}
- OSL_ENSURE( false, OStringBuffer( "lclGetColor - invalid VML color name '" ).
+ OSL_ENSURE( false, OStringBuffer( "ConversionHelper::decodeColor - invalid VML color name '" ).
append( OUStringToOString( roVmlColor.get(), RTL_TEXTENCODING_ASCII_US ) ).append( '\'' ).getStr() );
- orDmlColor.setSrgbClr( nDefaultRgb );
+ aDmlColor.setSrgbClr( nDefaultRgb );
+ return aDmlColor;
}
+// ============================================================================
+
+namespace {
+
sal_Int32 lclGetEmu( const GraphicHelper& rGraphicHelper, const OptValue< OUString >& roValue, sal_Int32 nDefValue )
{
return roValue.has() ? ConversionHelper::decodeMeasureToEmu( rGraphicHelper, roValue.get(), 0, false, false ) : nDefValue;
@@ -296,7 +282,7 @@ void lclGetDmlLineDash( OptValue< sal_Int32 >& oroPresetDash, LineProperties::Da
if( roDashStyle.has() )
{
const OUString& rDashStyle = roDashStyle.get();
- switch( StaticTokenMap::get().getTokenFromUnicode( rDashStyle ) )
+ switch( AttributeConversion::decodeToken( rDashStyle ) )
{
case XML_solid: oroPresetDash = XML_solid; return;
case XML_shortdot: oroPresetDash = XML_sysDot; return;
@@ -442,7 +428,7 @@ void StrokeModel::pushToPropMap( PropertyMap& rPropMap,
aLineProps.maLineFill.moFillType = XML_solidFill;
lclConvertArrow( aLineProps.maStartArrow, maStartArrow );
lclConvertArrow( aLineProps.maEndArrow, maEndArrow );
- lclGetColor( aLineProps.maLineFill.maFillColor, rGraphicHelper, moColor, moOpacity, API_RGB_BLACK );
+ aLineProps.maLineFill.maFillColor = ConversionHelper::decodeColor( rGraphicHelper, moColor, moOpacity, API_RGB_BLACK );
aLineProps.moLineWidth = lclGetEmu( rGraphicHelper, moWeight, 1 );
lclGetDmlLineDash( aLineProps.moPresetDash, aLineProps.maCustomDash, moDashStyle );
aLineProps.moLineCompound = lclGetDmlLineCompound( moLineStyle );
@@ -495,9 +481,8 @@ void FillModel::pushToPropMap( PropertyMap& rPropMap,
double fFocus = moFocus.get( 0.0 );
// prepare colors
- Color aColor1, aColor2;
- lclGetColor( aColor1, rGraphicHelper, moColor, moOpacity, API_RGB_WHITE );
- lclGetColor( aColor2, rGraphicHelper, moColor2, moOpacity2, API_RGB_WHITE, aColor1.getColor( rGraphicHelper ) );
+ Color aColor1 = ConversionHelper::decodeColor( rGraphicHelper, moColor, moOpacity, API_RGB_WHITE );
+ Color aColor2 = ConversionHelper::decodeColor( rGraphicHelper, moColor2, moOpacity2, API_RGB_WHITE, aColor1.getColor( rGraphicHelper ) );
// type XML_gradient is linear or axial gradient
if( nFillType == XML_gradient )
@@ -585,7 +570,7 @@ void FillModel::pushToPropMap( PropertyMap& rPropMap,
{
aFillProps.moFillType = XML_solidFill;
// fill color (default is white)
- lclGetColor( aFillProps.maFillColor, rGraphicHelper, moColor, moOpacity, API_RGB_WHITE );
+ aFillProps.maFillColor = ConversionHelper::decodeColor( rGraphicHelper, moColor, moOpacity, API_RGB_WHITE );
}
}
}
@@ -602,4 +587,4 @@ void FillModel::pushToPropMap( PropertyMap& rPropMap,
} // namespace vml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/vml/vmlinputstream.cxx b/oox/source/vml/vmlinputstream.cxx
index 69a039dada31..4f903ff2f00f 100644
--- a/oox/source/vml/vmlinputstream.cxx
+++ b/oox/source/vml/vmlinputstream.cxx
@@ -27,22 +27,25 @@
************************************************************************/
#include "oox/vml/vmlinputstream.hxx"
+
#include <map>
#include <rtl/strbuf.hxx>
#include <rtl/strbuf.hxx>
#include "oox/helper/helper.hxx"
-using ::rtl::OString;
-using ::rtl::OStringBuffer;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::io::XInputStream;
-
namespace oox {
namespace vml {
// ============================================================================
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OString;
+using ::rtl::OStringBuffer;
+
+// ============================================================================
+
namespace {
inline const sal_Char* lclFindCharacter( const sal_Char* pcBeg, const sal_Char* pcEnd, sal_Char cChar )
@@ -149,6 +152,48 @@ void lclProcessAttribs( OStringBuffer& rBuffer, const sal_Char* pcBeg, const sal
lclAppendToBuffer( rBuffer, pcBeg, pcEnd );
}
+void lclProcessContents( OStringBuffer& rBuffer, const sal_Char* pcBeg, const sal_Char* pcEnd )
+{
+ /* MSO has a very weird way to store and handle whitespaces. The stream
+ may contain lots of spaces, tabs, and newlines which have to be handled
+ as single space character. This will be done in this function.
+
+ If the element text contains a literal line break, it will be stored as
+ <br> tag (without matching closing </br> element).
+
+ A single space character following another character is stored
+ literally and must not be stipped away here. Example: The element
+ <font>abc </font>
+ contains the three letters a, b, and c, followed by a space character.
+
+ Consecutive space characters, or a leading single space character, are
+ stored in a <span> element. If there are N space characters (N > 1),
+ then the <span> element contains exactly (N-1) NBSP characters
+ (non-breaking space), followed by a regular space character. Example:
+ The element
+ <font><span style='mso-spacerun:yes'>\xA0\xA0\xA0 </span></font>
+ represents 4 consecutive space characters. Has to be handled by the
+ implementation.
+
+ A single space character for its own is stored in an empty element.
+ Example: The element
+ <font></font>
+ represents a single space character. Has to be handled by the
+ implementation.
+ */
+
+ // skip leading whitespace
+ const sal_Char* pcContentsBeg = lclFindNonWhiteSpace( pcBeg, pcEnd );
+ while( pcContentsBeg < pcEnd )
+ {
+ const sal_Char* pcWhitespaceBeg = lclFindWhiteSpace( pcContentsBeg + 1, pcEnd );
+ lclAppendToBuffer( rBuffer, pcContentsBeg, pcWhitespaceBeg );
+ if( pcWhitespaceBeg < pcEnd )
+ rBuffer.append( ' ' );
+ pcContentsBeg = lclFindNonWhiteSpace( pcWhitespaceBeg, pcEnd );
+ }
+}
+
} // namespace
// ============================================================================
@@ -177,8 +222,9 @@ StreamDataContainer::StreamDataContainer( const Reference< XInputStream >& rxInS
{
// look for the next opening angle bracket
const sal_Char* pcOpen = lclFindCharacter( pcCurr, pcEnd, '<' );
+
// copy all characters from current position to opening bracket
- lclAppendToBuffer( aBuffer, pcCurr, pcOpen );
+ lclProcessContents( aBuffer, pcCurr, pcOpen );
// nothing to do if no opening bracket has been found
if( pcOpen < pcEnd )
@@ -215,10 +261,10 @@ StreamDataContainer::StreamDataContainer( const Reference< XInputStream >& rxInS
// do nothing
}
- // replace '<br>' elements with '<br/>' elements
+ // replace '<br>' element with newline
else if( (nElementLen >= 4) && (pcOpen[ 1 ] == 'b') && (pcOpen[ 2 ] == 'r') && (lclFindNonWhiteSpace( pcOpen + 3, pcClose ) == pcClose) )
{
- aBuffer.append( RTL_CONSTASCII_STRINGPARAM( "<br/>" ) );
+ aBuffer.append( '\n' );
}
// check start elements and empty elements for repeated attributes
@@ -283,4 +329,4 @@ InputStream::~InputStream()
} // namespace vml
} // namespave oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 5f3065e8e1f3..233bc17d4005 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -27,13 +27,11 @@
************************************************************************/
#include "oox/vml/vmlshape.hxx"
-#include <rtl/math.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
#include <com/sun/star/beans/PropertyValues.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/XControlModel.hpp>
#include <com/sun/star/drawing/PointSequenceSequence.hpp>
-#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
@@ -44,7 +42,6 @@
#include <com/sun/star/text/XTextContent.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/XTextFrame.hpp>
-#include "properties.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
@@ -54,27 +51,11 @@
#include "oox/ole/oleobjecthelper.hxx"
#include "oox/vml/vmldrawing.hxx"
#include "oox/vml/vmlshapecontainer.hxx"
+#include "oox/vml/vmltextbox.hxx"
+#include "oox/helper/containerhelper.hxx"
-using ::rtl::OUString;
using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::awt::XControlModel;
-using ::com::sun::star::graphic::XGraphic;
-using ::com::sun::star::drawing::PointSequenceSequence;
-using ::com::sun::star::drawing::XControlShape;
-using ::com::sun::star::drawing::XEnhancedCustomShapeDefaulter;
-using ::com::sun::star::drawing::XShape;
-using ::com::sun::star::drawing::XShapes;
-using ::oox::core::XmlFilterBase;
using namespace ::com::sun::star::text;
@@ -83,8 +64,24 @@ namespace vml {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::graphic;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::XmlFilterBase;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
+const sal_Int32 VML_SHAPETYPE_PICTUREFRAME = 75;
+const sal_Int32 VML_SHAPETYPE_HOSTCONTROL = 201;
+
+// ----------------------------------------------------------------------------
+
Point lclGetAbsPoint( const Point& rRelPoint, const Rectangle& rShapeRect, const Rectangle& rCoordSys )
{
double fWidthRatio = static_cast< double >( rShapeRect.Width ) / rCoordSys.Width;
@@ -107,36 +104,6 @@ Rectangle lclGetAbsRect( const Rectangle& rRelRect, const Rectangle& rShapeRect,
return aAbsRect;
}
-Reference< XShape > lclCreateXShape( const XmlFilterBase& rFilter, const OUString& rService )
-{
- OSL_ENSURE( rService.getLength() > 0, "lclCreateXShape - missing UNO shape service name" );
- Reference< XShape > xShape;
- try
- {
- Reference< XMultiServiceFactory > xFactory( rFilter.getModelFactory(), UNO_SET_THROW );
- xShape.set( xFactory->createInstance( rService ), UNO_QUERY_THROW );
- }
- catch( Exception& )
- {
- }
- OSL_ENSURE( xShape.is(), "lclCreateXShape - cannot instanciate shape object" );
- return xShape;
-}
-
-void lclInsertXShape( const Reference< XShapes >& rxShapes, const Reference< XShape >& rxShape )
-{
- OSL_ENSURE( rxShapes.is(), "lclInsertXShape - missing XShapes container" );
- OSL_ENSURE( rxShape.is(), "lclInsertXShape - missing XShape" );
- if( rxShapes.is() && rxShape.is() ) try
- {
- // insert shape into passed shape collection (maybe drawpage or group shape)
- rxShapes->add( rxShape );
- }
- catch( Exception& )
- {
- }
-}
-
void lclInsertTextFrame( const XmlFilterBase& rFilter, const Reference< XShape >& rxShape )
{
OSL_ENSURE( rxShape.is(), "lclInsertTextFrame - missing XShape" );
@@ -194,21 +161,6 @@ void lclSetXShapeRect( const Reference< XShape >& rxShape, const Rectangle& rSha
}
}
}
-}
-
-Reference< XShape > lclCreateAndInsertXShape( const XmlFilterBase& rFilter,
- const Reference< XShapes >& rxShapes, const OUString& rService, const Rectangle& rShapeRect )
-{
- Reference< XShape > xShape = lclCreateXShape( rFilter, rService );
- if ( rService.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.TextFrame" ) ) )
- lclInsertTextFrame( rFilter, xShape );
- else
- lclInsertXShape( rxShapes, xShape );
- lclSetXShapeRect( xShape, rShapeRect );
-
- return xShape;
-}
-
} // namespace
// ============================================================================
@@ -241,6 +193,11 @@ ShapeType::~ShapeType()
{
}
+sal_Int32 ShapeType::getShapeType() const
+{
+ return maTypeModel.moShapeType.get( 0 );
+}
+
OUString ShapeType::getGraphicPath() const
{
return maTypeModel.moGraphicPath.get( OUString() );
@@ -289,12 +246,30 @@ Rectangle ShapeType::getRelRectangle() const
// ============================================================================
-ShapeClientData::ShapeClientData() :
+ClientData::ClientData() :
mnObjType( XML_TOKEN_INVALID ),
+ mnTextHAlign( XML_Left ),
+ mnTextVAlign( XML_Top ),
mnCol( -1 ),
mnRow( -1 ),
+ mnChecked( VML_CLIENTDATA_UNCHECKED ),
+ mnDropStyle( XML_Combo ),
+ mnDropLines( 1 ),
+ mnVal( 0 ),
+ mnMin( 0 ),
+ mnMax( 0 ),
+ mnInc( 0 ),
+ mnPage( 0 ),
+ mnSelType( XML_Single ),
+ mnVTEdit( VML_CLIENTDATA_TEXT ),
mbPrintObject( true ),
- mbVisible( false )
+ mbVisible( false ),
+ mbDde( false ),
+ mbNo3D( false ),
+ mbNo3D2( false ),
+ mbMultiLine( false ),
+ mbVScroll( false ),
+ mbSecretEdit( false )
{
}
@@ -304,9 +279,19 @@ ShapeModel::ShapeModel()
{
}
-ShapeClientData& ShapeModel::createClientData()
+ShapeModel::~ShapeModel()
+{
+}
+
+TextBox& ShapeModel::createTextBox()
+{
+ mxTextBox.reset( new TextBox );
+ return *mxTextBox;
+}
+
+ClientData& ShapeModel::createClientData()
{
- mxClientData.reset( new ShapeClientData );
+ mxClientData.reset( new ClientData );
return *mxClientData;
}
@@ -325,6 +310,22 @@ void ShapeBase::finalizeFragmentImport()
maTypeModel.assignUsed( pShapeType->getTypeModel() );
}
+OUString ShapeBase::getShapeName() const
+{
+ if( maTypeModel.maShapeName.getLength() > 0 )
+ return maTypeModel.maShapeName;
+
+ OUString aBaseName = mrDrawing.getShapeBaseName( *this );
+ if( aBaseName.getLength() > 0 )
+ {
+ sal_Int32 nShapeIdx = mrDrawing.getLocalShapeIndex( getShapeId() );
+ if( nShapeIdx > 0 )
+ return OUStringBuffer( aBaseName ).append( sal_Unicode( ' ' ) ).append( nShapeIdx ).makeStringAndClear();
+ }
+
+ return OUString();
+}
+
const ShapeType* ShapeBase::getChildTypeById( const OUString& ) const
{
return 0;
@@ -343,15 +344,23 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS
/* Calculate shape rectangle. Applications may do something special
according to some imported shape client data (e.g. Excel cell anchor). */
Rectangle aShapeRect = calcShapeRectangle( pParentAnchor );
+
// convert the shape, if the calculated rectangle is not empty
if( ((aShapeRect.Width > 0) || (aShapeRect.Height > 0)) && rxShapes.is() )
{
xShape = implConvertAndInsert( rxShapes, aShapeRect );
- /* Notify the drawing that a new shape has been inserted (but not
- for children of group shapes). For convenience, pass the
- rectangle that contains position and size of the shape. */
- if( !pParentAnchor && xShape.is() )
- mrDrawing.notifyShapeInserted( xShape, aShapeRect );
+ if( xShape.is() )
+ {
+ // set shape name (imported or generated)
+ PropertySet aShapeProp( xShape );
+ aShapeProp.setProperty( PROP_Name, getShapeName() );
+
+ /* Notify the drawing that a new shape has been inserted. For
+ convenience, pass the rectangle that contains position and
+ size of the shape. */
+ bool bGroupChild = pParentAnchor != 0;
+ mrDrawing.notifyXShapeInserted( xShape, aShapeRect, *this, bGroupChild );
+ }
}
}
return xShape;
@@ -364,10 +373,12 @@ void ShapeBase::convertFormatting( const Reference< XShape >& rxShape, const Sha
/* Calculate shape rectangle. Applications may do something special
according to some imported shape client data (e.g. Excel cell anchor). */
Rectangle aShapeRect = calcShapeRectangle( pParentAnchor );
+
// convert the shape, if the calculated rectangle is not empty
if( (aShapeRect.Width > 0) || (aShapeRect.Height > 0) )
{
- lclSetXShapeRect( rxShape, aShapeRect );
+ rxShape->setPosition( Point( aShapeRect.X, aShapeRect.Y ) );
+ rxShape->setSize( Size( aShapeRect.Width, aShapeRect.Height ) );
convertShapeProperties( rxShape );
}
}
@@ -380,7 +391,8 @@ Rectangle ShapeBase::calcShapeRectangle( const ShapeParentAnchor* pParentAnchor
/* Calculate shape rectangle. Applications may do something special
according to some imported shape client data (e.g. Excel cell anchor). */
Rectangle aShapeRect;
- if( !maShapeModel.mxClientData.get() || !mrDrawing.convertShapeClientAnchor( aShapeRect, maShapeModel.mxClientData->maAnchor ) )
+ const ClientData* pClientData = getClientData();
+ if( !pClientData || !mrDrawing.convertClientAnchor( aShapeRect, pClientData->maAnchor ) )
aShapeRect = getRectangle( pParentAnchor );
return aShapeRect;
}
@@ -408,7 +420,7 @@ SimpleShape::SimpleShape( Drawing& rDrawing, const OUString& rService ) :
Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect ) const
{
- Reference< XShape > xShape = lclCreateAndInsertXShape( mrDrawing.getFilter(), rxShapes, maService, rShapeRect );
+ Reference< XShape > xShape = mrDrawing.createAndInsertXShape( maService, rxShapes, rShapeRect );
convertShapeProperties( xShape );
return xShape;
}
@@ -467,7 +479,7 @@ Reference< XShape > CustomShape::implConvertAndInsert( const Reference< XShapes
{
// create the custom shape geometry
Reference< XEnhancedCustomShapeDefaulter > xDefaulter( xShape, UNO_QUERY_THROW );
- xDefaulter->createCustomShapeDefaults( OUString::valueOf( maTypeModel.moShapeType.get( 0 ) ) );
+ xDefaulter->createCustomShapeDefaults( OUString::valueOf( getShapeType() ) );
// convert common properties
convertShapeProperties( xShape );
}
@@ -487,11 +499,14 @@ ComplexShape::ComplexShape( Drawing& rDrawing ) :
Reference< XShape > ComplexShape::implConvertAndInsert( const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect ) const
{
XmlFilterBase& rFilter = mrDrawing.getFilter();
+ sal_Int32 nShapeType = getShapeType();
OUString aGraphicPath = getGraphicPath();
// try to find registered OLE object info
if( const OleObjectInfo* pOleObjectInfo = mrDrawing.getOleObjectInfo( maTypeModel.maShapeId ) )
{
+ OSL_ENSURE( nShapeType == VML_SHAPETYPE_PICTUREFRAME, "ComplexShape::implConvertAndInsert - unexpected shape type" );
+
// if OLE object is embedded into a DrawingML shape (PPTX), do not create it here
if( pOleObjectInfo->mbDmlShape )
return Reference< XShape >();
@@ -500,7 +515,7 @@ Reference< XShape > ComplexShape::implConvertAndInsert( const Reference< XShapes
Size aOleSize( rShapeRect.Width, rShapeRect.Height );
if( rFilter.getOleObjectHelper().importOleObject( aOleProps, *pOleObjectInfo, aOleSize ) )
{
- Reference< XShape > xShape = lclCreateAndInsertXShape( rFilter, rxShapes, CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" ), rShapeRect );
+ Reference< XShape > xShape = mrDrawing.createAndInsertXShape( CREATE_OUSTRING( "com.sun.star.drawing.OLE2Shape" ), rxShapes, rShapeRect );
if( xShape.is() )
{
// set the replacement graphic
@@ -521,36 +536,40 @@ Reference< XShape > ComplexShape::implConvertAndInsert( const Reference< XShapes
// try to find registered form control info
const ControlInfo* pControlInfo = mrDrawing.getControlInfo( maTypeModel.maShapeId );
- if( pControlInfo && (pControlInfo->maFragmentPath.getLength() > 0) && (maTypeModel.maName.getLength() > 0) )
+ if( pControlInfo && (pControlInfo->maFragmentPath.getLength() > 0) )
{
- OSL_ENSURE( maTypeModel.maName == pControlInfo->maName, "ComplexShape::implConvertAndInsert - control name mismatch" );
- ::oox::ole::EmbeddedControl aControl( maTypeModel.maName );
- // load the control properties from fragment
- if( rFilter.importFragment( new ::oox::ole::AxControlFragment( rFilter, pControlInfo->maFragmentPath, aControl ) ) ) try
- {
- // create control model and insert it into the form of the draw page
- Reference< XControlModel > xCtrlModel( mrDrawing.getControlForm().convertAndInsert( aControl ), UNO_SET_THROW );
- if( maShapeModel.mxClientData.get() )
- mrDrawing.convertControlClientData( xCtrlModel, *maShapeModel.mxClientData );
-
- // create the control shape, set control model at the shape
- Reference< XShape > xShape = lclCreateAndInsertXShape(
- rFilter, rxShapes, CREATE_OUSTRING( "com.sun.star.drawing.ControlShape" ), rShapeRect );
- Reference< XControlShape > xCtrlShape( xShape, UNO_QUERY ); // do not throw, but always return the shape
- if( xCtrlShape.is() )
- xCtrlShape->setControl( xCtrlModel );
- return xShape;
- }
- catch( Exception& )
+ OSL_ENSURE( nShapeType == VML_SHAPETYPE_HOSTCONTROL, "ComplexShape::implConvertAndInsert - unexpected shape type" );
+ OUString aShapeName = getShapeName();
+ if( aShapeName.getLength() > 0 )
{
+ OSL_ENSURE( aShapeName == pControlInfo->maName, "ComplexShape::implConvertAndInsert - control name mismatch" );
+ // load the control properties from fragment
+ ::oox::ole::EmbeddedControl aControl( aShapeName );
+ if( rFilter.importFragment( new ::oox::ole::AxControlFragment( rFilter, pControlInfo->maFragmentPath, aControl ) ) )
+ {
+ // create and return the control shape (including control model)
+ sal_Int32 nCtrlIndex = -1;
+ Reference< XShape > xShape = mrDrawing.createAndInsertXControlShape( aControl, rxShapes, rShapeRect, nCtrlIndex );
+ // on error, proceed and try to create picture from replacement image
+ if( xShape.is() )
+ return xShape;
+ }
}
- // on error, proceed and try to create picture from replacement image
+ }
+
+ // host application wants to create the shape (do not try failed OLE controls again)
+ if( (nShapeType == VML_SHAPETYPE_HOSTCONTROL) && !pControlInfo )
+ {
+ OSL_ENSURE( getClientData(), "ComplexShape::implConvertAndInsert - missing client data" );
+ Reference< XShape > xShape = mrDrawing.createAndInsertClientXShape( *this, rxShapes, rShapeRect );
+ if( xShape.is() )
+ return xShape;
}
// try to create a picture object
if( aGraphicPath.getLength() > 0 )
{
- Reference< XShape > xShape = lclCreateAndInsertXShape( rFilter, rxShapes, CREATE_OUSTRING( "com.sun.star.drawing.GraphicObjectShape" ), rShapeRect );
+ Reference< XShape > xShape = mrDrawing.createAndInsertXShape( CREATE_OUSTRING( "com.sun.star.drawing.GraphicObjectShape" ), rxShapes, rShapeRect );
if( xShape.is() )
{
OUString aGraphicUrl = rFilter.getGraphicHelper().importEmbeddedGraphicObject( aGraphicPath );
@@ -606,7 +625,7 @@ Reference< XShape > GroupShape::implConvertAndInsert( const Reference< XShapes >
aParentAnchor.maCoordSys = getCoordSystem();
if( !mxChildren->empty() && (aParentAnchor.maCoordSys.Width > 0) && (aParentAnchor.maCoordSys.Height > 0) ) try
{
- xGroupShape = lclCreateAndInsertXShape( mrDrawing.getFilter(), rxShapes, CREATE_OUSTRING( "com.sun.star.drawing.GroupShape" ), rShapeRect );
+ xGroupShape = mrDrawing.createAndInsertXShape( CREATE_OUSTRING( "com.sun.star.drawing.GroupShape" ), rxShapes, rShapeRect );
Reference< XShapes > xChildShapes( xGroupShape, UNO_QUERY_THROW );
mxChildren->convertAndInsert( xChildShapes, &aParentAnchor );
// no child shape has been created - delete the group shape
@@ -627,4 +646,4 @@ Reference< XShape > GroupShape::implConvertAndInsert( const Reference< XShapes >
} // namespace vml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/vml/vmlshapecontainer.cxx b/oox/source/vml/vmlshapecontainer.cxx
index a17c93d3ccd4..32d136b2337a 100644
--- a/oox/source/vml/vmlshapecontainer.cxx
+++ b/oox/source/vml/vmlshapecontainer.cxx
@@ -27,19 +27,23 @@
************************************************************************/
#include "oox/vml/vmlshapecontainer.hxx"
+
#include "oox/vml/vmldrawing.hxx"
#include "oox/vml/vmlshape.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::drawing::XShapes;
-
namespace oox {
namespace vml {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
template< typename ShapeType >
@@ -132,4 +136,4 @@ void ShapeContainer::convertAndInsert( const Reference< XShapes >& rxShapes, con
} // namespace vml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index 48ab00187ac6..108e0b21f830 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -27,17 +27,23 @@
************************************************************************/
#include "oox/vml/vmlshapecontext.hxx"
+
+#include "oox/vml/vmldrawing.hxx"
#include "oox/vml/vmlshape.hxx"
#include "oox/vml/vmlshapecontainer.hxx"
+#include "oox/vml/vmltextboxcontext.hxx"
+
+namespace oox {
+namespace vml {
+
+// ============================================================================
+
+using namespace ::com::sun::star::awt;
-using ::rtl::OUString;
-using ::com::sun::star::awt::Point;
using ::oox::core::ContextHandler2;
using ::oox::core::ContextHandler2Helper;
using ::oox::core::ContextHandlerRef;
-
-namespace oox {
-namespace vml {
+using ::rtl::OUString;
// ============================================================================
@@ -101,39 +107,101 @@ OptValue< DoublePair > lclDecodePercentPair( const AttributeList& rAttribs, sal_
bool lclDecodeVmlxBool( const OUString& rValue, bool bDefaultForEmpty )
{
if( rValue.getLength() == 0 ) return bDefaultForEmpty;
+ sal_Int32 nToken = AttributeConversion::decodeToken( rValue );
// anything else than 't' or 'True' is considered to be false, as specified
- return ((rValue.getLength() == 1) && (rValue[ 0 ] == 't')) || (rValue == CREATE_OUSTRING( "True" ));
+ return (nToken == XML_t) || (nToken == XML_True);
}
} // namespace
// ============================================================================
-ShapeClientDataContext::ShapeClientDataContext( ContextHandler2Helper& rParent,
- const AttributeList& rAttribs, ShapeClientData& rClientData ) :
+ShapeLayoutContext::ShapeLayoutContext( ContextHandler2Helper& rParent, Drawing& rDrawing ) :
+ ContextHandler2( rParent ),
+ mrDrawing( rDrawing )
+{
+}
+
+
+ContextHandlerRef ShapeLayoutContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( nElement )
+ {
+ case O_TOKEN( idmap ):
+ {
+ OUString aBlockIds = rAttribs.getString( XML_data, OUString() );
+ sal_Int32 nIndex = 0;
+ while( nIndex >= 0 )
+ {
+ OUString aToken = aBlockIds.getToken( 0, ' ', nIndex ).trim();
+ if( aToken.getLength() > 0 )
+ mrDrawing.registerBlockId( aToken.toInt32() );
+ }
+ }
+ break;
+ }
+ return 0;
+}
+
+// ============================================================================
+
+ClientDataContext::ClientDataContext( ContextHandler2Helper& rParent,
+ ClientData& rClientData, const AttributeList& rAttribs ) :
ContextHandler2( rParent ),
mrClientData( rClientData )
{
mrClientData.mnObjType = rAttribs.getToken( XML_ObjectType, XML_TOKEN_INVALID );
}
-ContextHandlerRef ShapeClientDataContext::onCreateContext( sal_Int32 /*nElement*/, const AttributeList& /*rAttribs*/ )
+ContextHandlerRef ClientDataContext::onCreateContext( sal_Int32 /*nElement*/, const AttributeList& /*rAttribs*/ )
{
- return isRootElement() ? this : 0;
+ if( isRootElement() )
+ {
+ maElementText = OUString();
+ return this;
+ }
+ return 0;
+}
+
+void ClientDataContext::onCharacters( const OUString& rChars )
+{
+ /* Empty but existing elements have special meaning, e.g. 'true'. Collect
+ existing text and convert it in onEndElement(). */
+ maElementText = rChars;
}
-void ShapeClientDataContext::onEndElement( const OUString& rChars )
+void ClientDataContext::onEndElement()
{
switch( getCurrentElement() )
{
- case VMLX_TOKEN( Anchor ): mrClientData.maAnchor = rChars; break;
- case VMLX_TOKEN( FmlaPict ): mrClientData.maPictureLink = rChars; break;
- case VMLX_TOKEN( FmlaLink ): mrClientData.maLinkedCell = rChars; break;
- case VMLX_TOKEN( FmlaRange ): mrClientData.maSourceRange = rChars; break;
- case VMLX_TOKEN( Column ): mrClientData.mnCol = rChars.toInt32(); break;
- case VMLX_TOKEN( Row ): mrClientData.mnRow = rChars.toInt32(); break;
- case VMLX_TOKEN( PrintObject ): mrClientData.mbPrintObject = lclDecodeVmlxBool( rChars, true ); break;
- case VMLX_TOKEN( Visible ): mrClientData.mbVisible = true; break;
+ case VMLX_TOKEN( Anchor ): mrClientData.maAnchor = maElementText; break;
+ case VMLX_TOKEN( FmlaMacro ): mrClientData.maFmlaMacro = maElementText; break;
+ case VMLX_TOKEN( FmlaPict ): mrClientData.maFmlaPict = maElementText; break;
+ case VMLX_TOKEN( FmlaLink ): mrClientData.maFmlaLink = maElementText; break;
+ case VMLX_TOKEN( FmlaRange ): mrClientData.maFmlaRange = maElementText; break;
+ case VMLX_TOKEN( FmlaGroup ): mrClientData.maFmlaGroup = maElementText; break;
+ case VMLX_TOKEN( TextHAlign ): mrClientData.mnTextHAlign = AttributeConversion::decodeToken( maElementText ); break;
+ case VMLX_TOKEN( TextVAlign ): mrClientData.mnTextVAlign = AttributeConversion::decodeToken( maElementText ); break;
+ case VMLX_TOKEN( Column ): mrClientData.mnCol = maElementText.toInt32(); break;
+ case VMLX_TOKEN( Row ): mrClientData.mnRow = maElementText.toInt32(); break;
+ case VMLX_TOKEN( Checked ): mrClientData.mnChecked = maElementText.toInt32(); break;
+ case VMLX_TOKEN( DropStyle ): mrClientData.mnDropStyle = AttributeConversion::decodeToken( maElementText ); break;
+ case VMLX_TOKEN( DropLines ): mrClientData.mnDropLines = maElementText.toInt32(); break;
+ case VMLX_TOKEN( Val ): mrClientData.mnVal = maElementText.toInt32(); break;
+ case VMLX_TOKEN( Min ): mrClientData.mnMin = maElementText.toInt32(); break;
+ case VMLX_TOKEN( Max ): mrClientData.mnMax = maElementText.toInt32(); break;
+ case VMLX_TOKEN( Inc ): mrClientData.mnInc = maElementText.toInt32(); break;
+ case VMLX_TOKEN( Page ): mrClientData.mnPage = maElementText.toInt32(); break;
+ case VMLX_TOKEN( SelType ): mrClientData.mnSelType = AttributeConversion::decodeToken( maElementText ); break;
+ case VMLX_TOKEN( VTEdit ): mrClientData.mnVTEdit = maElementText.toInt32(); break;
+ case VMLX_TOKEN( PrintObject ): mrClientData.mbPrintObject = lclDecodeVmlxBool( maElementText, true ); break;
+ case VMLX_TOKEN( Visible ): mrClientData.mbVisible = lclDecodeVmlxBool( maElementText, true ); break;
+ case VMLX_TOKEN( DDE ): mrClientData.mbDde = lclDecodeVmlxBool( maElementText, true ); break;
+ case VMLX_TOKEN( NoThreeD ): mrClientData.mbNo3D = lclDecodeVmlxBool( maElementText, true ); break;
+ case VMLX_TOKEN( NoThreeD2 ): mrClientData.mbNo3D2 = lclDecodeVmlxBool( maElementText, true ); break;
+ case VMLX_TOKEN( MultiLine ): mrClientData.mbMultiLine = lclDecodeVmlxBool( maElementText, true ); break;
+ case VMLX_TOKEN( VScroll ): mrClientData.mbVScroll = lclDecodeVmlxBool( maElementText, true ); break;
+ case VMLX_TOKEN( SecretEdit ): mrClientData.mbSecretEdit = lclDecodeVmlxBool( maElementText, true ); break;
}
}
@@ -145,24 +213,27 @@ ShapeContextBase::ShapeContextBase( ContextHandler2Helper& rParent ) :
}
/*static*/ ContextHandlerRef ShapeContextBase::createShapeContext( ContextHandler2Helper& rParent,
- sal_Int32 nElement, const AttributeList& rAttribs, ShapeContainer& rShapes )
+ ShapeContainer& rShapes, sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( nElement )
{
+ case O_TOKEN( shapelayout ):
+ return new ShapeLayoutContext( rParent, rShapes.getDrawing() );
+
case VML_TOKEN( shapetype ):
- return new ShapeTypeContext( rParent, rAttribs, rShapes.createShapeType() );
+ return new ShapeTypeContext( rParent, rShapes.createShapeType(), rAttribs );
case VML_TOKEN( group ):
- return new GroupShapeContext( rParent, rAttribs, rShapes.createShape< GroupShape >() );
+ return new GroupShapeContext( rParent, rShapes.createShape< GroupShape >(), rAttribs );
case VML_TOKEN( shape ):
- return new ShapeContext( rParent, rAttribs, rShapes.createShape< ComplexShape >() );
+ return new ShapeContext( rParent, rShapes.createShape< ComplexShape >(), rAttribs );
case VML_TOKEN( rect ):
return new RectangleShapeContext( rParent, rAttribs, rShapes.createShape< RectangleShape >() );
case VML_TOKEN( roundrect ):
- return new ShapeContext( rParent, rAttribs, rShapes.createShape< RectangleShape >() );
+ return new ShapeContext( rParent, rShapes.createShape< RectangleShape >(), rAttribs );
case VML_TOKEN( oval ):
- return new ShapeContext( rParent, rAttribs, rShapes.createShape< EllipseShape >() );
+ return new ShapeContext( rParent, rShapes.createShape< EllipseShape >(), rAttribs );
case VML_TOKEN( polyline ):
- return new ShapeContext( rParent, rAttribs, rShapes.createShape< PolyLineShape >() );
+ return new ShapeContext( rParent, rShapes.createShape< PolyLineShape >(), rAttribs );
// TODO:
case VML_TOKEN( arc ):
@@ -170,14 +241,14 @@ ShapeContextBase::ShapeContextBase( ContextHandler2Helper& rParent ) :
case VML_TOKEN( line ):
case VML_TOKEN( diagram ):
case VML_TOKEN( image ):
- return new ShapeContext( rParent, rAttribs, rShapes.createShape< ComplexShape >() );
+ return new ShapeContext( rParent, rShapes.createShape< ComplexShape >(), rAttribs );
}
return 0;
}
// ============================================================================
-ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper& rParent, const AttributeList& rAttribs, ShapeType& rShapeType ) :
+ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper& rParent, ShapeType& rShapeType, const AttributeList& rAttribs ) :
ShapeContextBase( rParent ),
mrTypeModel( rShapeType.getTypeModel() )
{
@@ -187,7 +258,7 @@ ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper& rParent, const Attrib
OSL_ENSURE( mrTypeModel.maShapeId.getLength() > 0, "ShapeTypeContext::ShapeTypeContext - missing shape identifier" );
// if the o:spid attribute exists, the id attribute contains the user-defined shape name
if( bHasOspid )
- mrTypeModel.maName = rAttribs.getXString( XML_id, OUString() );
+ mrTypeModel.maShapeName = rAttribs.getXString( XML_id, OUString() );
// builtin shape type identifier
mrTypeModel.moShapeType = rAttribs.getInteger( O_TOKEN( spt ) );
@@ -281,8 +352,8 @@ void ShapeTypeContext::setStyle( const OUString& rStyle )
// ============================================================================
-ShapeContext::ShapeContext( ContextHandler2Helper& rParent, const AttributeList& rAttribs, ShapeBase& rShape ) :
- ShapeTypeContext( rParent, rAttribs, rShape ),
+ShapeContext::ShapeContext( ContextHandler2Helper& rParent, ShapeBase& rShape, const AttributeList& rAttribs ) :
+ ShapeTypeContext( rParent, rShape, rAttribs ),
mrShape( rShape ),
mrShapeModel( rShape.getShapeModel() )
{
@@ -300,8 +371,13 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 nElement, const Attri
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextFrame")) );
// Excel specific shape client data
- if( isRootElement() && (nElement == VMLX_TOKEN( ClientData )) )
- return new ShapeClientDataContext( *this, rAttribs, mrShapeModel.createClientData() );
+ if( isRootElement() ) switch( nElement )
+ {
+ case VML_TOKEN( textbox ):
+ return new TextBoxContext( *this, mrShapeModel.createTextBox(), rAttribs );
+ case VMLX_TOKEN( ClientData ):
+ return new ClientDataContext( *this, mrShapeModel.createClientData(), rAttribs );
+ }
// handle remaining stuff in base class
return ShapeTypeContext::onCreateContext( nElement, rAttribs );
}
@@ -320,8 +396,8 @@ void ShapeContext::setPoints( const OUString& rPoints )
// ============================================================================
-GroupShapeContext::GroupShapeContext( ContextHandler2Helper& rParent, const AttributeList& rAttribs, GroupShape& rShape ) :
- ShapeContext( rParent, rAttribs, rShape ),
+GroupShapeContext::GroupShapeContext( ContextHandler2Helper& rParent, GroupShape& rShape, const AttributeList& rAttribs ) :
+ ShapeContext( rParent, rShape, rAttribs ),
mrShapes( rShape.getChildren() )
{
}
@@ -329,7 +405,7 @@ GroupShapeContext::GroupShapeContext( ContextHandler2Helper& rParent, const Attr
ContextHandlerRef GroupShapeContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
// try to create a context of an embedded shape
- ContextHandlerRef xContext = createShapeContext( *this, nElement, rAttribs, mrShapes );
+ ContextHandlerRef xContext = createShapeContext( *this, mrShapes, nElement, rAttribs );
// handle remaining stuff of this shape in base class
return xContext.get() ? xContext : ShapeContext::onCreateContext( nElement, rAttribs );
}
diff --git a/oox/source/helper/recordinputstream.cxx b/oox/source/vml/vmltextbox.cxx
index 1109d19d1d1f..9713517c39a4 100644..100755
--- a/oox/source/helper/recordinputstream.cxx
+++ b/oox/source/vml/vmltextbox.cxx
@@ -26,48 +26,59 @@
*
************************************************************************/
-#include "oox/helper/recordinputstream.hxx"
-#include <vector>
-#include <string.h>
+#include "oox/vml/vmltextbox.hxx"
-using ::rtl::OUString;
+#include <rtl/ustrbuf.hxx>
namespace oox {
+namespace vml {
+
+// ============================================================================
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
// ============================================================================
-RecordInputStream::RecordInputStream( const StreamDataSequence& rData ) :
- SequenceInputStream( rData )
+TextFontModel::TextFontModel()
+{
+}
+
+// ============================================================================
+
+TextPortionModel::TextPortionModel( const TextFontModel& rFont, const OUString& rText ) :
+ maFont( rFont ),
+ maText( rText )
+{
+}
+
+// ============================================================================
+
+TextBox::TextBox()
+{
+}
+
+void TextBox::appendPortion( const TextFontModel& rFont, const OUString& rText )
+{
+ maPortions.push_back( TextPortionModel( rFont, rText ) );
+}
+
+const TextFontModel* TextBox::getFirstFont() const
{
+ return maPortions.empty() ? 0 : &maPortions.front().maFont;
}
-OUString RecordInputStream::readString( bool b32BitLen )
+OUString TextBox::getText() const
{
- OUString aString;
- if( !isEof() )
- {
- sal_Int32 nCharCount = b32BitLen ? readValue< sal_Int32 >() : readValue< sal_Int16 >();
- // string length -1 is often used to indicate a missing string
- OSL_ENSURE( !isEof() && (nCharCount >= -1), "RecordInputStream::readString - invalid string length" );
- if( !isEof() && (nCharCount > 0) )
- {
- ::std::vector< sal_Unicode > aBuffer;
- aBuffer.reserve( getLimitedValue< size_t, sal_Int32 >( nCharCount + 1, 0, 0xFFFF ) );
- for( sal_Int32 nCharIdx = 0; !isEof() && (nCharIdx < nCharCount); ++nCharIdx )
- {
- sal_uInt16 nChar;
- readValue( nChar );
- aBuffer.push_back( static_cast< sal_Unicode >( nChar ) );
- }
- aBuffer.push_back( 0 );
- aString = OUString( &aBuffer.front() );
- }
- }
- return aString;
+ OUStringBuffer aBuffer;
+ for( PortionVector::const_iterator aIt = maPortions.begin(), aEnd = maPortions.end(); aIt != aEnd; ++aIt )
+ aBuffer.append( aIt->maText );
+ return aBuffer.makeStringAndClear();
}
// ============================================================================
+} // namespace vml
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/vml/vmltextboxcontext.cxx b/oox/source/vml/vmltextboxcontext.cxx
new file mode 100755
index 000000000000..4b57656b4f78
--- /dev/null
+++ b/oox/source/vml/vmltextboxcontext.cxx
@@ -0,0 +1,146 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "oox/vml/vmltextboxcontext.hxx"
+
+namespace oox {
+namespace vml {
+
+// ============================================================================
+
+using ::oox::core::ContextHandler2;
+using ::oox::core::ContextHandler2Helper;
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
+
+TextPortionContext::TextPortionContext( ContextHandler2Helper& rParent,
+ TextBox& rTextBox, const TextFontModel& rParentFont,
+ sal_Int32 nElement, const AttributeList& rAttribs ) :
+ ContextHandler2( rParent ),
+ mrTextBox( rTextBox ),
+ maFont( rParentFont ),
+ mnInitialPortions( rTextBox.getPortionCount() )
+{
+ switch( nElement )
+ {
+ case XML_font:
+ maFont.moName = rAttribs.getXString( XML_face );
+ maFont.moColor = rAttribs.getXString( XML_color );
+ maFont.monSize = rAttribs.getInteger( XML_size );
+ break;
+ case XML_u:
+ OSL_ENSURE( !maFont.monUnderline, "TextPortionContext::TextPortionContext - nested <u> elements" );
+ maFont.monUnderline = (rAttribs.getToken( XML_class, XML_TOKEN_INVALID ) == XML_font4) ? XML_double : XML_single;
+ break;
+ case XML_sub:
+ case XML_sup:
+ OSL_ENSURE( !maFont.monEscapement, "TextPortionContext::TextPortionContext - nested <sub> or <sup> elements" );
+ maFont.monEscapement = nElement;
+ break;
+ case XML_b:
+ OSL_ENSURE( !maFont.mobBold, "TextPortionContext::TextPortionContext - nested <b> elements" );
+ maFont.mobBold = true;
+ break;
+ case XML_i:
+ OSL_ENSURE( !maFont.mobItalic, "TextPortionContext::TextPortionContext - nested <i> elements" );
+ maFont.mobItalic = true;
+ break;
+ case XML_s:
+ OSL_ENSURE( !maFont.mobStrikeout, "TextPortionContext::TextPortionContext - nested <s> elements" );
+ maFont.mobStrikeout = true;
+ break;
+ default:
+ OSL_ENSURE( false, "TextPortionContext::TextPortionContext - unknown element" );
+ }
+}
+
+ContextHandlerRef TextPortionContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ OSL_ENSURE( nElement != XML_font, "TextPortionContext::onCreateContext - nested <font> elements" );
+ return new TextPortionContext( *this, mrTextBox, maFont, nElement, rAttribs );
+}
+
+void TextPortionContext::onCharacters( const OUString& rChars )
+{
+ switch( getCurrentElement() )
+ {
+ case XML_span:
+ // replace all NBSP characters with SP
+ mrTextBox.appendPortion( maFont, rChars.replace( 160, ' ' ) );
+ break;
+ default:
+ mrTextBox.appendPortion( maFont, rChars );
+ }
+}
+
+void TextPortionContext::onEndElement()
+{
+ /* An empty child element without own child elements represents a single
+ space character, for example:
+
+ <font>
+ <i>abc</i>
+ <font></font>
+ <b>def</b>
+ </font>
+
+ represents the italic text 'abc', an unformatted space character, and
+ the bold text 'def'.
+ */
+ if( (mnInitialPortions > 0) && (mrTextBox.getPortionCount() == mnInitialPortions) )
+ mrTextBox.appendPortion( maFont, OUString( sal_Unicode( ' ' ) ) );
+}
+
+// ============================================================================
+
+TextBoxContext::TextBoxContext( ContextHandler2Helper& rParent, TextBox& rTextBox, const AttributeList& /*rAttribs*/ ) :
+ ContextHandler2( rParent ),
+ mrTextBox( rTextBox )
+{
+}
+
+ContextHandlerRef TextBoxContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case VML_TOKEN( textbox ):
+ if( nElement == XML_div ) return this;
+ break;
+ case XML_div:
+ if( nElement == XML_font ) return new TextPortionContext( *this, mrTextBox, TextFontModel(), nElement, rAttribs );
+ break;
+ }
+ return 0;
+}
+
+// ============================================================================
+
+} // namespace vml
+} // namespace oox
+
diff --git a/oox/source/xls/addressconverter.cxx b/oox/source/xls/addressconverter.cxx
index 5dd8f99991e9..67e92ef57802 100644
--- a/oox/source/xls/addressconverter.cxx
+++ b/oox/source/xls/addressconverter.cxx
@@ -27,37 +27,37 @@
************************************************************************/
#include "oox/xls/addressconverter.hxx"
-#include <osl/diagnose.h>
-#include <rtl/ustrbuf.hxx>
-#include <rtl/strbuf.hxx>
+
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include "oox/helper/recordinputstream.hxx"
+#include <osl/diagnose.h>
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/biffoutputstream.hxx"
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OStringBuffer;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::rtl::OStringBuffer;
using ::rtl::OUStringToOString;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::sheet::XCellRangeAddressable;
-
-namespace oox {
-namespace xls {
// ============================================================================
namespace {
-//! TODO: this limit may be changed
+//! TODO: this limit may change, is there a way to obtain it via API?
const sal_Int16 API_MAXTAB = 255;
const sal_Int32 OOX_MAXCOL = static_cast< sal_Int32 >( (1 << 14) - 1 );
@@ -123,7 +123,7 @@ CellAddress ApiCellRangeList::getBaseAddress() const
// ============================================================================
-void BinAddress::read( RecordInputStream& rStrm )
+void BinAddress::read( SequenceInputStream& rStrm )
{
rStrm >> mnRow >> mnCol;
}
@@ -154,7 +154,7 @@ bool BinRange::contains( const BinAddress& rAddr ) const
(maFirst.mnRow <= rAddr.mnRow) && (rAddr.mnRow <= maLast.mnRow);
}
-void BinRange::read( RecordInputStream& rStrm )
+void BinRange::read( SequenceInputStream& rStrm )
{
rStrm >> maFirst.mnRow >> maLast.mnRow >> maFirst.mnCol >> maLast.mnCol;
}
@@ -199,7 +199,7 @@ BinRange BinRangeList::getEnclosingRange() const
return aRange;
}
-void BinRangeList::read( RecordInputStream& rStrm )
+void BinRangeList::read( SequenceInputStream& rStrm )
{
sal_Int32 nCount = rStrm.readInt32();
resize( getLimitedValue< size_t, sal_Int64 >( nCount, 0, rStrm.getRemaining() / 16 ) );
@@ -243,7 +243,7 @@ AddressConverter::AddressConverter( const WorkbookHelper& rHelper ) :
maDConChars.set( 0xFFFF, '\x01', 0xFFFF, '\x02', 0xFFFF );
switch( getFilterType() )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
initializeMaxPos( OOX_MAXTAB, OOX_MAXCOL, OOX_MAXROW );
break;
case FILTER_BIFF: switch( getBiff() )
@@ -783,4 +783,4 @@ void AddressConverter::initializeMaxPos(
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/autofilterbuffer.cxx b/oox/source/xls/autofilterbuffer.cxx
new file mode 100755
index 000000000000..7cf359f6d3c9
--- /dev/null
+++ b/oox/source/xls/autofilterbuffer.cxx
@@ -0,0 +1,853 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "oox/xls/autofilterbuffer.hxx"
+
+#include <com/sun/star/sheet/FilterConnection.hpp>
+#include <com/sun/star/sheet/FilterOperator2.hpp>
+#include <com/sun/star/sheet/TableFilterField2.hpp>
+#include <com/sun/star/sheet/XDatabaseRange.hpp>
+#include <com/sun/star/sheet/XSheetFilterDescriptor2.hpp>
+#include <com/sun/star/table/TableOrientation.hpp>
+#include <rtl/ustrbuf.hxx>
+#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/propertyset.hxx"
+#include "oox/xls/addressconverter.hxx"
+#include "oox/xls/biffinputstream.hxx"
+#include "oox/xls/defnamesbuffer.hxx"
+
+namespace oox {
+namespace xls {
+
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
+namespace {
+
+const sal_uInt8 BIFF12_TOP10FILTER_TOP = 0x01;
+const sal_uInt8 BIFF12_TOP10FILTER_PERCENT = 0x02;
+
+const sal_uInt16 BIFF12_FILTERCOLUMN_HIDDENBUTTON = 0x0001;
+const sal_uInt16 BIFF12_FILTERCOLUMN_SHOWBUTTON = 0x0002;
+
+const sal_uInt16 BIFF_FILTERCOLUMN_OR = 0x0001;
+const sal_uInt16 BIFF_FILTERCOLUMN_TOP10FILTER = 0x0010;
+const sal_uInt16 BIFF_FILTERCOLUMN_TOP = 0x0020;
+const sal_uInt16 BIFF_FILTERCOLUMN_PERCENT = 0x0040;
+
+const sal_uInt8 BIFF_FILTER_DATATYPE_NONE = 0;
+const sal_uInt8 BIFF_FILTER_DATATYPE_RK = 2;
+const sal_uInt8 BIFF_FILTER_DATATYPE_DOUBLE = 4;
+const sal_uInt8 BIFF_FILTER_DATATYPE_STRING = 6;
+const sal_uInt8 BIFF_FILTER_DATATYPE_BOOLEAN = 8;
+const sal_uInt8 BIFF_FILTER_DATATYPE_EMPTY = 12;
+const sal_uInt8 BIFF_FILTER_DATATYPE_NOTEMPTY = 14;
+
+// ----------------------------------------------------------------------------
+
+bool lclGetApiOperatorFromToken( sal_Int32& rnApiOperator, sal_Int32 nToken )
+{
+ switch( nToken )
+ {
+ case XML_lessThan: rnApiOperator = FilterOperator2::NOT_EQUAL; return true;
+ case XML_equal: rnApiOperator = FilterOperator2::EQUAL; return true;
+ case XML_lessThanOrEqual: rnApiOperator = FilterOperator2::LESS_EQUAL; return true;
+ case XML_greaterThan: rnApiOperator = FilterOperator2::GREATER; return true;
+ case XML_notEqual: rnApiOperator = FilterOperator2::NOT_EQUAL; return true;
+ case XML_greaterThanOrEqual: rnApiOperator = FilterOperator2::GREATER_EQUAL; return true;
+ }
+ return false;
+}
+
+/** Removes leading asterisk characters from the passed string.
+ @return True = at least one asterisk character has been removed. */
+bool lclTrimLeadingAsterisks( OUString& rValue )
+{
+ sal_Int32 nLength = rValue.getLength();
+ sal_Int32 nPos = 0;
+ while( (nPos < nLength) && (rValue[ nPos ] == '*') )
+ ++nPos;
+ if( nPos > 0 )
+ {
+ rValue = rValue.copy( nPos );
+ return true;
+ }
+ return false;
+}
+
+/** Removes trailing asterisk characters from the passed string.
+ @return True = at least one asterisk character has been removed. */
+bool lclTrimTrailingAsterisks( OUString& rValue )
+{
+ sal_Int32 nLength = rValue.getLength();
+ sal_Int32 nPos = nLength;
+ while( (nPos > 0) && (rValue[ nPos - 1 ] == '*') )
+ --nPos;
+ if( nPos < nLength )
+ {
+ rValue = rValue.copy( 0, nPos );
+ return true;
+ }
+ return false;
+}
+
+/** Converts wildcard characters '*' and '?' to regular expressions and quotes
+ RE meta characters.
+ @return True = passed string has been changed (RE needs to be enabled). */
+bool lclConvertWildcardsToRegExp( OUString& rValue )
+{
+ // check existence of the wildcard characters '*' and '?'
+ if( (rValue.getLength() > 0) && ((rValue.indexOf( '*' ) >= 0) || (rValue.indexOf( '?' ) >= 0)) )
+ {
+ OUStringBuffer aBuffer;
+ aBuffer.ensureCapacity( rValue.getLength() + 5 );
+ const sal_Unicode* pcChar = rValue.getStr();
+ const sal_Unicode* pcEnd = pcChar + rValue.getLength();
+ for( ; pcChar < pcEnd; ++pcChar )
+ {
+ switch( *pcChar )
+ {
+ case '?':
+ aBuffer.append( sal_Unicode( '.' ) );
+ break;
+ case '*':
+ aBuffer.append( sal_Unicode( '.' ) ).append( sal_Unicode( '*' ) );
+ break;
+ case '\\': case '.': case '|': case '(': case ')': case '^': case '$':
+ // quote RE meta characters
+ aBuffer.append( sal_Unicode( '\\' ) ).append( *pcChar );
+ break;
+ default:
+ aBuffer.append( *pcChar );
+ }
+ }
+ rValue = aBuffer.makeStringAndClear();
+ return true;
+ }
+ return false;
+}
+
+} // namespace
+
+// ============================================================================
+
+ApiFilterSettings::ApiFilterSettings()
+{
+}
+
+void ApiFilterSettings::appendField( bool bAnd, sal_Int32 nOperator, double fValue )
+{
+ maFilterFields.resize( maFilterFields.size() + 1 );
+ TableFilterField2& rFilterField = maFilterFields.back();
+ rFilterField.Connection = bAnd ? FilterConnection_AND : FilterConnection_OR;
+ rFilterField.Operator = nOperator;
+ rFilterField.IsNumeric = sal_True;
+ rFilterField.NumericValue = fValue;
+}
+
+void ApiFilterSettings::appendField( bool bAnd, sal_Int32 nOperator, const OUString& rValue )
+{
+ maFilterFields.resize( maFilterFields.size() + 1 );
+ TableFilterField2& rFilterField = maFilterFields.back();
+ rFilterField.Connection = bAnd ? FilterConnection_AND : FilterConnection_OR;
+ rFilterField.Operator = nOperator;
+ rFilterField.IsNumeric = sal_False;
+ rFilterField.StringValue = rValue;
+}
+
+// ============================================================================
+
+FilterSettingsBase::FilterSettingsBase( const WorkbookHelper& rHelper ) :
+ WorkbookHelper( rHelper )
+{
+}
+
+void FilterSettingsBase::importAttribs( sal_Int32 /*nElement*/, const AttributeList& /*rAttribs*/ )
+{
+}
+
+void FilterSettingsBase::importRecord( sal_Int32 /*nRecId*/, SequenceInputStream& /*rStrm*/ )
+{
+}
+
+void FilterSettingsBase::importBiffRecord( BiffInputStream& /*rStrm*/, sal_uInt16 /*nFlags*/ )
+{
+}
+
+ApiFilterSettings FilterSettingsBase::finalizeImport( sal_Int32 /*nMaxCount*/ )
+{
+ return ApiFilterSettings();
+}
+
+// ============================================================================
+
+DiscreteFilter::DiscreteFilter( const WorkbookHelper& rHelper ) :
+ FilterSettingsBase( rHelper ),
+ mnCalendarType( XML_none ),
+ mbShowBlank( false )
+{
+}
+
+void DiscreteFilter::importAttribs( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( nElement )
+ {
+ case XLS_TOKEN( filters ):
+ mnCalendarType = rAttribs.getToken( XML_calendarType, XML_none );
+ mbShowBlank = rAttribs.getBool( XML_blank, false );
+ break;
+
+ case XLS_TOKEN( filter ):
+ {
+ OUString aValue = rAttribs.getXString( XML_val, OUString() );
+ if( aValue.getLength() > 0 )
+ maValues.push_back( aValue );
+ }
+ break;
+ }
+}
+
+void DiscreteFilter::importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm )
+{
+ switch( nRecId )
+ {
+ case BIFF12_ID_DISCRETEFILTERS:
+ {
+ sal_Int32 nShowBlank, nCalendarType;
+ rStrm >> nShowBlank >> nCalendarType;
+
+ static const sal_Int32 spnCalendarTypes[] = {
+ XML_none, XML_gregorian, XML_gregorianUs, XML_japan, XML_taiwan, XML_korea, XML_hijri, XML_thai, XML_hebrew,
+ XML_gregorianMeFrench, XML_gregorianArabic, XML_gregorianXlitEnglish, XML_gregorianXlitFrench };
+ mnCalendarType = STATIC_ARRAY_SELECT( spnCalendarTypes, nCalendarType, XML_none );
+ mbShowBlank = nShowBlank != 0;
+ }
+ break;
+
+ case BIFF12_ID_DISCRETEFILTER:
+ {
+ OUString aValue = BiffHelper::readString( rStrm );
+ if( aValue.getLength() > 0 )
+ maValues.push_back( aValue );
+ }
+ break;
+ }
+}
+
+ApiFilterSettings DiscreteFilter::finalizeImport( sal_Int32 nMaxCount )
+{
+ ApiFilterSettings aSettings;
+ if( static_cast< sal_Int32 >( maValues.size() ) <= nMaxCount )
+ {
+ aSettings.maFilterFields.reserve( maValues.size() );
+
+ // insert all filter values
+ for( FilterValueVector::iterator aIt = maValues.begin(), aEnd = maValues.end(); aIt != aEnd; ++aIt )
+ aSettings.appendField( false, FilterOperator2::EQUAL, *aIt );
+
+ // extra field for 'show empty'
+ if( mbShowBlank )
+ aSettings.appendField( false, FilterOperator2::EMPTY, OUString() );
+
+ /* Require disabled regular expressions, filter entries may contain
+ any RE meta characters. */
+ if( !maValues.empty() )
+ aSettings.mobNeedsRegExp = false;
+ }
+ return aSettings;
+}
+
+// ============================================================================
+
+Top10Filter::Top10Filter( const WorkbookHelper& rHelper ) :
+ FilterSettingsBase( rHelper ),
+ mfValue( 0.0 ),
+ mbTop( true ),
+ mbPercent( false )
+{
+}
+
+void Top10Filter::importAttribs( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ if( nElement == XLS_TOKEN( top10 ) )
+ {
+ mfValue = rAttribs.getDouble( XML_val, 0.0 );
+ mbTop = rAttribs.getBool( XML_top, true );
+ mbPercent = rAttribs.getBool( XML_percent, false );
+ }
+}
+
+void Top10Filter::importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm )
+{
+ if( nRecId == BIFF12_ID_TOP10FILTER )
+ {
+ sal_uInt8 nFlags;
+ rStrm >> nFlags >> mfValue;
+ mbTop = getFlag( nFlags, BIFF12_TOP10FILTER_TOP );
+ mbPercent = getFlag( nFlags, BIFF12_TOP10FILTER_PERCENT );
+ }
+}
+
+void Top10Filter::importBiffRecord( BiffInputStream& /*rStrm*/, sal_uInt16 nFlags )
+{
+ mfValue = extractValue< sal_uInt16 >( nFlags, 7, 9 );
+ mbTop = getFlag( nFlags, BIFF_FILTERCOLUMN_TOP );
+ mbPercent = getFlag( nFlags, BIFF_FILTERCOLUMN_PERCENT );
+}
+
+ApiFilterSettings Top10Filter::finalizeImport( sal_Int32 /*nMaxCount*/ )
+{
+ sal_Int32 nOperator = mbTop ?
+ (mbPercent ? FilterOperator2::TOP_PERCENT : FilterOperator2::TOP_VALUES) :
+ (mbPercent ? FilterOperator2::BOTTOM_PERCENT : FilterOperator2::BOTTOM_VALUES);
+ ApiFilterSettings aSettings;
+ aSettings.appendField( true, nOperator, mfValue );
+ return aSettings;
+}
+
+// ============================================================================
+
+FilterCriterionModel::FilterCriterionModel() :
+ mnOperator( XML_equal ),
+ mnDataType( BIFF_FILTER_DATATYPE_NONE ),
+ mnStrLen( 0 )
+{
+}
+
+void FilterCriterionModel::setBiffOperator( sal_uInt8 nOperator )
+{
+ static const sal_Int32 spnOperators[] = { XML_TOKEN_INVALID,
+ XML_lessThan, XML_equal, XML_lessThanOrEqual, XML_greaterThan, XML_notEqual, XML_greaterThanOrEqual };
+ mnOperator = STATIC_ARRAY_SELECT( spnOperators, nOperator, XML_TOKEN_INVALID );
+}
+
+void FilterCriterionModel::readBiffData( SequenceInputStream& rStrm )
+{
+ sal_uInt8 nOperator;
+ rStrm >> mnDataType >> nOperator;
+ setBiffOperator( nOperator );
+
+ switch( mnDataType )
+ {
+ case BIFF_FILTER_DATATYPE_DOUBLE:
+ maValue <<= rStrm.readDouble();
+ break;
+ case BIFF_FILTER_DATATYPE_STRING:
+ {
+ rStrm.skip( 8 );
+ OUString aValue = BiffHelper::readString( rStrm ).trim();
+ if( aValue.getLength() > 0 )
+ maValue <<= aValue;
+ }
+ break;
+ case BIFF_FILTER_DATATYPE_BOOLEAN:
+ maValue <<= (rStrm.readuInt8() != 0);
+ rStrm.skip( 7 );
+ break;
+ case BIFF_FILTER_DATATYPE_EMPTY:
+ rStrm.skip( 8 );
+ if( mnOperator == XML_equal )
+ maValue <<= OUString();
+ break;
+ case BIFF_FILTER_DATATYPE_NOTEMPTY:
+ rStrm.skip( 8 );
+ if( mnOperator == XML_notEqual )
+ maValue <<= OUString();
+ break;
+ default:
+ OSL_ENSURE( false, "FilterCriterionModel::readBiffData - unexpected data type" );
+ rStrm.skip( 8 );
+ }
+}
+
+void FilterCriterionModel::readBiffData( BiffInputStream& rStrm )
+{
+ sal_uInt8 nOperator;
+ rStrm >> mnDataType >> nOperator;
+ setBiffOperator( nOperator );
+
+ switch( mnDataType )
+ {
+ case BIFF_FILTER_DATATYPE_NONE:
+ rStrm.skip( 8 );
+ break;
+ case BIFF_FILTER_DATATYPE_RK:
+ maValue <<= BiffHelper::calcDoubleFromRk( rStrm.readInt32() );
+ rStrm.skip( 4 );
+ break;
+ case BIFF_FILTER_DATATYPE_DOUBLE:
+ maValue <<= rStrm.readDouble();
+ break;
+ case BIFF_FILTER_DATATYPE_STRING:
+ rStrm.skip( 4 );
+ rStrm >> mnStrLen;
+ rStrm.skip( 3 );
+ break;
+ case BIFF_FILTER_DATATYPE_BOOLEAN:
+ {
+ sal_uInt8 nValue, nType;
+ rStrm >> nValue >> nType;
+ rStrm.skip( 6 );
+ switch( nType )
+ {
+ case BIFF_BOOLERR_BOOL: maValue <<= (nValue != 0); break;
+ case BIFF_BOOLERR_ERROR: maValue <<= BiffHelper::calcDoubleFromError( nValue ); break;
+ default: OSL_ENSURE( false, "FilterCriterionModel::readBiffData - unknown type" );
+ }
+ }
+ break;
+ case BIFF_FILTER_DATATYPE_EMPTY:
+ rStrm.skip( 8 );
+ if( mnOperator == XML_equal )
+ maValue <<= OUString();
+ break;
+ case BIFF_FILTER_DATATYPE_NOTEMPTY:
+ rStrm.skip( 8 );
+ if( mnOperator == XML_notEqual )
+ maValue <<= OUString();
+ break;
+ default:
+ OSL_ENSURE( false, "FilterCriterionModel::readBiffData - unexpected data type" );
+ rStrm.skip( 8 );
+ }
+}
+
+void FilterCriterionModel::readString( BiffInputStream& rStrm, BiffType eBiff, rtl_TextEncoding eTextEnc )
+{
+ if( (mnDataType == BIFF_FILTER_DATATYPE_STRING) && (mnStrLen > 0) )
+ {
+ OUString aValue = (eBiff == BIFF8) ?
+ rStrm.readUniStringBody( mnStrLen, true ) :
+ rStrm.readCharArrayUC( mnStrLen, eTextEnc, true );
+ aValue = aValue.trim();
+ if( aValue.getLength() > 0 )
+ maValue <<= aValue;
+ }
+}
+
+// ----------------------------------------------------------------------------
+
+CustomFilter::CustomFilter( const WorkbookHelper& rHelper ) :
+ FilterSettingsBase( rHelper ),
+ mbAnd( false )
+{
+}
+
+void CustomFilter::importAttribs( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( nElement )
+ {
+ case XLS_TOKEN( customFilters ):
+ mbAnd = rAttribs.getBool( XML_and, false );
+ break;
+
+ case XLS_TOKEN( customFilter ):
+ {
+ FilterCriterionModel aCriterion;
+ aCriterion.mnOperator = rAttribs.getToken( XML_operator, XML_equal );
+ OUString aValue = rAttribs.getXString( XML_val, OUString() ).trim();
+ if( (aCriterion.mnOperator == XML_equal) || (aCriterion.mnOperator == XML_notEqual) || (aValue.getLength() > 0) )
+ aCriterion.maValue <<= aValue;
+ appendCriterion( aCriterion );
+ }
+ break;
+ }
+}
+
+void CustomFilter::importRecord( sal_Int32 nRecId, SequenceInputStream& rStrm )
+{
+ switch( nRecId )
+ {
+ case BIFF12_ID_CUSTOMFILTERS:
+ mbAnd = rStrm.readInt32() == 0;
+ break;
+
+ case BIFF12_ID_CUSTOMFILTER:
+ {
+ FilterCriterionModel aCriterion;
+ aCriterion.readBiffData( rStrm );
+ appendCriterion( aCriterion );
+ }
+ break;
+ }
+}
+
+void CustomFilter::importBiffRecord( BiffInputStream& rStrm, sal_uInt16 nFlags )
+{
+ mbAnd = !getFlag( nFlags, BIFF_FILTERCOLUMN_OR );
+
+ FilterCriterionModel aCriterion1, aCriterion2;
+ aCriterion1.readBiffData( rStrm );
+ aCriterion2.readBiffData( rStrm );
+ aCriterion1.readString( rStrm, getBiff(), getTextEncoding() );
+ aCriterion2.readString( rStrm, getBiff(), getTextEncoding() );
+ appendCriterion( aCriterion1 );
+ appendCriterion( aCriterion2 );
+}
+
+ApiFilterSettings CustomFilter::finalizeImport( sal_Int32 /*nMaxCount*/ )
+{
+ ApiFilterSettings aSettings;
+ OSL_ENSURE( maCriteria.size() <= 2, "CustomFilter::finalizeImport - too many filter criteria" );
+ for( FilterCriterionVector::iterator aIt = maCriteria.begin(), aEnd = maCriteria.end(); aIt != aEnd; ++aIt )
+ {
+ // first extract the filter operator
+ sal_Int32 nOperator = 0;
+ bool bValidOperator = lclGetApiOperatorFromToken( nOperator, aIt->mnOperator );
+ if( bValidOperator )
+ {
+ if( aIt->maValue.has< OUString >() )
+ {
+ // string argument
+ OUString aValue;
+ aIt->maValue >>= aValue;
+ // check for 'empty', 'contains', 'begins with', or 'ends with' text filters
+ bool bEqual = nOperator == FilterOperator2::EQUAL;
+ bool bNotEqual = nOperator == FilterOperator2::NOT_EQUAL;
+ if( bEqual || bNotEqual )
+ {
+ if( aValue.getLength() == 0 )
+ {
+ // empty comparison string: create empty/not empty filters
+ nOperator = bNotEqual ? FilterOperator2::NOT_EMPTY : FilterOperator2::EMPTY;
+ }
+ else
+ {
+ // compare to something: try to find begins/ends/contains
+ bool bHasLeadingAsterisk = lclTrimLeadingAsterisks( aValue );
+ bool bHasTrailingAsterisk = lclTrimTrailingAsterisks( aValue );
+ // just '***' matches everything, do not create a filter field
+ bValidOperator = aValue.getLength() > 0;
+ if( bValidOperator )
+ {
+ if( bHasLeadingAsterisk && bHasTrailingAsterisk )
+ nOperator = bNotEqual ? FilterOperator2::DOES_NOT_CONTAIN : FilterOperator2::CONTAINS;
+ else if( bHasLeadingAsterisk )
+ nOperator = bNotEqual ? FilterOperator2::DOES_NOT_END_WITH : FilterOperator2::ENDS_WITH;
+ else if( bHasTrailingAsterisk )
+ nOperator = bNotEqual ? FilterOperator2::DOES_NOT_BEGIN_WITH : FilterOperator2::BEGINS_WITH;
+ // else: no asterisks, stick to equal/not equal
+ }
+ }
+ }
+
+ if( bValidOperator )
+ {
+ // if wildcards are present, require RE mode, otherwise keep don't care state
+ if( lclConvertWildcardsToRegExp( aValue ) )
+ aSettings.mobNeedsRegExp = true;
+ // create a new UNO API filter field
+ aSettings.appendField( mbAnd, nOperator, aValue );
+ }
+ }
+ else if( aIt->maValue.has< double >() )
+ {
+ // floating-point argument
+ double fValue = 0.0;
+ aIt->maValue >>= fValue;
+ aSettings.appendField( mbAnd, nOperator, fValue );
+ }
+ }
+ }
+ return aSettings;
+}
+
+void CustomFilter::appendCriterion( const FilterCriterionModel& rCriterion )
+{
+ if( (rCriterion.mnOperator != XML_TOKEN_INVALID) && rCriterion.maValue.hasValue() )
+ maCriteria.push_back( rCriterion );
+}
+
+// ============================================================================
+
+FilterColumn::FilterColumn( const WorkbookHelper& rHelper ) :
+ WorkbookHelper( rHelper ),
+ mnColId( -1 ),
+ mbHiddenButton( false ),
+ mbShowButton( true )
+{
+}
+
+void FilterColumn::importFilterColumn( const AttributeList& rAttribs )
+{
+ mnColId = rAttribs.getInteger( XML_colId, -1 );
+ mbHiddenButton = rAttribs.getBool( XML_hiddenButton, false );
+ mbShowButton = rAttribs.getBool( XML_showButton, true );
+}
+
+void FilterColumn::importFilterColumn( SequenceInputStream& rStrm )
+{
+ sal_uInt16 nFlags;
+ rStrm >> mnColId >> nFlags;
+ mbHiddenButton = getFlag( nFlags, BIFF12_FILTERCOLUMN_HIDDENBUTTON );
+ mbShowButton = getFlag( nFlags, BIFF12_FILTERCOLUMN_SHOWBUTTON );
+}
+
+void FilterColumn::importFilterColumn( BiffInputStream& rStrm )
+{
+ sal_uInt16 nFlags;
+ mnColId = rStrm.readuInt16();
+ rStrm >> nFlags;
+
+ // BIFF5/BIFF8 support top-10 filters and custom filters
+ if( getFlag( nFlags, BIFF_FILTERCOLUMN_TOP10FILTER ) )
+ createFilterSettings< Top10Filter >().importBiffRecord( rStrm, nFlags );
+ else
+ createFilterSettings< CustomFilter >().importBiffRecord( rStrm, nFlags );
+}
+
+ApiFilterSettings FilterColumn::finalizeImport( sal_Int32 nMaxCount )
+{
+ ApiFilterSettings aSettings;
+ if( (0 <= mnColId) && mxSettings.get() )
+ {
+ // filter settings object creates a sequence of filter fields
+ aSettings = mxSettings->finalizeImport( nMaxCount );
+ // add column index to all filter fields
+ for( ApiFilterSettings::FilterFieldVector::iterator aIt = aSettings.maFilterFields.begin(), aEnd = aSettings.maFilterFields.end(); aIt != aEnd; ++aIt )
+ aIt->Field = mnColId;
+ }
+ return aSettings;
+}
+
+// ============================================================================
+
+AutoFilter::AutoFilter( const WorkbookHelper& rHelper ) :
+ WorkbookHelper( rHelper )
+{
+}
+
+void AutoFilter::importAutoFilter( const AttributeList& rAttribs, sal_Int16 nSheet )
+{
+ OUString aRangeStr = rAttribs.getString( XML_ref, OUString() );
+ getAddressConverter().convertToCellRangeUnchecked( maRange, aRangeStr, nSheet );
+}
+
+void AutoFilter::importAutoFilter( SequenceInputStream& rStrm, sal_Int16 nSheet )
+{
+ BinRange aBinRange;
+ rStrm >> aBinRange;
+ getAddressConverter().convertToCellRangeUnchecked( maRange, aBinRange, nSheet );
+}
+
+FilterColumn& AutoFilter::createFilterColumn()
+{
+ FilterColumnVector::value_type xFilterColumn( new FilterColumn( *this ) );
+ maFilterColumns.push_back( xFilterColumn );
+ return *xFilterColumn;
+}
+
+void AutoFilter::finalizeImport( const Reference< XSheetFilterDescriptor2 >& rxFilterDesc )
+{
+ if( rxFilterDesc.is() )
+ {
+ // set some common properties for the auto filter range
+ PropertySet aDescProps( rxFilterDesc );
+ aDescProps.setProperty( PROP_IsCaseSensitive, false );
+ aDescProps.setProperty( PROP_SkipDuplicates, false );
+ aDescProps.setProperty( PROP_Orientation, TableOrientation_ROWS );
+ aDescProps.setProperty( PROP_ContainsHeader, true );
+ aDescProps.setProperty( PROP_CopyOutputData, false );
+
+ // maximum number of UNO API filter fields
+ sal_Int32 nMaxCount = 0;
+ aDescProps.getProperty( nMaxCount, PROP_MaxFieldCount );
+ OSL_ENSURE( nMaxCount > 0, "AutoFilter::finalizeImport - invalid maximum filter field count" );
+
+ // resulting list of all UNO API filter fields
+ ::std::vector< TableFilterField2 > aFilterFields;
+
+ // track if columns require to enable or disable regular expressions
+ OptValue< bool > obNeedsRegExp;
+
+ /* Track whether the filter fields of the first filter column are
+ connected with 'or'. In this case, other filter fields cannot be
+ inserted without altering the result of the entire filter, due to
+ Calc's precedence for the 'and' connection operator. Example:
+ Excel's filter conditions 'A1 and (B1 or B2) and C1' where B1 and
+ B2 belong to filter column B, will be evaluated by Calc as
+ '(A1 and B1) or (B2 and C1)'. */
+ bool bHasOrConnection = false;
+
+ // process all filter column objects, exit when 'or' connection exists
+ for( FilterColumnVector::iterator aIt = maFilterColumns.begin(), aEnd = maFilterColumns.end(); !bHasOrConnection && (aIt != aEnd); ++aIt )
+ {
+ // the filter settings object creates a list of filter fields
+ ApiFilterSettings aSettings = (*aIt)->finalizeImport( nMaxCount );
+ ApiFilterSettings::FilterFieldVector& rColumnFields = aSettings.maFilterFields;
+
+ // new total number of filter fields
+ sal_Int32 nNewCount = static_cast< sal_Int32 >( aFilterFields.size() + rColumnFields.size() );
+
+ /* Check whether mode for regular expressions is compatible with
+ the global mode in obNeedsRegExp. If either one is still in
+ don't-care state, all is fine. If both are set, they must be
+ equal. */
+ bool bRegExpCompatible = !obNeedsRegExp || !aSettings.mobNeedsRegExp || (obNeedsRegExp.get() == aSettings.mobNeedsRegExp.get());
+
+ // check whether fields are connected by 'or' (see comments above).
+ if( rColumnFields.size() >= 2 )
+ for( ApiFilterSettings::FilterFieldVector::iterator aSIt = rColumnFields.begin() + 1, aSEnd = rColumnFields.end(); !bHasOrConnection && (aSIt != aSEnd); ++aSIt )
+ bHasOrConnection = aSIt->Connection == FilterConnection_OR;
+
+ /* Skip the column filter, if no filter fields have been created,
+ if the number of new filter fields would exceed the total limit
+ of filter fields, or if the mode for regular expressions of the
+ filter column does not fit. */
+ if( !rColumnFields.empty() && (nNewCount <= nMaxCount) && bRegExpCompatible )
+ {
+ /* Add 'and' connection to the first filter field to connect
+ it to the existing filter fields of other columns. */
+ rColumnFields[ 0 ].Connection = FilterConnection_AND;
+
+ // insert the new filter fields
+ aFilterFields.insert( aFilterFields.end(), rColumnFields.begin(), rColumnFields.end() );
+
+ // update the regular expressions mode
+ obNeedsRegExp.assignIfUsed( aSettings.mobNeedsRegExp );
+ }
+ }
+
+ // insert all filter fields to the filter descriptor
+ if( !aFilterFields.empty() )
+ rxFilterDesc->setFilterFields2( ContainerHelper::vectorToSequence( aFilterFields ) );
+
+ // regular expressions
+ bool bUseRegExp = obNeedsRegExp.get( false );
+ aDescProps.setProperty( PROP_UseRegularExpressions, bUseRegExp );
+ }
+}
+
+// ============================================================================
+
+AutoFilterBuffer::AutoFilterBuffer( const WorkbookHelper& rHelper ) :
+ WorkbookHelper( rHelper )
+{
+}
+
+AutoFilter& AutoFilterBuffer::createAutoFilter()
+{
+ AutoFilterVector::value_type xAutoFilter( new AutoFilter( *this ) );
+ maAutoFilters.push_back( xAutoFilter );
+ return *xAutoFilter;
+}
+
+void AutoFilterBuffer::finalizeImport( sal_Int16 nSheet )
+{
+ // rely on existence of the defined name '_FilterDatabase' containing the range address of the filtered area
+ if( const DefinedName* pFilterDBName = getDefinedNames().getByBuiltinId( BIFF_DEFNAME_FILTERDATABASE, nSheet ).get() )
+ {
+ CellRangeAddress aFilterRange;
+ if( pFilterDBName->getAbsoluteRange( aFilterRange ) && (aFilterRange.Sheet == nSheet) )
+ {
+ // use the same name for the database range as used for the defined name '_FilterDatabase'
+ OUString aDBRangeName = pFilterDBName->getCalcName();
+ Reference< XDatabaseRange > xDatabaseRange = createDatabaseRangeObject( aDBRangeName, aFilterRange );
+ // first, try to create an auto filter
+ bool bHasAutoFilter = finalizeImport( xDatabaseRange );
+ // no success: try to create an advanced filter
+ if( !bHasAutoFilter && xDatabaseRange.is() )
+ {
+ // the built-in defined name 'Criteria' must exist
+ if( const DefinedName* pCriteriaName = getDefinedNames().getByBuiltinId( BIFF_DEFNAME_CRITERIA, nSheet ).get() )
+ {
+ CellRangeAddress aCriteriaRange;
+ if( pCriteriaName->getAbsoluteRange( aCriteriaRange ) )
+ {
+ // set some common properties for the filter descriptor
+ PropertySet aDescProps( xDatabaseRange->getFilterDescriptor() );
+ aDescProps.setProperty( PROP_IsCaseSensitive, false );
+ aDescProps.setProperty( PROP_SkipDuplicates, false );
+ aDescProps.setProperty( PROP_Orientation, TableOrientation_ROWS );
+ aDescProps.setProperty( PROP_ContainsHeader, true );
+ // criteria range may contain wildcards, but these are incompatible with REs
+ aDescProps.setProperty( PROP_UseRegularExpressions, false );
+
+ // position of output data (if built-in defined name 'Extract' exists)
+ DefinedNameRef xExtractName = getDefinedNames().getByBuiltinId( BIFF_DEFNAME_EXTRACT, nSheet );
+ CellRangeAddress aOutputRange;
+ bool bHasOutputRange = xExtractName.get() && xExtractName->getAbsoluteRange( aOutputRange );
+ aDescProps.setProperty( PROP_CopyOutputData, bHasOutputRange );
+ if( bHasOutputRange )
+ {
+ aDescProps.setProperty( PROP_SaveOutputPosition, true );
+ aDescProps.setProperty( PROP_OutputPosition, CellAddress( aOutputRange.Sheet, aOutputRange.StartColumn, aOutputRange.StartRow ) );
+ }
+
+ /* Properties of the database range (must be set after
+ modifying properties of the filter descriptor,
+ otherwise the 'FilterCriteriaSource' property gets
+ deleted). */
+ PropertySet aRangeProps( xDatabaseRange );
+ aRangeProps.setProperty( PROP_AutoFilter, false );
+ aRangeProps.setProperty( PROP_FilterCriteriaSource, aCriteriaRange );
+ }
+ }
+ }
+ }
+ }
+}
+
+bool AutoFilterBuffer::finalizeImport( const Reference< XDatabaseRange >& rxDatabaseRange )
+{
+ AutoFilter* pAutoFilter = getActiveAutoFilter();
+ if( pAutoFilter && rxDatabaseRange.is() ) try
+ {
+ // the property 'AutoFilter' enables the drop-down buttons
+ PropertySet aRangeProps( rxDatabaseRange );
+ aRangeProps.setProperty( PROP_AutoFilter, true );
+ // convert filter settings using the filter descriptor of the database range
+ Reference< XSheetFilterDescriptor2 > xFilterDesc( rxDatabaseRange->getFilterDescriptor(), UNO_QUERY_THROW );
+ pAutoFilter->finalizeImport( xFilterDesc );
+ // return true to indicate enabled autofilter
+ return true;
+ }
+ catch( Exception& )
+ {
+ }
+ return false;
+}
+
+AutoFilter* AutoFilterBuffer::getActiveAutoFilter()
+{
+ // Excel expects not more than one auto filter per sheet or table
+ OSL_ENSURE( maAutoFilters.size() == 1, "AutoFilterBuffer::getActiveAutoFilter - too many auto filters" );
+ // stick to the last imported auto filter
+ return maAutoFilters.empty() ? 0 : maAutoFilters.back().get();
+}
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
diff --git a/oox/source/xls/autofiltercontext.cxx b/oox/source/xls/autofiltercontext.cxx
index ccf3f880c7f9..3c4584d4a0da 100644
--- a/oox/source/xls/autofiltercontext.cxx
+++ b/oox/source/xls/autofiltercontext.cxx
@@ -27,746 +27,155 @@
************************************************************************/
#include "oox/xls/autofiltercontext.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/table/XCellRange.hpp>
-#include <com/sun/star/sheet/XDatabaseRange.hpp>
-#include <com/sun/star/sheet/XDatabaseRanges.hpp>
-#include <com/sun/star/sheet/XSheetFilterDescriptor.hpp>
-#include <com/sun/star/sheet/FilterOperator.hpp>
-#include <com/sun/star/sheet/FilterConnection.hpp>
-#include <com/sun/star/i18n/XLocaleData.hpp>
-#include "properties.hxx"
-#include "oox/helper/attributelist.hxx"
-#include "oox/helper/propertyset.hxx"
-#include "oox/core/filterbase.hxx"
-#include "oox/xls/addressconverter.hxx"
-#define DEBUG_OOX_AUTOFILTER 0
-
-#if USE_SC_MULTI_STRING_FILTER_PATCH
-#include <com/sun/star/sheet/XExtendedSheetFilterDescriptor.hpp>
-#include <com/sun/star/sheet/TableFilterFieldNormal.hpp>
-#include <com/sun/star/sheet/TableFilterFieldMultiString.hpp>
-using ::com::sun::star::sheet::TableFilterFieldNormal;
-using ::com::sun::star::sheet::TableFilterFieldMultiString;
-using ::com::sun::star::sheet::XExtendedSheetFilterDescriptor;
-#else
-#include <com/sun/star/sheet/TableFilterField.hpp>
-using ::com::sun::star::sheet::TableFilterField;
-#endif
-
-#if DEBUG_OOX_AUTOFILTER
-#include <stdio.h>
-#endif
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::sheet::XDatabaseRange;
-using ::com::sun::star::sheet::XDatabaseRanges;
-using ::com::sun::star::sheet::XSheetFilterDescriptor;
-using ::com::sun::star::i18n::LocaleDataItem;
-using ::com::sun::star::i18n::XLocaleData;
-using ::com::sun::star::lang::Locale;
-using ::oox::core::ContextHandlerRef;
+#include "oox/xls/autofilterbuffer.hxx"
+#include "oox/xls/biffinputstream.hxx"
namespace oox {
namespace xls {
-// ============================================================================
-
-FilterFieldItem::FilterFieldItem() :
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- mpField(new TableFilterFieldNormal),
-#else
- mpField(new TableFilterField),
-#endif
- meType(NORMAL)
-{
-}
-
-FilterFieldItem::FilterFieldItem(Type eType) :
- meType(eType)
-{
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- switch ( eType )
- {
- case MULTI_STRING:
- mpField.reset(new TableFilterFieldMultiString);
- break;
- case NORMAL:
- mpField.reset(new TableFilterFieldNormal);
- break;
- default:
- mpField.reset(new TableFilterFieldNormal);
- }
-#else
- mpField.reset(new TableFilterField);
- meType = NORMAL;
-#endif
-}
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
// ============================================================================
-OoxAutoFilterContext::OoxAutoFilterContext( OoxWorksheetFragmentBase& rFragment ) :
- OoxWorksheetContextBase( rFragment ),
- mbValidAddress( false ),
- mbUseRegex( false ),
- mbShowBlank( false ),
- mbConnectionAnd( false )
+FilterSettingsContext::FilterSettingsContext( WorksheetContextBase& rParent, FilterSettingsBase& rFilterSettings ) :
+ WorksheetContextBase( rParent ),
+ mrFilterSettings( rFilterSettings )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxAutoFilterContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
+ContextHandlerRef FilterSettingsContext::onCreateContext( sal_Int32 nElement, const AttributeList& /*rAttribs*/ )
{
switch( getCurrentElement() )
{
- case XLS_TOKEN( autoFilter ):
- switch( nElement )
- {
- case XLS_TOKEN( filterColumn ): return this;
- }
- break;
-
- case XLS_TOKEN( filterColumn ):
- switch( nElement )
- {
- case XLS_TOKEN( filters ):
- case XLS_TOKEN( customFilters ):
- case XLS_TOKEN( top10 ):
- case XLS_TOKEN( dynamicFilter ): return this;
- }
- break;
-
case XLS_TOKEN( filters ):
- switch( nElement )
- {
- case XLS_TOKEN( filter ): return this;
- }
+ if( nElement == XLS_TOKEN( filter ) ) return this;
break;
-
case XLS_TOKEN( customFilters ):
- switch( nElement )
- {
- case XLS_TOKEN( customFilter ): return this;
- }
+ if( nElement == XLS_TOKEN( customFilter ) ) return this;
break;
}
return 0;
}
-void OoxAutoFilterContext::onStartElement( const AttributeList& rAttribs )
+void FilterSettingsContext::onStartElement( const AttributeList& rAttribs )
{
- switch( getCurrentElement() )
- {
- case XLS_TOKEN( autoFilter ):
- importAutoFilter( rAttribs );
- break;
- case XLS_TOKEN( filterColumn ):
- if ( mbValidAddress )
- importFilterColumn( rAttribs );
- break;
- case XLS_TOKEN( filters ):
- if ( mbValidAddress )
- importFilters( rAttribs );
- break;
- case XLS_TOKEN( filter ):
- if ( mbValidAddress )
- importFilter( rAttribs );
- break;
- case XLS_TOKEN( customFilters ):
- if ( mbValidAddress )
- importCustomFilters( rAttribs );
- break;
- case XLS_TOKEN( customFilter ):
- if ( mbValidAddress )
- importCustomFilter( rAttribs );
- break;
- case XLS_TOKEN( top10 ):
- if ( mbValidAddress )
- importTop10( rAttribs );
- break;
- case XLS_TOKEN( dynamicFilter ):
- if ( mbValidAddress )
- importDynamicFilter( rAttribs );
- break;
- }
+ mrFilterSettings.importAttribs( getCurrentElement(), rAttribs );
}
-void OoxAutoFilterContext::onEndElement( const OUString& /*rChars*/ )
+ContextHandlerRef FilterSettingsContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ )
{
switch( getCurrentElement() )
{
- case XLS_TOKEN( autoFilter ):
- maybeShowBlank();
- setAutoFilter();
+ case BIFF12_ID_DISCRETEFILTERS:
+ if( nRecId == BIFF12_ID_DISCRETEFILTER ) return this;
break;
- case XLS_TOKEN( filters ):
- setFilterNames();
+ case BIFF12_ID_CUSTOMFILTERS:
+ if( nRecId == BIFF12_ID_CUSTOMFILTER ) return this;
break;
}
+ return 0;
}
-#if DEBUG_OOX_AUTOFILTER
-static void lclPrintNormalField(
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- TableFilterFieldNormal* pField
-#else
- TableFilterField* pField
-#endif
-)
+void FilterSettingsContext::onStartRecord( SequenceInputStream& rStrm )
{
- using namespace ::com::sun::star::sheet;
-
- printf(" Operator: ");
- switch ( pField->Operator )
- {
- case FilterOperator_EQUAL:
- printf("EQUAL");
- break;
- case FilterOperator_NOT_EQUAL:
- printf("NOT_EQUAL");
- break;
- case com::sun::star::sheet::FilterOperator_GREATER:
- printf("GREATER");
- break;
- case com::sun::star::sheet::FilterOperator_GREATER_EQUAL:
- printf("GREATER_EQUAL");
- break;
- case FilterOperator_LESS:
- printf("LESS");
- break;
- case FilterOperator_LESS_EQUAL:
- printf("LESS_EQUAL");
- break;
- case FilterOperator_NOT_EMPTY:
- printf("NOT_EMPTY");
- break;
- case FilterOperator_EMPTY:
- printf("EMPTY");
- break;
- case FilterOperator_BOTTOM_PERCENT:
- printf("BOTTOM_PERCENT");
- break;
- case FilterOperator_BOTTOM_VALUES:
- printf("BOTTOM_VALUES");
- break;
- case FilterOperator_TOP_PERCENT:
- printf("TOP_PERCENT");
- break;
- case FilterOperator_TOP_VALUES:
- printf("TOP_VALUES");
- break;
- default:
- printf("other");
- }
- printf("\n");
-
- printf(" StringValue: %s\n",
- OUStringToOString(pField->StringValue, RTL_TEXTENCODING_UTF8).getStr());
-
- printf(" NumericValue: %g\n", pField->NumericValue);
-
- printf(" IsNumeric: ");
- if (pField->IsNumeric)
- printf("yes\n");
- else
- printf("no\n");
+ mrFilterSettings.importRecord( getCurrentElement(), rStrm );
}
-static void lclPrintFieldConnection( ::com::sun::star::sheet::FilterConnection eConn )
-{
- using namespace ::com::sun::star::sheet;
+// ============================================================================
- printf(" Connection: ");
- switch ( eConn )
- {
- case FilterConnection_AND:
- printf("AND");
- break;
- case FilterConnection_OR:
- printf("OR");
- break;
- case FilterConnection_MAKE_FIXED_SIZE:
- printf("MAKE_FIXED_SIZE");
- break;
- default:
- printf("other");
- }
- printf("\n");
+FilterColumnContext::FilterColumnContext( WorksheetContextBase& rParent, FilterColumn& rFilterColumn ) :
+ WorksheetContextBase( rParent ),
+ mrFilterColumn( rFilterColumn )
+{
}
-static void lclPrintFilterField( const FilterFieldItem& aItem )
+ContextHandlerRef FilterColumnContext::onCreateContext( sal_Int32 nElement, const AttributeList& /*rAttribs*/ )
{
- using namespace ::com::sun::star::sheet;
-
- printf("----------------------------------------\n");
-#if USE_SC_MULTI_STRING_FILTER_PATCH
+ if( getCurrentElement() == XLS_TOKEN( filterColumn ) ) switch( nElement )
{
- // Print common fields first.
-
- TableFilterFieldBase* pField = aItem.mpField.get();
- printf(" Field: %ld\n", pField->Field);
- lclPrintFieldConnection(pField->Connection);
- }
- switch ( aItem.meType )
- {
- case FilterFieldItem::NORMAL:
- {
- TableFilterFieldNormal* pField = static_cast<TableFilterFieldNormal*>(aItem.mpField.get());
- lclPrintNormalField(pField);
- }
- break;
- case FilterFieldItem::MULTI_STRING:
- {
- TableFilterFieldMultiString* pMultiStrField = static_cast<TableFilterFieldMultiString*>(aItem.mpField.get());
- sal_Int32 nSize = pMultiStrField->StringSet.getLength();
- printf(" StringSet:\n");
- for ( sal_Int32 i = 0; i < nSize; ++i )
- {
- printf(" * %s\n",
- OUStringToOString(pMultiStrField->StringSet[i], RTL_TEXTENCODING_UTF8).getStr());
- }
- }
- break;
+ case XLS_TOKEN( filters ):
+ return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< DiscreteFilter >() );
+ case XLS_TOKEN( top10 ):
+ return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< Top10Filter >() );
+ case XLS_TOKEN( customFilters ):
+ return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< CustomFilter >() );
}
-#else
- TableFilterField* pField = aItem.mpField.get();
- printf(" Field: %ld\n", pField->Field);
- lclPrintFieldConnection(pField->Connection);
- lclPrintNormalField(pField);
-
-#endif
- fflush(stdout);
+ return 0;
}
-#endif
-void OoxAutoFilterContext::initialize()
+void FilterColumnContext::onStartElement( const AttributeList& rAttribs )
{
- maFields.clear();
- maFilterNames.clear();
- mbValidAddress = mbShowBlank = mbUseRegex = mbConnectionAnd = false;
+ mrFilterColumn.importFilterColumn( rAttribs );
}
-void OoxAutoFilterContext::setAutoFilter()
+ContextHandlerRef FilterColumnContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ )
{
- using namespace ::com::sun::star::sheet;
-
- // Name this built-in database.
- OUStringBuffer sDataAreaNameBuf( CREATE_OUSTRING("Excel_BuiltIn__FilterDatabase_ ") );
- sDataAreaNameBuf.append( static_cast<sal_Int32>(getSheetIndex()+1) );
-
- OUString sDataAreaName = sDataAreaNameBuf.makeStringAndClear();
- Reference< XCellRange > xCellRange = getCellRange( maAutoFilterRange );
-
- // Create a new database range, add filters to it and refresh the database
- // for that to take effect.
-
- Reference< XDatabaseRanges > xDBRanges = getDatabaseRanges();
- if ( !xDBRanges.is() )
- {
- OSL_ENSURE( false, "OoxAutoFilterContext::setAutoFilter: DBRange empty" );
- return;
- }
-
- Reference< XNameAccess > xNA( xDBRanges, UNO_QUERY_THROW );
- if ( !xNA->hasByName( sDataAreaName ) )
- xDBRanges->addNewByName( sDataAreaName, maAutoFilterRange );
-
- Reference< XDatabaseRange > xDB( xNA->getByName( sDataAreaName ), UNO_QUERY );
- if ( xDB.is() )
- {
- PropertySet aProp( xDB );
- aProp.setProperty( PROP_AutoFilter, true );
- }
-
- sal_Int32 nSize = maFields.size();
- sal_Int32 nMaxFieldCount = nSize;
- Reference< XSheetFilterDescriptor > xDescriptor = xDB->getFilterDescriptor();
- if ( xDescriptor.is() )
- {
- PropertySet aProp( xDescriptor );
- aProp.setProperty( PROP_ContainsHeader, true );
- aProp.setProperty( PROP_UseRegularExpressions, mbUseRegex );
- aProp.getProperty( nMaxFieldCount, PROP_MaxFieldCount );
- }
- else
+ if( getCurrentElement() == BIFF12_ID_FILTERCOLUMN ) switch( nRecId )
{
- OSL_ENSURE(false, "OoxAutoFilterContext::setAutoFilter: descriptor is empty");
- return;
+ case BIFF12_ID_DISCRETEFILTERS:
+ return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< DiscreteFilter >() );
+ case BIFF12_ID_TOP10FILTER:
+ return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< Top10Filter >() );
+ case BIFF12_ID_CUSTOMFILTERS:
+ return new FilterSettingsContext( *this, mrFilterColumn.createFilterSettings< CustomFilter >() );
}
-
- // Unpack all column field items into a sequence.
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- Reference< XExtendedSheetFilterDescriptor > xExtDescriptor( xDescriptor, UNO_QUERY );
- if ( !xExtDescriptor.is() )
- {
- OSL_ENSURE(false, "OoxAutoFilterContext::setAutoFilter: extended descriptor is empty");
- return;
- }
-
- xExtDescriptor->begin();
-
- ::std::list< FilterFieldItem >::const_iterator itr = maFields.begin(), itrEnd = maFields.end();
- for (sal_Int32 i = 0; itr != itrEnd && i < nMaxFieldCount; ++itr, ++i)
- {
-#if DEBUG_OOX_AUTOFILTER
- lclPrintFilterField(*itr);
-#endif
- switch ( itr->meType )
- {
- case oox::xls::FilterFieldItem::MULTI_STRING:
- {
- // multi-string filter type
- TableFilterFieldMultiString* pField = static_cast<TableFilterFieldMultiString*>( itr->mpField.get() );
- xExtDescriptor->addFilterFieldMultiString( *pField );
- }
- break;
- case oox::xls::FilterFieldItem::NORMAL:
- default:
- // normal filter type
- TableFilterFieldNormal* pField = static_cast<TableFilterFieldNormal*>( itr->mpField.get() );
- xExtDescriptor->addFilterFieldNormal( *pField );
- }
- }
- xExtDescriptor->commit();
-
-#else
- Sequence< TableFilterField > aFields(nSize);
- ::std::list< FilterFieldItem >::const_iterator itr = maFields.begin(), itrEnd = maFields.end();
- for (sal_Int32 i = 0; itr != itrEnd && i < nMaxFieldCount; ++itr, ++i)
- {
-#if DEBUG_OOX_AUTOFILTER
- lclPrintFilterField( *itr );
-#endif
- aFields[i] = *itr->mpField;
- }
- xDescriptor->setFilterFields( aFields );
-#endif
- xDB->refresh();
+ return 0;
}
-void OoxAutoFilterContext::maybeShowBlank()
+void FilterColumnContext::onStartRecord( SequenceInputStream& rStrm )
{
- using namespace ::com::sun::star::sheet;
-
- if ( !mbShowBlank )
- return;
-
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- FilterFieldItem aItem(FilterFieldItem::NORMAL);
- TableFilterFieldNormal* pField = static_cast<TableFilterFieldNormal*>(aItem.mpField.get());
- pField->Field = mnCurColID;
- pField->Operator = FilterOperator_EMPTY;
- pField->Connection = FilterConnection_AND;
- pField->IsNumeric = false;
-#else
- FilterFieldItem aItem;
- aItem.mpField->Field = mnCurColID;
- aItem.mpField->Operator = FilterOperator_EMPTY;
- aItem.mpField->Connection = FilterConnection_AND;
- aItem.mpField->IsNumeric = false;
-#endif
- maFields.push_back(aItem);
+ mrFilterColumn.importFilterColumn( rStrm );
}
-void OoxAutoFilterContext::setFilterNames()
-{
- using namespace ::com::sun::star::sheet;
-
-
- sal_Int32 size = maFilterNames.size();
- if ( !size )
- return;
-
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- Sequence< OUString > aStrList(size);
- ::std::list< OUString >::const_iterator itr = maFilterNames.begin(), itrEnd = maFilterNames.end();
- for (sal_Int32 i = 0; itr != itrEnd; ++itr, ++i)
- aStrList[i] = *itr;
-
- FilterFieldItem aItem(FilterFieldItem::MULTI_STRING);
- TableFilterFieldMultiString* pField = static_cast<TableFilterFieldMultiString*>( aItem.mpField.get() );
- pField->Field = mnCurColID;
- pField->Connection = FilterConnection_AND;
- pField->StringSet = aStrList;
-
- maFields.push_back(aItem);
-#else
- static const OUString sSep = CREATE_OUSTRING("|");
-
- OUStringBuffer buf;
- if ( size > 1 )
- {
- buf.append( CREATE_OUSTRING("^(") );
- mbUseRegex = true;
- }
-
- ::std::list< OUString >::const_iterator itr = maFilterNames.begin(), itrEnd = maFilterNames.end();
- bool bFirst = true;
- for (; itr != itrEnd; ++itr)
- {
- if (bFirst)
- bFirst = false;
- else
- buf.append( sSep );
- buf.append( *itr );
- }
- if ( size > 1 )
- buf.append( CREATE_OUSTRING(")$") );
-
- FilterFieldItem aItem;
- aItem.mpField->Field = mnCurColID;
- aItem.mpField->StringValue = buf.makeStringAndClear();
- aItem.mpField->Operator = FilterOperator_EQUAL;
- aItem.mpField->Connection = FilterConnection_AND;
- aItem.mpField->IsNumeric = false;
- maFields.push_back(aItem);
-#endif
-}
+// ============================================================================
-void OoxAutoFilterContext::importAutoFilter( const AttributeList& rAttribs )
+AutoFilterContext::AutoFilterContext( WorksheetFragmentBase& rFragment, AutoFilter& rAutoFilter ) :
+ WorksheetContextBase( rFragment ),
+ mrAutoFilter( rAutoFilter )
{
- initialize();
-
- mbValidAddress = getAddressConverter().convertToCellRange(
- maAutoFilterRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex(), true, true );
}
-void OoxAutoFilterContext::importFilterColumn( const AttributeList& rAttribs )
+ContextHandlerRef AutoFilterContext::onCreateContext( sal_Int32 nElement, const AttributeList& /*rAttribs*/ )
{
- // hiddenButton and showButton attributes are not used for now.
- mnCurColID = rAttribs.getInteger( XML_colId, -1 );
+ if( (getCurrentElement() == XLS_TOKEN( autoFilter )) && (nElement == XLS_TOKEN( filterColumn )) )
+ return new FilterColumnContext( *this, mrAutoFilter.createFilterColumn() );
+ return 0;
}
-void OoxAutoFilterContext::importTop10( const AttributeList& rAttribs )
+void AutoFilterContext::onStartElement( const AttributeList& rAttribs )
{
- using namespace ::com::sun::star::sheet;
-
- // filterVal attribute is not necessarily, since Calc also supports top 10
- // and top 10% filter type.
- FilterFieldItem aItem;
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- TableFilterFieldNormal* pField = static_cast<TableFilterFieldNormal*>(aItem.mpField.get());
-#else
- TableFilterField* pField = aItem.mpField.get();
-#endif
- pField->Field = mnCurColID;
-
- bool bPercent = rAttribs.getBool( XML_percent, false );
- bool bTop = rAttribs.getBool( XML_top, true );
- pField->NumericValue = rAttribs.getDouble( XML_val, 0.0 );
- pField->IsNumeric = true;
-
- // When top10 filter item is present, that's the only filter item for that column.
- if ( bTop )
- if ( bPercent )
- pField->Operator = FilterOperator_TOP_PERCENT;
- else
- pField->Operator = FilterOperator_TOP_VALUES;
- else
- if ( bPercent )
- pField->Operator = FilterOperator_BOTTOM_PERCENT;
- else
- pField->Operator = FilterOperator_BOTTOM_VALUES;
-
- maFields.push_back(aItem);
+ mrAutoFilter.importAutoFilter( rAttribs, getSheetIndex() );
}
-void OoxAutoFilterContext::importCustomFilters( const AttributeList& rAttribs )
+ContextHandlerRef AutoFilterContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ )
{
- // OR is default when the 'and' attribute is absent.
- mbConnectionAnd = rAttribs.getBool( XML_and, false );
+ if( (getCurrentElement() == BIFF12_ID_AUTOFILTER) && (nRecId == BIFF12_ID_FILTERCOLUMN) )
+ return new FilterColumnContext( *this, mrAutoFilter.createFilterColumn() );
+ return 0;
}
-/** Do a best-effort guess of whether or not the given string is numerical. */
-static bool lclIsNumeric( const OUString& _str, const LocaleDataItem& aLocaleItem )
+void AutoFilterContext::onStartRecord( SequenceInputStream& rStrm )
{
- OUString str = _str.trim();
- sal_Int32 size = str.getLength();
-
- if ( !size )
- // Empty string. This can't be a number.
- return false;
-
- // Get the decimal separator for the current locale.
- const OUString& sep = aLocaleItem.decimalSeparator;
-
- bool bDecimalSep = false;
- for (sal_Int32 i = 0; i < size; ++i)
- {
- OUString c = str.copy(i, 1);
- if ( !c.compareTo(sep) )
- {
- if ( bDecimalSep )
- return false;
- else
- {
- bDecimalSep = true;
- continue;
- }
- }
- if ( (0 > c.compareToAscii("0") || 0 < c.compareToAscii("9")) )
- return false;
- }
-
- return true;
+ mrAutoFilter.importAutoFilter( rStrm, getSheetIndex() );
}
-/** Convert wildcard characters to regex equivalent. Returns true if any
- wildcard character is found. */
-static bool lclWildcard2Regex( OUString& str )
-{
- bool bWCFound = false;
- OUStringBuffer buf;
- sal_Int32 size = str.getLength();
- buf.ensureCapacity(size + 6); // pure heuristics.
-
- sal_Unicode dot = '.', star = '*', hat = '^', dollar = '$';
- buf.append(hat);
- for (sal_Int32 i = 0; i < size; ++i)
- {
- OUString c = str.copy(i, 1);
- if ( !c.compareToAscii("?") )
- {
- buf.append(dot);
- bWCFound = true;
- }
- else if ( !c.compareToAscii("*") )
- {
- buf.append(dot);
- buf.append(star);
- bWCFound = true;
- }
- else
- buf.append(c);
- }
- buf.append(dollar);
-
- if (bWCFound)
- str = buf.makeStringAndClear();
-
- return bWCFound;
-}
+// ============================================================================
-/** Translate Excel's filter operator to Calc's. */
-static ::com::sun::star::sheet::FilterOperator lclTranslateFilterOp( sal_Int32 nToken )
+BiffAutoFilterContext::BiffAutoFilterContext( const WorksheetHelper& rHelper, AutoFilter& rAutoFilter ) :
+ BiffWorksheetContextBase( rHelper ),
+ mrAutoFilter( rAutoFilter )
{
- using namespace ::com::sun::star::sheet;
-
- switch ( nToken )
- {
- case XML_equal:
- return FilterOperator_EQUAL;
- case XML_notEqual:
- return FilterOperator_NOT_EQUAL;
- case XML_greaterThan:
- return FilterOperator_GREATER;
- case XML_greaterThanOrEqual:
- return FilterOperator_GREATER_EQUAL;
- case XML_lessThan:
- return FilterOperator_LESS;
- case XML_lessThanOrEqual:
- return FilterOperator_LESS_EQUAL;
- }
- return FilterOperator_EQUAL;
}
-void OoxAutoFilterContext::importCustomFilter( const AttributeList& rAttribs )
+void BiffAutoFilterContext::importRecord( BiffInputStream& rStrm )
{
- using namespace ::com::sun::star::sheet;
-
- sal_Int32 nToken = rAttribs.getToken( XML_operator, XML_equal );
-#if USE_SC_MULTI_STRING_FILTER_PATCH
- FilterFieldItem aItem(FilterFieldItem::NORMAL);
- TableFilterFieldNormal* pField = static_cast<TableFilterFieldNormal*>(aItem.mpField.get());
-#else
- FilterFieldItem aItem;
- TableFilterField* pField = aItem.mpField.get();
-#endif
- pField->Field = mnCurColID;
- pField->StringValue = rAttribs.getString( XML_val, OUString() );
- pField->NumericValue = pField->StringValue.toDouble();
- pField->Operator = lclTranslateFilterOp( nToken );
-
- if ( nToken == XML_notEqual && !pField->StringValue.compareToAscii(" ") )
+ switch( rStrm.getRecId() )
{
- // Special case for hiding blanks. Excel translates "hide blanks" to
- // (filter if notEqual " "). So, we need to translate it back.
- pField->Operator = FilterOperator_NOT_EMPTY;
- pField->IsNumeric = false;
- maFields.push_back(aItem);
- return;
+ // nothing to read for BIFF_ID_AUTOFILTER
+ case BIFF_ID_FILTERCOLUMN: mrAutoFilter.createFilterColumn().importFilterColumn( rStrm ); break;
}
-
- switch ( nToken )
- {
- case XML_equal:
- case XML_notEqual:
- {
- Reference< XLocaleData > xLocale( getGlobalFactory()->createInstance(
- CREATE_OUSTRING("com.sun.star.i18n.LocaleData") ), UNO_QUERY );
-
- if ( !xLocale.is() )
- return;
-
- LocaleDataItem aLocaleItem = xLocale->getLocaleItem( ::com::sun::star::lang::Locale() );
- pField->IsNumeric = lclIsNumeric(pField->StringValue, aLocaleItem);
-
- if ( !pField->IsNumeric && lclWildcard2Regex(pField->StringValue) )
- mbUseRegex = true;
-
- maFields.push_back(aItem);
- }
- break;
-
- case XML_greaterThan:
- case XML_greaterThanOrEqual:
- case XML_lessThan:
- case XML_lessThanOrEqual:
- {
- pField->IsNumeric = true;
- maFields.push_back(aItem);
- }
- break;
- default:
- OSL_ENSURE( false, "OoxAutoFilterContext::importCustomFilter: unhandled case" );
- }
-}
-
-void OoxAutoFilterContext::importFilters( const AttributeList& rAttribs )
-{
- // blank (boolean) and calendarType attributes can be present, but not used for now.
-
- mbShowBlank = rAttribs.getBool( XML_blank, false );
- maFilterNames.clear();
-}
-
-void OoxAutoFilterContext::importFilter( const AttributeList& rAttribs )
-{
- if (mnCurColID == -1)
- return;
-
- OUString value = rAttribs.getString( XML_val, OUString() );
- if ( value.getLength() )
- maFilterNames.push_back(value);
-}
-
-void OoxAutoFilterContext::importDynamicFilter( const AttributeList& /*rAttribs*/ )
-{
- // not implemented yet - Calc doesn't support this.
}
// ============================================================================
@@ -774,4 +183,4 @@ void OoxAutoFilterContext::importDynamicFilter( const AttributeList& /*rAttribs*
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/biffcodec.cxx b/oox/source/xls/biffcodec.cxx
index a5ba02204d2e..5a2fbf9ada91 100644
--- a/oox/source/xls/biffcodec.cxx
+++ b/oox/source/xls/biffcodec.cxx
@@ -27,18 +27,24 @@
************************************************************************/
#include "oox/xls/biffcodec.hxx"
+
#include <osl/thread.h>
#include <string.h>
#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::FilterBase;
using ::rtl::OString;
using ::rtl::OUString;
using ::rtl::OStringToOUString;
-using ::oox::core::FilterBase;
-
-namespace oox {
-namespace xls {
// ============================================================================
@@ -51,9 +57,16 @@ BiffDecoderBase::~BiffDecoderBase()
{
}
-::comphelper::DocPasswordVerifierResult BiffDecoderBase::verifyPassword( const OUString& rPassword )
+::comphelper::DocPasswordVerifierResult BiffDecoderBase::verifyPassword( const OUString& rPassword, Sequence< NamedValue >& o_rEncryptionData )
{
- mbValid = implVerify( rPassword );
+ o_rEncryptionData = implVerifyPassword( rPassword );
+ mbValid = o_rEncryptionData.hasElements();
+ return mbValid ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
+}
+
+::comphelper::DocPasswordVerifierResult BiffDecoderBase::verifyEncryptionData( const Sequence< NamedValue >& rEncryptionData )
+{
+ mbValid = implVerifyEncryptionData( rEncryptionData );
return mbValid ? ::comphelper::DocPasswordVerifierResult_OK : ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
}
@@ -72,7 +85,6 @@ void BiffDecoderBase::decode( sal_uInt8* pnDestData, const sal_uInt8* pnSrcData,
BiffDecoder_XOR::BiffDecoder_XOR( sal_uInt16 nKey, sal_uInt16 nHash ) :
maCodec( ::oox::core::BinaryCodec_XOR::CODEC_EXCEL ),
- maPassword( 16 ),
mnKey( nKey ),
mnHash( nHash )
{
@@ -81,12 +93,12 @@ BiffDecoder_XOR::BiffDecoder_XOR( sal_uInt16 nKey, sal_uInt16 nHash ) :
BiffDecoder_XOR::BiffDecoder_XOR( const BiffDecoder_XOR& rDecoder ) :
BiffDecoderBase(), // must be called to prevent compiler warning
maCodec( ::oox::core::BinaryCodec_XOR::CODEC_EXCEL ),
- maPassword( rDecoder.maPassword ),
+ maEncryptionData( rDecoder.maEncryptionData ),
mnKey( rDecoder.mnKey ),
mnHash( rDecoder.mnHash )
{
if( isValid() )
- maCodec.initKey( &maPassword.front() );
+ maCodec.initCodec( maEncryptionData );
}
BiffDecoder_XOR* BiffDecoder_XOR::implClone()
@@ -94,24 +106,40 @@ BiffDecoder_XOR* BiffDecoder_XOR::implClone()
return new BiffDecoder_XOR( *this );
}
-bool BiffDecoder_XOR::implVerify( const OUString& rPassword )
+Sequence< NamedValue > BiffDecoder_XOR::implVerifyPassword( const OUString& rPassword )
{
+ maEncryptionData.realloc( 0 );
+
/* Convert password to a byte string. TODO: this needs some finetuning
according to the spec... */
OString aBytePassword = OUStringToOString( rPassword, osl_getThreadTextEncoding() );
sal_Int32 nLen = aBytePassword.getLength();
if( (0 < nLen) && (nLen < 16) )
{
- // copy byte string to sal_uInt8 array
- maPassword.clear();
- maPassword.resize( 16, 0 );
- memcpy( &maPassword.front(), aBytePassword.getStr(), static_cast< size_t >( nLen ) );
+ // init codec
+ maCodec.initKey( reinterpret_cast< const sal_uInt8* >( aBytePassword.getStr() ) );
+
+ if( maCodec.verifyKey( mnKey, mnHash ) )
+ maEncryptionData = maCodec.getEncryptionData();
+ }
+
+ return maEncryptionData;
+}
+
+bool BiffDecoder_XOR::implVerifyEncryptionData( const Sequence< NamedValue >& rEncryptionData )
+{
+ maEncryptionData.realloc( 0 );
+ if( rEncryptionData.hasElements() )
+ {
// init codec
- maCodec.initKey( &maPassword.front() );
- return maCodec.verifyKey( mnKey, mnHash );
+ maCodec.initCodec( rEncryptionData );
+
+ if( maCodec.verifyKey( mnKey, mnHash ) )
+ maEncryptionData = rEncryptionData;
}
- return false;
+
+ return maEncryptionData.hasElements();
}
void BiffDecoder_XOR::implDecode( sal_uInt8* pnDestData, const sal_uInt8* pnSrcData, sal_Int64 nStreamPos, sal_uInt16 nBytes )
@@ -142,7 +170,6 @@ sal_Int32 lclGetRcfOffset( sal_Int64 nStreamPos )
// ----------------------------------------------------------------------------
BiffDecoder_RCF::BiffDecoder_RCF( sal_uInt8 pnSalt[ 16 ], sal_uInt8 pnVerifier[ 16 ], sal_uInt8 pnVerifierHash[ 16 ] ) :
- maPassword( 16, 0 ),
maSalt( pnSalt, pnSalt + 16 ),
maVerifier( pnVerifier, pnVerifier + 16 ),
maVerifierHash( pnVerifierHash, pnVerifierHash + 16 )
@@ -151,13 +178,13 @@ BiffDecoder_RCF::BiffDecoder_RCF( sal_uInt8 pnSalt[ 16 ], sal_uInt8 pnVerifier[
BiffDecoder_RCF::BiffDecoder_RCF( const BiffDecoder_RCF& rDecoder ) :
BiffDecoderBase(), // must be called to prevent compiler warning
- maPassword( rDecoder.maPassword ),
+ maEncryptionData( rDecoder.maEncryptionData ),
maSalt( rDecoder.maSalt ),
maVerifier( rDecoder.maVerifier ),
maVerifierHash( rDecoder.maVerifierHash )
{
if( isValid() )
- maCodec.initKey( &maPassword.front(), &maSalt.front() );
+ maCodec.initCodec( maEncryptionData );
}
BiffDecoder_RCF* BiffDecoder_RCF::implClone()
@@ -165,25 +192,44 @@ BiffDecoder_RCF* BiffDecoder_RCF::implClone()
return new BiffDecoder_RCF( *this );
}
-bool BiffDecoder_RCF::implVerify( const OUString& rPassword )
+Sequence< NamedValue > BiffDecoder_RCF::implVerifyPassword( const OUString& rPassword )
{
+ maEncryptionData.realloc( 0 );
+
sal_Int32 nLen = rPassword.getLength();
if( (0 < nLen) && (nLen < 16) )
{
// copy string to sal_uInt16 array
- maPassword.clear();
- maPassword.resize( 16, 0 );
+ ::std::vector< sal_uInt16 > aPassVect( 16 );
const sal_Unicode* pcChar = rPassword.getStr();
const sal_Unicode* pcCharEnd = pcChar + nLen;
- ::std::vector< sal_uInt16 >::iterator aIt = maPassword.begin();
+ ::std::vector< sal_uInt16 >::iterator aIt = aPassVect.begin();
for( ; pcChar < pcCharEnd; ++pcChar, ++aIt )
*aIt = static_cast< sal_uInt16 >( *pcChar );
// init codec
- maCodec.initKey( &maPassword.front(), &maSalt.front() );
- return maCodec.verifyKey( &maVerifier.front(), &maVerifierHash.front() );
+ maCodec.initKey( &aPassVect.front(), &maSalt.front() );
+ if( maCodec.verifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
+ maEncryptionData = maCodec.getEncryptionData();
}
- return false;
+
+ return maEncryptionData;
+}
+
+bool BiffDecoder_RCF::implVerifyEncryptionData( const Sequence< NamedValue >& rEncryptionData )
+{
+ maEncryptionData.realloc( 0 );
+
+ if( rEncryptionData.hasElements() )
+ {
+ // init codec
+ maCodec.initCodec( rEncryptionData );
+
+ if( maCodec.verifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
+ maEncryptionData = rEncryptionData;
+ }
+
+ return maEncryptionData.hasElements();
}
void BiffDecoder_RCF::implDecode( sal_uInt8* pnDestData, const sal_uInt8* pnSrcData, sal_Int64 nStreamPos, sal_uInt16 nBytes )
@@ -317,7 +363,7 @@ bool BiffCodecHelper::importFilePass( BiffInputStream& rStrm )
mxDecoder = implReadFilePass( rStrm, getBiff() );
// request and verify a password (decoder implements IDocPasswordVerifier)
if( mxDecoder.get() )
- getBaseFilter().requestPassword( *mxDecoder );
+ getBaseFilter().requestEncryptionData( *mxDecoder );
// correct password is indicated by isValid() function of decoder
return mxDecoder.get() && mxDecoder->isValid();
}
@@ -333,4 +379,4 @@ void BiffCodecHelper::cloneDecoder( BiffInputStream& rStrm )
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/biffdetector.cxx b/oox/source/xls/biffdetector.cxx
index 8bb708d3b415..7af1d61e3d78 100644
--- a/oox/source/xls/biffdetector.cxx
+++ b/oox/source/xls/biffdetector.cxx
@@ -27,31 +27,31 @@
************************************************************************/
#include "oox/xls/biffdetector.hxx"
+
#include <algorithm>
-#include <rtl/strbuf.hxx>
#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <comphelper/mediadescriptor.hxx>
+#include <rtl/strbuf.hxx>
#include "oox/helper/binaryinputstream.hxx"
#include "oox/ole/olestorage.hxx"
-using ::rtl::OUString;
-using ::rtl::OStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::XInterface;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::io::XInputStream;
-using ::comphelper::MediaDescriptor;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+
+using ::comphelper::MediaDescriptor;
+using ::rtl::OStringBuffer;
+using ::rtl::OUString;
+
+// ============================================================================
+
Sequence< OUString > BiffDetector_getSupportedServiceNames()
{
Sequence< OUString > aServiceNames( 1 );
@@ -61,18 +61,18 @@ Sequence< OUString > BiffDetector_getSupportedServiceNames()
OUString BiffDetector_getImplementationName()
{
- return CREATE_OUSTRING( "com.sun.star.comp.oox.BiffDetector" );
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.BiffDetector" );
}
-Reference< XInterface > SAL_CALL BiffDetector_createInstance( const Reference< XMultiServiceFactory >& rxFactory ) throw( Exception )
+Reference< XInterface > SAL_CALL BiffDetector_createInstance( const Reference< XComponentContext >& rxContext ) throw( Exception )
{
- return static_cast< ::cppu::OWeakObject* >( new BiffDetector( rxFactory ) );
+ return static_cast< ::cppu::OWeakObject* >( new BiffDetector( rxContext ) );
}
// ============================================================================
-BiffDetector::BiffDetector( const Reference< XMultiServiceFactory >& rxFactory ) :
- mxFactory( rxFactory )
+BiffDetector::BiffDetector( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ mxContext( rxContext, UNO_SET_THROW )
{
}
@@ -80,7 +80,7 @@ BiffDetector::~BiffDetector()
{
}
-BiffType BiffDetector::detectStreamBiffVersion( BinaryInputStream& rInStream )
+/*static*/ BiffType BiffDetector::detectStreamBiffVersion( BinaryInputStream& rInStream )
{
BiffType eBiff = BIFF_UNKNOWN;
if( !rInStream.isEof() && rInStream.isSeekable() && (rInStream.getLength() > 4) )
@@ -133,36 +133,36 @@ BiffType BiffDetector::detectStreamBiffVersion( BinaryInputStream& rInStream )
return eBiff;
}
-BiffType BiffDetector::detectStorageBiffVersion( OUString& orWorkbookStreamName, StorageRef xStorage )
+/*static*/ BiffType BiffDetector::detectStorageBiffVersion( OUString& orWorkbookStreamName, const StorageRef& rxStorage )
{
static const OUString saBookName = CREATE_OUSTRING( "Book" );
static const OUString saWorkbookName = CREATE_OUSTRING( "Workbook" );
BiffType eBiff = BIFF_UNKNOWN;
- if( xStorage.get() )
+ if( rxStorage.get() )
{
- if( xStorage->isStorage() )
+ if( rxStorage->isStorage() )
{
// try to open the "Book" stream
- BinaryXInputStream aBookStrm5( xStorage->openInputStream( saBookName ), true );
+ BinaryXInputStream aBookStrm5( rxStorage->openInputStream( saBookName ), true );
BiffType eBookStrm5Biff = detectStreamBiffVersion( aBookStrm5 );
// try to open the "Workbook" stream
- BinaryXInputStream aBookStrm8( xStorage->openInputStream( saWorkbookName ), true );
+ BinaryXInputStream aBookStrm8( rxStorage->openInputStream( saWorkbookName ), true );
BiffType eBookStrm8Biff = detectStreamBiffVersion( aBookStrm8 );
// decide which stream to use
if( (eBookStrm8Biff != BIFF_UNKNOWN) && ((eBookStrm5Biff == BIFF_UNKNOWN) || (eBookStrm8Biff > eBookStrm5Biff)) )
{
- /* Only "Workbook" stream exists; or both streams exist,
- and "Workbook" has higher BIFF version than "Book" stream. */
+ /* Only "Workbook" stream exists; or both streams exist, and
+ "Workbook" has higher BIFF version than "Book" stream. */
eBiff = eBookStrm8Biff;
orWorkbookStreamName = saWorkbookName;
}
else if( eBookStrm5Biff != BIFF_UNKNOWN )
{
- /* Only "Book" stream exists; or both streams exist,
- and "Book" has higher BIFF version than "Workbook" stream. */
+ /* Only "Book" stream exists; or both streams exist, and
+ "Book" has higher BIFF version than "Workbook" stream. */
eBiff = eBookStrm5Biff;
orWorkbookStreamName = saBookName;
}
@@ -170,7 +170,7 @@ BiffType BiffDetector::detectStorageBiffVersion( OUString& orWorkbookStreamName,
else
{
// no storage, try plain input stream from medium (even for BIFF5+)
- BinaryXInputStream aStrm( xStorage->openInputStream( OUString() ), false );
+ BinaryXInputStream aStrm( rxStorage->openInputStream( OUString() ), false );
eBiff = detectStreamBiffVersion( aStrm );
orWorkbookStreamName = OUString();
}
@@ -188,7 +188,7 @@ OUString SAL_CALL BiffDetector::getImplementationName() throw( RuntimeException
sal_Bool SAL_CALL BiffDetector::supportsService( const OUString& rService ) throw( RuntimeException )
{
- const Sequence< OUString > aServices( BiffDetector_getSupportedServiceNames() );
+ const Sequence< OUString > aServices = BiffDetector_getSupportedServiceNames();
const OUString* pArray = aServices.getConstArray();
const OUString* pArrayEnd = pArray + aServices.getLength();
return ::std::find( pArray, pArrayEnd, rService ) != pArrayEnd;
@@ -208,20 +208,19 @@ OUString SAL_CALL BiffDetector::detect( Sequence< PropertyValue >& rDescriptor )
MediaDescriptor aDescriptor( rDescriptor );
aDescriptor.addInputStream();
- Reference< XInputStream > xInStrm( aDescriptor[ MediaDescriptor::PROP_INPUTSTREAM() ], UNO_QUERY );
- if( xInStrm.is() )
+ Reference< XMultiServiceFactory > xFactory( mxContext->getServiceManager(), UNO_QUERY_THROW );
+ Reference< XInputStream > xInStrm( aDescriptor[ MediaDescriptor::PROP_INPUTSTREAM() ], UNO_QUERY_THROW );
+ StorageRef xStorage( new ::oox::ole::OleStorage( xFactory, xInStrm, true ) );
+
+ OUString aWorkbookName;
+ switch( detectStorageBiffVersion( aWorkbookName, xStorage ) )
{
- OUString aWorkbookName;
- StorageRef xStorage( new ::oox::ole::OleStorage( mxFactory, xInStrm, true ) );
- switch( detectStorageBiffVersion( aWorkbookName, xStorage ) )
- {
- case BIFF2:
- case BIFF3:
- case BIFF4: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_40" ); break;
- case BIFF5: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_95" ); break;
- case BIFF8: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_97" ); break;
- default:;
- }
+ case BIFF2:
+ case BIFF3:
+ case BIFF4: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_40" ); break;
+ case BIFF5: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_95" ); break;
+ case BIFF8: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_97" ); break;
+ default:;
}
return aTypeName;
@@ -232,4 +231,4 @@ OUString SAL_CALL BiffDetector::detect( Sequence< PropertyValue >& rDescriptor )
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/biffhelper.cxx b/oox/source/xls/biffhelper.cxx
index ad790fc9f2e9..1f32e2204525 100644
--- a/oox/source/xls/biffhelper.cxx
+++ b/oox/source/xls/biffhelper.cxx
@@ -27,20 +27,23 @@
************************************************************************/
#include "oox/xls/biffhelper.hxx"
+
#include <rtl/math.hxx>
#include <rtl/tencinfo.h>
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/biffoutputstream.hxx"
#include "oox/xls/worksheethelper.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-
namespace oox {
namespace xls {
// ============================================================================
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
const sal_Int32 BIFF_RK_100FLAG = 0x00000001;
@@ -187,6 +190,8 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm,
// ============================================================================
+// conversion -----------------------------------------------------------------
+
/*static*/ double BiffHelper::calcDoubleFromRk( sal_Int32 nRkValue )
{
DecodedDouble aDecDbl( 0.0 );
@@ -263,6 +268,53 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm,
return static_cast< sal_uInt16 >( (nCodePage == 0) ? 1252 : nCodePage );
}
+// BIFF12 import --------------------------------------------------------------
+
+/*static*/ OUString BiffHelper::readString( SequenceInputStream& rStrm, bool b32BitLen )
+{
+ OUString aString;
+ if( !rStrm.isEof() )
+ {
+ sal_Int32 nCharCount = b32BitLen ? rStrm.readValue< sal_Int32 >() : rStrm.readValue< sal_Int16 >();
+ // string length -1 is often used to indicate a missing string
+ OSL_ENSURE( !rStrm.isEof() && (nCharCount >= -1), "BiffHelper::readString - invalid string length" );
+ if( !rStrm.isEof() && (nCharCount > 0) )
+ {
+ ::std::vector< sal_Unicode > aBuffer;
+ aBuffer.reserve( getLimitedValue< size_t, sal_Int32 >( nCharCount + 1, 0, 0xFFFF ) );
+ for( sal_Int32 nCharIdx = 0; !rStrm.isEof() && (nCharIdx < nCharCount); ++nCharIdx )
+ {
+ sal_uInt16 nChar;
+ rStrm.readValue( nChar );
+ aBuffer.push_back( static_cast< sal_Unicode >( nChar ) );
+ }
+ aBuffer.push_back( 0 );
+ aString = OUString( &aBuffer.front() );
+ }
+ }
+ return aString;
+}
+
+// BIFF2-BIFF8 import ---------------------------------------------------------
+
+/*static*/ bool BiffHelper::isBofRecord( BiffInputStream& rStrm )
+{
+ return
+ (rStrm.getRecId() == BIFF2_ID_BOF) ||
+ (rStrm.getRecId() == BIFF3_ID_BOF) ||
+ (rStrm.getRecId() == BIFF4_ID_BOF) ||
+ (rStrm.getRecId() == BIFF5_ID_BOF);
+}
+
+/*static*/ bool BiffHelper::skipRecordBlock( BiffInputStream& rStrm, sal_uInt16 nEndRecId )
+{
+ sal_uInt16 nStartRecId = rStrm.getRecId();
+ while( rStrm.startNextRecord() && (rStrm.getRecId() != nEndRecId) )
+ if( rStrm.getRecId() == nStartRecId )
+ skipRecordBlock( rStrm, nEndRecId );
+ return !rStrm.isEof() && (rStrm.getRecId() == nEndRecId);
+}
+
/*static*/ void BiffHelper::importImgData( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, BiffType eBiff )
{
sal_uInt16 nFormat, nEnv;
@@ -286,4 +338,4 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm,
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/biffinputstream.cxx b/oox/source/xls/biffinputstream.cxx
index dd8d5baede5c..62f1af123c58 100644
--- a/oox/source/xls/biffinputstream.cxx
+++ b/oox/source/xls/biffinputstream.cxx
@@ -27,17 +27,20 @@
************************************************************************/
#include "oox/xls/biffinputstream.hxx"
+
#include <algorithm>
#include <rtl/ustrbuf.hxx>
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
using ::rtl::OString;
using ::rtl::OStringToOUString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-namespace oox {
-namespace xls {
-
// ============================================================================
namespace prv {
@@ -630,4 +633,4 @@ BiffInputStreamPosGuard::~BiffInputStreamPosGuard()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/biffoutputstream.cxx b/oox/source/xls/biffoutputstream.cxx
index 5e87e683e075..3f1efc24bd77 100644
--- a/oox/source/xls/biffoutputstream.cxx
+++ b/oox/source/xls/biffoutputstream.cxx
@@ -207,4 +207,4 @@ sal_uInt16 BiffOutputStream::prepareRawBlock( sal_Int32 nTotalSize )
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/chartsheetfragment.cxx b/oox/source/xls/chartsheetfragment.cxx
index 61fc356b5ec5..82b5d4ef5b3c 100644
--- a/oox/source/xls/chartsheetfragment.cxx
+++ b/oox/source/xls/chartsheetfragment.cxx
@@ -27,32 +27,32 @@
************************************************************************/
#include "oox/xls/chartsheetfragment.hxx"
+
#include "oox/helper/attributelist.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/pagesettings.hxx"
#include "oox/xls/viewsettings.hxx"
#include "oox/xls/workbooksettings.hxx"
#include "oox/xls/worksheetsettings.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
-
namespace oox {
namespace xls {
// ============================================================================
-OoxChartsheetFragment::OoxChartsheetFragment( const WorkbookHelper& rHelper,
- const OUString& rFragmentPath, ISegmentProgressBarRef xProgressBar, sal_Int16 nSheet ) :
- OoxWorksheetFragmentBase( rHelper, rFragmentPath, xProgressBar, SHEETTYPE_CHARTSHEET, nSheet )
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+ChartsheetFragment::ChartsheetFragment( const WorkbookHelper& rHelper,
+ const OUString& rFragmentPath, const ISegmentProgressBarRef& rxProgressBar, sal_Int16 nSheet ) :
+ WorksheetFragmentBase( rHelper, rFragmentPath, rxProgressBar, SHEETTYPE_CHARTSHEET, nSheet )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxChartsheetFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ChartsheetFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -87,14 +87,14 @@ ContextHandlerRef OoxChartsheetFragment::onCreateContext( sal_Int32 nElement, co
case XLS_TOKEN( oddHeader ):
case XLS_TOKEN( oddFooter ):
case XLS_TOKEN( evenHeader ):
- case XLS_TOKEN( evenFooter ): return this; // collect contents in onEndElement()
+ case XLS_TOKEN( evenFooter ): return this; // collect contents in onCharacters()
}
break;
}
return 0;
}
-void OoxChartsheetFragment::onEndElement( const OUString& rChars )
+void ChartsheetFragment::onCharacters( const OUString& rChars )
{
switch( getCurrentElement() )
{
@@ -109,60 +109,58 @@ void OoxChartsheetFragment::onEndElement( const OUString& rChars )
}
}
-ContextHandlerRef OoxChartsheetFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ChartsheetFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_WORKSHEET ) return this;
+ if( nRecId == BIFF12_ID_WORKSHEET ) return this;
break;
- case OOBIN_ID_WORKSHEET:
+ case BIFF12_ID_WORKSHEET:
switch( nRecId )
{
- case OOBIN_ID_CHARTSHEETVIEWS: return this;
-
- case OOBIN_ID_CHARTSHEETPR: getWorksheetSettings().importChartSheetPr( rStrm ); break;
- case OOBIN_ID_CHARTPROTECTION: getWorksheetSettings().importChartProtection( rStrm ); break;
- case OOBIN_ID_PAGEMARGINS: getPageSettings().importPageMargins( rStrm ); break;
- case OOBIN_ID_CHARTPAGESETUP: getPageSettings().importChartPageSetup( getRelations(), rStrm ); break;
- case OOBIN_ID_HEADERFOOTER: getPageSettings().importHeaderFooter( rStrm ); break;
- case OOBIN_ID_PICTURE: getPageSettings().importPicture( getRelations(), rStrm ); break;
- case OOBIN_ID_DRAWING: importDrawing( rStrm ); break;
+ case BIFF12_ID_CHARTSHEETVIEWS: return this;
+
+ case BIFF12_ID_CHARTSHEETPR: getWorksheetSettings().importChartSheetPr( rStrm ); break;
+ case BIFF12_ID_CHARTPROTECTION: getWorksheetSettings().importChartProtection( rStrm ); break;
+ case BIFF12_ID_PAGEMARGINS: getPageSettings().importPageMargins( rStrm ); break;
+ case BIFF12_ID_CHARTPAGESETUP: getPageSettings().importChartPageSetup( getRelations(), rStrm ); break;
+ case BIFF12_ID_HEADERFOOTER: getPageSettings().importHeaderFooter( rStrm ); break;
+ case BIFF12_ID_PICTURE: getPageSettings().importPicture( getRelations(), rStrm ); break;
+ case BIFF12_ID_DRAWING: importDrawing( rStrm ); break;
}
break;
- case OOBIN_ID_CHARTSHEETVIEWS:
- if( nRecId == OOBIN_ID_CHARTSHEETVIEW ) getSheetViewSettings().importChartSheetView( rStrm );
+ case BIFF12_ID_CHARTSHEETVIEWS:
+ if( nRecId == BIFF12_ID_CHARTSHEETVIEW ) getSheetViewSettings().importChartSheetView( rStrm );
break;
}
return 0;
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxChartsheetFragment::getRecordInfos() const
+const RecordInfo* ChartsheetFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_CHARTSHEETVIEW, OOBIN_ID_CHARTSHEETVIEW + 1 },
- { OOBIN_ID_CHARTSHEETVIEWS, OOBIN_ID_CHARTSHEETVIEWS + 1 },
- { OOBIN_ID_CUSTOMCHARTVIEW, OOBIN_ID_CUSTOMCHARTVIEW + 1 },
- { OOBIN_ID_CUSTOMCHARTVIEWS, OOBIN_ID_CUSTOMCHARTVIEWS + 1 },
- { OOBIN_ID_HEADERFOOTER, OOBIN_ID_HEADERFOOTER + 1 },
- { OOBIN_ID_WORKSHEET, OOBIN_ID_WORKSHEET + 1 },
+ { BIFF12_ID_CHARTSHEETVIEW, BIFF12_ID_CHARTSHEETVIEW + 1 },
+ { BIFF12_ID_CHARTSHEETVIEWS, BIFF12_ID_CHARTSHEETVIEWS + 1 },
+ { BIFF12_ID_CUSTOMCHARTVIEW, BIFF12_ID_CUSTOMCHARTVIEW + 1 },
+ { BIFF12_ID_CUSTOMCHARTVIEWS, BIFF12_ID_CUSTOMCHARTVIEWS + 1 },
+ { BIFF12_ID_HEADERFOOTER, BIFF12_ID_HEADERFOOTER + 1 },
+ { BIFF12_ID_WORKSHEET, BIFF12_ID_WORKSHEET + 1 },
{ -1, -1 }
};
return spRecInfos;
}
-void OoxChartsheetFragment::initializeImport()
+void ChartsheetFragment::initializeImport()
{
// initial processing in base class WorksheetHelper
initializeWorksheetImport();
}
-void OoxChartsheetFragment::finalizeImport()
+void ChartsheetFragment::finalizeImport()
{
// final processing in base class WorksheetHelper
finalizeWorksheetImport();
@@ -170,21 +168,21 @@ void OoxChartsheetFragment::finalizeImport()
// private --------------------------------------------------------------------
-void OoxChartsheetFragment::importDrawing( const AttributeList& rAttribs )
+void ChartsheetFragment::importDrawing( const AttributeList& rAttribs )
{
setDrawingPath( getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ) );
}
-void OoxChartsheetFragment::importDrawing( RecordInputStream& rStrm )
+void ChartsheetFragment::importDrawing( SequenceInputStream& rStrm )
{
- setDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) );
+ setDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) );
}
// ============================================================================
BiffChartsheetFragment::BiffChartsheetFragment( const BiffWorkbookFragmentBase& rParent,
- ISegmentProgressBarRef xProgressBar, sal_Int16 nSheet ) :
- BiffWorksheetFragmentBase( rParent, xProgressBar, SHEETTYPE_CHARTSHEET, nSheet )
+ const ISegmentProgressBarRef& rxProgressBar, sal_Int16 nSheet ) :
+ BiffWorksheetFragmentBase( rParent, rxProgressBar, SHEETTYPE_CHARTSHEET, nSheet )
{
}
@@ -198,80 +196,82 @@ bool BiffChartsheetFragment::importFragment()
PageSettings& rPageSett = getPageSettings();
// process all record in this sheet fragment
- while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
+ BiffInputStream& rStrm = getInputStream();
+ while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
{
- if( isBofRecord() )
+ if( BiffHelper::isBofRecord( rStrm ) )
{
// skip unknown embedded fragments (BOF/EOF blocks)
skipFragment();
}
else
{
- sal_uInt16 nRecId = mrStrm.getRecId();
+ sal_uInt16 nRecId = rStrm.getRecId();
switch( nRecId )
{
// records in all BIFF versions
- case BIFF_ID_BOTTOMMARGIN: rPageSett.importBottomMargin( mrStrm ); break;
- case BIFF_ID_CHBEGIN: skipRecordBlock( BIFF_ID_CHEND ); break;
- case BIFF_ID_FOOTER: rPageSett.importFooter( mrStrm ); break;
- case BIFF_ID_HEADER: rPageSett.importHeader( mrStrm ); break;
- case BIFF_ID_LEFTMARGIN: rPageSett.importLeftMargin( mrStrm ); break;
- case BIFF_ID_PASSWORD: rWorksheetSett.importPassword( mrStrm ); break;
- case BIFF_ID_PROTECT: rWorksheetSett.importProtect( mrStrm ); break;
- case BIFF_ID_RIGHTMARGIN: rPageSett.importRightMargin( mrStrm ); break;
- case BIFF_ID_TOPMARGIN: rPageSett.importTopMargin( mrStrm ); break;
+ case BIFF_ID_BOTTOMMARGIN: rPageSett.importBottomMargin( rStrm ); break;
+ case BIFF_ID_CHBEGIN: BiffHelper::skipRecordBlock( rStrm, BIFF_ID_CHEND ); break;
+ case BIFF_ID_FOOTER: rPageSett.importFooter( rStrm ); break;
+ case BIFF_ID_HEADER: rPageSett.importHeader( rStrm ); break;
+ case BIFF_ID_LEFTMARGIN: rPageSett.importLeftMargin( rStrm ); break;
+ case BIFF_ID_PASSWORD: rWorksheetSett.importPassword( rStrm ); break;
+ case BIFF_ID_PROTECT: rWorksheetSett.importProtect( rStrm ); break;
+ case BIFF_ID_RIGHTMARGIN: rPageSett.importRightMargin( rStrm ); break;
+ case BIFF_ID_TOPMARGIN: rPageSett.importTopMargin( rStrm ); break;
// BIFF specific records
default: switch( getBiff() )
{
case BIFF2: switch( nRecId )
{
- case BIFF2_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF2_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF3: switch( nRecId )
{
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF4: switch( nRecId )
{
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF5: switch( nRecId )
{
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( mrStrm ); break;
- case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( mrStrm ); break;
- case BIFF_ID_SCL: rSheetViewSett.importScl( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
+ case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( rStrm ); break;
+ case BIFF_ID_SCL: rSheetViewSett.importScl( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF8: switch( nRecId )
{
- case BIFF_ID_CODENAME: rWorksheetSett.importCodeName( mrStrm ); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_PICTURE: rPageSett.importPicture( mrStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( mrStrm ); break;
- case BIFF_ID_SCL: rSheetViewSett.importScl( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_CODENAME: rWorksheetSett.importCodeName( rStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_PICTURE: rPageSett.importPicture( rStrm ); break;
+ case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
+ case BIFF_ID_SCL: rSheetViewSett.importScl( rStrm ); break;
+ case BIFF_ID_SHEETEXT: rWorksheetSett.importSheetExt( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
@@ -283,7 +283,7 @@ bool BiffChartsheetFragment::importFragment()
// final processing in base class WorksheetHelper
finalizeWorksheetImport();
- return mrStrm.getRecId() == BIFF_ID_EOF;
+ return rStrm.getRecId() == BIFF_ID_EOF;
}
// ============================================================================
@@ -291,4 +291,4 @@ bool BiffChartsheetFragment::importFragment()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/commentsbuffer.cxx b/oox/source/xls/commentsbuffer.cxx
index 035c14a606ec..8217a0148a0b 100644
--- a/oox/source/xls/commentsbuffer.cxx
+++ b/oox/source/xls/commentsbuffer.cxx
@@ -27,12 +27,12 @@
************************************************************************/
#include "oox/xls/commentsbuffer.hxx"
+
#include <com/sun/star/sheet/XSheetAnnotationAnchor.hpp>
#include <com/sun/star/sheet/XSheetAnnotationShapeSupplier.hpp>
#include <com/sun/star/sheet/XSheetAnnotations.hpp>
#include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>
#include "oox/helper/attributelist.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/vml/vmlshape.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/drawingfragment.hxx"
@@ -43,19 +43,6 @@
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/text/XTextRange.hpp>
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::drawing::XShape;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::XSheetAnnotation;
-using ::com::sun::star::sheet::XSheetAnnotationAnchor;
-using ::com::sun::star::sheet::XSheetAnnotationShapeSupplier;
-using ::com::sun::star::sheet::XSheetAnnotations;
-using ::com::sun::star::sheet::XSheetAnnotationsSupplier;
-
using ::com::sun::star::text::XText;
using ::com::sun::star::text::XTextRange;
using ::com::sun::star::awt::Size;
@@ -99,6 +86,15 @@ namespace xls {
// ============================================================================
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
CommentModel::CommentModel() :
mnAuthorId( -1 )
{
@@ -173,7 +169,7 @@ void Comment::importAnchor( bool bFrom, sal_Int32 nWhich, const OUString &rChars
}
}
-void Comment::importComment( RecordInputStream& rStrm )
+void Comment::importComment( SequenceInputStream& rStrm )
{
BinRange aBinRange;
rStrm >> maModel.mnAuthorId >> aBinRange;
@@ -189,7 +185,7 @@ RichStringRef Comment::createText()
void Comment::finalizeImport()
{
- // OOBIN format stores cell range instead of cell address, use first cell of this range
+ // BIFF12 stores cell range instead of cell address, use first cell of this range
OSL_ENSURE( (maModel.maRange.StartColumn == maModel.maRange.EndColumn) &&
(maModel.maRange.StartRow == maModel.maRange.EndRow),
"Comment::finalizeImport - comment anchor should be a single cell" );
@@ -233,9 +229,8 @@ void Comment::finalizeImport()
// position and formatting
pNoteShape->convertFormatting( xAnnoShape );
// visibility
- const ::oox::vml::ShapeModel::ShapeClientDataPtr& rxClientData = pNoteShape->getShapeModel().mxClientData;
- bool bVisible = rxClientData.get() && rxClientData->mbVisible;
- xAnno->setIsVisible( bVisible );
+ const ::oox::vml::ClientData* pClientData = pNoteShape->getClientData();
+ xAnno->setIsVisible( pClientData && pClientData->mbVisible );
}
}
}
@@ -273,4 +268,4 @@ void CommentsBuffer::finalizeImport()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/commentsfragment.cxx b/oox/source/xls/commentsfragment.cxx
index 6ab15d29eda4..169b45d6d83f 100644
--- a/oox/source/xls/commentsfragment.cxx
+++ b/oox/source/xls/commentsfragment.cxx
@@ -27,25 +27,26 @@
************************************************************************/
#include "oox/xls/commentsfragment.hxx"
-#include "oox/xls/richstringcontext.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
+#include "oox/xls/richstringcontext.hxx"
namespace oox {
namespace xls {
// ============================================================================
-OoxCommentsFragment::OoxCommentsFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorksheetFragmentBase( rHelper, rFragmentPath )
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+CommentsFragment::CommentsFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+ WorksheetFragmentBase( rHelper, rFragmentPath )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxCommentsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef CommentsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -57,7 +58,7 @@ ContextHandlerRef OoxCommentsFragment::onCreateContext( sal_Int32 nElement, cons
if( nElement == XLS_TOKEN( commentList ) ) return this;
break;
case XLS_TOKEN( authors ):
- if( nElement == XLS_TOKEN( author ) ) return this; // collect author in onEndElement()
+ if( nElement == XLS_TOKEN( author ) ) return this; // collect author in onCharacters()
break;
case XLS_TOKEN( commentList ):
if( nElement == XLS_TOKEN( comment ) ) { importComment( rAttribs ); return this; }
@@ -75,23 +76,26 @@ ContextHandlerRef OoxCommentsFragment::onCreateContext( sal_Int32 nElement, cons
return this;
case XLS_TOKEN( comment ):
if( (nElement == XLS_TOKEN( text )) && mxComment.get() )
- return new OoxRichStringContext( *this, mxComment->createText() );
+ return new RichStringContext( *this, mxComment->createText() );
if( nElement == XLS_TOKEN( commentPr ) ) { mxComment->importCommentPr( rAttribs ); return this; }
break;
}
return 0;
}
-void OoxCommentsFragment::onEndElement( const OUString& rChars )
+void CommentsFragment::onCharacters( const OUString& rChars )
+{
+ if( isCurrentElement( XLS_TOKEN( author ) ) )
+ getComments().appendAuthor( rChars );
+}
+
+void CommentsFragment::onEndElement()
{
bool bFrom = false;
if( getPreviousElement() == XDR_TOKEN( from ) )
bFrom = true;
switch( getCurrentElement() )
{
- case XLS_TOKEN( author ):
- getComments().appendAuthor( rChars );
- break;
case XDR_TOKEN( col ):
case XDR_TOKEN( colOff ):
case XDR_TOKEN( row ):
@@ -104,65 +108,65 @@ void OoxCommentsFragment::onEndElement( const OUString& rChars )
}
}
-ContextHandlerRef OoxCommentsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+void CommentsFragment::onEndElement()
+{
+ if( isCurrentElement( XLS_TOKEN( comment ) ) )
+ mxComment.reset();
+}
+
+ContextHandlerRef CommentsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_COMMENTS ) return this;
+ if( nRecId == BIFF12_ID_COMMENTS ) return this;
break;
- case OOBIN_ID_COMMENTS:
- if( nRecId == OOBIN_ID_COMMENTAUTHORS ) return this;
- if( nRecId == OOBIN_ID_COMMENTLIST ) return this;
+ case BIFF12_ID_COMMENTS:
+ if( nRecId == BIFF12_ID_COMMENTAUTHORS ) return this;
+ if( nRecId == BIFF12_ID_COMMENTLIST ) return this;
break;
- case OOBIN_ID_COMMENTAUTHORS:
- if( nRecId == OOBIN_ID_COMMENTAUTHOR ) getComments().appendAuthor( rStrm.readString() );
+ case BIFF12_ID_COMMENTAUTHORS:
+ if( nRecId == BIFF12_ID_COMMENTAUTHOR ) getComments().appendAuthor( BiffHelper::readString( rStrm ) );
break;
- case OOBIN_ID_COMMENTLIST:
- if( nRecId == OOBIN_ID_COMMENT ) { importComment( rStrm ); return this; }
+ case BIFF12_ID_COMMENTLIST:
+ if( nRecId == BIFF12_ID_COMMENT ) { importComment( rStrm ); return this; }
break;
- case OOBIN_ID_COMMENT:
- if( (nRecId == OOBIN_ID_COMMENTTEXT) && mxComment.get() )
+ case BIFF12_ID_COMMENT:
+ if( (nRecId == BIFF12_ID_COMMENTTEXT) && mxComment.get() )
mxComment->createText()->importString( rStrm, true );
break;
}
return 0;
}
-void OoxCommentsFragment::onEndRecord()
+void CommentsFragment::onEndRecord()
{
- switch( getCurrentElement() )
- {
- case OOBIN_ID_COMMENT:
- mxComment.reset();
- break;
- }
+ if( isCurrentElement( BIFF12_ID_COMMENT ) )
+ mxComment.reset();
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxCommentsFragment::getRecordInfos() const
+const RecordInfo* CommentsFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_COMMENT, OOBIN_ID_COMMENT + 1 },
- { OOBIN_ID_COMMENTAUTHORS, OOBIN_ID_COMMENTAUTHORS + 1 },
- { OOBIN_ID_COMMENTLIST, OOBIN_ID_COMMENTLIST + 1 },
- { OOBIN_ID_COMMENTS, OOBIN_ID_COMMENTS + 1 },
- { -1, -1 }
+ { BIFF12_ID_COMMENT, BIFF12_ID_COMMENT + 1 },
+ { BIFF12_ID_COMMENTAUTHORS, BIFF12_ID_COMMENTAUTHORS + 1 },
+ { BIFF12_ID_COMMENTLIST, BIFF12_ID_COMMENTLIST + 1 },
+ { BIFF12_ID_COMMENTS, BIFF12_ID_COMMENTS + 1 },
+ { -1, -1 }
};
return spRecInfos;
}
// private --------------------------------------------------------------------
-void OoxCommentsFragment::importComment( const AttributeList& rAttribs )
+void CommentsFragment::importComment( const AttributeList& rAttribs )
{
mxComment = getComments().createComment();
mxComment->importComment( rAttribs );
}
-void OoxCommentsFragment::importComment( RecordInputStream& rStrm )
+void CommentsFragment::importComment( SequenceInputStream& rStrm )
{
mxComment = getComments().createComment();
mxComment->importComment( rStrm );
@@ -173,4 +177,4 @@ void OoxCommentsFragment::importComment( RecordInputStream& rStrm )
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/condformatbuffer.cxx b/oox/source/xls/condformatbuffer.cxx
index c7ba215e2e67..4835a13b239d 100644
--- a/oox/source/xls/condformatbuffer.cxx
+++ b/oox/source/xls/condformatbuffer.cxx
@@ -27,108 +27,98 @@
************************************************************************/
#include "oox/xls/condformatbuffer.hxx"
-#include <rtl/ustrbuf.hxx>
+
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/table/CellAddress.hpp>
-#include <com/sun/star/table/CellRangeAddress.hpp>
-#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/sheet/ConditionOperator2.hpp>
+#include <com/sun/star/sheet/XSheetCellRanges.hpp>
#include <com/sun/star/sheet/XSheetConditionalEntries.hpp>
+#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheets.hpp>
-#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-#include "properties.hxx"
+#include <com/sun/star/table/CellAddress.hpp>
+#include <com/sun/star/table/CellRangeAddress.hpp>
+#include <com/sun/star/table/XCellRange.hpp>
+#include <rtl/ustrbuf.hxx>
#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/stylesbuffer.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::beans::PropertyValue;
-using ::com::sun::star::style::XStyleFamiliesSupplier;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameContainer;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::sheet::XSheetCellRanges;
-using ::com::sun::star::sheet::XSheetConditionalEntries;
-using ::com::sun::star::sheet::XSpreadsheetDocument;
-using ::com::sun::star::sheet::XSpreadsheets;
-using ::com::sun::star::sheet::XSpreadsheet;
-using ::com::sun::star::style::XStyle;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
-const sal_Int32 OOBIN_CFRULE_TYPE_CELLIS = 1;
-const sal_Int32 OOBIN_CFRULE_TYPE_EXPRESSION = 2;
-const sal_Int32 OOBIN_CFRULE_TYPE_COLORSCALE = 3;
-const sal_Int32 OOBIN_CFRULE_TYPE_DATABAR = 4;
-const sal_Int32 OOBIN_CFRULE_TYPE_TOPTEN = 5;
-const sal_Int32 OOBIN_CFRULE_TYPE_ICONSET = 6;
-
-const sal_Int32 OOBIN_CFRULE_SUB_CELLIS = 0;
-const sal_Int32 OOBIN_CFRULE_SUB_EXPRESSION = 1;
-const sal_Int32 OOBIN_CFRULE_SUB_COLORSCALE = 2;
-const sal_Int32 OOBIN_CFRULE_SUB_DATABAR = 3;
-const sal_Int32 OOBIN_CFRULE_SUB_ICONSET = 4;
-const sal_Int32 OOBIN_CFRULE_SUB_TOPTEN = 5;
-const sal_Int32 OOBIN_CFRULE_SUB_UNIQUE = 7;
-const sal_Int32 OOBIN_CFRULE_SUB_TEXT = 8;
-const sal_Int32 OOBIN_CFRULE_SUB_BLANK = 9;
-const sal_Int32 OOBIN_CFRULE_SUB_NOTBLANK = 10;
-const sal_Int32 OOBIN_CFRULE_SUB_ERROR = 11;
-const sal_Int32 OOBIN_CFRULE_SUB_NOTERROR = 12;
-const sal_Int32 OOBIN_CFRULE_SUB_TODAY = 15;
-const sal_Int32 OOBIN_CFRULE_SUB_TOMORROW = 16;
-const sal_Int32 OOBIN_CFRULE_SUB_YESTERDAY = 17;
-const sal_Int32 OOBIN_CFRULE_SUB_LAST7DAYS = 18;
-const sal_Int32 OOBIN_CFRULE_SUB_LASTMONTH = 19;
-const sal_Int32 OOBIN_CFRULE_SUB_NEXTMONTH = 20;
-const sal_Int32 OOBIN_CFRULE_SUB_THISWEEK = 21;
-const sal_Int32 OOBIN_CFRULE_SUB_NEXTWEEK = 22;
-const sal_Int32 OOBIN_CFRULE_SUB_LASTWEEK = 23;
-const sal_Int32 OOBIN_CFRULE_SUB_THISMONTH = 24;
-const sal_Int32 OOBIN_CFRULE_SUB_ABOVEAVERAGE = 25;
-const sal_Int32 OOBIN_CFRULE_SUB_BELOWAVERAGE = 26;
-const sal_Int32 OOBIN_CFRULE_SUB_DUPLICATE = 27;
-const sal_Int32 OOBIN_CFRULE_SUB_EQABOVEAVERAGE = 29;
-const sal_Int32 OOBIN_CFRULE_SUB_EQBELOWAVERAGE = 30;
-
-const sal_Int32 OOBIN_CFRULE_TIMEOP_TODAY = 0;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_YESTERDAY = 1;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_LAST7DAYS = 2;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_THISWEEK = 3;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_LASTWEEK = 4;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_LASTMONTH = 5;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_TOMORROW = 6;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_NEXTWEEK = 7;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_NEXTMONTH = 8;
-const sal_Int32 OOBIN_CFRULE_TIMEOP_THISMONTH = 9;
-
-const sal_uInt16 OOBIN_CFRULE_STOPIFTRUE = 0x0002;
-const sal_uInt16 OOBIN_CFRULE_ABOVEAVERAGE = 0x0004;
-const sal_uInt16 OOBIN_CFRULE_BOTTOM = 0x0008;
-const sal_uInt16 OOBIN_CFRULE_PERCENT = 0x0010;
+const sal_Int32 BIFF12_CFRULE_TYPE_CELLIS = 1;
+const sal_Int32 BIFF12_CFRULE_TYPE_EXPRESSION = 2;
+const sal_Int32 BIFF12_CFRULE_TYPE_COLORSCALE = 3;
+const sal_Int32 BIFF12_CFRULE_TYPE_DATABAR = 4;
+const sal_Int32 BIFF12_CFRULE_TYPE_TOPTEN = 5;
+const sal_Int32 BIFF12_CFRULE_TYPE_ICONSET = 6;
+
+const sal_Int32 BIFF12_CFRULE_SUB_CELLIS = 0;
+const sal_Int32 BIFF12_CFRULE_SUB_EXPRESSION = 1;
+const sal_Int32 BIFF12_CFRULE_SUB_COLORSCALE = 2;
+const sal_Int32 BIFF12_CFRULE_SUB_DATABAR = 3;
+const sal_Int32 BIFF12_CFRULE_SUB_ICONSET = 4;
+const sal_Int32 BIFF12_CFRULE_SUB_TOPTEN = 5;
+const sal_Int32 BIFF12_CFRULE_SUB_UNIQUE = 7;
+const sal_Int32 BIFF12_CFRULE_SUB_TEXT = 8;
+const sal_Int32 BIFF12_CFRULE_SUB_BLANK = 9;
+const sal_Int32 BIFF12_CFRULE_SUB_NOTBLANK = 10;
+const sal_Int32 BIFF12_CFRULE_SUB_ERROR = 11;
+const sal_Int32 BIFF12_CFRULE_SUB_NOTERROR = 12;
+const sal_Int32 BIFF12_CFRULE_SUB_TODAY = 15;
+const sal_Int32 BIFF12_CFRULE_SUB_TOMORROW = 16;
+const sal_Int32 BIFF12_CFRULE_SUB_YESTERDAY = 17;
+const sal_Int32 BIFF12_CFRULE_SUB_LAST7DAYS = 18;
+const sal_Int32 BIFF12_CFRULE_SUB_LASTMONTH = 19;
+const sal_Int32 BIFF12_CFRULE_SUB_NEXTMONTH = 20;
+const sal_Int32 BIFF12_CFRULE_SUB_THISWEEK = 21;
+const sal_Int32 BIFF12_CFRULE_SUB_NEXTWEEK = 22;
+const sal_Int32 BIFF12_CFRULE_SUB_LASTWEEK = 23;
+const sal_Int32 BIFF12_CFRULE_SUB_THISMONTH = 24;
+const sal_Int32 BIFF12_CFRULE_SUB_ABOVEAVERAGE = 25;
+const sal_Int32 BIFF12_CFRULE_SUB_BELOWAVERAGE = 26;
+const sal_Int32 BIFF12_CFRULE_SUB_DUPLICATE = 27;
+const sal_Int32 BIFF12_CFRULE_SUB_EQABOVEAVERAGE = 29;
+const sal_Int32 BIFF12_CFRULE_SUB_EQBELOWAVERAGE = 30;
+
+const sal_Int32 BIFF12_CFRULE_TIMEOP_TODAY = 0;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_YESTERDAY = 1;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_LAST7DAYS = 2;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_THISWEEK = 3;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_LASTWEEK = 4;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_LASTMONTH = 5;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_TOMORROW = 6;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_NEXTWEEK = 7;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_NEXTMONTH = 8;
+const sal_Int32 BIFF12_CFRULE_TIMEOP_THISMONTH = 9;
+
+const sal_uInt16 BIFF12_CFRULE_STOPIFTRUE = 0x0002;
+const sal_uInt16 BIFF12_CFRULE_ABOVEAVERAGE = 0x0004;
+const sal_uInt16 BIFF12_CFRULE_BOTTOM = 0x0008;
+const sal_uInt16 BIFF12_CFRULE_PERCENT = 0x0010;
// ----------------------------------------------------------------------------
@@ -160,7 +150,7 @@ CondFormatRuleModel::CondFormatRuleModel() :
{
}
-void CondFormatRuleModel::setBinOperator( sal_Int32 nOperator )
+void CondFormatRuleModel::setBiffOperator( sal_Int32 nOperator )
{
static const sal_Int32 spnOperators[] = {
XML_TOKEN_INVALID, XML_between, XML_notBetween, XML_equal, XML_notEqual,
@@ -168,7 +158,7 @@ void CondFormatRuleModel::setBinOperator( sal_Int32 nOperator )
mnOperator = STATIC_ARRAY_SELECT( spnOperators, nOperator, XML_TOKEN_INVALID );
}
-void CondFormatRuleModel::setOobTextType( sal_Int32 nOperator )
+void CondFormatRuleModel::setBiff12TextType( sal_Int32 nOperator )
{
// note: type XML_notContainsText vs. operator XML_notContains
static const sal_Int32 spnTypes[] = { XML_containsText, XML_notContainsText, XML_beginsWith, XML_endsWith };
@@ -210,7 +200,7 @@ void CondFormatRule::appendFormula( const OUString& rFormula )
maModel.maFormulas.push_back( aContext );
}
-void CondFormatRule::importCfRule( RecordInputStream& rStrm )
+void CondFormatRule::importCfRule( SequenceInputStream& rStrm )
{
sal_Int32 nType, nSubType, nOperator, nFmla1Size, nFmla2Size, nFmla3Size;
sal_uInt16 nFlags;
@@ -251,129 +241,129 @@ void CondFormatRule::importCfRule( RecordInputStream& rStrm )
}
// flags
- maModel.mbStopIfTrue = getFlag( nFlags, OOBIN_CFRULE_STOPIFTRUE );
- maModel.mbBottom = getFlag( nFlags, OOBIN_CFRULE_BOTTOM );
- maModel.mbPercent = getFlag( nFlags, OOBIN_CFRULE_PERCENT );
- maModel.mbAboveAverage = getFlag( nFlags, OOBIN_CFRULE_ABOVEAVERAGE );
+ maModel.mbStopIfTrue = getFlag( nFlags, BIFF12_CFRULE_STOPIFTRUE );
+ maModel.mbBottom = getFlag( nFlags, BIFF12_CFRULE_BOTTOM );
+ maModel.mbPercent = getFlag( nFlags, BIFF12_CFRULE_PERCENT );
+ maModel.mbAboveAverage = getFlag( nFlags, BIFF12_CFRULE_ABOVEAVERAGE );
// no flag for equalAverage, must be determined from subtype below...
// Convert the type/operator settings. This is a real mess...
switch( nType )
{
- case OOBIN_CFRULE_TYPE_CELLIS:
- OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_CELLIS, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+ case BIFF12_CFRULE_TYPE_CELLIS:
+ OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_CELLIS, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
maModel.mnType = XML_cellIs;
- maModel.setBinOperator( nOperator );
+ maModel.setBiffOperator( nOperator );
OSL_ENSURE( maModel.mnOperator != XML_TOKEN_INVALID, "CondFormatRule::importCfRule - unknown operator" );
break;
- case OOBIN_CFRULE_TYPE_EXPRESSION:
+ case BIFF12_CFRULE_TYPE_EXPRESSION:
// here we have to look at the subtype to find the real type...
switch( nSubType )
{
- case OOBIN_CFRULE_SUB_EXPRESSION:
+ case BIFF12_CFRULE_SUB_EXPRESSION:
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_expression;
break;
- case OOBIN_CFRULE_SUB_UNIQUE:
+ case BIFF12_CFRULE_SUB_UNIQUE:
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_uniqueValues;
break;
- case OOBIN_CFRULE_SUB_TEXT:
- maModel.setOobTextType( nOperator );
+ case BIFF12_CFRULE_SUB_TEXT:
+ maModel.setBiff12TextType( nOperator );
OSL_ENSURE( maModel.mnType != XML_TOKEN_INVALID, "CondFormatRule::importCfRule - unexpected operator value" );
break;
- case OOBIN_CFRULE_SUB_BLANK:
+ case BIFF12_CFRULE_SUB_BLANK:
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_containsBlanks;
break;
- case OOBIN_CFRULE_SUB_NOTBLANK:
+ case BIFF12_CFRULE_SUB_NOTBLANK:
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_notContainsBlanks;
break;
- case OOBIN_CFRULE_SUB_ERROR:
+ case BIFF12_CFRULE_SUB_ERROR:
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_containsErrors;
break;
- case OOBIN_CFRULE_SUB_NOTERROR:
+ case BIFF12_CFRULE_SUB_NOTERROR:
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_notContainsErrors;
break;
- case OOBIN_CFRULE_SUB_TODAY:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_TODAY, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_TODAY:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_TODAY, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_today;
break;
- case OOBIN_CFRULE_SUB_TOMORROW:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_TOMORROW, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_TOMORROW:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_TOMORROW, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_tomorrow;
break;
- case OOBIN_CFRULE_SUB_YESTERDAY:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_YESTERDAY, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_YESTERDAY:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_YESTERDAY, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_yesterday;
break;
- case OOBIN_CFRULE_SUB_LAST7DAYS:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_LAST7DAYS, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_LAST7DAYS:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_LAST7DAYS, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_last7Days;
break;
- case OOBIN_CFRULE_SUB_LASTMONTH:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_LASTMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_LASTMONTH:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_LASTMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_lastMonth;
break;
- case OOBIN_CFRULE_SUB_NEXTMONTH:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_NEXTMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_NEXTMONTH:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_NEXTMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_nextMonth;
break;
- case OOBIN_CFRULE_SUB_THISWEEK:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_THISWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_THISWEEK:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_THISWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_thisWeek;
break;
- case OOBIN_CFRULE_SUB_NEXTWEEK:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_NEXTWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_NEXTWEEK:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_NEXTWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_nextWeek;
break;
- case OOBIN_CFRULE_SUB_LASTWEEK:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_LASTWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_LASTWEEK:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_LASTWEEK, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_lastWeek;
break;
- case OOBIN_CFRULE_SUB_THISMONTH:
- OSL_ENSURE( nOperator == OOBIN_CFRULE_TIMEOP_THISMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
+ case BIFF12_CFRULE_SUB_THISMONTH:
+ OSL_ENSURE( nOperator == BIFF12_CFRULE_TIMEOP_THISMONTH, "CondFormatRule::importCfRule - unexpected time operator value" );
maModel.mnType = XML_timePeriod;
maModel.mnTimePeriod = XML_thisMonth;
break;
- case OOBIN_CFRULE_SUB_ABOVEAVERAGE:
+ case BIFF12_CFRULE_SUB_ABOVEAVERAGE:
OSL_ENSURE( maModel.mbAboveAverage, "CondFormatRule::importCfRule - wrong above-average flag" );
maModel.mnType = XML_aboveAverage;
maModel.mnStdDev = nOperator; // operator field used for standard deviation
maModel.mbAboveAverage = true;
maModel.mbEqualAverage = false; // does not exist as real flag...
break;
- case OOBIN_CFRULE_SUB_BELOWAVERAGE:
+ case BIFF12_CFRULE_SUB_BELOWAVERAGE:
OSL_ENSURE( !maModel.mbAboveAverage, "CondFormatRule::importCfRule - wrong above-average flag" );
maModel.mnType = XML_aboveAverage;
maModel.mnStdDev = nOperator; // operator field used for standard deviation
maModel.mbAboveAverage = false;
maModel.mbEqualAverage = false; // does not exist as real flag...
break;
- case OOBIN_CFRULE_SUB_DUPLICATE:
+ case BIFF12_CFRULE_SUB_DUPLICATE:
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_duplicateValues;
break;
- case OOBIN_CFRULE_SUB_EQABOVEAVERAGE:
+ case BIFF12_CFRULE_SUB_EQABOVEAVERAGE:
OSL_ENSURE( maModel.mbAboveAverage, "CondFormatRule::importCfRule - wrong above-average flag" );
maModel.mnType = XML_aboveAverage;
maModel.mnStdDev = nOperator; // operator field used for standard deviation
maModel.mbAboveAverage = true;
maModel.mbEqualAverage = true; // does not exist as real flag...
break;
- case OOBIN_CFRULE_SUB_EQBELOWAVERAGE:
+ case BIFF12_CFRULE_SUB_EQBELOWAVERAGE:
OSL_ENSURE( !maModel.mbAboveAverage, "CondFormatRule::importCfRule - wrong above-average flag" );
maModel.mnType = XML_aboveAverage;
maModel.mnStdDev = nOperator; // operator field used for standard deviation
@@ -382,23 +372,23 @@ void CondFormatRule::importCfRule( RecordInputStream& rStrm )
break;
}
break;
- case OOBIN_CFRULE_TYPE_COLORSCALE:
- OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_COLORSCALE, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+ case BIFF12_CFRULE_TYPE_COLORSCALE:
+ OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_COLORSCALE, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_colorScale;
break;
- case OOBIN_CFRULE_TYPE_DATABAR:
- OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_DATABAR, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+ case BIFF12_CFRULE_TYPE_DATABAR:
+ OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_DATABAR, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_dataBar;
break;
- case OOBIN_CFRULE_TYPE_TOPTEN:
- OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_TOPTEN, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+ case BIFF12_CFRULE_TYPE_TOPTEN:
+ OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_TOPTEN, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
maModel.mnType = XML_top10;
maModel.mnRank = nOperator; // operator field used for rank value
break;
- case OOBIN_CFRULE_TYPE_ICONSET:
- OSL_ENSURE( nSubType == OOBIN_CFRULE_SUB_ICONSET, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
+ case BIFF12_CFRULE_TYPE_ICONSET:
+ OSL_ENSURE( nSubType == BIFF12_CFRULE_SUB_ICONSET, "CondFormatRule::importCfRule - rule type/subtype mismatch" );
OSL_ENSURE( nOperator == 0, "CondFormatRule::importCfRule - unexpected operator value" );
maModel.mnType = XML_iconSet;
break;
@@ -418,7 +408,7 @@ void CondFormatRule::importCfRule( BiffInputStream& rStrm, sal_Int32 nPriority )
static const sal_Int32 spnTypeIds[] = { XML_TOKEN_INVALID, XML_cellIs, XML_expression };
maModel.mnType = STATIC_ARRAY_SELECT( spnTypeIds, nType, XML_TOKEN_INVALID );
- maModel.setBinOperator( nOperator );
+ maModel.setBiffOperator( nOperator );
maModel.mnPriority = nPriority;
maModel.mbStopIfTrue = true;
@@ -663,7 +653,7 @@ CondFormatRuleRef CondFormat::importCfRule( const AttributeList& rAttribs )
return xRule;
}
-void CondFormat::importCondFormatting( RecordInputStream& rStrm )
+void CondFormat::importCondFormatting( SequenceInputStream& rStrm )
{
BinRangeList aRanges;
rStrm.skip( 8 );
@@ -671,7 +661,7 @@ void CondFormat::importCondFormatting( RecordInputStream& rStrm )
getAddressConverter().convertToCellRangeList( maModel.maRanges, aRanges, getSheetIndex(), true );
}
-void CondFormat::importCfRule( RecordInputStream& rStrm )
+void CondFormat::importCfRule( SequenceInputStream& rStrm )
{
CondFormatRuleRef xRule = createRule();
xRule->importCfRule( rStrm );
@@ -699,18 +689,17 @@ void CondFormat::importCfHeader( BiffInputStream& rStrm )
void CondFormat::finalizeImport()
{
- Reference< XSheetCellRanges > xRanges = getCellRangeList( maModel.maRanges );
- if( xRanges.is() )
+ try
{
+ Reference< XSheetCellRanges > xRanges( getCellRangeList( maModel.maRanges ), UNO_SET_THROW );
PropertySet aPropSet( xRanges );
- Reference< XSheetConditionalEntries > xEntries;
- aPropSet.getProperty( xEntries, PROP_ConditionalFormat );
- if( xEntries.is() )
- {
- // maRules is sorted by rule priority
- maRules.forEachMem( &CondFormatRule::finalizeImport, ::boost::cref( xEntries ) );
- aPropSet.setProperty( PROP_ConditionalFormat, xEntries );
- }
+ Reference< XSheetConditionalEntries > xEntries( aPropSet.getAnyProperty( PROP_ConditionalFormat ), UNO_QUERY_THROW );
+ // maRules is sorted by rule priority
+ maRules.forEachMem( &CondFormatRule::finalizeImport, ::boost::cref( xEntries ) );
+ aPropSet.setProperty( PROP_ConditionalFormat, xEntries );
+ }
+ catch( Exception& )
+ {
}
}
@@ -742,7 +731,7 @@ CondFormatRef CondFormatBuffer::importConditionalFormatting( const AttributeList
return xCondFmt;
}
-CondFormatRef CondFormatBuffer::importCondFormatting( RecordInputStream& rStrm )
+CondFormatRef CondFormatBuffer::importCondFormatting( SequenceInputStream& rStrm )
{
CondFormatRef xCondFmt = createCondFormat();
xCondFmt->importCondFormatting( rStrm );
@@ -791,4 +780,4 @@ CondFormatRef CondFormatBuffer::createCondFormat()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/condformatcontext.cxx b/oox/source/xls/condformatcontext.cxx
index d9421d7232e9..2e2813ee9685 100644
--- a/oox/source/xls/condformatcontext.cxx
+++ b/oox/source/xls/condformatcontext.cxx
@@ -28,22 +28,22 @@
#include "oox/xls/condformatcontext.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-
namespace oox {
namespace xls {
// ============================================================================
-OoxCondFormatContext::OoxCondFormatContext( OoxWorksheetFragmentBase& rFragment ) :
- OoxWorksheetContextBase( rFragment )
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
+
+CondFormatContext::CondFormatContext( WorksheetFragmentBase& rFragment ) :
+ WorksheetContextBase( rFragment )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxCondFormatContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
+ContextHandlerRef CondFormatContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
{
switch( getCurrentElement() )
{
@@ -55,7 +55,7 @@ ContextHandlerRef OoxCondFormatContext::onCreateContext( sal_Int32 nElement, con
return 0;
}
-void OoxCondFormatContext::onStartElement( const AttributeList& rAttribs )
+void CondFormatContext::onStartElement( const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -68,34 +68,30 @@ void OoxCondFormatContext::onStartElement( const AttributeList& rAttribs )
}
}
-void OoxCondFormatContext::onEndElement( const OUString& rChars )
+void CondFormatContext::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
- {
- case XLS_TOKEN( formula ):
- if( mxCondFmt.get() && mxRule.get() ) mxRule->appendFormula( rChars );
- break;
- }
+ if( isCurrentElement( XLS_TOKEN( formula ) ) && mxCondFmt.get() && mxRule.get() )
+ mxRule->appendFormula( rChars );
}
-ContextHandlerRef OoxCondFormatContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& )
+ContextHandlerRef CondFormatContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_CONDFORMATTING:
- return (nRecId == OOBIN_ID_CFRULE) ? this : 0;
+ case BIFF12_ID_CONDFORMATTING:
+ return (nRecId == BIFF12_ID_CFRULE) ? this : 0;
}
return 0;
}
-void OoxCondFormatContext::onStartRecord( RecordInputStream& rStrm )
+void CondFormatContext::onStartRecord( SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_CONDFORMATTING:
+ case BIFF12_ID_CONDFORMATTING:
mxCondFmt = getCondFormats().importCondFormatting( rStrm );
break;
- case OOBIN_ID_CFRULE:
+ case BIFF12_ID_CFRULE:
if( mxCondFmt.get() ) mxCondFmt->importCfRule( rStrm );
break;
}
@@ -106,4 +102,4 @@ void OoxCondFormatContext::onStartRecord( RecordInputStream& rStrm )
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/connectionsbuffer.cxx b/oox/source/xls/connectionsbuffer.cxx
new file mode 100755
index 000000000000..6d0fcd65122f
--- /dev/null
+++ b/oox/source/xls/connectionsbuffer.cxx
@@ -0,0 +1,501 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "oox/xls/connectionsbuffer.hxx"
+
+#include "oox/helper/attributelist.hxx"
+#include "oox/xls/biffinputstream.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
+namespace {
+
+const sal_Int32 BIFF12_RECONNECT_AS_REQUIRED = 1;
+const sal_Int32 BIFF12_RECONNECT_ALWAYS = 2;
+const sal_Int32 BIFF12_RECONNECT_NEVER = 3;
+
+const sal_uInt8 BIFF12_CONNECTION_SAVEPASSWORD_ON = 1;
+const sal_uInt8 BIFF12_CONNECTION_SAVEPASSWORD_OFF = 2;
+
+const sal_uInt16 BIFF12_CONNECTION_KEEPALIVE = 0x0001;
+const sal_uInt16 BIFF12_CONNECTION_NEW = 0x0002;
+const sal_uInt16 BIFF12_CONNECTION_DELETED = 0x0004;
+const sal_uInt16 BIFF12_CONNECTION_ONLYUSECONNFILE = 0x0008;
+const sal_uInt16 BIFF12_CONNECTION_BACKGROUND = 0x0010;
+const sal_uInt16 BIFF12_CONNECTION_REFRESHONLOAD = 0x0020;
+const sal_uInt16 BIFF12_CONNECTION_SAVEDATA = 0x0040;
+
+const sal_uInt16 BIFF12_CONNECTION_HAS_SOURCEFILE = 0x0001;
+const sal_uInt16 BIFF12_CONNECTION_HAS_SOURCECONNFILE = 0x0002;
+const sal_uInt16 BIFF12_CONNECTION_HAS_DESCRIPTION = 0x0004;
+const sal_uInt16 BIFF12_CONNECTION_HAS_NAME = 0x0008;
+const sal_uInt16 BIFF12_CONNECTION_HAS_SSOID = 0x0010;
+
+const sal_uInt32 BIFF12_WEBPR_XML = 0x00000100;
+const sal_uInt32 BIFF12_WEBPR_SOURCEDATA = 0x00000200;
+const sal_uInt32 BIFF12_WEBPR_PARSEPRE = 0x00000400;
+const sal_uInt32 BIFF12_WEBPR_CONSECUTIVE = 0x00000800;
+const sal_uInt32 BIFF12_WEBPR_FIRSTROW = 0x00001000;
+const sal_uInt32 BIFF12_WEBPR_XL97CREATED = 0x00002000;
+const sal_uInt32 BIFF12_WEBPR_TEXTDATES = 0x00004000;
+const sal_uInt32 BIFF12_WEBPR_XL2000REFRESHED = 0x00008000;
+const sal_uInt32 BIFF12_WEBPR_HTMLTABLES = 0x00010000;
+
+const sal_uInt8 BIFF12_WEBPR_HAS_POSTMETHOD = 0x01;
+const sal_uInt8 BIFF12_WEBPR_HAS_EDITPAGE = 0x02;
+const sal_uInt8 BIFF12_WEBPR_HAS_URL = 0x04;
+
+const sal_uInt16 BIFF_DBQUERY_ODBC = 0x0008;
+const sal_uInt16 BIFF_DBQUERY_SQLQUERY = 0x0010;
+const sal_uInt16 BIFF_DBQUERY_SERVERBASEDSQL = 0x0020;
+const sal_uInt16 BIFF_DBQUERY_HTML = 0x0040;
+const sal_uInt16 BIFF_DBQUERY_SAVEPASSWORD = 0x0080;
+const sal_uInt16 BIFF_DBQUERY_HTMLTABLES = 0x0100;
+
+const sal_uInt16 BIFF_QTSETTINGS_KEEPALIVE = 0x0001;
+const sal_uInt16 BIFF_QTSETTINGS_NEW = 0x0002;
+const sal_uInt16 BIFF_QTSETTINGS_SOURCEDATA = 0x0004;
+const sal_uInt16 BIFF_QTSETTINGS_WEBBASEDPROV = 0x0008;
+const sal_uInt16 BIFF_QTSETTINGS_REINITLIST = 0x0010;
+const sal_uInt16 BIFF_QTSETTINGS_XML = 0x0080;
+
+const sal_uInt16 BIFF_QTSETTINGS_PARSEPRE = 0x0001;
+const sal_uInt16 BIFF_QTSETTINGS_CONSECUTIVE = 0x0002;
+const sal_uInt16 BIFF_QTSETTINGS_FIRSTROW = 0x0004;
+const sal_uInt16 BIFF_QTSETTINGS_XL97CREATED = 0x0008;
+const sal_uInt16 BIFF_QTSETTINGS_TEXTDATES = 0x0010;
+const sal_uInt16 BIFF_QTSETTINGS_XL2000REFRESHED = 0x0020;
+
+const sal_uInt16 BIFF_QTSETTINGS_TEXTQUERY = 0x0001;
+const sal_uInt16 BIFF_QTSETTINGS_TABLENAMES = 0x0002;
+
+// ----------------------------------------------------------------------------
+
+OUString lclReadQueryString( BiffInputStream& rStrm, sal_uInt16 nCount )
+{
+ bool bValidRec = true;
+ OUStringBuffer aBuffer;
+ for( sal_uInt16 nIndex = 0; bValidRec && (nIndex < nCount); ++nIndex )
+ {
+ bValidRec = (rStrm.getNextRecId() == BIFF_ID_PCITEM_STRING) && rStrm.startNextRecord();
+ if( bValidRec )
+ aBuffer.append( rStrm.readUniString() );
+ }
+ OSL_ENSURE( bValidRec, "lclReadQueryString - missing PCITEM_STRING records" );
+ return aBuffer.makeStringAndClear();
+}
+
+void lclParseTables( WebPrModel::TablesVector& rTables, const OUString& rTableNames )
+{
+ rTables.clear();
+ OUString aTableNames = rTableNames.trim();
+ while( aTableNames.getLength() > 0 )
+ {
+ sal_Int32 nSep = -1;
+ // table names are enclosed in double quotes
+ if( aTableNames[ 0 ] == '"' )
+ {
+ // search closing quote character
+ sal_Int32 nEndQuote = aTableNames.indexOf( '"', 1 );
+ OSL_ENSURE( nEndQuote >= 1, "lclParseTables - invalid syntax" );
+ if( nEndQuote < 0 )
+ nEndQuote = aTableNames.getLength();
+ else
+ nSep = aTableNames.indexOf( ',', nEndQuote + 1 );
+ // extract text between quote characters
+ OUString aTableName = aTableNames.copy( 1, nEndQuote - 1 ).trim();
+ if( aTableName.getLength() > 0 )
+ rTables.push_back( Any( aTableName ) );
+ else
+ rTables.push_back( Any() );
+ }
+ else
+ {
+ nSep = aTableNames.indexOf( ',' );
+ if( nSep < 0 )
+ nSep = aTableNames.getLength();
+ OUString aTableIndex = aTableNames.copy( 0, nSep ).trim();
+ if( (aTableIndex.getLength() > 0) && (aTableIndex[ 0 ] >= '1') && (aTableIndex[ 0 ] <= '9') )
+ rTables.push_back( Any( aTableIndex.toInt32() ) );
+ else
+ rTables.push_back( Any() );
+ }
+
+ // remove processed item from aTableNames
+ if( (nSep < 0) || (nSep >= aTableNames.getLength()) )
+ aTableNames = OUString();
+ else
+ aTableNames = aTableNames.copy( nSep + 1 ).trim();
+ }
+}
+
+} // namespace
+
+// ============================================================================
+
+WebPrModel::WebPrModel() :
+ mnHtmlFormat( XML_none ),
+ mbXml( false ),
+ mbSourceData( false ),
+ mbParsePre( false ),
+ mbConsecutive( false ),
+ mbFirstRow( false ),
+ mbXl97Created( false ),
+ mbTextDates( false ),
+ mbXl2000Refreshed( false ),
+ mbHtmlTables( false )
+{
+}
+
+// ----------------------------------------------------------------------------
+
+ConnectionModel::ConnectionModel() :
+ mnId( -1 ),
+ mnType( BIFF12_CONNECTION_UNKNOWN ),
+ mnReconnectMethod( BIFF12_RECONNECT_AS_REQUIRED ),
+ mnCredentials( XML_integrated ),
+ mnInterval( 0 ),
+ mbKeepAlive( false ),
+ mbNew( false ),
+ mbDeleted( false ),
+ mbOnlyUseConnFile( false ),
+ mbBackground( false ),
+ mbRefreshOnLoad( false ),
+ mbSaveData( false ),
+ mbSavePassword( false )
+{
+}
+
+WebPrModel& ConnectionModel::createWebPr()
+{
+ OSL_ENSURE( !mxWebPr.get(), "ConnectionModel::createWebPr - multiple call" );
+ mxWebPr.reset( new WebPrModel );
+ return *mxWebPr;
+}
+
+// ----------------------------------------------------------------------------
+
+Connection::Connection( const WorkbookHelper& rHelper, sal_Int32 nConnId ) :
+ WorkbookHelper( rHelper )
+{
+ maModel.mnId = nConnId;
+}
+
+void Connection::importConnection( const AttributeList& rAttribs )
+{
+ maModel.maName = rAttribs.getXString( XML_name, OUString() );
+ maModel.maDescription = rAttribs.getXString( XML_description, OUString() );
+ maModel.maSourceFile = rAttribs.getXString( XML_sourceFile, OUString() );
+ maModel.maSourceConnFile = rAttribs.getXString( XML_odcFile, OUString() );
+ maModel.maSsoId = rAttribs.getXString( XML_singleSignOnId, OUString() );
+ maModel.mnId = rAttribs.getInteger( XML_id, -1 );
+ // type and reconnectionMethod are using the BIFF12 constants instead of XML tokens
+ maModel.mnType = rAttribs.getInteger( XML_type, BIFF12_CONNECTION_UNKNOWN );
+ maModel.mnReconnectMethod = rAttribs.getInteger( XML_reconnectionMethod, BIFF12_RECONNECT_AS_REQUIRED );
+ maModel.mnCredentials = rAttribs.getToken( XML_credentials, XML_integrated );
+ maModel.mnInterval = rAttribs.getInteger( XML_interval, 0 );
+ maModel.mbKeepAlive = rAttribs.getBool( XML_keepAlive, false );
+ maModel.mbNew = rAttribs.getBool( XML_new, false );
+ maModel.mbDeleted = rAttribs.getBool( XML_deleted, false );
+ maModel.mbOnlyUseConnFile = rAttribs.getBool( XML_onlyUseConnectionFile, false );
+ maModel.mbBackground = rAttribs.getBool( XML_background, false );
+ maModel.mbRefreshOnLoad = rAttribs.getBool( XML_refreshOnLoad, false );
+ maModel.mbSaveData = rAttribs.getBool( XML_saveData, false );
+ maModel.mbSavePassword = rAttribs.getBool( XML_savePassword, false );
+}
+
+void Connection::importWebPr( const AttributeList& rAttribs )
+{
+ WebPrModel& rWebPr = maModel.createWebPr();
+
+ rWebPr.maUrl = rAttribs.getXString( XML_url, OUString() );
+ rWebPr.maPostMethod = rAttribs.getXString( XML_post, OUString() );
+ rWebPr.maEditPage = rAttribs.getXString( XML_editPage, OUString() );
+ rWebPr.mnHtmlFormat = rAttribs.getToken( XML_htmlFormat, XML_none );
+ rWebPr.mbXml = rAttribs.getBool( XML_xml, false );
+ rWebPr.mbSourceData = rAttribs.getBool( XML_sourceData, false );
+ rWebPr.mbParsePre = rAttribs.getBool( XML_parsePre, false );
+ rWebPr.mbConsecutive = rAttribs.getBool( XML_consecutive, false );
+ rWebPr.mbFirstRow = rAttribs.getBool( XML_firstRow, false );
+ rWebPr.mbXl97Created = rAttribs.getBool( XML_xl97, false );
+ rWebPr.mbTextDates = rAttribs.getBool( XML_textDates, false );
+ rWebPr.mbXl2000Refreshed = rAttribs.getBool( XML_xl2000, false );
+ rWebPr.mbHtmlTables = rAttribs.getBool( XML_htmlTables, false );
+}
+
+void Connection::importTables( const AttributeList& /*rAttribs*/ )
+{
+ if( maModel.mxWebPr.get() )
+ {
+ OSL_ENSURE( maModel.mxWebPr->maTables.empty(), "Connection::importTables - multiple calls" );
+ maModel.mxWebPr->maTables.clear();
+ }
+}
+
+void Connection::importTable( const AttributeList& rAttribs, sal_Int32 nElement )
+{
+ if( maModel.mxWebPr.get() )
+ {
+ Any aTableAny;
+ switch( nElement )
+ {
+ case XLS_TOKEN( m ): break;
+ case XLS_TOKEN( s ): aTableAny <<= rAttribs.getXString( XML_v, OUString() ); break;
+ case XLS_TOKEN( x ): aTableAny <<= rAttribs.getInteger( XML_v, -1 ); break;
+ default:
+ OSL_ENSURE( false, "Connection::importTable - unexpected element" );
+ return;
+ }
+ maModel.mxWebPr->maTables.push_back( aTableAny );
+ }
+}
+
+void Connection::importConnection( SequenceInputStream& rStrm )
+{
+ sal_uInt16 nFlags, nStrFlags;
+ sal_uInt8 nSavePassword, nCredentials;
+ rStrm.skip( 2 );
+ rStrm >> nSavePassword;
+ rStrm.skip( 1 );
+ maModel.mnInterval = rStrm.readuInt16();
+ rStrm >> nFlags >> nStrFlags >> maModel.mnType >> maModel.mnReconnectMethod >> maModel.mnId >> nCredentials;
+
+ if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_SOURCEFILE ) )
+ rStrm >> maModel.maSourceFile;
+ if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_SOURCECONNFILE ) )
+ rStrm >> maModel.maSourceConnFile;
+ if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_DESCRIPTION ) )
+ rStrm >> maModel.maDescription;
+ if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_NAME ) )
+ rStrm >> maModel.maName;
+ if( getFlag( nStrFlags, BIFF12_CONNECTION_HAS_SSOID ) )
+ rStrm >> maModel.maSsoId;
+
+ static const sal_Int32 spnCredentials[] = { XML_integrated, XML_none, XML_stored, XML_prompt };
+ maModel.mnCredentials = STATIC_ARRAY_SELECT( spnCredentials, nCredentials, XML_integrated );
+
+ maModel.mbKeepAlive = getFlag( nFlags, BIFF12_CONNECTION_KEEPALIVE );
+ maModel.mbNew = getFlag( nFlags, BIFF12_CONNECTION_NEW );
+ maModel.mbDeleted = getFlag( nFlags, BIFF12_CONNECTION_DELETED );
+ maModel.mbOnlyUseConnFile = getFlag( nFlags, BIFF12_CONNECTION_ONLYUSECONNFILE );
+ maModel.mbBackground = getFlag( nFlags, BIFF12_CONNECTION_BACKGROUND );
+ maModel.mbRefreshOnLoad = getFlag( nFlags, BIFF12_CONNECTION_REFRESHONLOAD );
+ maModel.mbSaveData = getFlag( nFlags, BIFF12_CONNECTION_SAVEDATA );
+ maModel.mbSavePassword = nSavePassword == BIFF12_CONNECTION_SAVEPASSWORD_ON;
+}
+
+void Connection::importWebPr( SequenceInputStream& rStrm )
+{
+ WebPrModel& rWebPr = maModel.createWebPr();
+
+ sal_uInt32 nFlags;
+ sal_uInt8 nStrFlags;
+ rStrm >> nFlags >> nStrFlags;
+
+ if( getFlag( nStrFlags, BIFF12_WEBPR_HAS_URL ) )
+ rStrm >> rWebPr.maUrl;
+ if( getFlag( nStrFlags, BIFF12_WEBPR_HAS_POSTMETHOD ) )
+ rStrm >> rWebPr.maPostMethod;
+ if( getFlag( nStrFlags, BIFF12_WEBPR_HAS_EDITPAGE ) )
+ rStrm >> rWebPr.maEditPage;
+
+ static const sal_Int32 spnHmlFormats[] = { XML_none, XML_rtf, XML_all };
+ rWebPr.mnHtmlFormat = STATIC_ARRAY_SELECT( spnHmlFormats, extractValue< sal_uInt8 >( nFlags, 0, 8 ), XML_none );
+
+ rWebPr.mbXml = getFlag( nFlags, BIFF12_WEBPR_XML );
+ rWebPr.mbSourceData = getFlag( nFlags, BIFF12_WEBPR_SOURCEDATA );
+ rWebPr.mbParsePre = getFlag( nFlags, BIFF12_WEBPR_PARSEPRE );
+ rWebPr.mbConsecutive = getFlag( nFlags, BIFF12_WEBPR_CONSECUTIVE );
+ rWebPr.mbFirstRow = getFlag( nFlags, BIFF12_WEBPR_FIRSTROW );
+ rWebPr.mbXl97Created = getFlag( nFlags, BIFF12_WEBPR_XL97CREATED );
+ rWebPr.mbTextDates = getFlag( nFlags, BIFF12_WEBPR_TEXTDATES );
+ rWebPr.mbXl2000Refreshed = getFlag( nFlags, BIFF12_WEBPR_XL2000REFRESHED );
+ rWebPr.mbHtmlTables = getFlag( nFlags, BIFF12_WEBPR_HTMLTABLES );
+}
+
+void Connection::importWebPrTables( SequenceInputStream& /*rStrm*/ )
+{
+ if( maModel.mxWebPr.get() )
+ {
+ OSL_ENSURE( maModel.mxWebPr->maTables.empty(), "Connection::importWebPrTables - multiple calls" );
+ maModel.mxWebPr->maTables.clear();
+ }
+}
+
+void Connection::importWebPrTable( SequenceInputStream& rStrm, sal_Int32 nRecId )
+{
+ if( maModel.mxWebPr.get() )
+ {
+ Any aTableAny;
+ switch( nRecId )
+ {
+ case BIFF12_ID_PCITEM_MISSING: break;
+ case BIFF12_ID_PCITEM_STRING: aTableAny <<= BiffHelper::readString( rStrm ); break;
+ case BIFF12_ID_PCITEM_INDEX: aTableAny <<= rStrm.readInt32(); break;
+ default:
+ OSL_ENSURE( false, "Connection::importWebPrTable - unexpected record" );
+ return;
+ }
+ maModel.mxWebPr->maTables.push_back( aTableAny );
+ }
+}
+
+void Connection::importDbQuery( BiffInputStream& rStrm )
+{
+ sal_uInt16 nFlags, nSqlParamCount, nCommandCount, nPostMethodCount, nServerSqlCount, nOdbcConnCount;
+ rStrm >> nFlags >> nSqlParamCount >> nCommandCount >> nPostMethodCount >> nServerSqlCount >> nOdbcConnCount;
+
+ // same type constants in all BIFF versions
+ maModel.mnType = extractValue< sal_Int32 >( nFlags, 0, 3 );
+ maModel.mbSavePassword = getFlag( nFlags, BIFF_DBQUERY_SAVEPASSWORD );
+
+ OSL_ENSURE( getFlag( nFlags, BIFF_DBQUERY_ODBC ) == (maModel.mnType == BIFF12_CONNECTION_ODBC), "Connection::importDbQuery - wrong ODBC flag" );
+ OSL_ENSURE( getFlag( nFlags, BIFF_DBQUERY_SQLQUERY ) != (maModel.mnType == BIFF12_CONNECTION_HTML), "Connection::importDbQuery - wrong SQL query flag" );
+ OSL_ENSURE( getFlag( nFlags, BIFF_DBQUERY_HTML ) == (maModel.mnType == BIFF12_CONNECTION_HTML), "Connection::importDbQuery - wrong HTML flag" );
+
+ if( (maModel.mnType == BIFF12_CONNECTION_HTML) && getFlag( nFlags, BIFF_DBQUERY_HTML ) )
+ {
+ WebPrModel& rWebPr = maModel.createWebPr();
+ rWebPr.mbHtmlTables = getFlag( nFlags, BIFF_DBQUERY_HTMLTABLES );
+
+ // read HTML query URL and post method
+ rWebPr.maUrl = lclReadQueryString( rStrm, nCommandCount );
+ rWebPr.maPostMethod = lclReadQueryString( rStrm, nPostMethodCount );
+ }
+}
+
+void Connection::importQueryTableSettings( BiffInputStream& rStrm )
+{
+ rStrm.skip( 4 );
+ // source data type, again
+ sal_uInt16 nType = rStrm.readuInt16();
+ OSL_ENSURE( nType == maModel.mnType, "Connection::importQueryTableSettings - source data type mismatch" );
+ if( nType == maModel.mnType )
+ {
+ sal_uInt16 nFlags1, nFlags2, nFlags3, nHtmlFormat;
+ rStrm >> nFlags1 >> nFlags2 >> nFlags3;
+ rStrm.skip( 10 );
+ maModel.mnInterval = rStrm.readuInt16();
+ rStrm >> nHtmlFormat;
+
+ // first flags field: generic connection flags
+ maModel.mbKeepAlive = getFlag( nFlags1, BIFF_QTSETTINGS_KEEPALIVE );
+ maModel.mbNew = getFlag( nFlags1, BIFF_QTSETTINGS_NEW );
+
+ // meaning of second flags field is dependent on source data type
+ if( (maModel.mnType == BIFF12_CONNECTION_HTML) && maModel.mxWebPr.get() )
+ {
+ WebPrModel& rWebPr = *maModel.mxWebPr;
+
+ // HTML format is one-based in BIFF8 (but zero-based in BIFF12)
+ static const sal_Int32 spnHmlFormats[] = { XML_none, XML_none, XML_rtf, XML_all };
+ rWebPr.mnHtmlFormat = STATIC_ARRAY_SELECT( spnHmlFormats, nHtmlFormat, XML_none );
+
+ rWebPr.mbXml = getFlag( nFlags1, BIFF_QTSETTINGS_XML );
+ rWebPr.mbSourceData = getFlag( nFlags1, BIFF_QTSETTINGS_SOURCEDATA );
+ rWebPr.mbParsePre = getFlag( nFlags2, BIFF_QTSETTINGS_PARSEPRE );
+ rWebPr.mbConsecutive = getFlag( nFlags2, BIFF_QTSETTINGS_CONSECUTIVE );
+ rWebPr.mbFirstRow = getFlag( nFlags2, BIFF_QTSETTINGS_FIRSTROW );
+ rWebPr.mbXl97Created = getFlag( nFlags2, BIFF_QTSETTINGS_XL97CREATED );
+ rWebPr.mbTextDates = getFlag( nFlags2, BIFF_QTSETTINGS_TEXTDATES );
+ rWebPr.mbXl2000Refreshed = getFlag( nFlags2, BIFF_QTSETTINGS_XL2000REFRESHED );
+
+ // list of HTML table names or indexes
+ if( getFlag( nFlags3, BIFF_QTSETTINGS_TABLENAMES ) )
+ {
+ // a QUERYTABLESTRING record containing the table names must follow
+ bool bHasQTString = (rStrm.getNextRecId() == BIFF_ID_QUERYTABLESTRING) && rStrm.startNextRecord();
+ OSL_ENSURE( bHasQTString, "Connection::importQueryTableSettings - missing QUERYTABLESTRING record" );
+ if( bHasQTString )
+ {
+ rStrm.skip( 4 );
+ lclParseTables( rWebPr.maTables, rStrm.readUniString() );
+ }
+ }
+ }
+ }
+}
+
+// ============================================================================
+
+ConnectionsBuffer::ConnectionsBuffer( const WorkbookHelper& rHelper ) :
+ WorkbookHelper( rHelper ),
+ mnUnusedId( 1 )
+{
+}
+
+Connection& ConnectionsBuffer::createConnection()
+{
+ ConnectionRef xConnection( new Connection( *this ) );
+ maConnections.push_back( xConnection );
+ return *xConnection;
+}
+
+Connection& ConnectionsBuffer::createConnectionWithId()
+{
+ ConnectionRef xConnection( new Connection( *this, mnUnusedId ) );
+ maConnections.push_back( xConnection );
+ insertConnectionToMap( xConnection );
+ return *xConnection;
+}
+
+void ConnectionsBuffer::finalizeImport()
+{
+ for( ConnectionVector::iterator aIt = maConnections.begin(), aEnd = maConnections.end(); aIt != aEnd; ++aIt )
+ insertConnectionToMap( *aIt );
+}
+
+ConnectionRef ConnectionsBuffer::getConnection( sal_Int32 nConnId ) const
+{
+ return maConnectionsById.get( nConnId );
+}
+
+void ConnectionsBuffer::insertConnectionToMap( const ConnectionRef& rxConnection )
+{
+ sal_Int32 nConnId = rxConnection->getConnectionId();
+ if( nConnId > 0 )
+ {
+ OSL_ENSURE( !maConnectionsById.has( nConnId ), "ConnectionsBuffer::insertConnectionToMap - multiple connection identifier" );
+ maConnectionsById[ nConnId ] = rxConnection;
+ mnUnusedId = ::std::max< sal_Int32 >( mnUnusedId, nConnId + 1 );
+ }
+}
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
diff --git a/oox/source/xls/connectionsfragment.cxx b/oox/source/xls/connectionsfragment.cxx
index fb4c19890882..dde91218a433 100644
--- a/oox/source/xls/connectionsfragment.cxx
+++ b/oox/source/xls/connectionsfragment.cxx
@@ -27,89 +27,156 @@
************************************************************************/
#include "oox/xls/connectionsfragment.hxx"
-#include "oox/helper/attributelist.hxx"
-#include "oox/xls/webquerybuffer.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
+#include "oox/helper/attributelist.hxx"
+#include "oox/xls/biffhelper.hxx"
+#include "oox/xls/connectionsbuffer.hxx"
namespace oox {
namespace xls {
-OoxConnectionsFragment::OoxConnectionsFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+// ============================================================================
+
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+ConnectionContext::ConnectionContext( WorkbookFragmentBase& rParent, Connection& rConnection ) :
+ WorkbookContextBase( rParent ),
+ mrConnection( rConnection )
{
}
-ContextHandlerRef OoxConnectionsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ConnectionContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
- case XML_ROOT_CONTEXT:
- if( nElement == XLS_TOKEN( connections ) ) return this;
- break;
-
- case XLS_TOKEN( connections ):
- switch( nElement )
+ case XLS_TOKEN( connection ):
+ if( nElement == XLS_TOKEN( webPr ) )
{
- case XLS_TOKEN( connection ): importConnection( rAttribs ); return this;
+ mrConnection.importWebPr( rAttribs );
+ return this;
}
break;
- case XLS_TOKEN( connection ):
- switch( nElement )
+ case XLS_TOKEN( webPr ):
+ if( nElement == XLS_TOKEN( tables ) )
{
- case XLS_TOKEN( webPr ): importWebPr( rAttribs ); return this;
+ mrConnection.importTables( rAttribs );
+ return this;
}
break;
- case XLS_TOKEN( webPr ):
- switch( nElement )
+ case XLS_TOKEN( tables ):
+ mrConnection.importTable( rAttribs, nElement );
+ break;
+ }
+ return 0;
+}
+
+void ConnectionContext::onStartElement( const AttributeList& rAttribs )
+{
+ if( getCurrentElement() == XLS_TOKEN( connection ) )
+ mrConnection.importConnection( rAttribs );
+}
+
+ContextHandlerRef ConnectionContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
+{
+ switch( getCurrentElement() )
+ {
+ case BIFF12_ID_CONNECTION:
+ if( nRecId == BIFF12_ID_WEBPR )
{
- case XLS_TOKEN( tables ): importTables( rAttribs ); return this;
+ mrConnection.importWebPr( rStrm );
+ return this;
}
break;
- case XLS_TOKEN( tables ):
- switch( nElement )
+ case BIFF12_ID_WEBPR:
+ if( nRecId == BIFF12_ID_WEBPRTABLES )
{
- case XLS_TOKEN( s ): importS( rAttribs ); break;
- case XLS_TOKEN( x ): importX( rAttribs ); break;
+ mrConnection.importWebPrTables( rStrm );
+ return this;
}
break;
+
+ case BIFF12_ID_WEBPRTABLES:
+ mrConnection.importWebPrTable( rStrm, nRecId );
+ break;
}
return 0;
}
-void OoxConnectionsFragment::importConnection( const AttributeList& rAttribs )
+void ConnectionContext::onStartRecord( SequenceInputStream& rStrm )
+{
+ if( getCurrentElement() == BIFF12_ID_CONNECTION )
+ mrConnection.importConnection( rStrm );
+}
+
+// ============================================================================
+
+ConnectionsFragment::ConnectionsFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
+ WorkbookFragmentBase( rHelper, rFragmentPath )
{
- if ( rAttribs.getInteger( XML_type, 0 ) == Connection::CONNECTION_WEBQUERY )
- {
- getWebQueries().importConnection( rAttribs );
- }
}
-void OoxConnectionsFragment::importWebPr( const AttributeList& rAttribs )
+ContextHandlerRef ConnectionsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& /*rAttribs*/ )
{
- getWebQueries().importWebPr( rAttribs );
+ switch( getCurrentElement() )
+ {
+ case XML_ROOT_CONTEXT:
+ if( nElement == XLS_TOKEN( connections ) )
+ return this;
+ break;
+
+ case XLS_TOKEN( connections ):
+ if( nElement == XLS_TOKEN( connection ) )
+ return new ConnectionContext( *this, getConnections().createConnection() );
+ break;
+ }
+ return 0;
}
-void OoxConnectionsFragment::importTables( const AttributeList& /*rAttribs*/ )
+ContextHandlerRef ConnectionsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& /*rStrm*/ )
{
-// sal_Int32 nCount = rAttribs.getInteger( XML_count, 0 );
+ switch( getCurrentElement() )
+ {
+ case XML_ROOT_CONTEXT:
+ if( nRecId == BIFF12_ID_CONNECTIONS )
+ return this;
+ break;
+
+ case BIFF12_ID_CONNECTIONS:
+ if( nRecId == BIFF12_ID_CONNECTION )
+ return new ConnectionContext( *this, getConnections().createConnection() );
+ break;
+ }
+ return 0;
}
-void OoxConnectionsFragment::importS( const AttributeList& /*rAttribs*/ )
+const RecordInfo* ConnectionsFragment::getRecordInfos() const
{
-// OUString aName = rAttribs.getString( XML_v );
+ static const RecordInfo spRecInfos[] =
+ {
+ { BIFF12_ID_CONNECTIONS, BIFF12_ID_CONNECTIONS + 1 },
+ { BIFF12_ID_CONNECTION, BIFF12_ID_CONNECTION + 1 },
+ { BIFF12_ID_WEBPR, BIFF12_ID_WEBPR + 1 },
+ { BIFF12_ID_WEBPRTABLES, BIFF12_ID_WEBPRTABLES + 1 },
+ { -1, -1 }
+ };
+ return spRecInfos;
}
-void OoxConnectionsFragment::importX( const AttributeList& /*rAttribs*/ )
+void ConnectionsFragment::finalizeImport()
{
-// sal_Int32 nSharedId = rAttribs.getInteger( XML_v, 0 );
+ getConnections().finalizeImport();
}
+// ============================================================================
+
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/defnamesbuffer.cxx b/oox/source/xls/defnamesbuffer.cxx
index 6b1708c19858..03cd5e0c030a 100644
--- a/oox/source/xls/defnamesbuffer.cxx
+++ b/oox/source/xls/defnamesbuffer.cxx
@@ -27,7 +27,7 @@
************************************************************************/
#include "oox/xls/defnamesbuffer.hxx"
-#include <rtl/ustrbuf.hxx>
+
#include <com/sun/star/sheet/ComplexReference.hpp>
#include <com/sun/star/sheet/ExternalReference.hpp>
#include <com/sun/star/sheet/NamedRangeFlag.hpp>
@@ -35,8 +35,9 @@
#include <com/sun/star/sheet/SingleReference.hpp>
#include <com/sun/star/sheet/XFormulaTokens.hpp>
#include <com/sun/star/sheet/XPrintAreas.hpp>
-#include "properties.hxx"
+#include <rtl/ustrbuf.hxx>
#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
@@ -44,34 +45,30 @@
#include "oox/xls/formulaparser.hxx"
#include "oox/xls/worksheetbuffer.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::sheet::ComplexReference;
-using ::com::sun::star::sheet::ExternalReference;
-using ::com::sun::star::sheet::SingleReference;
-using ::com::sun::star::sheet::XFormulaTokens;
-using ::com::sun::star::sheet::XPrintAreas;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
-const sal_uInt32 OOBIN_DEFNAME_HIDDEN = 0x00000001;
-const sal_uInt32 OOBIN_DEFNAME_FUNC = 0x00000002;
-const sal_uInt32 OOBIN_DEFNAME_VBNAME = 0x00000004;
-const sal_uInt32 OOBIN_DEFNAME_MACRO = 0x00000008;
-const sal_uInt32 OOBIN_DEFNAME_CALCEXP = 0x00000010;
-const sal_uInt32 OOBIN_DEFNAME_BUILTIN = 0x00000020;
-const sal_uInt32 OOBIN_DEFNAME_PUBLISHED = 0x00008000;
-const sal_uInt32 OOBIN_DEFNAME_WBPARAM = 0x00010000;
+const sal_uInt32 BIFF12_DEFNAME_HIDDEN = 0x00000001;
+const sal_uInt32 BIFF12_DEFNAME_FUNC = 0x00000002;
+const sal_uInt32 BIFF12_DEFNAME_VBNAME = 0x00000004;
+const sal_uInt32 BIFF12_DEFNAME_MACRO = 0x00000008;
+const sal_uInt32 BIFF12_DEFNAME_CALCEXP = 0x00000010;
+const sal_uInt32 BIFF12_DEFNAME_BUILTIN = 0x00000020;
+const sal_uInt32 BIFF12_DEFNAME_PUBLISHED = 0x00008000;
+const sal_uInt32 BIFF12_DEFNAME_WBPARAM = 0x00010000;
const sal_uInt16 BIFF_DEFNAME_HIDDEN = 0x0001;
const sal_uInt16 BIFF_DEFNAME_FUNC = 0x0002;
@@ -85,6 +82,11 @@ const sal_uInt8 BIFF2_DEFNAME_FUNC = 0x02; /// BIFF2 function/comma
const sal_uInt16 BIFF_DEFNAME_GLOBAL = 0; /// 0 = Globally defined name.
+const sal_uInt16 BIFF_REFFLAG_COL1REL = 0x0001;
+const sal_uInt16 BIFF_REFFLAG_ROW1REL = 0x0002;
+const sal_uInt16 BIFF_REFFLAG_COL2REL = 0x0004;
+const sal_uInt16 BIFF_REFFLAG_ROW2REL = 0x0008;
+
// ----------------------------------------------------------------------------
const sal_Char* const spcLegacyPrefix = "Excel_BuiltIn_";
@@ -92,20 +94,20 @@ const sal_Char* const spcOoxPrefix = "_xlnm.";
const sal_Char* const sppcBaseNames[] =
{
- "Consolidate_Area", /* OOX */
+ "Consolidate_Area",
"Auto_Open",
"Auto_Close",
- "Extract", /* OOX */
- "Database", /* OOX */
- "Criteria", /* OOX */
- "Print_Area", /* OOX */
- "Print_Titles", /* OOX */
+ "Extract",
+ "Database",
+ "Criteria",
+ "Print_Area",
+ "Print_Titles",
"Recorder",
"Data_Form",
"Auto_Activate",
"Auto_Deactivate",
- "Sheet_Title", /* OOX */
- "_FilterDatabase" /* OOX */
+ "Sheet_Title",
+ "_FilterDatabase"
};
/** Localized names for _xlnm._FilterDatabase as used in BIFF5. */
@@ -117,7 +119,7 @@ const sal_Char* const sppcFilterDbNames[] =
OUString lclGetBaseName( sal_Unicode cBuiltinId )
{
- OSL_ENSURE( cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ), "lclGetBaseName - unknown builtin name" );
+ OSL_ENSURE( cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ), "lclGetBaseName - unsupported built-in identifier" );
OUStringBuffer aBuffer;
if( cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ) )
aBuffer.appendAscii( sppcBaseNames[ cBuiltinId ] );
@@ -126,67 +128,52 @@ OUString lclGetBaseName( sal_Unicode cBuiltinId )
return aBuffer.makeStringAndClear();
}
-OUString lclGetBuiltinName( sal_Unicode cBuiltinId )
+OUString lclGetPrefixedName( sal_Unicode cBuiltinId )
{
return OUStringBuffer().appendAscii( spcOoxPrefix ).append( lclGetBaseName( cBuiltinId ) ).makeStringAndClear();
}
-sal_Unicode lclGetBuiltinIdFromOox( const OUString& rOoxName )
+/** returns the built-in name identifier from a perfixed built-in name, e.g. '_xlnm.Print_Area'. */
+sal_Unicode lclGetBuiltinIdFromPrefixedName( const OUString& rModelName )
{
OUString aPrefix = OUString::createFromAscii( spcOoxPrefix );
sal_Int32 nPrefixLen = aPrefix.getLength();
- if( rOoxName.matchIgnoreAsciiCase( aPrefix ) )
+ if( rModelName.matchIgnoreAsciiCase( aPrefix ) )
{
for( sal_Unicode cBuiltinId = 0; cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ); ++cBuiltinId )
{
OUString aBaseName = lclGetBaseName( cBuiltinId );
sal_Int32 nBaseNameLen = aBaseName.getLength();
- if( (rOoxName.getLength() == nPrefixLen + nBaseNameLen) && rOoxName.matchIgnoreAsciiCase( aBaseName, nPrefixLen ) )
+ if( (rModelName.getLength() == nPrefixLen + nBaseNameLen) && rModelName.matchIgnoreAsciiCase( aBaseName, nPrefixLen ) )
return cBuiltinId;
}
}
- return OOX_DEFNAME_UNKNOWN;
+ return BIFF_DEFNAME_UNKNOWN;
}
-sal_Unicode lclGetBuiltinIdFromOob( const OUString& rOobName )
+/** returns the built-in name identifier from a built-in base name, e.g. 'Print_Area'. */
+sal_Unicode lclGetBuiltinIdFromBaseName( const OUString& rModelName )
{
for( sal_Unicode cBuiltinId = 0; cBuiltinId < STATIC_ARRAY_SIZE( sppcBaseNames ); ++cBuiltinId )
- if( rOobName.equalsIgnoreAsciiCaseAscii( sppcBaseNames[ cBuiltinId ] ) )
+ if( rModelName.equalsIgnoreAsciiCaseAscii( sppcBaseNames[ cBuiltinId ] ) )
return cBuiltinId;
- return OOX_DEFNAME_UNKNOWN;
+ return BIFF_DEFNAME_UNKNOWN;
}
-bool lclIsFilterDatabaseName( const OUString& rName )
+bool lclIsFilterDatabaseName( const OUString& rModelName )
{
for( const sal_Char* const* ppcName = sppcFilterDbNames; ppcName < STATIC_ARRAY_END( sppcFilterDbNames ); ++ppcName )
- if( rName.equalsIgnoreAsciiCaseAscii( *ppcName ) )
+ if( rModelName.equalsIgnoreAsciiCaseAscii( *ppcName ) )
return true;
return false;
}
-} // namespace
-
-// ============================================================================
-
-DefinedNameModel::DefinedNameModel() :
- mnSheet( -1 ),
- mnFuncGroupId( -1 ),
- mbMacro( false ),
- mbFunction( false ),
- mbVBName( false ),
- mbHidden( false )
+OUString lclGetUpcaseModelName( const OUString& rModelName )
{
+ // TODO: i18n?
+ return rModelName.toAsciiUpperCase();
}
-// ============================================================================
-
-namespace {
-
-const sal_uInt16 BIFF_REFFLAG_COL1REL = 0x0001;
-const sal_uInt16 BIFF_REFFLAG_ROW1REL = 0x0002;
-const sal_uInt16 BIFF_REFFLAG_COL2REL = 0x0004;
-const sal_uInt16 BIFF_REFFLAG_ROW2REL = 0x0008;
-
void lclConvertRefFlags( sal_Int32& ornFlags, sal_Int32& ornAbsPos, sal_Int32& ornRelPos, sal_Int32 nBasePos, sal_Int32 nApiRelFlag, bool bRel )
{
if( getFlag( ornFlags, nApiRelFlag ) && !bRel )
@@ -236,7 +223,19 @@ Any lclConvertReference( const Any& rRefAny, const CellAddress& rBaseAddress, sa
} // namespace
-// ----------------------------------------------------------------------------
+// ============================================================================
+
+DefinedNameModel::DefinedNameModel() :
+ mnSheet( -1 ),
+ mnFuncGroupId( -1 ),
+ mbMacro( false ),
+ mbFunction( false ),
+ mbVBName( false ),
+ mbHidden( false )
+{
+}
+
+// ============================================================================
DefinedNameBase::DefinedNameBase( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper )
@@ -246,7 +245,7 @@ DefinedNameBase::DefinedNameBase( const WorkbookHelper& rHelper ) :
const OUString& DefinedNameBase::getUpcaseModelName() const
{
if( maUpModelName.getLength() == 0 )
- maUpModelName = maModel.maName.toAsciiUpperCase();
+ maUpModelName = lclGetUpcaseModelName( maModel.maName );
return maUpModelName;
}
@@ -289,7 +288,7 @@ void DefinedNameBase::importOoxFormula( FormulaContext& rContext, sal_Int16 nBas
getFormulaParser().convertErrorToFormula( rContext, BIFF_ERR_NAME );
}
-void DefinedNameBase::importOobFormula( FormulaContext& rContext, sal_Int16 nBaseSheet, RecordInputStream& rStrm )
+void DefinedNameBase::importBiff12Formula( FormulaContext& rContext, sal_Int16 nBaseSheet, SequenceInputStream& rStrm )
{
rContext.setBaseAddress( CellAddress( nBaseSheet, 0, 0 ) );
getFormulaParser().importFormula( rContext, rStrm );
@@ -315,7 +314,7 @@ void DefinedNameBase::extractReference( const ApiTokenSequence& rTokens )
DefinedName::DefinedName( const WorkbookHelper& rHelper ) :
DefinedNameBase( rHelper ),
mnTokenIndex( -1 ),
- mcBuiltinId( OOX_DEFNAME_UNKNOWN ),
+ mcBuiltinId( BIFF_DEFNAME_UNKNOWN ),
mnFmlaSize( 0 )
{
}
@@ -329,8 +328,11 @@ void DefinedName::importDefinedName( const AttributeList& rAttribs )
maModel.mbFunction = rAttribs.getBool( XML_function, false );
maModel.mbVBName = rAttribs.getBool( XML_vbProcedure, false );
maModel.mbHidden = rAttribs.getBool( XML_hidden, false );
- mcBuiltinId = lclGetBuiltinIdFromOox( maModel.maName );
mnCalcSheet = (maModel.mnSheet >= 0) ? getWorksheets().getCalcSheetIndex( maModel.mnSheet ) : -1;
+
+ /* Detect built-in state from name itself, there is no built-in flag.
+ Built-in names are prexixed with '_xlnm.' instead. */
+ mcBuiltinId = lclGetBuiltinIdFromPrefixedName( maModel.maName );
}
void DefinedName::setFormula( const OUString& rFormula )
@@ -338,7 +340,7 @@ void DefinedName::setFormula( const OUString& rFormula )
maModel.maFormula = rFormula;
}
-void DefinedName::importDefinedName( RecordInputStream& rStrm )
+void DefinedName::importDefinedName( SequenceInputStream& rStrm )
{
sal_uInt32 nFlags;
rStrm >> nFlags;
@@ -348,17 +350,14 @@ void DefinedName::importDefinedName( RecordInputStream& rStrm )
// macro function/command, hidden flag
maModel.mnFuncGroupId = extractValue< sal_Int32 >( nFlags, 6, 9 );
- maModel.mbMacro = getFlag( nFlags, OOBIN_DEFNAME_MACRO );
- maModel.mbFunction = getFlag( nFlags, OOBIN_DEFNAME_FUNC );
- maModel.mbVBName = getFlag( nFlags, OOBIN_DEFNAME_VBNAME );
- maModel.mbHidden = getFlag( nFlags, OOBIN_DEFNAME_HIDDEN );
-
- // get builtin name index from name
- if( getFlag( nFlags, OOBIN_DEFNAME_BUILTIN ) )
- mcBuiltinId = lclGetBuiltinIdFromOob( maModel.maName );
- // unhide built-in names (_xlnm._FilterDatabase is always hidden)
- if( isBuiltinName() )
- maModel.mbHidden = false;
+ maModel.mbMacro = getFlag( nFlags, BIFF12_DEFNAME_MACRO );
+ maModel.mbFunction = getFlag( nFlags, BIFF12_DEFNAME_FUNC );
+ maModel.mbVBName = getFlag( nFlags, BIFF12_DEFNAME_VBNAME );
+ maModel.mbHidden = getFlag( nFlags, BIFF12_DEFNAME_HIDDEN );
+
+ // get built-in name index from name
+ if( getFlag( nFlags, BIFF12_DEFNAME_BUILTIN ) )
+ mcBuiltinId = lclGetBuiltinIdFromBaseName( maModel.maName );
// store token array data
sal_Int64 nRecPos = rStrm.tell();
@@ -420,24 +419,22 @@ void DefinedName::importDefinedName( BiffInputStream& rStrm, sal_Int16 nCalcShee
maModel.mbVBName = getFlag( nFlags, BIFF_DEFNAME_VBNAME );
maModel.mbHidden = getFlag( nFlags, BIFF_DEFNAME_HIDDEN );
- // get builtin name index from name
+ // get built-in name index from name
if( getFlag( nFlags, BIFF_DEFNAME_BUILTIN ) )
{
- OSL_ENSURE( maModel.maName.getLength() == 1, "DefinedName::importDefinedName - wrong builtin name" );
- if( maModel.maName.getLength() > 0 )
+ // name may be the built-in identifier or the built-in base name
+ if( maModel.maName.getLength() == 1 )
mcBuiltinId = maModel.maName[ 0 ];
+ else
+ mcBuiltinId = lclGetBuiltinIdFromBaseName( maModel.maName );
}
- /* In BIFF5, _xlnm._FilterDatabase appears as hidden user name without
+ /* In BIFF5, '_FilterDatabase' appears as hidden user name without
built-in flag, and even worse, localized. */
else if( (eBiff == BIFF5) && lclIsFilterDatabaseName( maModel.maName ) )
{
- mcBuiltinId = OOX_DEFNAME_FILTERDATABASE;
+ mcBuiltinId = BIFF_DEFNAME_FILTERDATABASE;
}
- // unhide built-in names (_xlnm._FilterDatabase is always hidden)
- if( isBuiltinName() )
- maModel.mbHidden = false;
-
// get sheet index for sheet-local names in BIFF5-BIFF8
switch( getBiff() )
{
@@ -487,18 +484,13 @@ void DefinedName::importDefinedName( BiffInputStream& rStrm, sal_Int16 nCalcShee
void DefinedName::createNameObject()
{
- // do not create names for (macro) functions
+ // do not create names for (macro) functions or VBA procedures
// #163146# do not ignore hidden names (may be regular names created by VBA scripts)
- if( /*maModel.mbHidden ||*/ maModel.mbFunction )
+ if( /*maModel.mbHidden ||*/ maModel.mbFunction || maModel.mbVBName )
return;
- // convert original name to final Calc name
- if( maModel.mbVBName )
- maCalcName = maModel.maName;
- else if( isBuiltinName() )
- maCalcName = lclGetBuiltinName( mcBuiltinId );
- else
- maCalcName = maModel.maName; //! TODO convert to valid name
+ // convert original name to final Calc name (TODO: filter invalid characters from model name)
+ maCalcName = isBuiltinName() ? lclGetPrefixedName( mcBuiltinId ) : maModel.maName;
// #163146# do not rename sheet-local names by default, this breaks VBA scripts
#if 0
@@ -513,9 +505,9 @@ void DefinedName::createNameObject()
using namespace ::com::sun::star::sheet::NamedRangeFlag;
if( !isGlobalName() ) switch( mcBuiltinId )
{
- case OOX_DEFNAME_CRITERIA: nNameFlags = FILTER_CRITERIA; break;
- case OOX_DEFNAME_PRINTAREA: nNameFlags = PRINT_AREA; break;
- case OOX_DEFNAME_PRINTTITLES: nNameFlags = COLUMN_HEADER | ROW_HEADER; break;
+ case BIFF_DEFNAME_CRITERIA: nNameFlags = FILTER_CRITERIA; break;
+ case BIFF_DEFNAME_PRINTAREA: nNameFlags = PRINT_AREA; break;
+ case BIFF_DEFNAME_PRINTTITLES: nNameFlags = COLUMN_HEADER | ROW_HEADER; break;
}
// create the name and insert it into the document, maCalcName will be changed to the resulting name
@@ -533,7 +525,7 @@ void DefinedName::convertFormula()
// convert and set formula of the defined name
switch( getFilterType() )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
{
SimpleFormulaContext aContext( xTokens, true, false );
implImportOoxFormula( aContext );
@@ -548,10 +540,10 @@ void DefinedName::convertFormula()
case FILTER_UNKNOWN: break;
}
- // set builtin names (print ranges, repeated titles, filter ranges)
+ // set built-in names (print ranges, repeated titles, filter ranges)
if( !isGlobalName() ) switch( mcBuiltinId )
{
- case OOX_DEFNAME_PRINTAREA:
+ case BIFF_DEFNAME_PRINTAREA:
{
Reference< XPrintAreas > xPrintAreas( getSheetFromDoc( mnCalcSheet ), UNO_QUERY );
ApiCellRangeList aPrintRanges;
@@ -560,7 +552,7 @@ void DefinedName::convertFormula()
xPrintAreas->setPrintAreas( ContainerHelper::vectorToSequence( aPrintRanges ) );
}
break;
- case OOX_DEFNAME_PRINTTITLES:
+ case BIFF_DEFNAME_PRINTTITLES:
{
Reference< XPrintAreas > xPrintAreas( getSheetFromDoc( mnCalcSheet ), UNO_QUERY );
ApiCellRangeList aTitleRanges;
@@ -606,8 +598,8 @@ void DefinedName::implImportOoxFormula( FormulaContext& rContext )
{
if( mxFormula.get() )
{
- RecordInputStream aStrm( *mxFormula );
- importOobFormula( rContext, mnCalcSheet, aStrm );
+ SequenceInputStream aStrm( *mxFormula );
+ importBiff12Formula( rContext, mnCalcSheet, aStrm );
}
else
importOoxFormula( rContext, mnCalcSheet );
@@ -644,7 +636,7 @@ DefinedNameRef DefinedNamesBuffer::importDefinedName( const AttributeList& rAttr
return xDefName;
}
-void DefinedNamesBuffer::importDefinedName( RecordInputStream& rStrm )
+void DefinedNamesBuffer::importDefinedName( SequenceInputStream& rStrm )
{
createDefinedName()->importDefinedName( rStrm );
}
@@ -656,14 +648,20 @@ void DefinedNamesBuffer::importDefinedName( BiffInputStream& rStrm )
void DefinedNamesBuffer::finalizeImport()
{
- // first insert all names without formula definition into the document
+ // first insert all names without formula definition into the document, and insert them into the maps
for( DefNameVector::iterator aIt = maDefNames.begin(), aEnd = maDefNames.end(); aIt != aEnd; ++aIt )
{
DefinedNameRef xDefName = *aIt;
xDefName->createNameObject();
+ // map by sheet index and original model name
+ maModelNameMap[ SheetNameKey( xDefName->getLocalCalcSheet(), xDefName->getUpcaseModelName() ) ] = xDefName;
+ // map by sheet index and built-in identifier
+ if( !xDefName->isGlobalName() && xDefName->isBuiltinName() )
+ maBuiltinMap[ BuiltinKey( xDefName->getLocalCalcSheet(), xDefName->getBuiltinId() ) ] = xDefName;
+ // map by API formula token identifier
sal_Int32 nTokenIndex = xDefName->getTokenIndex();
if( nTokenIndex >= 0 )
- maDefNameMap[ nTokenIndex ] = xDefName;
+ maTokenIdMap[ nTokenIndex ] = xDefName;
}
/* Now convert all name formulas, so that the formula parser can find all
@@ -678,25 +676,22 @@ DefinedNameRef DefinedNamesBuffer::getByIndex( sal_Int32 nIndex ) const
DefinedNameRef DefinedNamesBuffer::getByTokenIndex( sal_Int32 nIndex ) const
{
- return maDefNameMap.get( nIndex );
+ return maTokenIdMap.get( nIndex );
}
DefinedNameRef DefinedNamesBuffer::getByModelName( const OUString& rModelName, sal_Int16 nCalcSheet ) const
{
- DefinedNameRef xGlobalName; // a found global name
- DefinedNameRef xLocalName; // a found local name
- for( DefNameVector::const_iterator aIt = maDefNames.begin(), aEnd = maDefNames.end(); (aIt != aEnd) && !xLocalName; ++aIt )
- {
- DefinedNameRef xCurrName = *aIt;
- if( xCurrName->getModelName() == rModelName )
- {
- if( xCurrName->getLocalCalcSheet() == nCalcSheet )
- xLocalName = xCurrName;
- else if( xCurrName->isGlobalName() )
- xGlobalName = xCurrName;
- }
- }
- return xLocalName.get() ? xLocalName : xGlobalName;
+ OUString aUpcaseName = lclGetUpcaseModelName( rModelName );
+ DefinedNameRef xDefName = maModelNameMap.get( SheetNameKey( nCalcSheet, aUpcaseName ) );
+ // lookup global name, if no local name exists
+ if( !xDefName && (nCalcSheet >= 0) )
+ xDefName = maModelNameMap.get( SheetNameKey( -1, aUpcaseName ) );
+ return xDefName;
+}
+
+DefinedNameRef DefinedNamesBuffer::getByBuiltinId( sal_Unicode cBuiltinId, sal_Int16 nCalcSheet ) const
+{
+ return maBuiltinMap.get( BuiltinKey( nCalcSheet, cBuiltinId ) );
}
DefinedNameRef DefinedNamesBuffer::createDefinedName()
@@ -711,4 +706,4 @@ DefinedNameRef DefinedNamesBuffer::createDefinedName()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx
index 4a32fe5d42e1..a774ee4fed92 100644
--- a/oox/source/xls/drawingfragment.cxx
+++ b/oox/source/xls/drawingfragment.cxx
@@ -27,11 +27,16 @@
************************************************************************/
#include "oox/xls/drawingfragment.hxx"
-#include <com/sun/star/awt/Point.hpp>
+
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/container/XNameReplace.hpp>
+#include <com/sun/star/document/XEventsSupplier.hpp>
+#include <com/sun/star/drawing/XControlShape.hpp>
+#include <com/sun/star/script/ScriptEventDescriptor.hpp>
+#include <com/sun/star/script/XEventAttacherManager.hpp>
+#include <rtl/strbuf.hxx>
#include "oox/drawingml/connectorshapecontext.hxx"
#include "oox/drawingml/graphicshapecontext.hxx"
-#include "oox/drawingml/shapecontext.hxx"
-#include "oox/drawingml/shapegroupcontext.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/propertyset.hxx"
#include "oox/vml/vmlshape.hxx"
@@ -40,32 +45,32 @@
#include "oox/xls/stylesbuffer.hxx"
#include "oox/xls/themebuffer.hxx"
#include "oox/xls/unitconverter.hxx"
-#include "properties.hxx"
-namespace oox {
-namespace xls {
+using ::rtl::OUString;
// ============================================================================
using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::script;
using namespace ::com::sun::star::table;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::xml::sax;
+using namespace ::oox::core;
+using namespace ::oox::drawingml;
+using namespace ::oox::ole;
-using ::oox::core::ContextHandlerRef;
-using ::oox::drawingml::ConnectorShapeContext;
-using ::oox::drawingml::GraphicalObjectFrameContext;
-using ::oox::drawingml::GraphicShapeContext;
-using ::oox::drawingml::Shape;
-using ::oox::drawingml::ShapePtr;
-using ::oox::drawingml::ShapeContext;
-using ::oox::drawingml::ShapeGroupContext;
+using ::rtl::OStringBuffer;
using ::rtl::OUString;
-
-
+using ::rtl::OUStringToOString;
// no using's for ::oox::vml, that may clash with ::oox::drawingml types
// ============================================================================
+// DrawingML
+// ============================================================================
namespace {
@@ -405,19 +410,120 @@ Rectangle ShapeAnchor::calcEmuLocation( const AnchorSizeModel& rEmuSheetSize ) c
// ============================================================================
-OoxDrawingFragment::OoxDrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorksheetFragmentBase( rHelper, rFragmentPath ),
+ShapeMacroAttacher::ShapeMacroAttacher( const OUString& rMacroName, const Reference< XShape >& rxShape ) :
+ VbaMacroAttacherBase( rMacroName ),
+ mxShape( rxShape )
+{
+}
+
+void ShapeMacroAttacher::attachMacro( const OUString& rMacroUrl )
+{
+ try
+ {
+ Reference< XEventsSupplier > xSupplier( mxShape, UNO_QUERY_THROW );
+ Reference< XNameReplace > xEvents( xSupplier->getEvents(), UNO_SET_THROW );
+ Sequence< PropertyValue > aEventProps( 2 );
+ aEventProps[ 0 ].Name = CREATE_OUSTRING( "EventType" );
+ aEventProps[ 0 ].Value <<= CREATE_OUSTRING( "Script" );
+ aEventProps[ 1 ].Name = CREATE_OUSTRING( "Script" );
+ aEventProps[ 1 ].Value <<= rMacroUrl;
+ xEvents->replaceByName( CREATE_OUSTRING( "OnClick" ), Any( aEventProps ) );
+ }
+ catch( Exception& )
+ {
+ }
+}
+
+// ============================================================================
+
+Shape::Shape( const WorksheetHelper& rHelper, const AttributeList& rAttribs, const sal_Char* pcServiceName ) :
+ ::oox::drawingml::Shape( pcServiceName ),
+ WorksheetHelper( rHelper )
+{
+ OUString aMacro = rAttribs.getXString( XML_macro, OUString() );
+ if( aMacro.getLength() > 0 )
+ maMacroName = getFormulaParser().importMacroName( aMacro );
+}
+
+void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >& rxShapes )
+{
+ if( (maMacroName.getLength() > 0) && mxShape.is() )
+ {
+ VbaMacroAttacherRef xAttacher( new ShapeMacroAttacher( maMacroName, mxShape ) );
+ getBaseFilter().getVbaProject().registerMacroAttacher( xAttacher );
+ }
+ ::oox::drawingml::Shape::finalizeXShape( rFilter, rxShapes );
+}
+
+// ============================================================================
+
+GroupShapeContext::GroupShapeContext( ContextHandler& rParent,
+ const WorksheetHelper& rHelper, const ShapePtr& rxParentShape, const ShapePtr& rxShape ) :
+ ShapeGroupContext( rParent, rxParentShape, rxShape ),
+ WorksheetHelper( rHelper )
+{
+}
+
+/*static*/ ContextHandlerRef GroupShapeContext::createShapeContext( ContextHandler& rParent,
+ const WorksheetHelper& rHelper, sal_Int32 nElement, const AttributeList& rAttribs,
+ const ShapePtr& rxParentShape, ShapePtr* pxShape )
+{
+ switch( nElement )
+ {
+ case XDR_TOKEN( sp ):
+ {
+ ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.CustomShape" ) );
+ if( pxShape ) *pxShape = xShape;
+ return new ShapeContext( rParent, rxParentShape, xShape );
+ }
+ case XDR_TOKEN( cxnSp ):
+ {
+ ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.ConnectorShape" ) );
+ if( pxShape ) *pxShape = xShape;
+ return new ConnectorShapeContext( rParent, rxParentShape, xShape );
+ }
+ case XDR_TOKEN( pic ):
+ {
+ ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GraphicObjectShape" ) );
+ if( pxShape ) *pxShape = xShape;
+ return new GraphicShapeContext( rParent, rxParentShape, xShape );
+ }
+ case XDR_TOKEN( graphicFrame ):
+ {
+ ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GraphicObjectShape" ) );
+ if( pxShape ) *pxShape = xShape;
+ return new GraphicalObjectFrameContext( rParent, rxParentShape, xShape, rHelper.getSheetType() != SHEETTYPE_CHARTSHEET );
+ }
+ case XDR_TOKEN( grpSp ):
+ {
+ ShapePtr xShape( new Shape( rHelper, rAttribs, "com.sun.star.drawing.GroupShape" ) );
+ if( pxShape ) *pxShape = xShape;
+ return new GroupShapeContext( rParent, rHelper, rxParentShape, xShape );
+ }
+ }
+ return 0;
+}
+
+Reference< XFastContextHandler > SAL_CALL GroupShapeContext::createFastChildContext(
+ sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) throw (SAXException, RuntimeException)
+{
+ ContextHandlerRef xContext = createShapeContext( *this, *this, nElement, AttributeList( rxAttribs ), mpGroupShapePtr );
+ return xContext.get() ? xContext.get() : ShapeGroupContext::createFastChildContext( nElement, rxAttribs );
+}
+
+// ============================================================================
+
+DrawingFragment::DrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+ WorksheetFragmentBase( rHelper, rFragmentPath ),
mxDrawPage( rHelper.getDrawPage(), UNO_QUERY )
{
- OSL_ENSURE( mxDrawPage.is(), "OoxDrawingFragment::OoxDrawingFragment - missing drawing page" );
+ OSL_ENSURE( mxDrawPage.is(), "DrawingFragment::DrawingFragment - missing drawing page" );
maApiSheetSize = getDrawPageSize();
maEmuSheetSize.Width = static_cast< sal_Int64 >( getUnitConverter().scaleFromMm100( maApiSheetSize.Width, UNIT_EMU ) );
maEmuSheetSize.Height = static_cast< sal_Int64 >( getUnitConverter().scaleFromMm100( maApiSheetSize.Height, UNIT_EMU ) );
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxDrawingFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef DrawingFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -440,31 +546,19 @@ ContextHandlerRef OoxDrawingFragment::onCreateContext( sal_Int32 nElement, const
case XDR_TOKEN( absoluteAnchor ):
case XDR_TOKEN( oneCellAnchor ):
case XDR_TOKEN( twoCellAnchor ):
+ {
switch( nElement )
{
- case XDR_TOKEN( sp ):
- mxShape.reset( new Shape( "com.sun.star.drawing.CustomShape" ) );
- return new ShapeContext( *this, ShapePtr(), mxShape );
- case XDR_TOKEN( cxnSp ):
- mxShape.reset( new Shape( "com.sun.star.drawing.ConnectorShape" ) );
- return new ConnectorShapeContext( *this, ShapePtr(), mxShape );
- case XDR_TOKEN( pic ):
- mxShape.reset( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) );
- return new GraphicShapeContext( *this, ShapePtr(), mxShape );
- case XDR_TOKEN( graphicFrame ):
- mxShape.reset( new Shape( "com.sun.star.drawing.OLE2Shape" ) );
- return new GraphicalObjectFrameContext( *this, ShapePtr(), mxShape, getSheetType() != SHEETTYPE_CHARTSHEET );
- case XDR_TOKEN( grpSp ):
- mxShape.reset( new Shape( "com.sun.star.drawing.GroupShape" ) );
- return new ShapeGroupContext( *this, ShapePtr(), mxShape );
-
case XDR_TOKEN( from ):
case XDR_TOKEN( to ): return this;
case XDR_TOKEN( pos ): if( mxAnchor.get() ) mxAnchor->importPos( rAttribs ); break;
case XDR_TOKEN( ext ): if( mxAnchor.get() ) mxAnchor->importExt( rAttribs ); break;
case XDR_TOKEN( clientData ): if( mxAnchor.get() ) mxAnchor->importClientData( rAttribs ); break;
+
+ default: return GroupShapeContext::createShapeContext( *this, *this, nElement, rAttribs, ShapePtr(), &mxShape );
}
+ }
break;
case XDR_TOKEN( from ):
@@ -474,14 +568,14 @@ ContextHandlerRef OoxDrawingFragment::onCreateContext( sal_Int32 nElement, const
case XDR_TOKEN( col ):
case XDR_TOKEN( row ):
case XDR_TOKEN( colOff ):
- case XDR_TOKEN( rowOff ): return this; // collect index in onEndElement()
+ case XDR_TOKEN( rowOff ): return this; // collect index in onCharacters()
}
break;
}
return 0;
}
-void OoxDrawingFragment::onEndElement( const OUString& rChars )
+void DrawingFragment::onCharacters( const OUString& rChars )
{
switch( getCurrentElement() )
{
@@ -489,8 +583,15 @@ void OoxDrawingFragment::onEndElement( const OUString& rChars )
case XDR_TOKEN( row ):
case XDR_TOKEN( colOff ):
case XDR_TOKEN( rowOff ):
- if( mxAnchor.get() ) mxAnchor->setCellPos( getCurrentElement(), getPreviousElement(), rChars );
+ if( mxAnchor.get() ) mxAnchor->setCellPos( getCurrentElement(), getParentElement(), rChars );
break;
+ }
+}
+
+void DrawingFragment::onEndElement()
+{
+ switch( getCurrentElement() )
+ {
case XDR_TOKEN( absoluteAnchor ):
case XDR_TOKEN( oneCellAnchor ):
case XDR_TOKEN( twoCellAnchor ):
@@ -500,8 +601,15 @@ void OoxDrawingFragment::onEndElement( const OUString& rChars )
if( (aShapeRect.X >= 0) && (aShapeRect.Y >= 0) && (aShapeRect.Width >= 0) && (aShapeRect.Height >= 0) )
{
mxShape->addShape( getOoxFilter(), &getTheme(), mxDrawPage, &aShapeRect );
- // collect all shape positions in the WorksheetHelper base class
- extendShapeBoundingBox( aShapeRect );
+ /* Collect all shape positions in the WorksheetHelper base
+ class. But first, scale EMUs to 1/100 mm. */
+ const UnitConverter& rUnitConv = getUnitConverter();
+ Rectangle aShapeRectHmm(
+ rUnitConv.scaleToMm100( aShapeRect.X, UNIT_EMU ),
+ rUnitConv.scaleToMm100( aShapeRect.Y, UNIT_EMU ),
+ rUnitConv.scaleToMm100( aShapeRect.Width, UNIT_EMU ),
+ rUnitConv.scaleToMm100( aShapeRect.Height, UNIT_EMU ) );
+ extendShapeBoundingBox( aShapeRectHmm );
}
}
mxShape.reset();
@@ -511,6 +619,8 @@ void OoxDrawingFragment::onEndElement( const OUString& rChars )
}
// ============================================================================
+// VML
+// ============================================================================
namespace {
@@ -525,6 +635,8 @@ private:
sal_Int32 mnRow;
};
+// ----------------------------------------------------------------------------
+
VmlFindNoteFunc::VmlFindNoteFunc( const CellAddress& rPos ) :
mnCol( rPos.Column ),
mnRow( rPos.Row )
@@ -533,19 +645,88 @@ VmlFindNoteFunc::VmlFindNoteFunc( const CellAddress& rPos ) :
bool VmlFindNoteFunc::operator()( const ::oox::vml::ShapeBase& rShape ) const
{
- const ::oox::vml::ShapeModel::ShapeClientDataPtr& rxClientData = rShape.getShapeModel().mxClientData;
- return rxClientData.get() && (rxClientData->mnCol == mnCol) && (rxClientData->mnRow == mnRow);
+ const ::oox::vml::ClientData* pClientData = rShape.getClientData();
+ return pClientData && (pClientData->mnCol == mnCol) && (pClientData->mnRow == mnRow);
}
} // namespace
-// ----------------------------------------------------------------------------
+// ============================================================================
+
+VmlControlMacroAttacher::VmlControlMacroAttacher( const OUString& rMacroName,
+ const Reference< XIndexContainer >& rxCtrlFormIC, sal_Int32 nCtrlIndex, sal_Int32 nCtrlType, sal_Int32 nDropStyle ) :
+ VbaMacroAttacherBase( rMacroName ),
+ mxCtrlFormIC( rxCtrlFormIC ),
+ mnCtrlIndex( nCtrlIndex ),
+ mnCtrlType( nCtrlType ),
+ mnDropStyle( nDropStyle )
+{
+}
+
+void VmlControlMacroAttacher::attachMacro( const OUString& rMacroUrl )
+{
+ ScriptEventDescriptor aEventDesc;
+ aEventDesc.ScriptType = CREATE_OUSTRING( "Script" );
+ aEventDesc.ScriptCode = rMacroUrl;
+
+ // editable drop downs are treated like edit boxes
+ bool bEditDropDown = (mnCtrlType == XML_Drop) && (mnDropStyle == XML_ComboEdit);
+ sal_Int32 nCtrlType = bEditDropDown ? XML_Edit : mnCtrlType;
+
+ switch( nCtrlType )
+ {
+ case XML_Button:
+ case XML_Checkbox:
+ case XML_Radio:
+ aEventDesc.ListenerType = CREATE_OUSTRING( "XActionListener" );
+ aEventDesc.EventMethod = CREATE_OUSTRING( "actionPerformed" );
+ break;
+ case XML_Label:
+ case XML_GBox:
+ case XML_Dialog:
+ aEventDesc.ListenerType = CREATE_OUSTRING( "XMouseListener" );
+ aEventDesc.EventMethod = CREATE_OUSTRING( "mouseReleased" );
+ break;
+ case XML_Edit:
+ aEventDesc.ListenerType = CREATE_OUSTRING( "XTextListener" );
+ aEventDesc.EventMethod = CREATE_OUSTRING( "textChanged" );
+ break;
+ case XML_Spin:
+ case XML_Scroll:
+ aEventDesc.ListenerType = CREATE_OUSTRING( "XAdjustmentListener" );
+ aEventDesc.EventMethod = CREATE_OUSTRING( "adjustmentValueChanged" );
+ break;
+ case XML_List:
+ case XML_Drop:
+ aEventDesc.ListenerType = CREATE_OUSTRING( "XChangeListener" );
+ aEventDesc.EventMethod = CREATE_OUSTRING( "changed" );
+ break;
+ default:
+ OSL_ENSURE( false, "VmlControlMacroAttacher::attachMacro - unexpected object type" );
+ return;
+ }
+
+ try
+ {
+ Reference< XEventAttacherManager > xEventMgr( mxCtrlFormIC, UNO_QUERY_THROW );
+ xEventMgr->registerScriptEvent( mnCtrlIndex, aEventDesc );
+ }
+ catch( Exception& )
+ {
+ }
+}
+
+// ============================================================================
VmlDrawing::VmlDrawing( const WorksheetHelper& rHelper ) :
::oox::vml::Drawing( rHelper.getOoxFilter(), rHelper.getDrawPage(), ::oox::vml::VMLDRAWING_EXCEL ),
WorksheetHelper( rHelper ),
maControlConv( rHelper.getBaseFilter().getModel(), rHelper.getBaseFilter().getGraphicHelper() )
{
+ // default font for legacy listboxes and dropdowns: Tahoma, 8pt
+ maListBoxFont.moName = CREATE_OUSTRING( "Tahoma" );
+ maListBoxFont.moColor = CREATE_OUSTRING( "auto" );
+ maListBoxFont.monSize = 160;
}
const ::oox::vml::ShapeBase* VmlDrawing::getNoteShape( const CellAddress& rPos ) const
@@ -555,11 +736,35 @@ const ::oox::vml::ShapeBase* VmlDrawing::getNoteShape( const CellAddress& rPos )
bool VmlDrawing::isShapeSupported( const ::oox::vml::ShapeBase& rShape ) const
{
- const ::oox::vml::ShapeModel::ShapeClientDataPtr& rxClientData = rShape.getShapeModel().mxClientData;
- return !rxClientData.get() || (rxClientData->mnObjType != XML_Note);
+ const ::oox::vml::ClientData* pClientData = rShape.getClientData();
+ return !pClientData || (pClientData->mnObjType != XML_Note);
+}
+
+OUString VmlDrawing::getShapeBaseName( const ::oox::vml::ShapeBase& rShape ) const
+{
+ if( const ::oox::vml::ClientData* pClientData = rShape.getClientData() )
+ {
+ switch( pClientData->mnObjType )
+ {
+ case XML_Button: return CREATE_OUSTRING( "Button" );
+ case XML_Checkbox: return CREATE_OUSTRING( "Check Box" );
+ case XML_Dialog: return CREATE_OUSTRING( "Dialog Frame" );
+ case XML_Drop: return CREATE_OUSTRING( "Drop Down" );
+ case XML_Edit: return CREATE_OUSTRING( "Edit Box" );
+ case XML_GBox: return CREATE_OUSTRING( "Group Box" );
+ case XML_Label: return CREATE_OUSTRING( "Label" );
+ case XML_List: return CREATE_OUSTRING( "List Box" );
+ case XML_Note: return CREATE_OUSTRING( "Comment" );
+ case XML_Pict: return (pClientData->mbDde || getOleObjectInfo( rShape.getShapeId() )) ? CREATE_OUSTRING( "Object" ) : CREATE_OUSTRING( "Picture" );
+ case XML_Radio: return CREATE_OUSTRING( "Option Button" );
+ case XML_Scroll: return CREATE_OUSTRING( "Scroll Bar" );
+ case XML_Spin: return CREATE_OUSTRING( "Spinner" );
+ }
+ }
+ return ::oox::vml::Drawing::getShapeBaseName( rShape );
}
-bool VmlDrawing::convertShapeClientAnchor( Rectangle& orShapeRect, const OUString& rShapeAnchor ) const
+bool VmlDrawing::convertClientAnchor( Rectangle& orShapeRect, const OUString& rShapeAnchor ) const
{
if( rShapeAnchor.getLength() == 0 )
return false;
@@ -569,37 +774,320 @@ bool VmlDrawing::convertShapeClientAnchor( Rectangle& orShapeRect, const OUStrin
return (orShapeRect.Width >= 0) && (orShapeRect.Height >= 0);
}
-void VmlDrawing::convertControlClientData( const Reference< XControlModel >& rxCtrlModel,
- const ::oox::vml::ShapeClientData& rClientData ) const
+Reference< XShape > VmlDrawing::createAndInsertClientXShape( const ::oox::vml::ShapeBase& rShape,
+ const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect ) const
+{
+ // simulate the legacy drawing controls with OLE form controls
+ OUString aShapeName = rShape.getShapeName();
+ const ::oox::vml::ClientData* pClientData = rShape.getClientData();
+ if( (aShapeName.getLength() > 0) && pClientData )
+ {
+ Rectangle aShapeRect = rShapeRect;
+ const ::oox::vml::TextBox* pTextBox = rShape.getTextBox();
+ EmbeddedControl aControl( aShapeName );
+ switch( pClientData->mnObjType )
+ {
+ case XML_Button:
+ {
+ AxCommandButtonModel& rAxModel = aControl.createModel< AxCommandButtonModel >();
+ convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
+ rAxModel.mnFlags = AX_FLAGS_ENABLED | AX_FLAGS_OPAQUE | AX_FLAGS_WORDWRAP;
+ rAxModel.mnVerticalAlign = pClientData->mnTextVAlign;
+ }
+ break;
+
+ case XML_Label:
+ {
+ AxLabelModel& rAxModel = aControl.createModel< AxLabelModel >();
+ convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
+ rAxModel.mnFlags = AX_FLAGS_ENABLED | AX_FLAGS_WORDWRAP;
+ rAxModel.mnBorderStyle = AX_BORDERSTYLE_NONE;
+ rAxModel.mnSpecialEffect = AX_SPECIALEFFECT_FLAT;
+ rAxModel.mnVerticalAlign = pClientData->mnTextVAlign;
+ }
+ break;
+
+ case XML_Edit:
+ {
+ bool bNumeric = (pClientData->mnVTEdit == ::oox::vml::VML_CLIENTDATA_INTEGER) || (pClientData->mnVTEdit == ::oox::vml::VML_CLIENTDATA_NUMBER);
+ AxMorphDataModelBase& rAxModel = bNumeric ?
+ static_cast< AxMorphDataModelBase& >( aControl.createModel< AxNumericFieldModel >() ) :
+ static_cast< AxMorphDataModelBase& >( aControl.createModel< AxTextBoxModel >() );
+ convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maValue, pTextBox, pClientData->mnTextHAlign );
+ setFlag( rAxModel.mnFlags, AX_FLAGS_MULTILINE, pClientData->mbMultiLine );
+ setFlag( rAxModel.mnScrollBars, AX_SCROLLBAR_VERTICAL, pClientData->mbVScroll );
+ if( pClientData->mbSecretEdit )
+ rAxModel.mnPasswordChar = '*';
+ }
+ break;
+
+ case XML_GBox:
+ {
+ AxFrameModel& rAxModel = aControl.createModel< AxFrameModel >();
+ convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
+ rAxModel.mnBorderStyle = pClientData->mbNo3D ? AX_BORDERSTYLE_SINGLE : AX_BORDERSTYLE_NONE;
+ rAxModel.mnSpecialEffect = pClientData->mbNo3D ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_BUMPED;
+
+ /* Move top border of groupbox up by half font height, because
+ Excel specifies Y position of the groupbox border line
+ instead the top border of the caption text. */
+ if( const ::oox::vml::TextFontModel* pFontModel = pTextBox ? pTextBox->getFirstFont() : 0 )
+ {
+ sal_Int32 nFontHeightHmm = getUnitConverter().scaleToMm100( pFontModel->monSize.get( 160 ), UNIT_TWIP );
+ sal_Int32 nYDiff = ::std::min< sal_Int32 >( nFontHeightHmm / 2, aShapeRect.Y );
+ aShapeRect.Y -= nYDiff;
+ aShapeRect.Height += nYDiff;
+ }
+ }
+ break;
+
+ case XML_Checkbox:
+ {
+ AxCheckBoxModel& rAxModel = aControl.createModel< AxCheckBoxModel >();
+ convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
+ convertControlBackground( rAxModel, rShape );
+ rAxModel.maValue = OUString::valueOf( pClientData->mnChecked );
+ rAxModel.mnSpecialEffect = pClientData->mbNo3D ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN;
+ rAxModel.mnVerticalAlign = pClientData->mnTextVAlign;
+ bool bTriState = (pClientData->mnChecked != ::oox::vml::VML_CLIENTDATA_UNCHECKED) && (pClientData->mnChecked != ::oox::vml::VML_CLIENTDATA_CHECKED);
+ rAxModel.mnMultiSelect = bTriState ? AX_SELCTION_MULTI : AX_SELCTION_SINGLE;
+ }
+ break;
+
+ case XML_Radio:
+ {
+ AxOptionButtonModel& rAxModel = aControl.createModel< AxOptionButtonModel >();
+ convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, pClientData->mnTextHAlign );
+ convertControlBackground( rAxModel, rShape );
+ rAxModel.maValue = OUString::valueOf( pClientData->mnChecked );
+ rAxModel.mnSpecialEffect = pClientData->mbNo3D ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN;
+ rAxModel.mnVerticalAlign = pClientData->mnTextVAlign;
+ }
+ break;
+
+ case XML_List:
+ {
+ AxListBoxModel& rAxModel = aControl.createModel< AxListBoxModel >();
+ convertControlFontData( rAxModel.maFontData, rAxModel.mnTextColor, maListBoxFont );
+ rAxModel.mnBorderStyle = pClientData->mbNo3D2 ? AX_BORDERSTYLE_SINGLE : AX_BORDERSTYLE_NONE;
+ rAxModel.mnSpecialEffect = pClientData->mbNo3D2 ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN;
+ switch( pClientData->mnSelType )
+ {
+ case XML_Single: rAxModel.mnMultiSelect = AX_SELCTION_SINGLE; break;
+ case XML_Multi: rAxModel.mnMultiSelect = AX_SELCTION_MULTI; break;
+ case XML_Extend: rAxModel.mnMultiSelect = AX_SELCTION_EXTENDED; break;
+ }
+ }
+ break;
+
+ case XML_Drop:
+ {
+ AxComboBoxModel& rAxModel = aControl.createModel< AxComboBoxModel >();
+ convertControlFontData( rAxModel.maFontData, rAxModel.mnTextColor, maListBoxFont );
+ rAxModel.mnDisplayStyle = AX_DISPLAYSTYLE_DROPDOWN;
+ rAxModel.mnShowDropButton = AX_SHOWDROPBUTTON_ALWAYS;
+ rAxModel.mnBorderStyle = pClientData->mbNo3D2 ? AX_BORDERSTYLE_SINGLE : AX_BORDERSTYLE_NONE;
+ rAxModel.mnSpecialEffect = pClientData->mbNo3D2 ? AX_SPECIALEFFECT_FLAT : AX_SPECIALEFFECT_SUNKEN;
+ rAxModel.mnListRows = pClientData->mnDropLines;
+ }
+ break;
+
+ case XML_Spin:
+ {
+ AxSpinButtonModel& rAxModel = aControl.createModel< AxSpinButtonModel >();
+ rAxModel.mnMin = pClientData->mnMin;
+ rAxModel.mnMax = pClientData->mnMax;
+ rAxModel.mnPosition = pClientData->mnVal;
+ rAxModel.mnSmallChange = pClientData->mnInc;
+ }
+ break;
+
+ case XML_Scroll:
+ {
+ AxScrollBarModel& rAxModel = aControl.createModel< AxScrollBarModel >();
+ rAxModel.mnMin = pClientData->mnMin;
+ rAxModel.mnMax = pClientData->mnMax;
+ rAxModel.mnPosition = pClientData->mnVal;
+ rAxModel.mnSmallChange = pClientData->mnInc;
+ rAxModel.mnLargeChange = pClientData->mnPage;
+ }
+ break;
+
+ case XML_Dialog:
+ {
+ // fake with a group box
+ AxFrameModel& rAxModel = aControl.createModel< AxFrameModel >();
+ convertControlText( rAxModel.maFontData, rAxModel.mnTextColor, rAxModel.maCaption, pTextBox, XML_Left );
+ rAxModel.mnBorderStyle = AX_BORDERSTYLE_SINGLE;
+ rAxModel.mnSpecialEffect = AX_SPECIALEFFECT_FLAT;
+ }
+ break;
+ }
+
+ if( ControlModelBase* pAxModel = aControl.getModel() )
+ {
+ // create the control shape
+ pAxModel->maSize.first = aShapeRect.Width;
+ pAxModel->maSize.second = aShapeRect.Height;
+ sal_Int32 nCtrlIndex = -1;
+ Reference< XShape > xShape = createAndInsertXControlShape( aControl, rxShapes, aShapeRect, nCtrlIndex );
+
+ // control shape macro
+ if( xShape.is() && (nCtrlIndex >= 0) && (pClientData->maFmlaMacro.getLength() > 0) )
+ {
+ OUString aMacroName = getFormulaParser().importMacroName( pClientData->maFmlaMacro );
+ if( aMacroName.getLength() > 0 )
+ {
+ Reference< XIndexContainer > xFormIC = getControlForm().getXForm();
+ VbaMacroAttacherRef xAttacher( new VmlControlMacroAttacher( aMacroName, xFormIC, nCtrlIndex, pClientData->mnObjType, pClientData->mnDropStyle ) );
+ getBaseFilter().getVbaProject().registerMacroAttacher( xAttacher );
+ }
+ }
+
+ return xShape;
+ }
+ }
+
+ return Reference< XShape >();
+}
+
+void VmlDrawing::notifyXShapeInserted( const Reference< XShape >& rxShape,
+ const Rectangle& rShapeRect, const ::oox::vml::ShapeBase& rShape, bool bGroupChild )
{
- if( rxCtrlModel.is() )
+ // collect all shape positions in the WorksheetHelper base class (but not children of group shapes)
+ if( !bGroupChild )
+ extendShapeBoundingBox( rShapeRect );
+
+ // convert settings from VML client data
+ if( const ::oox::vml::ClientData* pClientData = rShape.getClientData() )
{
- PropertySet aPropSet( rxCtrlModel );
+ // specific settings for embedded form controls
+ try
+ {
+ Reference< XControlShape > xCtrlShape( rxShape, UNO_QUERY_THROW );
+ Reference< XControlModel > xCtrlModel( xCtrlShape->getControl(), UNO_SET_THROW );
+ PropertySet aPropSet( xCtrlModel );
+
+ // printable
+ aPropSet.setProperty( PROP_Printable, pClientData->mbPrintObject );
+
+ // control source links
+ if( (pClientData->maFmlaLink.getLength() > 0) || (pClientData->maFmlaRange.getLength() > 0) )
+ maControlConv.bindToSources( xCtrlModel, pClientData->maFmlaLink, pClientData->maFmlaRange, getSheetIndex() );
+ }
+ catch( Exception& )
+ {
+ }
+ }
+}
- // printable
- aPropSet.setProperty( PROP_Printable, rClientData.mbPrintObject );
+// private --------------------------------------------------------------------
- // control sources
- if( (rClientData.maLinkedCell.getLength() > 0) || (rClientData.maSourceRange.getLength() > 0) )
- maControlConv.bindToSources( rxCtrlModel, rClientData.maLinkedCell, rClientData.maSourceRange, getSheetIndex() );
+sal_uInt32 VmlDrawing::convertControlTextColor( const OUString& rTextColor ) const
+{
+ // color attribute not present or 'auto' - use passed default color
+ if( (rTextColor.getLength() == 0) || rTextColor.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "auto" ) ) )
+ return AX_SYSCOLOR_WINDOWTEXT;
+
+ if( rTextColor[ 0 ] == '#' )
+ {
+ // RGB colors in the format '#RRGGBB'
+ if( rTextColor.getLength() == 7 )
+ return OleHelper::encodeOleColor( rTextColor.copy( 1 ).toInt32( 16 ) );
+
+ // RGB colors in the format '#RGB'
+ if( rTextColor.getLength() == 4 )
+ {
+ sal_Int32 nR = rTextColor.copy( 1, 1 ).toInt32( 16 ) * 0x11;
+ sal_Int32 nG = rTextColor.copy( 2, 1 ).toInt32( 16 ) * 0x11;
+ sal_Int32 nB = rTextColor.copy( 3, 1 ).toInt32( 16 ) * 0x11;
+ return OleHelper::encodeOleColor( (nR << 16) | (nG << 8) | nB );
+ }
+
+ OSL_ENSURE( false, OStringBuffer( "VmlDrawing::convertControlTextColor - invalid color name '" ).
+ append( OUStringToOString( rTextColor, RTL_TEXTENCODING_ASCII_US ) ).append( '\'' ).getStr() );
+ return AX_SYSCOLOR_WINDOWTEXT;
}
+
+ const GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper();
+
+ /* Predefined color names or system color names (resolve to RGB to detect
+ valid color name). */
+ sal_Int32 nColorToken = AttributeConversion::decodeToken( rTextColor );
+ sal_Int32 nRgbValue = Color::getVmlPresetColor( nColorToken, API_RGB_TRANSPARENT );
+ if( nRgbValue == API_RGB_TRANSPARENT )
+ nRgbValue = rGraphicHelper.getSystemColor( nColorToken, API_RGB_TRANSPARENT );
+ if( nRgbValue != API_RGB_TRANSPARENT )
+ return OleHelper::encodeOleColor( nRgbValue );
+
+ // try palette color
+ return OleHelper::encodeOleColor( rGraphicHelper.getPaletteColor( rTextColor.toInt32() ) );
}
-void VmlDrawing::notifyShapeInserted( const Reference< XShape >& /*rxShape*/, const Rectangle& rShapeRect )
+void VmlDrawing::convertControlFontData( AxFontData& rAxFontData, sal_uInt32& rnOleTextColor, const ::oox::vml::TextFontModel& rFontModel ) const
{
- // collect all shape positions in the WorksheetHelper base class
- extendShapeBoundingBox( rShapeRect );
+ if( rFontModel.moName.has() )
+ rAxFontData.maFontName = rFontModel.moName.get();
+
+ // font height: convert from twips to points, then to internal representation of AX controls
+ rAxFontData.setHeightPoints( static_cast< sal_Int16 >( (rFontModel.monSize.get( 200 ) + 10) / 20 ) );
+
+ // font effects
+ rAxFontData.mnFontEffects = 0;
+ setFlag( rAxFontData.mnFontEffects, AX_FONTDATA_BOLD, rFontModel.mobBold.get( false ) );
+ setFlag( rAxFontData.mnFontEffects, AX_FONTDATA_ITALIC, rFontModel.mobItalic.get( false ) );
+ setFlag( rAxFontData.mnFontEffects, AX_FONTDATA_STRIKEOUT, rFontModel.mobStrikeout.get( false ) );
+ sal_Int32 nUnderline = rFontModel.monUnderline.get( XML_none );
+ setFlag( rAxFontData.mnFontEffects, AX_FONTDATA_UNDERLINE, nUnderline != XML_none );
+ rAxFontData.mbDblUnderline = nUnderline == XML_double;
+
+ // font color
+ rnOleTextColor = convertControlTextColor( rFontModel.moColor.get( OUString() ) );
+}
+
+void VmlDrawing::convertControlText( AxFontData& rAxFontData, sal_uInt32& rnOleTextColor,
+ OUString& rCaption, const ::oox::vml::TextBox* pTextBox, sal_Int32 nTextHAlign ) const
+{
+ if( pTextBox )
+ {
+ rCaption = pTextBox->getText();
+ if( const ::oox::vml::TextFontModel* pFontModel = pTextBox->getFirstFont() )
+ convertControlFontData( rAxFontData, rnOleTextColor, *pFontModel );
+ }
+
+ switch( nTextHAlign )
+ {
+ case XML_Left: rAxFontData.mnHorAlign = AX_FONTDATA_LEFT; break;
+ case XML_Center: rAxFontData.mnHorAlign = AX_FONTDATA_CENTER; break;
+ case XML_Right: rAxFontData.mnHorAlign = AX_FONTDATA_RIGHT; break;
+ default: rAxFontData.mnHorAlign = AX_FONTDATA_LEFT;
+ }
+}
+
+void VmlDrawing::convertControlBackground( AxMorphDataModelBase& rAxModel, const ::oox::vml::ShapeBase& rShape ) const
+{
+ const ::oox::vml::FillModel& rFillModel = rShape.getTypeModel().maFillModel;
+ bool bHasFill = rFillModel.moFilled.get( true );
+ setFlag( rAxModel.mnFlags, AX_FLAGS_OPAQUE, bHasFill );
+ if( bHasFill )
+ {
+ const GraphicHelper& rGraphicHelper = getBaseFilter().getGraphicHelper();
+ sal_Int32 nSysWindowColor = rGraphicHelper.getSystemColor( XML_window, API_RGB_WHITE );
+ ::oox::drawingml::Color aColor = ::oox::vml::ConversionHelper::decodeColor( rGraphicHelper, rFillModel.moColor, rFillModel.moOpacity, nSysWindowColor );
+ sal_Int32 nRgbValue = aColor.getColor( rGraphicHelper );
+ rAxModel.mnBackColor = OleHelper::encodeOleColor( nRgbValue );
+ }
}
// ============================================================================
-OoxVmlDrawingFragment::OoxVmlDrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+VmlDrawingFragment::VmlDrawingFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
::oox::vml::DrawingFragment( rHelper.getOoxFilter(), rFragmentPath, rHelper.getVmlDrawing() ),
WorksheetHelper( rHelper )
{
}
-void OoxVmlDrawingFragment::finalizeImport()
+void VmlDrawingFragment::finalizeImport()
{
::oox::vml::DrawingFragment::finalizeImport();
getVmlDrawing().convertAndInsert();
@@ -610,4 +1098,4 @@ void OoxVmlDrawingFragment::finalizeImport()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/excelchartconverter.cxx b/oox/source/xls/excelchartconverter.cxx
index 412239a30732..e12025742844 100644
--- a/oox/source/xls/excelchartconverter.cxx
+++ b/oox/source/xls/excelchartconverter.cxx
@@ -27,30 +27,30 @@
************************************************************************/
#include "oox/xls/excelchartconverter.hxx"
+
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include "oox/drawingml/chart/datasourcemodel.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/xls/formulaparser.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::chart2::XChartDocument;
-using ::com::sun::star::chart2::data::XDataProvider;
-using ::com::sun::star::chart2::data::XDataReceiver;
-using ::com::sun::star::chart2::data::XDataSequence;
-using ::oox::drawingml::chart::DataSequenceModel;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::chart2;
+using namespace ::com::sun::star::chart2::data;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::oox::drawingml::chart::DataSequenceModel;
+using ::rtl::OUString;
+
+// ============================================================================
+
ExcelChartConverter::ExcelChartConverter( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper )
{
@@ -124,4 +124,4 @@ Reference< XDataSequence > ExcelChartConverter::createDataSequence(
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/excelfilter.cxx b/oox/source/xls/excelfilter.cxx
index f598a64bf366..953d752fe842 100644
--- a/oox/source/xls/excelfilter.cxx
+++ b/oox/source/xls/excelfilter.cxx
@@ -27,37 +27,32 @@
************************************************************************/
#include "oox/xls/excelfilter.hxx"
-#include <com/sun/star/container/XNameContainer.hpp>
+
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include "oox/dump/biffdumper.hxx"
#include "oox/dump/xlsbdumper.hxx"
#include "oox/helper/binaryinputstream.hxx"
#include "oox/xls/biffdetector.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/excelchartconverter.hxx"
-#include "oox/ole/vbaproject.hxx"
+#include "oox/xls/excelvbaproject.hxx"
#include "oox/xls/stylesbuffer.hxx"
#include "oox/xls/themebuffer.hxx"
#include "oox/xls/workbookfragment.hxx"
-#include "oox/dump/biffdumper.hxx"
-#include "oox/dump/xlsbdumper.hxx"
namespace oox {
namespace xls {
// ============================================================================
-using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::xml::sax;
+using namespace ::com::sun::star::sheet;
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::xml::sax;
+using namespace ::oox::core;
-using ::oox::core::BinaryFilterBase;
-using ::oox::core::FragmentHandlerRef;
-using ::oox::core::Relation;
-using ::oox::core::Relations;
-using ::oox::core::XmlFilterBase;
-using ::oox::drawingml::table::TableStyleListPtr;
using ::rtl::OUString;
+using ::oox::drawingml::table::TableStyleListPtr;
// ============================================================================
@@ -91,26 +86,27 @@ void ExcelFilterBase::unregisterWorkbookData()
OUString SAL_CALL ExcelFilter_getImplementationName() throw()
{
- return CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelFilter" );
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelFilter" );
}
Sequence< OUString > SAL_CALL ExcelFilter_getSupportedServiceNames() throw()
{
- Sequence< OUString > aSeq( 1 );
- aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelFilter" );
+ Sequence< OUString > aSeq( 2 );
+ aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" );
+ aSeq[ 1 ] = CREATE_OUSTRING( "com.sun.star.document.ExportFilter" );
return aSeq;
}
Reference< XInterface > SAL_CALL ExcelFilter_createInstance(
- const Reference< XMultiServiceFactory >& rxGlobalFactory ) throw( Exception )
+ const Reference< XComponentContext >& rxContext ) throw( Exception )
{
- return static_cast< ::cppu::OWeakObject* >( new ExcelFilter( rxGlobalFactory ) );
+ return static_cast< ::cppu::OWeakObject* >( new ExcelFilter( rxContext ) );
}
// ----------------------------------------------------------------------------
-ExcelFilter::ExcelFilter( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
- XmlFilterBase( rxGlobalFactory )
+ExcelFilter::ExcelFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ XmlFilterBase( rxContext )
{
}
@@ -126,17 +122,12 @@ bool ExcelFilter::importDocument() throw()
this variable (nonpro only). */
OOX_DUMP_FILE( ::oox::dump::xlsb::Dumper );
- OUString aWorkbookPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "officeDocument" ) );
+ OUString aWorkbookPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "officeDocument" ) );
if( aWorkbookPath.getLength() == 0 )
return false;
WorkbookHelperRoot aHelper( *this );
- if( aHelper.isValid() && importFragment( new OoxWorkbookFragment( aHelper, aWorkbookPath ) ) )
- {
- importDocumentProperties();
- return true;
- }
- return false;
+ return aHelper.isValid() && importFragment( new WorkbookFragment( aHelper, aWorkbookPath ) );
}
bool ExcelFilter::exportDocument() throw()
@@ -169,6 +160,12 @@ GraphicHelper* ExcelFilter::implCreateGraphicHelper() const
return new ExcelGraphicHelper( getWorkbookData() );
}
+::oox::ole::VbaProject* ExcelFilter::implCreateVbaProject() const
+{
+ return new ExcelVbaProject( getComponentContext(), Reference< XSpreadsheetDocument >( getModel(), UNO_QUERY ) );
+}
+
+
sal_Bool SAL_CALL ExcelFilter::filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rDescriptor ) throw( ::com::sun::star::uno::RuntimeException )
{
if ( XmlFilterBase::filter( rDescriptor ) )
@@ -176,7 +173,7 @@ sal_Bool SAL_CALL ExcelFilter::filter( const ::com::sun::star::uno::Sequence< ::
if ( isExportFilter() )
{
- Reference< XExporter > xExporter( getGlobalFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelFilterExport" ) ), UNO_QUERY );
+ Reference< XExporter > xExporter( getServiceFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelFilterExport" ) ), UNO_QUERY );
if ( xExporter.is() )
{
@@ -204,26 +201,27 @@ OUString ExcelFilter::implGetImplementationName() const
OUString SAL_CALL ExcelBiffFilter_getImplementationName() throw()
{
- return CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelBiffFilter" );
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelBiffFilter" );
}
Sequence< OUString > SAL_CALL ExcelBiffFilter_getSupportedServiceNames() throw()
{
- Sequence< OUString > aSeq( 1 );
- aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelBiffFilter" );
+ Sequence< OUString > aSeq( 2 );
+ aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" );
+ aSeq[ 1 ] = CREATE_OUSTRING( "com.sun.star.document.ExportFilter" );
return aSeq;
}
Reference< XInterface > SAL_CALL ExcelBiffFilter_createInstance(
- const Reference< XMultiServiceFactory >& rxGlobalFactory ) throw( Exception )
+ const Reference< XComponentContext >& rxContext ) throw( Exception )
{
- return static_cast< ::cppu::OWeakObject* >( new ExcelBiffFilter( rxGlobalFactory ) );
+ return static_cast< ::cppu::OWeakObject* >( new ExcelBiffFilter( rxContext ) );
}
// ----------------------------------------------------------------------------
-ExcelBiffFilter::ExcelBiffFilter( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
- BinaryFilterBase( rxGlobalFactory )
+ExcelBiffFilter::ExcelBiffFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ BinaryFilterBase( rxContext )
{
}
@@ -269,6 +267,11 @@ GraphicHelper* ExcelBiffFilter::implCreateGraphicHelper() const
return new ExcelGraphicHelper( getWorkbookData() );
}
+::oox::ole::VbaProject* ExcelBiffFilter::implCreateVbaProject() const
+{
+ return new ExcelVbaProject( getComponentContext(), Reference< XSpreadsheetDocument >( getModel(), UNO_QUERY ) );
+}
+
OUString ExcelBiffFilter::implGetImplementationName() const
{
return ExcelBiffFilter_getImplementationName();
@@ -278,58 +281,61 @@ OUString ExcelBiffFilter::implGetImplementationName() const
OUString SAL_CALL ExcelVbaProjectFilter_getImplementationName() throw()
{
- return CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelVbaProjectFilter" );
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelVbaProjectFilter" );
}
Sequence< OUString > SAL_CALL ExcelVbaProjectFilter_getSupportedServiceNames() throw()
{
Sequence< OUString > aSeq( 1 );
- aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelVBAProjectFilter" );
+ aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" );
return aSeq;
}
Reference< XInterface > SAL_CALL ExcelVbaProjectFilter_createInstance(
- const Reference< XMultiServiceFactory >& rxGlobalFactory ) throw( Exception )
+ const Reference< XComponentContext >& rxContext ) throw( Exception )
{
- return static_cast< ::cppu::OWeakObject* >( new ExcelVbaProjectFilter( rxGlobalFactory ) );
+ return static_cast< ::cppu::OWeakObject* >( new ExcelVbaProjectFilter( rxContext ) );
}
// ----------------------------------------------------------------------------
-ExcelVbaProjectFilter::ExcelVbaProjectFilter( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
- ExcelBiffFilter( rxGlobalFactory )
+ExcelVbaProjectFilter::ExcelVbaProjectFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
+ ExcelBiffFilter( rxContext )
{
}
bool ExcelVbaProjectFilter::importDocument() throw()
{
- bool bRet = false;
-
// detect BIFF version and workbook stream name
OUString aWorkbookName;
BiffType eBiff = BiffDetector::detectStorageBiffVersion( aWorkbookName, getStorage() );
OSL_ENSURE( eBiff == BIFF8, "ExcelVbaProjectFilter::ExcelVbaProjectFilter - invalid file format" );
- if( eBiff == BIFF8 )
- {
- Reference< XNameContainer > xOleNameOverrideSink;
- getArgument( CREATE_OUSTRING( "OleNameOverrideInfo" ) ) >>= xOleNameOverrideSink;
- WorkbookHelperRoot aHelper( *this, eBiff );
- StorageRef xVbaPrjStrg = openSubStorage( CREATE_OUSTRING( "_VBA_PROJECT_CUR" ), false );
- if( xVbaPrjStrg.get() && xVbaPrjStrg->isStorage() )
- {
- ole::VbaProject aVbaProject( getGlobalFactory(), Reference< com::sun::star::frame::XModel >( aHelper.getDocument(), UNO_QUERY ), CREATE_OUSTRING( "Calc" ) );
- aVbaProject.setOleOverridesSink( xOleNameOverrideSink );
- aVbaProject.importVbaProject( *xVbaPrjStrg, getGraphicHelper() );
- bRet = true;
- }
- }
- return bRet;
+ if( eBiff != BIFF8 )
+ return false;
+
+ StorageRef xVbaPrjStrg = openSubStorage( CREATE_OUSTRING( "_VBA_PROJECT_CUR" ), false );
+ if( !xVbaPrjStrg || !xVbaPrjStrg->isStorage() )
+ return false;
+
+ WorkbookHelperRoot aHelper( *this, eBiff );
+ // set palette colors passed in service constructor
+ Any aPalette = getArgument( CREATE_OUSTRING( "ColorPalette" ) );
+ aHelper.getStyles().importPalette( aPalette );
+ // import the VBA project
+ getVbaProject().importVbaProject( *xVbaPrjStrg, getGraphicHelper() );
+ return true;
+}
+
+bool ExcelVbaProjectFilter::exportDocument() throw()
+{
+ return false;
}
OUString ExcelVbaProjectFilter::implGetImplementationName() const
{
return ExcelVbaProjectFilter_getImplementationName();
}
+
// ============================================================================
} // namespace xls
diff --git a/oox/source/xls/excelhandlers.cxx b/oox/source/xls/excelhandlers.cxx
index a341484992ea..624085f08209 100644
--- a/oox/source/xls/excelhandlers.cxx
+++ b/oox/source/xls/excelhandlers.cxx
@@ -27,20 +27,23 @@
************************************************************************/
#include "oox/xls/excelhandlers.hxx"
+
#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
-using ::rtl::OUString;
-using ::oox::core::FilterBase;
-using ::oox::core::FragmentHandler2;
-
namespace oox {
namespace xls {
// ============================================================================
+
+using ::oox::core::FilterBase;
+using ::oox::core::FragmentHandler2;
+using ::rtl::OUString;
+
+// ============================================================================
// ============================================================================
-OoxWorkbookFragmentBase::OoxWorkbookFragmentBase(
+WorkbookFragmentBase::WorkbookFragmentBase(
const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
FragmentHandler2( rHelper.getOoxFilter(), rFragmentPath ),
WorkbookHelper( rHelper )
@@ -49,14 +52,14 @@ OoxWorkbookFragmentBase::OoxWorkbookFragmentBase(
// ============================================================================
-OoxWorksheetFragmentBase::OoxWorksheetFragmentBase( const WorkbookHelper& rHelper,
- const OUString& rFragmentPath, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+WorksheetFragmentBase::WorksheetFragmentBase( const WorkbookHelper& rHelper,
+ const OUString& rFragmentPath, const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
FragmentHandler2( rHelper.getOoxFilter(), rFragmentPath ),
- WorksheetHelperRoot( rHelper, xProgressBar, eSheetType, nSheet )
+ WorksheetHelperRoot( rHelper, rxProgressBar, eSheetType, nSheet )
{
}
-OoxWorksheetFragmentBase::OoxWorksheetFragmentBase(
+WorksheetFragmentBase::WorksheetFragmentBase(
const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
FragmentHandler2( rHelper.getOoxFilter(), rFragmentPath ),
WorksheetHelperRoot( rHelper )
@@ -66,108 +69,52 @@ OoxWorksheetFragmentBase::OoxWorksheetFragmentBase(
// ============================================================================
// ============================================================================
-namespace {
-
-const sal_uInt16 BIFF_BOF_GLOBALS = 0x0005; /// BIFF5-BIFF8 workbook globals.
-const sal_uInt16 BIFF_BOF_MODULE = 0x0006; /// BIFF5-BIFF8 Visual Basic module.
-const sal_uInt16 BIFF_BOF_SHEET = 0x0010; /// BIFF2-BIFF8 worksheet/dialog sheet.
-const sal_uInt16 BIFF_BOF_CHART = 0x0020; /// BIFF2-BIFF8 chart sheet.
-const sal_uInt16 BIFF_BOF_MACRO = 0x0040; /// BIFF4-BIFF8 macro sheet.
-const sal_uInt16 BIFF_BOF_WORKSPACE = 0x0100; /// BIFF3-BIFF8 workspace.
-
-} // namespace
-
-// ============================================================================
-
-BiffHandlerBase::~BiffHandlerBase()
-{
-}
-
-bool BiffHandlerBase::skipRecordBlock( sal_uInt16 nEndRecId )
-{
- sal_uInt16 nStartRecId = mrStrm.getRecId();
- while( mrStrm.startNextRecord() && (mrStrm.getRecId() != nEndRecId) )
- if( mrStrm.getRecId() == nStartRecId )
- skipRecordBlock( nEndRecId );
- return !mrStrm.isEof() && (mrStrm.getRecId() == nEndRecId);
-}
-
-bool BiffHandlerBase::isBofRecord() const
-{
- return
- (mrStrm.getRecId() == BIFF2_ID_BOF) ||
- (mrStrm.getRecId() == BIFF3_ID_BOF) ||
- (mrStrm.getRecId() == BIFF4_ID_BOF) ||
- (mrStrm.getRecId() == BIFF5_ID_BOF);
-}
-
-// ============================================================================
-
-BiffContextHandler::BiffContextHandler( const BiffHandlerBase& rParent ) :
- BiffHandlerBase( rParent )
+BiffContextHandler::~BiffContextHandler()
{
}
-// ============================================================================
-
-namespace prv {
-
-BiffFragmentStreamOwner::BiffFragmentStreamOwner( const FilterBase& rFilter, const OUString& rStrmName )
-{
- // do not automatically close the root stream (indicated by empty stream name)
- mxXInStrm.reset( new BinaryXInputStream( rFilter.openInputStream( rStrmName ), rStrmName.getLength() > 0 ) );
- mxBiffStrm.reset( new BiffInputStream( *mxXInStrm ) );
-}
+// ----------------------------------------------------------------------------
-BiffFragmentStreamOwner::~BiffFragmentStreamOwner()
+BiffWorkbookContextBase::BiffWorkbookContextBase( const WorkbookHelper& rHelper ) :
+ WorkbookHelper( rHelper )
{
}
-} // namespace prv
-
// ----------------------------------------------------------------------------
-BiffFragmentHandler::BiffFragmentHandler( const FilterBase& rFilter, const OUString& rStrmName ) :
- prv::BiffFragmentStreamOwner( rFilter, rStrmName ),
- BiffHandlerBase( *mxBiffStrm )
+BiffWorksheetContextBase::BiffWorksheetContextBase( const WorkbookHelper& rHelper,
+ const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+ WorksheetHelperRoot( rHelper, rxProgressBar, eSheetType, nSheet )
{
}
-BiffFragmentHandler::BiffFragmentHandler( const BiffFragmentHandler& rHandler ) :
- prv::BiffFragmentStreamOwner( rHandler ),
- BiffHandlerBase( rHandler )
+BiffWorksheetContextBase::BiffWorksheetContextBase( const WorksheetHelper& rHelper ) :
+ WorksheetHelperRoot( rHelper )
{
}
-BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff )
-{
- return mrStrm.startNextRecord() ? implStartFragment( eBiff ) : BIFF_FRAGMENT_UNKNOWN;
-}
+// ============================================================================
-BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff, sal_Int64 nRecHandle )
-{
- return mrStrm.startRecordByHandle( nRecHandle ) ? implStartFragment( eBiff ) : BIFF_FRAGMENT_UNKNOWN;
-}
+namespace {
-bool BiffFragmentHandler::skipFragment()
-{
- while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
- if( isBofRecord() )
- skipFragment();
- return !mrStrm.isEof() && (mrStrm.getRecId() == BIFF_ID_EOF);
-}
+const sal_uInt16 BIFF_BOF_GLOBALS = 0x0005; /// BIFF5-BIFF8 workbook globals.
+const sal_uInt16 BIFF_BOF_MODULE = 0x0006; /// BIFF5-BIFF8 Visual Basic module.
+const sal_uInt16 BIFF_BOF_SHEET = 0x0010; /// BIFF2-BIFF8 worksheet/dialog sheet.
+const sal_uInt16 BIFF_BOF_CHART = 0x0020; /// BIFF2-BIFF8 chart sheet.
+const sal_uInt16 BIFF_BOF_MACRO = 0x0040; /// BIFF4-BIFF8 macro sheet.
+const sal_uInt16 BIFF_BOF_WORKSPACE = 0x0100; /// BIFF3-BIFF8 workspace.
-BiffFragmentType BiffFragmentHandler::implStartFragment( BiffType eBiff )
+BiffFragmentType lclStartFragment( BiffInputStream& rStrm, BiffType eBiff )
{
BiffFragmentType eFragment = BIFF_FRAGMENT_UNKNOWN;
/* #i23425# Don't rely on BOF record ID to read BOF contents, but on
the detected BIFF version. */
- if( isBofRecord() )
+ if( BiffHelper::isBofRecord( rStrm ) )
{
// BOF is always written unencrypted
- mrStrm.enableDecoder( false );
- mrStrm.skip( 2 );
- sal_uInt16 nType = mrStrm.readuInt16();
+ rStrm.enableDecoder( false );
+ rStrm.skip( 2 );
+ sal_uInt16 nType = rStrm.readuInt16();
// decide which fragment types are valid for current BIFF version
switch( eBiff )
@@ -220,30 +167,64 @@ BiffFragmentType BiffFragmentHandler::implStartFragment( BiffType eBiff )
return eFragment;
}
-// ============================================================================
+} // namespace
+
+// ----------------------------------------------------------------------------
+
+BiffFragmentHandler::BiffFragmentHandler( const FilterBase& rFilter, const OUString& rStrmName )
+{
+ // do not automatically close the root stream (indicated by empty stream name)
+ bool bRootStrm = rStrmName.getLength() == 0;
+ mxXInStrm.reset( new BinaryXInputStream( rFilter.openInputStream( rStrmName ), !bRootStrm ) );
+ mxBiffStrm.reset( new BiffInputStream( *mxXInStrm ) );
+}
+
+BiffFragmentHandler::~BiffFragmentHandler()
+{
+}
+
+BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff )
+{
+ return mxBiffStrm->startNextRecord() ? lclStartFragment( *mxBiffStrm, eBiff ) : BIFF_FRAGMENT_UNKNOWN;
+}
+
+BiffFragmentType BiffFragmentHandler::startFragment( BiffType eBiff, sal_Int64 nRecHandle )
+{
+ return mxBiffStrm->startRecordByHandle( nRecHandle ) ? lclStartFragment( *mxBiffStrm, eBiff ) : BIFF_FRAGMENT_UNKNOWN;
+}
+
+bool BiffFragmentHandler::skipFragment()
+{
+ while( mxBiffStrm->startNextRecord() && (mxBiffStrm->getRecId() != BIFF_ID_EOF) )
+ if( BiffHelper::isBofRecord( *mxBiffStrm ) )
+ skipFragment();
+ return !mxBiffStrm->isEof() && (mxBiffStrm->getRecId() == BIFF_ID_EOF);
+}
+
+// ----------------------------------------------------------------------------
BiffWorkbookFragmentBase::BiffWorkbookFragmentBase( const WorkbookHelper& rHelper, const OUString& rStrmName, bool bCloneDecoder ) :
BiffFragmentHandler( rHelper.getBaseFilter(), rStrmName ),
WorkbookHelper( rHelper )
{
if( bCloneDecoder )
- getCodecHelper().cloneDecoder( mrStrm );
+ getCodecHelper().cloneDecoder( getInputStream() );
}
-// ============================================================================
+// ----------------------------------------------------------------------------
BiffWorksheetFragmentBase::BiffWorksheetFragmentBase( const BiffWorkbookFragmentBase& rParent,
- ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+ const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
BiffFragmentHandler( rParent ),
- WorksheetHelperRoot( rParent, xProgressBar, eSheetType, nSheet )
+ WorksheetHelperRoot( rParent, rxProgressBar, eSheetType, nSheet )
{
}
-// ============================================================================
+// ----------------------------------------------------------------------------
-BiffSkipWorksheetFragment::BiffSkipWorksheetFragment(
- const BiffWorkbookFragmentBase& rParent, ISegmentProgressBarRef xProgressBar, sal_Int16 nSheet ) :
- BiffWorksheetFragmentBase( rParent, xProgressBar, SHEETTYPE_EMPTYSHEET, nSheet )
+BiffSkipWorksheetFragment::BiffSkipWorksheetFragment( const BiffWorkbookFragmentBase& rParent,
+ const ISegmentProgressBarRef& rxProgressBar, sal_Int16 nSheet ) :
+ BiffWorksheetFragmentBase( rParent, rxProgressBar, SHEETTYPE_EMPTYSHEET, nSheet )
{
}
@@ -258,4 +239,4 @@ bool BiffSkipWorksheetFragment::importFragment()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/excelvbaproject.cxx b/oox/source/xls/excelvbaproject.cxx
new file mode 100755
index 000000000000..7fc8115cc680
--- /dev/null
+++ b/oox/source/xls/excelvbaproject.cxx
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "oox/xls/excelvbaproject.hxx"
+
+#include <list>
+#include <set>
+#include <com/sun/star/container/XEnumeration.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/document/XEventsSupplier.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/script/ModuleType.hpp>
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
+#include <rtl/ustrbuf.hxx>
+#include "oox/helper/helper.hxx"
+#include "oox/helper/propertyset.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::script;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
+ExcelVbaProject::ExcelVbaProject( const Reference< XComponentContext >& rxContext, const Reference< XSpreadsheetDocument >& rxDocument ) :
+ ::oox::ole::VbaProject( rxContext, Reference< XModel >( rxDocument, UNO_QUERY ), CREATE_OUSTRING( "Calc" ) ),
+ mxDocument( rxDocument )
+{
+}
+
+// protected ------------------------------------------------------------------
+
+namespace {
+
+struct SheetCodeNameInfo
+{
+ PropertySet maSheetProps; /// Property set of the sheet without codename.
+ OUString maPrefix; /// Prefix for the codename to be generated.
+
+ inline explicit SheetCodeNameInfo( PropertySet& rSheetProps, const OUString& rPrefix ) :
+ maSheetProps( rSheetProps ), maPrefix( rPrefix ) {}
+};
+
+typedef ::std::set< OUString > CodeNameSet;
+typedef ::std::list< SheetCodeNameInfo > SheetCodeNameInfoList;
+
+} // namespace
+
+void ExcelVbaProject::prepareImport()
+{
+ /* Check if the sheets have imported codenames. Generate new unused
+ codenames if not. */
+ if( mxDocument.is() ) try
+ {
+ // collect existing codenames (do not use them when creating new codenames)
+ CodeNameSet aUsedCodeNames;
+
+ // collect sheets without codenames
+ SheetCodeNameInfoList aCodeNameInfos;
+
+ // iterate over all imported sheets
+ Reference< XEnumerationAccess > xSheetsEA( mxDocument->getSheets(), UNO_QUERY_THROW );
+ Reference< XEnumeration > xSheetsEnum( xSheetsEA->createEnumeration(), UNO_SET_THROW );
+ // own try/catch for every sheet
+ while( xSheetsEnum->hasMoreElements() ) try
+ {
+ PropertySet aSheetProp( xSheetsEnum->nextElement() );
+ OUString aCodeName;
+ aSheetProp.getProperty( aCodeName, PROP_CodeName );
+ if( aCodeName.getLength() > 0 )
+ {
+ aUsedCodeNames.insert( aCodeName );
+ }
+ else
+ {
+ // TODO: once we have chart sheets we need a switch/case on sheet type ('SheetNNN' vs. 'ChartNNN')
+ aCodeNameInfos.push_back( SheetCodeNameInfo( aSheetProp, CREATE_OUSTRING( "Sheet" ) ) );
+ }
+ }
+ catch( Exception& )
+ {
+ }
+
+ // create new codenames if sheets do not have one
+ for( SheetCodeNameInfoList::iterator aIt = aCodeNameInfos.begin(), aEnd = aCodeNameInfos.end(); aIt != aEnd; ++aIt )
+ {
+ // search for an unused codename
+ sal_Int32 nCounter = 1;
+ OUString aCodeName;
+ do
+ {
+ aCodeName = OUStringBuffer( aIt->maPrefix ).append( nCounter++ ).makeStringAndClear();
+ }
+ while( aUsedCodeNames.count( aCodeName ) > 0 );
+ aUsedCodeNames.insert( aCodeName );
+
+ // set codename at sheet
+ aIt->maSheetProps.setProperty( PROP_CodeName, aCodeName );
+
+ // tell base class to create a dummy module
+ addDummyModule( aCodeName, ModuleType::DOCUMENT );
+ }
+ }
+ catch( Exception& )
+ {
+ }
+}
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
diff --git a/oox/source/xls/externallinkbuffer.cxx b/oox/source/xls/externallinkbuffer.cxx
index f057f42ca73f..d5c6fc5dc50e 100644
--- a/oox/source/xls/externallinkbuffer.cxx
+++ b/oox/source/xls/externallinkbuffer.cxx
@@ -27,7 +27,7 @@
************************************************************************/
#include "oox/xls/externallinkbuffer.hxx"
-#include <rtl/strbuf.hxx>
+
#include <com/sun/star/sheet/ComplexReference.hpp>
#include <com/sun/star/sheet/DDELinkInfo.hpp>
#include <com/sun/star/sheet/ExternalLinkType.hpp>
@@ -39,53 +39,44 @@
#include <com/sun/star/sheet/XDDELinkResults.hpp>
#include <com/sun/star/sheet/XExternalDocLink.hpp>
#include <com/sun/star/sheet/XExternalDocLinks.hpp>
-#include "oox/helper/attributelist.hxx"
+#include <rtl/strbuf.hxx>
#include "oox/core/filterbase.hxx"
+#include "oox/helper/attributelist.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/excelhandlers.hxx"
#include "oox/xls/formulaparser.hxx"
#include "oox/xls/worksheetbuffer.hxx"
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::Relation;
+using ::oox::core::Relations;
using ::rtl::OString;
using ::rtl::OStringBuffer;
using ::rtl::OStringToOUString;
using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::ComplexReference;
-using ::com::sun::star::sheet::DDEItemInfo;
-using ::com::sun::star::sheet::DDELinkInfo;
-using ::com::sun::star::sheet::ExternalLinkInfo;
-using ::com::sun::star::sheet::ExternalReference;
-using ::com::sun::star::sheet::SingleReference;
-using ::com::sun::star::sheet::XDDELinks;
-using ::com::sun::star::sheet::XDDELinkResults;
-using ::com::sun::star::sheet::XExternalDocLinks;
-using ::com::sun::star::sheet::XExternalSheetCache;
-using ::oox::core::Relation;
-using ::oox::core::Relations;
-
-namespace oox {
-namespace xls {
// ============================================================================
namespace {
-const sal_uInt16 OOBIN_EXTERNALBOOK_BOOK = 0;
-const sal_uInt16 OOBIN_EXTERNALBOOK_DDE = 1;
-const sal_uInt16 OOBIN_EXTERNALBOOK_OLE = 2;
+const sal_uInt16 BIFF12_EXTERNALBOOK_BOOK = 0;
+const sal_uInt16 BIFF12_EXTERNALBOOK_DDE = 1;
+const sal_uInt16 BIFF12_EXTERNALBOOK_OLE = 2;
-const sal_uInt16 OOBIN_EXTNAME_AUTOMATIC = 0x0002;
-const sal_uInt16 OOBIN_EXTNAME_PREFERPIC = 0x0004;
-const sal_uInt16 OOBIN_EXTNAME_STDDOCNAME = 0x0008;
-const sal_uInt16 OOBIN_EXTNAME_OLEOBJECT = 0x0010;
-const sal_uInt16 OOBIN_EXTNAME_ICONIFIED = 0x0020;
+const sal_uInt16 BIFF12_EXTNAME_AUTOMATIC = 0x0002;
+const sal_uInt16 BIFF12_EXTNAME_PREFERPIC = 0x0004;
+const sal_uInt16 BIFF12_EXTNAME_STDDOCNAME = 0x0008;
+const sal_uInt16 BIFF12_EXTNAME_OLEOBJECT = 0x0010;
+const sal_uInt16 BIFF12_EXTNAME_ICONIFIED = 0x0020;
const sal_uInt16 BIFF_EXTNAME_BUILTIN = 0x0001;
const sal_uInt16 BIFF_EXTNAME_AUTOMATIC = 0x0002;
@@ -151,54 +142,54 @@ void ExternalName::importOleItem( const AttributeList& rAttribs )
maExtNameModel.mbIconified = rAttribs.getBool( XML_icon, false );
}
-void ExternalName::importExternalName( RecordInputStream& rStrm )
+void ExternalName::importExternalName( SequenceInputStream& rStrm )
{
rStrm >> maModel.maName;
OSL_ENSURE( maModel.maName.getLength() > 0, "ExternalName::importExternalName - empty name" );
}
-void ExternalName::importExternalNameFlags( RecordInputStream& rStrm )
+void ExternalName::importExternalNameFlags( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags;
sal_Int32 nSheetId;
rStrm >> nFlags >> nSheetId;
- // index into sheet list of EXTSHEETNAMES (one-based in OOBIN)
+ // index into sheet list of EXTSHEETNAMES (one-based in BIFF12)
maModel.mnSheet = nSheetId - 1;
- // no flag for built-in names, as in OOX...
- maExtNameModel.mbNotify = getFlag( nFlags, OOBIN_EXTNAME_AUTOMATIC );
- maExtNameModel.mbPreferPic = getFlag( nFlags, OOBIN_EXTNAME_PREFERPIC );
- maExtNameModel.mbStdDocName = getFlag( nFlags, OOBIN_EXTNAME_STDDOCNAME );
- maExtNameModel.mbOleObj = getFlag( nFlags, OOBIN_EXTNAME_OLEOBJECT );
- maExtNameModel.mbIconified = getFlag( nFlags, OOBIN_EXTNAME_ICONIFIED );
+ // no flag for built-in names, as in OOXML...
+ maExtNameModel.mbNotify = getFlag( nFlags, BIFF12_EXTNAME_AUTOMATIC );
+ maExtNameModel.mbPreferPic = getFlag( nFlags, BIFF12_EXTNAME_PREFERPIC );
+ maExtNameModel.mbStdDocName = getFlag( nFlags, BIFF12_EXTNAME_STDDOCNAME );
+ maExtNameModel.mbOleObj = getFlag( nFlags, BIFF12_EXTNAME_OLEOBJECT );
+ maExtNameModel.mbIconified = getFlag( nFlags, BIFF12_EXTNAME_ICONIFIED );
OSL_ENSURE( (mrParentLink.getLinkType() == LINKTYPE_OLE) == maExtNameModel.mbOleObj,
"ExternalName::importExternalNameFlags - wrong OLE flag in external name" );
}
-void ExternalName::importDdeItemValues( RecordInputStream& rStrm )
+void ExternalName::importDdeItemValues( SequenceInputStream& rStrm )
{
sal_Int32 nRows, nCols;
rStrm >> nRows >> nCols;
setResultSize( nCols, nRows );
}
-void ExternalName::importDdeItemBool( RecordInputStream& rStrm )
+void ExternalName::importDdeItemBool( SequenceInputStream& rStrm )
{
appendResultValue< double >( (rStrm.readuInt8() == 0) ? 0.0 : 1.0 );
}
-void ExternalName::importDdeItemDouble( RecordInputStream& rStrm )
+void ExternalName::importDdeItemDouble( SequenceInputStream& rStrm )
{
appendResultValue( rStrm.readDouble() );
}
-void ExternalName::importDdeItemError( RecordInputStream& rStrm )
+void ExternalName::importDdeItemError( SequenceInputStream& rStrm )
{
appendResultValue( BiffHelper::calcDoubleFromError( rStrm.readuInt8() ) );
}
-void ExternalName::importDdeItemString( RecordInputStream& rStrm )
+void ExternalName::importDdeItemString( SequenceInputStream& rStrm )
{
- appendResultValue( rStrm.readString() );
+ appendResultValue( BiffHelper::readString( rStrm ) );
}
void ExternalName::importExternalName( BiffInputStream& rStrm )
@@ -323,8 +314,8 @@ sal_Int32 ExternalName::getSheetCacheIndex() const
sal_Int32 nCacheIdx = -1;
switch( getFilterType() )
{
- case FILTER_OOX:
- // OOXML/OOBIN: zero-based index into sheet list, -1 means global name
+ case FILTER_OOXML:
+ // OOXML/BIFF12: zero-based index into sheet list, -1 means global name
if( maModel.mnSheet >= 0 )
nCacheIdx = mrParentLink.getSheetIndex( maModel.mnSheet );
break;
@@ -374,14 +365,15 @@ bool ExternalName::getDdeLinkData( OUString& orDdeServer, OUString& orDdeTopic,
// try to create a DDE link and to set the imported link results
if( !mbDdeLinkCreated ) try
{
- Reference< XDDELinks > xDdeLinks( getDdeLinks(), UNO_QUERY_THROW );
+ PropertySet aDocProps( getDocument() );
+ Reference< XDDELinks > xDdeLinks( aDocProps.getAnyProperty( PROP_DDELinks ), UNO_QUERY_THROW );
mxDdeLink = xDdeLinks->addDDELink( mrParentLink.getClassName(), mrParentLink.getTargetUrl(), maModel.maName, ::com::sun::star::sheet::DDELinkMode_DEFAULT );
+ mbDdeLinkCreated = true; // ignore if setting results fails
if( !maResults.empty() )
{
Reference< XDDELinkResults > xResults( mxDdeLink, UNO_QUERY_THROW );
xResults->setResults( ContainerHelper::matrixToSequenceSequence( maResults ) );
}
- mbDdeLinkCreated = true;
}
catch( Exception& )
{
@@ -552,44 +544,44 @@ ExternalNameRef ExternalLink::importOleItem( const AttributeList& rAttribs )
return xExtName;
}
-void ExternalLink::importExternalRef( RecordInputStream& rStrm )
+void ExternalLink::importExternalRef( SequenceInputStream& rStrm )
{
rStrm >> maRelId;
}
-void ExternalLink::importExternalSelf( RecordInputStream& )
+void ExternalLink::importExternalSelf( SequenceInputStream& )
{
meLinkType = LINKTYPE_SELF;
}
-void ExternalLink::importExternalSame( RecordInputStream& )
+void ExternalLink::importExternalSame( SequenceInputStream& )
{
meLinkType = LINKTYPE_SAME;
}
-void ExternalLink::importExternalAddin( RecordInputStream& )
+void ExternalLink::importExternalAddin( SequenceInputStream& )
{
meLinkType = LINKTYPE_UNKNOWN;
}
-void ExternalLink::importExternalBook( const Relations& rRelations, RecordInputStream& rStrm )
+void ExternalLink::importExternalBook( const Relations& rRelations, SequenceInputStream& rStrm )
{
switch( rStrm.readuInt16() )
{
- case OOBIN_EXTERNALBOOK_BOOK:
- parseExternalReference( rRelations, rStrm.readString() );
+ case BIFF12_EXTERNALBOOK_BOOK:
+ parseExternalReference( rRelations, BiffHelper::readString( rStrm ) );
break;
- case OOBIN_EXTERNALBOOK_DDE:
+ case BIFF12_EXTERNALBOOK_DDE:
{
OUString aDdeService, aDdeTopic;
rStrm >> aDdeService >> aDdeTopic;
setDdeOleTargetUrl( aDdeService, aDdeTopic, LINKTYPE_DDE );
}
break;
- case OOBIN_EXTERNALBOOK_OLE:
+ case BIFF12_EXTERNALBOOK_OLE:
{
- OUString aTargetUrl = rRelations.getExternalTargetFromRelId( rStrm.readString() );
- OUString aProgId = rStrm.readString();
+ OUString aTargetUrl = rRelations.getExternalTargetFromRelId( BiffHelper::readString( rStrm ) );
+ OUString aProgId = BiffHelper::readString( rStrm );
setDdeOleTargetUrl( aProgId, aTargetUrl, LINKTYPE_OLE );
}
break;
@@ -598,17 +590,17 @@ void ExternalLink::importExternalBook( const Relations& rRelations, RecordInputS
}
}
-void ExternalLink::importExtSheetNames( RecordInputStream& rStrm )
+void ExternalLink::importExtSheetNames( SequenceInputStream& rStrm )
{
// load external sheet names and create the sheet caches in the Calc document
OSL_ENSURE( (meLinkType == LINKTYPE_EXTERNAL) || (meLinkType == LINKTYPE_LIBRARY),
"ExternalLink::importExtSheetNames - invalid link type" );
if( meLinkType == LINKTYPE_EXTERNAL ) // ignore sheets of external libraries
for( sal_Int32 nSheet = 0, nCount = rStrm.readInt32(); !rStrm.isEof() && (nSheet < nCount); ++nSheet )
- insertExternalSheet( rStrm.readString() );
+ insertExternalSheet( BiffHelper::readString( rStrm ) );
}
-ExternalNameRef ExternalLink::importExternalName( RecordInputStream& rStrm )
+ExternalNameRef ExternalLink::importExternalName( SequenceInputStream& rStrm )
{
ExternalNameRef xExtName = createExternalName();
xExtName->importExternalName( rStrm );
@@ -725,9 +717,9 @@ FunctionLibraryType ExternalLink::getFuncLibraryType() const
sal_Int16 ExternalLink::getCalcSheetIndex( sal_Int32 nTabId ) const
{
OSL_ENSURE( meLinkType == LINKTYPE_INTERNAL, "ExternalLink::getCalcSheetIndex - invalid link type" );
- OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOX) || (getBiff() == BIFF8),
+ OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOXML) || (getBiff() == BIFF8),
"ExternalLink::getCalcSheetIndex - invalid sheet index" );
- return ContainerHelper::getVectorElement< sal_Int16 >( maCalcSheets, nTabId, -1 );
+ return ContainerHelper::getVectorElement( maCalcSheets, nTabId, -1 );
}
sal_Int32 ExternalLink::getDocumentLinkIndex() const
@@ -739,9 +731,9 @@ sal_Int32 ExternalLink::getDocumentLinkIndex() const
sal_Int32 ExternalLink::getSheetCacheIndex( sal_Int32 nTabId ) const
{
OSL_ENSURE( meLinkType == LINKTYPE_EXTERNAL, "ExternalLink::getSheetCacheIndex - invalid link type" );
- OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOX) || (getBiff() == BIFF8),
+ OSL_ENSURE( (nTabId == 0) || (getFilterType() == FILTER_OOXML) || (getBiff() == BIFF8),
"ExternalLink::getSheetCacheIndex - invalid sheet index" );
- return ContainerHelper::getVectorElement< sal_Int32 >( maSheetCaches, nTabId, -1 );
+ return ContainerHelper::getVectorElement( maSheetCaches, nTabId, -1 );
}
Reference< XExternalSheetCache > ExternalLink::getSheetCache( sal_Int32 nTabId ) const
@@ -777,8 +769,8 @@ void ExternalLink::getSheetRange( LinkSheetRange& orSheetRange, sal_Int32 nTabId
sal_Int32 nDocLinkIdx = getDocumentLinkIndex();
switch( getFilterType() )
{
- case FILTER_OOX:
- // OOBIN: passed indexes point into sheet list of EXTSHEETLIST
+ case FILTER_OOXML:
+ // BIFF12: passed indexes point into sheet list of EXTSHEETLIST
orSheetRange.setExternalRange( nDocLinkIdx, getSheetCacheIndex( nTabId1 ), getSheetCacheIndex( nTabId2 ) );
break;
case FILTER_BIFF:
@@ -820,8 +812,8 @@ ExternalNameRef ExternalLink::getNameByIndex( sal_Int32 nIndex ) const
// private --------------------------------------------------------------------
-#define OOX_TARGETTYPE_EXTLINK CREATE_OFFICEDOC_RELATIONSTYPE( "externalLinkPath" )
-#define OOX_TARGETTYPE_LIBRARY CREATE_MSOFFICE_RELATIONSTYPE( "xlExternalLinkPath/xlLibrary" )
+#define OOX_TARGETTYPE_EXTLINK CREATE_OFFICEDOC_RELATION_TYPE( "externalLinkPath" )
+#define OOX_TARGETTYPE_LIBRARY CREATE_MSOFFICE_RELATION_TYPE( "xlExternalLinkPath/xlLibrary" )
void ExternalLink::setExternalTargetUrl( const OUString& rTargetUrl, const OUString& rTargetType )
{
@@ -840,11 +832,14 @@ void ExternalLink::setExternalTargetUrl( const OUString& rTargetUrl, const OUStr
OSL_ENSURE( meLinkType != LINKTYPE_UNKNOWN, "ExternalLink::setExternalTargetUrl - empty target URL or unknown target type" );
// create the external document link API object that will contain the sheet caches
- if( meLinkType == LINKTYPE_EXTERNAL )
+ if( meLinkType == LINKTYPE_EXTERNAL ) try
+ {
+ PropertySet aDocProps( getDocument() );
+ Reference< XExternalDocLinks > xDocLinks( aDocProps.getAnyProperty( PROP_ExternalDocLinks ), UNO_QUERY_THROW );
+ mxDocLink = xDocLinks->addDocLink( maTargetUrl );
+ }
+ catch( Exception& )
{
- Reference< XExternalDocLinks > xDocLinks = getExternalDocLinks();
- if( xDocLinks.is() )
- mxDocLink = xDocLinks->addDocLink( maTargetUrl );
}
}
@@ -932,7 +927,7 @@ RefSheetsModel::RefSheetsModel() :
{
}
-void RefSheetsModel::readOobData( RecordInputStream& rStrm )
+void RefSheetsModel::readBiff12Data( SequenceInputStream& rStrm )
{
rStrm >> mnExtRefId >> mnTabId1 >> mnTabId2;
}
@@ -948,8 +943,10 @@ void RefSheetsModel::readBiff8Data( BiffInputStream& rStrm )
ExternalLinkBuffer::ExternalLinkBuffer( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper ),
+ mxSelfRef( new ExternalLink( rHelper ) ),
mbUseRefSheets( false )
{
+ mxSelfRef->setSelfLinkType();
}
ExternalLinkRef ExternalLinkBuffer::importExternalReference( const AttributeList& rAttribs )
@@ -960,7 +957,7 @@ ExternalLinkRef ExternalLinkBuffer::importExternalReference( const AttributeList
return xExtLink;
}
-ExternalLinkRef ExternalLinkBuffer::importExternalRef( RecordInputStream& rStrm )
+ExternalLinkRef ExternalLinkBuffer::importExternalRef( SequenceInputStream& rStrm )
{
mbUseRefSheets = true;
ExternalLinkRef xExtLink = createExternalLink();
@@ -969,25 +966,25 @@ ExternalLinkRef ExternalLinkBuffer::importExternalRef( RecordInputStream& rStrm
return xExtLink;
}
-void ExternalLinkBuffer::importExternalSelf( RecordInputStream& rStrm )
+void ExternalLinkBuffer::importExternalSelf( SequenceInputStream& rStrm )
{
mbUseRefSheets = true;
createExternalLink()->importExternalSelf( rStrm );
}
-void ExternalLinkBuffer::importExternalSame( RecordInputStream& rStrm )
+void ExternalLinkBuffer::importExternalSame( SequenceInputStream& rStrm )
{
mbUseRefSheets = true;
createExternalLink()->importExternalSame( rStrm );
}
-void ExternalLinkBuffer::importExternalAddin( RecordInputStream& rStrm )
+void ExternalLinkBuffer::importExternalAddin( SequenceInputStream& rStrm )
{
mbUseRefSheets = true;
createExternalLink()->importExternalAddin( rStrm );
}
-void ExternalLinkBuffer::importExternalSheets( RecordInputStream& rStrm )
+void ExternalLinkBuffer::importExternalSheets( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbUseRefSheets, "ExternalLinkBuffer::importExternalSheets - missing EXTERNALREFS records" );
mbUseRefSheets = true;
@@ -1000,7 +997,7 @@ void ExternalLinkBuffer::importExternalSheets( RecordInputStream& rStrm )
for( size_t nRefId = 0; !rStrm.isEof() && (nRefId < nMaxCount); ++nRefId )
{
RefSheetsModel aRefSheets;
- aRefSheets.readOobData( rStrm );
+ aRefSheets.readBiff12Data( rStrm );
maRefSheets.push_back( aRefSheets );
}
}
@@ -1040,30 +1037,32 @@ void ExternalLinkBuffer::importExternSheet8( BiffInputStream& rStrm )
insert the entries of the second record before the entries of the first
record. */
maRefSheets.insert( maRefSheets.begin(), nRefCount, RefSheetsModel() );
- for( RefSheetsModelVec::iterator aIt = maRefSheets.begin(); !rStrm.isEof() && (nRefCount > 0); --nRefCount )
+ for( RefSheetsModelVec::iterator aIt = maRefSheets.begin(), aEnd = aIt + nRefCount; !rStrm.isEof() && (aIt != aEnd); ++aIt )
aIt->readBiff8Data( rStrm );
}
Sequence< ExternalLinkInfo > ExternalLinkBuffer::getLinkInfos() const
{
::std::vector< ExternalLinkInfo > aLinkInfos;
- // dummy entry for index 0
- aLinkInfos.push_back( ExternalLinkInfo( ::com::sun::star::sheet::ExternalLinkType::UNKNOWN, Any() ) );
+ // should not be used for BIFF12 documents
+ OSL_ENSURE( (getFilterType() == FILTER_OOXML) && !mbUseRefSheets, "ExternalLinkBuffer::getLinkInfos - unexpected file format" );
+ // add entry for implicit index 0 (self reference to this document)
+ aLinkInfos.push_back( mxSelfRef->getLinkInfo() );
for( ExternalLinkVec::const_iterator aIt = maExtLinks.begin(), aEnd = maExtLinks.end(); aIt != aEnd; ++aIt )
aLinkInfos.push_back( (*aIt)->getLinkInfo() );
return ContainerHelper::vectorToSequence( aLinkInfos );
}
-ExternalLinkRef ExternalLinkBuffer::getExternalLink( sal_Int32 nRefId ) const
+ExternalLinkRef ExternalLinkBuffer::getExternalLink( sal_Int32 nRefId, bool bUseRefSheets ) const
{
ExternalLinkRef xExtLink;
switch( getFilterType() )
{
- case FILTER_OOX:
- // OOXML: one-based index
- if( !mbUseRefSheets )
- xExtLink = maLinks.get( nRefId - 1 );
- // OOBIN: zero-based index into ref-sheets list
+ case FILTER_OOXML:
+ // OOXML: 0 = this document, otherwise one-based index into link list
+ if( !bUseRefSheets || !mbUseRefSheets )
+ xExtLink = (nRefId == 0) ? mxSelfRef : maLinks.get( nRefId - 1 );
+ // BIFF12: zero-based index into ref-sheets list
else if( const RefSheetsModel* pRefSheets = getRefSheets( nRefId ) )
xExtLink = maLinks.get( pRefSheets->mnExtRefId );
break;
@@ -1114,7 +1113,7 @@ LinkSheetRange ExternalLinkBuffer::getSheetRange( sal_Int32 nRefId, sal_Int16 nT
LinkSheetRange ExternalLinkBuffer::getSheetRange( sal_Int32 nRefId ) const
{
- OSL_ENSURE( ((getFilterType() == FILTER_OOX) && mbUseRefSheets) || (getBiff() == BIFF8), "ExternalLinkBuffer::getSheetRange - wrong BIFF version" );
+ OSL_ENSURE( ((getFilterType() == FILTER_OOXML) && mbUseRefSheets) || (getBiff() == BIFF8), "ExternalLinkBuffer::getSheetRange - wrong BIFF version" );
LinkSheetRange aSheetRange;
if( const ExternalLink* pExtLink = getExternalLink( nRefId ).get() )
if( const RefSheetsModel* pRefSheets = getRefSheets( nRefId ) )
@@ -1142,4 +1141,4 @@ const RefSheetsModel* ExternalLinkBuffer::getRefSheets( sal_Int32 nRefId ) const
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/externallinkfragment.cxx b/oox/source/xls/externallinkfragment.cxx
index 3a451a2610b6..3e1134c08f5b 100644
--- a/oox/source/xls/externallinkfragment.cxx
+++ b/oox/source/xls/externallinkfragment.cxx
@@ -27,6 +27,7 @@
************************************************************************/
#include "oox/xls/externallinkfragment.hxx"
+
#include <com/sun/star/sheet/XExternalSheetCache.hpp>
#include "oox/helper/attributelist.hxx"
#include "oox/xls/biffinputstream.hxx"
@@ -34,32 +35,30 @@
#include "oox/xls/sheetdatacontext.hxx"
#include "oox/xls/unitconverter.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::XExternalSheetCache;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
-using ::oox::core::Relation;
-
namespace oox {
namespace xls {
// ============================================================================
-OoxExternalSheetDataContext::OoxExternalSheetDataContext(
- OoxWorkbookFragmentBase& rFragment, const Reference< XExternalSheetCache >& rxSheetCache ) :
- OoxWorkbookContextBase( rFragment ),
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+// ============================================================================
+
+ExternalSheetDataContext::ExternalSheetDataContext(
+ WorkbookFragmentBase& rFragment, const Reference< XExternalSheetCache >& rxSheetCache ) :
+ WorkbookContextBase( rFragment ),
mxSheetCache( rxSheetCache )
{
- OSL_ENSURE( mxSheetCache.is(), "OoxExternalSheetDataContext::OoxExternalSheetDataContext - missing sheet cache" );
+ OSL_ENSURE( mxSheetCache.is(), "ExternalSheetDataContext::ExternalSheetDataContext - missing sheet cache" );
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxExternalSheetDataContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ExternalSheetDataContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -70,50 +69,48 @@ ContextHandlerRef OoxExternalSheetDataContext::onCreateContext( sal_Int32 nEleme
if( nElement == XLS_TOKEN( cell ) ) { importCell( rAttribs ); return this; }
break;
case XLS_TOKEN( cell ):
- if( nElement == XLS_TOKEN( v ) ) return this; // collect characters in onEndElement()
+ if( nElement == XLS_TOKEN( v ) ) return this; // collect characters in onCharacters()
break;
}
return 0;
}
-void OoxExternalSheetDataContext::onEndElement( const OUString& rChars )
+void ExternalSheetDataContext::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
+ if( isCurrentElement( XLS_TOKEN( v ) ) )
{
- case XLS_TOKEN( v ):
- switch( mnCurrType )
- {
- case XML_b:
- case XML_n:
- setCellValue( Any( rChars.toDouble() ) );
- break;
- case XML_e:
- setCellValue( Any( BiffHelper::calcDoubleFromError( getUnitConverter().calcBiffErrorCode( rChars ) ) ) );
- break;
- case XML_str:
- setCellValue( Any( rChars ) );
- break;
- }
- mnCurrType = XML_TOKEN_INVALID;
- break;
+ switch( mnCurrType )
+ {
+ case XML_b:
+ case XML_n:
+ setCellValue( Any( rChars.toDouble() ) );
+ break;
+ case XML_e:
+ setCellValue( Any( BiffHelper::calcDoubleFromError( getUnitConverter().calcBiffErrorCode( rChars ) ) ) );
+ break;
+ case XML_str:
+ setCellValue( Any( rChars ) );
+ break;
+ }
+ mnCurrType = XML_TOKEN_INVALID;
}
}
-ContextHandlerRef OoxExternalSheetDataContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ExternalSheetDataContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_EXTSHEETDATA:
- if( nRecId == OOBIN_ID_EXTROW ) { maCurrPos.Row = rStrm.readInt32(); return this; }
+ case BIFF12_ID_EXTSHEETDATA:
+ if( nRecId == BIFF12_ID_EXTROW ) { maCurrPos.Row = rStrm.readInt32(); return this; }
break;
- case OOBIN_ID_EXTROW:
+ case BIFF12_ID_EXTROW:
switch( nRecId )
{
- case OOBIN_ID_EXTCELL_BLANK: importExtCellBlank( rStrm ); break;
- case OOBIN_ID_EXTCELL_BOOL: importExtCellBool( rStrm ); break;
- case OOBIN_ID_EXTCELL_DOUBLE: importExtCellDouble( rStrm ); break;
- case OOBIN_ID_EXTCELL_ERROR: importExtCellError( rStrm ); break;
- case OOBIN_ID_EXTCELL_STRING: importExtCellString( rStrm ); break;
+ case BIFF12_ID_EXTCELL_BLANK: importExtCellBlank( rStrm ); break;
+ case BIFF12_ID_EXTCELL_BOOL: importExtCellBool( rStrm ); break;
+ case BIFF12_ID_EXTCELL_DOUBLE: importExtCellDouble( rStrm ); break;
+ case BIFF12_ID_EXTCELL_ERROR: importExtCellError( rStrm ); break;
+ case BIFF12_ID_EXTCELL_STRING: importExtCellString( rStrm ); break;
}
break;
}
@@ -122,7 +119,7 @@ ContextHandlerRef OoxExternalSheetDataContext::onCreateRecordContext( sal_Int32
// private --------------------------------------------------------------------
-void OoxExternalSheetDataContext::importCell( const AttributeList& rAttribs )
+void ExternalSheetDataContext::importCell( const AttributeList& rAttribs )
{
if( getAddressConverter().convertToCellAddress( maCurrPos, rAttribs.getString( XML_r, OUString() ), 0, false ) )
mnCurrType = rAttribs.getToken( XML_t, XML_n );
@@ -130,38 +127,38 @@ void OoxExternalSheetDataContext::importCell( const AttributeList& rAttribs )
mnCurrType = XML_TOKEN_INVALID;
}
-void OoxExternalSheetDataContext::importExtCellBlank( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellBlank( SequenceInputStream& rStrm )
{
maCurrPos.Column = rStrm.readInt32();
setCellValue( Any( OUString() ) );
}
-void OoxExternalSheetDataContext::importExtCellBool( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellBool( SequenceInputStream& rStrm )
{
maCurrPos.Column = rStrm.readInt32();
double fValue = (rStrm.readuInt8() == 0) ? 0.0 : 1.0;
setCellValue( Any( fValue ) );
}
-void OoxExternalSheetDataContext::importExtCellDouble( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellDouble( SequenceInputStream& rStrm )
{
maCurrPos.Column = rStrm.readInt32();
setCellValue( Any( rStrm.readDouble() ) );
}
-void OoxExternalSheetDataContext::importExtCellError( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellError( SequenceInputStream& rStrm )
{
maCurrPos.Column = rStrm.readInt32();
setCellValue( Any( BiffHelper::calcDoubleFromError( rStrm.readuInt8() ) ) );
}
-void OoxExternalSheetDataContext::importExtCellString( RecordInputStream& rStrm )
+void ExternalSheetDataContext::importExtCellString( SequenceInputStream& rStrm )
{
maCurrPos.Column = rStrm.readInt32();
- setCellValue( Any( rStrm.readString() ) );
+ setCellValue( Any( BiffHelper::readString( rStrm ) ) );
}
-void OoxExternalSheetDataContext::setCellValue( const Any& rValue )
+void ExternalSheetDataContext::setCellValue( const Any& rValue )
{
if( mxSheetCache.is() && getAddressConverter().checkCellAddress( maCurrPos, false ) ) try
{
@@ -174,17 +171,15 @@ void OoxExternalSheetDataContext::setCellValue( const Any& rValue )
// ============================================================================
-OoxExternalLinkFragment::OoxExternalLinkFragment( const WorkbookHelper& rHelper,
+ExternalLinkFragment::ExternalLinkFragment( const WorkbookHelper& rHelper,
const OUString& rFragmentPath, ExternalLink& rExtLink ) :
- OoxWorkbookFragmentBase( rHelper, rFragmentPath ),
+ WorkbookFragmentBase( rHelper, rFragmentPath ),
mrExtLink( rExtLink ),
mnResultType( XML_TOKEN_INVALID )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxExternalLinkFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ExternalLinkFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -246,7 +241,7 @@ ContextHandlerRef OoxExternalLinkFragment::onCreateContext( sal_Int32 nElement,
}
break;
case XLS_TOKEN( value ):
- if( nElement == XLS_TOKEN( val ) ) return this; // collect value in onEndElement()
+ if( nElement == XLS_TOKEN( val ) ) return this; // collect value in onCharacters()
break;
case XLS_TOKEN( oleLink ):
@@ -259,209 +254,188 @@ ContextHandlerRef OoxExternalLinkFragment::onCreateContext( sal_Int32 nElement,
return 0;
}
-void OoxExternalLinkFragment::onEndElement( const OUString& rChars )
+void ExternalLinkFragment::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
+ if( isCurrentElement( XLS_TOKEN( val ) ) )
+ maResultValue = rChars;
+}
+
+void ExternalLinkFragment::onEndElement()
+{
+ if( isCurrentElement( XLS_TOKEN( value ) ) && mxExtName.get() ) switch( mnResultType )
{
- case XLS_TOKEN( val ):
- maResultValue = rChars;
+ case XML_b:
+ mxExtName->appendResultValue( maResultValue.toDouble() );
break;
- case XLS_TOKEN( value ):
- if( mxExtName.get() ) switch( mnResultType )
- {
- case XML_b:
- mxExtName->appendResultValue( maResultValue.toDouble() );
- break;
- case XML_e:
- mxExtName->appendResultValue( BiffHelper::calcDoubleFromError( getUnitConverter().calcBiffErrorCode( maResultValue ) ) );
- break;
- case XML_n:
- mxExtName->appendResultValue( maResultValue.toDouble() );
- break;
- case XML_str:
- mxExtName->appendResultValue( maResultValue );
- break;
- default:
- mxExtName->appendResultValue( BiffHelper::calcDoubleFromError( BIFF_ERR_NA ) );
- }
+ case XML_e:
+ mxExtName->appendResultValue( BiffHelper::calcDoubleFromError( getUnitConverter().calcBiffErrorCode( maResultValue ) ) );
+ break;
+ case XML_n:
+ mxExtName->appendResultValue( maResultValue.toDouble() );
+ break;
+ case XML_str:
+ mxExtName->appendResultValue( maResultValue );
break;
+ default:
+ mxExtName->appendResultValue( BiffHelper::calcDoubleFromError( BIFF_ERR_NA ) );
}
}
-ContextHandlerRef OoxExternalLinkFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ExternalLinkFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_EXTERNALBOOK )
+ if( nRecId == BIFF12_ID_EXTERNALBOOK )
{
mrExtLink.importExternalBook( getRelations(), rStrm );
return this;
}
break;
- case OOBIN_ID_EXTERNALBOOK:
+ case BIFF12_ID_EXTERNALBOOK:
switch( nRecId )
{
- case OOBIN_ID_EXTSHEETDATA:
+ case BIFF12_ID_EXTSHEETDATA:
if( mrExtLink.getLinkType() == LINKTYPE_EXTERNAL )
return createSheetDataContext( rStrm.readInt32() );
break;
- case OOBIN_ID_EXTSHEETNAMES: mrExtLink.importExtSheetNames( rStrm ); break;
- case OOBIN_ID_EXTERNALNAME: mxExtName = mrExtLink.importExternalName( rStrm ); return this;
+ case BIFF12_ID_EXTSHEETNAMES: mrExtLink.importExtSheetNames( rStrm ); break;
+ case BIFF12_ID_EXTERNALNAME: mxExtName = mrExtLink.importExternalName( rStrm ); return this;
}
break;
- case OOBIN_ID_EXTERNALNAME:
+ case BIFF12_ID_EXTERNALNAME:
switch( nRecId )
{
- case OOBIN_ID_EXTERNALNAMEFLAGS: if( mxExtName.get() ) mxExtName->importExternalNameFlags( rStrm ); break;
- case OOBIN_ID_DDEITEMVALUES: if( mxExtName.get() ) mxExtName->importDdeItemValues( rStrm ); return this;
+ case BIFF12_ID_EXTERNALNAMEFLAGS: if( mxExtName.get() ) mxExtName->importExternalNameFlags( rStrm ); break;
+ case BIFF12_ID_DDEITEMVALUES: if( mxExtName.get() ) mxExtName->importDdeItemValues( rStrm ); return this;
}
break;
- case OOBIN_ID_DDEITEMVALUES:
+ case BIFF12_ID_DDEITEMVALUES:
switch( nRecId )
{
- case OOBIN_ID_DDEITEM_BOOL: if( mxExtName.get() ) mxExtName->importDdeItemBool( rStrm ); break;
- case OOBIN_ID_DDEITEM_DOUBLE: if( mxExtName.get() ) mxExtName->importDdeItemDouble( rStrm ); break;
- case OOBIN_ID_DDEITEM_ERROR: if( mxExtName.get() ) mxExtName->importDdeItemError( rStrm ); break;
- case OOBIN_ID_DDEITEM_STRING: if( mxExtName.get() ) mxExtName->importDdeItemString( rStrm ); break;
+ case BIFF12_ID_DDEITEM_BOOL: if( mxExtName.get() ) mxExtName->importDdeItemBool( rStrm ); break;
+ case BIFF12_ID_DDEITEM_DOUBLE: if( mxExtName.get() ) mxExtName->importDdeItemDouble( rStrm ); break;
+ case BIFF12_ID_DDEITEM_ERROR: if( mxExtName.get() ) mxExtName->importDdeItemError( rStrm ); break;
+ case BIFF12_ID_DDEITEM_STRING: if( mxExtName.get() ) mxExtName->importDdeItemString( rStrm ); break;
}
break;
}
return 0;
}
-ContextHandlerRef OoxExternalLinkFragment::createSheetDataContext( sal_Int32 nSheetId )
+ContextHandlerRef ExternalLinkFragment::createSheetDataContext( sal_Int32 nSheetId )
{
- return new OoxExternalSheetDataContext( *this, mrExtLink.getSheetCache( nSheetId ) );
+ return new ExternalSheetDataContext( *this, mrExtLink.getSheetCache( nSheetId ) );
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxExternalLinkFragment::getRecordInfos() const
+const RecordInfo* ExternalLinkFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_DDEITEMVALUES, OOBIN_ID_DDEITEMVALUES + 1 },
- { OOBIN_ID_EXTERNALBOOK, OOBIN_ID_EXTERNALBOOK + 228 },
- { OOBIN_ID_EXTERNALNAME, OOBIN_ID_EXTERNALNAME + 10 },
- { OOBIN_ID_EXTROW, -1 },
- { OOBIN_ID_EXTSHEETDATA, OOBIN_ID_EXTSHEETDATA + 1 },
- { -1, -1 }
+ { BIFF12_ID_DDEITEMVALUES, BIFF12_ID_DDEITEMVALUES + 1 },
+ { BIFF12_ID_EXTERNALBOOK, BIFF12_ID_EXTERNALBOOK + 228 },
+ { BIFF12_ID_EXTERNALNAME, BIFF12_ID_EXTERNALNAME + 10 },
+ { BIFF12_ID_EXTROW, -1 },
+ { BIFF12_ID_EXTSHEETDATA, BIFF12_ID_EXTSHEETDATA + 1 },
+ { -1, -1 }
};
return spRecInfos;
}
// ============================================================================
+// ============================================================================
-BiffExternalLinkFragment::BiffExternalLinkFragment( const BiffWorkbookFragmentBase& rParent, bool bImportDefNames ) :
- BiffWorkbookFragmentBase( rParent ),
+BiffExternalSheetDataContext::BiffExternalSheetDataContext( const WorkbookHelper& rHelper, bool bImportDefNames ) :
+ BiffWorkbookContextBase( rHelper ),
mbImportDefNames( bImportDefNames )
{
}
-BiffExternalLinkFragment::~BiffExternalLinkFragment()
+BiffExternalSheetDataContext::~BiffExternalSheetDataContext()
{
}
-bool BiffExternalLinkFragment::importFragment()
+void BiffExternalSheetDataContext::importRecord( BiffInputStream& rStrm )
{
- // process all record in this sheet fragment
- while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
- {
- if( isBofRecord() )
- skipFragment(); // skip unknown embedded fragments
- else
- importRecord();
- }
- return !mrStrm.isEof() && (mrStrm.getRecId() == BIFF_ID_EOF);
-}
-
-void BiffExternalLinkFragment::importRecord()
-{
- sal_uInt16 nRecId = mrStrm.getRecId();
+ sal_uInt16 nRecId = rStrm.getRecId();
switch( getBiff() )
{
case BIFF2: switch( nRecId )
{
- case BIFF2_ID_EXTERNALNAME: importExternalName(); break;
- case BIFF_ID_EXTERNSHEET: importExternSheet(); break;
- case BIFF2_ID_DEFINEDNAME: importDefinedName(); break;
+ case BIFF2_ID_EXTERNALNAME: importExternalName( rStrm ); break;
+ case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break;
+ case BIFF2_ID_DEFINEDNAME: importDefinedName( rStrm ); break;
}
break;
case BIFF3: switch( nRecId )
{
- case BIFF_ID_CRN: importCrn(); break;
- case BIFF3_ID_EXTERNALNAME: importExternalName(); break;
- case BIFF_ID_EXTERNSHEET: importExternSheet(); break;
- case BIFF3_ID_DEFINEDNAME: importDefinedName(); break;
- case BIFF_ID_XCT: importXct(); break;
+ case BIFF_ID_CRN: importCrn( rStrm ); break;
+ case BIFF3_ID_EXTERNALNAME: importExternalName( rStrm ); break;
+ case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break;
+ case BIFF3_ID_DEFINEDNAME: importDefinedName( rStrm ); break;
+ case BIFF_ID_XCT: importXct( rStrm ); break;
}
break;
case BIFF4: switch( nRecId )
{
- case BIFF_ID_CRN: importCrn(); break;
- case BIFF3_ID_EXTERNALNAME: importExternalName(); break;
- case BIFF_ID_EXTERNSHEET: importExternSheet(); break;
- case BIFF3_ID_DEFINEDNAME: importDefinedName(); break;
- case BIFF_ID_XCT: importXct(); break;
+ case BIFF_ID_CRN: importCrn( rStrm ); break;
+ case BIFF3_ID_EXTERNALNAME: importExternalName( rStrm ); break;
+ case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break;
+ case BIFF3_ID_DEFINEDNAME: importDefinedName( rStrm ); break;
+ case BIFF_ID_XCT: importXct( rStrm ); break;
}
break;
case BIFF5: switch( nRecId )
{
- case BIFF_ID_CRN: importCrn(); break;
- case BIFF5_ID_EXTERNALNAME: importExternalName(); break;
- case BIFF_ID_EXTERNSHEET: importExternSheet(); break;
- case BIFF5_ID_DEFINEDNAME: importDefinedName(); break;
- case BIFF_ID_XCT: importXct(); break;
+ case BIFF_ID_CRN: importCrn( rStrm ); break;
+ case BIFF5_ID_EXTERNALNAME: importExternalName( rStrm ); break;
+ case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break;
+ case BIFF5_ID_DEFINEDNAME: importDefinedName( rStrm ); break;
+ case BIFF_ID_XCT: importXct( rStrm ); break;
}
break;
case BIFF8: switch( nRecId )
{
- case BIFF_ID_CRN: importCrn(); break;
- case BIFF_ID_EXTERNALBOOK: importExternalBook(); break;
- case BIFF5_ID_EXTERNALNAME: importExternalName(); break;
- case BIFF_ID_EXTERNSHEET: importExternSheet(); break;
- case BIFF5_ID_DEFINEDNAME: importDefinedName(); break;
- case BIFF_ID_XCT: importXct(); break;
+ case BIFF_ID_CRN: importCrn( rStrm ); break;
+ case BIFF_ID_EXTERNALBOOK: importExternalBook( rStrm ); break;
+ case BIFF5_ID_EXTERNALNAME: importExternalName( rStrm ); break;
+ case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break;
+ case BIFF5_ID_DEFINEDNAME: importDefinedName( rStrm ); break;
+ case BIFF_ID_XCT: importXct( rStrm ); break;
}
break;
case BIFF_UNKNOWN: break;
}
}
-void BiffExternalLinkFragment::finalizeImport()
-{
- getDefinedNames().finalizeImport();
-}
-
// private --------------------------------------------------------------------
-void BiffExternalLinkFragment::importExternSheet()
+void BiffExternalSheetDataContext::importExternSheet( BiffInputStream& rStrm )
{
mxSheetCache.clear();
if( getBiff() == BIFF8 )
- getExternalLinks().importExternSheet8( mrStrm );
+ getExternalLinks().importExternSheet8( rStrm );
else
- mxExtLink = getExternalLinks().importExternSheet( mrStrm );
+ mxExtLink = getExternalLinks().importExternSheet( rStrm );
}
-void BiffExternalLinkFragment::importExternalBook()
+void BiffExternalSheetDataContext::importExternalBook( BiffInputStream& rStrm )
{
mxSheetCache.clear();
- mxExtLink = getExternalLinks().importExternalBook( mrStrm );
+ mxExtLink = getExternalLinks().importExternalBook( rStrm );
}
-void BiffExternalLinkFragment::importExternalName()
+void BiffExternalSheetDataContext::importExternalName( BiffInputStream& rStrm )
{
if( mxExtLink.get() )
- mxExtLink->importExternalName( mrStrm );
+ mxExtLink->importExternalName( rStrm );
}
-void BiffExternalLinkFragment::importXct()
+void BiffExternalSheetDataContext::importXct( BiffInputStream& rStrm )
{
mxSheetCache.clear();
if( mxExtLink.get() && (mxExtLink->getLinkType() == LINKTYPE_EXTERNAL) )
@@ -476,64 +450,65 @@ void BiffExternalLinkFragment::importXct()
mxSheetCache = mxExtLink->getSheetCache( 0 );
break;
case BIFF8:
- mrStrm.skip( 2 );
- mxSheetCache = mxExtLink->getSheetCache( mrStrm.readInt16() );
+ rStrm.skip( 2 );
+ mxSheetCache = mxExtLink->getSheetCache( rStrm.readInt16() );
+ break;
+ case BIFF_UNKNOWN:
break;
- case BIFF_UNKNOWN: break;
}
}
}
-void BiffExternalLinkFragment::importCrn()
+void BiffExternalSheetDataContext::importCrn( BiffInputStream& rStrm )
{
if( !mxSheetCache.is() ) return;
sal_uInt8 nCol2, nCol1;
sal_uInt16 nRow;
- mrStrm >> nCol2 >> nCol1 >> nRow;
+ rStrm >> nCol2 >> nCol1 >> nRow;
bool bLoop = true;
- for( BinAddress aBinAddr( nCol1, nRow ); bLoop && !mrStrm.isEof() && (aBinAddr.mnCol <= nCol2); ++aBinAddr.mnCol )
+ for( BinAddress aBinAddr( nCol1, nRow ); bLoop && !rStrm.isEof() && (aBinAddr.mnCol <= nCol2); ++aBinAddr.mnCol )
{
- switch( mrStrm.readuInt8() )
+ switch( rStrm.readuInt8() )
{
case BIFF_DATATYPE_EMPTY:
- mrStrm.skip( 8 );
+ rStrm.skip( 8 );
setCellValue( aBinAddr, Any( OUString() ) );
break;
case BIFF_DATATYPE_DOUBLE:
- setCellValue( aBinAddr, Any( mrStrm.readDouble() ) );
+ setCellValue( aBinAddr, Any( rStrm.readDouble() ) );
break;
case BIFF_DATATYPE_STRING:
{
- OUString aText = (getBiff() == BIFF8) ? mrStrm.readUniString() : mrStrm.readByteStringUC( false, getTextEncoding() );
+ OUString aText = (getBiff() == BIFF8) ? rStrm.readUniString() : rStrm.readByteStringUC( false, getTextEncoding() );
setCellValue( aBinAddr, Any( aText ) );
}
break;
case BIFF_DATATYPE_BOOL:
{
- double fValue = (mrStrm.readuInt8() == 0) ? 0.0 : 1.0;
+ double fValue = (rStrm.readuInt8() == 0) ? 0.0 : 1.0;
setCellValue( aBinAddr, Any( fValue ) );
- mrStrm.skip( 7 );
+ rStrm.skip( 7 );
}
break;
case BIFF_DATATYPE_ERROR:
- setCellValue( aBinAddr, Any( BiffHelper::calcDoubleFromError( mrStrm.readuInt8() ) ) );
- mrStrm.skip( 7 );
+ setCellValue( aBinAddr, Any( BiffHelper::calcDoubleFromError( rStrm.readuInt8() ) ) );
+ rStrm.skip( 7 );
break;
default:
- OSL_ENSURE( false, "BiffExternalLinkFragment::importCrn - unknown data type" );
+ OSL_ENSURE( false, "BiffExternalSheetDataContext::importCrn - unknown data type" );
bLoop = false;
}
}
}
-void BiffExternalLinkFragment::importDefinedName()
+void BiffExternalSheetDataContext::importDefinedName( BiffInputStream& rStrm )
{
if( mbImportDefNames )
- getDefinedNames().importDefinedName( mrStrm );
+ getDefinedNames().importDefinedName( rStrm );
}
-void BiffExternalLinkFragment::setCellValue( const BinAddress& rBinAddr, const Any& rValue )
+void BiffExternalSheetDataContext::setCellValue( const BinAddress& rBinAddr, const Any& rValue )
{
CellAddress aCellPos;
if( mxSheetCache.is() && getAddressConverter().convertToCellAddress( aCellPos, rBinAddr, 0, false ) ) try
@@ -547,7 +522,30 @@ void BiffExternalLinkFragment::setCellValue( const BinAddress& rBinAddr, const A
// ============================================================================
+BiffExternalLinkFragment::BiffExternalLinkFragment( const BiffWorkbookFragmentBase& rParent ) :
+ BiffWorkbookFragmentBase( rParent )
+{
+}
+
+bool BiffExternalLinkFragment::importFragment()
+{
+ // process all record in this sheet fragment
+ BiffExternalSheetDataContext aSheetContext( *this, false );
+ BiffInputStream& rStrm = getInputStream();
+ while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
+ {
+ if( BiffHelper::isBofRecord( rStrm ) )
+ skipFragment(); // skip unknown embedded fragments
+ else
+ aSheetContext.importRecord( rStrm );
+ }
+ return !rStrm.isEof() && (rStrm.getRecId() == BIFF_ID_EOF);
+}
+
+// ============================================================================
+// ============================================================================
+
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/formulabase.cxx b/oox/source/xls/formulabase.cxx
index fbde6fd1721c..58200d072603 100644..100755
--- a/oox/source/xls/formulabase.cxx
+++ b/oox/source/xls/formulabase.cxx
@@ -27,9 +27,8 @@
************************************************************************/
#include "oox/xls/formulabase.hxx"
+
#include <map>
-#include <rtl/strbuf.hxx>
-#include <rtl/ustrbuf.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/sheet/AddressConvention.hpp>
@@ -42,37 +41,28 @@
#include <com/sun/star/sheet/XFormulaOpCodeMapper.hpp>
#include <com/sun/star/sheet/XFormulaParser.hpp>
#include <com/sun/star/sheet/XFormulaTokens.hpp>
-#include "properties.hxx"
-#include "oox/helper/recordinputstream.hxx"
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
#include "oox/core/filterbase.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/xls/biffinputstream.hxx"
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
using ::rtl::OString;
using ::rtl::OStringBuffer;
+using ::rtl::OStringToOUString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::rtl::OStringToOUString;
using ::rtl::OUStringToOString;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::sheet::SingleReference;
-using ::com::sun::star::sheet::ComplexReference;
-using ::com::sun::star::sheet::FormulaToken;
-using ::com::sun::star::sheet::FormulaOpCodeMapEntry;
-using ::com::sun::star::sheet::XSpreadsheetDocument;
-using ::com::sun::star::sheet::XFormulaOpCodeMapper;
-using ::com::sun::star::sheet::XFormulaTokens;
-
-namespace oox {
-namespace xls {
// reference helpers ==========================================================
@@ -84,16 +74,16 @@ BinSingleRef2d::BinSingleRef2d() :
{
}
-void BinSingleRef2d::setOobData( sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset )
+void BinSingleRef2d::setBiff12Data( sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset )
{
- mnCol = nCol & OOBIN_TOK_REF_COLMASK;
- mnRow = nRow & OOBIN_TOK_REF_ROWMASK;
- mbColRel = getFlag( nCol, OOBIN_TOK_REF_COLREL );
- mbRowRel = getFlag( nCol, OOBIN_TOK_REF_ROWREL );
- if( bRelativeAsOffset && mbColRel && (mnCol > (OOBIN_TOK_REF_COLMASK >> 1)) )
- mnCol -= (OOBIN_TOK_REF_COLMASK + 1);
- if( bRelativeAsOffset && mbRowRel && (mnRow > (OOBIN_TOK_REF_ROWMASK >> 1)) )
- mnRow -= (OOBIN_TOK_REF_ROWMASK + 1);
+ mnCol = nCol & BIFF12_TOK_REF_COLMASK;
+ mnRow = nRow & BIFF12_TOK_REF_ROWMASK;
+ mbColRel = getFlag( nCol, BIFF12_TOK_REF_COLREL );
+ mbRowRel = getFlag( nCol, BIFF12_TOK_REF_ROWREL );
+ if( bRelativeAsOffset && mbColRel && (mnCol > (BIFF12_TOK_REF_COLMASK >> 1)) )
+ mnCol -= (BIFF12_TOK_REF_COLMASK + 1);
+ if( bRelativeAsOffset && mbRowRel && (mnRow > (BIFF12_TOK_REF_ROWMASK >> 1)) )
+ mnRow -= (BIFF12_TOK_REF_ROWMASK + 1);
}
void BinSingleRef2d::setBiff2Data( sal_uInt8 nCol, sal_uInt16 nRow, bool bRelativeAsOffset )
@@ -120,12 +110,12 @@ void BinSingleRef2d::setBiff8Data( sal_uInt16 nCol, sal_uInt16 nRow, bool bRelat
mnRow -= 0x10000;
}
-void BinSingleRef2d::readOobData( RecordInputStream& rStrm, bool bRelativeAsOffset )
+void BinSingleRef2d::readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset )
{
sal_Int32 nRow;
sal_uInt16 nCol;
rStrm >> nRow >> nCol;
- setOobData( nCol, nRow, bRelativeAsOffset );
+ setBiff12Data( nCol, nRow, bRelativeAsOffset );
}
void BinSingleRef2d::readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset )
@@ -145,13 +135,13 @@ void BinSingleRef2d::readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffs
// ----------------------------------------------------------------------------
-void BinComplexRef2d::readOobData( RecordInputStream& rStrm, bool bRelativeAsOffset )
+void BinComplexRef2d::readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset )
{
sal_Int32 nRow1, nRow2;
sal_uInt16 nCol1, nCol2;
rStrm >> nRow1 >> nRow2 >> nCol1 >> nCol2;
- maRef1.setOobData( nCol1, nRow1, bRelativeAsOffset );
- maRef2.setOobData( nCol2, nRow2, bRelativeAsOffset );
+ maRef1.setBiff12Data( nCol1, nRow1, bRelativeAsOffset );
+ maRef2.setBiff12Data( nCol2, nRow2, bRelativeAsOffset );
}
void BinComplexRef2d::readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset )
@@ -247,8 +237,8 @@ struct FunctionData
{
const sal_Char* mpcOdfFuncName; /// ODF function name.
const sal_Char* mpcOoxFuncName; /// OOXML function name.
- sal_uInt16 mnOobFuncId; /// OOBIN function identifier.
- sal_uInt16 mnBiffFuncId; /// BIFF function identifier.
+ sal_uInt16 mnBiff12FuncId; /// BIFF12 function identifier.
+ sal_uInt16 mnBiffFuncId; /// BIFF2-BIFF8 function identifier.
sal_uInt8 mnMinParamCount; /// Minimum number of parameters.
sal_uInt8 mnMaxParamCount; /// Maximum number of parameters.
sal_uInt8 mnRetClass; /// BIFF token class of the return value.
@@ -265,7 +255,7 @@ inline bool FunctionData::isSupported( bool bImportFilter ) const
return !getFlag( mnFlags, bImportFilter ? FUNCFLAG_EXPORTONLY : FUNCFLAG_IMPORTONLY );
}
-const sal_uInt16 NOID = SAL_MAX_UINT16; /// No BIFF/OOBIN function identifier available.
+const sal_uInt16 NOID = SAL_MAX_UINT16; /// No BIFF function identifier available.
const sal_uInt8 MX = SAL_MAX_UINT8; /// Maximum parameter count.
// abbreviations for function return token class
@@ -679,8 +669,8 @@ static const FunctionData saFuncTableBiff5[] =
{ "COUNTBLANK", "COUNTBLANK", 347, 347, 1, 1, V, { RO }, 0 },
{ "ISPMT", "ISPMT", 350, 350, 4, 4, V, { VR }, 0 },
{ 0, "DATEDIF", 351, 351, 3, 3, V, { VR }, FUNCFLAG_IMPORTONLY }, // not supported in Calc
- { 0, "DATESTRING", 352, 352, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY }, // not supported in Calc, missing in OOX spec
- { 0, "NUMBERSTRING", 353, 353, 2, 2, V, { VR }, FUNCFLAG_IMPORTONLY }, // not supported in Calc, missing in OOX spec
+ { 0, "DATESTRING", 352, 352, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY }, // not supported in Calc, missing in OOXML spec
+ { 0, "NUMBERSTRING", 353, 353, 2, 2, V, { VR }, FUNCFLAG_IMPORTONLY }, // not supported in Calc, missing in OOXML spec
{ "ROMAN", "ROMAN", 354, 354, 1, 2, V, { VR }, 0 },
// *** EuroTool add-in ***
@@ -723,7 +713,7 @@ static const FunctionData saFuncTableBiff8[] =
{ 0, "RTD", 379, 379, 3, 3, A, { VR, VR, RO }, 0 }
};
-/** Functions new in OOX. */
+/** Functions new in OOXML. */
static const FunctionData saFuncTableOox[] =
{
{ 0, "CUBEVALUE", 380, NOID, 1, MX, V, { VR, RX }, 0 },
@@ -770,7 +760,7 @@ static const FunctionData saFuncTableOdf[] =
{ "PERMUTATIONA", 0, NOID, NOID, 2, 2, V, { VR }, FUNCFLAG_MACROCALLODF },
{ "PHI", 0, NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALLODF },
{ "RRI", 0, NOID, NOID, 3, 3, V, { VR }, FUNCFLAG_MACROCALLODF },
- { "SHEET", 0, NOID, NOID, 1, 1, V, { RO }, FUNCFLAG_MACROCALLODF },
+ { "SHEET", 0, NOID, NOID, 0, 1, V, { RO }, FUNCFLAG_MACROCALLODF },
{ "SHEETS", 0, NOID, NOID, 0, 1, V, { RO }, FUNCFLAG_MACROCALLODF },
{ "SKEWP", 0, NOID, NOID, 1, MX, V, { RX }, FUNCFLAG_MACROCALLODF },
{ "UNICHAR", 0, NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALLODF },
@@ -846,8 +836,8 @@ struct FunctionProviderImpl
FunctionInfoVector maFuncs; /// All function infos in one list.
FuncNameMap maOdfFuncs; /// Maps ODF function names to function data.
FuncNameMap maOoxFuncs; /// Maps OOXML function names to function data.
- FuncIdMap maOobFuncs; /// Maps OOBIN function indexes to function data.
- FuncIdMap maBiffFuncs; /// Maps BIFF function indexes to function data.
+ FuncIdMap maBiff12Funcs; /// Maps BIFF12 function indexes to function data.
+ FuncIdMap maBiffFuncs; /// Maps BIFF2-BIFF8 function indexes to function data.
FuncNameMap maMacroFuncs; /// Maps macro function names to function data.
explicit FunctionProviderImpl( FilterType eFilter, BiffType eBiff, bool bImportFilter );
@@ -870,9 +860,9 @@ FunctionProviderImpl::FunctionProviderImpl( FilterType eFilter, BiffType eBiff,
sal_uInt8 nMaxParam = 0;
switch( eFilter )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
nMaxParam = OOX_MAX_PARAMCOUNT;
- eBiff = BIFF8; // insert all BIFF function tables, then the OOX table
+ eBiff = BIFF8; // insert all BIFF function tables, then the OOXML table
break;
case FILTER_BIFF:
nMaxParam = BIFF_MAX_PARAMCOUNT;
@@ -896,7 +886,7 @@ FunctionProviderImpl::FunctionProviderImpl( FilterType eFilter, BiffType eBiff,
initFuncs( saFuncTableBiff5, STATIC_ARRAY_END( saFuncTableBiff5 ), nMaxParam, bImportFilter );
if( eBiff >= BIFF8 )
initFuncs( saFuncTableBiff8, STATIC_ARRAY_END( saFuncTableBiff8 ), nMaxParam, bImportFilter );
- if( eFilter == FILTER_OOX )
+ if( eFilter == FILTER_OOXML )
initFuncs( saFuncTableOox, STATIC_ARRAY_END( saFuncTableOox ), nMaxParam, bImportFilter );
initFuncs( saFuncTableOdf, STATIC_ARRAY_END( saFuncTableOdf ), nMaxParam, bImportFilter );
}
@@ -929,7 +919,7 @@ void FunctionProviderImpl::initFunc( const FunctionData& rFuncData, sal_uInt8 nM
}
xFuncInfo->mnApiOpCode = -1;
- xFuncInfo->mnOobFuncId = rFuncData.mnOobFuncId;
+ xFuncInfo->mnBiff12FuncId = rFuncData.mnBiff12FuncId;
xFuncInfo->mnBiffFuncId = rFuncData.mnBiffFuncId;
xFuncInfo->mnMinParamCount = rFuncData.mnMinParamCount;
xFuncInfo->mnMaxParamCount = (rFuncData.mnMaxParamCount == MX) ? nMaxParam : rFuncData.mnMaxParamCount;
@@ -942,7 +932,7 @@ void FunctionProviderImpl::initFunc( const FunctionData& rFuncData, sal_uInt8 nM
xFuncInfo->mbMacroFunc = bMacroCmd || getFlag( rFuncData.mnFlags, FUNCFLAG_MACROFUNC );
xFuncInfo->mbVarParam = bMacroCmd || (rFuncData.mnMinParamCount != rFuncData.mnMaxParamCount) || getFlag( rFuncData.mnFlags, FUNCFLAG_ALWAYSVAR );
- setFlag( xFuncInfo->mnOobFuncId, BIFF_TOK_FUNCVAR_CMD, bMacroCmd );
+ setFlag( xFuncInfo->mnBiff12FuncId, BIFF_TOK_FUNCVAR_CMD, bMacroCmd );
setFlag( xFuncInfo->mnBiffFuncId, BIFF_TOK_FUNCVAR_CMD, bMacroCmd );
// insert the function info into the member maps
@@ -951,8 +941,8 @@ void FunctionProviderImpl::initFunc( const FunctionData& rFuncData, sal_uInt8 nM
maOdfFuncs[ xFuncInfo->maOdfFuncName ] = xFuncInfo;
if( xFuncInfo->maOoxFuncName.getLength() > 0 )
maOoxFuncs[ xFuncInfo->maOoxFuncName ] = xFuncInfo;
- if( xFuncInfo->mnOobFuncId != NOID )
- maOobFuncs[ xFuncInfo->mnOobFuncId ] = xFuncInfo;
+ if( xFuncInfo->mnBiff12FuncId != NOID )
+ maBiff12Funcs[ xFuncInfo->mnBiff12FuncId ] = xFuncInfo;
if( xFuncInfo->mnBiffFuncId != NOID )
maBiffFuncs[ xFuncInfo->mnBiffFuncId ] = xFuncInfo;
if( xFuncInfo->maBiffMacroName.getLength() > 0 )
@@ -987,9 +977,9 @@ const FunctionInfo* FunctionProvider::getFuncInfoFromOoxFuncName( const OUString
return mxFuncImpl->maOoxFuncs.get( rFuncName ).get();
}
-const FunctionInfo* FunctionProvider::getFuncInfoFromOobFuncId( sal_uInt16 nFuncId ) const
+const FunctionInfo* FunctionProvider::getFuncInfoFromBiff12FuncId( sal_uInt16 nFuncId ) const
{
- return mxFuncImpl->maOobFuncs.get( nFuncId ).get();
+ return mxFuncImpl->maBiff12Funcs.get( nFuncId ).get();
}
const FunctionInfo* FunctionProvider::getFuncInfoFromBiffFuncId( sal_uInt16 nFuncId ) const
@@ -1253,7 +1243,7 @@ bool OpCodeProviderImpl::initFuncOpCode( FunctionInfo& orFuncInfo, const ApiToke
append( '"' ).getStr() );
}
- // add to parser map, if OOX function name exists
+ // add to parser map, if OOXML function name exists
if( bIsValid && (orFuncInfo.maOoxFuncName.getLength() > 0) )
{
// create the parser map entry
@@ -1749,4 +1739,4 @@ void FormulaProcessorBase::convertStringToStringList(
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/formulaparser.cxx b/oox/source/xls/formulaparser.cxx
index 34d87336f776..9f6492529e17 100644
--- a/oox/source/xls/formulaparser.cxx
+++ b/oox/source/xls/formulaparser.cxx
@@ -27,14 +27,13 @@
************************************************************************/
#include "oox/xls/formulaparser.hxx"
+
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/sheet/ComplexReference.hpp>
#include <com/sun/star/sheet/ExternalReference.hpp>
#include <com/sun/star/sheet/FormulaToken.hpp>
#include <com/sun/star/sheet/ReferenceFlags.hpp>
#include <com/sun/star/sheet/SingleReference.hpp>
-#include "properties.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/core/filterbase.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
@@ -43,26 +42,20 @@
#include "oox/xls/tablebuffer.hxx"
#include "oox/xls/worksheethelper.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::sheet::ComplexReference;
-using ::com::sun::star::sheet::ExternalReference;
-using ::com::sun::star::sheet::SingleReference;
-using ::com::sun::star::sheet::XFormulaParser;
-using namespace ::com::sun::star::sheet::ReferenceFlags;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::sheet::ReferenceFlags;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
sal_uInt16 lclReadFmlaSize( BiffInputStream& rStrm, BiffType eBiff, const sal_uInt16* pnFmlaSize )
@@ -250,7 +243,7 @@ const ApiToken* FormulaFinalizer::processParameters(
if( !aParamInfoIt.isExcelOnlyParam() )
{
// replace empty second and third parameter in IF function with zeros
- if( (pRealFuncInfo->mnOobFuncId == OOBIN_FUNC_IF) && ((nParam == 1) || (nParam == 2)) && bIsEmpty )
+ if( (pRealFuncInfo->mnBiff12FuncId == BIFF_FUNC_IF) && ((nParam == 1) || (nParam == 2)) && bIsEmpty )
{
maTokens.append< double >( OPCODE_PUSH, 0.0 );
bIsEmpty = false;
@@ -369,10 +362,10 @@ const ApiToken* FormulaFinalizer::findParameters( ParameterPosVector& rParams,
void FormulaFinalizer::appendCalcOnlyParameter( const FunctionInfo& rFuncInfo, size_t nParam )
{
(void)nParam; // prevent 'unused' warning
- switch( rFuncInfo.mnOobFuncId )
+ switch( rFuncInfo.mnBiff12FuncId )
{
- case OOBIN_FUNC_FLOOR:
- case OOBIN_FUNC_CEILING:
+ case BIFF_FUNC_FLOOR:
+ case BIFF_FUNC_CEILING:
OSL_ENSURE( nParam == 2, "FormulaFinalizer::appendCalcOnlyParameter - unexpected parameter index" );
maTokens.append< double >( OPCODE_PUSH, 1.0 );
maTokens.append( OPCODE_SEP );
@@ -382,9 +375,9 @@ void FormulaFinalizer::appendCalcOnlyParameter( const FunctionInfo& rFuncInfo, s
void FormulaFinalizer::appendRequiredParameters( const FunctionInfo& rFuncInfo, size_t nParamCount )
{
- switch( rFuncInfo.mnOobFuncId )
+ switch( rFuncInfo.mnBiff12FuncId )
{
- case OOBIN_FUNC_WEEKNUM:
+ case BIFF_FUNC_WEEKNUM:
if( nParamCount == 1 )
{
maTokens.append< double >( OPCODE_PUSH, 1.0 );
@@ -423,12 +416,12 @@ public:
FormulaContext& rContext,
const OUString& rFormulaString );
- /** Imports and converts a OOBIN token array from the passed stream. */
- virtual void importOobFormula(
+ /** Imports and converts a BIFF12 token array from the passed stream. */
+ virtual void importBiff12Formula(
FormulaContext& rContext,
- RecordInputStream& rStrm );
+ SequenceInputStream& rStrm );
- /** Imports and converts a BIFF token array from the passed stream. */
+ /** Imports and converts a BIFF2-BIFF8 token array from the passed stream. */
virtual void importBiffFormula(
FormulaContext& rContext,
BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize );
@@ -440,7 +433,7 @@ public:
const ApiTokenSequence& rTokens );
/** Tries to resolve the passed ref-id to an OLE target URL. */
- OUString resolveOleTarget( sal_Int32 nRefId ) const;
+ OUString resolveOleTarget( sal_Int32 nRefId, bool bUseRefSheets ) const;
protected:
typedef ::std::pair< sal_Int32, bool > WhiteSpace;
@@ -590,9 +583,9 @@ void FormulaParserImpl::importOoxFormula( FormulaContext&, const OUString& )
OSL_ENSURE( false, "FormulaParserImpl::importOoxFormula - not implemented" );
}
-void FormulaParserImpl::importOobFormula( FormulaContext&, RecordInputStream& )
+void FormulaParserImpl::importBiff12Formula( FormulaContext&, SequenceInputStream& )
{
- OSL_ENSURE( false, "FormulaParserImpl::importOobFormula - not implemented" );
+ OSL_ENSURE( false, "FormulaParserImpl::importBiff12Formula - not implemented" );
}
void FormulaParserImpl::importBiffFormula( FormulaContext&, BiffInputStream&, const sal_uInt16* )
@@ -606,9 +599,9 @@ void FormulaParserImpl::setFormula( FormulaContext& rContext, const ApiTokenSequ
finalizeImport( rTokens );
}
-OUString FormulaParserImpl::resolveOleTarget( sal_Int32 nRefId ) const
+OUString FormulaParserImpl::resolveOleTarget( sal_Int32 nRefId, bool bUseRefSheets ) const
{
- const ExternalLink* pExtLink = getExternalLinks().getExternalLink( nRefId ).get();
+ const ExternalLink* pExtLink = getExternalLinks().getExternalLink( nRefId, bUseRefSheets ).get();
OSL_ENSURE( pExtLink && (pExtLink->getLinkType() == LINKTYPE_OLE), "FormulaParserImpl::resolveOleTarget - missing or wrong link" );
if( pExtLink && (pExtLink->getLinkType() == LINKTYPE_OLE) )
return getBaseFilter().getAbsoluteUrl( pExtLink->getTargetUrl() );
@@ -904,7 +897,7 @@ bool FormulaParserImpl::pushValueOperand( const Type& rValue, sal_Int32 nOpCode
bool FormulaParserImpl::pushBoolOperand( bool bValue )
{
- if( const FunctionInfo* pFuncInfo = getFuncInfoFromOobFuncId( bValue ? OOBIN_FUNC_TRUE : OOBIN_FUNC_FALSE ) )
+ if( const FunctionInfo* pFuncInfo = getFuncInfoFromBiff12FuncId( bValue ? BIFF_FUNC_TRUE : BIFF_FUNC_FALSE ) )
return pushFunctionOperator( pFuncInfo->mnApiOpCode, 0 );
return pushValueOperand< double >( bValue ? 1.0 : 0.0 );
}
@@ -1235,7 +1228,7 @@ OUString FormulaParserImpl::resolveDefinedName( sal_Int32 nTokenIndex ) const
return OUString();
}
-// OOX parser implementation ==================================================
+// OOXML/BIFF12 parser implementation =========================================
class OoxFormulaParserImpl : public FormulaParserImpl
{
@@ -1246,40 +1239,40 @@ public:
FormulaContext& rContext,
const OUString& rFormulaString );
- virtual void importOobFormula(
+ virtual void importBiff12Formula(
FormulaContext& rContext,
- RecordInputStream& rStrm );
+ SequenceInputStream& rStrm );
private:
// import token contents and create API formula token ---------------------
- bool importAttrToken( RecordInputStream& rStrm );
- bool importSpaceToken( RecordInputStream& rStrm );
- bool importTableToken( RecordInputStream& rStrm );
- bool importArrayToken( RecordInputStream& rStrm );
- bool importRefToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
- bool importAreaToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
- bool importRef3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
- bool importArea3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
- bool importMemAreaToken( RecordInputStream& rStrm, bool bAddData );
- bool importMemFuncToken( RecordInputStream& rStrm );
- bool importNameToken( RecordInputStream& rStrm );
- bool importNameXToken( RecordInputStream& rStrm );
- bool importFuncToken( RecordInputStream& rStrm );
- bool importFuncVarToken( RecordInputStream& rStrm );
- bool importExpToken( RecordInputStream& rStrm );
-
- LinkSheetRange readSheetRange( RecordInputStream& rStrm );
-
- void swapStreamPosition( RecordInputStream& rStrm );
- void skipMemAreaAddData( RecordInputStream& rStrm );
+ bool importAttrToken( SequenceInputStream& rStrm );
+ bool importSpaceToken( SequenceInputStream& rStrm );
+ bool importTableToken( SequenceInputStream& rStrm );
+ bool importArrayToken( SequenceInputStream& rStrm );
+ bool importRefToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
+ bool importAreaToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
+ bool importRef3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
+ bool importArea3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset );
+ bool importMemAreaToken( SequenceInputStream& rStrm, bool bAddData );
+ bool importMemFuncToken( SequenceInputStream& rStrm );
+ bool importNameToken( SequenceInputStream& rStrm );
+ bool importNameXToken( SequenceInputStream& rStrm );
+ bool importFuncToken( SequenceInputStream& rStrm );
+ bool importFuncVarToken( SequenceInputStream& rStrm );
+ bool importExpToken( SequenceInputStream& rStrm );
+
+ LinkSheetRange readSheetRange( SequenceInputStream& rStrm );
+
+ void swapStreamPosition( SequenceInputStream& rStrm );
+ void skipMemAreaAddData( SequenceInputStream& rStrm );
// convert BIN token and push API operand or operator ---------------------
- bool pushOobName( sal_Int32 nNameId );
- bool pushOobExtName( sal_Int32 nRefId, sal_Int32 nNameId );
- bool pushOobFunction( sal_uInt16 nFuncId );
- bool pushOobFunction( sal_uInt16 nFuncId, sal_uInt8 nParamCount );
+ bool pushBiff12Name( sal_Int32 nNameId );
+ bool pushBiff12ExtName( sal_Int32 nRefId, sal_Int32 nNameId );
+ bool pushBiff12Function( sal_uInt16 nFuncId );
+ bool pushBiff12Function( sal_uInt16 nFuncId, sal_uInt8 nParamCount );
private:
ApiParserWrapper maApiParser; /// Wrapper for the API formula parser object.
@@ -1308,7 +1301,7 @@ void OoxFormulaParserImpl::importOoxFormula( FormulaContext& rContext, const OUS
finalizeImport( maApiParser.parseFormula( rFormulaString, rContext.getBaseAddress() ) );
}
-void OoxFormulaParserImpl::importOobFormula( FormulaContext& rContext, RecordInputStream& rStrm )
+void OoxFormulaParserImpl::importBiff12Formula( FormulaContext& rContext, SequenceInputStream& rStrm )
{
initializeImport( rContext );
@@ -1337,34 +1330,34 @@ void OoxFormulaParserImpl::importOobFormula( FormulaContext& rContext, RecordInp
// base tokens
switch( nBaseId )
{
- case BIFF_TOKID_EXP: bOk = importExpToken( rStrm ); break;
- case BIFF_TOKID_ADD: bOk = pushBinaryOperator( OPCODE_ADD ); break;
- case BIFF_TOKID_SUB: bOk = pushBinaryOperator( OPCODE_SUB ); break;
- case BIFF_TOKID_MUL: bOk = pushBinaryOperator( OPCODE_MULT ); break;
- case BIFF_TOKID_DIV: bOk = pushBinaryOperator( OPCODE_DIV ); break;
- case BIFF_TOKID_POWER: bOk = pushBinaryOperator( OPCODE_POWER ); break;
- case BIFF_TOKID_CONCAT: bOk = pushBinaryOperator( OPCODE_CONCAT ); break;
- case BIFF_TOKID_LT: bOk = pushBinaryOperator( OPCODE_LESS ); break;
- case BIFF_TOKID_LE: bOk = pushBinaryOperator( OPCODE_LESS_EQUAL ); break;
- case BIFF_TOKID_EQ: bOk = pushBinaryOperator( OPCODE_EQUAL ); break;
- case BIFF_TOKID_GE: bOk = pushBinaryOperator( OPCODE_GREATER_EQUAL ); break;
- case BIFF_TOKID_GT: bOk = pushBinaryOperator( OPCODE_GREATER ); break;
- case BIFF_TOKID_NE: bOk = pushBinaryOperator( OPCODE_NOT_EQUAL ); break;
- case BIFF_TOKID_ISECT: bOk = pushBinaryOperator( OPCODE_INTERSECT ); break;
- case BIFF_TOKID_LIST: bOk = pushBinaryOperator( OPCODE_LIST ); break;
- case BIFF_TOKID_RANGE: bOk = pushBinaryOperator( OPCODE_RANGE ); break;
- case BIFF_TOKID_UPLUS: bOk = pushUnaryPreOperator( OPCODE_PLUS_SIGN ); break;
- case BIFF_TOKID_UMINUS: bOk = pushUnaryPreOperator( OPCODE_MINUS_SIGN ); break;
- case BIFF_TOKID_PERCENT: bOk = pushUnaryPostOperator( OPCODE_PERCENT ); break;
- case BIFF_TOKID_PAREN: bOk = pushParenthesesOperator(); break;
- case BIFF_TOKID_MISSARG: bOk = pushOperand( OPCODE_MISSING ); break;
- case BIFF_TOKID_STR: bOk = pushValueOperand( rStrm.readString( false ) ); break;
- case BIFF_TOKID_NLR: bOk = importTableToken( rStrm ); break;
- case BIFF_TOKID_ATTR: bOk = importAttrToken( rStrm ); break;
- case BIFF_TOKID_ERR: bOk = pushBiffErrorOperand( rStrm.readuInt8() ); break;
- case BIFF_TOKID_BOOL: bOk = pushBiffBoolOperand( rStrm.readuInt8() ); break;
- case BIFF_TOKID_INT: bOk = pushValueOperand< double >( rStrm.readuInt16() ); break;
- case BIFF_TOKID_NUM: bOk = pushValueOperand( rStrm.readDouble() ); break;
+ case BIFF_TOKID_EXP: bOk = importExpToken( rStrm ); break;
+ case BIFF_TOKID_ADD: bOk = pushBinaryOperator( OPCODE_ADD ); break;
+ case BIFF_TOKID_SUB: bOk = pushBinaryOperator( OPCODE_SUB ); break;
+ case BIFF_TOKID_MUL: bOk = pushBinaryOperator( OPCODE_MULT ); break;
+ case BIFF_TOKID_DIV: bOk = pushBinaryOperator( OPCODE_DIV ); break;
+ case BIFF_TOKID_POWER: bOk = pushBinaryOperator( OPCODE_POWER ); break;
+ case BIFF_TOKID_CONCAT: bOk = pushBinaryOperator( OPCODE_CONCAT ); break;
+ case BIFF_TOKID_LT: bOk = pushBinaryOperator( OPCODE_LESS ); break;
+ case BIFF_TOKID_LE: bOk = pushBinaryOperator( OPCODE_LESS_EQUAL ); break;
+ case BIFF_TOKID_EQ: bOk = pushBinaryOperator( OPCODE_EQUAL ); break;
+ case BIFF_TOKID_GE: bOk = pushBinaryOperator( OPCODE_GREATER_EQUAL ); break;
+ case BIFF_TOKID_GT: bOk = pushBinaryOperator( OPCODE_GREATER ); break;
+ case BIFF_TOKID_NE: bOk = pushBinaryOperator( OPCODE_NOT_EQUAL ); break;
+ case BIFF_TOKID_ISECT: bOk = pushBinaryOperator( OPCODE_INTERSECT ); break;
+ case BIFF_TOKID_LIST: bOk = pushBinaryOperator( OPCODE_LIST ); break;
+ case BIFF_TOKID_RANGE: bOk = pushBinaryOperator( OPCODE_RANGE ); break;
+ case BIFF_TOKID_UPLUS: bOk = pushUnaryPreOperator( OPCODE_PLUS_SIGN ); break;
+ case BIFF_TOKID_UMINUS: bOk = pushUnaryPreOperator( OPCODE_MINUS_SIGN ); break;
+ case BIFF_TOKID_PERCENT: bOk = pushUnaryPostOperator( OPCODE_PERCENT ); break;
+ case BIFF_TOKID_PAREN: bOk = pushParenthesesOperator(); break;
+ case BIFF_TOKID_MISSARG: bOk = pushOperand( OPCODE_MISSING ); break;
+ case BIFF_TOKID_STR: bOk = pushValueOperand( BiffHelper::readString( rStrm, false ) ); break;
+ case BIFF_TOKID_NLR: bOk = importTableToken( rStrm ); break;
+ case BIFF_TOKID_ATTR: bOk = importAttrToken( rStrm ); break;
+ case BIFF_TOKID_ERR: bOk = pushBiffErrorOperand( rStrm.readuInt8() ); break;
+ case BIFF_TOKID_BOOL: bOk = pushBiffBoolOperand( rStrm.readuInt8() ); break;
+ case BIFF_TOKID_INT: bOk = pushValueOperand< double >( rStrm.readuInt16() ); break;
+ case BIFF_TOKID_NUM: bOk = pushValueOperand( rStrm.readDouble() ); break;
default: bOk = false;
}
}
@@ -1410,31 +1403,31 @@ void OoxFormulaParserImpl::importOobFormula( FormulaContext& rContext, RecordInp
// import token contents and create API formula token -------------------------
-bool OoxFormulaParserImpl::importAttrToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importAttrToken( SequenceInputStream& rStrm )
{
bool bOk = true;
sal_uInt8 nType;
rStrm >> nType;
- // equal flags in BIFF and OOBIN
+ // equal flags in all BIFFs
switch( nType )
{
case 0: // sometimes, tAttrSkip tokens miss the type flag
- case OOBIN_TOK_ATTR_VOLATILE:
- case OOBIN_TOK_ATTR_IF:
- case OOBIN_TOK_ATTR_SKIP:
- case OOBIN_TOK_ATTR_ASSIGN:
- case OOBIN_TOK_ATTR_IFERROR:
+ case BIFF_TOK_ATTR_VOLATILE:
+ case BIFF_TOK_ATTR_IF:
+ case BIFF_TOK_ATTR_SKIP:
+ case BIFF_TOK_ATTR_ASSIGN:
+ case BIFF_TOK_ATTR_IFERROR:
rStrm.skip( 2 );
break;
- case OOBIN_TOK_ATTR_CHOOSE:
+ case BIFF_TOK_ATTR_CHOOSE:
rStrm.skip( 2 * rStrm.readuInt16() + 2 );
break;
- case OOBIN_TOK_ATTR_SUM:
+ case BIFF_TOK_ATTR_SUM:
rStrm.skip( 2 );
- bOk = pushOobFunction( OOBIN_FUNC_SUM, 1 );
+ bOk = pushBiff12Function( BIFF_FUNC_SUM, 1 );
break;
- case OOBIN_TOK_ATTR_SPACE:
- case OOBIN_TOK_ATTR_SPACE_VOLATILE:
+ case BIFF_TOK_ATTR_SPACE:
+ case BIFF_TOK_ATTR_SPACE_VOLATILE:
bOk = importSpaceToken( rStrm );
break;
default:
@@ -1443,7 +1436,7 @@ bool OoxFormulaParserImpl::importAttrToken( RecordInputStream& rStrm )
return bOk;
}
-bool OoxFormulaParserImpl::importSpaceToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importSpaceToken( SequenceInputStream& rStrm )
{
// equal constants in BIFF and OOX
sal_uInt8 nType, nCount;
@@ -1472,7 +1465,7 @@ bool OoxFormulaParserImpl::importSpaceToken( RecordInputStream& rStrm )
return true;
}
-bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importTableToken( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags, nTableId, nCol1, nCol2;
rStrm.skip( 3 );
@@ -1492,8 +1485,8 @@ bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm )
bool bFixedStartRow = true;
bool bFixedHeight = false;
- bool bSingleCol = getFlag( nFlags, OOBIN_TOK_TABLE_COLUMN );
- bool bColRange = getFlag( nFlags, OOBIN_TOK_TABLE_COLRANGE );
+ bool bSingleCol = getFlag( nFlags, BIFF12_TOK_TABLE_COLUMN );
+ bool bColRange = getFlag( nFlags, BIFF12_TOK_TABLE_COLRANGE );
bool bValidRef = !bSingleCol || !bColRange;
OSL_ENSURE( bValidRef, "OoxFormulaParserImpl::importTableToken - illegal combination of single column and column range" );
if( bValidRef )
@@ -1508,11 +1501,11 @@ bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm )
if( bValidRef )
{
- bool bAllRows = getFlag( nFlags, OOBIN_TOK_TABLE_ALL );
- bool bHeaderRows = getFlag( nFlags, OOBIN_TOK_TABLE_HEADERS );
- bool bDataRows = getFlag( nFlags, OOBIN_TOK_TABLE_DATA );
- bool bTotalsRows = getFlag( nFlags, OOBIN_TOK_TABLE_TOTALS );
- bool bThisRow = getFlag( nFlags, OOBIN_TOK_TABLE_THISROW );
+ bool bAllRows = getFlag( nFlags, BIFF12_TOK_TABLE_ALL );
+ bool bHeaderRows = getFlag( nFlags, BIFF12_TOK_TABLE_HEADERS );
+ bool bDataRows = getFlag( nFlags, BIFF12_TOK_TABLE_DATA );
+ bool bTotalsRows = getFlag( nFlags, BIFF12_TOK_TABLE_TOTALS );
+ bool bThisRow = getFlag( nFlags, BIFF12_TOK_TABLE_THISROW );
sal_Int32 nStartDataRow = xTable->getHeaderRows();
sal_Int32 nEndDataRow = nEndRow - xTable->getTotalsRows();
@@ -1568,8 +1561,8 @@ bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm )
if( (nStartCol == 0) && (nEndCol + 1 == nWidth) && (nStartRow == 0) && (nEndRow + 1 == nHeight) )
return pushValueOperand( nTokenIndex, OPCODE_DBAREA );
// create an OFFSET function call to refer to a subrange of the table
- const FunctionInfo* pRowsInfo = getFuncInfoFromOobFuncId( OOBIN_FUNC_ROWS );
- const FunctionInfo* pColumnsInfo = getFuncInfoFromOobFuncId( OOBIN_FUNC_COLUMNS );
+ const FunctionInfo* pRowsInfo = getFuncInfoFromBiff12FuncId( BIFF_FUNC_ROWS );
+ const FunctionInfo* pColumnsInfo = getFuncInfoFromBiff12FuncId( BIFF_FUNC_COLUMNS );
return
pRowsInfo && pColumnsInfo &&
pushValueOperandToken( nTokenIndex, OPCODE_DBAREA ) &&
@@ -1591,13 +1584,13 @@ bool OoxFormulaParserImpl::importTableToken( RecordInputStream& rStrm )
(pushValueOperandToken( nTokenIndex, OPCODE_DBAREA ) &&
pushFunctionOperatorToken( *pColumnsInfo, 1 )) :
pushValueOperandToken< double >( nEndCol - nStartCol + 1 )) &&
- pushOobFunction( OOBIN_FUNC_OFFSET, 5 );
+ pushBiff12Function( BIFF_FUNC_OFFSET, 5 );
}
}
return pushBiffErrorOperand( BIFF_ERR_REF );
}
-bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importArrayToken( SequenceInputStream& rStrm )
{
rStrm.skip( 14 );
@@ -1623,16 +1616,16 @@ bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm )
appendRawToken( OPCODE_ARRAY_COLSEP );
switch( rStrm.readuInt8() )
{
- case OOBIN_TOK_ARRAY_DOUBLE:
+ case BIFF_TOK_ARRAY_DOUBLE:
appendRawToken( OPCODE_PUSH ) <<= rStrm.readDouble();
break;
- case OOBIN_TOK_ARRAY_STRING:
- appendRawToken( OPCODE_PUSH ) <<= rStrm.readString( false );
+ case BIFF_TOK_ARRAY_STRING:
+ appendRawToken( OPCODE_PUSH ) <<= BiffHelper::readString( rStrm, false );
break;
- case OOBIN_TOK_ARRAY_BOOL:
+ case BIFF_TOK_ARRAY_BOOL:
appendRawToken( OPCODE_PUSH ) <<= static_cast< double >( (rStrm.readuInt8() == BIFF_TOK_BOOL_FALSE) ? 0.0 : 1.0 );
break;
- case OOBIN_TOK_ARRAY_ERROR:
+ case BIFF_TOK_ARRAY_ERROR:
appendRawToken( OPCODE_PUSH ) <<= BiffHelper::calcDoubleFromError( rStrm.readuInt8() );
rStrm.skip( 3 );
break;
@@ -1650,37 +1643,37 @@ bool OoxFormulaParserImpl::importArrayToken( RecordInputStream& rStrm )
return true;
}
-bool OoxFormulaParserImpl::importRefToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
+bool OoxFormulaParserImpl::importRefToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
{
BinSingleRef2d aRef;
- aRef.readOobData( rStrm, bRelativeAsOffset );
+ aRef.readBiff12Data( rStrm, bRelativeAsOffset );
return pushReferenceOperand( aRef, bDeleted, bRelativeAsOffset );
}
-bool OoxFormulaParserImpl::importAreaToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
+bool OoxFormulaParserImpl::importAreaToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
{
BinComplexRef2d aRef;
- aRef.readOobData( rStrm, bRelativeAsOffset );
+ aRef.readBiff12Data( rStrm, bRelativeAsOffset );
return pushReferenceOperand( aRef, bDeleted, bRelativeAsOffset );
}
-bool OoxFormulaParserImpl::importRef3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
+bool OoxFormulaParserImpl::importRef3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
{
LinkSheetRange aSheetRange = readSheetRange( rStrm );
BinSingleRef2d aRef;
- aRef.readOobData( rStrm, bRelativeAsOffset );
+ aRef.readBiff12Data( rStrm, bRelativeAsOffset );
return pushReferenceOperand( aSheetRange, aRef, bDeleted, bRelativeAsOffset );
}
-bool OoxFormulaParserImpl::importArea3dToken( RecordInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
+bool OoxFormulaParserImpl::importArea3dToken( SequenceInputStream& rStrm, bool bDeleted, bool bRelativeAsOffset )
{
LinkSheetRange aSheetRange = readSheetRange( rStrm );
BinComplexRef2d aRef;
- aRef.readOobData( rStrm, bRelativeAsOffset );
+ aRef.readBiff12Data( rStrm, bRelativeAsOffset );
return pushReferenceOperand( aSheetRange, aRef, bDeleted, bRelativeAsOffset );
}
-bool OoxFormulaParserImpl::importMemAreaToken( RecordInputStream& rStrm, bool bAddData )
+bool OoxFormulaParserImpl::importMemAreaToken( SequenceInputStream& rStrm, bool bAddData )
{
rStrm.skip( 6 );
if( bAddData )
@@ -1688,40 +1681,40 @@ bool OoxFormulaParserImpl::importMemAreaToken( RecordInputStream& rStrm, bool bA
return true;
}
-bool OoxFormulaParserImpl::importMemFuncToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importMemFuncToken( SequenceInputStream& rStrm )
{
rStrm.skip( 2 );
return true;
}
-bool OoxFormulaParserImpl::importNameToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importNameToken( SequenceInputStream& rStrm )
{
- return pushOobName( rStrm.readInt32() );
+ return pushBiff12Name( rStrm.readInt32() );
}
-bool OoxFormulaParserImpl::importNameXToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importNameXToken( SequenceInputStream& rStrm )
{
sal_Int32 nRefId = rStrm.readInt16();
sal_Int32 nNameId = rStrm.readInt32();
- return pushOobExtName( nRefId, nNameId );
+ return pushBiff12ExtName( nRefId, nNameId );
}
-bool OoxFormulaParserImpl::importFuncToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importFuncToken( SequenceInputStream& rStrm )
{
sal_uInt16 nFuncId;
rStrm >> nFuncId;
- return pushOobFunction( nFuncId );
+ return pushBiff12Function( nFuncId );
}
-bool OoxFormulaParserImpl::importFuncVarToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importFuncVarToken( SequenceInputStream& rStrm )
{
sal_uInt8 nParamCount;
sal_uInt16 nFuncId;
rStrm >> nParamCount >> nFuncId;
- return pushOobFunction( nFuncId, nParamCount );
+ return pushBiff12Function( nFuncId, nParamCount );
}
-bool OoxFormulaParserImpl::importExpToken( RecordInputStream& rStrm )
+bool OoxFormulaParserImpl::importExpToken( SequenceInputStream& rStrm )
{
BinAddress aBaseAddr;
rStrm >> aBaseAddr.mnRow;
@@ -1733,19 +1726,19 @@ bool OoxFormulaParserImpl::importExpToken( RecordInputStream& rStrm )
return false;
}
-LinkSheetRange OoxFormulaParserImpl::readSheetRange( RecordInputStream& rStrm )
+LinkSheetRange OoxFormulaParserImpl::readSheetRange( SequenceInputStream& rStrm )
{
return getExternalLinks().getSheetRange( rStrm.readInt16() );
}
-void OoxFormulaParserImpl::swapStreamPosition( RecordInputStream& rStrm )
+void OoxFormulaParserImpl::swapStreamPosition( SequenceInputStream& rStrm )
{
sal_Int64 nRecPos = rStrm.tell();
rStrm.seek( mnAddDataPos );
mnAddDataPos = nRecPos;
}
-void OoxFormulaParserImpl::skipMemAreaAddData( RecordInputStream& rStrm )
+void OoxFormulaParserImpl::skipMemAreaAddData( SequenceInputStream& rStrm )
{
swapStreamPosition( rStrm );
rStrm.skip( 16 * rStrm.readInt32() );
@@ -1754,38 +1747,38 @@ void OoxFormulaParserImpl::skipMemAreaAddData( RecordInputStream& rStrm )
// convert BIN token and push API operand or operator -------------------------
-bool OoxFormulaParserImpl::pushOobName( sal_Int32 nNameId )
+bool OoxFormulaParserImpl::pushBiff12Name( sal_Int32 nNameId )
{
- // one-based in OOBIN formulas
+ // one-based in BIFF12 formulas
return pushDefinedNameOperand( getDefinedNames().getByIndex( nNameId - 1 ) );
}
-bool OoxFormulaParserImpl::pushOobExtName( sal_Int32 nRefId, sal_Int32 nNameId )
+bool OoxFormulaParserImpl::pushBiff12ExtName( sal_Int32 nRefId, sal_Int32 nNameId )
{
if( const ExternalLink* pExtLink = getExternalLinks().getExternalLink( nRefId ).get() )
{
if( pExtLink->getLinkType() == LINKTYPE_SELF )
- return pushOobName( nNameId );
- // external name indexes are one-based in OOBIN
+ return pushBiff12Name( nNameId );
+ // external name indexes are one-based in BIFF12
ExternalNameRef xExtName = pExtLink->getNameByIndex( nNameId - 1 );
return pushExternalNameOperand( xExtName, *pExtLink );
}
return pushBiffErrorOperand( BIFF_ERR_NAME );
}
-bool OoxFormulaParserImpl::pushOobFunction( sal_uInt16 nFuncId )
+bool OoxFormulaParserImpl::pushBiff12Function( sal_uInt16 nFuncId )
{
- if( const FunctionInfo* pFuncInfo = getFuncInfoFromOobFuncId( nFuncId ) )
+ if( const FunctionInfo* pFuncInfo = getFuncInfoFromBiff12FuncId( nFuncId ) )
if( pFuncInfo->mnMinParamCount == pFuncInfo->mnMaxParamCount )
return pushFunctionOperator( *pFuncInfo, pFuncInfo->mnMinParamCount );
return pushFunctionOperator( OPCODE_NONAME, 0 );
}
-bool OoxFormulaParserImpl::pushOobFunction( sal_uInt16 nFuncId, sal_uInt8 nParamCount )
+bool OoxFormulaParserImpl::pushBiff12Function( sal_uInt16 nFuncId, sal_uInt8 nParamCount )
{
if( getFlag( nFuncId, BIFF_TOK_FUNCVAR_CMD ) )
nParamCount &= BIFF_TOK_FUNCVAR_COUNTMASK;
- if( const FunctionInfo* pFuncInfo = getFuncInfoFromOobFuncId( nFuncId ) )
+ if( const FunctionInfo* pFuncInfo = getFuncInfoFromBiff12FuncId( nFuncId ) )
return pushFunctionOperator( *pFuncInfo, nParamCount );
return pushFunctionOperator( OPCODE_NONAME, nParamCount );
}
@@ -2735,12 +2728,35 @@ bool BiffFormulaParserImpl::pushBiffFunction( sal_uInt16 nFuncId, sal_uInt8 nPar
// ============================================================================
+namespace {
+
+/** Extracts the reference identifier and the remaining data from a formula in
+ the format '[RefID]Remaining'. */
+bool lclExtractRefId( sal_Int32& rnRefId, OUString& rRemainder, const OUString& rFormulaString )
+{
+ if( (rFormulaString.getLength() >= 4) && (rFormulaString[ 0 ] == '[') )
+ {
+ sal_Int32 nBracketClose = rFormulaString.indexOf( ']', 1 );
+ if( nBracketClose >= 2 )
+ {
+ rnRefId = rFormulaString.copy( 1, nBracketClose - 1 ).toInt32();
+ rRemainder = rFormulaString.copy( nBracketClose + 1 );
+ return rRemainder.getLength() > 0;
+ }
+ }
+ return false;
+}
+
+}
+
+// ----------------------------------------------------------------------------
+
FormulaParser::FormulaParser( const WorkbookHelper& rHelper ) :
FormulaProcessorBase( rHelper )
{
switch( getFilterType() )
{
- case FILTER_OOX: mxImpl.reset( new OoxFormulaParserImpl( *this ) ); break;
+ case FILTER_OOXML: mxImpl.reset( new OoxFormulaParserImpl( *this ) ); break;
case FILTER_BIFF: mxImpl.reset( new BiffFormulaParserImpl( *this ) ); break;
case FILTER_UNKNOWN: break;
}
@@ -2755,9 +2771,9 @@ void FormulaParser::importFormula( FormulaContext& rContext, const OUString& rFo
mxImpl->importOoxFormula( rContext, rFormulaString );
}
-void FormulaParser::importFormula( FormulaContext& rContext, RecordInputStream& rStrm ) const
+void FormulaParser::importFormula( FormulaContext& rContext, SequenceInputStream& rStrm ) const
{
- mxImpl->importOobFormula( rContext, rStrm );
+ mxImpl->importBiff12Formula( rContext, rStrm );
}
void FormulaParser::importFormula( FormulaContext& rContext, BiffInputStream& rStrm, const sal_uInt16* pnFmlaSize ) const
@@ -2792,7 +2808,7 @@ void FormulaParser::convertNameToFormula( FormulaContext& rContext, sal_Int32 nT
void FormulaParser::convertNumberToHyperlink( FormulaContext& rContext, const OUString& rUrl, double fValue ) const
{
OSL_ENSURE( rUrl.getLength() > 0, "FormulaParser::convertNumberToHyperlink - missing URL" );
- if( const FunctionInfo* pFuncInfo = getFuncInfoFromOobFuncId( OOBIN_FUNC_HYPERLINK ) )
+ if( const FunctionInfo* pFuncInfo = getFuncInfoFromBiff12FuncId( BIFF_FUNC_HYPERLINK ) )
{
ApiTokenSequence aTokens( 6 );
aTokens[ 0 ].OpCode = pFuncInfo->mnApiOpCode;
@@ -2809,27 +2825,15 @@ void FormulaParser::convertNumberToHyperlink( FormulaContext& rContext, const OU
OUString FormulaParser::importOleTargetLink( const OUString& rFormulaString )
{
- // obviously, this would overburden our formula parser, so we parse it manually
- OUString aTargetLink;
- sal_Int32 nFmlaLen = rFormulaString.getLength();
- if( (nFmlaLen >= 8) && (rFormulaString[ 0 ] == '[') )
- {
- // passed string is trimmed already
- sal_Int32 nBracketClose = rFormulaString.indexOf( ']' );
- sal_Int32 nExclamation = rFormulaString.indexOf( '!' );
- if( (nBracketClose >= 2) &&
- (nBracketClose + 1 == nExclamation) &&
- (rFormulaString[ nExclamation + 1 ] == '\'') &&
- (rFormulaString[ nFmlaLen - 1 ] == '\'') )
- {
- sal_Int32 nRefId = rFormulaString.copy( 1, nBracketClose - 1 ).toInt32();
- aTargetLink = mxImpl->resolveOleTarget( nRefId );
- }
- }
- return aTargetLink;
+ sal_Int32 nRefId = -1;
+ OUString aRemainder;
+ if( lclExtractRefId( nRefId, aRemainder, rFormulaString ) && (aRemainder.getLength() >= 3) &&
+ (aRemainder[ 0 ] == '!') && (aRemainder[ 1 ] == '\'') && (aRemainder[ aRemainder.getLength() - 1 ] == '\'') )
+ return mxImpl->resolveOleTarget( nRefId, false );
+ return OUString();
}
-OUString FormulaParser::importOleTargetLink( RecordInputStream& rStrm )
+OUString FormulaParser::importOleTargetLink( SequenceInputStream& rStrm )
{
OUString aTargetLink;
sal_Int32 nFmlaSize = rStrm.readInt32();
@@ -2841,7 +2845,7 @@ OUString FormulaParser::importOleTargetLink( RecordInputStream& rStrm )
sal_Int32 nNameId;
rStrm >> nToken >> nRefId >> nNameId;
if( nToken == (BIFF_TOKCLASS_VAL|BIFF_TOKID_NAMEX) )
- aTargetLink = mxImpl->resolveOleTarget( nRefId );
+ aTargetLink = mxImpl->resolveOleTarget( nRefId, true );
}
rStrm.seek( nFmlaEndPos );
return aTargetLink;
@@ -2855,9 +2859,62 @@ OUString FormulaParser::importOleTargetLink( BiffInputStream& rStrm, const sal_u
return aTargetLink;
}
+OUString FormulaParser::importMacroName( const OUString& rFormulaString )
+{
+ /* Valid macros are either sheet macros or VBA macros. OOXML and all BIFF
+ documents store defined names for sheet macros, but OOXML documents do
+ not store any defined name for VBA macros (while BIFF documents do).
+ Sheet macros may be defined locally to a sheet, or globally to the
+ document. As a result, all of the following macro specifiers are valid:
+
+ 1) Macros located in the own document:
+ [0]!MySheetMacro (global sheet macro 'MySheetMacro')
+ Macro1!MyMacro (sheet-local sheet macro 'MyMacro')
+ [0]!MyVBAProc (VBA macro 'MyVBAProc')
+ [0]!Mod1.MyVBAProc (VBA macro 'MyVBAProc' from code module 'Mod1')
+
+ 2) Macros from an external document:
+ [2]!MySheetMacro (global external sheet macro 'MySheetMacro')
+ [2]Macro1!MyMacro (sheet-local external sheet macro 'MyMacro')
+ [2]!MyVBAProc (external VBA macro 'MyVBAProc')
+ [2]!Mod1.MyVBAProc (external VBA macro from code module 'Mod1')
+
+ This implementation is only interested in VBA macros from the own
+ document, ignoring the valid syntax 'Macro1!MyMacro' for sheet-local
+ sheet macros.
+ */
+ sal_Int32 nRefId = -1;
+ OUString aRemainder;
+ if( lclExtractRefId( nRefId, aRemainder, rFormulaString ) && (aRemainder.getLength() > 1) && (aRemainder[ 0 ] == '!') )
+ {
+ /* In BIFF12 documents, the reference identifier is always the
+ one-based index of the external link as it is in OOXML documents
+ (it is not an index into the list of reference sheets as used in
+ cell formulas). Index 0 is an implicit placeholder for the own
+ document. In BIFF12 documents, the reference to the own document is
+ stored explicitly, mostly at the top of the list, so index 1 may
+ resolve to the own document too.
+ Passing 'false' to getExternalLink() specifies to ignore the
+ reference sheets list (if existing) and to access the list of
+ external links directly. */
+ const ExternalLink* pExtLink = getExternalLinks().getExternalLink( nRefId, false ).get();
+ OSL_ENSURE( pExtLink, "FormulaParser::importMacroName - missing link" );
+ // do not accept macros in external documents (not supported)
+ if( pExtLink && (pExtLink->getLinkType() == LINKTYPE_SELF) )
+ {
+ // ignore sheet macros (defined name for VBA macros may not exist, see above)
+ OUString aMacroName = aRemainder.copy( 1 );
+ const DefinedName* pDefName = getDefinedNames().getByModelName( aMacroName ).get();
+ if( !pDefName || pDefName->isVBName() )
+ return aMacroName;
+ }
+ }
+ return OUString();
+}
+
// ============================================================================
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/makefile.mk b/oox/source/xls/makefile.mk
index cdb2e18c262d..6ca6e6a271b9 100644
--- a/oox/source/xls/makefile.mk
+++ b/oox/source/xls/makefile.mk
@@ -42,6 +42,7 @@ ENABLE_EXCEPTIONS=TRUE
SLOFILES = \
$(SLO)$/addressconverter.obj \
+ $(SLO)$/autofilterbuffer.obj \
$(SLO)$/autofiltercontext.obj \
$(SLO)$/biffcodec.obj \
$(SLO)$/biffdetector.obj \
@@ -53,12 +54,14 @@ SLOFILES = \
$(SLO)$/commentsfragment.obj \
$(SLO)$/condformatbuffer.obj \
$(SLO)$/condformatcontext.obj \
+ $(SLO)$/connectionsbuffer.obj \
$(SLO)$/connectionsfragment.obj \
$(SLO)$/defnamesbuffer.obj \
$(SLO)$/drawingfragment.obj \
$(SLO)$/excelchartconverter.obj \
$(SLO)$/excelfilter.obj \
$(SLO)$/excelhandlers.obj \
+ $(SLO)$/excelvbaproject.obj \
$(SLO)$/externallinkbuffer.obj \
$(SLO)$/externallinkfragment.obj \
$(SLO)$/formulabase.obj \
@@ -70,6 +73,7 @@ SLOFILES = \
$(SLO)$/pivotcachefragment.obj \
$(SLO)$/pivottablebuffer.obj \
$(SLO)$/pivottablefragment.obj \
+ $(SLO)$/querytablebuffer.obj \
$(SLO)$/querytablefragment.obj \
$(SLO)$/richstring.obj \
$(SLO)$/richstringcontext.obj \
@@ -86,13 +90,12 @@ SLOFILES = \
$(SLO)$/themebuffer.obj \
$(SLO)$/unitconverter.obj \
$(SLO)$/viewsettings.obj \
- $(SLO)$/webquerybuffer.obj \
$(SLO)$/workbookfragment.obj \
$(SLO)$/workbookhelper.obj \
$(SLO)$/workbooksettings.obj \
$(SLO)$/worksheetbuffer.obj \
$(SLO)$/worksheetfragment.obj \
- $(SLO)$/worksheethelper.obj \
+ $(SLO)$/worksheethelper.obj \
$(SLO)$/worksheetsettings.obj
# --- Targets -------------------------------------------------------
diff --git a/oox/source/xls/numberformatsbuffer.cxx b/oox/source/xls/numberformatsbuffer.cxx
index d7a055469b48..f60e60fac1c3 100644
--- a/oox/source/xls/numberformatsbuffer.cxx
+++ b/oox/source/xls/numberformatsbuffer.cxx
@@ -27,43 +27,37 @@
************************************************************************/
#include "oox/xls/numberformatsbuffer.hxx"
+
#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/i18n/NumberFormatIndex.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#include <com/sun/star/util/XNumberFormats.hpp>
#include <com/sun/star/util/XNumberFormatTypes.hpp>
-#include <com/sun/star/i18n/NumberFormatIndex.hpp>
-#include <osl/thread.h>
-#include <rtl/string.hxx>
+#include <com/sun/star/util/XNumberFormats.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <rtl/strbuf.hxx>
+#include <rtl/string.hxx>
+#include <osl/thread.h>
#include <rtl/ustrbuf.hxx>
-#include "properties.hxx"
+#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/propertymap.hxx"
-#include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
using ::rtl::OString;
using ::rtl::OStringBuffer;
+using ::rtl::OStringToOUString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::rtl::OStringToOUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::lang::Locale;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::util::XNumberFormatsSupplier;
-using ::com::sun::star::util::XNumberFormats;
-using ::com::sun::star::util::XNumberFormatTypes;
-
-namespace oox {
-namespace xls {
// ============================================================================
@@ -2004,10 +1998,10 @@ NumberFormatRef NumberFormatsBuffer::importNumFmt( const AttributeList& rAttribs
return createNumFmt( nNumFmtId, aFmtCode );
}
-void NumberFormatsBuffer::importNumFmt( RecordInputStream& rStrm )
+void NumberFormatsBuffer::importNumFmt( SequenceInputStream& rStrm )
{
sal_Int32 nNumFmtId = rStrm.readuInt16();
- OUString aFmtCode = rStrm.readString();
+ OUString aFmtCode = BiffHelper::readString( rStrm );
createNumFmt( nNumFmtId, aFmtCode );
}
@@ -2122,4 +2116,4 @@ void NumberFormatsBuffer::insertBuiltinFormats()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/ooxformulaparser.cxx b/oox/source/xls/ooxformulaparser.cxx
index dea7bcb2c161..e73db3e56dbf 100644
--- a/oox/source/xls/ooxformulaparser.cxx
+++ b/oox/source/xls/ooxformulaparser.cxx
@@ -27,27 +27,24 @@
************************************************************************/
#include "oox/xls/ooxformulaparser.hxx"
+
#include <com/sun/star/uno/XComponentContext.hpp>
#include "oox/xls/formulaparser.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::XComponentContext;
-using ::com::sun::star::uno::XInterface;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::FormulaToken;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
class OOXMLFormulaParserImpl : private FormulaFinalizer
{
public:
@@ -65,7 +62,7 @@ private:
// ----------------------------------------------------------------------------
OOXMLFormulaParserImpl::OOXMLFormulaParserImpl( const Reference< XMultiServiceFactory >& rxFactory ) :
- FormulaFinalizer( OpCodeProvider( rxFactory, FILTER_OOX, BIFF_UNKNOWN, true ) ),
+ FormulaFinalizer( OpCodeProvider( rxFactory, FILTER_OOXML, BIFF_UNKNOWN, true ) ),
maApiParser( rxFactory, *this )
{
}
@@ -128,7 +125,7 @@ private:
// ----------------------------------------------------------------------------
OOXMLFormulaPrinterImpl::OOXMLFormulaPrinterImpl( const Reference< XMultiServiceFactory >& rxFactory ) :
- OpCodeProvider( rxFactory, FILTER_OOX, BIFF_UNKNOWN, false ),
+ OpCodeProvider( rxFactory, FILTER_OOXML, BIFF_UNKNOWN, false ),
maApiParser( rxFactory, *this )
{
}
@@ -144,7 +141,7 @@ Sequence< OUString > OOXMLFormulaParser_getSupportedServiceNames()
OUString OOXMLFormulaParser_getImplementationName()
{
- return CREATE_OUSTRING( "com.sun.star.comp.oox.OOXMLFormulaParser" );
+ return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.FormulaParser" );
}
Reference< XInterface > SAL_CALL OOXMLFormulaParser_createInstance( const Reference< XComponentContext >& ) throw( Exception )
@@ -224,4 +221,4 @@ OUString SAL_CALL OOXMLFormulaParser::printFormula(
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/pagesettings.cxx b/oox/source/xls/pagesettings.cxx
index 907cdf2a384d..1366514e1f92 100644
--- a/oox/source/xls/pagesettings.cxx
+++ b/oox/source/xls/pagesettings.cxx
@@ -27,10 +27,9 @@
************************************************************************/
#include "oox/xls/pagesettings.hxx"
-#include <set>
+
#include <algorithm>
-#include <rtl/strbuf.hxx>
-#include <rtl/ustrbuf.hxx>
+#include <set>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/sheet/XHeaderFooterContent.hpp>
@@ -39,13 +38,13 @@
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/text/XTextContent.hpp>
#include <com/sun/star/text/XTextCursor.hpp>
-#include "properties.hxx"
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
+#include "oox/core/xmlfilterbase.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
-#include "oox/core/xmlfilterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/excelhandlers.hxx"
#include "oox/xls/stylesbuffer.hxx"
@@ -53,27 +52,24 @@
#include "tools/mapunit.hxx"
#include "xmloff/xmluconv.hxx"
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::Relations;
using ::rtl::OString;
using ::rtl::OStringBuffer;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::sheet::XHeaderFooterContent;
-using ::com::sun::star::style::XStyle;
-using ::com::sun::star::text::XText;
-using ::com::sun::star::text::XTextCursor;
-using ::com::sun::star::text::XTextContent;
-using ::com::sun::star::text::XTextRange;
-using ::oox::core::Relations;
-
-namespace oox {
-namespace xls {
// ============================================================================
@@ -83,32 +79,32 @@ const double OOX_MARGIN_DEFAULT_LR = 0.748; /// Left/right d
const double OOX_MARGIN_DEFAULT_TB = 0.984; /// Top/bottom default margin in inches.
const double OOX_MARGIN_DEFAULT_HF = 0.512; /// Header/footer default margin in inches.
-const sal_uInt16 OOBIN_PRINTOPT_HORCENTER = 0x0001;
-const sal_uInt16 OOBIN_PRINTOPT_VERCENTER = 0x0002;
-const sal_uInt16 OOBIN_PRINTOPT_PRINTHEADING = 0x0004;
-const sal_uInt16 OOBIN_PRINTOPT_PRINTGRID = 0x0008;
-
-const sal_uInt16 OOBIN_HEADERFOOTER_DIFFEVEN = 0x0001;
-const sal_uInt16 OOBIN_HEADERFOOTER_DIFFFIRST = 0x0002;
-const sal_uInt16 OOBIN_HEADERFOOTER_SCALEDOC = 0x0004;
-const sal_uInt16 OOBIN_HEADERFOOTER_ALIGNMARGIN = 0x0008;
-
-const sal_uInt16 OOBIN_PAGESETUP_INROWS = 0x0001;
-const sal_uInt16 OOBIN_PAGESETUP_LANDSCAPE = 0x0002;
-const sal_uInt16 OOBIN_PAGESETUP_INVALID = 0x0004;
-const sal_uInt16 OOBIN_PAGESETUP_BLACKWHITE = 0x0008;
-const sal_uInt16 OOBIN_PAGESETUP_DRAFTQUALITY = 0x0010;
-const sal_uInt16 OOBIN_PAGESETUP_PRINTNOTES = 0x0020;
-const sal_uInt16 OOBIN_PAGESETUP_DEFAULTORIENT = 0x0040;
-const sal_uInt16 OOBIN_PAGESETUP_USEFIRSTPAGE = 0x0080;
-const sal_uInt16 OOBIN_PAGESETUP_NOTES_END = 0x0100; // different to BIFF flag
-
-const sal_uInt16 OOBIN_CHARTPAGESETUP_LANDSCAPE = 0x0001;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_INVALID = 0x0002;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_BLACKWHITE = 0x0004;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_DEFAULTORIENT = 0x0008;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_USEFIRSTPAGE = 0x0010;
-const sal_uInt16 OOBIN_CHARTPAGESETUP_DRAFTQUALITY = 0x0020;
+const sal_uInt16 BIFF12_PRINTOPT_HORCENTER = 0x0001;
+const sal_uInt16 BIFF12_PRINTOPT_VERCENTER = 0x0002;
+const sal_uInt16 BIFF12_PRINTOPT_PRINTHEADING = 0x0004;
+const sal_uInt16 BIFF12_PRINTOPT_PRINTGRID = 0x0008;
+
+const sal_uInt16 BIFF12_HEADERFOOTER_DIFFEVEN = 0x0001;
+const sal_uInt16 BIFF12_HEADERFOOTER_DIFFFIRST = 0x0002;
+const sal_uInt16 BIFF12_HEADERFOOTER_SCALEDOC = 0x0004;
+const sal_uInt16 BIFF12_HEADERFOOTER_ALIGNMARGIN = 0x0008;
+
+const sal_uInt16 BIFF12_PAGESETUP_INROWS = 0x0001;
+const sal_uInt16 BIFF12_PAGESETUP_LANDSCAPE = 0x0002;
+const sal_uInt16 BIFF12_PAGESETUP_INVALID = 0x0004;
+const sal_uInt16 BIFF12_PAGESETUP_BLACKWHITE = 0x0008;
+const sal_uInt16 BIFF12_PAGESETUP_DRAFTQUALITY = 0x0010;
+const sal_uInt16 BIFF12_PAGESETUP_PRINTNOTES = 0x0020;
+const sal_uInt16 BIFF12_PAGESETUP_DEFAULTORIENT = 0x0040;
+const sal_uInt16 BIFF12_PAGESETUP_USEFIRSTPAGE = 0x0080;
+const sal_uInt16 BIFF12_PAGESETUP_NOTES_END = 0x0100; // different to BIFF flag
+
+const sal_uInt16 BIFF12_CHARTPAGESETUP_LANDSCAPE = 0x0001;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_INVALID = 0x0002;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_BLACKWHITE = 0x0004;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_DEFAULTORIENT= 0x0008;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_USEFIRSTPAGE = 0x0010;
+const sal_uInt16 BIFF12_CHARTPAGESETUP_DRAFTQUALITY = 0x0020;
const sal_uInt16 BIFF_PAGESETUP_INROWS = 0x0001;
const sal_uInt16 BIFF_PAGESETUP_PORTRAIT = 0x0002;
@@ -159,7 +155,7 @@ PageSettingsModel::PageSettingsModel() :
{
}
-void PageSettingsModel::setBinPrintErrors( sal_uInt8 nPrintErrors )
+void PageSettingsModel::setBiffPrintErrors( sal_uInt8 nPrintErrors )
{
static const sal_Int32 spnErrorIds[] = { XML_displayed, XML_none, XML_dash, XML_NA };
mnPrintErrors = STATIC_ARRAY_SELECT( spnErrorIds, nPrintErrors, XML_none );
@@ -260,24 +256,24 @@ void PageSettings::importPicture( const Relations& rRelations, const AttributeLi
importPictureData( rRelations, rAttribs.getString( R_TOKEN( id ), OUString() ) );
}
-void PageSettings::importPageMargins( RecordInputStream& rStrm )
+void PageSettings::importPageMargins( SequenceInputStream& rStrm )
{
rStrm >> maModel.mfLeftMargin >> maModel.mfRightMargin
>> maModel.mfTopMargin >> maModel.mfBottomMargin
>> maModel.mfHeaderMargin >> maModel.mfFooterMargin;
}
-void PageSettings::importPrintOptions( RecordInputStream& rStrm )
+void PageSettings::importPrintOptions( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags;
rStrm >> nFlags;
- maModel.mbHorCenter = getFlag( nFlags, OOBIN_PRINTOPT_HORCENTER );
- maModel.mbVerCenter = getFlag( nFlags, OOBIN_PRINTOPT_VERCENTER );
- maModel.mbPrintGrid = getFlag( nFlags, OOBIN_PRINTOPT_PRINTGRID );
- maModel.mbPrintHeadings = getFlag( nFlags, OOBIN_PRINTOPT_PRINTHEADING );
+ maModel.mbHorCenter = getFlag( nFlags, BIFF12_PRINTOPT_HORCENTER );
+ maModel.mbVerCenter = getFlag( nFlags, BIFF12_PRINTOPT_VERCENTER );
+ maModel.mbPrintGrid = getFlag( nFlags, BIFF12_PRINTOPT_PRINTGRID );
+ maModel.mbPrintHeadings = getFlag( nFlags, BIFF12_PRINTOPT_PRINTHEADING );
}
-void PageSettings::importPageSetup( const Relations& rRelations, RecordInputStream& rStrm )
+void PageSettings::importPageSetup( const Relations& rRelations, SequenceInputStream& rStrm )
{
OUString aRelId;
sal_uInt16 nFlags;
@@ -286,18 +282,18 @@ void PageSettings::importPageSetup( const Relations& rRelations, RecordInputStre
>> maModel.mnCopies >> maModel.mnFirstPage
>> maModel.mnFitToWidth >> maModel.mnFitToHeight
>> nFlags >> aRelId;
- maModel.setBinPrintErrors( extractValue< sal_uInt8 >( nFlags, 9, 2 ) );
+ maModel.setBiffPrintErrors( extractValue< sal_uInt8 >( nFlags, 9, 2 ) );
maModel.maBinSettPath = rRelations.getFragmentPathFromRelId( aRelId );
- maModel.mnOrientation = getFlagValue( nFlags, OOBIN_PAGESETUP_DEFAULTORIENT, XML_default, getFlagValue( nFlags, OOBIN_PAGESETUP_LANDSCAPE, XML_landscape, XML_portrait ) );
- maModel.mnPageOrder = getFlagValue( nFlags, OOBIN_PAGESETUP_INROWS, XML_overThenDown, XML_downThenOver );
- maModel.mnCellComments = getFlagValue( nFlags, OOBIN_PAGESETUP_PRINTNOTES, getFlagValue( nFlags, OOBIN_PAGESETUP_NOTES_END, XML_atEnd, XML_asDisplayed ), XML_none );
- maModel.mbValidSettings = !getFlag( nFlags, OOBIN_PAGESETUP_INVALID );
- maModel.mbUseFirstPage = getFlag( nFlags, OOBIN_PAGESETUP_USEFIRSTPAGE );
- maModel.mbBlackWhite = getFlag( nFlags, OOBIN_PAGESETUP_BLACKWHITE );
- maModel.mbDraftQuality = getFlag( nFlags, OOBIN_PAGESETUP_DRAFTQUALITY );
+ maModel.mnOrientation = getFlagValue( nFlags, BIFF12_PAGESETUP_DEFAULTORIENT, XML_default, getFlagValue( nFlags, BIFF12_PAGESETUP_LANDSCAPE, XML_landscape, XML_portrait ) );
+ maModel.mnPageOrder = getFlagValue( nFlags, BIFF12_PAGESETUP_INROWS, XML_overThenDown, XML_downThenOver );
+ maModel.mnCellComments = getFlagValue( nFlags, BIFF12_PAGESETUP_PRINTNOTES, getFlagValue( nFlags, BIFF12_PAGESETUP_NOTES_END, XML_atEnd, XML_asDisplayed ), XML_none );
+ maModel.mbValidSettings = !getFlag( nFlags, BIFF12_PAGESETUP_INVALID );
+ maModel.mbUseFirstPage = getFlag( nFlags, BIFF12_PAGESETUP_USEFIRSTPAGE );
+ maModel.mbBlackWhite = getFlag( nFlags, BIFF12_PAGESETUP_BLACKWHITE );
+ maModel.mbDraftQuality = getFlag( nFlags, BIFF12_PAGESETUP_DRAFTQUALITY );
}
-void PageSettings::importChartPageSetup( const Relations& rRelations, RecordInputStream& rStrm )
+void PageSettings::importChartPageSetup( const Relations& rRelations, SequenceInputStream& rStrm )
{
OUString aRelId;
sal_uInt16 nFirstPage, nFlags;
@@ -305,27 +301,27 @@ void PageSettings::importChartPageSetup( const Relations& rRelations, RecordInpu
>> maModel.mnCopies >> nFirstPage >> nFlags >> aRelId;
maModel.maBinSettPath = rRelations.getFragmentPathFromRelId( aRelId );
maModel.mnFirstPage = nFirstPage; // 16-bit in CHARTPAGESETUP
- maModel.mnOrientation = getFlagValue( nFlags, OOBIN_CHARTPAGESETUP_DEFAULTORIENT, XML_default, getFlagValue( nFlags, OOBIN_CHARTPAGESETUP_LANDSCAPE, XML_landscape, XML_portrait ) );
- maModel.mbValidSettings = !getFlag( nFlags, OOBIN_CHARTPAGESETUP_INVALID );
- maModel.mbUseFirstPage = getFlag( nFlags, OOBIN_CHARTPAGESETUP_USEFIRSTPAGE );
- maModel.mbBlackWhite = getFlag( nFlags, OOBIN_CHARTPAGESETUP_BLACKWHITE );
- maModel.mbDraftQuality = getFlag( nFlags, OOBIN_CHARTPAGESETUP_DRAFTQUALITY );
+ maModel.mnOrientation = getFlagValue( nFlags, BIFF12_CHARTPAGESETUP_DEFAULTORIENT, XML_default, getFlagValue( nFlags, BIFF12_CHARTPAGESETUP_LANDSCAPE, XML_landscape, XML_portrait ) );
+ maModel.mbValidSettings = !getFlag( nFlags, BIFF12_CHARTPAGESETUP_INVALID );
+ maModel.mbUseFirstPage = getFlag( nFlags, BIFF12_CHARTPAGESETUP_USEFIRSTPAGE );
+ maModel.mbBlackWhite = getFlag( nFlags, BIFF12_CHARTPAGESETUP_BLACKWHITE );
+ maModel.mbDraftQuality = getFlag( nFlags, BIFF12_CHARTPAGESETUP_DRAFTQUALITY );
}
-void PageSettings::importHeaderFooter( RecordInputStream& rStrm )
+void PageSettings::importHeaderFooter( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags;
rStrm >> nFlags
>> maModel.maOddHeader >> maModel.maOddFooter
>> maModel.maEvenHeader >> maModel.maEvenFooter
>> maModel.maFirstHeader >> maModel.maFirstFooter;
- maModel.mbUseEvenHF = getFlag( nFlags, OOBIN_HEADERFOOTER_DIFFEVEN );
- maModel.mbUseFirstHF = getFlag( nFlags, OOBIN_HEADERFOOTER_DIFFFIRST );
+ maModel.mbUseEvenHF = getFlag( nFlags, BIFF12_HEADERFOOTER_DIFFEVEN );
+ maModel.mbUseFirstHF = getFlag( nFlags, BIFF12_HEADERFOOTER_DIFFFIRST );
}
-void PageSettings::importPicture( const Relations& rRelations, RecordInputStream& rStrm )
+void PageSettings::importPicture( const Relations& rRelations, SequenceInputStream& rStrm )
{
- importPictureData( rRelations, rStrm.readString() );
+ importPictureData( rRelations, BiffHelper::readString( rStrm ) );
}
void PageSettings::importLeftMargin( BiffInputStream& rStrm )
@@ -379,7 +375,7 @@ void PageSettings::importPageSetup( BiffInputStream& rStrm )
if( getBiff() == BIFF8 )
{
- maModel.setBinPrintErrors( extractValue< sal_uInt8 >( nFlags, 10, 2 ) );
+ maModel.setBiffPrintErrors( extractValue< sal_uInt8 >( nFlags, 10, 2 ) );
maModel.mnCellComments = getFlagValue( nFlags, BIFF_PAGESETUP_PRINTNOTES, getFlagValue( nFlags, BIFF_PAGESETUP_NOTES_END, XML_atEnd, XML_asDisplayed ), XML_none );
}
}
@@ -695,8 +691,8 @@ double HeaderFooterParser::parse( const Reference< XHeaderFooterContent >& rxCon
appendField( xContent );
}
break;
- case 'Z': // file path (without file name), BIFF8 and OOX only
- if( (getFilterType() == FILTER_OOX) || ((getFilterType() == FILTER_BIFF) && (getBiff() == BIFF8)) )
+ case 'Z': // file path (without file name), OOXML, BIFF12, and BIFF8 only
+ if( (getFilterType() == FILTER_OOXML) || ((getFilterType() == FILTER_BIFF) && (getBiff() == BIFF8)) )
{
Reference< XTextContent > xContent = createField( maFileNameService );
PropertySet aPropSet( xContent );
@@ -764,7 +760,7 @@ double HeaderFooterParser::parse( const Reference< XHeaderFooterContent >& rxCon
break;
case 'K': // text color (not in BIFF)
- if( (getFilterType() == FILTER_OOX) && (pcChar + 6 < pcEnd) )
+ if( (getFilterType() == FILTER_OOXML) && (pcChar + 6 < pcEnd) )
{
setAttributes();
// eat the following 6 characters
@@ -1268,8 +1264,8 @@ sal_Int32 PageSettingsConverter::writeHeaderFooter(
sal_Int32 nHeight = 0;
if( rContent.getLength() > 0 )
{
- Reference< XHeaderFooterContent > xHFContent;
- if( rPropSet.getProperty( xHFContent, nPropId ) && xHFContent.is() )
+ Reference< XHeaderFooterContent > xHFContent( rPropSet.getAnyProperty( nPropId ), UNO_QUERY );
+ if( xHFContent.is() )
{
double fTotalHeight = mxHFParser->parse( xHFContent, rContent );
rPropSet.setProperty( nPropId, xHFContent );
@@ -1284,4 +1280,4 @@ sal_Int32 PageSettingsConverter::writeHeaderFooter(
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/pivotcachebuffer.cxx b/oox/source/xls/pivotcachebuffer.cxx
index aeaade3b0640..1294131b34cc 100644
--- a/oox/source/xls/pivotcachebuffer.cxx
+++ b/oox/source/xls/pivotcachebuffer.cxx
@@ -27,20 +27,20 @@
************************************************************************/
#include "oox/xls/pivotcachebuffer.hxx"
+
#include <set>
-#include <rtl/ustrbuf.hxx>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/table/XCell.hpp>
#include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp>
#include <com/sun/star/sheet/DataPilotFieldGroupInfo.hpp>
#include <com/sun/star/sheet/XDataPilotFieldGrouping.hpp>
-#include "properties.hxx"
+#include <com/sun/star/table/XCell.hpp>
+#include <rtl/ustrbuf.hxx>
+#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/defnamesbuffer.hxx"
#include "oox/xls/excelhandlers.hxx"
@@ -49,75 +49,71 @@
#include "oox/xls/unitconverter.hxx"
#include "oox/xls/worksheetbuffer.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::DataPilotFieldGroupInfo;
-using ::com::sun::star::table::XCell;
-using ::com::sun::star::sheet::XDataPilotField;
-using ::com::sun::star::sheet::XDataPilotFieldGrouping;
-using ::oox::core::Relations;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::oox::core::Relations;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
-const sal_uInt16 OOBIN_PCDFIELD_SERVERFIELD = 0x0001;
-const sal_uInt16 OOBIN_PCDFIELD_NOUNIQUEITEMS = 0x0002;
-const sal_uInt16 OOBIN_PCDFIELD_DATABASEFIELD = 0x0004;
-const sal_uInt16 OOBIN_PCDFIELD_HASCAPTION = 0x0008;
-const sal_uInt16 OOBIN_PCDFIELD_MEMBERPROPFIELD = 0x0010;
-const sal_uInt16 OOBIN_PCDFIELD_HASFORMULA = 0x0100;
-const sal_uInt16 OOBIN_PCDFIELD_HASPROPERTYNAME = 0x0200;
-
-const sal_uInt16 OOBIN_PCDFSITEMS_HASSEMIMIXED = 0x0001;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASNONDATE = 0x0002;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASDATE = 0x0004;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASSTRING = 0x0008;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASBLANK = 0x0010;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASMIXED = 0x0020;
-const sal_uInt16 OOBIN_PCDFSITEMS_ISNUMERIC = 0x0040;
-const sal_uInt16 OOBIN_PCDFSITEMS_ISINTEGER = 0x0080;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASMINMAX = 0x0100;
-const sal_uInt16 OOBIN_PCDFSITEMS_HASLONGTEXT = 0x0200;
-
-const sal_uInt16 OOBIN_PCITEM_ARRAY_DOUBLE = 0x0001;
-const sal_uInt16 OOBIN_PCITEM_ARRAY_STRING = 0x0002;
-const sal_uInt16 OOBIN_PCITEM_ARRAY_ERROR = 0x0010;
-const sal_uInt16 OOBIN_PCITEM_ARRAY_DATE = 0x0020;
-
-const sal_uInt8 OOBIN_PCDFRANGEPR_AUTOSTART = 0x01;
-const sal_uInt8 OOBIN_PCDFRANGEPR_AUTOEND = 0x02;
-const sal_uInt8 OOBIN_PCDFRANGEPR_DATEGROUP = 0x04;
-
-const sal_uInt8 OOBIN_PCDEFINITION_SAVEDATA = 0x01;
-const sal_uInt8 OOBIN_PCDEFINITION_INVALID = 0x02;
-const sal_uInt8 OOBIN_PCDEFINITION_REFRESHONLOAD = 0x04;
-const sal_uInt8 OOBIN_PCDEFINITION_OPTIMIZEMEMORY = 0x08;
-const sal_uInt8 OOBIN_PCDEFINITION_ENABLEREFRESH = 0x10;
-const sal_uInt8 OOBIN_PCDEFINITION_BACKGROUNDQUERY = 0x20;
-const sal_uInt8 OOBIN_PCDEFINITION_UPGRADEONREFR = 0x40;
-const sal_uInt8 OOBIN_PCDEFINITION_TUPELCACHE = 0x80;
-
-const sal_uInt8 OOBIN_PCDEFINITION_HASUSERNAME = 0x01;
-const sal_uInt8 OOBIN_PCDEFINITION_HASRELID = 0x02;
-const sal_uInt8 OOBIN_PCDEFINITION_SUPPORTSUBQUERY = 0x04;
-const sal_uInt8 OOBIN_PCDEFINITION_SUPPORTDRILL = 0x08;
-
-const sal_uInt8 OOBIN_PCDWBSOURCE_HASRELID = 0x01;
-const sal_uInt8 OOBIN_PCDWBSOURCE_HASSHEET = 0x02;
+const sal_uInt16 BIFF12_PCDFIELD_SERVERFIELD = 0x0001;
+const sal_uInt16 BIFF12_PCDFIELD_NOUNIQUEITEMS = 0x0002;
+const sal_uInt16 BIFF12_PCDFIELD_DATABASEFIELD = 0x0004;
+const sal_uInt16 BIFF12_PCDFIELD_HASCAPTION = 0x0008;
+const sal_uInt16 BIFF12_PCDFIELD_MEMBERPROPFIELD = 0x0010;
+const sal_uInt16 BIFF12_PCDFIELD_HASFORMULA = 0x0100;
+const sal_uInt16 BIFF12_PCDFIELD_HASPROPERTYNAME = 0x0200;
+
+const sal_uInt16 BIFF12_PCDFSITEMS_HASSEMIMIXED = 0x0001;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASNONDATE = 0x0002;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASDATE = 0x0004;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASSTRING = 0x0008;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASBLANK = 0x0010;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASMIXED = 0x0020;
+const sal_uInt16 BIFF12_PCDFSITEMS_ISNUMERIC = 0x0040;
+const sal_uInt16 BIFF12_PCDFSITEMS_ISINTEGER = 0x0080;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASMINMAX = 0x0100;
+const sal_uInt16 BIFF12_PCDFSITEMS_HASLONGTEXT = 0x0200;
+
+const sal_uInt16 BIFF12_PCITEM_ARRAY_DOUBLE = 0x0001;
+const sal_uInt16 BIFF12_PCITEM_ARRAY_STRING = 0x0002;
+const sal_uInt16 BIFF12_PCITEM_ARRAY_ERROR = 0x0010;
+const sal_uInt16 BIFF12_PCITEM_ARRAY_DATE = 0x0020;
+
+const sal_uInt8 BIFF12_PCDFRANGEPR_AUTOSTART = 0x01;
+const sal_uInt8 BIFF12_PCDFRANGEPR_AUTOEND = 0x02;
+const sal_uInt8 BIFF12_PCDFRANGEPR_DATEGROUP = 0x04;
+
+const sal_uInt8 BIFF12_PCDEFINITION_SAVEDATA = 0x01;
+const sal_uInt8 BIFF12_PCDEFINITION_INVALID = 0x02;
+const sal_uInt8 BIFF12_PCDEFINITION_REFRESHONLOAD = 0x04;
+const sal_uInt8 BIFF12_PCDEFINITION_OPTIMIZEMEMORY = 0x08;
+const sal_uInt8 BIFF12_PCDEFINITION_ENABLEREFRESH = 0x10;
+const sal_uInt8 BIFF12_PCDEFINITION_BACKGROUNDQUERY = 0x20;
+const sal_uInt8 BIFF12_PCDEFINITION_UPGRADEONREFR = 0x40;
+const sal_uInt8 BIFF12_PCDEFINITION_TUPELCACHE = 0x80;
+
+const sal_uInt8 BIFF12_PCDEFINITION_HASUSERNAME = 0x01;
+const sal_uInt8 BIFF12_PCDEFINITION_HASRELID = 0x02;
+const sal_uInt8 BIFF12_PCDEFINITION_SUPPORTSUBQUERY = 0x04;
+const sal_uInt8 BIFF12_PCDEFINITION_SUPPORTDRILL = 0x08;
+
+const sal_uInt8 BIFF12_PCDWBSOURCE_HASRELID = 0x01;
+const sal_uInt8 BIFF12_PCDWBSOURCE_HASSHEET = 0x02;
+
+// ----------------------------------------------------------------------------
const sal_uInt16 BIFF_PCDSOURCE_WORKSHEET = 0x0001;
const sal_uInt16 BIFF_PCDSOURCE_EXTERNAL = 0x0002;
@@ -217,19 +213,19 @@ void PivotCacheItem::readIndex( const AttributeList& rAttribs )
mnType = XML_x;
}
-void PivotCacheItem::readString( RecordInputStream& rStrm )
+void PivotCacheItem::readString( SequenceInputStream& rStrm )
{
- maValue <<= rStrm.readString();
+ maValue <<= BiffHelper::readString( rStrm );
mnType = XML_s;
}
-void PivotCacheItem::readDouble( RecordInputStream& rStrm )
+void PivotCacheItem::readDouble( SequenceInputStream& rStrm )
{
maValue <<= rStrm.readDouble();
mnType = XML_n;
}
-void PivotCacheItem::readDate( RecordInputStream& rStrm )
+void PivotCacheItem::readDate( SequenceInputStream& rStrm )
{
DateTime aDateTime;
aDateTime.Year = rStrm.readuInt16();
@@ -243,19 +239,19 @@ void PivotCacheItem::readDate( RecordInputStream& rStrm )
mnType = XML_d;
}
-void PivotCacheItem::readBool( RecordInputStream& rStrm )
+void PivotCacheItem::readBool( SequenceInputStream& rStrm )
{
maValue <<= (rStrm.readuInt8() != 0);
mnType = XML_b;
}
-void PivotCacheItem::readError( RecordInputStream& rStrm )
+void PivotCacheItem::readError( SequenceInputStream& rStrm )
{
maValue <<= static_cast< sal_Int32 >( rStrm.readuInt8() );
mnType = XML_e;
}
-void PivotCacheItem::readIndex( RecordInputStream& rStrm )
+void PivotCacheItem::readIndex( SequenceInputStream& rStrm )
{
maValue <<= rStrm.readInt32();
mnType = XML_x;
@@ -343,9 +339,9 @@ void PivotCacheItemList::importItem( sal_Int32 nElement, const AttributeList& rA
}
}
-void PivotCacheItemList::importItem( sal_Int32 nRecId, RecordInputStream& rStrm )
+void PivotCacheItemList::importItem( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
- if( nRecId == OOBIN_ID_PCITEM_ARRAY )
+ if( nRecId == BIFF12_ID_PCITEM_ARRAY )
{
importArray( rStrm );
return;
@@ -354,18 +350,18 @@ void PivotCacheItemList::importItem( sal_Int32 nRecId, RecordInputStream& rStrm
PivotCacheItem& rItem = createItem();
switch( nRecId )
{
- case OOBIN_ID_PCITEM_MISSING:
- case OOBIN_ID_PCITEMA_MISSING: break;
- case OOBIN_ID_PCITEM_STRING:
- case OOBIN_ID_PCITEMA_STRING: rItem.readString( rStrm ); break;
- case OOBIN_ID_PCITEM_DOUBLE:
- case OOBIN_ID_PCITEMA_DOUBLE: rItem.readDouble( rStrm ); break;
- case OOBIN_ID_PCITEM_DATE:
- case OOBIN_ID_PCITEMA_DATE: rItem.readDate( rStrm ); break;
- case OOBIN_ID_PCITEM_BOOL:
- case OOBIN_ID_PCITEMA_BOOL: rItem.readBool( rStrm ); break;
- case OOBIN_ID_PCITEM_ERROR:
- case OOBIN_ID_PCITEMA_ERROR: rItem.readError( rStrm ); break;
+ case BIFF12_ID_PCITEM_MISSING:
+ case BIFF12_ID_PCITEMA_MISSING: break;
+ case BIFF12_ID_PCITEM_STRING:
+ case BIFF12_ID_PCITEMA_STRING: rItem.readString( rStrm ); break;
+ case BIFF12_ID_PCITEM_DOUBLE:
+ case BIFF12_ID_PCITEMA_DOUBLE: rItem.readDouble( rStrm ); break;
+ case BIFF12_ID_PCITEM_DATE:
+ case BIFF12_ID_PCITEMA_DATE: rItem.readDate( rStrm ); break;
+ case BIFF12_ID_PCITEM_BOOL:
+ case BIFF12_ID_PCITEMA_BOOL: rItem.readBool( rStrm ); break;
+ case BIFF12_ID_PCITEM_ERROR:
+ case BIFF12_ID_PCITEMA_ERROR: rItem.readError( rStrm ); break;
default: OSL_ENSURE( false, "PivotCacheItemList::importItem - unknown record type" );
}
}
@@ -412,7 +408,7 @@ PivotCacheItem& PivotCacheItemList::createItem()
return maItems.back();
}
-void PivotCacheItemList::importArray( RecordInputStream& rStrm )
+void PivotCacheItemList::importArray( SequenceInputStream& rStrm )
{
sal_uInt16 nType = rStrm.readuInt16();
sal_Int32 nCount = rStrm.readInt32();
@@ -420,10 +416,10 @@ void PivotCacheItemList::importArray( RecordInputStream& rStrm )
{
switch( nType )
{
- case OOBIN_PCITEM_ARRAY_DOUBLE: createItem().readDouble( rStrm ); break;
- case OOBIN_PCITEM_ARRAY_STRING: createItem().readString( rStrm ); break;
- case OOBIN_PCITEM_ARRAY_ERROR: createItem().readError( rStrm ); break;
- case OOBIN_PCITEM_ARRAY_DATE: createItem().readDate( rStrm ); break;
+ case BIFF12_PCITEM_ARRAY_DOUBLE: createItem().readDouble( rStrm ); break;
+ case BIFF12_PCITEM_ARRAY_STRING: createItem().readString( rStrm ); break;
+ case BIFF12_PCITEM_ARRAY_ERROR: createItem().readError( rStrm ); break;
+ case BIFF12_PCITEM_ARRAY_DATE: createItem().readDate( rStrm ); break;
default:
OSL_ENSURE( false, "PivotCacheItemList::importArray - unknown data type" );
nIdx = nCount;
@@ -478,7 +474,7 @@ PCFieldGroupModel::PCFieldGroupModel() :
{
}
-void PCFieldGroupModel::setBinGroupBy( sal_uInt8 nGroupBy )
+void PCFieldGroupModel::setBiffGroupBy( sal_uInt8 nGroupBy )
{
static const sal_Int32 spnGroupBy[] = { XML_range,
XML_seconds, XML_minutes, XML_hours, XML_days, XML_months, XML_quarters, XML_years };
@@ -563,62 +559,62 @@ void PivotCacheField::importGroupItem( sal_Int32 nElement, const AttributeList&
maGroupItems.importItem( nElement, rAttribs );
}
-void PivotCacheField::importPCDField( RecordInputStream& rStrm )
+void PivotCacheField::importPCDField( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags;
rStrm >> nFlags >> maFieldModel.mnNumFmtId;
maFieldModel.mnSqlType = rStrm.readInt16();
rStrm >> maFieldModel.mnHierarchy >> maFieldModel.mnLevel >> maFieldModel.mnMappingCount >> maFieldModel.maName;
- if( getFlag( nFlags, OOBIN_PCDFIELD_HASCAPTION ) )
+ if( getFlag( nFlags, BIFF12_PCDFIELD_HASCAPTION ) )
rStrm >> maFieldModel.maCaption;
- if( getFlag( nFlags, OOBIN_PCDFIELD_HASFORMULA ) )
+ if( getFlag( nFlags, BIFF12_PCDFIELD_HASFORMULA ) )
rStrm.skip( ::std::max< sal_Int32 >( rStrm.readInt32(), 0 ) );
if( maFieldModel.mnMappingCount > 0 )
rStrm.skip( ::std::max< sal_Int32 >( rStrm.readInt32(), 0 ) );
- if( getFlag( nFlags, OOBIN_PCDFIELD_HASPROPERTYNAME ) )
+ if( getFlag( nFlags, BIFF12_PCDFIELD_HASPROPERTYNAME ) )
rStrm >> maFieldModel.maPropertyName;
- maFieldModel.mbDatabaseField = getFlag( nFlags, OOBIN_PCDFIELD_DATABASEFIELD );
- maFieldModel.mbServerField = getFlag( nFlags, OOBIN_PCDFIELD_SERVERFIELD );
- maFieldModel.mbUniqueList = !getFlag( nFlags, OOBIN_PCDFIELD_NOUNIQUEITEMS );
- maFieldModel.mbMemberPropField = getFlag( nFlags, OOBIN_PCDFIELD_MEMBERPROPFIELD );
+ maFieldModel.mbDatabaseField = getFlag( nFlags, BIFF12_PCDFIELD_DATABASEFIELD );
+ maFieldModel.mbServerField = getFlag( nFlags, BIFF12_PCDFIELD_SERVERFIELD );
+ maFieldModel.mbUniqueList = !getFlag( nFlags, BIFF12_PCDFIELD_NOUNIQUEITEMS );
+ maFieldModel.mbMemberPropField = getFlag( nFlags, BIFF12_PCDFIELD_MEMBERPROPFIELD );
}
-void PivotCacheField::importPCDFSharedItems( RecordInputStream& rStrm )
+void PivotCacheField::importPCDFSharedItems( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags;
rStrm >> nFlags;
- maSharedItemsModel.mbHasSemiMixed = getFlag( nFlags, OOBIN_PCDFSITEMS_HASSEMIMIXED );
- maSharedItemsModel.mbHasNonDate = getFlag( nFlags, OOBIN_PCDFSITEMS_HASNONDATE );
- maSharedItemsModel.mbHasDate = getFlag( nFlags, OOBIN_PCDFSITEMS_HASDATE );
- maSharedItemsModel.mbHasString = getFlag( nFlags, OOBIN_PCDFSITEMS_HASSTRING );
- maSharedItemsModel.mbHasBlank = getFlag( nFlags, OOBIN_PCDFSITEMS_HASBLANK );
- maSharedItemsModel.mbHasMixed = getFlag( nFlags, OOBIN_PCDFSITEMS_HASMIXED );
- maSharedItemsModel.mbIsNumeric = getFlag( nFlags, OOBIN_PCDFSITEMS_ISNUMERIC );
- maSharedItemsModel.mbIsInteger = getFlag( nFlags, OOBIN_PCDFSITEMS_ISINTEGER );
- maSharedItemsModel.mbHasLongText = getFlag( nFlags, OOBIN_PCDFSITEMS_HASLONGTEXT );
+ maSharedItemsModel.mbHasSemiMixed = getFlag( nFlags, BIFF12_PCDFSITEMS_HASSEMIMIXED );
+ maSharedItemsModel.mbHasNonDate = getFlag( nFlags, BIFF12_PCDFSITEMS_HASNONDATE );
+ maSharedItemsModel.mbHasDate = getFlag( nFlags, BIFF12_PCDFSITEMS_HASDATE );
+ maSharedItemsModel.mbHasString = getFlag( nFlags, BIFF12_PCDFSITEMS_HASSTRING );
+ maSharedItemsModel.mbHasBlank = getFlag( nFlags, BIFF12_PCDFSITEMS_HASBLANK );
+ maSharedItemsModel.mbHasMixed = getFlag( nFlags, BIFF12_PCDFSITEMS_HASMIXED );
+ maSharedItemsModel.mbIsNumeric = getFlag( nFlags, BIFF12_PCDFSITEMS_ISNUMERIC );
+ maSharedItemsModel.mbIsInteger = getFlag( nFlags, BIFF12_PCDFSITEMS_ISINTEGER );
+ maSharedItemsModel.mbHasLongText = getFlag( nFlags, BIFF12_PCDFSITEMS_HASLONGTEXT );
}
-void PivotCacheField::importPCDFSharedItem( sal_Int32 nRecId, RecordInputStream& rStrm )
+void PivotCacheField::importPCDFSharedItem( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
maSharedItems.importItem( nRecId, rStrm );
}
-void PivotCacheField::importPCDFieldGroup( RecordInputStream& rStrm )
+void PivotCacheField::importPCDFieldGroup( SequenceInputStream& rStrm )
{
rStrm >> maFieldGroupModel.mnParentField >> maFieldGroupModel.mnBaseField;
}
-void PivotCacheField::importPCDFRangePr( RecordInputStream& rStrm )
+void PivotCacheField::importPCDFRangePr( SequenceInputStream& rStrm )
{
sal_uInt8 nGroupBy, nFlags;
rStrm >> nGroupBy >> nFlags >> maFieldGroupModel.mfStartValue >> maFieldGroupModel.mfEndValue >> maFieldGroupModel.mfInterval;
- maFieldGroupModel.setBinGroupBy( nGroupBy );
+ maFieldGroupModel.setBiffGroupBy( nGroupBy );
maFieldGroupModel.mbRangeGroup = true;
- maFieldGroupModel.mbDateGroup = getFlag( nFlags, OOBIN_PCDFRANGEPR_DATEGROUP );
- maFieldGroupModel.mbAutoStart = getFlag( nFlags, OOBIN_PCDFRANGEPR_AUTOSTART );
- maFieldGroupModel.mbAutoEnd = getFlag( nFlags, OOBIN_PCDFRANGEPR_AUTOEND );
+ maFieldGroupModel.mbDateGroup = getFlag( nFlags, BIFF12_PCDFRANGEPR_DATEGROUP );
+ maFieldGroupModel.mbAutoStart = getFlag( nFlags, BIFF12_PCDFRANGEPR_AUTOSTART );
+ maFieldGroupModel.mbAutoEnd = getFlag( nFlags, BIFF12_PCDFRANGEPR_AUTOEND );
OSL_ENSURE( maFieldGroupModel.mbDateGroup == (maFieldGroupModel.mnGroupBy != XML_range), "PivotCacheField::importPCDFRangePr - wrong date flag" );
if( maFieldGroupModel.mbDateGroup )
@@ -628,14 +624,14 @@ void PivotCacheField::importPCDFRangePr( RecordInputStream& rStrm )
}
}
-void PivotCacheField::importPCDFDiscretePrItem( sal_Int32 nRecId, RecordInputStream& rStrm )
+void PivotCacheField::importPCDFDiscretePrItem( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
- OSL_ENSURE( nRecId == OOBIN_ID_PCITEM_INDEX, "PivotCacheField::importPCDFDiscretePrItem - unexpected record" );
- if( nRecId == OOBIN_ID_PCITEM_INDEX )
+ OSL_ENSURE( nRecId == BIFF12_ID_PCITEM_INDEX, "PivotCacheField::importPCDFDiscretePrItem - unexpected record" );
+ if( nRecId == BIFF12_ID_PCITEM_INDEX )
maDiscreteItems.push_back( rStrm.readInt32() );
}
-void PivotCacheField::importPCDFGroupItem( sal_Int32 nRecId, RecordInputStream& rStrm )
+void PivotCacheField::importPCDFGroupItem( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
maGroupItems.importItem( nRecId, rStrm );
}
@@ -697,7 +693,7 @@ void PivotCacheField::importPCDFRangePr( BiffInputStream& rStrm )
{
sal_uInt16 nFlags;
rStrm >> nFlags;
- maFieldGroupModel.setBinGroupBy( extractValue< sal_uInt8 >( nFlags, 2, 3 ) );
+ maFieldGroupModel.setBiffGroupBy( extractValue< sal_uInt8 >( nFlags, 2, 3 ) );
maFieldGroupModel.mbRangeGroup = true;
maFieldGroupModel.mbDateGroup = maFieldGroupModel.mnGroupBy != XML_range;
maFieldGroupModel.mbAutoStart = getFlag( nFlags, BIFF_PCDFRANGEPR_AUTOSTART );
@@ -838,7 +834,7 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie
typedef ::std::vector< GroupItemList > GroupItemMap;
GroupItemMap aItemMap( maGroupItems.size() );
for( IndexVector::const_iterator aBeg = maDiscreteItems.begin(), aIt = aBeg, aEnd = maDiscreteItems.end(); aIt != aEnd; ++aIt )
- if( GroupItemList* pItems = ContainerHelper::getVectorElement( aItemMap, *aIt ) )
+ if( GroupItemList* pItems = ContainerHelper::getVectorElementAccess( aItemMap, *aIt ) )
pItems->push_back( static_cast< sal_Int32 >( aIt - aBeg ) );
// process all groups
@@ -925,7 +921,7 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie
}
// replace original item names in passed vector with group name
for( GroupItemList::iterator aIt2 = aIt->begin(), aEnd2 = aIt->end(); aIt2 != aEnd2; ++aIt2 )
- if( PivotCacheGroupItem* pName = ContainerHelper::getVectorElement( orItemNames, *aIt2 ) )
+ if( PivotCacheGroupItem* pName = ContainerHelper::getVectorElementAccess( orItemNames, *aIt2 ) )
pName->maGroupName = aGroupName;
}
}
@@ -954,7 +950,7 @@ void PivotCacheField::writeSourceDataCell( WorksheetHelper& rSheetHelper, sal_In
writeItemToSourceDataCell( rSheetHelper, nCol, nRow, rItem );
}
-void PivotCacheField::importPCRecordItem( RecordInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nCol, sal_Int32 nRow ) const
+void PivotCacheField::importPCRecordItem( SequenceInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nCol, sal_Int32 nRow ) const
{
if( hasSharedItems() )
{
@@ -1089,29 +1085,29 @@ void PivotCache::importWorksheetSource( const AttributeList& rAttribs, const Rel
getAddressConverter().convertToCellRangeUnchecked( maSheetSrcModel.maRange, rAttribs.getString( XML_ref, OUString() ), 0 );
}
-void PivotCache::importPCDefinition( RecordInputStream& rStrm )
+void PivotCache::importPCDefinition( SequenceInputStream& rStrm )
{
sal_uInt8 nFlags1, nFlags2;
rStrm.skip( 3 ); // create/refresh version id's
rStrm >> nFlags1 >> maDefModel.mnMissItemsLimit >> maDefModel.mfRefreshedDate >> nFlags2 >> maDefModel.mnRecords;
- if( getFlag( nFlags2, OOBIN_PCDEFINITION_HASUSERNAME ) )
+ if( getFlag( nFlags2, BIFF12_PCDEFINITION_HASUSERNAME ) )
rStrm >> maDefModel.maRefreshedBy;
- if( getFlag( nFlags2, OOBIN_PCDEFINITION_HASRELID ) )
+ if( getFlag( nFlags2, BIFF12_PCDEFINITION_HASRELID ) )
rStrm >> maDefModel.maRelId;
- maDefModel.mbInvalid = getFlag( nFlags1, OOBIN_PCDEFINITION_INVALID );
- maDefModel.mbSaveData = getFlag( nFlags1, OOBIN_PCDEFINITION_SAVEDATA );
- maDefModel.mbRefreshOnLoad = getFlag( nFlags1, OOBIN_PCDEFINITION_REFRESHONLOAD );
- maDefModel.mbOptimizeMemory = getFlag( nFlags1, OOBIN_PCDEFINITION_OPTIMIZEMEMORY );
- maDefModel.mbEnableRefresh = getFlag( nFlags1, OOBIN_PCDEFINITION_ENABLEREFRESH );
- maDefModel.mbBackgroundQuery = getFlag( nFlags1, OOBIN_PCDEFINITION_BACKGROUNDQUERY );
- maDefModel.mbUpgradeOnRefresh = getFlag( nFlags1, OOBIN_PCDEFINITION_UPGRADEONREFR );
- maDefModel.mbTupleCache = getFlag( nFlags1, OOBIN_PCDEFINITION_TUPELCACHE );
- maDefModel.mbSupportSubquery = getFlag( nFlags2, OOBIN_PCDEFINITION_SUPPORTSUBQUERY );
- maDefModel.mbSupportDrill = getFlag( nFlags2, OOBIN_PCDEFINITION_SUPPORTDRILL );
+ maDefModel.mbInvalid = getFlag( nFlags1, BIFF12_PCDEFINITION_INVALID );
+ maDefModel.mbSaveData = getFlag( nFlags1, BIFF12_PCDEFINITION_SAVEDATA );
+ maDefModel.mbRefreshOnLoad = getFlag( nFlags1, BIFF12_PCDEFINITION_REFRESHONLOAD );
+ maDefModel.mbOptimizeMemory = getFlag( nFlags1, BIFF12_PCDEFINITION_OPTIMIZEMEMORY );
+ maDefModel.mbEnableRefresh = getFlag( nFlags1, BIFF12_PCDEFINITION_ENABLEREFRESH );
+ maDefModel.mbBackgroundQuery = getFlag( nFlags1, BIFF12_PCDEFINITION_BACKGROUNDQUERY );
+ maDefModel.mbUpgradeOnRefresh = getFlag( nFlags1, BIFF12_PCDEFINITION_UPGRADEONREFR );
+ maDefModel.mbTupleCache = getFlag( nFlags1, BIFF12_PCDEFINITION_TUPELCACHE );
+ maDefModel.mbSupportSubquery = getFlag( nFlags2, BIFF12_PCDEFINITION_SUPPORTSUBQUERY );
+ maDefModel.mbSupportDrill = getFlag( nFlags2, BIFF12_PCDEFINITION_SUPPORTDRILL );
}
-void PivotCache::importPCDSource( RecordInputStream& rStrm )
+void PivotCache::importPCDSource( SequenceInputStream& rStrm )
{
sal_Int32 nSourceType;
rStrm >> nSourceType >> maSourceModel.mnConnectionId;
@@ -1119,13 +1115,13 @@ void PivotCache::importPCDSource( RecordInputStream& rStrm )
maSourceModel.mnSourceType = STATIC_ARRAY_SELECT( spnSourceTypes, nSourceType, XML_TOKEN_INVALID );
}
-void PivotCache::importPCDSheetSource( RecordInputStream& rStrm, const Relations& rRelations )
+void PivotCache::importPCDSheetSource( SequenceInputStream& rStrm, const Relations& rRelations )
{
sal_uInt8 nIsDefName, nIsBuiltinName, nFlags;
rStrm >> nIsDefName >> nIsBuiltinName >> nFlags;
- if( getFlag( nFlags, OOBIN_PCDWBSOURCE_HASSHEET ) )
+ if( getFlag( nFlags, BIFF12_PCDWBSOURCE_HASSHEET ) )
rStrm >> maSheetSrcModel.maSheet;
- if( getFlag( nFlags, OOBIN_PCDWBSOURCE_HASRELID ) )
+ if( getFlag( nFlags, BIFF12_PCDWBSOURCE_HASRELID ) )
rStrm >> maSheetSrcModel.maRelId;
// read cell range or defined name
@@ -1269,7 +1265,7 @@ const PivotCacheField* PivotCache::getCacheField( sal_Int32 nFieldIdx ) const
sal_Int32 PivotCache::getCacheDatabaseIndex( sal_Int32 nFieldIdx ) const
{
- return ContainerHelper::getVectorElement< sal_Int32 >( maDatabaseIndexes, nFieldIdx, -1 );
+ return ContainerHelper::getVectorElement( maDatabaseIndexes, nFieldIdx, -1 );
}
void PivotCache::writeSourceHeaderCells( WorksheetHelper& rSheetHelper ) const
@@ -1291,7 +1287,7 @@ void PivotCache::writeSourceDataCell( WorksheetHelper& rSheetHelper, sal_Int32 n
pCacheField->writeSourceDataCell( rSheetHelper, maSheetSrcModel.maRange.StartColumn + nCol, maSheetSrcModel.maRange.StartRow + nRow, rItem );
}
-void PivotCache::importPCRecord( RecordInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const
+void PivotCache::importPCRecord( SequenceInputStream& rStrm, WorksheetHelper& rSheetHelper, sal_Int32 nRow ) const
{
OSL_ENSURE( (0 < nRow) && (nRow <= maSheetSrcModel.maRange.EndRow - maSheetSrcModel.maRange.StartRow), "PivotCache::importPCRecord - invalid row index" );
sal_Int32 nCol = maSheetSrcModel.maRange.StartColumn;
@@ -1412,7 +1408,7 @@ void PivotCache::finalizeExternalSheetSource()
{
/* If pivot cache is based on external sheet data, try to restore sheet
data from cache records. No support for external defined names or tables,
- sheet name and path to cache records fragment (OOX only) are required. */
+ sheet name and path to cache records fragment (OOXML only) are required. */
bool bHasRelation = (getFilterType() == FILTER_BIFF) || (maDefModel.maRelId.getLength() > 0);
if( bHasRelation && (maSheetSrcModel.maDefName.getLength() == 0) && (maSheetSrcModel.maSheet.getLength() > 0) )
prepareSourceDataSheet();
@@ -1472,6 +1468,29 @@ PivotCache* PivotCacheBuffer::importPivotCacheFragment( sal_Int32 nCacheId )
{
switch( getFilterType() )
{
+ /* OOXML/BIFF12 filter: On first call for the cache ID, the pivot
+ cache object is created and inserted into maCaches. Then, the cache
+ definition fragment is read and the cache is returned. On
+ subsequent calls, the created cache will be found in maCaches and
+ returned immediately. */
+ case FILTER_OOXML:
+ {
+ // try to find an imported pivot cache
+ if( PivotCache* pCache = maCaches.get( nCacheId ).get() )
+ return pCache;
+
+ // check if a fragment path exists for the passed cache identifier
+ FragmentPathMap::iterator aIt = maFragmentPaths.find( nCacheId );
+ if( aIt == maFragmentPaths.end() )
+ return 0;
+
+ /* Import the cache fragment. This may create a dummy data sheet
+ for external sheet sources. */
+ PivotCache& rCache = createPivotCache( nCacheId );
+ importOoxFragment( new PivotCacheDefinitionFragment( *this, aIt->second, rCache ) );
+ return &rCache;
+ }
+
/* BIFF filter: Pivot table provides 0-based index into list of pivot
cache source links (PIVOTCACHE/PCDSOURCE/... record blocks in
workbook stream). First, this index has to be resolved to the cache
@@ -1486,7 +1505,7 @@ PivotCache* PivotCacheBuffer::importPivotCacheFragment( sal_Int32 nCacheId )
{
/* Resolve cache index to cache identifier and try to find pivot
cache. Cache must exist already for a valid cache index. */
- nCacheId = ContainerHelper::getVectorElement< sal_Int32 >( maCacheIds, nCacheId, -1 );
+ nCacheId = ContainerHelper::getVectorElement( maCacheIds, nCacheId, -1 );
PivotCache* pCache = maCaches.get( nCacheId ).get();
if( !pCache )
return 0;
@@ -1505,29 +1524,6 @@ PivotCache* PivotCacheBuffer::importPivotCacheFragment( sal_Int32 nCacheId )
return pCache;
}
- /* OOX/OOBIN filter: On first call for the cache ID, the pivot cache
- object is created and inserted into maCaches. Then, the cache
- definition fragment is read and the cache is returned. On
- subsequent calls, the created cache will be found in maCaches and
- returned immediately. */
- case FILTER_OOX:
- {
- // try to find an imported pivot cache
- if( PivotCache* pCache = maCaches.get( nCacheId ).get() )
- return pCache;
-
- // check if a fragment path exists for the passed cache identifier
- FragmentPathMap::iterator aIt = maFragmentPaths.find( nCacheId );
- if( aIt == maFragmentPaths.end() )
- return 0;
-
- /* Import the cache fragment. This may create a dummy data sheet
- for external sheet sources. */
- PivotCache& rCache = createPivotCache( nCacheId );
- importOoxFragment( new OoxPivotCacheDefinitionFragment( *this, aIt->second, rCache ) );
- return &rCache;
- }
-
case FILTER_UNKNOWN:
OSL_ENSURE( false, "PivotCacheBuffer::importPivotCacheFragment - unknown filter type" );
}
@@ -1547,4 +1543,4 @@ PivotCache& PivotCacheBuffer::createPivotCache( sal_Int32 nCacheId )
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/pivotcachefragment.cxx b/oox/source/xls/pivotcachefragment.cxx
index 9800ebb6e567..05ad2c9c919a 100644
--- a/oox/source/xls/pivotcachefragment.cxx
+++ b/oox/source/xls/pivotcachefragment.cxx
@@ -27,29 +27,31 @@
************************************************************************/
#include "oox/xls/pivotcachefragment.hxx"
+
#include "oox/helper/attributelist.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/pivotcachebuffer.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
-
namespace oox {
namespace xls {
// ============================================================================
-OoxPivotCacheFieldContext::OoxPivotCacheFieldContext( OoxWorkbookFragmentBase& rFragment, PivotCacheField& rCacheField ) :
- OoxWorkbookContextBase( rFragment ),
+using namespace ::com::sun::star::uno;
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+PivotCacheFieldContext::PivotCacheFieldContext( WorkbookFragmentBase& rFragment, PivotCacheField& rCacheField ) :
+ WorkbookContextBase( rFragment ),
mrCacheField( rCacheField )
{
}
-ContextHandlerRef OoxPivotCacheFieldContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotCacheFieldContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -74,41 +76,41 @@ ContextHandlerRef OoxPivotCacheFieldContext::onCreateContext( sal_Int32 nElement
return 0;
}
-void OoxPivotCacheFieldContext::onStartElement( const AttributeList& rAttribs )
+void PivotCacheFieldContext::onStartElement( const AttributeList& rAttribs )
{
if( isRootElement() )
mrCacheField.importCacheField( rAttribs );
}
-ContextHandlerRef OoxPivotCacheFieldContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotCacheFieldContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_PCDFIELD:
+ case BIFF12_ID_PCDFIELD:
switch( nRecId )
{
- case OOBIN_ID_PCDFSHAREDITEMS: mrCacheField.importPCDFSharedItems( rStrm ); return this;
- case OOBIN_ID_PCDFIELDGROUP: mrCacheField.importPCDFieldGroup( rStrm ); return this;
+ case BIFF12_ID_PCDFSHAREDITEMS: mrCacheField.importPCDFSharedItems( rStrm ); return this;
+ case BIFF12_ID_PCDFIELDGROUP: mrCacheField.importPCDFieldGroup( rStrm ); return this;
}
break;
- case OOBIN_ID_PCDFIELDGROUP:
+ case BIFF12_ID_PCDFIELDGROUP:
switch( nRecId )
{
- case OOBIN_ID_PCDFRANGEPR: mrCacheField.importPCDFRangePr( rStrm ); break;
- case OOBIN_ID_PCDFDISCRETEPR: return this;
- case OOBIN_ID_PCDFGROUPITEMS: return this;
+ case BIFF12_ID_PCDFRANGEPR: mrCacheField.importPCDFRangePr( rStrm ); break;
+ case BIFF12_ID_PCDFDISCRETEPR: return this;
+ case BIFF12_ID_PCDFGROUPITEMS: return this;
}
break;
- case OOBIN_ID_PCDFSHAREDITEMS: mrCacheField.importPCDFSharedItem( nRecId, rStrm ); break;
- case OOBIN_ID_PCDFDISCRETEPR: mrCacheField.importPCDFDiscretePrItem( nRecId, rStrm ); break;
- case OOBIN_ID_PCDFGROUPITEMS: mrCacheField.importPCDFGroupItem( nRecId, rStrm ); break;
+ case BIFF12_ID_PCDFSHAREDITEMS: mrCacheField.importPCDFSharedItem( nRecId, rStrm ); break;
+ case BIFF12_ID_PCDFDISCRETEPR: mrCacheField.importPCDFDiscretePrItem( nRecId, rStrm ); break;
+ case BIFF12_ID_PCDFGROUPITEMS: mrCacheField.importPCDFGroupItem( nRecId, rStrm ); break;
}
return 0;
}
-void OoxPivotCacheFieldContext::onStartRecord( RecordInputStream& rStrm )
+void PivotCacheFieldContext::onStartRecord( SequenceInputStream& rStrm )
{
if( isRootElement() )
mrCacheField.importPCDField( rStrm );
@@ -116,14 +118,14 @@ void OoxPivotCacheFieldContext::onStartRecord( RecordInputStream& rStrm )
// ============================================================================
-OoxPivotCacheDefinitionFragment::OoxPivotCacheDefinitionFragment(
+PivotCacheDefinitionFragment::PivotCacheDefinitionFragment(
const WorkbookHelper& rHelper, const OUString& rFragmentPath, PivotCache& rPivotCache ) :
- OoxWorkbookFragmentBase( rHelper, rFragmentPath ),
+ WorkbookFragmentBase( rHelper, rFragmentPath ),
mrPivotCache( rPivotCache )
{
}
-ContextHandlerRef OoxPivotCacheDefinitionFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotCacheDefinitionFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -144,60 +146,60 @@ ContextHandlerRef OoxPivotCacheDefinitionFragment::onCreateContext( sal_Int32 nE
break;
case XLS_TOKEN( cacheFields ):
- if( nElement == XLS_TOKEN( cacheField ) ) return new OoxPivotCacheFieldContext( *this, mrPivotCache.createCacheField() );
+ if( nElement == XLS_TOKEN( cacheField ) ) return new PivotCacheFieldContext( *this, mrPivotCache.createCacheField() );
break;
}
return 0;
}
-ContextHandlerRef OoxPivotCacheDefinitionFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotCacheDefinitionFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_PCDEFINITION ) { mrPivotCache.importPCDefinition( rStrm ); return this; }
+ if( nRecId == BIFF12_ID_PCDEFINITION ) { mrPivotCache.importPCDefinition( rStrm ); return this; }
break;
- case OOBIN_ID_PCDEFINITION:
+ case BIFF12_ID_PCDEFINITION:
switch( nRecId )
{
- case OOBIN_ID_PCDSOURCE: mrPivotCache.importPCDSource( rStrm ); return this;
- case OOBIN_ID_PCDFIELDS: return this;
+ case BIFF12_ID_PCDSOURCE: mrPivotCache.importPCDSource( rStrm ); return this;
+ case BIFF12_ID_PCDFIELDS: return this;
}
break;
- case OOBIN_ID_PCDSOURCE:
- if( nRecId == OOBIN_ID_PCDSHEETSOURCE ) mrPivotCache.importPCDSheetSource( rStrm, getRelations() );
+ case BIFF12_ID_PCDSOURCE:
+ if( nRecId == BIFF12_ID_PCDSHEETSOURCE ) mrPivotCache.importPCDSheetSource( rStrm, getRelations() );
break;
- case OOBIN_ID_PCDFIELDS:
- if( nRecId == OOBIN_ID_PCDFIELD ) return new OoxPivotCacheFieldContext( *this, mrPivotCache.createCacheField() );
+ case BIFF12_ID_PCDFIELDS:
+ if( nRecId == BIFF12_ID_PCDFIELD ) return new PivotCacheFieldContext( *this, mrPivotCache.createCacheField() );
break;
}
return 0;
}
-const RecordInfo* OoxPivotCacheDefinitionFragment::getRecordInfos() const
+const RecordInfo* PivotCacheDefinitionFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_PCDEFINITION, OOBIN_ID_PCDEFINITION + 1 },
- { OOBIN_ID_PCDFDISCRETEPR, OOBIN_ID_PCDFDISCRETEPR + 1 },
- { OOBIN_ID_PCDFGROUPITEMS, OOBIN_ID_PCDFGROUPITEMS + 1 },
- { OOBIN_ID_PCDFIELD, OOBIN_ID_PCDFIELD + 1 },
- { OOBIN_ID_PCDFIELDGROUP, OOBIN_ID_PCDFIELDGROUP + 1 },
- { OOBIN_ID_PCDFIELDS, OOBIN_ID_PCDFIELDS + 1 },
- { OOBIN_ID_PCDFRANGEPR, OOBIN_ID_PCDFRANGEPR + 1 },
- { OOBIN_ID_PCDFSHAREDITEMS, OOBIN_ID_PCDFSHAREDITEMS + 1 },
- { OOBIN_ID_PCITEM_ARRAY, OOBIN_ID_PCITEM_ARRAY + 1 },
- { OOBIN_ID_PCDSHEETSOURCE, OOBIN_ID_PCDSHEETSOURCE + 1 },
- { OOBIN_ID_PCDSOURCE, OOBIN_ID_PCDSOURCE + 1 },
- { -1, -1 }
+ { BIFF12_ID_PCDEFINITION, BIFF12_ID_PCDEFINITION + 1 },
+ { BIFF12_ID_PCDFDISCRETEPR, BIFF12_ID_PCDFDISCRETEPR + 1 },
+ { BIFF12_ID_PCDFGROUPITEMS, BIFF12_ID_PCDFGROUPITEMS + 1 },
+ { BIFF12_ID_PCDFIELD, BIFF12_ID_PCDFIELD + 1 },
+ { BIFF12_ID_PCDFIELDGROUP, BIFF12_ID_PCDFIELDGROUP + 1 },
+ { BIFF12_ID_PCDFIELDS, BIFF12_ID_PCDFIELDS + 1 },
+ { BIFF12_ID_PCDFRANGEPR, BIFF12_ID_PCDFRANGEPR + 1 },
+ { BIFF12_ID_PCDFSHAREDITEMS, BIFF12_ID_PCDFSHAREDITEMS + 1 },
+ { BIFF12_ID_PCITEM_ARRAY, BIFF12_ID_PCITEM_ARRAY + 1 },
+ { BIFF12_ID_PCDSHEETSOURCE, BIFF12_ID_PCDSHEETSOURCE + 1 },
+ { BIFF12_ID_PCDSOURCE, BIFF12_ID_PCDSOURCE + 1 },
+ { -1, -1 }
};
return spRecInfos;
}
-void OoxPivotCacheDefinitionFragment::finalizeImport()
+void PivotCacheDefinitionFragment::finalizeImport()
{
// finalize the cache (check source range etc.)
mrPivotCache.finalizeImport();
@@ -207,15 +209,15 @@ void OoxPivotCacheDefinitionFragment::finalizeImport()
{
OUString aRecFragmentPath = getRelations().getFragmentPathFromRelId( mrPivotCache.getRecordsRelId() );
if( aRecFragmentPath.getLength() > 0 )
- importOoxFragment( new OoxPivotCacheRecordsFragment( *this, aRecFragmentPath, mrPivotCache ) );
+ importOoxFragment( new PivotCacheRecordsFragment( *this, aRecFragmentPath, mrPivotCache ) );
}
}
// ============================================================================
-OoxPivotCacheRecordsFragment::OoxPivotCacheRecordsFragment( const WorkbookHelper& rHelper,
+PivotCacheRecordsFragment::PivotCacheRecordsFragment( const WorkbookHelper& rHelper,
const OUString& rFragmentPath, const PivotCache& rPivotCache ) :
- OoxWorksheetFragmentBase( rHelper, rFragmentPath, ISegmentProgressBarRef(), SHEETTYPE_WORKSHEET, rPivotCache.getSourceRange().Sheet ),
+ WorksheetFragmentBase( rHelper, rFragmentPath, ISegmentProgressBarRef(), SHEETTYPE_WORKSHEET, rPivotCache.getSourceRange().Sheet ),
mrPivotCache( rPivotCache ),
mnCol( 0 ),
mnRow( 0 ),
@@ -225,7 +227,7 @@ OoxPivotCacheRecordsFragment::OoxPivotCacheRecordsFragment( const WorkbookHelper
rPivotCache.writeSourceHeaderCells( *this );
}
-ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotCacheRecordsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -249,7 +251,7 @@ ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateContext( sal_Int32 nElem
case XLS_TOKEN( b ): aItem.readBool( rAttribs ); break;
case XLS_TOKEN( e ): aItem.readError( rAttribs, getUnitConverter() ); break;
case XLS_TOKEN( x ): aItem.readIndex( rAttribs ); break;
- default: OSL_ENSURE( false, "OoxPivotCacheRecordsFragment::onCreateContext - unexpected element" );
+ default: OSL_ENSURE( false, "PivotCacheRecordsFragment::onCreateContext - unexpected element" );
}
mrPivotCache.writeSourceDataCell( *this, mnCol, mnRow, aItem );
++mnCol;
@@ -259,19 +261,19 @@ ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateContext( sal_Int32 nElem
return 0;
}
-ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotCacheRecordsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_PCRECORDS ) return this;
+ if( nRecId == BIFF12_ID_PCRECORDS ) return this;
break;
- case OOBIN_ID_PCRECORDS:
+ case BIFF12_ID_PCRECORDS:
switch( nRecId )
{
- case OOBIN_ID_PCRECORD: importPCRecord( rStrm ); break;
- case OOBIN_ID_PCRECORDDT: startCacheRecord(); break;
+ case BIFF12_ID_PCRECORD: importPCRecord( rStrm ); break;
+ case BIFF12_ID_PCRECORDDT: startCacheRecord(); break;
default: importPCRecordItem( nRecId, rStrm ); break;
}
break;
@@ -279,11 +281,11 @@ ContextHandlerRef OoxPivotCacheRecordsFragment::onCreateRecordContext( sal_Int32
return 0;
}
-const RecordInfo* OoxPivotCacheRecordsFragment::getRecordInfos() const
+const RecordInfo* PivotCacheRecordsFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_PCRECORDS, OOBIN_ID_PCRECORDS + 1 },
+ { BIFF12_ID_PCRECORDS, BIFF12_ID_PCRECORDS + 1 },
{ -1, -1 }
};
return spRecInfos;
@@ -291,35 +293,35 @@ const RecordInfo* OoxPivotCacheRecordsFragment::getRecordInfos() const
// private --------------------------------------------------------------------
-void OoxPivotCacheRecordsFragment::startCacheRecord()
+void PivotCacheRecordsFragment::startCacheRecord()
{
mnCol = 0;
++mnRow;
mbInRecord = true;
}
-void OoxPivotCacheRecordsFragment::importPCRecord( RecordInputStream& rStrm )
+void PivotCacheRecordsFragment::importPCRecord( SequenceInputStream& rStrm )
{
startCacheRecord();
mrPivotCache.importPCRecord( rStrm, *this, mnRow );
mbInRecord = false;
}
-void OoxPivotCacheRecordsFragment::importPCRecordItem( sal_Int32 nRecId, RecordInputStream& rStrm )
+void PivotCacheRecordsFragment::importPCRecordItem( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
if( mbInRecord )
{
PivotCacheItem aItem;
switch( nRecId )
{
- case OOBIN_ID_PCITEM_MISSING: break;
- case OOBIN_ID_PCITEM_STRING: aItem.readString( rStrm ); break;
- case OOBIN_ID_PCITEM_DOUBLE: aItem.readDouble( rStrm ); break;
- case OOBIN_ID_PCITEM_DATE: aItem.readDate( rStrm ); break;
- case OOBIN_ID_PCITEM_BOOL: aItem.readBool( rStrm ); break;
- case OOBIN_ID_PCITEM_ERROR: aItem.readError( rStrm ); break;
- case OOBIN_ID_PCITEM_INDEX: aItem.readIndex( rStrm ); break;
- default: OSL_ENSURE( false, "OoxPivotCacheRecordsFragment::importPCRecordItem - unexpected record" );
+ case BIFF12_ID_PCITEM_MISSING: break;
+ case BIFF12_ID_PCITEM_STRING: aItem.readString( rStrm ); break;
+ case BIFF12_ID_PCITEM_DOUBLE: aItem.readDouble( rStrm ); break;
+ case BIFF12_ID_PCITEM_DATE: aItem.readDate( rStrm ); break;
+ case BIFF12_ID_PCITEM_BOOL: aItem.readBool( rStrm ); break;
+ case BIFF12_ID_PCITEM_ERROR: aItem.readError( rStrm ); break;
+ case BIFF12_ID_PCITEM_INDEX: aItem.readIndex( rStrm ); break;
+ default: OSL_ENSURE( false, "PivotCacheRecordsFragment::importPCRecordItem - unexpected record" );
}
mrPivotCache.writeSourceDataCell( *this, mnCol, mnRow, aItem );
++mnCol;
@@ -346,7 +348,7 @@ bool lclSeekToPCDField( BiffInputStream& rStrm )
// ----------------------------------------------------------------------------
BiffPivotCacheFragment::BiffPivotCacheFragment(
- const WorkbookHelper& rHelper, const ::rtl::OUString& rStrmName, PivotCache& rPivotCache ) :
+ const WorkbookHelper& rHelper, const OUString& rStrmName, PivotCache& rPivotCache ) :
BiffWorkbookFragmentBase( rHelper, rStrmName, true ),
mrPivotCache( rPivotCache )
{
@@ -354,14 +356,15 @@ BiffPivotCacheFragment::BiffPivotCacheFragment(
bool BiffPivotCacheFragment::importFragment()
{
- if( mrStrm.startNextRecord() && (mrStrm.getRecId() == BIFF_ID_PCDEFINITION) )
+ BiffInputStream& rStrm = getInputStream();
+ if( rStrm.startNextRecord() && (rStrm.getRecId() == BIFF_ID_PCDEFINITION) )
{
// read PCDEFINITION and optional PCDEFINITION2 records
- mrPivotCache.importPCDefinition( mrStrm );
+ mrPivotCache.importPCDefinition( rStrm );
// read cache fields as long as another PCDFIELD record can be found
- while( lclSeekToPCDField( mrStrm ) )
- mrPivotCache.createCacheField( true ).importPCDField( mrStrm );
+ while( lclSeekToPCDField( rStrm ) )
+ mrPivotCache.createCacheField( true ).importPCDField( rStrm );
// finalize the cache (check source range etc.)
mrPivotCache.finalizeImport();
@@ -373,19 +376,18 @@ bool BiffPivotCacheFragment::importFragment()
unchanged. Stream should point to source data table now. */
BiffPivotCacheRecordsContext aContext( *this, mrPivotCache );
if( aContext.isValidSheet() )
- while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
- aContext.importRecord();
+ while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
+ aContext.importRecord( rStrm );
}
}
- return mrStrm.getRecId() == BIFF_ID_EOF;
+ return rStrm.getRecId() == BIFF_ID_EOF;
}
// ============================================================================
-BiffPivotCacheRecordsContext::BiffPivotCacheRecordsContext(
- const BiffWorkbookFragmentBase& rFragment, const PivotCache& rPivotCache ) :
- BiffWorksheetContextBase( rFragment, ISegmentProgressBarRef(), SHEETTYPE_WORKSHEET, rPivotCache.getSourceRange().Sheet ),
+BiffPivotCacheRecordsContext::BiffPivotCacheRecordsContext( const WorkbookHelper& rHelper, const PivotCache& rPivotCache ) :
+ BiffWorksheetContextBase( rHelper, ISegmentProgressBarRef(), SHEETTYPE_WORKSHEET, rPivotCache.getSourceRange().Sheet ),
mrPivotCache( rPivotCache ),
mnColIdx( 0 ),
mnRow( 0 ),
@@ -410,28 +412,28 @@ BiffPivotCacheRecordsContext::BiffPivotCacheRecordsContext(
}
}
-void BiffPivotCacheRecordsContext::importRecord()
+void BiffPivotCacheRecordsContext::importRecord( BiffInputStream& rStrm )
{
- if( mrStrm.getRecId() == BIFF_ID_PCITEM_INDEXLIST )
+ if( rStrm.getRecId() == BIFF_ID_PCITEM_INDEXLIST )
{
OSL_ENSURE( mbHasShared, "BiffPivotCacheRecordsContext::importRecord - unexpected PCITEM_INDEXLIST record" );
// PCITEM_INDEXLIST record always in front of a new data row
startNextRow();
- mrPivotCache.importPCItemIndexList( mrStrm, *this, mnRow );
+ mrPivotCache.importPCItemIndexList( rStrm, *this, mnRow );
mbInRow = !maUnsharedCols.empty(); // mbInRow remains true, if unshared items are expected
return;
}
PivotCacheItem aItem;
- switch( mrStrm.getRecId() )
+ switch( rStrm.getRecId() )
{
case BIFF_ID_PCITEM_MISSING: break;
- case BIFF_ID_PCITEM_STRING: aItem.readString( mrStrm, *this ); break;
- case BIFF_ID_PCITEM_DOUBLE: aItem.readDouble( mrStrm ); break;
- case BIFF_ID_PCITEM_INTEGER: aItem.readInteger( mrStrm ); break;
- case BIFF_ID_PCITEM_DATE: aItem.readDate( mrStrm ); break;
- case BIFF_ID_PCITEM_BOOL: aItem.readBool( mrStrm ); break;
- case BIFF_ID_PCITEM_ERROR: aItem.readError( mrStrm ); break;
+ case BIFF_ID_PCITEM_STRING: aItem.readString( rStrm, *this ); break;
+ case BIFF_ID_PCITEM_DOUBLE: aItem.readDouble( rStrm ); break;
+ case BIFF_ID_PCITEM_INTEGER: aItem.readInteger( rStrm ); break;
+ case BIFF_ID_PCITEM_DATE: aItem.readDate( rStrm ); break;
+ case BIFF_ID_PCITEM_BOOL: aItem.readBool( rStrm ); break;
+ case BIFF_ID_PCITEM_ERROR: aItem.readError( rStrm ); break;
default: return; // unknown record, ignore
}
@@ -464,4 +466,4 @@ void BiffPivotCacheRecordsContext::startNextRow()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/pivottablebuffer.cxx b/oox/source/xls/pivottablebuffer.cxx
index 2a6ce43a2484..ff04af3a6fc7 100644
--- a/oox/source/xls/pivottablebuffer.cxx
+++ b/oox/source/xls/pivottablebuffer.cxx
@@ -27,6 +27,7 @@
************************************************************************/
#include "oox/xls/pivottablebuffer.hxx"
+
#include <set>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -46,37 +47,26 @@
#include <com/sun/star/sheet/XDataPilotField.hpp>
#include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp>
#include <com/sun/star/sheet/XSheetOperation.hpp>
-#include "properties.hxx"
#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::sheet::DataPilotFieldOrientation;
-using ::com::sun::star::sheet::XDataPilotDataLayoutFieldSupplier;
-using ::com::sun::star::sheet::XDataPilotDescriptor;
-using ::com::sun::star::sheet::XDataPilotField;
-using ::com::sun::star::sheet::XDataPilotTables;
-using ::com::sun::star::sheet::XDataPilotTablesSupplier;
-using ::com::sun::star::sheet::XSheetOperation;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
const sal_Int32 OOX_PT_DATALAYOUTFIELD = -2; /// Placeholder index of data layout field.
@@ -86,83 +76,90 @@ const sal_Int32 OOX_PT_NEXT_ITEM = 0x001000FD; /// Calculat
// ----------------------------------------------------------------------------
-const sal_uInt32 OOBIN_PTFIELD_DATAFIELD = 0x00000008;
-const sal_uInt32 OOBIN_PTFIELD_DEFAULT = 0x00000100;
-const sal_uInt32 OOBIN_PTFIELD_SUM = 0x00000200;
-const sal_uInt32 OOBIN_PTFIELD_COUNTA = 0x00000400;
-const sal_uInt32 OOBIN_PTFIELD_AVERAGE = 0x00000800;
-const sal_uInt32 OOBIN_PTFIELD_MAX = 0x00001000;
-const sal_uInt32 OOBIN_PTFIELD_MIN = 0x00002000;
-const sal_uInt32 OOBIN_PTFIELD_PRODUCT = 0x00004000;
-const sal_uInt32 OOBIN_PTFIELD_COUNT = 0x00008000;
-const sal_uInt32 OOBIN_PTFIELD_STDDEV = 0x00010000;
-const sal_uInt32 OOBIN_PTFIELD_STDDEVP = 0x00020000;
-const sal_uInt32 OOBIN_PTFIELD_VAR = 0x00040000;
-const sal_uInt32 OOBIN_PTFIELD_VARP = 0x00080000;
-
-const sal_uInt32 OOBIN_PTFIELD_SHOWALL = 0x00000020;
-const sal_uInt32 OOBIN_PTFIELD_OUTLINE = 0x00000040;
-const sal_uInt32 OOBIN_PTFIELD_INSERTBLANKROW = 0x00000080;
-const sal_uInt32 OOBIN_PTFIELD_SUBTOTALTOP = 0x00000100;
-const sal_uInt32 OOBIN_PTFIELD_INSERTPAGEBREAK = 0x00000800;
-const sal_uInt32 OOBIN_PTFIELD_AUTOSORT = 0x00001000;
-const sal_uInt32 OOBIN_PTFIELD_SORTASCENDING = 0x00002000;
-const sal_uInt32 OOBIN_PTFIELD_AUTOSHOW = 0x00004000;
-const sal_uInt32 OOBIN_PTFIELD_AUTOSHOWTOP = 0x00008000;
-const sal_uInt32 OOBIN_PTFIELD_MULTIPAGEITEMS = 0x00080000;
-
-const sal_uInt16 OOBIN_PTFITEM_HIDDEN = 0x0001;
-const sal_uInt16 OOBIN_PTFITEM_HIDEDETAILS = 0x0002;
-
-const sal_uInt8 OOBIN_PTPAGEFIELD_HASNAME = 0x01;
-const sal_uInt8 OOBIN_PTPAGEFIELD_HASOLAPCAPTION = 0x02;
-const sal_Int32 OOBIN_PTPAGEFIELD_MULTIITEMS = 0x001000FE;
-
-const sal_uInt16 OOBIN_PTFILTER_HASNAME = 0x0001;
-const sal_uInt16 OOBIN_PTFILTER_HASDESCRIPTION = 0x0002;
-const sal_uInt16 OOBIN_PTFILTER_HASSTRVALUE1 = 0x0004;
-const sal_uInt16 OOBIN_PTFILTER_HASSTRVALUE2 = 0x0008;
-
-const sal_uInt8 OOBIN_TOP10FILTER_TOP = 0x01;
-const sal_uInt8 OOBIN_TOP10FILTER_PERCENT = 0x02;
-
-const sal_uInt32 OOBIN_PTDEF_SHOWITEMS = 0x00000100;
-const sal_uInt32 OOBIN_PTDEF_DISABLEFIELDLIST = 0x00000400;
-const sal_uInt32 OOBIN_PTDEF_HIDECALCMEMBERS = 0x00001000;
-const sal_uInt32 OOBIN_PTDEF_WITHHIDDENTOTALS = 0x00002000;
-const sal_uInt32 OOBIN_PTDEF_HIDEDRILL = 0x00100000;
-const sal_uInt32 OOBIN_PTDEF_PRINTDRILL = 0x00200000;
-const sal_uInt32 OOBIN_PTDEF_HIDEHEADERS = 0x80000000;
-
-const sal_uInt32 OOBIN_PTDEF_SHOWEMPTYROW = 0x00000004;
-const sal_uInt32 OOBIN_PTDEF_SHOWEMPTYCOL = 0x00000008;
-const sal_uInt32 OOBIN_PTDEF_ENABLEDRILL = 0x00000020;
-const sal_uInt32 OOBIN_PTDEF_PRESERVEFORMATTING = 0x00000080;
-const sal_uInt32 OOBIN_PTDEF_SHOWERROR = 0x00000200;
-const sal_uInt32 OOBIN_PTDEF_SHOWMISSING = 0x00000400;
-const sal_uInt32 OOBIN_PTDEF_PAGEOVERTHENDOWN = 0x00000800;
-const sal_uInt32 OOBIN_PTDEF_SUBTOTALHIDDENITEMS = 0x00001000;
-const sal_uInt32 OOBIN_PTDEF_ROWGRANDTOTALS = 0x00002000;
-const sal_uInt32 OOBIN_PTDEF_COLGRANDTOTALS = 0x00004000;
-const sal_uInt32 OOBIN_PTDEF_FIELDPRINTTITLES = 0x00008000;
-const sal_uInt32 OOBIN_PTDEF_ITEMPRINTTITLES = 0x00020000;
-const sal_uInt32 OOBIN_PTDEF_MERGEITEM = 0x00040000;
-const sal_uInt32 OOBIN_PTDEF_HASDATACAPTION = 0x00080000;
-const sal_uInt32 OOBIN_PTDEF_HASGRANDTOTALCAPTION = 0x00100000;
-const sal_uInt32 OOBIN_PTDEF_HASPAGESTYLE = 0x00200000;
-const sal_uInt32 OOBIN_PTDEF_HASPIVOTTABLESTYLE = 0x00400000;
-const sal_uInt32 OOBIN_PTDEF_HASVACATEDSTYLE = 0x00800000;
-const sal_uInt32 OOBIN_PTDEF_HASTAG = 0x40000000;
-
-const sal_uInt32 OOBIN_PTDEF_NOERRORCAPTION = 0x00000040;
-const sal_uInt32 OOBIN_PTDEF_NOMISSINGCAPTION = 0x00000080;
-const sal_uInt32 OOBIN_PTDEF_HASROWHEADERCAPTION = 0x00000400;
-const sal_uInt32 OOBIN_PTDEF_HASCOLHEADERCAPTION = 0x00000800;
-const sal_uInt32 OOBIN_PTDEF_FIELDLISTSORTASC = 0x00001000;
-const sal_uInt32 OOBIN_PTDEF_NOCUSTOMLISTSORT = 0x00004000;
-
-const sal_uInt8 OOBIN_PTDEF_ROWAXIS = 1;
-const sal_uInt8 OOBIN_PTDEF_COLAXIS = 2;
+const sal_uInt32 BIFF12_PTFIELD_DATAFIELD = 0x00000008;
+const sal_uInt32 BIFF12_PTFIELD_DEFAULT = 0x00000100;
+const sal_uInt32 BIFF12_PTFIELD_SUM = 0x00000200;
+const sal_uInt32 BIFF12_PTFIELD_COUNTA = 0x00000400;
+const sal_uInt32 BIFF12_PTFIELD_AVERAGE = 0x00000800;
+const sal_uInt32 BIFF12_PTFIELD_MAX = 0x00001000;
+const sal_uInt32 BIFF12_PTFIELD_MIN = 0x00002000;
+const sal_uInt32 BIFF12_PTFIELD_PRODUCT = 0x00004000;
+const sal_uInt32 BIFF12_PTFIELD_COUNT = 0x00008000;
+const sal_uInt32 BIFF12_PTFIELD_STDDEV = 0x00010000;
+const sal_uInt32 BIFF12_PTFIELD_STDDEVP = 0x00020000;
+const sal_uInt32 BIFF12_PTFIELD_VAR = 0x00040000;
+const sal_uInt32 BIFF12_PTFIELD_VARP = 0x00080000;
+
+const sal_uInt32 BIFF12_PTFIELD_SHOWALL = 0x00000020;
+const sal_uInt32 BIFF12_PTFIELD_OUTLINE = 0x00000040;
+const sal_uInt32 BIFF12_PTFIELD_INSERTBLANKROW = 0x00000080;
+const sal_uInt32 BIFF12_PTFIELD_SUBTOTALTOP = 0x00000100;
+const sal_uInt32 BIFF12_PTFIELD_INSERTPAGEBREAK = 0x00000800;
+const sal_uInt32 BIFF12_PTFIELD_AUTOSORT = 0x00001000;
+const sal_uInt32 BIFF12_PTFIELD_SORTASCENDING = 0x00002000;
+const sal_uInt32 BIFF12_PTFIELD_AUTOSHOW = 0x00004000;
+const sal_uInt32 BIFF12_PTFIELD_AUTOSHOWTOP = 0x00008000;
+const sal_uInt32 BIFF12_PTFIELD_MULTIPAGEITEMS = 0x00080000;
+
+const sal_uInt16 BIFF12_PTFITEM_HIDDEN = 0x0001;
+const sal_uInt16 BIFF12_PTFITEM_HIDEDETAILS = 0x0002;
+
+const sal_uInt8 BIFF12_PTPAGEFIELD_HASNAME = 0x01;
+const sal_uInt8 BIFF12_PTPAGEFIELD_HASOLAPCAPTION = 0x02;
+const sal_Int32 BIFF12_PTPAGEFIELD_MULTIITEMS = 0x001000FE;
+
+const sal_uInt16 BIFF12_PTFILTER_HASNAME = 0x0001;
+const sal_uInt16 BIFF12_PTFILTER_HASDESCRIPTION = 0x0002;
+const sal_uInt16 BIFF12_PTFILTER_HASSTRVALUE1 = 0x0004;
+const sal_uInt16 BIFF12_PTFILTER_HASSTRVALUE2 = 0x0008;
+
+const sal_uInt8 BIFF12_TOP10FILTER_TOP = 0x01;
+const sal_uInt8 BIFF12_TOP10FILTER_PERCENT = 0x02;
+
+const sal_uInt32 BIFF12_PTDEF_SHOWITEMS = 0x00000100;
+const sal_uInt32 BIFF12_PTDEF_DISABLEFIELDLIST = 0x00000400;
+const sal_uInt32 BIFF12_PTDEF_HIDECALCMEMBERS = 0x00001000;
+const sal_uInt32 BIFF12_PTDEF_WITHHIDDENTOTALS = 0x00002000;
+const sal_uInt32 BIFF12_PTDEF_HIDEDRILL = 0x00100000;
+const sal_uInt32 BIFF12_PTDEF_PRINTDRILL = 0x00200000;
+const sal_uInt32 BIFF12_PTDEF_HIDEHEADERS = 0x80000000;
+
+const sal_uInt32 BIFF12_PTDEF_SHOWEMPTYROW = 0x00000004;
+const sal_uInt32 BIFF12_PTDEF_SHOWEMPTYCOL = 0x00000008;
+const sal_uInt32 BIFF12_PTDEF_ENABLEDRILL = 0x00000020;
+const sal_uInt32 BIFF12_PTDEF_PRESERVEFORMATTING = 0x00000080;
+const sal_uInt32 BIFF12_PTDEF_USEAUTOFORMAT = 0x00000100;
+const sal_uInt32 BIFF12_PTDEF_SHOWERROR = 0x00000200;
+const sal_uInt32 BIFF12_PTDEF_SHOWMISSING = 0x00000400;
+const sal_uInt32 BIFF12_PTDEF_PAGEOVERTHENDOWN = 0x00000800;
+const sal_uInt32 BIFF12_PTDEF_SUBTOTALHIDDENITEMS = 0x00001000;
+const sal_uInt32 BIFF12_PTDEF_ROWGRANDTOTALS = 0x00002000;
+const sal_uInt32 BIFF12_PTDEF_COLGRANDTOTALS = 0x00004000;
+const sal_uInt32 BIFF12_PTDEF_FIELDPRINTTITLES = 0x00008000;
+const sal_uInt32 BIFF12_PTDEF_ITEMPRINTTITLES = 0x00020000;
+const sal_uInt32 BIFF12_PTDEF_MERGEITEM = 0x00040000;
+const sal_uInt32 BIFF12_PTDEF_HASDATACAPTION = 0x00080000;
+const sal_uInt32 BIFF12_PTDEF_HASGRANDTOTALCAPTION = 0x00100000;
+const sal_uInt32 BIFF12_PTDEF_HASPAGESTYLE = 0x00200000;
+const sal_uInt32 BIFF12_PTDEF_HASPIVOTTABLESTYLE = 0x00400000;
+const sal_uInt32 BIFF12_PTDEF_HASVACATEDSTYLE = 0x00800000;
+const sal_uInt32 BIFF12_PTDEF_APPLYNUMFMT = 0x01000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYFONT = 0x02000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYALIGNMENT = 0x04000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYBORDER = 0x08000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYFILL = 0x10000000;
+const sal_uInt32 BIFF12_PTDEF_APPLYPROTECTION = 0x20000000;
+const sal_uInt32 BIFF12_PTDEF_HASTAG = 0x40000000;
+
+const sal_uInt32 BIFF12_PTDEF_NOERRORCAPTION = 0x00000040;
+const sal_uInt32 BIFF12_PTDEF_NOMISSINGCAPTION = 0x00000080;
+const sal_uInt32 BIFF12_PTDEF_HASROWHEADERCAPTION = 0x00000400;
+const sal_uInt32 BIFF12_PTDEF_HASCOLHEADERCAPTION = 0x00000800;
+const sal_uInt32 BIFF12_PTDEF_FIELDLISTSORTASC = 0x00001000;
+const sal_uInt32 BIFF12_PTDEF_NOCUSTOMLISTSORT = 0x00004000;
+
+const sal_uInt8 BIFF12_PTDEF_ROWAXIS = 1;
+const sal_uInt8 BIFF12_PTDEF_COLAXIS = 2;
// ----------------------------------------------------------------------------
@@ -234,7 +231,7 @@ PTFieldItemModel::PTFieldItemModel() :
{
}
-void PTFieldItemModel::setBinType( sal_uInt16 nType )
+void PTFieldItemModel::setBiffType( sal_uInt16 nType )
{
static const sal_Int32 spnTypes[] = { XML_data, XML_default,
XML_sum, XML_countA, XML_avg, XML_max, XML_min, XML_product, XML_count,
@@ -276,7 +273,7 @@ PTFieldModel::PTFieldModel() :
{
}
-void PTFieldModel::setBinAxis( sal_uInt8 nAxis )
+void PTFieldModel::setBiffAxis( sal_uInt8 nAxis )
{
/* Weird. The axis field is organized as bit field, but only one of the
row/col/page flags are allowed at the same time and refer to the values
@@ -294,7 +291,7 @@ void PTFieldModel::setBinAxis( sal_uInt8 nAxis )
PTPageFieldModel::PTPageFieldModel() :
mnField( -1 ),
- mnItem( OOBIN_PTPAGEFIELD_MULTIITEMS )
+ mnItem( BIFF12_PTPAGEFIELD_MULTIITEMS )
{
}
@@ -310,13 +307,13 @@ PTDataFieldModel::PTDataFieldModel() :
{
}
-void PTDataFieldModel::setBinSubtotal( sal_Int32 nSubtotal )
+void PTDataFieldModel::setBiffSubtotal( sal_Int32 nSubtotal )
{
static sal_Int32 spnSubtotals[] = { XML_sum, XML_count, XML_average, XML_max, XML_min, XML_product, XML_countNums, XML_stdDev, XML_stdDevp, XML_var, XML_varp };
mnSubtotal = STATIC_ARRAY_SELECT( spnSubtotals, nSubtotal, XML_TOKEN_INVALID );
}
-void PTDataFieldModel::setBinShowDataAs( sal_Int32 nShowDataAs )
+void PTDataFieldModel::setBiffShowDataAs( sal_Int32 nShowDataAs )
{
static sal_Int32 spnShowDataAs[] = { XML_normal, XML_difference, XML_percent, XML_percentDiff, XML_runTotal, XML_percentOfRow, XML_percentOfCol, XML_percentOfTotal, XML_index };
mnShowDataAs = STATIC_ARRAY_SELECT( spnShowDataAs, nShowDataAs, XML_TOKEN_INVALID );
@@ -387,60 +384,60 @@ void PivotTableField::importReferenceItem( const AttributeList& rAttribs )
maModel.mnSortRefItem = rAttribs.getInteger( XML_v, -1 );
}
-void PivotTableField::importPTField( RecordInputStream& rStrm )
+void PivotTableField::importPTField( SequenceInputStream& rStrm )
{
sal_uInt32 nFlags1, nFlags2;
rStrm >> nFlags1 >> maModel.mnNumFmtId >> nFlags2 >> maModel.mnAutoShowItems >> maModel.mnAutoShowRankBy;
- maModel.setBinAxis( extractValue< sal_uInt8 >( nFlags1, 0, 3 ) );
- maModel.mbDataField = getFlag( nFlags1, OOBIN_PTFIELD_DATAFIELD );
- maModel.mbDefaultSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_DEFAULT );
- maModel.mbSumSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_SUM );
- maModel.mbCountASubtotal = getFlag( nFlags1, OOBIN_PTFIELD_COUNTA );
- maModel.mbAverageSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_AVERAGE );
- maModel.mbMaxSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_MAX );
- maModel.mbMinSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_MIN );
- maModel.mbProductSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_PRODUCT );
- maModel.mbCountSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_COUNT );
- maModel.mbStdDevSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_STDDEV );
- maModel.mbStdDevPSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_STDDEVP );
- maModel.mbVarSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_VAR );
- maModel.mbVarPSubtotal = getFlag( nFlags1, OOBIN_PTFIELD_VARP );
-
- maModel.mbShowAll = getFlag( nFlags2, OOBIN_PTFIELD_SHOWALL );
- maModel.mbOutline = getFlag( nFlags2, OOBIN_PTFIELD_OUTLINE );
- maModel.mbSubtotalTop = getFlag( nFlags2, OOBIN_PTFIELD_SUBTOTALTOP );
- maModel.mbInsertBlankRow = getFlag( nFlags2, OOBIN_PTFIELD_INSERTBLANKROW );
- maModel.mbInsertPageBreak = getFlag( nFlags2, OOBIN_PTFIELD_INSERTPAGEBREAK );
- maModel.mbAutoShow = getFlag( nFlags2, OOBIN_PTFIELD_AUTOSHOW );
- maModel.mbTopAutoShow = getFlag( nFlags2, OOBIN_PTFIELD_AUTOSHOWTOP );
- maModel.mbMultiPageItems = getFlag( nFlags2, OOBIN_PTFIELD_MULTIPAGEITEMS );
-
- bool bAutoSort = getFlag( nFlags2, OOBIN_PTFIELD_AUTOSORT );
- bool bAscending = getFlag( nFlags2, OOBIN_PTFIELD_SORTASCENDING );
+ maModel.setBiffAxis( extractValue< sal_uInt8 >( nFlags1, 0, 3 ) );
+ maModel.mbDataField = getFlag( nFlags1, BIFF12_PTFIELD_DATAFIELD );
+ maModel.mbDefaultSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_DEFAULT );
+ maModel.mbSumSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_SUM );
+ maModel.mbCountASubtotal = getFlag( nFlags1, BIFF12_PTFIELD_COUNTA );
+ maModel.mbAverageSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_AVERAGE );
+ maModel.mbMaxSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_MAX );
+ maModel.mbMinSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_MIN );
+ maModel.mbProductSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_PRODUCT );
+ maModel.mbCountSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_COUNT );
+ maModel.mbStdDevSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_STDDEV );
+ maModel.mbStdDevPSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_STDDEVP );
+ maModel.mbVarSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_VAR );
+ maModel.mbVarPSubtotal = getFlag( nFlags1, BIFF12_PTFIELD_VARP );
+
+ maModel.mbShowAll = getFlag( nFlags2, BIFF12_PTFIELD_SHOWALL );
+ maModel.mbOutline = getFlag( nFlags2, BIFF12_PTFIELD_OUTLINE );
+ maModel.mbSubtotalTop = getFlag( nFlags2, BIFF12_PTFIELD_SUBTOTALTOP );
+ maModel.mbInsertBlankRow = getFlag( nFlags2, BIFF12_PTFIELD_INSERTBLANKROW );
+ maModel.mbInsertPageBreak = getFlag( nFlags2, BIFF12_PTFIELD_INSERTPAGEBREAK );
+ maModel.mbAutoShow = getFlag( nFlags2, BIFF12_PTFIELD_AUTOSHOW );
+ maModel.mbTopAutoShow = getFlag( nFlags2, BIFF12_PTFIELD_AUTOSHOWTOP );
+ maModel.mbMultiPageItems = getFlag( nFlags2, BIFF12_PTFIELD_MULTIPAGEITEMS );
+
+ bool bAutoSort = getFlag( nFlags2, BIFF12_PTFIELD_AUTOSORT );
+ bool bAscending = getFlag( nFlags2, BIFF12_PTFIELD_SORTASCENDING );
maModel.mnSortType = bAutoSort ? (bAscending ? XML_ascending : XML_descending) : XML_manual;
}
-void PivotTableField::importPTFItem( RecordInputStream& rStrm )
+void PivotTableField::importPTFItem( SequenceInputStream& rStrm )
{
PTFieldItemModel aModel;
sal_uInt8 nType;
sal_uInt16 nFlags;
rStrm >> nType >> nFlags >> aModel.mnCacheItem;
- aModel.setBinType( nType );
- aModel.mbShowDetails = !getFlag( nFlags, OOBIN_PTFITEM_HIDEDETAILS );
- aModel.mbHidden = getFlag( nFlags, OOBIN_PTFITEM_HIDDEN );
+ aModel.setBiffType( nType );
+ aModel.mbShowDetails = !getFlag( nFlags, BIFF12_PTFITEM_HIDEDETAILS );
+ aModel.mbHidden = getFlag( nFlags, BIFF12_PTFITEM_HIDDEN );
maItems.push_back( aModel );
}
-void PivotTableField::importPTReference( RecordInputStream& rStrm )
+void PivotTableField::importPTReference( SequenceInputStream& rStrm )
{
rStrm >> maModel.mnSortRefField;
}
-void PivotTableField::importPTReferenceItem( RecordInputStream& rStrm )
+void PivotTableField::importPTReferenceItem( SequenceInputStream& rStrm )
{
rStrm >> maModel.mnSortRefItem;
}
@@ -451,7 +448,7 @@ void PivotTableField::importPTField( BiffInputStream& rStrm )
rStrm >> nAxis >> nSubtCount >> nSubtotals;
rStrm.skip( 2 ); // item count
- maModel.setBinAxis( extractValue< sal_uInt8 >( nAxis, 0, 3 ) );
+ maModel.setBiffAxis( extractValue< sal_uInt8 >( nAxis, 0, 3 ) );
maModel.mbDataField = getFlag( nAxis, BIFF_PTFIELD_DATAFIELD );
maModel.mbDefaultSubtotal = getFlag( nSubtotals, BIFF_PTFIELD_DEFAULT );
@@ -510,7 +507,7 @@ void PivotTableField::importPTFItem( BiffInputStream& rStrm )
sal_Int16 nCacheItem;
rStrm >> nType >> nFlags >> nCacheItem;
- aModel.setBinType( nType );
+ aModel.setBiffType( nType );
aModel.mnCacheItem = nCacheItem;
aModel.mbShowDetails = !getFlag( nFlags, BIFF_PTFITEM_HIDEDETAILS );
aModel.mbHidden = getFlag( nFlags, BIFF_PTFITEM_HIDDEN );
@@ -628,7 +625,7 @@ void PivotTableField::convertPageField( const PTPageFieldModel& rPageField )
if( maModel.mbMultiPageItems )
{
// multiple items may be selected
- OSL_ENSURE( rPageField.mnItem == OOBIN_PTPAGEFIELD_MULTIITEMS, "PivotTableField::convertPageField - unexpected cache item index" );
+ OSL_ENSURE( rPageField.mnItem == BIFF12_PTPAGEFIELD_MULTIITEMS, "PivotTableField::convertPageField - unexpected cache item index" );
// try to find a single visible item
bool bHasMultiItems = false;
for( ItemModelVector::iterator aIt = maItems.begin(), aEnd = maItems.end(); (aIt != aEnd) && !bHasMultiItems; ++aIt )
@@ -800,7 +797,7 @@ Reference< XDataPilotField > PivotTableField::convertRowColPageField( sal_Int32
aPropSet.setProperty( PROP_LayoutInfo, aLayoutInfo );
aPropSet.setProperty( PROP_ShowEmpty, maModel.mbShowAll );
- // auto show (OOXML3/OOBIN3 only)
+ // auto show (OOXML/BIFF12 only)
if( maModel.mbAutoShow )
{
DataPilotFieldAutoShowInfo aAutoShowInfo;
@@ -910,20 +907,20 @@ void PivotTableFilter::importTop10( const AttributeList& rAttribs )
maModel.mbTopFilter = rAttribs.getBool( XML_top, true );
}
-void PivotTableFilter::importPTFilter( RecordInputStream& rStrm )
+void PivotTableFilter::importPTFilter( SequenceInputStream& rStrm )
{
sal_Int32 nType;
sal_uInt16 nFlags;
rStrm >> maModel.mnField >> maModel.mnMemPropField >> nType;
rStrm.skip( 4 ); // unused
rStrm >> maModel.mnId >> maModel.mnMeasureField >> maModel.mnMeasureHier >> nFlags;
- if( getFlag( nFlags, OOBIN_PTFILTER_HASNAME ) )
+ if( getFlag( nFlags, BIFF12_PTFILTER_HASNAME ) )
rStrm >> maModel.maName;
- if( getFlag( nFlags, OOBIN_PTFILTER_HASDESCRIPTION ) )
+ if( getFlag( nFlags, BIFF12_PTFILTER_HASDESCRIPTION ) )
rStrm >> maModel.maDescription;
- if( getFlag( nFlags, OOBIN_PTFILTER_HASSTRVALUE1 ) )
+ if( getFlag( nFlags, BIFF12_PTFILTER_HASSTRVALUE1 ) )
rStrm >> maModel.maStrValue1;
- if( getFlag( nFlags, OOBIN_PTFILTER_HASSTRVALUE2 ) )
+ if( getFlag( nFlags, BIFF12_PTFILTER_HASSTRVALUE2 ) )
rStrm >> maModel.maStrValue2;
static sal_Int32 spnTypes[] =
@@ -950,14 +947,14 @@ void PivotTableFilter::importPTFilter( RecordInputStream& rStrm )
maModel.mnType = STATIC_ARRAY_SELECT( spnTypes, nType, XML_TOKEN_INVALID );
}
-void PivotTableFilter::importTop10Filter( RecordInputStream& rStrm )
+void PivotTableFilter::importTop10Filter( SequenceInputStream& rStrm )
{
sal_uInt8 nFlags;
rStrm >> nFlags >> maModel.mfValue;
- OSL_ENSURE( getFlag( nFlags, OOBIN_TOP10FILTER_PERCENT ) == (maModel.mnType == XML_percent),
+ OSL_ENSURE( getFlag( nFlags, BIFF12_TOP10FILTER_PERCENT ) == (maModel.mnType == XML_percent),
"PivotTableFilter::importTop10 - unexpected value of percent attribute" );
- maModel.mbTopFilter = getFlag( nFlags, OOBIN_TOP10FILTER_TOP );
+ maModel.mbTopFilter = getFlag( nFlags, BIFF12_TOP10FILTER_TOP );
}
void PivotTableFilter::finalizeImport()
@@ -1001,6 +998,7 @@ PTDefinitionModel::PTDefinitionModel() :
mbPrintDrill( false ),
mbEnableDrill( true ),
mbPreserveFormatting( true ),
+ mbUseAutoFormat( false ),
mbPageOverThenDown( false ),
mbSubtotalHiddenItems( false ),
mbRowGrandTotals( true ),
@@ -1054,6 +1052,7 @@ void PivotTable::importPivotTableDefinition( const AttributeList& rAttribs )
maDefModel.mnPageWrap = rAttribs.getInteger( XML_pageWrap, 0 );
maDefModel.mnIndent = rAttribs.getInteger( XML_indent, 1 );
maDefModel.mnChartFormat = rAttribs.getInteger( XML_chartFormat, 0 );
+ maDefModel.mnAutoFormatId = rAttribs.getInteger( XML_autoFormatId, 0 );
maDefModel.mbDataOnRows = rAttribs.getBool( XML_dataOnRows, false );
maDefModel.mbShowError = rAttribs.getBool( XML_showError, false );
maDefModel.mbShowMissing = rAttribs.getBool( XML_showMissing, true );
@@ -1065,6 +1064,7 @@ void PivotTable::importPivotTableDefinition( const AttributeList& rAttribs )
maDefModel.mbPrintDrill = rAttribs.getBool( XML_printDrill, false );
maDefModel.mbEnableDrill = rAttribs.getBool( XML_enableDrill, true );
maDefModel.mbPreserveFormatting = rAttribs.getBool( XML_preserveFormatting, true );
+ maDefModel.mbUseAutoFormat = rAttribs.getBool( XML_useAutoFormatting, false );
maDefModel.mbPageOverThenDown = rAttribs.getBool( XML_pageOverThenDown, false );
maDefModel.mbSubtotalHiddenItems = rAttribs.getBool( XML_subtotalHiddenItems, false );
maDefModel.mbRowGrandTotals = rAttribs.getBool( XML_rowGrandTotals, true );
@@ -1077,6 +1077,13 @@ void PivotTable::importPivotTableDefinition( const AttributeList& rAttribs )
maDefModel.mbShowHeaders = rAttribs.getBool( XML_showHeaders, true );
maDefModel.mbFieldListSortAsc = rAttribs.getBool( XML_fieldListSortAscending, false );
maDefModel.mbCustomListSort = rAttribs.getBool( XML_customListSort, true );
+ maDefModel.mbApplyNumFmt = rAttribs.getBool( XML_applyNumberFormats, false );
+ maDefModel.mbApplyFont = rAttribs.getBool( XML_applyFontFormats, false );
+ maDefModel.mbApplyAlignment = rAttribs.getBool( XML_applyAlignmentFormats, false );
+ maDefModel.mbApplyBorder = rAttribs.getBool( XML_applyBorderFormats, false );
+ maDefModel.mbApplyFill = rAttribs.getBool( XML_applyPatternFormats, false );
+ // OOXML and BIFF12 documentation differ: OOXML mentions width/height, BIFF12 mentions protection
+ maDefModel.mbApplyProtection = rAttribs.getBool( XML_applyWidthHeightFormats, false );
}
void PivotTable::importLocation( const AttributeList& rAttribs, sal_Int16 nSheet )
@@ -1105,7 +1112,7 @@ void PivotTable::importPageField( const AttributeList& rAttribs )
aModel.maName = rAttribs.getXString( XML_name, OUString() );
aModel.mnField = rAttribs.getInteger( XML_fld, -1 );
// specification is wrong, XML_item is not the cache item, but the field item
- aModel.mnItem = rAttribs.getInteger( XML_item, OOBIN_PTPAGEFIELD_MULTIITEMS );
+ aModel.mnItem = rAttribs.getInteger( XML_item, BIFF12_PTPAGEFIELD_MULTIITEMS );
maPageFields.push_back( aModel );
}
@@ -1122,7 +1129,7 @@ void PivotTable::importDataField( const AttributeList& rAttribs )
maDataFields.push_back( aModel );
}
-void PivotTable::importPTDefinition( RecordInputStream& rStrm )
+void PivotTable::importPTDefinition( SequenceInputStream& rStrm )
{
sal_uInt32 nFlags1, nFlags2, nFlags3;
sal_uInt8 nDataAxis;
@@ -1130,59 +1137,67 @@ void PivotTable::importPTDefinition( RecordInputStream& rStrm )
maDefModel.mnPageWrap = rStrm.readuInt8();
rStrm.skip( 2 ); // refresh versions
rStrm >> maDefModel.mnDataPosition;
- rStrm.skip( 4 ); // 2 bytes autoformat id, 2 bytes unused
+ maDefModel.mnAutoFormatId = rStrm.readuInt16();
+ rStrm.skip( 2 ); // unused
rStrm >> maDefModel.mnChartFormat >> maDefModel.mnCacheId >> maDefModel.maName;
- if( getFlag( nFlags2, OOBIN_PTDEF_HASDATACAPTION ) )
+ if( getFlag( nFlags2, BIFF12_PTDEF_HASDATACAPTION ) )
rStrm >> maDefModel.maDataCaption;
- if( getFlag( nFlags2, OOBIN_PTDEF_HASGRANDTOTALCAPTION ) )
+ if( getFlag( nFlags2, BIFF12_PTDEF_HASGRANDTOTALCAPTION ) )
rStrm >> maDefModel.maGrandTotalCaption;
- if( !getFlag( nFlags3, OOBIN_PTDEF_NOERRORCAPTION ) ) // missing flag indicates existing string
+ if( !getFlag( nFlags3, BIFF12_PTDEF_NOERRORCAPTION ) ) // missing flag indicates existing string
rStrm >> maDefModel.maErrorCaption;
- if( !getFlag( nFlags3, OOBIN_PTDEF_NOMISSINGCAPTION ) ) // missing flag indicates existing string
+ if( !getFlag( nFlags3, BIFF12_PTDEF_NOMISSINGCAPTION ) ) // missing flag indicates existing string
rStrm >> maDefModel.maMissingCaption;
- if( getFlag( nFlags2, OOBIN_PTDEF_HASPAGESTYLE ) )
+ if( getFlag( nFlags2, BIFF12_PTDEF_HASPAGESTYLE ) )
rStrm >> maDefModel.maPageStyle;
- if( getFlag( nFlags2, OOBIN_PTDEF_HASPIVOTTABLESTYLE ) )
+ if( getFlag( nFlags2, BIFF12_PTDEF_HASPIVOTTABLESTYLE ) )
rStrm >> maDefModel.maPivotTableStyle;
- if( getFlag( nFlags2, OOBIN_PTDEF_HASVACATEDSTYLE ) )
+ if( getFlag( nFlags2, BIFF12_PTDEF_HASVACATEDSTYLE ) )
rStrm >> maDefModel.maVacatedStyle;
- if( getFlag( nFlags2, OOBIN_PTDEF_HASTAG ) )
+ if( getFlag( nFlags2, BIFF12_PTDEF_HASTAG ) )
rStrm >> maDefModel.maTag;
- if( getFlag( nFlags3, OOBIN_PTDEF_HASCOLHEADERCAPTION ) ) // TODO: right order (col/row)? spec is unclear
+ if( getFlag( nFlags3, BIFF12_PTDEF_HASCOLHEADERCAPTION ) ) // TODO: right order (col/row)? spec is unclear
rStrm >> maDefModel.maColHeaderCaption;
- if( getFlag( nFlags3, OOBIN_PTDEF_HASROWHEADERCAPTION ) )
+ if( getFlag( nFlags3, BIFF12_PTDEF_HASROWHEADERCAPTION ) )
rStrm >> maDefModel.maRowHeaderCaption;
- OSL_ENSURE( (nDataAxis == OOBIN_PTDEF_ROWAXIS) || (nDataAxis == OOBIN_PTDEF_COLAXIS),
+ OSL_ENSURE( (nDataAxis == BIFF12_PTDEF_ROWAXIS) || (nDataAxis == BIFF12_PTDEF_COLAXIS),
"PivotTable::importPTDefinition - unexpected axis position for data field" );
maDefModel.mnIndent = extractValue< sal_uInt8 >( nFlags1, 24, 7 );
- maDefModel.mbDataOnRows = nDataAxis == OOBIN_PTDEF_ROWAXIS;
- maDefModel.mbShowError = getFlag( nFlags2, OOBIN_PTDEF_SHOWERROR );
- maDefModel.mbShowMissing = getFlag( nFlags2, OOBIN_PTDEF_SHOWMISSING );
- maDefModel.mbShowItems = getFlag( nFlags1, OOBIN_PTDEF_SHOWITEMS );
- maDefModel.mbDisableFieldList = getFlag( nFlags1, OOBIN_PTDEF_DISABLEFIELDLIST );
- maDefModel.mbShowCalcMembers = !getFlag( nFlags1, OOBIN_PTDEF_HIDECALCMEMBERS );
- maDefModel.mbVisualTotals = !getFlag( nFlags1, OOBIN_PTDEF_WITHHIDDENTOTALS );
- maDefModel.mbShowDrill = !getFlag( nFlags1, OOBIN_PTDEF_HIDEDRILL );
- maDefModel.mbPrintDrill = getFlag( nFlags1, OOBIN_PTDEF_PRINTDRILL );
- maDefModel.mbEnableDrill = getFlag( nFlags2, OOBIN_PTDEF_ENABLEDRILL );
- maDefModel.mbPreserveFormatting = getFlag( nFlags2, OOBIN_PTDEF_PRESERVEFORMATTING );
- maDefModel.mbPageOverThenDown = getFlag( nFlags2, OOBIN_PTDEF_PAGEOVERTHENDOWN );
- maDefModel.mbSubtotalHiddenItems = getFlag( nFlags2, OOBIN_PTDEF_SUBTOTALHIDDENITEMS );
- maDefModel.mbRowGrandTotals = getFlag( nFlags2, OOBIN_PTDEF_ROWGRANDTOTALS );
- maDefModel.mbColGrandTotals = getFlag( nFlags2, OOBIN_PTDEF_COLGRANDTOTALS );
- maDefModel.mbFieldPrintTitles = getFlag( nFlags2, OOBIN_PTDEF_FIELDPRINTTITLES );
- maDefModel.mbItemPrintTitles = getFlag( nFlags2, OOBIN_PTDEF_ITEMPRINTTITLES );
- maDefModel.mbMergeItem = getFlag( nFlags2, OOBIN_PTDEF_MERGEITEM );
- maDefModel.mbShowEmptyRow = getFlag( nFlags2, OOBIN_PTDEF_SHOWEMPTYROW );
- maDefModel.mbShowEmptyCol = getFlag( nFlags2, OOBIN_PTDEF_SHOWEMPTYCOL );
- maDefModel.mbShowHeaders = !getFlag( nFlags1, OOBIN_PTDEF_HIDEHEADERS );
- maDefModel.mbFieldListSortAsc = getFlag( nFlags3, OOBIN_PTDEF_FIELDLISTSORTASC );
- maDefModel.mbCustomListSort = !getFlag( nFlags3, OOBIN_PTDEF_NOCUSTOMLISTSORT );
-}
-
-void PivotTable::importPTLocation( RecordInputStream& rStrm, sal_Int16 nSheet )
+ maDefModel.mbDataOnRows = nDataAxis == BIFF12_PTDEF_ROWAXIS;
+ maDefModel.mbShowError = getFlag( nFlags2, BIFF12_PTDEF_SHOWERROR );
+ maDefModel.mbShowMissing = getFlag( nFlags2, BIFF12_PTDEF_SHOWMISSING );
+ maDefModel.mbShowItems = getFlag( nFlags1, BIFF12_PTDEF_SHOWITEMS );
+ maDefModel.mbDisableFieldList = getFlag( nFlags1, BIFF12_PTDEF_DISABLEFIELDLIST );
+ maDefModel.mbShowCalcMembers = !getFlag( nFlags1, BIFF12_PTDEF_HIDECALCMEMBERS );
+ maDefModel.mbVisualTotals = !getFlag( nFlags1, BIFF12_PTDEF_WITHHIDDENTOTALS );
+ maDefModel.mbShowDrill = !getFlag( nFlags1, BIFF12_PTDEF_HIDEDRILL );
+ maDefModel.mbPrintDrill = getFlag( nFlags1, BIFF12_PTDEF_PRINTDRILL );
+ maDefModel.mbEnableDrill = getFlag( nFlags2, BIFF12_PTDEF_ENABLEDRILL );
+ maDefModel.mbPreserveFormatting = getFlag( nFlags2, BIFF12_PTDEF_PRESERVEFORMATTING );
+ maDefModel.mbUseAutoFormat = getFlag( nFlags2, BIFF12_PTDEF_USEAUTOFORMAT );
+ maDefModel.mbPageOverThenDown = getFlag( nFlags2, BIFF12_PTDEF_PAGEOVERTHENDOWN );
+ maDefModel.mbSubtotalHiddenItems = getFlag( nFlags2, BIFF12_PTDEF_SUBTOTALHIDDENITEMS );
+ maDefModel.mbRowGrandTotals = getFlag( nFlags2, BIFF12_PTDEF_ROWGRANDTOTALS );
+ maDefModel.mbColGrandTotals = getFlag( nFlags2, BIFF12_PTDEF_COLGRANDTOTALS );
+ maDefModel.mbFieldPrintTitles = getFlag( nFlags2, BIFF12_PTDEF_FIELDPRINTTITLES );
+ maDefModel.mbItemPrintTitles = getFlag( nFlags2, BIFF12_PTDEF_ITEMPRINTTITLES );
+ maDefModel.mbMergeItem = getFlag( nFlags2, BIFF12_PTDEF_MERGEITEM );
+ maDefModel.mbApplyNumFmt = getFlag( nFlags2, BIFF12_PTDEF_APPLYNUMFMT );
+ maDefModel.mbApplyFont = getFlag( nFlags2, BIFF12_PTDEF_APPLYFONT );
+ maDefModel.mbApplyAlignment = getFlag( nFlags2, BIFF12_PTDEF_APPLYALIGNMENT );
+ maDefModel.mbApplyBorder = getFlag( nFlags2, BIFF12_PTDEF_APPLYBORDER );
+ maDefModel.mbApplyFill = getFlag( nFlags2, BIFF12_PTDEF_APPLYFILL );
+ maDefModel.mbApplyProtection = getFlag( nFlags2, BIFF12_PTDEF_APPLYPROTECTION );
+ maDefModel.mbShowEmptyRow = getFlag( nFlags2, BIFF12_PTDEF_SHOWEMPTYROW );
+ maDefModel.mbShowEmptyCol = getFlag( nFlags2, BIFF12_PTDEF_SHOWEMPTYCOL );
+ maDefModel.mbShowHeaders = !getFlag( nFlags1, BIFF12_PTDEF_HIDEHEADERS );
+ maDefModel.mbFieldListSortAsc = getFlag( nFlags3, BIFF12_PTDEF_FIELDLISTSORTASC );
+ maDefModel.mbCustomListSort = !getFlag( nFlags3, BIFF12_PTDEF_NOCUSTOMLISTSORT );
+}
+
+void PivotTable::importPTLocation( SequenceInputStream& rStrm, sal_Int16 nSheet )
{
BinRange aBinRange;
rStrm >> aBinRange >> maLocationModel.mnFirstHeaderRow
@@ -1191,29 +1206,29 @@ void PivotTable::importPTLocation( RecordInputStream& rStrm, sal_Int16 nSheet )
getAddressConverter().convertToCellRangeUnchecked( maLocationModel.maRange, aBinRange, nSheet );
}
-void PivotTable::importPTRowFields( RecordInputStream& rStrm )
+void PivotTable::importPTRowFields( SequenceInputStream& rStrm )
{
importFields( maRowFields, rStrm );
}
-void PivotTable::importPTColFields( RecordInputStream& rStrm )
+void PivotTable::importPTColFields( SequenceInputStream& rStrm )
{
importFields( maColFields, rStrm );
}
-void PivotTable::importPTPageField( RecordInputStream& rStrm )
+void PivotTable::importPTPageField( SequenceInputStream& rStrm )
{
PTPageFieldModel aModel;
sal_uInt8 nFlags;
rStrm >> aModel.mnField >> aModel.mnItem;
rStrm.skip( 4 ); // hierarchy
rStrm >> nFlags;
- if( getFlag( nFlags, OOBIN_PTPAGEFIELD_HASNAME ) )
+ if( getFlag( nFlags, BIFF12_PTPAGEFIELD_HASNAME ) )
rStrm >> aModel.maName;
maPageFields.push_back( aModel );
}
-void PivotTable::importPTDataField( RecordInputStream& rStrm )
+void PivotTable::importPTDataField( SequenceInputStream& rStrm )
{
PTDataFieldModel aModel;
sal_Int32 nSubtotal, nShowDataAs;
@@ -1221,8 +1236,8 @@ void PivotTable::importPTDataField( RecordInputStream& rStrm )
rStrm >> aModel.mnField >> nSubtotal >> nShowDataAs >> aModel.mnBaseField >> aModel.mnBaseItem >> aModel.mnNumFmtId >> nHasName;
if( nHasName == 1 )
rStrm >> aModel.maName;
- aModel.setBinSubtotal( nSubtotal );
- aModel.setBinShowDataAs( nShowDataAs );
+ aModel.setBiffSubtotal( nSubtotal );
+ aModel.setBiffShowDataAs( nShowDataAs );
maDataFields.push_back( aModel );
}
@@ -1298,7 +1313,7 @@ void PivotTable::importPTPageFields( BiffInputStream& rStrm )
rStrm >> nField >> nItem;
rStrm.skip( 2 ); // dropdown object ID
aModel.mnField = nField;
- aModel.mnItem = (nItem == BIFF_PTPAGEFIELDS_ALLITEMS) ? OOBIN_PTPAGEFIELD_MULTIITEMS : nItem;
+ aModel.mnItem = (nItem == BIFF_PTPAGEFIELDS_ALLITEMS) ? BIFF12_PTPAGEFIELD_MULTIITEMS : nItem;
maPageFields.push_back( aModel );
}
}
@@ -1312,8 +1327,8 @@ void PivotTable::importPTDataField( BiffInputStream& rStrm )
aModel.maName = lclReadPivotString( *this, rStrm, nNameLen );
aModel.mnField = nField;
- aModel.setBinSubtotal( nSubtotal );
- aModel.setBinShowDataAs( nShowDataAs );
+ aModel.setBiffSubtotal( nSubtotal );
+ aModel.setBiffShowDataAs( nShowDataAs );
aModel.mnBaseField = nBaseField;
switch( nBaseItem )
{
@@ -1507,7 +1522,7 @@ void PivotTable::importField( IndexVector& orFields, const AttributeList& rAttri
orFields.push_back( rAttribs.getInteger( XML_x, -1 ) );
}
-void PivotTable::importFields( IndexVector& orFields, RecordInputStream& rStrm )
+void PivotTable::importFields( IndexVector& orFields, SequenceInputStream& rStrm )
{
OSL_ENSURE( orFields.empty(), "PivotTable::importFields - multiple record instances" );
orFields.clear();
@@ -1552,4 +1567,4 @@ void PivotTableBuffer::finalizeImport()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/pivottablefragment.cxx b/oox/source/xls/pivottablefragment.cxx
index 9c34994d482d..440b2f6f0fe7 100644
--- a/oox/source/xls/pivottablefragment.cxx
+++ b/oox/source/xls/pivottablefragment.cxx
@@ -27,25 +27,28 @@
************************************************************************/
#include "oox/xls/pivottablefragment.hxx"
+
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/pivottablebuffer.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
-
namespace oox {
namespace xls {
// ============================================================================
-OoxPivotTableFieldContext::OoxPivotTableFieldContext( OoxWorksheetFragmentBase& rFragment, PivotTableField& rTableField ) :
- OoxWorksheetContextBase( rFragment ),
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+PivotTableFieldContext::PivotTableFieldContext( WorksheetFragmentBase& rFragment, PivotTableField& rTableField ) :
+ WorksheetContextBase( rFragment ),
mrTableField( rTableField )
{
}
-ContextHandlerRef OoxPivotTableFieldContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotTableFieldContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -75,43 +78,43 @@ ContextHandlerRef OoxPivotTableFieldContext::onCreateContext( sal_Int32 nElement
return 0;
}
-void OoxPivotTableFieldContext::onStartElement( const AttributeList& rAttribs )
+void PivotTableFieldContext::onStartElement( const AttributeList& rAttribs )
{
if( isRootElement() )
mrTableField.importPivotField( rAttribs );
}
-ContextHandlerRef OoxPivotTableFieldContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotTableFieldContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_PTFIELD:
+ case BIFF12_ID_PTFIELD:
switch( nRecId )
{
- case OOBIN_ID_PTFITEMS: return this;
- case OOBIN_ID_AUTOSORTSCOPE: return this;
+ case BIFF12_ID_PTFITEMS: return this;
+ case BIFF12_ID_AUTOSORTSCOPE: return this;
}
break;
- case OOBIN_ID_PTFITEMS:
- if( nRecId == OOBIN_ID_PTFITEM ) mrTableField.importPTFItem( rStrm );
+ case BIFF12_ID_PTFITEMS:
+ if( nRecId == BIFF12_ID_PTFITEM ) mrTableField.importPTFItem( rStrm );
break;
- case OOBIN_ID_AUTOSORTSCOPE:
- if( nRecId == OOBIN_ID_PIVOTAREA ) return this;
+ case BIFF12_ID_AUTOSORTSCOPE:
+ if( nRecId == BIFF12_ID_PIVOTAREA ) return this;
break;
- case OOBIN_ID_PIVOTAREA:
- if( nRecId == OOBIN_ID_PTREFERENCES ) return this;
+ case BIFF12_ID_PIVOTAREA:
+ if( nRecId == BIFF12_ID_PTREFERENCES ) return this;
break;
- case OOBIN_ID_PTREFERENCES:
- if( nRecId == OOBIN_ID_PTREFERENCE ) { mrTableField.importPTReference( rStrm ); return this; }
+ case BIFF12_ID_PTREFERENCES:
+ if( nRecId == BIFF12_ID_PTREFERENCE ) { mrTableField.importPTReference( rStrm ); return this; }
break;
- case OOBIN_ID_PTREFERENCE:
- if( nRecId == OOBIN_ID_PTREFERENCEITEM ) mrTableField.importPTReferenceItem( rStrm );
+ case BIFF12_ID_PTREFERENCE:
+ if( nRecId == BIFF12_ID_PTREFERENCEITEM ) mrTableField.importPTReferenceItem( rStrm );
break;
}
return 0;
}
-void OoxPivotTableFieldContext::onStartRecord( RecordInputStream& rStrm )
+void PivotTableFieldContext::onStartRecord( SequenceInputStream& rStrm )
{
if( isRootElement() )
mrTableField.importPTField( rStrm );
@@ -119,13 +122,13 @@ void OoxPivotTableFieldContext::onStartRecord( RecordInputStream& rStrm )
// ============================================================================
-OoxPivotTableFilterContext::OoxPivotTableFilterContext( OoxWorksheetFragmentBase& rFragment, PivotTableFilter& rTableFilter ) :
- OoxWorksheetContextBase( rFragment ),
+PivotTableFilterContext::PivotTableFilterContext( WorksheetFragmentBase& rFragment, PivotTableFilter& rTableFilter ) :
+ WorksheetContextBase( rFragment ),
mrTableFilter( rTableFilter )
{
}
-ContextHandlerRef OoxPivotTableFilterContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotTableFilterContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -142,30 +145,30 @@ ContextHandlerRef OoxPivotTableFilterContext::onCreateContext( sal_Int32 nElemen
return 0;
}
-void OoxPivotTableFilterContext::onStartElement( const AttributeList& rAttribs )
+void PivotTableFilterContext::onStartElement( const AttributeList& rAttribs )
{
if( isRootElement() )
mrTableFilter.importFilter( rAttribs );
}
-ContextHandlerRef OoxPivotTableFilterContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotTableFilterContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_PTFILTER:
- if( nRecId == OOBIN_ID_AUTOFILTER ) return this;
+ case BIFF12_ID_PTFILTER:
+ if( nRecId == BIFF12_ID_AUTOFILTER ) return this;
break;
- case OOBIN_ID_AUTOFILTER:
- if( nRecId == OOBIN_ID_FILTERCOLUMN ) return this;
+ case BIFF12_ID_AUTOFILTER:
+ if( nRecId == BIFF12_ID_FILTERCOLUMN ) return this;
break;
- case OOBIN_ID_FILTERCOLUMN:
- if( nRecId == OOBIN_ID_TOP10FILTER ) mrTableFilter.importTop10Filter( rStrm );
+ case BIFF12_ID_FILTERCOLUMN:
+ if( nRecId == BIFF12_ID_TOP10FILTER ) mrTableFilter.importTop10Filter( rStrm );
break;
}
return 0;
}
-void OoxPivotTableFilterContext::onStartRecord( RecordInputStream& rStrm )
+void PivotTableFilterContext::onStartRecord( SequenceInputStream& rStrm )
{
if( isRootElement() )
mrTableFilter.importPTFilter( rStrm );
@@ -173,13 +176,13 @@ void OoxPivotTableFilterContext::onStartRecord( RecordInputStream& rStrm )
// ============================================================================
-OoxPivotTableFragment::OoxPivotTableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorksheetFragmentBase( rHelper, rFragmentPath ),
- mrPivotTable( rHelper.getPivotTables().createPivotTable() )
+PivotTableFragment::PivotTableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+ WorksheetFragmentBase( rHelper, rFragmentPath ),
+ mrPivotTable( getPivotTables().createPivotTable() )
{
}
-ContextHandlerRef OoxPivotTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef PivotTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -201,7 +204,7 @@ ContextHandlerRef OoxPivotTableFragment::onCreateContext( sal_Int32 nElement, co
break;
case XLS_TOKEN( pivotFields ):
- if( nElement == XLS_TOKEN( pivotField ) ) return new OoxPivotTableFieldContext( *this, mrPivotTable.createTableField() );
+ if( nElement == XLS_TOKEN( pivotField ) ) return new PivotTableFieldContext( *this, mrPivotTable.createTableField() );
break;
case XLS_TOKEN( rowFields ):
if( nElement == XLS_TOKEN( field ) ) mrPivotTable.importRowField( rAttribs );
@@ -216,75 +219,75 @@ ContextHandlerRef OoxPivotTableFragment::onCreateContext( sal_Int32 nElement, co
if( nElement == XLS_TOKEN( dataField ) ) mrPivotTable.importDataField( rAttribs );
break;
case XLS_TOKEN( filters ):
- if( nElement == XLS_TOKEN( filter ) ) return new OoxPivotTableFilterContext( *this, mrPivotTable.createTableFilter() );
+ if( nElement == XLS_TOKEN( filter ) ) return new PivotTableFilterContext( *this, mrPivotTable.createTableFilter() );
break;
}
return 0;
}
-ContextHandlerRef OoxPivotTableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef PivotTableFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_PTDEFINITION ) { mrPivotTable.importPTDefinition( rStrm ); return this; }
+ if( nRecId == BIFF12_ID_PTDEFINITION ) { mrPivotTable.importPTDefinition( rStrm ); return this; }
break;
- case OOBIN_ID_PTDEFINITION:
+ case BIFF12_ID_PTDEFINITION:
switch( nRecId )
{
- case OOBIN_ID_PTLOCATION: mrPivotTable.importPTLocation( rStrm, getSheetIndex() ); break;
- case OOBIN_ID_PTFIELDS: return this;
- case OOBIN_ID_PTROWFIELDS: mrPivotTable.importPTRowFields( rStrm ); break;
- case OOBIN_ID_PTCOLFIELDS: mrPivotTable.importPTColFields( rStrm ); break;
- case OOBIN_ID_PTPAGEFIELDS: return this;
- case OOBIN_ID_PTDATAFIELDS: return this;
- case OOBIN_ID_PTFILTERS: return this;
+ case BIFF12_ID_PTLOCATION: mrPivotTable.importPTLocation( rStrm, getSheetIndex() ); break;
+ case BIFF12_ID_PTFIELDS: return this;
+ case BIFF12_ID_PTROWFIELDS: mrPivotTable.importPTRowFields( rStrm ); break;
+ case BIFF12_ID_PTCOLFIELDS: mrPivotTable.importPTColFields( rStrm ); break;
+ case BIFF12_ID_PTPAGEFIELDS: return this;
+ case BIFF12_ID_PTDATAFIELDS: return this;
+ case BIFF12_ID_PTFILTERS: return this;
}
break;
- case OOBIN_ID_PTFIELDS:
- if( nRecId == OOBIN_ID_PTFIELD ) return new OoxPivotTableFieldContext( *this, mrPivotTable.createTableField() );
+ case BIFF12_ID_PTFIELDS:
+ if( nRecId == BIFF12_ID_PTFIELD ) return new PivotTableFieldContext( *this, mrPivotTable.createTableField() );
break;
- case OOBIN_ID_PTPAGEFIELDS:
- if( nRecId == OOBIN_ID_PTPAGEFIELD ) mrPivotTable.importPTPageField( rStrm );
+ case BIFF12_ID_PTPAGEFIELDS:
+ if( nRecId == BIFF12_ID_PTPAGEFIELD ) mrPivotTable.importPTPageField( rStrm );
break;
- case OOBIN_ID_PTDATAFIELDS:
- if( nRecId == OOBIN_ID_PTDATAFIELD ) mrPivotTable.importPTDataField( rStrm );
+ case BIFF12_ID_PTDATAFIELDS:
+ if( nRecId == BIFF12_ID_PTDATAFIELD ) mrPivotTable.importPTDataField( rStrm );
break;
- case OOBIN_ID_PTFILTERS:
- if( nRecId == OOBIN_ID_PTFILTER ) return new OoxPivotTableFilterContext( *this, mrPivotTable.createTableFilter() );
+ case BIFF12_ID_PTFILTERS:
+ if( nRecId == BIFF12_ID_PTFILTER ) return new PivotTableFilterContext( *this, mrPivotTable.createTableFilter() );
break;
}
return 0;
}
-const RecordInfo* OoxPivotTableFragment::getRecordInfos() const
+const RecordInfo* PivotTableFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_AUTOFILTER, OOBIN_ID_AUTOFILTER + 1 },
- { OOBIN_ID_AUTOSORTSCOPE, OOBIN_ID_AUTOSORTSCOPE + 1 },
- { OOBIN_ID_FILTERCOLUMN, OOBIN_ID_FILTERCOLUMN + 1 },
- { OOBIN_ID_PIVOTAREA, OOBIN_ID_PIVOTAREA + 1 },
- { OOBIN_ID_PTCOLFIELDS, OOBIN_ID_PTCOLFIELDS + 1 },
- { OOBIN_ID_PTDATAFIELD, OOBIN_ID_PTDATAFIELD + 1 },
- { OOBIN_ID_PTDATAFIELDS, OOBIN_ID_PTDATAFIELDS + 1 },
- { OOBIN_ID_PTDEFINITION, OOBIN_ID_PTDEFINITION + 35 },
- { OOBIN_ID_PTFIELD, OOBIN_ID_PTFIELD + 1 },
- { OOBIN_ID_PTFIELDS, OOBIN_ID_PTFIELDS + 1 },
- { OOBIN_ID_PTFILTER, OOBIN_ID_PTFILTER + 1 },
- { OOBIN_ID_PTFILTERS, OOBIN_ID_PTFILTERS + 1 },
- { OOBIN_ID_PTFITEM, OOBIN_ID_PTFITEM - 1 },
- { OOBIN_ID_PTFITEMS, OOBIN_ID_PTFITEMS + 1 },
- { OOBIN_ID_PTLOCATION, OOBIN_ID_PTLOCATION - 1 },
- { OOBIN_ID_PTPAGEFIELD, OOBIN_ID_PTPAGEFIELD + 1 },
- { OOBIN_ID_PTPAGEFIELDS, OOBIN_ID_PTPAGEFIELDS + 1 },
- { OOBIN_ID_PTREFERENCE, OOBIN_ID_PTREFERENCE + 1 },
- { OOBIN_ID_PTREFERENCEITEM, OOBIN_ID_PTREFERENCEITEM + 1 },
- { OOBIN_ID_PTREFERENCES, OOBIN_ID_PTREFERENCES + 1 },
- { OOBIN_ID_PTROWFIELDS, OOBIN_ID_PTROWFIELDS + 1 },
- { -1, -1 }
+ { BIFF12_ID_AUTOFILTER, BIFF12_ID_AUTOFILTER + 1 },
+ { BIFF12_ID_AUTOSORTSCOPE, BIFF12_ID_AUTOSORTSCOPE + 1 },
+ { BIFF12_ID_FILTERCOLUMN, BIFF12_ID_FILTERCOLUMN + 1 },
+ { BIFF12_ID_PIVOTAREA, BIFF12_ID_PIVOTAREA + 1 },
+ { BIFF12_ID_PTCOLFIELDS, BIFF12_ID_PTCOLFIELDS + 1 },
+ { BIFF12_ID_PTDATAFIELD, BIFF12_ID_PTDATAFIELD + 1 },
+ { BIFF12_ID_PTDATAFIELDS, BIFF12_ID_PTDATAFIELDS + 1 },
+ { BIFF12_ID_PTDEFINITION, BIFF12_ID_PTDEFINITION + 35 },
+ { BIFF12_ID_PTFIELD, BIFF12_ID_PTFIELD + 1 },
+ { BIFF12_ID_PTFIELDS, BIFF12_ID_PTFIELDS + 1 },
+ { BIFF12_ID_PTFILTER, BIFF12_ID_PTFILTER + 1 },
+ { BIFF12_ID_PTFILTERS, BIFF12_ID_PTFILTERS + 1 },
+ { BIFF12_ID_PTFITEM, BIFF12_ID_PTFITEM - 1 },
+ { BIFF12_ID_PTFITEMS, BIFF12_ID_PTFITEMS + 1 },
+ { BIFF12_ID_PTLOCATION, BIFF12_ID_PTLOCATION - 1 },
+ { BIFF12_ID_PTPAGEFIELD, BIFF12_ID_PTPAGEFIELD + 1 },
+ { BIFF12_ID_PTPAGEFIELDS, BIFF12_ID_PTPAGEFIELDS + 1 },
+ { BIFF12_ID_PTREFERENCE, BIFF12_ID_PTREFERENCE + 1 },
+ { BIFF12_ID_PTREFERENCEITEM, BIFF12_ID_PTREFERENCEITEM + 1 },
+ { BIFF12_ID_PTREFERENCES, BIFF12_ID_PTREFERENCES + 1 },
+ { BIFF12_ID_PTROWFIELDS, BIFF12_ID_PTROWFIELDS + 1 },
+ { -1, -1 }
};
return spRecInfos;
}
@@ -292,22 +295,22 @@ const RecordInfo* OoxPivotTableFragment::getRecordInfos() const
// ============================================================================
// ============================================================================
-BiffPivotTableContext::BiffPivotTableContext( const BiffWorksheetFragmentBase& rFragment, PivotTable& rPivotTable ) :
- BiffWorksheetContextBase( rFragment ),
- mrPivotTable( rPivotTable )
+BiffPivotTableContext::BiffPivotTableContext( const WorksheetHelper& rHelper ) :
+ BiffWorksheetContextBase( rHelper ),
+ mrPivotTable( getPivotTables().createPivotTable() )
{
}
-void BiffPivotTableContext::importRecord()
+void BiffPivotTableContext::importRecord( BiffInputStream& rStrm )
{
- switch( mrStrm.getRecId() )
+ switch( rStrm.getRecId() )
{
- case BIFF_ID_PTDEFINITION: mrPivotTable.importPTDefinition( mrStrm, getSheetIndex() ); break;
- case BIFF_ID_PTDEFINITION2: mrPivotTable.importPTDefinition2( mrStrm ); break;
- case BIFF_ID_PTFIELD: mrPivotTable.createTableField().importPTField( mrStrm ); break;
- case BIFF_ID_PTROWCOLFIELDS: mrPivotTable.importPTRowColFields( mrStrm ); break;
- case BIFF_ID_PTPAGEFIELDS: mrPivotTable.importPTPageFields( mrStrm ); break;
- case BIFF_ID_PTDATAFIELD: mrPivotTable.importPTDataField( mrStrm ); break;
+ case BIFF_ID_PTDEFINITION: mrPivotTable.importPTDefinition( rStrm, getSheetIndex() ); break;
+ case BIFF_ID_PTDEFINITION2: mrPivotTable.importPTDefinition2( rStrm ); break;
+ case BIFF_ID_PTFIELD: mrPivotTable.createTableField().importPTField( rStrm ); break;
+ case BIFF_ID_PTROWCOLFIELDS: mrPivotTable.importPTRowColFields( rStrm ); break;
+ case BIFF_ID_PTPAGEFIELDS: mrPivotTable.importPTPageFields( rStrm ); break;
+ case BIFF_ID_PTDATAFIELD: mrPivotTable.importPTDataField( rStrm ); break;
}
}
@@ -316,4 +319,4 @@ void BiffPivotTableContext::importRecord()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/querytablebuffer.cxx b/oox/source/xls/querytablebuffer.cxx
new file mode 100644
index 000000000000..28ace4de52d8
--- /dev/null
+++ b/oox/source/xls/querytablebuffer.cxx
@@ -0,0 +1,390 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "oox/xls/querytablebuffer.hxx"
+
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/sheet/XAreaLink.hpp>
+#include <com/sun/star/sheet/XAreaLinks.hpp>
+#include "oox/core/filterbase.hxx"
+#include "oox/helper/attributelist.hxx"
+#include "oox/xls/addressconverter.hxx"
+#include "oox/xls/biffinputstream.hxx"
+#include "oox/xls/connectionsbuffer.hxx"
+#include "oox/xls/defnamesbuffer.hxx"
+
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
+namespace {
+
+const sal_uInt32 BIFF12_QUERYTABLE_HEADERS = 0x00000001;
+const sal_uInt32 BIFF12_QUERYTABLE_ROWNUMBERS = 0x00000002;
+const sal_uInt32 BIFF12_QUERYTABLE_DISABLEREFRESH = 0x00000004;
+const sal_uInt32 BIFF12_QUERYTABLE_BACKGROUND = 0x00000008;
+const sal_uInt32 BIFF12_QUERYTABLE_FIRSTBACKGROUND = 0x00000010;
+const sal_uInt32 BIFF12_QUERYTABLE_REFRESHONLOAD = 0x00000020;
+const sal_uInt32 BIFF12_QUERYTABLE_FILLFORMULAS = 0x00000100;
+const sal_uInt32 BIFF12_QUERYTABLE_SAVEDATA = 0x00000200;
+const sal_uInt32 BIFF12_QUERYTABLE_DISABLEEDIT = 0x00000400;
+const sal_uInt32 BIFF12_QUERYTABLE_PRESERVEFORMAT = 0x00000800;
+const sal_uInt32 BIFF12_QUERYTABLE_ADJUSTCOLWIDTH = 0x00001000;
+const sal_uInt32 BIFF12_QUERYTABLE_INTERMEDIATE = 0x00002000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYNUMFMT = 0x00004000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYFONT = 0x00008000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYALIGNMENT = 0x00010000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYBORDER = 0x00020000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYFILL = 0x00040000;
+const sal_uInt32 BIFF12_QUERYTABLE_APPLYPROTECTION = 0x00080000;
+
+const sal_uInt16 BIFF_QUERYTABLE_HEADERS = 0x0001;
+const sal_uInt16 BIFF_QUERYTABLE_ROWNUMBERS = 0x0002;
+const sal_uInt16 BIFF_QUERYTABLE_DISABLEREFRESH = 0x0004;
+const sal_uInt16 BIFF_QUERYTABLE_BACKGROUND = 0x0008;
+const sal_uInt16 BIFF_QUERYTABLE_FIRSTBACKGROUND = 0x0010;
+const sal_uInt16 BIFF_QUERYTABLE_REFRESHONLOAD = 0x0020;
+const sal_uInt16 BIFF_QUERYTABLE_DELETEUNUSED = 0x0040;
+const sal_uInt16 BIFF_QUERYTABLE_FILLFORMULAS = 0x0080;
+const sal_uInt16 BIFF_QUERYTABLE_ADJUSTCOLWIDTH = 0x0100;
+const sal_uInt16 BIFF_QUERYTABLE_SAVEDATA = 0x0200;
+const sal_uInt16 BIFF_QUERYTABLE_DISABLEEDIT = 0x0400;
+const sal_uInt16 BIFF_QUERYTABLE_OVERWRITEEXISTING = 0x2000;
+
+const sal_uInt16 BIFF_QUERYTABLE_APPLYNUMFMT = 0x0001;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYFONT = 0x0002;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYALIGNMENT = 0x0004;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYBORDER = 0x0008;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYFILL = 0x0010;
+const sal_uInt16 BIFF_QUERYTABLE_APPLYPROTECTION = 0x0020;
+
+const sal_uInt32 BIFF_QTREFRESH_PRESERVEFORMAT = 0x00000001;
+const sal_uInt32 BIFF_QTREFRESH_ADJUSTCOLWIDTH = 0x00000002;
+
+// ----------------------------------------------------------------------------
+
+void lclAppendWebQueryTableName( OUStringBuffer& rTables, const OUString& rTableName )
+{
+ if( rTableName.getLength() > 0 )
+ {
+ if( rTables.getLength() > 0 )
+ rTables.append( sal_Unicode( ';' ) );
+ rTables.appendAscii( RTL_CONSTASCII_STRINGPARAM( "HTML__" ) ).append( rTableName );
+ }
+}
+
+void lclAppendWebQueryTableIndex( OUStringBuffer& rTables, sal_Int32 nTableIndex )
+{
+ if( nTableIndex > 0 )
+ {
+ if( rTables.getLength() > 0 )
+ rTables.append( sal_Unicode( ';' ) );
+ rTables.appendAscii( RTL_CONSTASCII_STRINGPARAM( "HTML_" ) ).append( nTableIndex );
+ }
+}
+
+OUString lclBuildWebQueryTables( const WebPrModel::TablesVector& rTables )
+{
+ if( rTables.empty() )
+ return CREATE_OUSTRING( "HTML_tables" );
+
+ OUStringBuffer aTables;
+ for( WebPrModel::TablesVector::const_iterator aIt = rTables.begin(), aEnd = rTables.end(); aIt != aEnd; ++aIt )
+ {
+ if( aIt->has< OUString >() )
+ lclAppendWebQueryTableName( aTables, aIt->get< OUString >() );
+ else if( aIt->has< sal_Int32 >() )
+ lclAppendWebQueryTableIndex( aTables, aIt->get< sal_Int32 >() );
+ }
+ return aTables.makeStringAndClear();
+}
+
+Reference< XAreaLink > lclFindAreaLink(
+ const Reference< XAreaLinks >& rxAreaLinks, const CellAddress& rDestPos,
+ const OUString& rFileUrl, const OUString& rTables, const OUString& rFilterName, const OUString& rFilterOptions )
+{
+ try
+ {
+ Reference< XEnumerationAccess > xAreaLinksEA( rxAreaLinks, UNO_QUERY_THROW );
+ Reference< XEnumeration > xAreaLinksEnum( xAreaLinksEA->createEnumeration(), UNO_SET_THROW );
+ while( xAreaLinksEnum->hasMoreElements() )
+ {
+ Reference< XAreaLink > xAreaLink( xAreaLinksEnum->nextElement(), UNO_QUERY_THROW );
+ PropertySet aPropSet( xAreaLink );
+ CellRangeAddress aDestArea = xAreaLink->getDestArea();
+ OUString aString;
+ if( (rDestPos.Sheet == aDestArea.Sheet) && (rDestPos.Column == aDestArea.StartColumn) && (rDestPos.Row == aDestArea.StartRow) &&
+ (rTables == xAreaLink->getSourceArea()) &&
+ aPropSet.getProperty( aString, PROP_Url ) && (rFileUrl == aString) &&
+ aPropSet.getProperty( aString, PROP_Filter ) && (rFilterName == aString) &&
+ aPropSet.getProperty( aString, PROP_FilterOptions ) && (rFilterOptions == aString) )
+ return xAreaLink;
+ }
+ }
+ catch( Exception& )
+ {
+ }
+ return Reference< XAreaLink >();
+}
+
+} // namespace
+
+// ============================================================================
+
+QueryTableModel::QueryTableModel() :
+ mnConnId( -1 ),
+ mnGrowShrinkType( XML_insertDelete ),
+ mbHeaders( true ),
+ mbRowNumbers( false ),
+ mbDisableRefresh( false ),
+ mbBackground( true ),
+ mbFirstBackground( false ),
+ mbRefreshOnLoad( false ),
+ mbFillFormulas( false ),
+ mbRemoveDataOnSave( false ),
+ mbDisableEdit( false ),
+ mbPreserveFormat( true ),
+ mbAdjustColWidth( true ),
+ mbIntermediate( false )
+{
+}
+
+// ----------------------------------------------------------------------------
+
+QueryTable::QueryTable( const WorksheetHelper& rHelper ) :
+ WorksheetHelper( rHelper )
+{
+}
+
+void QueryTable::importQueryTable( const AttributeList& rAttribs )
+{
+ maModel.maDefName = rAttribs.getXString( XML_name, OUString() );
+ maModel.mnConnId = rAttribs.getInteger( XML_connectionId, -1 );
+ maModel.mnGrowShrinkType = rAttribs.getToken( XML_growShrinkType, XML_insertDelete );
+ maModel.mnAutoFormatId = rAttribs.getInteger( XML_autoFormatId, 0 );
+ maModel.mbHeaders = rAttribs.getBool( XML_headers, true );
+ maModel.mbRowNumbers = rAttribs.getBool( XML_rowNumbers, false );
+ maModel.mbDisableRefresh = rAttribs.getBool( XML_disableRefresh, false );
+ maModel.mbBackground = rAttribs.getBool( XML_backgroundRefresh, true );
+ maModel.mbFirstBackground = rAttribs.getBool( XML_firstBackgroundRefresh, false );
+ maModel.mbRefreshOnLoad = rAttribs.getBool( XML_refreshOnLoad, false );
+ maModel.mbFillFormulas = rAttribs.getBool( XML_fillFormulas, false );
+ maModel.mbRemoveDataOnSave = rAttribs.getBool( XML_removeDataOnSave, false );
+ maModel.mbDisableEdit = rAttribs.getBool( XML_disableEdit, false );
+ maModel.mbPreserveFormat = rAttribs.getBool( XML_preserveFormatting, true );
+ maModel.mbAdjustColWidth = rAttribs.getBool( XML_adjustColumnWidth, true );
+ maModel.mbIntermediate = rAttribs.getBool( XML_intermediate, false );
+ maModel.mbApplyNumFmt = rAttribs.getBool( XML_applyNumberFormats, false );
+ maModel.mbApplyFont = rAttribs.getBool( XML_applyFontFormats, false );
+ maModel.mbApplyAlignment = rAttribs.getBool( XML_applyAlignmentFormats, false );
+ maModel.mbApplyBorder = rAttribs.getBool( XML_applyBorderFormats, false );
+ maModel.mbApplyFill = rAttribs.getBool( XML_applyPatternFormats, false );
+ // OOXML and BIFF12 documentation differ: OOXML mentions width/height, BIFF12 mentions protection
+ maModel.mbApplyProtection = rAttribs.getBool( XML_applyWidthHeightFormats, false );
+}
+
+void QueryTable::importQueryTable( SequenceInputStream& rStrm )
+{
+ sal_uInt32 nFlags;
+ rStrm >> nFlags;
+ maModel.mnAutoFormatId = rStrm.readuInt16();
+ rStrm >> maModel.mnConnId >> maModel.maDefName;
+
+ static const sal_Int32 spnGrowShrinkTypes[] = { XML_insertClear, XML_insertDelete, XML_overwriteClear };
+ maModel.mnGrowShrinkType = STATIC_ARRAY_SELECT( spnGrowShrinkTypes, extractValue< sal_uInt8 >( nFlags, 6, 2 ), XML_insertDelete );
+
+ maModel.mbHeaders = getFlag( nFlags, BIFF12_QUERYTABLE_HEADERS );
+ maModel.mbRowNumbers = getFlag( nFlags, BIFF12_QUERYTABLE_ROWNUMBERS );
+ maModel.mbDisableRefresh = getFlag( nFlags, BIFF12_QUERYTABLE_DISABLEREFRESH );
+ maModel.mbBackground = getFlag( nFlags, BIFF12_QUERYTABLE_BACKGROUND );
+ maModel.mbFirstBackground = getFlag( nFlags, BIFF12_QUERYTABLE_FIRSTBACKGROUND );
+ maModel.mbRefreshOnLoad = getFlag( nFlags, BIFF12_QUERYTABLE_REFRESHONLOAD );
+ maModel.mbFillFormulas = getFlag( nFlags, BIFF12_QUERYTABLE_FILLFORMULAS );
+ maModel.mbRemoveDataOnSave = !getFlag( nFlags, BIFF12_QUERYTABLE_SAVEDATA ); // flag negated in BIFF12
+ maModel.mbDisableEdit = getFlag( nFlags, BIFF12_QUERYTABLE_DISABLEEDIT );
+ maModel.mbPreserveFormat = getFlag( nFlags, BIFF12_QUERYTABLE_PRESERVEFORMAT );
+ maModel.mbAdjustColWidth = getFlag( nFlags, BIFF12_QUERYTABLE_ADJUSTCOLWIDTH );
+ maModel.mbIntermediate = getFlag( nFlags, BIFF12_QUERYTABLE_INTERMEDIATE );
+ maModel.mbApplyNumFmt = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYNUMFMT );
+ maModel.mbApplyFont = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYFONT );
+ maModel.mbApplyAlignment = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYALIGNMENT );
+ maModel.mbApplyBorder = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYBORDER );
+ maModel.mbApplyFill = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYFILL );
+ maModel.mbApplyProtection = getFlag( nFlags, BIFF12_QUERYTABLE_APPLYPROTECTION );
+}
+
+void QueryTable::importQueryTable( BiffInputStream& rStrm )
+{
+ sal_uInt16 nFlags, nAutoFormatFlags;
+ rStrm >> nFlags;
+ maModel.mnAutoFormatId = rStrm.readuInt16();
+ rStrm >> nAutoFormatFlags;
+ rStrm.skip( 4 );
+ maModel.maDefName = rStrm.readUniString();
+
+ bool bDeleteUnused = getFlag( nFlags, BIFF_QUERYTABLE_DELETEUNUSED );
+ bool bOverwriteExisting = getFlag( nFlags, BIFF_QUERYTABLE_OVERWRITEEXISTING );
+ OSL_ENSURE( !bDeleteUnused || !bOverwriteExisting, "QueryTable::importQueryTable - invalid flags" );
+ maModel.mnGrowShrinkType = bDeleteUnused ? XML_insertDelete : (bOverwriteExisting ? XML_overwriteClear : XML_insertClear);
+
+ maModel.mbHeaders = getFlag( nFlags, BIFF_QUERYTABLE_HEADERS );
+ maModel.mbRowNumbers = getFlag( nFlags, BIFF_QUERYTABLE_ROWNUMBERS );
+ maModel.mbDisableRefresh = getFlag( nFlags, BIFF_QUERYTABLE_DISABLEREFRESH );
+ maModel.mbBackground = getFlag( nFlags, BIFF_QUERYTABLE_BACKGROUND );
+ maModel.mbFirstBackground = getFlag( nFlags, BIFF_QUERYTABLE_FIRSTBACKGROUND );
+ maModel.mbRefreshOnLoad = getFlag( nFlags, BIFF_QUERYTABLE_REFRESHONLOAD );
+ maModel.mbFillFormulas = getFlag( nFlags, BIFF_QUERYTABLE_FILLFORMULAS );
+ maModel.mbRemoveDataOnSave = !getFlag( nFlags, BIFF_QUERYTABLE_SAVEDATA ); // flag negated in BIFF
+ maModel.mbDisableEdit = getFlag( nFlags, BIFF_QUERYTABLE_DISABLEEDIT );
+ maModel.mbAdjustColWidth = getFlag( nFlags, BIFF_QUERYTABLE_ADJUSTCOLWIDTH );
+ maModel.mbApplyNumFmt = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYNUMFMT );
+ maModel.mbApplyFont = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYFONT );
+ maModel.mbApplyAlignment = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYALIGNMENT );
+ maModel.mbApplyBorder = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYBORDER );
+ maModel.mbApplyFill = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYFILL );
+ maModel.mbApplyProtection = getFlag( nAutoFormatFlags, BIFF_QUERYTABLE_APPLYPROTECTION );
+
+ // create a new connection object that will store settings from following records
+ OSL_ENSURE( maModel.mnConnId == -1, "QueryTable::importQueryTable - multiple call" );
+ Connection& rConnection = getConnections().createConnectionWithId();
+ maModel.mnConnId = rConnection.getConnectionId();
+
+ // a DBQUERY record with some PCITEM_STRING records must follow
+ bool bHasDbQuery = (rStrm.getNextRecId() == BIFF_ID_DBQUERY) && rStrm.startNextRecord();
+ OSL_ENSURE( bHasDbQuery, "QueryTable::importQueryTable - missing DBQUERY record" );
+ if( bHasDbQuery )
+ rConnection.importDbQuery( rStrm );
+}
+
+void QueryTable::importQueryTableRefresh( BiffInputStream& rStrm )
+{
+ rStrm.skip( 4 );
+ bool bPivot = rStrm.readuInt16() != 0;
+ OSL_ENSURE( !bPivot, "QueryTable::importQueryTableRefresh - unexpected pivot flag" );
+ if( !bPivot )
+ {
+ rStrm.skip( 2 );
+ sal_uInt32 nFlags = rStrm.readuInt32();
+ maModel.mbPreserveFormat = getFlag( nFlags, BIFF_QTREFRESH_PRESERVEFORMAT );
+ maModel.mbAdjustColWidth = getFlag( nFlags, BIFF_QTREFRESH_ADJUSTCOLWIDTH );
+ }
+}
+
+void QueryTable::importQueryTableSettings( BiffInputStream& rStrm )
+{
+ ConnectionRef xConnection = getConnections().getConnection( maModel.mnConnId );
+ OSL_ENSURE( xConnection.get(), "QueryTable::importQueryTableSettings - missing connection object" );
+ if( xConnection.get() )
+ xConnection->importQueryTableSettings( rStrm );
+}
+
+void QueryTable::finalizeImport()
+{
+ ConnectionRef xConnection = getConnections().getConnection( maModel.mnConnId );
+ OSL_ENSURE( xConnection.get(), "QueryTable::finalizeImport - missing connection object" );
+ if( xConnection.get() && (xConnection->getConnectionType() == BIFF12_CONNECTION_HTML) )
+ {
+ // check that valid web query properties exist
+ const WebPrModel* pWebPr = xConnection->getModel().mxWebPr.get();
+ if( pWebPr && !pWebPr->mbXml )
+ {
+ OUString aFileUrl = getBaseFilter().getAbsoluteUrl( pWebPr->maUrl );
+ if( aFileUrl.getLength() > 0 )
+ {
+ // resolve destination cell range (stored as defined name containing the range)
+ OUString aDefName = maModel.maDefName.replace( ' ', '_' ).replace( '-', '_' );
+ DefinedNameRef xDefName = getDefinedNames().getByModelName( aDefName, getSheetIndex() );
+ OSL_ENSURE( xDefName.get(), "QueryTable::finalizeImport - missing defined name" );
+ if( xDefName.get() )
+ {
+ CellRangeAddress aDestRange;
+ bool bIsRange = xDefName->getAbsoluteRange( aDestRange ) && (aDestRange.Sheet == getSheetIndex());
+ OSL_ENSURE( bIsRange, "QueryTable::finalizeImport - defined name does not contain valid cell range" );
+ if( bIsRange && getAddressConverter().checkCellRange( aDestRange, false, true ) )
+ {
+ CellAddress aDestPos( aDestRange.Sheet, aDestRange.StartColumn, aDestRange.StartRow );
+ // find tables mode: entire document, all tables, or specific tables
+ OUString aTables = pWebPr->mbHtmlTables ? lclBuildWebQueryTables( pWebPr->maTables ) : CREATE_OUSTRING( "HTML_all" );
+ if( aTables.getLength() > 0 ) try
+ {
+ PropertySet aDocProps( getDocument() );
+ Reference< XAreaLinks > xAreaLinks( aDocProps.getAnyProperty( PROP_AreaLinks ), UNO_QUERY_THROW );
+ OUString aFilterName = CREATE_OUSTRING( "calc_HTML_WebQuery" );
+ OUString aFilterOptions;
+ xAreaLinks->insertAtPosition( aDestPos, aFileUrl, aTables, aFilterName, aFilterOptions );
+ // set refresh interval (convert minutes to seconds)
+ sal_Int32 nRefreshPeriod = xConnection->getModel().mnInterval * 60;
+ if( nRefreshPeriod > 0 )
+ {
+ PropertySet aPropSet( lclFindAreaLink( xAreaLinks, aDestPos, aFileUrl, aTables, aFilterName, aFilterOptions ) );
+ aPropSet.setProperty( PROP_RefreshPeriod, nRefreshPeriod );
+ }
+ }
+ catch( Exception& )
+ {
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+// ============================================================================
+
+QueryTableBuffer::QueryTableBuffer( const WorksheetHelper& rHelper ) :
+ WorksheetHelper( rHelper )
+{
+}
+
+QueryTable& QueryTableBuffer::createQueryTable()
+{
+ QueryTableVector::value_type xQueryTable( new QueryTable( *this ) );
+ maQueryTables.push_back( xQueryTable );
+ return *xQueryTable;
+}
+
+void QueryTableBuffer::finalizeImport()
+{
+ maQueryTables.forEachMem( &QueryTable::finalizeImport );
+}
+
+// ============================================================================
+
+} // namespace xls
+} // namespace oox
diff --git a/oox/source/xls/querytablefragment.cxx b/oox/source/xls/querytablefragment.cxx
index 73251419711e..84ba0615ce3b 100644
--- a/oox/source/xls/querytablefragment.cxx
+++ b/oox/source/xls/querytablefragment.cxx
@@ -27,32 +27,83 @@
************************************************************************/
#include "oox/xls/querytablefragment.hxx"
-#include "oox/xls/webquerybuffer.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
+#include "oox/xls/biffinputstream.hxx"
+#include "oox/xls/querytablebuffer.hxx"
namespace oox {
namespace xls {
-OoxQueryTableFragment::OoxQueryTableFragment(
- const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+// ============================================================================
+
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+QueryTableFragment::QueryTableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+ WorksheetFragmentBase( rHelper, rFragmentPath ),
+ mrQueryTable( getQueryTables().createQueryTable() )
{
}
-ContextHandlerRef OoxQueryTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef QueryTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case XML_ROOT_CONTEXT:
+ if( nElement == XLS_TOKEN( queryTable ) )
+ mrQueryTable.importQueryTable( rAttribs );
+ break;
+ }
+ return 0;
+}
+
+ContextHandlerRef QueryTableFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nElement == XLS_TOKEN( queryTable ) ) getWebQueries().importQueryTable( rAttribs );
+ if( nRecId == BIFF12_ID_QUERYTABLE )
+ mrQueryTable.importQueryTable( rStrm );
break;
}
return 0;
}
+const RecordInfo* QueryTableFragment::getRecordInfos() const
+{
+ static const RecordInfo spRecInfos[] =
+ {
+ { BIFF12_ID_QUERYTABLE, BIFF12_ID_QUERYTABLE + 1 },
+ { BIFF12_ID_QUERYTABLEREFRESH, BIFF12_ID_QUERYTABLEREFRESH + 1 },
+ { -1, -1 }
+ };
+ return spRecInfos;
+}
+
+// ============================================================================
+
+BiffQueryTableContext::BiffQueryTableContext( const WorksheetHelper& rHelper ) :
+ BiffWorksheetContextBase( rHelper ),
+ mrQueryTable( getQueryTables().createQueryTable() )
+{
+}
+
+void BiffQueryTableContext::importRecord( BiffInputStream& rStrm )
+{
+ switch( rStrm.getRecId() )
+ {
+ case BIFF_ID_QUERYTABLE: mrQueryTable.importQueryTable( rStrm ); break;
+ case BIFF_ID_QUERYTABLEREFRESH: mrQueryTable.importQueryTableRefresh( rStrm ); break;
+ case BIFF_ID_QUERYTABLESETTINGS: mrQueryTable.importQueryTableSettings( rStrm ); break;
+ }
+}
+
+// ============================================================================
+
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/richstring.cxx b/oox/source/xls/richstring.cxx
index 0e2b067105c6..2f2db66573af 100644
--- a/oox/source/xls/richstring.cxx
+++ b/oox/source/xls/richstring.cxx
@@ -27,29 +27,31 @@
************************************************************************/
#include "oox/xls/richstring.hxx"
-#include <rtl/ustrbuf.hxx>
+
#include <com/sun/star/text/XText.hpp>
+#include <rtl/ustrbuf.hxx>
#include "oox/helper/attributelist.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/biffinputstream.hxx"
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+
using ::rtl::OString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::text::XText;
-using ::com::sun::star::text::XTextRange;
-
-namespace oox {
-namespace xls {
// ============================================================================
namespace {
-const sal_uInt8 OOBIN_STRINGFLAG_FONTS = 0x01;
-const sal_uInt8 OOBIN_STRINGFLAG_PHONETICS = 0x02;
+const sal_uInt8 BIFF12_STRINGFLAG_FONTS = 0x01;
+const sal_uInt8 BIFF12_STRINGFLAG_PHONETICS = 0x02;
} // namespace
@@ -120,7 +122,7 @@ void RichStringPortion::writeFontProperties( const Reference<XText>& rxText, sal
// ----------------------------------------------------------------------------
-void FontPortionModel::read( RecordInputStream& rStrm )
+void FontPortionModel::read( SequenceInputStream& rStrm )
{
mnPos = rStrm.readuInt16();
mnFontId = rStrm.readuInt16();
@@ -158,7 +160,7 @@ void FontPortionModelList::appendPortion( const FontPortionModel& rPortion )
back().mnFontId = rPortion.mnFontId;
}
-void FontPortionModelList::importPortions( RecordInputStream& rStrm )
+void FontPortionModelList::importPortions( SequenceInputStream& rStrm )
{
sal_Int32 nCount = rStrm.readInt32();
clear();
@@ -205,7 +207,7 @@ PhoneticDataModel::PhoneticDataModel() :
{
}
-void PhoneticDataModel::setBinData( sal_Int32 nType, sal_Int32 nAlignment )
+void PhoneticDataModel::setBiffData( sal_Int32 nType, sal_Int32 nAlignment )
{
static const sal_Int32 spnTypeIds[] = { XML_halfwidthKatakana, XML_fullwidthKatakana, XML_hiragana, XML_noConversion };
mnType = STATIC_ARRAY_SELECT( spnTypeIds, nType, XML_fullwidthKatakana );
@@ -228,13 +230,13 @@ void PhoneticSettings::importPhoneticPr( const AttributeList& rAttribs )
maModel.mnAlignment = rAttribs.getToken( XML_alignment, XML_left );
}
-void PhoneticSettings::importPhoneticPr( RecordInputStream& rStrm )
+void PhoneticSettings::importPhoneticPr( SequenceInputStream& rStrm )
{
sal_uInt16 nFontId;
sal_Int32 nType, nAlignment;
rStrm >> nFontId >> nType >> nAlignment;
maModel.mnFontId = nFontId;
- maModel.setBinData( nType, nAlignment );
+ maModel.setBiffData( nType, nAlignment );
}
void PhoneticSettings::importPhoneticPr( BiffInputStream& rStrm )
@@ -242,16 +244,16 @@ void PhoneticSettings::importPhoneticPr( BiffInputStream& rStrm )
sal_uInt16 nFontId, nFlags;
rStrm >> nFontId >> nFlags;
maModel.mnFontId = nFontId;
- maModel.setBinData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
+ maModel.setBiffData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
// following: range list with cells showing phonetic text
}
-void PhoneticSettings::importStringData( RecordInputStream& rStrm )
+void PhoneticSettings::importStringData( SequenceInputStream& rStrm )
{
sal_uInt16 nFontId, nFlags;
rStrm >> nFontId >> nFlags;
maModel.mnFontId = nFontId;
- maModel.setBinData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
+ maModel.setBiffData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
}
void PhoneticSettings::importStringData( BiffInputStream& rStrm )
@@ -259,7 +261,7 @@ void PhoneticSettings::importStringData( BiffInputStream& rStrm )
sal_uInt16 nFontId, nFlags;
rStrm >> nFontId >> nFlags;
maModel.mnFontId = nFontId;
- maModel.setBinData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
+ maModel.setBiffData( extractValue< sal_Int32 >( nFlags, 0, 2 ), extractValue< sal_Int32 >( nFlags, 2, 2 ) );
}
// ============================================================================
@@ -290,7 +292,7 @@ void RichStringPhonetic::setBaseRange( sal_Int32 nBasePos, sal_Int32 nBaseEnd )
// ----------------------------------------------------------------------------
-void PhoneticPortionModel::read( RecordInputStream& rStrm )
+void PhoneticPortionModel::read( SequenceInputStream& rStrm )
{
mnPos = rStrm.readuInt16();
mnBasePos = rStrm.readuInt16();
@@ -323,7 +325,7 @@ void PhoneticPortionModelList::appendPortion( const PhoneticPortionModel& rPorti
}
}
-void PhoneticPortionModelList::importPortions( RecordInputStream& rStrm )
+void PhoneticPortionModelList::importPortions( SequenceInputStream& rStrm )
{
sal_Int32 nCount = rStrm.readInt32();
clear();
@@ -395,12 +397,12 @@ void RichString::importPhoneticPr( const AttributeList& rAttribs )
maPhonSettings.importPhoneticPr( rAttribs );
}
-void RichString::importString( RecordInputStream& rStrm, bool bRich )
+void RichString::importString( SequenceInputStream& rStrm, bool bRich )
{
sal_uInt8 nFlags = bRich ? rStrm.readuInt8() : 0;
- OUString aBaseText = rStrm.readString();
+ OUString aBaseText = BiffHelper::readString( rStrm );
- if( !rStrm.isEof() && getFlag( nFlags, OOBIN_STRINGFLAG_FONTS ) )
+ if( !rStrm.isEof() && getFlag( nFlags, BIFF12_STRINGFLAG_FONTS ) )
{
FontPortionModelList aPortions;
aPortions.importPortions( rStrm );
@@ -411,9 +413,9 @@ void RichString::importString( RecordInputStream& rStrm, bool bRich )
createPortion()->setText( aBaseText );
}
- if( !rStrm.isEof() && getFlag( nFlags, OOBIN_STRINGFLAG_PHONETICS ) )
+ if( !rStrm.isEof() && getFlag( nFlags, BIFF12_STRINGFLAG_PHONETICS ) )
{
- OUString aPhoneticText = rStrm.readString();
+ OUString aPhoneticText = BiffHelper::readString( rStrm );
PhoneticPortionModelList aPortions;
aPortions.importPortions( rStrm );
maPhonSettings.importStringData( rStrm );
@@ -636,4 +638,4 @@ void RichString::createPhoneticPortions( const ::rtl::OUString& rText, PhoneticP
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/richstringcontext.cxx b/oox/source/xls/richstringcontext.cxx
index 015d01b72684..aa231062dda6 100644
--- a/oox/source/xls/richstringcontext.cxx
+++ b/oox/source/xls/richstringcontext.cxx
@@ -27,28 +27,37 @@
************************************************************************/
#include "oox/xls/richstringcontext.hxx"
-#include "oox/xls/stylesfragment.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
+#include "oox/xls/stylesfragment.hxx"
namespace oox {
namespace xls {
// ============================================================================
-// oox.core.ContextHandler2Helper interface -----------------------------------
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
-ContextHandlerRef OoxRichStringContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef RichStringContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
if( isRootElement() )
{
switch( nElement )
{
- case XLS_TOKEN( t ): mxPortion = mxString->importText( rAttribs ); return this; // collect text in onEndElement()
- case XLS_TOKEN( r ): mxPortion = mxString->importRun( rAttribs ); return this;
- case XLS_TOKEN( rPh ): mxPhonetic = mxString->importPhoneticRun( rAttribs ); return this;
- case XLS_TOKEN( phoneticPr ): mxString->importPhoneticPr( rAttribs ); break;
+ case XLS_TOKEN( t ):
+ mxPortion = mxString->importText( rAttribs );
+ return this; // collect text in onCharacters()
+ case XLS_TOKEN( r ):
+ mxPortion = mxString->importRun( rAttribs );
+ return this;
+ case XLS_TOKEN( rPh ):
+ mxPhonetic = mxString->importPhoneticRun( rAttribs );
+ return this;
+ case XLS_TOKEN( phoneticPr ):
+ mxString->importPhoneticPr( rAttribs );
+ break;
}
}
else switch( getCurrentElement() )
@@ -58,11 +67,11 @@ ContextHandlerRef OoxRichStringContext::onCreateContext( sal_Int32 nElement, con
{
case XLS_TOKEN( rPr ):
if( mxPortion.get() )
- return new OoxFontContext( *this, mxPortion->createFont() );
+ return new FontContext( *this, mxPortion->createFont() );
break;
case XLS_TOKEN( t ):
- return this; // collect portion text in onEndElement()
+ return this; // collect portion text in onCharacters()
}
break;
@@ -70,22 +79,24 @@ ContextHandlerRef OoxRichStringContext::onCreateContext( sal_Int32 nElement, con
switch( nElement )
{
case XLS_TOKEN( t ):
- return this; // collect phonetic text in onEndElement()
+ return this; // collect phonetic text in onCharacters()
}
break;
}
return 0;
}
-void OoxRichStringContext::onEndElement( const OUString& rChars )
+void RichStringContext::onCharacters( const OUString& rChars )
{
- if( getCurrentElement() == XLS_TOKEN( t ) )
+ if( isCurrentElement( XLS_TOKEN( t ) ) ) switch( getParentElement() )
{
- switch( getPreviousElement() )
- {
- case XLS_TOKEN( rPh ): if( mxPhonetic.get() ) mxPhonetic->setText( rChars ); break;
- default: if( mxPortion.get() ) mxPortion->setText( rChars ); break;
- }
+ case XLS_TOKEN( rPh ):
+ if( mxPhonetic.get() )
+ mxPhonetic->setText( rChars );
+ break;
+ default:
+ if( mxPortion.get() )
+ mxPortion->setText( rChars );
}
}
@@ -94,4 +105,4 @@ void OoxRichStringContext::onEndElement( const OUString& rChars )
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/scenariobuffer.cxx b/oox/source/xls/scenariobuffer.cxx
index 0cdd54f5c9cf..b5c6268bfc02 100644
--- a/oox/source/xls/scenariobuffer.cxx
+++ b/oox/source/xls/scenariobuffer.cxx
@@ -27,39 +27,33 @@
************************************************************************/
#include "oox/xls/scenariobuffer.hxx"
+
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/sheet/XScenario.hpp>
#include <com/sun/star/sheet/XScenarios.hpp>
#include <com/sun/star/sheet/XScenariosSupplier.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include "properties.hxx"
#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::XCell;
-using ::com::sun::star::sheet::XScenario;
-using ::com::sun::star::sheet::XScenarios;
-using ::com::sun::star::sheet::XScenariosSupplier;
-using ::com::sun::star::sheet::XSpreadsheet;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
const sal_Int32 BIFF_SCENARIO_DELETED = 0x4000;
@@ -109,7 +103,7 @@ void Scenario::importInputCells( const AttributeList& rAttribs )
maCells.push_back( aModel );
}
-void Scenario::importScenario( RecordInputStream& rStrm )
+void Scenario::importScenario( SequenceInputStream& rStrm )
{
rStrm.skip( 2 ); // cell count
// two longs instead of flag field
@@ -118,7 +112,7 @@ void Scenario::importScenario( RecordInputStream& rStrm )
rStrm >> maModel.maName >> maModel.maComment >> maModel.maUser;
}
-void Scenario::importInputCells( RecordInputStream& rStrm )
+void Scenario::importInputCells( SequenceInputStream& rStrm )
{
// TODO: where is the deleted flag?
ScenarioCellModel aModel;
@@ -239,7 +233,7 @@ void SheetScenarios::importScenarios( const AttributeList& rAttribs )
maModel.mnShown = rAttribs.getInteger( XML_show, 0 );
}
-void SheetScenarios::importScenarios( RecordInputStream& rStrm )
+void SheetScenarios::importScenarios( SequenceInputStream& rStrm )
{
maModel.mnCurrent = rStrm.readuInt16();
maModel.mnShown = rStrm.readuInt16();
@@ -305,4 +299,4 @@ void ScenarioBuffer::finalizeImport()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/scenariocontext.cxx b/oox/source/xls/scenariocontext.cxx
index c244065aa876..885c0c751908 100644
--- a/oox/source/xls/scenariocontext.cxx
+++ b/oox/source/xls/scenariocontext.cxx
@@ -27,22 +27,25 @@
************************************************************************/
#include "oox/xls/scenariocontext.hxx"
-#include "oox/xls/scenariobuffer.hxx"
-using ::oox::core::ContextHandlerRef;
+#include "oox/xls/scenariobuffer.hxx"
namespace oox {
namespace xls {
// ============================================================================
-OoxScenarioContext::OoxScenarioContext( OoxWorksheetContextBase& rParent, SheetScenarios& rSheetScenarios ) :
- OoxWorksheetContextBase( rParent ),
+using ::oox::core::ContextHandlerRef;
+
+// ============================================================================
+
+ScenarioContext::ScenarioContext( WorksheetContextBase& rParent, SheetScenarios& rSheetScenarios ) :
+ WorksheetContextBase( rParent ),
mrScenario( rSheetScenarios.createScenario() )
{
}
-ContextHandlerRef OoxScenarioContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef ScenarioContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -53,24 +56,24 @@ ContextHandlerRef OoxScenarioContext::onCreateContext( sal_Int32 nElement, const
return 0;
}
-void OoxScenarioContext::onStartElement( const AttributeList& rAttribs )
+void ScenarioContext::onStartElement( const AttributeList& rAttribs )
{
if( isRootElement() )
mrScenario.importScenario( rAttribs );
}
-ContextHandlerRef OoxScenarioContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef ScenarioContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_SCENARIO:
- if( nRecId == OOBIN_ID_INPUTCELLS ) mrScenario.importInputCells( rStrm );
+ case BIFF12_ID_SCENARIO:
+ if( nRecId == BIFF12_ID_INPUTCELLS ) mrScenario.importInputCells( rStrm );
break;
}
return 0;
}
-void OoxScenarioContext::onStartRecord( RecordInputStream& rStrm )
+void ScenarioContext::onStartRecord( SequenceInputStream& rStrm )
{
if( isRootElement() )
mrScenario.importScenario( rStrm );
@@ -78,41 +81,41 @@ void OoxScenarioContext::onStartRecord( RecordInputStream& rStrm )
// ============================================================================
-OoxScenariosContext::OoxScenariosContext( OoxWorksheetFragmentBase& rFragment ) :
- OoxWorksheetContextBase( rFragment ),
+ScenariosContext::ScenariosContext( WorksheetFragmentBase& rFragment ) :
+ WorksheetContextBase( rFragment ),
mrSheetScenarios( getScenarios().createSheetScenarios( getSheetIndex() ) )
{
}
-ContextHandlerRef OoxScenariosContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
+ContextHandlerRef ScenariosContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
{
switch( getCurrentElement() )
{
case XLS_TOKEN( scenarios ):
- if( nElement == XLS_TOKEN( scenario ) ) return new OoxScenarioContext( *this, mrSheetScenarios );
+ if( nElement == XLS_TOKEN( scenario ) ) return new ScenarioContext( *this, mrSheetScenarios );
break;
}
return 0;
}
-void OoxScenariosContext::onStartElement( const AttributeList& rAttribs )
+void ScenariosContext::onStartElement( const AttributeList& rAttribs )
{
if( isRootElement() )
mrSheetScenarios.importScenarios( rAttribs );
}
-ContextHandlerRef OoxScenariosContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& )
+ContextHandlerRef ScenariosContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_SCENARIOS:
- if( nRecId == OOBIN_ID_SCENARIO ) return new OoxScenarioContext( *this, mrSheetScenarios );
+ case BIFF12_ID_SCENARIOS:
+ if( nRecId == BIFF12_ID_SCENARIO ) return new ScenarioContext( *this, mrSheetScenarios );
break;
}
return 0;
}
-void OoxScenariosContext::onStartRecord( RecordInputStream& rStrm )
+void ScenariosContext::onStartRecord( SequenceInputStream& rStrm )
{
if( isRootElement() )
mrSheetScenarios.importScenarios( rStrm );
@@ -123,4 +126,4 @@ void OoxScenariosContext::onStartRecord( RecordInputStream& rStrm )
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/sharedformulabuffer.cxx b/oox/source/xls/sharedformulabuffer.cxx
index 46f0712b22ec..129b4e2fb010 100644
--- a/oox/source/xls/sharedformulabuffer.cxx
+++ b/oox/source/xls/sharedformulabuffer.cxx
@@ -27,30 +27,28 @@
************************************************************************/
#include "oox/xls/sharedformulabuffer.hxx"
-#include <rtl/ustrbuf.hxx>
+
#include <com/sun/star/sheet/XFormulaTokens.hpp>
-#include "properties.hxx"
+#include <rtl/ustrbuf.hxx>
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/formulaparser.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::sheet::XFormulaTokens;
-using ::com::sun::star::sheet::XNamedRange;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
bool operator==( const CellAddress& rAddr1, const CellAddress& rAddr2 )
@@ -114,7 +112,7 @@ void SharedFormulaBuffer::importSharedFmla( const OUString& rFormula, const OUSt
}
}
-void SharedFormulaBuffer::importSharedFmla( RecordInputStream& rStrm, const CellAddress& rBaseAddr )
+void SharedFormulaBuffer::importSharedFmla( SequenceInputStream& rStrm, const CellAddress& rBaseAddr )
{
BinRange aRange;
rStrm >> aRange;
@@ -214,4 +212,4 @@ void SharedFormulaBuffer::updateCachedCell( const CellAddress& rBaseAddr, const
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/sharedstringsbuffer.cxx b/oox/source/xls/sharedstringsbuffer.cxx
index c11b7c225be9..8e023d54a37d 100644
--- a/oox/source/xls/sharedstringsbuffer.cxx
+++ b/oox/source/xls/sharedstringsbuffer.cxx
@@ -27,16 +27,19 @@
************************************************************************/
#include "oox/xls/sharedstringsbuffer.hxx"
-#include "oox/xls/biffinputstream.hxx"
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::text::XText;
+#include "oox/xls/biffinputstream.hxx"
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+
+// ============================================================================
+
SharedStringsBuffer::SharedStringsBuffer( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper )
{
@@ -83,4 +86,4 @@ void SharedStringsBuffer::convertString( const Reference< XText >& rxText, sal_I
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/sharedstringsfragment.cxx b/oox/source/xls/sharedstringsfragment.cxx
index 0dc8ab221ab3..8d592b828903 100644
--- a/oox/source/xls/sharedstringsfragment.cxx
+++ b/oox/source/xls/sharedstringsfragment.cxx
@@ -27,27 +27,28 @@
************************************************************************/
#include "oox/xls/sharedstringsfragment.hxx"
-#include "oox/xls/sharedstringsbuffer.hxx"
-#include "oox/xls/richstringcontext.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
+#include "oox/xls/richstringcontext.hxx"
+#include "oox/xls/sharedstringsbuffer.hxx"
namespace oox {
namespace xls {
// ============================================================================
-OoxSharedStringsFragment::OoxSharedStringsFragment(
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+SharedStringsFragment::SharedStringsFragment(
const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+ WorkbookFragmentBase( rHelper, rFragmentPath )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxSharedStringsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& )
+ContextHandlerRef SharedStringsFragment::onCreateContext( sal_Int32 nElement, const AttributeList& )
{
switch( getCurrentElement() )
{
@@ -58,42 +59,40 @@ ContextHandlerRef OoxSharedStringsFragment::onCreateContext( sal_Int32 nElement,
case XLS_TOKEN( sst ):
if( nElement == XLS_TOKEN( si ) )
- return new OoxRichStringContext( *this, getSharedStrings().createRichString() );
+ return new RichStringContext( *this, getSharedStrings().createRichString() );
break;
}
return 0;
}
-ContextHandlerRef OoxSharedStringsFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef SharedStringsFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_SST )
+ if( nRecId == BIFF12_ID_SST )
return this;
break;
- case OOBIN_ID_SST:
- if( nRecId == OOBIN_ID_SI )
+ case BIFF12_ID_SST:
+ if( nRecId == BIFF12_ID_SI )
getSharedStrings().createRichString()->importString( rStrm, true );
break;
}
return 0;
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxSharedStringsFragment::getRecordInfos() const
+const RecordInfo* SharedStringsFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_SST, OOBIN_ID_SST + 1 },
+ { BIFF12_ID_SST, BIFF12_ID_SST + 1 },
{ -1, -1 }
};
return spRecInfos;
}
-void OoxSharedStringsFragment::finalizeImport()
+void SharedStringsFragment::finalizeImport()
{
getSharedStrings().finalizeImport();
}
@@ -103,4 +102,4 @@ void OoxSharedStringsFragment::finalizeImport()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/sheetdatacontext.cxx b/oox/source/xls/sheetdatacontext.cxx
index a7aa5d303122..fa37a5e8a57a 100644
--- a/oox/source/xls/sheetdatacontext.cxx
+++ b/oox/source/xls/sheetdatacontext.cxx
@@ -27,15 +27,15 @@
************************************************************************/
#include "oox/xls/sheetdatacontext.hxx"
+
+#include <com/sun/star/sheet/XArrayFormulaTokens.hpp>
+#include <com/sun/star/sheet/XFormulaTokens.hpp>
#include <com/sun/star/table/CellContentType.hpp>
#include <com/sun/star/table/XCell.hpp>
#include <com/sun/star/table/XCellRange.hpp>
-#include <com/sun/star/sheet/XFormulaTokens.hpp>
-#include <com/sun/star/sheet/XArrayFormulaTokens.hpp>
#include <com/sun/star/text/XText.hpp>
#include "oox/helper/attributelist.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/formulaparser.hxx"
@@ -43,47 +43,39 @@
#include "oox/xls/sharedformulabuffer.hxx"
#include "oox/xls/unitconverter.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::CellContentType_EMPTY;
-using ::com::sun::star::table::XCell;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::sheet::XFormulaTokens;
-using ::com::sun::star::sheet::XArrayFormulaTokens;
-using ::com::sun::star::text::XText;
-using ::oox::core::ContextHandlerRef;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::ContextHandlerRef;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
// record constants -----------------------------------------------------------
-const sal_uInt32 OOBIN_CELL_SHOWPHONETIC = 0x01000000;
-
-const sal_uInt8 OOBIN_DATATABLE_ROW = 0x01;
-const sal_uInt8 OOBIN_DATATABLE_2D = 0x02;
-const sal_uInt8 OOBIN_DATATABLE_REF1DEL = 0x04;
-const sal_uInt8 OOBIN_DATATABLE_REF2DEL = 0x08;
+const sal_uInt32 BIFF12_CELL_SHOWPHONETIC = 0x01000000;
-const sal_uInt16 OOBIN_ROW_THICKTOP = 0x0001;
-const sal_uInt16 OOBIN_ROW_THICKBOTTOM = 0x0002;
-const sal_uInt16 OOBIN_ROW_COLLAPSED = 0x0800;
-const sal_uInt16 OOBIN_ROW_HIDDEN = 0x1000;
-const sal_uInt16 OOBIN_ROW_CUSTOMHEIGHT = 0x2000;
-const sal_uInt16 OOBIN_ROW_CUSTOMFORMAT = 0x4000;
-const sal_uInt8 OOBIN_ROW_SHOWPHONETIC = 0x01;
+const sal_uInt8 BIFF12_DATATABLE_ROW = 0x01;
+const sal_uInt8 BIFF12_DATATABLE_2D = 0x02;
+const sal_uInt8 BIFF12_DATATABLE_REF1DEL = 0x04;
+const sal_uInt8 BIFF12_DATATABLE_REF2DEL = 0x08;
-const sal_uInt8 BIFF_BOOLERR_BOOL = 0;
-const sal_uInt8 BIFF_BOOLERR_ERROR = 1;
+const sal_uInt16 BIFF12_ROW_THICKTOP = 0x0001;
+const sal_uInt16 BIFF12_ROW_THICKBOTTOM = 0x0002;
+const sal_uInt16 BIFF12_ROW_COLLAPSED = 0x0800;
+const sal_uInt16 BIFF12_ROW_HIDDEN = 0x1000;
+const sal_uInt16 BIFF12_ROW_CUSTOMHEIGHT = 0x2000;
+const sal_uInt16 BIFF12_ROW_CUSTOMFORMAT = 0x4000;
+const sal_uInt8 BIFF12_ROW_SHOWPHONETIC = 0x01;
const sal_uInt16 BIFF_DATATABLE_ROW = 0x0004;
const sal_uInt16 BIFF_DATATABLE_2D = 0x0008;
@@ -163,14 +155,12 @@ void ArrayFormulaContext::setTokens( const ApiTokenSequence& rTokens )
// ============================================================================
-OoxSheetDataContext::OoxSheetDataContext( OoxWorksheetFragmentBase& rFragment ) :
- OoxWorksheetContextBase( rFragment )
+SheetDataContext::SheetDataContext( WorksheetFragmentBase& rFragment ) :
+ WorksheetContextBase( rFragment )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxSheetDataContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef SheetDataContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -187,7 +177,7 @@ ContextHandlerRef OoxSheetDataContext::onCreateContext( sal_Int32 nElement, cons
{
case XLS_TOKEN( is ):
mxInlineStr.reset( new RichString( *this ) );
- return new OoxRichStringContext( *this, mxInlineStr );
+ return new RichStringContext( *this, mxInlineStr );
case XLS_TOKEN( v ):
return this;
case XLS_TOKEN( f ):
@@ -199,7 +189,7 @@ ContextHandlerRef OoxSheetDataContext::onCreateContext( sal_Int32 nElement, cons
return 0;
}
-void OoxSheetDataContext::onEndElement( const OUString& rChars )
+void SheetDataContext::onCharacters( const OUString& rChars )
{
switch( getCurrentElement() )
{
@@ -253,84 +243,85 @@ void OoxSheetDataContext::onEndElement( const OUString& rChars )
break;
default:
- OSL_ENSURE( false, "OoxSheetDataContext::onEndElement - unknown formula type" );
+ OSL_ENSURE( false, "SheetDataContext::onCharacters - unknown formula type" );
}
}
catch( Exception& )
{
}
break;
+ }
+}
- case XLS_TOKEN( c ):
- if( maCurrCell.mxCell.is() )
+void SheetDataContext::onEndElement()
+{
+ if( isCurrentElement( XLS_TOKEN( c ) ) && maCurrCell.mxCell.is() )
+ {
+ if( maCurrCell.mxCell->getType() == CellContentType_EMPTY )
+ {
+ if( maCurrCell.mbHasValueStr )
{
- if( maCurrCell.mxCell->getType() == CellContentType_EMPTY )
- {
- if( maCurrCell.mbHasValueStr )
- {
- // implemented in WorksheetHelper class
- setCell( maCurrCell );
- }
- else if( (maCurrCell.mnCellType == XML_inlineStr) && mxInlineStr.get() )
- {
- // convert font settings
- mxInlineStr->finalizeImport();
- // write string to cell
- Reference< XText > xText( maCurrCell.mxCell, UNO_QUERY );
- if( xText.is() )
- mxInlineStr->convert( xText, maCurrCell.mnXfId );
- }
- else
- {
- // empty cell, update cell type
- maCurrCell.mnCellType = XML_TOKEN_INVALID;
- }
- }
-
- // store the cell formatting data
- setCellFormat( maCurrCell );
+ // implemented in WorksheetHelper class
+ setCell( maCurrCell );
}
- break;
+ else if( (maCurrCell.mnCellType == XML_inlineStr) && mxInlineStr.get() )
+ {
+ // convert font settings
+ mxInlineStr->finalizeImport();
+ // write string to cell
+ Reference< XText > xText( maCurrCell.mxCell, UNO_QUERY );
+ if( xText.is() )
+ mxInlineStr->convert( xText, maCurrCell.mnXfId );
+ }
+ else
+ {
+ // empty cell, update cell type
+ maCurrCell.mnCellType = XML_TOKEN_INVALID;
+ }
+ }
+
+ // store the cell formatting data
+ setCellFormat( maCurrCell );
}
}
-ContextHandlerRef OoxSheetDataContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef SheetDataContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_SHEETDATA:
+ case BIFF12_ID_SHEETDATA:
switch( nRecId )
{
- case OOBIN_ID_ROW: importRow( rStrm ); return this;
+ case BIFF12_ID_ROW: importRow( rStrm ); return this;
}
break;
- case OOBIN_ID_ROW:
+ case BIFF12_ID_ROW:
switch( nRecId )
{
- case OOBIN_ID_ARRAY: importArray( rStrm ); break;
- case OOBIN_ID_CELL_BOOL: importCellBool( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_CELL_BLANK: importCellBlank( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_CELL_DOUBLE: importCellDouble( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_CELL_ERROR: importCellError( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_CELL_RK: importCellRk( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_CELL_RSTRING: importCellRString( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_CELL_SI: importCellSi( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_CELL_STRING: importCellString( rStrm, CELLTYPE_VALUE ); break;
- case OOBIN_ID_DATATABLE: importDataTable( rStrm ); break;
- case OOBIN_ID_FORMULA_BOOL: importCellBool( rStrm, CELLTYPE_FORMULA ); break;
- case OOBIN_ID_FORMULA_DOUBLE: importCellDouble( rStrm, CELLTYPE_FORMULA ); break;
- case OOBIN_ID_FORMULA_ERROR: importCellError( rStrm, CELLTYPE_FORMULA ); break;
- case OOBIN_ID_FORMULA_STRING: importCellString( rStrm, CELLTYPE_FORMULA ); break;
- case OOBIN_ID_MULTCELL_BOOL: importCellBool( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_MULTCELL_BLANK: importCellBlank( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_MULTCELL_DOUBLE: importCellDouble( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_MULTCELL_ERROR: importCellError( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_MULTCELL_RK: importCellRk( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_MULTCELL_RSTRING: importCellRString( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_MULTCELL_SI: importCellSi( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_MULTCELL_STRING: importCellString( rStrm, CELLTYPE_MULTI ); break;
- case OOBIN_ID_SHAREDFMLA: importSharedFmla( rStrm ); break;
+ case BIFF12_ID_ARRAY: importArray( rStrm ); break;
+ case BIFF12_ID_CELL_BOOL: importCellBool( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_CELL_BLANK: importCellBlank( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_CELL_DOUBLE: importCellDouble( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_CELL_ERROR: importCellError( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_CELL_RK: importCellRk( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_CELL_RSTRING: importCellRString( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_CELL_SI: importCellSi( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_CELL_STRING: importCellString( rStrm, CELLTYPE_VALUE ); break;
+ case BIFF12_ID_DATATABLE: importDataTable( rStrm ); break;
+ case BIFF12_ID_FORMULA_BOOL: importCellBool( rStrm, CELLTYPE_FORMULA ); break;
+ case BIFF12_ID_FORMULA_DOUBLE: importCellDouble( rStrm, CELLTYPE_FORMULA ); break;
+ case BIFF12_ID_FORMULA_ERROR: importCellError( rStrm, CELLTYPE_FORMULA ); break;
+ case BIFF12_ID_FORMULA_STRING: importCellString( rStrm, CELLTYPE_FORMULA ); break;
+ case BIFF12_ID_MULTCELL_BOOL: importCellBool( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_MULTCELL_BLANK: importCellBlank( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_MULTCELL_DOUBLE: importCellDouble( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_MULTCELL_ERROR: importCellError( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_MULTCELL_RK: importCellRk( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_MULTCELL_RSTRING:importCellRString( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_MULTCELL_SI: importCellSi( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_MULTCELL_STRING: importCellString( rStrm, CELLTYPE_MULTI ); break;
+ case BIFF12_ID_SHAREDFMLA: importSharedFmla( rStrm ); break;
}
break;
}
@@ -339,7 +330,7 @@ ContextHandlerRef OoxSheetDataContext::onCreateRecordContext( sal_Int32 nRecId,
// private --------------------------------------------------------------------
-void OoxSheetDataContext::importRow( const AttributeList& rAttribs )
+void SheetDataContext::importRow( const AttributeList& rAttribs )
{
RowModel aModel;
aModel.mnFirstRow = aModel.mnLastRow = rAttribs.getInteger( XML_r, -1 );
@@ -357,7 +348,7 @@ void OoxSheetDataContext::importRow( const AttributeList& rAttribs )
setRowModel( aModel );
}
-void OoxSheetDataContext::importCell( const AttributeList& rAttribs )
+void SheetDataContext::importCell( const AttributeList& rAttribs )
{
maCurrCell.reset();
maCurrCell.mxCell = getCell( rAttribs.getString( XML_r, OUString() ), &maCurrCell.maAddress );
@@ -371,7 +362,7 @@ void OoxSheetDataContext::importCell( const AttributeList& rAttribs )
extendUsedArea( maCurrCell.maAddress );
}
-void OoxSheetDataContext::importFormula( const AttributeList& rAttribs )
+void SheetDataContext::importFormula( const AttributeList& rAttribs )
{
maCurrCell.maFormulaRef = rAttribs.getString( XML_ref, OUString() );
maCurrCell.mnFormulaType = rAttribs.getToken( XML_t, XML_normal );
@@ -384,7 +375,7 @@ void OoxSheetDataContext::importFormula( const AttributeList& rAttribs )
maTableData.mbRef2Deleted = rAttribs.getBool( XML_del2, false );
}
-void OoxSheetDataContext::importCellHeader( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellHeader( SequenceInputStream& rStrm, CellType eCellType )
{
maCurrCell.reset();
@@ -400,14 +391,14 @@ void OoxSheetDataContext::importCellHeader( RecordInputStream& rStrm, CellType e
maCurrCell.mxCell = getCell( maCurrPos, &maCurrCell.maAddress );
maCurrCell.mnXfId = extractValue< sal_Int32 >( nXfId, 0, 24 );
- maCurrCell.mbShowPhonetic = getFlag( nXfId, OOBIN_CELL_SHOWPHONETIC );
+ maCurrCell.mbShowPhonetic = getFlag( nXfId, BIFF12_CELL_SHOWPHONETIC );
// update used area of the sheet
if( maCurrCell.mxCell.is() )
extendUsedArea( maCurrCell.maAddress );
}
-void OoxSheetDataContext::importCellBool( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellBool( SequenceInputStream& rStrm, CellType eCellType )
{
importCellHeader( rStrm, eCellType );
maCurrCell.mnCellType = XML_b;
@@ -428,14 +419,14 @@ void OoxSheetDataContext::importCellBool( RecordInputStream& rStrm, CellType eCe
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellBlank( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellBlank( SequenceInputStream& rStrm, CellType eCellType )
{
- OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "OoxSheetDataContext::importCellBlank - no formula cells supported" );
+ OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellBlank - no formula cells supported" );
importCellHeader( rStrm, eCellType );
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellDouble( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellDouble( SequenceInputStream& rStrm, CellType eCellType )
{
importCellHeader( rStrm, eCellType );
maCurrCell.mnCellType = XML_n;
@@ -450,7 +441,7 @@ void OoxSheetDataContext::importCellDouble( RecordInputStream& rStrm, CellType e
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellError( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellError( SequenceInputStream& rStrm, CellType eCellType )
{
importCellHeader( rStrm, eCellType );
maCurrCell.mnCellType = XML_e;
@@ -465,9 +456,9 @@ void OoxSheetDataContext::importCellError( RecordInputStream& rStrm, CellType eC
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellRk( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellRk( SequenceInputStream& rStrm, CellType eCellType )
{
- OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "OoxSheetDataContext::importCellRk - no formula cells supported" );
+ OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellRk - no formula cells supported" );
importCellHeader( rStrm, eCellType );
maCurrCell.mnCellType = XML_n;
if( maCurrCell.mxCell.is() && (maCurrCell.mxCell->getType() == CellContentType_EMPTY) )
@@ -475,9 +466,9 @@ void OoxSheetDataContext::importCellRk( RecordInputStream& rStrm, CellType eCell
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellRString( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellRString( SequenceInputStream& rStrm, CellType eCellType )
{
- OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "OoxSheetDataContext::importCellRString - no formula cells supported" );
+ OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellRString - no formula cells supported" );
importCellHeader( rStrm, eCellType );
maCurrCell.mnCellType = XML_inlineStr;
Reference< XText > xText( maCurrCell.mxCell, UNO_QUERY );
@@ -491,9 +482,9 @@ void OoxSheetDataContext::importCellRString( RecordInputStream& rStrm, CellType
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellSi( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellSi( SequenceInputStream& rStrm, CellType eCellType )
{
- OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "OoxSheetDataContext::importCellSi - no formula cells supported" );
+ OSL_ENSURE( eCellType != CELLTYPE_FORMULA, "SheetDataContext::importCellSi - no formula cells supported" );
importCellHeader( rStrm, eCellType );
maCurrCell.mnCellType = XML_s;
if( maCurrCell.mxCell.is() && (maCurrCell.mxCell->getType() == CellContentType_EMPTY) )
@@ -501,7 +492,7 @@ void OoxSheetDataContext::importCellSi( RecordInputStream& rStrm, CellType eCell
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellString( RecordInputStream& rStrm, CellType eCellType )
+void SheetDataContext::importCellString( SequenceInputStream& rStrm, CellType eCellType )
{
importCellHeader( rStrm, eCellType );
maCurrCell.mnCellType = XML_inlineStr;
@@ -519,7 +510,7 @@ void OoxSheetDataContext::importCellString( RecordInputStream& rStrm, CellType e
setCellFormat( maCurrCell );
}
-void OoxSheetDataContext::importCellFormula( RecordInputStream& rStrm )
+void SheetDataContext::importCellFormula( SequenceInputStream& rStrm )
{
rStrm.skip( 2 );
Reference< XFormulaTokens > xTokens( maCurrCell.mxCell, UNO_QUERY );
@@ -530,7 +521,7 @@ void OoxSheetDataContext::importCellFormula( RecordInputStream& rStrm )
}
}
-void OoxSheetDataContext::importRow( RecordInputStream& rStrm )
+void SheetDataContext::importRow( SequenceInputStream& rStrm )
{
RowModel aModel;
@@ -538,23 +529,23 @@ void OoxSheetDataContext::importRow( RecordInputStream& rStrm )
sal_uInt8 nFlags2;
rStrm >> maCurrPos.mnRow >> aModel.mnXfId >> nHeight >> nFlags1 >> nFlags2;
- // row index is 0-based in OOBIN, but RowModel expects 1-based
+ // row index is 0-based in BIFF12, but RowModel expects 1-based
aModel.mnFirstRow = aModel.mnLastRow = maCurrPos.mnRow + 1;
- // row height is in twips in OOBIN, convert to points
+ // row height is in twips in BIFF12, convert to points
aModel.mfHeight = nHeight / 20.0;
aModel.mnLevel = extractValue< sal_Int32 >( nFlags1, 8, 3 );
- aModel.mbCustomHeight = getFlag( nFlags1, OOBIN_ROW_CUSTOMHEIGHT );
- aModel.mbCustomFormat = getFlag( nFlags1, OOBIN_ROW_CUSTOMFORMAT );
- aModel.mbShowPhonetic = getFlag( nFlags2, OOBIN_ROW_SHOWPHONETIC );
- aModel.mbHidden = getFlag( nFlags1, OOBIN_ROW_HIDDEN );
- aModel.mbCollapsed = getFlag( nFlags1, OOBIN_ROW_COLLAPSED );
- aModel.mbThickTop = getFlag( nFlags1, OOBIN_ROW_THICKTOP );
- aModel.mbThickBottom = getFlag( nFlags1, OOBIN_ROW_THICKBOTTOM );
+ aModel.mbCustomHeight = getFlag( nFlags1, BIFF12_ROW_CUSTOMHEIGHT );
+ aModel.mbCustomFormat = getFlag( nFlags1, BIFF12_ROW_CUSTOMFORMAT );
+ aModel.mbShowPhonetic = getFlag( nFlags2, BIFF12_ROW_SHOWPHONETIC );
+ aModel.mbHidden = getFlag( nFlags1, BIFF12_ROW_HIDDEN );
+ aModel.mbCollapsed = getFlag( nFlags1, BIFF12_ROW_COLLAPSED );
+ aModel.mbThickTop = getFlag( nFlags1, BIFF12_ROW_THICKTOP );
+ aModel.mbThickBottom = getFlag( nFlags1, BIFF12_ROW_THICKBOTTOM );
// set row properties in the current sheet
setRowModel( aModel );
}
-void OoxSheetDataContext::importArray( RecordInputStream& rStrm )
+void SheetDataContext::importArray( SequenceInputStream& rStrm )
{
BinRange aRange;
rStrm >> aRange;
@@ -569,12 +560,12 @@ void OoxSheetDataContext::importArray( RecordInputStream& rStrm )
}
}
-void OoxSheetDataContext::importSharedFmla( RecordInputStream& rStrm )
+void SheetDataContext::importSharedFmla( SequenceInputStream& rStrm )
{
getSharedFormulas().importSharedFmla( rStrm, maCurrCell.maAddress );
}
-void OoxSheetDataContext::importDataTable( RecordInputStream& rStrm )
+void SheetDataContext::importDataTable( SequenceInputStream& rStrm )
{
BinRange aRange;
rStrm >> aRange;
@@ -587,18 +578,18 @@ void OoxSheetDataContext::importDataTable( RecordInputStream& rStrm )
rStrm >> aRef1 >> aRef2 >> nFlags;
aModel.maRef1 = FormulaProcessorBase::generateAddress2dString( aRef1, false );
aModel.maRef2 = FormulaProcessorBase::generateAddress2dString( aRef2, false );
- aModel.mbRowTable = getFlag( nFlags, OOBIN_DATATABLE_ROW );
- aModel.mb2dTable = getFlag( nFlags, OOBIN_DATATABLE_2D );
- aModel.mbRef1Deleted = getFlag( nFlags, OOBIN_DATATABLE_REF1DEL );
- aModel.mbRef2Deleted = getFlag( nFlags, OOBIN_DATATABLE_REF2DEL );
+ aModel.mbRowTable = getFlag( nFlags, BIFF12_DATATABLE_ROW );
+ aModel.mb2dTable = getFlag( nFlags, BIFF12_DATATABLE_2D );
+ aModel.mbRef1Deleted = getFlag( nFlags, BIFF12_DATATABLE_REF1DEL );
+ aModel.mbRef2Deleted = getFlag( nFlags, BIFF12_DATATABLE_REF2DEL );
setTableOperation( aTableRange, aModel );
}
}
// ============================================================================
-BiffSheetDataContext::BiffSheetDataContext( const BiffWorksheetFragmentBase& rParent ) :
- BiffWorksheetContextBase( rParent ),
+BiffSheetDataContext::BiffSheetDataContext( const WorksheetHelper& rHelper ) :
+ BiffWorksheetContextBase( rHelper ),
mnBiff2XfId( 0 )
{
mnArrayIgnoreSize = (getBiff() == BIFF2) ? 1 : ((getBiff() <= BIFF4) ? 2 : 6);
@@ -622,80 +613,80 @@ BiffSheetDataContext::BiffSheetDataContext( const BiffWorksheetFragmentBase& rPa
}
}
-void BiffSheetDataContext::importRecord()
+void BiffSheetDataContext::importRecord( BiffInputStream& rStrm )
{
- sal_uInt16 nRecId = mrStrm.getRecId();
+ sal_uInt16 nRecId = rStrm.getRecId();
switch( nRecId )
{
// records in all BIFF versions
case BIFF2_ID_ARRAY: // #i72713#
- case BIFF3_ID_ARRAY: importArray(); break;
+ case BIFF3_ID_ARRAY: importArray( rStrm ); break;
case BIFF2_ID_BLANK:
- case BIFF3_ID_BLANK: importBlank(); break;
+ case BIFF3_ID_BLANK: importBlank( rStrm ); break;
case BIFF2_ID_BOOLERR:
- case BIFF3_ID_BOOLERR: importBoolErr(); break;
- case BIFF2_ID_INTEGER: importInteger(); break;
- case BIFF_ID_IXFE: mrStrm >> mnBiff2XfId; break;
+ case BIFF3_ID_BOOLERR: importBoolErr( rStrm ); break;
+ case BIFF2_ID_INTEGER: importInteger( rStrm ); break;
+ case BIFF_ID_IXFE: rStrm >> mnBiff2XfId; break;
case BIFF2_ID_LABEL:
- case BIFF3_ID_LABEL: importLabel(); break;
+ case BIFF3_ID_LABEL: importLabel( rStrm ); break;
case BIFF2_ID_NUMBER:
- case BIFF3_ID_NUMBER: importNumber(); break;
- case BIFF_ID_RK: importRk(); break;
+ case BIFF3_ID_NUMBER: importNumber( rStrm ); break;
+ case BIFF_ID_RK: importRk( rStrm ); break;
// BIFF specific records
default: switch( getBiff() )
{
case BIFF2: switch( nRecId )
{
- case BIFF2_ID_DATATABLE: importDataTable(); break;
- case BIFF2_ID_DATATABLE2: importDataTable(); break;
- case BIFF2_ID_FORMULA: importFormula(); break;
- case BIFF2_ID_ROW: importRow(); break;
+ case BIFF2_ID_DATATABLE: importDataTable( rStrm ); break;
+ case BIFF2_ID_DATATABLE2: importDataTable( rStrm ); break;
+ case BIFF2_ID_FORMULA: importFormula( rStrm ); break;
+ case BIFF2_ID_ROW: importRow( rStrm ); break;
}
break;
case BIFF3: switch( nRecId )
{
- case BIFF3_ID_DATATABLE: importDataTable(); break;
- case BIFF3_ID_FORMULA: importFormula(); break;
- case BIFF3_ID_ROW: importRow(); break;
+ case BIFF3_ID_DATATABLE: importDataTable( rStrm ); break;
+ case BIFF3_ID_FORMULA: importFormula( rStrm ); break;
+ case BIFF3_ID_ROW: importRow( rStrm ); break;
}
break;
case BIFF4: switch( nRecId )
{
- case BIFF3_ID_DATATABLE: importDataTable(); break;
- case BIFF4_ID_FORMULA: importFormula(); break;
- case BIFF3_ID_ROW: importRow(); break;
+ case BIFF3_ID_DATATABLE: importDataTable( rStrm ); break;
+ case BIFF4_ID_FORMULA: importFormula( rStrm ); break;
+ case BIFF3_ID_ROW: importRow( rStrm ); break;
}
break;
case BIFF5: switch( nRecId )
{
- case BIFF3_ID_DATATABLE: importDataTable(); break;
+ case BIFF3_ID_DATATABLE: importDataTable( rStrm ); break;
case BIFF3_ID_FORMULA:
case BIFF4_ID_FORMULA:
- case BIFF5_ID_FORMULA: importFormula(); break;
- case BIFF_ID_MULTBLANK: importMultBlank(); break;
- case BIFF_ID_MULTRK: importMultRk(); break;
- case BIFF3_ID_ROW: importRow(); break;
- case BIFF_ID_RSTRING: importLabel(); break;
- case BIFF_ID_SHAREDFMLA: importSharedFmla(); break;
+ case BIFF5_ID_FORMULA: importFormula( rStrm ); break;
+ case BIFF_ID_MULTBLANK: importMultBlank( rStrm ); break;
+ case BIFF_ID_MULTRK: importMultRk( rStrm ); break;
+ case BIFF3_ID_ROW: importRow( rStrm ); break;
+ case BIFF_ID_RSTRING: importLabel( rStrm ); break;
+ case BIFF_ID_SHAREDFMLA: importSharedFmla( rStrm ); break;
}
break;
case BIFF8: switch( nRecId )
{
- case BIFF3_ID_DATATABLE: importDataTable(); break;
+ case BIFF3_ID_DATATABLE: importDataTable( rStrm ); break;
case BIFF3_ID_FORMULA:
case BIFF4_ID_FORMULA:
- case BIFF5_ID_FORMULA: importFormula(); break;
- case BIFF_ID_LABELSST: importLabelSst(); break;
- case BIFF_ID_MULTBLANK: importMultBlank(); break;
- case BIFF_ID_MULTRK: importMultRk(); break;
- case BIFF3_ID_ROW: importRow(); break;
- case BIFF_ID_RSTRING: importLabel(); break;
- case BIFF_ID_SHAREDFMLA: importSharedFmla(); break;
+ case BIFF5_ID_FORMULA: importFormula( rStrm ); break;
+ case BIFF_ID_LABELSST: importLabelSst( rStrm ); break;
+ case BIFF_ID_MULTBLANK: importMultBlank( rStrm ); break;
+ case BIFF_ID_MULTRK: importMultRk( rStrm ); break;
+ case BIFF3_ID_ROW: importRow( rStrm ); break;
+ case BIFF_ID_RSTRING: importLabel( rStrm ); break;
+ case BIFF_ID_SHAREDFMLA: importSharedFmla( rStrm ); break;
}
break;
@@ -715,44 +706,44 @@ void BiffSheetDataContext::setCurrCell( const BinAddress& rAddr )
extendUsedArea( maCurrCell.maAddress );
}
-void BiffSheetDataContext::importXfId( bool bBiff2 )
+void BiffSheetDataContext::importXfId( BiffInputStream& rStrm, bool bBiff2 )
{
if( bBiff2 )
{
sal_uInt8 nBiff2XfId;
- mrStrm >> nBiff2XfId;
- mrStrm.skip( 2 );
+ rStrm >> nBiff2XfId;
+ rStrm.skip( 2 );
maCurrCell.mnXfId = nBiff2XfId & BIFF2_XF_MASK;
if( maCurrCell.mnXfId == BIFF2_XF_EXTENDED_IDS )
maCurrCell.mnXfId = mnBiff2XfId;
}
else
{
- maCurrCell.mnXfId = mrStrm.readuInt16();
+ maCurrCell.mnXfId = rStrm.readuInt16();
}
}
-void BiffSheetDataContext::importCellHeader( bool bBiff2 )
+void BiffSheetDataContext::importCellHeader( BiffInputStream& rStrm, bool bBiff2 )
{
BinAddress aAddr;
- mrStrm >> aAddr;
+ rStrm >> aAddr;
setCurrCell( aAddr );
- importXfId( bBiff2 );
+ importXfId( rStrm, bBiff2 );
}
-void BiffSheetDataContext::importBlank()
+void BiffSheetDataContext::importBlank( BiffInputStream& rStrm )
{
- importCellHeader( mrStrm.getRecId() == BIFF2_ID_BLANK );
+ importCellHeader( rStrm, rStrm.getRecId() == BIFF2_ID_BLANK );
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importBoolErr()
+void BiffSheetDataContext::importBoolErr( BiffInputStream& rStrm )
{
- importCellHeader( mrStrm.getRecId() == BIFF2_ID_BOOLERR );
+ importCellHeader( rStrm, rStrm.getRecId() == BIFF2_ID_BOOLERR );
if( maCurrCell.mxCell.is() )
{
sal_uInt8 nValue, nType;
- mrStrm >> nValue >> nType;
+ rStrm >> nValue >> nType;
switch( nType )
{
case BIFF_BOOLERR_BOOL:
@@ -772,33 +763,33 @@ void BiffSheetDataContext::importBoolErr()
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importFormula()
+void BiffSheetDataContext::importFormula( BiffInputStream& rStrm )
{
- importCellHeader( getBiff() == BIFF2 );
+ importCellHeader( rStrm, getBiff() == BIFF2 );
maCurrCell.mnCellType = XML_n;
Reference< XFormulaTokens > xTokens( maCurrCell.mxCell, UNO_QUERY );
if( xTokens.is() )
{
- mrStrm.skip( mnFormulaIgnoreSize );
+ rStrm.skip( mnFormulaIgnoreSize );
ExtCellFormulaContext aContext( *this, xTokens, maCurrCell.maAddress );
- getFormulaParser().importFormula( aContext, mrStrm );
+ getFormulaParser().importFormula( aContext, rStrm );
}
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importInteger()
+void BiffSheetDataContext::importInteger( BiffInputStream& rStrm )
{
- importCellHeader( true );
+ importCellHeader( rStrm, true );
maCurrCell.mnCellType = XML_n;
if( maCurrCell.mxCell.is() )
- maCurrCell.mxCell->setValue( mrStrm.readuInt16() );
+ maCurrCell.mxCell->setValue( rStrm.readuInt16() );
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importLabel()
+void BiffSheetDataContext::importLabel( BiffInputStream& rStrm )
{
- bool bBiff2Xf = mrStrm.getRecId() == BIFF2_ID_LABEL;
- importCellHeader( bBiff2Xf );
+ bool bBiff2Xf = rStrm.getRecId() == BIFF2_ID_LABEL;
+ importCellHeader( rStrm, bBiff2Xf );
maCurrCell.mnCellType = XML_inlineStr;
Reference< XText > xText( maCurrCell.mxCell, UNO_QUERY );
if( xText.is() )
@@ -813,7 +804,7 @@ void BiffSheetDataContext::importLabel()
RichString aString( *this );
if( getBiff() == BIFF8 )
{
- aString.importUniString( mrStrm );
+ aString.importUniString( rStrm );
}
else
{
@@ -822,8 +813,8 @@ void BiffSheetDataContext::importLabel()
if( const Font* pFont = getStyles().getFontFromCellXf( maCurrCell.mnXfId ).get() )
eTextEnc = pFont->getFontEncoding();
BiffStringFlags nFlags = bBiff2Xf ? BIFF_STR_8BITLENGTH : BIFF_STR_DEFAULT;
- setFlag( nFlags, BIFF_STR_EXTRAFONTS, mrStrm.getRecId() == BIFF_ID_RSTRING );
- aString.importByteString( mrStrm, eTextEnc, nFlags );
+ setFlag( nFlags, BIFF_STR_EXTRAFONTS, rStrm.getRecId() == BIFF_ID_RSTRING );
+ aString.importByteString( rStrm, eTextEnc, nFlags );
}
aString.finalizeImport();
aString.convert( xText, maCurrCell.mnXfId );
@@ -831,81 +822,81 @@ void BiffSheetDataContext::importLabel()
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importLabelSst()
+void BiffSheetDataContext::importLabelSst( BiffInputStream& rStrm )
{
- importCellHeader( false );
+ importCellHeader( rStrm, false );
maCurrCell.mnCellType = XML_s;
if( maCurrCell.mxCell.is() )
- setSharedStringCell( maCurrCell.mxCell, mrStrm.readInt32(), maCurrCell.mnXfId );
+ setSharedStringCell( maCurrCell.mxCell, rStrm.readInt32(), maCurrCell.mnXfId );
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importMultBlank()
+void BiffSheetDataContext::importMultBlank( BiffInputStream& rStrm )
{
BinAddress aAddr;
- for( mrStrm >> aAddr; mrStrm.getRemaining() > 2; ++aAddr.mnCol )
+ for( rStrm >> aAddr; rStrm.getRemaining() > 2; ++aAddr.mnCol )
{
setCurrCell( aAddr );
- importXfId( false );
+ importXfId( rStrm, false );
setCellFormat( maCurrCell );
}
}
-void BiffSheetDataContext::importMultRk()
+void BiffSheetDataContext::importMultRk( BiffInputStream& rStrm )
{
BinAddress aAddr;
- for( mrStrm >> aAddr; mrStrm.getRemaining() > 2; ++aAddr.mnCol )
+ for( rStrm >> aAddr; rStrm.getRemaining() > 2; ++aAddr.mnCol )
{
setCurrCell( aAddr );
maCurrCell.mnCellType = XML_n;
- importXfId( false );
- sal_Int32 nRkValue = mrStrm.readInt32();
+ importXfId( rStrm, false );
+ sal_Int32 nRkValue = rStrm.readInt32();
if( maCurrCell.mxCell.is() )
maCurrCell.mxCell->setValue( BiffHelper::calcDoubleFromRk( nRkValue ) );
setCellFormat( maCurrCell );
}
}
-void BiffSheetDataContext::importNumber()
+void BiffSheetDataContext::importNumber( BiffInputStream& rStrm )
{
- importCellHeader( mrStrm.getRecId() == BIFF2_ID_NUMBER );
+ importCellHeader( rStrm, rStrm.getRecId() == BIFF2_ID_NUMBER );
maCurrCell.mnCellType = XML_n;
if( maCurrCell.mxCell.is() )
- maCurrCell.mxCell->setValue( mrStrm.readDouble() );
+ maCurrCell.mxCell->setValue( rStrm.readDouble() );
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importRk()
+void BiffSheetDataContext::importRk( BiffInputStream& rStrm )
{
- importCellHeader( false );
+ importCellHeader( rStrm, false );
maCurrCell.mnCellType = XML_n;
if( maCurrCell.mxCell.is() )
- maCurrCell.mxCell->setValue( BiffHelper::calcDoubleFromRk( mrStrm.readInt32() ) );
+ maCurrCell.mxCell->setValue( BiffHelper::calcDoubleFromRk( rStrm.readInt32() ) );
setCellFormat( maCurrCell );
}
-void BiffSheetDataContext::importRow()
+void BiffSheetDataContext::importRow( BiffInputStream& rStrm )
{
RowModel aModel;
sal_uInt16 nRow, nHeight;
- mrStrm >> nRow;
- mrStrm.skip( 4 );
- mrStrm >> nHeight;
+ rStrm >> nRow;
+ rStrm.skip( 4 );
+ rStrm >> nHeight;
if( getBiff() == BIFF2 )
{
- mrStrm.skip( 2 );
- aModel.mbCustomFormat = mrStrm.readuInt8() == BIFF2_ROW_CUSTOMFORMAT;
+ rStrm.skip( 2 );
+ aModel.mbCustomFormat = rStrm.readuInt8() == BIFF2_ROW_CUSTOMFORMAT;
if( aModel.mbCustomFormat )
{
- mrStrm.skip( 5 );
- aModel.mnXfId = mrStrm.readuInt16();
+ rStrm.skip( 5 );
+ aModel.mnXfId = rStrm.readuInt16();
}
}
else
{
- mrStrm.skip( 4 );
- sal_uInt32 nFlags = mrStrm.readuInt32();
+ rStrm.skip( 4 );
+ sal_uInt32 nFlags = rStrm.readuInt32();
aModel.mnXfId = extractValue< sal_Int32 >( nFlags, 16, 12 );
aModel.mnLevel = extractValue< sal_Int32 >( nFlags, 0, 3 );
aModel.mbCustomFormat = getFlag( nFlags, BIFF_ROW_CUSTOMFORMAT );
@@ -925,52 +916,52 @@ void BiffSheetDataContext::importRow()
setRowModel( aModel );
}
-void BiffSheetDataContext::importArray()
+void BiffSheetDataContext::importArray( BiffInputStream& rStrm )
{
BinRange aRange;
- aRange.read( mrStrm, false ); // columns always 8-bit
+ aRange.read( rStrm, false ); // columns always 8-bit
CellRangeAddress aArrayRange;
Reference< XCellRange > xRange = getCellRange( aRange, &aArrayRange );
Reference< XArrayFormulaTokens > xTokens( xRange, UNO_QUERY );
if( xRange.is() && xTokens.is() )
{
- mrStrm.skip( mnArrayIgnoreSize );
+ rStrm.skip( mnArrayIgnoreSize );
ArrayFormulaContext aContext( xTokens, aArrayRange );
- getFormulaParser().importFormula( aContext, mrStrm );
+ getFormulaParser().importFormula( aContext, rStrm );
}
}
-void BiffSheetDataContext::importSharedFmla()
+void BiffSheetDataContext::importSharedFmla( BiffInputStream& rStrm )
{
- getSharedFormulas().importSharedFmla( mrStrm, maCurrCell.maAddress );
+ getSharedFormulas().importSharedFmla( rStrm, maCurrCell.maAddress );
}
-void BiffSheetDataContext::importDataTable()
+void BiffSheetDataContext::importDataTable( BiffInputStream& rStrm )
{
BinRange aRange;
- aRange.read( mrStrm, false ); // columns always 8-bit
+ aRange.read( rStrm, false ); // columns always 8-bit
CellRangeAddress aTableRange;
if( getAddressConverter().convertToCellRange( aTableRange, aRange, getSheetIndex(), true, true ) )
{
DataTableModel aModel;
BinAddress aRef1, aRef2;
- switch( mrStrm.getRecId() )
+ switch( rStrm.getRecId() )
{
case BIFF2_ID_DATATABLE:
- mrStrm.skip( 1 );
- aModel.mbRowTable = mrStrm.readuInt8() != 0;
+ rStrm.skip( 1 );
+ aModel.mbRowTable = rStrm.readuInt8() != 0;
aModel.mb2dTable = false;
- mrStrm >> aRef1;
+ rStrm >> aRef1;
break;
case BIFF2_ID_DATATABLE2:
- mrStrm.skip( 2 );
+ rStrm.skip( 2 );
aModel.mb2dTable = true;
- mrStrm >> aRef1 >> aRef2;
+ rStrm >> aRef1 >> aRef2;
break;
case BIFF3_ID_DATATABLE:
{
sal_uInt16 nFlags;
- mrStrm >> nFlags >> aRef1 >> aRef2;
+ rStrm >> nFlags >> aRef1 >> aRef2;
aModel.mbRowTable = getFlag( nFlags, BIFF_DATATABLE_ROW );
aModel.mb2dTable = getFlag( nFlags, BIFF_DATATABLE_2D );
aModel.mbRef1Deleted = getFlag( nFlags, BIFF_DATATABLE_REF1DEL );
@@ -991,4 +982,4 @@ void BiffSheetDataContext::importDataTable()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/stylesbuffer.cxx b/oox/source/xls/stylesbuffer.cxx
index 91ed3f966f71..2ec1e31d1724 100644
--- a/oox/source/xls/stylesbuffer.cxx
+++ b/oox/source/xls/stylesbuffer.cxx
@@ -27,8 +27,7 @@
************************************************************************/
#include "oox/xls/stylesbuffer.hxx"
-#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
+
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/awt/FontFamily.hpp>
#include <com/sun/star/awt/FontPitch.hpp>
@@ -39,6 +38,8 @@
#include <com/sun/star/awt/FontUnderline.hpp>
#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/awt/XFont2.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/text/XText.hpp>
@@ -47,52 +48,45 @@
#include <com/sun/star/table/TableBorder.hpp>
#include <rtl/tencinfo.h>
#include <rtl/ustrbuf.hxx>
-#include "properties.hxx"
+#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/condformatbuffer.hxx"
#include "oox/xls/excelhandlers.hxx"
#include "oox/xls/themebuffer.hxx"
#include "oox/xls/unitconverter.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::awt::FontDescriptor;
-using ::com::sun::star::awt::XDevice;
-using ::com::sun::star::awt::XFont2;
-using ::com::sun::star::table::BorderLine;
using ::com::sun::star::table::BorderLine2;
-using ::com::sun::star::table::TableBorder;
-using ::com::sun::star::text::XText;
-using ::com::sun::star::style::XStyle;
-using ::oox::core::FilterBase;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::FilterBase;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
// OOXML constants ------------------------------------------------------------
-// OOX predefined color indexes (also used in BIFF3-BIFF8)
-const sal_Int32 OOX_COLOR_USEROFFSET = 0; /// First user defined color in palette (OOX).
-const sal_Int32 BIFF_COLOR_USEROFFSET = 8; /// First user defined color in palette (BIFF).
+// OOXML predefined color indexes (also used in BIFF3-BIFF8)
+const sal_Int32 OOX_COLOR_USEROFFSET = 0; /// First user defined color in palette (OOXML/BIFF12).
+const sal_Int32 BIFF_COLOR_USEROFFSET = 8; /// First user defined color in palette (BIFF3-BIFF8).
-// OOX font family (also used in BIFF)
+// OOXML font family (also used in BIFF)
const sal_Int32 OOX_FONTFAMILY_NONE = 0;
const sal_Int32 OOX_FONTFAMILY_ROMAN = 1;
const sal_Int32 OOX_FONTFAMILY_SWISS = 2;
@@ -100,102 +94,102 @@ const sal_Int32 OOX_FONTFAMILY_MODERN = 3;
const sal_Int32 OOX_FONTFAMILY_SCRIPT = 4;
const sal_Int32 OOX_FONTFAMILY_DECORATIVE = 5;
-// OOX cell text direction (also used in BIFF)
+// OOXML cell text direction (also used in BIFF)
const sal_Int32 OOX_XF_TEXTDIR_CONTEXT = 0;
const sal_Int32 OOX_XF_TEXTDIR_LTR = 1;
const sal_Int32 OOX_XF_TEXTDIR_RTL = 2;
-// OOX cell rotation (also used in BIFF)
+// OOXML cell rotation (also used in BIFF)
const sal_Int32 OOX_XF_ROTATION_NONE = 0;
const sal_Int32 OOX_XF_ROTATION_90CCW = 90;
const sal_Int32 OOX_XF_ROTATION_90CW = 180;
const sal_Int32 OOX_XF_ROTATION_STACKED = 255;
-// OOX cell indentation
+// OOXML cell indentation
const sal_Int32 OOX_XF_INDENT_NONE = 0;
-// OOX built-in cell styles (also used in BIFF)
+// OOXML built-in cell styles (also used in BIFF)
const sal_Int32 OOX_STYLE_NORMAL = 0; /// Default cell style.
const sal_Int32 OOX_STYLE_ROWLEVEL = 1; /// RowLevel_x cell style.
const sal_Int32 OOX_STYLE_COLLEVEL = 2; /// ColLevel_x cell style.
const sal_Int32 OOX_STYLE_LEVELCOUNT = 7; /// Number of outline level styles.
-// OOBIN constants ------------------------------------------------------------
-
-// OOBIN color types
-const sal_uInt8 OOBIN_COLOR_AUTO = 0;
-const sal_uInt8 OOBIN_COLOR_INDEXED = 1;
-const sal_uInt8 OOBIN_COLOR_RGB = 2;
-const sal_uInt8 OOBIN_COLOR_THEME = 3;
-
-// OOBIN diagonal borders
-const sal_uInt8 OOBIN_BORDER_DIAG_TLBR = 0x01; /// Top-left to bottom-right.
-const sal_uInt8 OOBIN_BORDER_DIAG_BLTR = 0x02; /// Bottom-left to top-right.
-
-// OOBIN gradient fill
-const sal_Int32 OOBIN_FILL_GRADIENT = 40;
-
-// OOBIN XF flags
-const sal_uInt32 OOBIN_XF_WRAPTEXT = 0x00400000;
-const sal_uInt32 OOBIN_XF_JUSTLASTLINE = 0x00800000;
-const sal_uInt32 OOBIN_XF_SHRINK = 0x01000000;
-const sal_uInt32 OOBIN_XF_LOCKED = 0x10000000;
-const sal_uInt32 OOBIN_XF_HIDDEN = 0x20000000;
-
-// OOBIN XF attribute used flags
-const sal_uInt16 OOBIN_XF_NUMFMT_USED = 0x0001;
-const sal_uInt16 OOBIN_XF_FONT_USED = 0x0002;
-const sal_uInt16 OOBIN_XF_ALIGN_USED = 0x0004;
-const sal_uInt16 OOBIN_XF_BORDER_USED = 0x0008;
-const sal_uInt16 OOBIN_XF_AREA_USED = 0x0010;
-const sal_uInt16 OOBIN_XF_PROT_USED = 0x0020;
-
-// OOBIN DXF constants
-const sal_uInt16 OOBIN_DXF_FILL_PATTERN = 0;
-const sal_uInt16 OOBIN_DXF_FILL_FGCOLOR = 1;
-const sal_uInt16 OOBIN_DXF_FILL_BGCOLOR = 2;
-const sal_uInt16 OOBIN_DXF_FILL_GRADIENT = 3;
-const sal_uInt16 OOBIN_DXF_FILL_STOP = 4;
-const sal_uInt16 OOBIN_DXF_FONT_COLOR = 5;
-const sal_uInt16 OOBIN_DXF_BORDER_TOP = 6;
-const sal_uInt16 OOBIN_DXF_BORDER_BOTTOM = 7;
-const sal_uInt16 OOBIN_DXF_BORDER_LEFT = 8;
-const sal_uInt16 OOBIN_DXF_BORDER_RIGHT = 9;
-const sal_uInt16 OOBIN_DXF_BORDER_DIAG = 10;
-const sal_uInt16 OOBIN_DXF_BORDER_VERT = 11;
-const sal_uInt16 OOBIN_DXF_BORDER_HOR = 12;
-const sal_uInt16 OOBIN_DXF_BORDER_DIAGUP = 13;
-const sal_uInt16 OOBIN_DXF_BORDER_DIAGDOWN = 14;
-const sal_uInt16 OOBIN_DXF_FONT_NAME = 24;
-const sal_uInt16 OOBIN_DXF_FONT_WEIGHT = 25;
-const sal_uInt16 OOBIN_DXF_FONT_UNDERLINE = 26;
-const sal_uInt16 OOBIN_DXF_FONT_ESCAPEMENT = 27;
-const sal_uInt16 OOBIN_DXF_FONT_ITALIC = 28;
-const sal_uInt16 OOBIN_DXF_FONT_STRIKE = 29;
-const sal_uInt16 OOBIN_DXF_FONT_OUTLINE = 30;
-const sal_uInt16 OOBIN_DXF_FONT_SHADOW = 31;
-const sal_uInt16 OOBIN_DXF_FONT_CONDENSE = 32;
-const sal_uInt16 OOBIN_DXF_FONT_EXTEND = 33;
-const sal_uInt16 OOBIN_DXF_FONT_CHARSET = 34;
-const sal_uInt16 OOBIN_DXF_FONT_FAMILY = 35;
-const sal_uInt16 OOBIN_DXF_FONT_HEIGHT = 36;
-const sal_uInt16 OOBIN_DXF_FONT_SCHEME = 37;
-const sal_uInt16 OOBIN_DXF_NUMFMT_CODE = 38;
-const sal_uInt16 OOBIN_DXF_NUMFMT_ID = 41;
-
-// OOBIN CELLSTYLE flags
-const sal_uInt16 OOBIN_CELLSTYLE_BUILTIN = 0x0001;
-const sal_uInt16 OOBIN_CELLSTYLE_HIDDEN = 0x0002;
-const sal_uInt16 OOBIN_CELLSTYLE_CUSTOM = 0x0004;
-
-// OOBIN and BIFF constants ---------------------------------------------------
+// BIFF12 constants -----------------------------------------------------------
+
+// BIFF12 color types
+const sal_uInt8 BIFF12_COLOR_AUTO = 0;
+const sal_uInt8 BIFF12_COLOR_INDEXED = 1;
+const sal_uInt8 BIFF12_COLOR_RGB = 2;
+const sal_uInt8 BIFF12_COLOR_THEME = 3;
+
+// BIFF12 diagonal borders
+const sal_uInt8 BIFF12_BORDER_DIAG_TLBR = 0x01; /// Top-left to bottom-right.
+const sal_uInt8 BIFF12_BORDER_DIAG_BLTR = 0x02; /// Bottom-left to top-right.
+
+// BIFF12 gradient fill
+const sal_Int32 BIFF12_FILL_GRADIENT = 40;
+
+// BIFF12 XF flags
+const sal_uInt32 BIFF12_XF_WRAPTEXT = 0x00400000;
+const sal_uInt32 BIFF12_XF_JUSTLASTLINE = 0x00800000;
+const sal_uInt32 BIFF12_XF_SHRINK = 0x01000000;
+const sal_uInt32 BIFF12_XF_LOCKED = 0x10000000;
+const sal_uInt32 BIFF12_XF_HIDDEN = 0x20000000;
+
+// BIFF12 XF attribute used flags
+const sal_uInt16 BIFF12_XF_NUMFMT_USED = 0x0001;
+const sal_uInt16 BIFF12_XF_FONT_USED = 0x0002;
+const sal_uInt16 BIFF12_XF_ALIGN_USED = 0x0004;
+const sal_uInt16 BIFF12_XF_BORDER_USED = 0x0008;
+const sal_uInt16 BIFF12_XF_AREA_USED = 0x0010;
+const sal_uInt16 BIFF12_XF_PROT_USED = 0x0020;
+
+// BIFF12 DXF constants
+const sal_uInt16 BIFF12_DXF_FILL_PATTERN = 0;
+const sal_uInt16 BIFF12_DXF_FILL_FGCOLOR = 1;
+const sal_uInt16 BIFF12_DXF_FILL_BGCOLOR = 2;
+const sal_uInt16 BIFF12_DXF_FILL_GRADIENT = 3;
+const sal_uInt16 BIFF12_DXF_FILL_STOP = 4;
+const sal_uInt16 BIFF12_DXF_FONT_COLOR = 5;
+const sal_uInt16 BIFF12_DXF_BORDER_TOP = 6;
+const sal_uInt16 BIFF12_DXF_BORDER_BOTTOM = 7;
+const sal_uInt16 BIFF12_DXF_BORDER_LEFT = 8;
+const sal_uInt16 BIFF12_DXF_BORDER_RIGHT = 9;
+const sal_uInt16 BIFF12_DXF_BORDER_DIAG = 10;
+const sal_uInt16 BIFF12_DXF_BORDER_VERT = 11;
+const sal_uInt16 BIFF12_DXF_BORDER_HOR = 12;
+const sal_uInt16 BIFF12_DXF_BORDER_DIAGUP = 13;
+const sal_uInt16 BIFF12_DXF_BORDER_DIAGDOWN = 14;
+const sal_uInt16 BIFF12_DXF_FONT_NAME = 24;
+const sal_uInt16 BIFF12_DXF_FONT_WEIGHT = 25;
+const sal_uInt16 BIFF12_DXF_FONT_UNDERLINE = 26;
+const sal_uInt16 BIFF12_DXF_FONT_ESCAPEMENT = 27;
+const sal_uInt16 BIFF12_DXF_FONT_ITALIC = 28;
+const sal_uInt16 BIFF12_DXF_FONT_STRIKE = 29;
+const sal_uInt16 BIFF12_DXF_FONT_OUTLINE = 30;
+const sal_uInt16 BIFF12_DXF_FONT_SHADOW = 31;
+const sal_uInt16 BIFF12_DXF_FONT_CONDENSE = 32;
+const sal_uInt16 BIFF12_DXF_FONT_EXTEND = 33;
+const sal_uInt16 BIFF12_DXF_FONT_CHARSET = 34;
+const sal_uInt16 BIFF12_DXF_FONT_FAMILY = 35;
+const sal_uInt16 BIFF12_DXF_FONT_HEIGHT = 36;
+const sal_uInt16 BIFF12_DXF_FONT_SCHEME = 37;
+const sal_uInt16 BIFF12_DXF_NUMFMT_CODE = 38;
+const sal_uInt16 BIFF12_DXF_NUMFMT_ID = 41;
+
+// BIFF12 CELLSTYLE flags
+const sal_uInt16 BIFF12_CELLSTYLE_BUILTIN = 0x0001;
+const sal_uInt16 BIFF12_CELLSTYLE_HIDDEN = 0x0002;
+const sal_uInt16 BIFF12_CELLSTYLE_CUSTOM = 0x0004;
+
+// BIFF constants -------------------------------------------------------------
// BIFF predefined color indexes
const sal_uInt16 BIFF2_COLOR_BLACK = 0; /// Black (text) in BIFF2.
const sal_uInt16 BIFF2_COLOR_WHITE = 1; /// White (background) in BIFF2.
-// BIFF font flags, also used in OOBIN
+// BIFF font flags, also used in BIFF12
const sal_uInt16 BIFF_FONTFLAG_BOLD = 0x0001;
const sal_uInt16 BIFF_FONTFLAG_ITALIC = 0x0002;
const sal_uInt16 BIFF_FONTFLAG_UNDERLINE = 0x0004;
@@ -207,7 +201,7 @@ const sal_uInt16 BIFF_FONTFLAG_CONDENSE = 0x0040;
// BIFF font weight
const sal_uInt16 BIFF_FONTWEIGHT_BOLD = 450;
-// BIFF font underline, also used in OOBIN
+// BIFF font underline, also used in BIFF12
const sal_uInt8 BIFF_FONTUNDERL_NONE = 0;
const sal_uInt8 BIFF_FONTUNDERL_SINGLE = 1;
const sal_uInt8 BIFF_FONTUNDERL_DOUBLE = 2;
@@ -311,14 +305,14 @@ sal_Int32 lclReadRgbColor( BinaryInputStream& rStrm )
// ============================================================================
ExcelGraphicHelper::ExcelGraphicHelper( const WorkbookHelper& rHelper ) :
- GraphicHelper( rHelper.getGlobalFactory(), rHelper.getBaseFilter().getTargetFrame(), rHelper.getBaseFilter().getStorage() ),
+ GraphicHelper( rHelper.getBaseFilter().getComponentContext(), rHelper.getBaseFilter().getTargetFrame(), rHelper.getBaseFilter().getStorage() ),
WorkbookHelper( rHelper )
{
}
sal_Int32 ExcelGraphicHelper::getSchemeColor( sal_Int32 nToken ) const
{
- if( getFilterType() == FILTER_OOX )
+ if( getFilterType() == FILTER_OOXML )
return getTheme().getColorByToken( nToken );
return GraphicHelper::getSchemeColor( nToken );
}
@@ -377,7 +371,7 @@ void Color::importColor( const AttributeList& rAttribs )
}
}
-void Color::importColor( RecordInputStream& rStrm )
+void Color::importColor( SequenceInputStream& rStrm )
{
sal_uInt8 nFlags, nIndex;
sal_Int16 nTint;
@@ -392,18 +386,18 @@ void Color::importColor( RecordInputStream& rStrm )
switch( extractValue< sal_uInt8 >( nFlags, 1, 7 ) )
{
- case OOBIN_COLOR_AUTO:
+ case BIFF12_COLOR_AUTO:
setAuto();
rStrm.skip( 4 );
break;
- case OOBIN_COLOR_INDEXED:
+ case BIFF12_COLOR_INDEXED:
setIndexed( nIndex, fTint );
rStrm.skip( 4 );
break;
- case OOBIN_COLOR_RGB:
+ case BIFF12_COLOR_RGB:
setRgb( lclReadRgbColor( rStrm ), fTint );
break;
- case OOBIN_COLOR_THEME:
+ case BIFF12_COLOR_THEME:
setTheme( nIndex, fTint );
rStrm.skip( 4 );
break;
@@ -414,12 +408,12 @@ void Color::importColor( RecordInputStream& rStrm )
}
}
-void Color::importColorId( RecordInputStream& rStrm )
+void Color::importColorId( SequenceInputStream& rStrm )
{
setIndexed( rStrm.readInt32() );
}
-void Color::importColorRgb( RecordInputStream& rStrm )
+void Color::importColorRgb( SequenceInputStream& rStrm )
{
setRgb( lclReadRgbColor( rStrm ) );
}
@@ -434,7 +428,7 @@ void Color::importColorRgb( BiffInputStream& rStrm )
setRgb( lclReadRgbColor( rStrm ) );
}
-RecordInputStream& operator>>( RecordInputStream& rStrm, Color& orColor )
+SequenceInputStream& operator>>( SequenceInputStream& rStrm, Color& orColor )
{
orColor.importColor( rStrm );
return rStrm;
@@ -478,7 +472,7 @@ static const sal_Int32 spnDefColors5[] =
/* 56 */ 0x1D2FBE, 0x286676, 0x004500, 0x453E01, 0x6A2813, 0x85396A, 0x4A3285, 0x424242
};
-/** Default color table for BIFF8/OOX. */
+/** Default color table for BIFF8/BIFF12/OOXML. */
static const sal_Int32 spnDefColors8[] =
{
/* 0 */ PALETTE_EGA_COLORS_LIGHT,
@@ -504,7 +498,7 @@ ColorPalette::ColorPalette( const WorkbookHelper& rHelper ) :
// default colors
switch( getFilterType() )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
maColors.insert( maColors.begin(), spnDefColors8, STATIC_ARRAY_END( spnDefColors8 ) );
mnAppendIndex = OOX_COLOR_USEROFFSET;
break;
@@ -529,7 +523,7 @@ void ColorPalette::importPaletteColor( const AttributeList& rAttribs )
appendColor( rAttribs.getIntegerHex( XML_rgb, API_RGB_WHITE ) );
}
-void ColorPalette::importPaletteColor( RecordInputStream& rStrm )
+void ColorPalette::importPaletteColor( SequenceInputStream& rStrm )
{
sal_Int32 nRgb = lclReadRgbColor( rStrm );
appendColor( nRgb & 0xFFFFFF );
@@ -550,6 +544,18 @@ void ColorPalette::importPalette( BiffInputStream& rStrm )
}
}
+void ColorPalette::importPalette( const Any& rPalette )
+{
+ Sequence< sal_Int32 > rColorSeq;
+ if( (rPalette >>= rColorSeq) && rColorSeq.hasElements() )
+ {
+ const sal_Int32* pnColor = rColorSeq.getConstArray();
+ const sal_Int32* pnColorEnd = pnColor + rColorSeq.getLength();
+ for( ; pnColor < pnColorEnd; ++pnColor )
+ appendColor( *pnColor & 0xFFFFFF );
+ }
+}
+
sal_Int32 ColorPalette::getColor( sal_Int32 nPaletteIdx ) const
{
sal_Int32 nColor = API_RGB_TRANSPARENT;
@@ -622,7 +628,7 @@ FontModel::FontModel() :
{
}
-void FontModel::setBinScheme( sal_uInt8 nScheme )
+void FontModel::setBiff12Scheme( sal_uInt8 nScheme )
{
static const sal_Int32 spnSchemes[] = { XML_none, XML_major, XML_minor };
mnScheme = STATIC_ARRAY_SELECT( spnSchemes, nScheme, XML_none );
@@ -790,7 +796,7 @@ void Font::importAttribs( sal_Int32 nElement, const AttributeList& rAttribs )
}
}
-void Font::importFont( RecordInputStream& rStrm )
+void Font::importFont( SequenceInputStream& rStrm )
{
OSL_ENSURE( !mbDxf, "Font::importFont - unexpected conditional formatting flag" );
@@ -800,71 +806,71 @@ void Font::importFont( RecordInputStream& rStrm )
rStrm.skip( 1 );
rStrm >> maModel.maColor >> nScheme >> maModel.maName;
- // equal constants in BIFF and OOBIN for weight, underline, and escapement
- maModel.setBinScheme( nScheme );
+ // equal constants in all BIFFs for weight, underline, and escapement
+ maModel.setBiff12Scheme( nScheme );
maModel.setBiffHeight( nHeight );
maModel.setBiffWeight( nWeight );
maModel.setBiffUnderline( nUnderline );
maModel.setBiffEscapement( nEscapement );
maModel.mnFamily = nFamily;
maModel.mnCharSet = nCharSet;
- // equal flags in BIFF and OOBIN
+ // equal flags in all BIFFs
maModel.mbItalic = getFlag( nFlags, BIFF_FONTFLAG_ITALIC );
maModel.mbStrikeout = getFlag( nFlags, BIFF_FONTFLAG_STRIKEOUT );
maModel.mbOutline = getFlag( nFlags, BIFF_FONTFLAG_OUTLINE );
maModel.mbShadow = getFlag( nFlags, BIFF_FONTFLAG_SHADOW );
}
-void Font::importDxfName( RecordInputStream& rStrm )
+void Font::importDxfName( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfName - missing conditional formatting flag" );
- maModel.maName = rStrm.readString( false );
+ maModel.maName = BiffHelper::readString( rStrm, false );
maUsedFlags.mbColorUsed = true;
}
-void Font::importDxfColor( RecordInputStream& rStrm )
+void Font::importDxfColor( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfColor - missing conditional formatting flag" );
rStrm >> maModel.maColor;
maUsedFlags.mbColorUsed = true;
}
-void Font::importDxfScheme( RecordInputStream& rStrm )
+void Font::importDxfScheme( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfScheme - missing conditional formatting flag" );
- maModel.setBinScheme( rStrm.readuInt8() );
+ maModel.setBiff12Scheme( rStrm.readuInt8() );
maUsedFlags.mbSchemeUsed = true;
}
-void Font::importDxfHeight( RecordInputStream& rStrm )
+void Font::importDxfHeight( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfHeight - missing conditional formatting flag" );
maModel.setBiffHeight( rStrm.readuInt16() );
maUsedFlags.mbHeightUsed = true;
}
-void Font::importDxfWeight( RecordInputStream& rStrm )
+void Font::importDxfWeight( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfWeight - missing conditional formatting flag" );
maModel.setBiffWeight( rStrm.readuInt16() );
maUsedFlags.mbWeightUsed = true;
}
-void Font::importDxfUnderline( RecordInputStream& rStrm )
+void Font::importDxfUnderline( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfUnderline - missing conditional formatting flag" );
maModel.setBiffUnderline( rStrm.readuInt16() );
maUsedFlags.mbUnderlineUsed = true;
}
-void Font::importDxfEscapement( RecordInputStream& rStrm )
+void Font::importDxfEscapement( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfEscapement - missing conditional formatting flag" );
maModel.setBiffEscapement( rStrm.readuInt16() );
maUsedFlags.mbEscapementUsed = true;
}
-void Font::importDxfFlag( sal_Int32 nElement, RecordInputStream& rStrm )
+void Font::importDxfFlag( sal_Int32 nElement, SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Font::importDxfFlag - missing conditional formatting flag" );
bool bFlag = rStrm.readuInt8() != 0;
@@ -1044,7 +1050,8 @@ void Font::finalizeImport()
// supported script types
if( maUsedFlags.mbNameUsed )
{
- Reference< XDevice > xDevice = getReferenceDevice();
+ PropertySet aDocProps( getDocument() );
+ Reference< XDevice > xDevice( aDocProps.getAnyProperty( PROP_ReferenceDevice ), UNO_QUERY );
if( xDevice.is() )
{
Reference< XFont2 > xFont( xDevice->getFont( maApiData.maDesc ), UNO_QUERY );
@@ -1232,7 +1239,7 @@ AlignmentModel::AlignmentModel() :
{
}
-void AlignmentModel::setBinHorAlign( sal_uInt8 nHorAlign )
+void AlignmentModel::setBiffHorAlign( sal_uInt8 nHorAlign )
{
static const sal_Int32 spnHorAligns[] = {
XML_general, XML_left, XML_center, XML_right,
@@ -1240,14 +1247,14 @@ void AlignmentModel::setBinHorAlign( sal_uInt8 nHorAlign )
mnHorAlign = STATIC_ARRAY_SELECT( spnHorAligns, nHorAlign, XML_general );
}
-void AlignmentModel::setBinVerAlign( sal_uInt8 nVerAlign )
+void AlignmentModel::setBiffVerAlign( sal_uInt8 nVerAlign )
{
static const sal_Int32 spnVerAligns[] = {
XML_top, XML_center, XML_bottom, XML_justify, XML_distributed };
mnVerAlign = STATIC_ARRAY_SELECT( spnVerAligns, nVerAlign, XML_bottom );
}
-void AlignmentModel::setBinTextOrient( sal_uInt8 nTextOrient )
+void AlignmentModel::setBiffTextOrient( sal_uInt8 nTextOrient )
{
static const sal_Int32 spnRotations[] = {
OOX_XF_ROTATION_NONE, OOX_XF_ROTATION_STACKED,
@@ -1305,49 +1312,49 @@ void Alignment::importAlignment( const AttributeList& rAttribs )
maModel.mbJustLastLine = rAttribs.getBool( XML_justifyLastLine, false );
}
-void Alignment::setBinData( sal_uInt32 nFlags )
+void Alignment::setBiff12Data( sal_uInt32 nFlags )
{
- maModel.setBinHorAlign( extractValue< sal_uInt8 >( nFlags, 16, 3 ) );
- maModel.setBinVerAlign( extractValue< sal_uInt8 >( nFlags, 19, 3 ) );
+ maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nFlags, 16, 3 ) );
+ maModel.setBiffVerAlign( extractValue< sal_uInt8 >( nFlags, 19, 3 ) );
maModel.mnTextDir = extractValue< sal_Int32 >( nFlags, 26, 2 );
maModel.mnRotation = extractValue< sal_Int32 >( nFlags, 0, 8 );
maModel.mnIndent = extractValue< sal_uInt8 >( nFlags, 8, 8 );
- maModel.mbWrapText = getFlag( nFlags, OOBIN_XF_WRAPTEXT );
- maModel.mbShrink = getFlag( nFlags, OOBIN_XF_SHRINK );
- maModel.mbJustLastLine = getFlag( nFlags, OOBIN_XF_JUSTLASTLINE );
+ maModel.mbWrapText = getFlag( nFlags, BIFF12_XF_WRAPTEXT );
+ maModel.mbShrink = getFlag( nFlags, BIFF12_XF_SHRINK );
+ maModel.mbJustLastLine = getFlag( nFlags, BIFF12_XF_JUSTLASTLINE );
}
void Alignment::setBiff2Data( sal_uInt8 nFlags )
{
- maModel.setBinHorAlign( extractValue< sal_uInt8 >( nFlags, 0, 3 ) );
+ maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nFlags, 0, 3 ) );
}
void Alignment::setBiff3Data( sal_uInt16 nAlign )
{
- maModel.setBinHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
+ maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
maModel.mbWrapText = getFlag( nAlign, BIFF_XF_WRAPTEXT ); // new in BIFF3
}
void Alignment::setBiff4Data( sal_uInt16 nAlign )
{
- maModel.setBinHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
- maModel.setBinVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 2 ) ); // new in BIFF4
- maModel.setBinTextOrient( extractValue< sal_uInt8 >( nAlign, 6, 2 ) ); // new in BIFF4
+ maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
+ maModel.setBiffVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 2 ) ); // new in BIFF4
+ maModel.setBiffTextOrient( extractValue< sal_uInt8 >( nAlign, 6, 2 ) ); // new in BIFF4
maModel.mbWrapText = getFlag( nAlign, BIFF_XF_WRAPTEXT );
}
void Alignment::setBiff5Data( sal_uInt16 nAlign )
{
- maModel.setBinHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
- maModel.setBinVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 3 ) );
- maModel.setBinTextOrient( extractValue< sal_uInt8 >( nAlign, 8, 2 ) );
+ maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
+ maModel.setBiffVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 3 ) );
+ maModel.setBiffTextOrient( extractValue< sal_uInt8 >( nAlign, 8, 2 ) );
maModel.mbWrapText = getFlag( nAlign, BIFF_XF_WRAPTEXT );
}
void Alignment::setBiff8Data( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib )
{
- maModel.setBinHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
- maModel.setBinVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 3 ) );
+ maModel.setBiffHorAlign( extractValue< sal_uInt8 >( nAlign, 0, 3 ) );
+ maModel.setBiffVerAlign( extractValue< sal_uInt8 >( nAlign, 4, 3 ) );
maModel.mnTextDir = extractValue< sal_Int32 >( nMiscAttrib, 6, 2 ); // new in BIFF8
maModel.mnRotation = extractValue< sal_Int32 >( nAlign, 8, 8 ); // new in BIFF8
maModel.mnIndent = extractValue< sal_uInt8 >( nMiscAttrib, 0, 4 ); // new in BIFF8
@@ -1391,11 +1398,11 @@ void Alignment::finalizeImport()
maApiData.mnVerJustifyMethod = csstab::CellJustifyMethod::DISTRIBUTE;
/* indentation: expressed as number of blocks of 3 space characters in
- OOX, and as multiple of 10 points in BIFF. */
+ OOXML/BIFF12, and as multiple of 10 points in BIFF8. */
sal_Int32 nIndent = 0;
switch( getFilterType() )
{
- case FILTER_OOX: nIndent = getUnitConverter().scaleToMm100( 3.0 * maModel.mnIndent, UNIT_SPACE ); break;
+ case FILTER_OOXML: nIndent = getUnitConverter().scaleToMm100( 3.0 * maModel.mnIndent, UNIT_SPACE ); break;
case FILTER_BIFF: nIndent = getUnitConverter().scaleToMm100( 10.0 * maModel.mnIndent, UNIT_POINT ); break;
case FILTER_UNKNOWN: break;
}
@@ -1477,10 +1484,10 @@ void Protection::importProtection( const AttributeList& rAttribs )
maModel.mbHidden = rAttribs.getBool( XML_hidden, false );
}
-void Protection::setBinData( sal_uInt32 nFlags )
+void Protection::setBiff12Data( sal_uInt32 nFlags )
{
- maModel.mbLocked = getFlag( nFlags, OOBIN_XF_LOCKED );
- maModel.mbHidden = getFlag( nFlags, OOBIN_XF_HIDDEN );
+ maModel.mbLocked = getFlag( nFlags, BIFF12_XF_LOCKED );
+ maModel.mbHidden = getFlag( nFlags, BIFF12_XF_HIDDEN );
}
void Protection::setBiff2Data( sal_uInt8 nNumFmt )
@@ -1675,11 +1682,11 @@ void Border::importColor( sal_Int32 nElement, const AttributeList& rAttribs )
pBorderLine->maColor.importColor( rAttribs );
}
-void Border::importBorder( RecordInputStream& rStrm )
+void Border::importBorder( SequenceInputStream& rStrm )
{
sal_uInt8 nFlags = rStrm.readuInt8();
- maModel.mbDiagTLtoBR = getFlag( nFlags, OOBIN_BORDER_DIAG_TLBR );
- maModel.mbDiagBLtoTR = getFlag( nFlags, OOBIN_BORDER_DIAG_BLTR );
+ maModel.mbDiagTLtoBR = getFlag( nFlags, BIFF12_BORDER_DIAG_TLBR );
+ maModel.mbDiagBLtoTR = getFlag( nFlags, BIFF12_BORDER_DIAG_BLTR );
maModel.maTop.setBiffStyle( rStrm.readuInt16() );
rStrm >> maModel.maTop.maColor;
maModel.maBottom.setBiffStyle( rStrm.readuInt16() );
@@ -1692,7 +1699,7 @@ void Border::importBorder( RecordInputStream& rStrm )
rStrm >> maModel.maDiagonal.maColor;
}
-void Border::importDxfBorder( sal_Int32 nElement, RecordInputStream& rStrm )
+void Border::importDxfBorder( sal_Int32 nElement, SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Border::importDxfBorder - missing conditional formatting flag" );
if( BorderLineModel* pBorderLine = getBorderLine( nElement ) )
@@ -1874,7 +1881,7 @@ PatternFillModel::PatternFillModel( bool bDxf ) :
maFillColor.setIndexed( OOX_COLOR_WINDOWBACK );
}
-void PatternFillModel::setBinPattern( sal_Int32 nPattern )
+void PatternFillModel::setBiffPattern( sal_Int32 nPattern )
{
static const sal_Int32 spnPatternIds[] = {
XML_none, XML_solid, XML_mediumGray, XML_darkGray,
@@ -1889,8 +1896,8 @@ void PatternFillModel::setBiffData( sal_uInt16 nPatternColor, sal_uInt16 nFillCo
{
maPatternColor.setIndexed( nPatternColor );
maFillColor.setIndexed( nFillColor );
- // patterns equal in BIFF and OOBIN
- setBinPattern( nPattern );
+ // patterns equal in all BIFFs
+ setBiffPattern( nPattern );
}
// ----------------------------------------------------------------------------
@@ -1905,7 +1912,7 @@ GradientFillModel::GradientFillModel() :
{
}
-void GradientFillModel::readGradient( RecordInputStream& rStrm )
+void GradientFillModel::readGradient( SequenceInputStream& rStrm )
{
sal_Int32 nType;
rStrm >> nType >> mfAngle >> mfLeft >> mfRight >> mfTop >> mfBottom;
@@ -1913,7 +1920,7 @@ void GradientFillModel::readGradient( RecordInputStream& rStrm )
mnType = STATIC_ARRAY_SELECT( spnTypes, nType, XML_TOKEN_INVALID );
}
-void GradientFillModel::readGradientStop( RecordInputStream& rStrm, bool bDxf )
+void GradientFillModel::readGradientStop( SequenceInputStream& rStrm, bool bDxf )
{
Color aColor;
double fPosition;
@@ -2020,11 +2027,11 @@ void Fill::importColor( const AttributeList& rAttribs, double fPosition )
mxGradientModel->maColors[ fPosition ].importColor( rAttribs );
}
-void Fill::importFill( RecordInputStream& rStrm )
+void Fill::importFill( SequenceInputStream& rStrm )
{
OSL_ENSURE( !mbDxf, "Fill::importFill - unexpected conditional formatting flag" );
sal_Int32 nPattern = rStrm.readInt32();
- if( nPattern == OOBIN_FILL_GRADIENT )
+ if( nPattern == BIFF12_FILL_GRADIENT )
{
mxGradientModel.reset( new GradientFillModel );
sal_Int32 nStopCount;
@@ -2037,21 +2044,21 @@ void Fill::importFill( RecordInputStream& rStrm )
else
{
mxPatternModel.reset( new PatternFillModel( mbDxf ) );
- mxPatternModel->setBinPattern( nPattern );
+ mxPatternModel->setBiffPattern( nPattern );
rStrm >> mxPatternModel->maPatternColor >> mxPatternModel->maFillColor;
}
}
-void Fill::importDxfPattern( RecordInputStream& rStrm )
+void Fill::importDxfPattern( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Fill::importDxfPattern - missing conditional formatting flag" );
if( !mxPatternModel )
mxPatternModel.reset( new PatternFillModel( mbDxf ) );
- mxPatternModel->setBinPattern( rStrm.readuInt8() );
+ mxPatternModel->setBiffPattern( rStrm.readuInt8() );
mxPatternModel->mbPatternUsed = true;
}
-void Fill::importDxfFgColor( RecordInputStream& rStrm )
+void Fill::importDxfFgColor( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Fill::importDxfFgColor - missing conditional formatting flag" );
if( !mxPatternModel )
@@ -2060,7 +2067,7 @@ void Fill::importDxfFgColor( RecordInputStream& rStrm )
mxPatternModel->mbPattColorUsed = true;
}
-void Fill::importDxfBgColor( RecordInputStream& rStrm )
+void Fill::importDxfBgColor( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Fill::importDxfBgColor - missing conditional formatting flag" );
if( !mxPatternModel )
@@ -2069,7 +2076,7 @@ void Fill::importDxfBgColor( RecordInputStream& rStrm )
mxPatternModel->mbFillColorUsed = true;
}
-void Fill::importDxfGradient( RecordInputStream& rStrm )
+void Fill::importDxfGradient( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Fill::importDxfGradient - missing conditional formatting flag" );
if( !mxGradientModel )
@@ -2077,7 +2084,7 @@ void Fill::importDxfGradient( RecordInputStream& rStrm )
mxGradientModel->readGradient( rStrm );
}
-void Fill::importDxfStop( RecordInputStream& rStrm )
+void Fill::importDxfStop( SequenceInputStream& rStrm )
{
OSL_ENSURE( mbDxf, "Fill::importDxfStop - missing conditional formatting flag" );
if( !mxGradientModel )
@@ -2147,7 +2154,7 @@ void Fill::finalizeImport()
if( mxPatternModel.get() )
{
- // finalize the OOX data struct
+ // finalize the OOXML data struct
PatternFillModel& rModel = *mxPatternModel;
if( mbDxf )
{
@@ -2299,7 +2306,7 @@ void Xf::importProtection( const AttributeList& rAttribs )
maProtection.importProtection( rAttribs );
}
-void Xf::importXf( RecordInputStream& rStrm, bool bCellXf )
+void Xf::importXf( SequenceInputStream& rStrm, bool bCellXf )
{
maModel.mbCellXf = bCellXf;
maModel.mnStyleXfId = rStrm.readuInt16();
@@ -2308,16 +2315,16 @@ void Xf::importXf( RecordInputStream& rStrm, bool bCellXf )
maModel.mnFillId = rStrm.readuInt16();
maModel.mnBorderId = rStrm.readuInt16();
sal_uInt32 nFlags = rStrm.readuInt32();
- maAlignment.setBinData( nFlags );
- maProtection.setBinData( nFlags );
+ maAlignment.setBiff12Data( nFlags );
+ maProtection.setBiff12Data( nFlags );
// used flags, see comments in Xf::setBiffUsedFlags()
sal_uInt16 nUsedFlags = rStrm.readuInt16();
- maModel.mbFontUsed = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_FONT_USED );
- maModel.mbNumFmtUsed = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_NUMFMT_USED );
- maModel.mbAlignUsed = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_ALIGN_USED );
- maModel.mbProtUsed = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_PROT_USED );
- maModel.mbBorderUsed = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_BORDER_USED );
- maModel.mbAreaUsed = maModel.mbCellXf == getFlag( nUsedFlags, OOBIN_XF_AREA_USED );
+ maModel.mbFontUsed = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_FONT_USED );
+ maModel.mbNumFmtUsed = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_NUMFMT_USED );
+ maModel.mbAlignUsed = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_ALIGN_USED );
+ maModel.mbProtUsed = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_PROT_USED );
+ maModel.mbBorderUsed = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_BORDER_USED );
+ maModel.mbAreaUsed = maModel.mbCellXf == getFlag( nUsedFlags, BIFF12_XF_AREA_USED );
}
void Xf::importXf( BiffInputStream& rStrm )
@@ -2595,7 +2602,7 @@ void Dxf::importProtection( const AttributeList& rAttribs )
mxProtection->importProtection( rAttribs );
}
-void Dxf::importDxf( RecordInputStream& rStrm )
+void Dxf::importDxf( SequenceInputStream& rStrm )
{
sal_Int32 nNumFmtId = -1;
OUString aFmtCode;
@@ -2610,28 +2617,28 @@ void Dxf::importDxf( RecordInputStream& rStrm )
nRecEnd += nSubRecSize;
switch( nSubRecId )
{
- case OOBIN_DXF_FILL_PATTERN: createFill( false )->importDxfPattern( rStrm ); break;
- case OOBIN_DXF_FILL_FGCOLOR: createFill( false )->importDxfFgColor( rStrm ); break;
- case OOBIN_DXF_FILL_BGCOLOR: createFill( false )->importDxfBgColor( rStrm ); break;
- case OOBIN_DXF_FILL_GRADIENT: createFill( false )->importDxfGradient( rStrm ); break;
- case OOBIN_DXF_FILL_STOP: createFill( false )->importDxfStop( rStrm ); break;
- case OOBIN_DXF_FONT_COLOR: createFont( false )->importDxfColor( rStrm ); break;
- case OOBIN_DXF_BORDER_TOP: createBorder( false )->importDxfBorder( XLS_TOKEN( top ), rStrm ); break;
- case OOBIN_DXF_BORDER_BOTTOM: createBorder( false )->importDxfBorder( XLS_TOKEN( bottom ), rStrm ); break;
- case OOBIN_DXF_BORDER_LEFT: createBorder( false )->importDxfBorder( XLS_TOKEN( left ), rStrm ); break;
- case OOBIN_DXF_BORDER_RIGHT: createBorder( false )->importDxfBorder( XLS_TOKEN( right ), rStrm ); break;
- case OOBIN_DXF_FONT_NAME: createFont( false )->importDxfName( rStrm ); break;
- case OOBIN_DXF_FONT_WEIGHT: createFont( false )->importDxfWeight( rStrm ); break;
- case OOBIN_DXF_FONT_UNDERLINE: createFont( false )->importDxfUnderline( rStrm ); break;
- case OOBIN_DXF_FONT_ESCAPEMENT: createFont( false )->importDxfEscapement( rStrm ); break;
- case OOBIN_DXF_FONT_ITALIC: createFont( false )->importDxfFlag( XML_i, rStrm ); break;
- case OOBIN_DXF_FONT_STRIKE: createFont( false )->importDxfFlag( XML_strike, rStrm ); break;
- case OOBIN_DXF_FONT_OUTLINE: createFont( false )->importDxfFlag( XML_outline, rStrm ); break;
- case OOBIN_DXF_FONT_SHADOW: createFont( false )->importDxfFlag( XML_shadow, rStrm ); break;
- case OOBIN_DXF_FONT_HEIGHT: createFont( false )->importDxfHeight( rStrm ); break;
- case OOBIN_DXF_FONT_SCHEME: createFont( false )->importDxfScheme( rStrm ); break;
- case OOBIN_DXF_NUMFMT_CODE: aFmtCode = rStrm.readString( false ); break;
- case OOBIN_DXF_NUMFMT_ID: nNumFmtId = rStrm.readuInt16(); break;
+ case BIFF12_DXF_FILL_PATTERN: createFill( false )->importDxfPattern( rStrm ); break;
+ case BIFF12_DXF_FILL_FGCOLOR: createFill( false )->importDxfFgColor( rStrm ); break;
+ case BIFF12_DXF_FILL_BGCOLOR: createFill( false )->importDxfBgColor( rStrm ); break;
+ case BIFF12_DXF_FILL_GRADIENT: createFill( false )->importDxfGradient( rStrm ); break;
+ case BIFF12_DXF_FILL_STOP: createFill( false )->importDxfStop( rStrm ); break;
+ case BIFF12_DXF_FONT_COLOR: createFont( false )->importDxfColor( rStrm ); break;
+ case BIFF12_DXF_BORDER_TOP: createBorder( false )->importDxfBorder( XLS_TOKEN( top ), rStrm ); break;
+ case BIFF12_DXF_BORDER_BOTTOM: createBorder( false )->importDxfBorder( XLS_TOKEN( bottom ), rStrm ); break;
+ case BIFF12_DXF_BORDER_LEFT: createBorder( false )->importDxfBorder( XLS_TOKEN( left ), rStrm ); break;
+ case BIFF12_DXF_BORDER_RIGHT: createBorder( false )->importDxfBorder( XLS_TOKEN( right ), rStrm ); break;
+ case BIFF12_DXF_FONT_NAME: createFont( false )->importDxfName( rStrm ); break;
+ case BIFF12_DXF_FONT_WEIGHT: createFont( false )->importDxfWeight( rStrm ); break;
+ case BIFF12_DXF_FONT_UNDERLINE: createFont( false )->importDxfUnderline( rStrm ); break;
+ case BIFF12_DXF_FONT_ESCAPEMENT: createFont( false )->importDxfEscapement( rStrm ); break;
+ case BIFF12_DXF_FONT_ITALIC: createFont( false )->importDxfFlag( XML_i, rStrm ); break;
+ case BIFF12_DXF_FONT_STRIKE: createFont( false )->importDxfFlag( XML_strike, rStrm ); break;
+ case BIFF12_DXF_FONT_OUTLINE: createFont( false )->importDxfFlag( XML_outline, rStrm ); break;
+ case BIFF12_DXF_FONT_SHADOW: createFont( false )->importDxfFlag( XML_shadow, rStrm ); break;
+ case BIFF12_DXF_FONT_HEIGHT: createFont( false )->importDxfHeight( rStrm ); break;
+ case BIFF12_DXF_FONT_SCHEME: createFont( false )->importDxfScheme( rStrm ); break;
+ case BIFF12_DXF_NUMFMT_CODE: aFmtCode = BiffHelper::readString( rStrm, false ); break;
+ case BIFF12_DXF_NUMFMT_ID: nNumFmtId = rStrm.readuInt16(); break;
}
rStrm.seek( nRecEnd );
}
@@ -2900,16 +2907,16 @@ void CellStyle::importCellStyle( const AttributeList& rAttribs )
maModel.mbHidden = rAttribs.getBool( XML_hidden, false );
}
-void CellStyle::importCellStyle( RecordInputStream& rStrm )
+void CellStyle::importCellStyle( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags;
rStrm >> maModel.mnXfId >> nFlags;
maModel.mnBuiltinId = rStrm.readInt8();
maModel.mnLevel = rStrm.readInt8();
rStrm >> maModel.maName;
- maModel.mbBuiltin = getFlag( nFlags, OOBIN_CELLSTYLE_BUILTIN );
- maModel.mbCustom = getFlag( nFlags, OOBIN_CELLSTYLE_CUSTOM );
- maModel.mbHidden = getFlag( nFlags, OOBIN_CELLSTYLE_HIDDEN );
+ maModel.mbBuiltin = getFlag( nFlags, BIFF12_CELLSTYLE_BUILTIN );
+ maModel.mbCustom = getFlag( nFlags, BIFF12_CELLSTYLE_CUSTOM );
+ maModel.mbHidden = getFlag( nFlags, BIFF12_CELLSTYLE_HIDDEN );
}
void CellStyle::importStyle( BiffInputStream& rStrm )
@@ -3001,7 +3008,7 @@ CellStyleRef CellStyleBuffer::importCellStyle( const AttributeList& rAttribs )
return xCellStyle;
}
-CellStyleRef CellStyleBuffer::importCellStyle( RecordInputStream& rStrm )
+CellStyleRef CellStyleBuffer::importCellStyle( SequenceInputStream& rStrm )
{
CellStyleRef xCellStyle( new CellStyle( *this ) );
xCellStyle->importCellStyle( rStrm );
@@ -3162,6 +3169,19 @@ OUString CellStyleBuffer::createCellStyle( const CellStyleRef& rxCellStyle ) con
// ============================================================================
+AutoFormatModel::AutoFormatModel() :
+ mnAutoFormatId( 0 ),
+ mbApplyNumFmt( false ),
+ mbApplyFont( false ),
+ mbApplyAlignment( false ),
+ mbApplyBorder( false ),
+ mbApplyFill( false ),
+ mbApplyProtection( false )
+{
+}
+
+// ============================================================================
+
StylesBuffer::StylesBuffer( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper ),
maPalette( rHelper ),
@@ -3238,17 +3258,17 @@ CellStyleRef StylesBuffer::importCellStyle( const AttributeList& rAttribs )
return maCellStyles.importCellStyle( rAttribs );
}
-void StylesBuffer::importPaletteColor( RecordInputStream& rStrm )
+void StylesBuffer::importPaletteColor( SequenceInputStream& rStrm )
{
maPalette.importPaletteColor( rStrm );
}
-void StylesBuffer::importNumFmt( RecordInputStream& rStrm )
+void StylesBuffer::importNumFmt( SequenceInputStream& rStrm )
{
maNumFmts.importNumFmt( rStrm );
}
-void StylesBuffer::importCellStyle( RecordInputStream& rStrm )
+void StylesBuffer::importCellStyle( SequenceInputStream& rStrm )
{
maCellStyles.importCellStyle( rStrm );
}
@@ -3305,6 +3325,11 @@ void StylesBuffer::importStyle( BiffInputStream& rStrm )
maCellStyles.importStyle( rStrm );
}
+void StylesBuffer::importPalette( const Any& rPalette )
+{
+ maPalette.importPalette( rPalette );
+}
+
void StylesBuffer::finalizeImport()
{
// fonts first, are needed to finalize unit converter and XFs below
@@ -3388,7 +3413,7 @@ bool StylesBuffer::equalBorders( sal_Int32 nBorderId1, sal_Int32 nBorderId2 ) co
switch( getFilterType() )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
// in OOXML, borders are assumed to be unique
return false;
@@ -3413,7 +3438,7 @@ bool StylesBuffer::equalFills( sal_Int32 nFillId1, sal_Int32 nFillId2 ) const
switch( getFilterType() )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
// in OOXML, fills are assumed to be unique
return false;
@@ -3520,4 +3545,4 @@ void StylesBuffer::writeStyleXfToPropertySet( PropertySet& rPropSet, sal_Int32 n
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/stylesfragment.cxx b/oox/source/xls/stylesfragment.cxx
index c3b15f872077..2e52b4b9e993 100644
--- a/oox/source/xls/stylesfragment.cxx
+++ b/oox/source/xls/stylesfragment.cxx
@@ -27,23 +27,26 @@
************************************************************************/
#include "oox/xls/stylesfragment.hxx"
-#include "oox/helper/attributelist.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
+#include "oox/helper/attributelist.hxx"
namespace oox {
namespace xls {
// ============================================================================
-OoxIndexedColorsContext::OoxIndexedColorsContext( OoxWorkbookFragmentBase& rFragment ) :
- OoxWorkbookContextBase( rFragment )
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+IndexedColorsContext::IndexedColorsContext( WorkbookFragmentBase& rFragment ) :
+ WorkbookContextBase( rFragment )
{
}
-ContextHandlerRef OoxIndexedColorsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef IndexedColorsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -54,12 +57,12 @@ ContextHandlerRef OoxIndexedColorsContext::onCreateContext( sal_Int32 nElement,
return 0;
}
-ContextHandlerRef OoxIndexedColorsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef IndexedColorsContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
- case OOBIN_ID_INDEXEDCOLORS:
- if( nRecId == OOBIN_ID_RGBCOLOR ) getStyles().importPaletteColor( rStrm );
+ case BIFF12_ID_INDEXEDCOLORS:
+ if( nRecId == BIFF12_ID_RGBCOLOR ) getStyles().importPaletteColor( rStrm );
break;
}
return 0;
@@ -67,7 +70,7 @@ ContextHandlerRef OoxIndexedColorsContext::onCreateRecordContext( sal_Int32 nRec
// ============================================================================
-ContextHandlerRef OoxFontContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef FontContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
if( mxFont.get() )
mxFont->importAttribs( nElement, rAttribs );
@@ -76,13 +79,13 @@ ContextHandlerRef OoxFontContext::onCreateContext( sal_Int32 nElement, const Att
// ============================================================================
-void OoxBorderContext::onStartElement( const AttributeList& rAttribs )
+void BorderContext::onStartElement( const AttributeList& rAttribs )
{
if( mxBorder.get() && (getCurrentElement() == XLS_TOKEN( border )) )
mxBorder->importBorder( rAttribs );
}
-ContextHandlerRef OoxBorderContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef BorderContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
if( mxBorder.get() ) switch( getCurrentElement() )
{
@@ -99,7 +102,7 @@ ContextHandlerRef OoxBorderContext::onCreateContext( sal_Int32 nElement, const A
// ============================================================================
-ContextHandlerRef OoxFillContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef FillContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
if( mxFill.get() ) switch( getCurrentElement() )
{
@@ -134,13 +137,13 @@ ContextHandlerRef OoxFillContext::onCreateContext( sal_Int32 nElement, const Att
// ============================================================================
-void OoxXfContext::onStartElement( const AttributeList& rAttribs )
+void XfContext::onStartElement( const AttributeList& rAttribs )
{
if( mxXf.get() && (getCurrentElement() == XLS_TOKEN( xf )) )
mxXf->importXf( rAttribs, mbCellXf );
}
-ContextHandlerRef OoxXfContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef XfContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
if( mxXf.get() ) switch( getCurrentElement() )
{
@@ -157,16 +160,16 @@ ContextHandlerRef OoxXfContext::onCreateContext( sal_Int32 nElement, const Attri
// ============================================================================
-ContextHandlerRef OoxDxfContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef DxfContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
if( mxDxf.get() ) switch( getCurrentElement() )
{
case XLS_TOKEN( dxf ):
switch( nElement )
{
- case XLS_TOKEN( font ): return new OoxFontContext( *this, mxDxf->createFont() );
- case XLS_TOKEN( border ): return new OoxBorderContext( *this, mxDxf->createBorder() );
- case XLS_TOKEN( fill ): return new OoxFillContext( *this, mxDxf->createFill() );
+ case XLS_TOKEN( font ): return new FontContext( *this, mxDxf->createFont() );
+ case XLS_TOKEN( border ): return new BorderContext( *this, mxDxf->createBorder() );
+ case XLS_TOKEN( fill ): return new FillContext( *this, mxDxf->createFill() );
case XLS_TOKEN( numFmt ): mxDxf->importNumFmt( rAttribs ); break;
#if 0
@@ -181,14 +184,12 @@ ContextHandlerRef OoxDxfContext::onCreateContext( sal_Int32 nElement, const Attr
// ============================================================================
-OoxStylesFragment::OoxStylesFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+StylesFragment::StylesFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
+ WorkbookFragmentBase( rHelper, rFragmentPath )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxStylesFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef StylesFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -212,28 +213,28 @@ ContextHandlerRef OoxStylesFragment::onCreateContext( sal_Int32 nElement, const
break;
case XLS_TOKEN( colors ):
- if( nElement == XLS_TOKEN( indexedColors ) ) return new OoxIndexedColorsContext( *this );
+ if( nElement == XLS_TOKEN( indexedColors ) ) return new IndexedColorsContext( *this );
break;
case XLS_TOKEN( numFmts ):
if( nElement == XLS_TOKEN( numFmt ) ) getStyles().importNumFmt( rAttribs );
break;
case XLS_TOKEN( fonts ):
- if( nElement == XLS_TOKEN( font ) ) return new OoxFontContext( *this, getStyles().createFont() );
+ if( nElement == XLS_TOKEN( font ) ) return new FontContext( *this, getStyles().createFont() );
break;
case XLS_TOKEN( borders ):
- if( nElement == XLS_TOKEN( border ) ) return new OoxBorderContext( *this, getStyles().createBorder() );
+ if( nElement == XLS_TOKEN( border ) ) return new BorderContext( *this, getStyles().createBorder() );
break;
case XLS_TOKEN( fills ):
- if( nElement == XLS_TOKEN( fill ) ) return new OoxFillContext( *this, getStyles().createFill() );
+ if( nElement == XLS_TOKEN( fill ) ) return new FillContext( *this, getStyles().createFill() );
break;
case XLS_TOKEN( cellXfs ):
- if( nElement == XLS_TOKEN( xf ) ) return new OoxXfContext( *this, getStyles().createCellXf(), true );
+ if( nElement == XLS_TOKEN( xf ) ) return new XfContext( *this, getStyles().createCellXf(), true );
break;
case XLS_TOKEN( cellStyleXfs ):
- if( nElement == XLS_TOKEN( xf ) ) return new OoxXfContext( *this, getStyles().createStyleXf(), false );
+ if( nElement == XLS_TOKEN( xf ) ) return new XfContext( *this, getStyles().createStyleXf(), false );
break;
case XLS_TOKEN( dxfs ):
- if( nElement == XLS_TOKEN( dxf ) ) return new OoxDxfContext( *this, getStyles().createDxf() );
+ if( nElement == XLS_TOKEN( dxf ) ) return new DxfContext( *this, getStyles().createDxf() );
break;
case XLS_TOKEN( cellStyles ):
if( nElement == XLS_TOKEN( cellStyle ) ) getStyles().importCellStyle( rAttribs );
@@ -242,85 +243,83 @@ ContextHandlerRef OoxStylesFragment::onCreateContext( sal_Int32 nElement, const
return 0;
}
-ContextHandlerRef OoxStylesFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef StylesFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_STYLESHEET ) return this;
+ if( nRecId == BIFF12_ID_STYLESHEET ) return this;
break;
- case OOBIN_ID_STYLESHEET:
+ case BIFF12_ID_STYLESHEET:
switch( nRecId )
{
- case OOBIN_ID_COLORS:
- case OOBIN_ID_NUMFMTS:
- case OOBIN_ID_FONTS:
- case OOBIN_ID_BORDERS:
- case OOBIN_ID_FILLS:
- case OOBIN_ID_CELLXFS:
- case OOBIN_ID_CELLSTYLEXFS:
- case OOBIN_ID_DXFS:
- case OOBIN_ID_CELLSTYLES: return this;
+ case BIFF12_ID_COLORS:
+ case BIFF12_ID_NUMFMTS:
+ case BIFF12_ID_FONTS:
+ case BIFF12_ID_BORDERS:
+ case BIFF12_ID_FILLS:
+ case BIFF12_ID_CELLXFS:
+ case BIFF12_ID_CELLSTYLEXFS:
+ case BIFF12_ID_DXFS:
+ case BIFF12_ID_CELLSTYLES: return this;
}
break;
- case OOBIN_ID_COLORS:
- if( nRecId == OOBIN_ID_INDEXEDCOLORS ) return new OoxIndexedColorsContext( *this );
+ case BIFF12_ID_COLORS:
+ if( nRecId == BIFF12_ID_INDEXEDCOLORS ) return new IndexedColorsContext( *this );
break;
- case OOBIN_ID_NUMFMTS:
- if( nRecId == OOBIN_ID_NUMFMT ) getStyles().importNumFmt( rStrm );
+ case BIFF12_ID_NUMFMTS:
+ if( nRecId == BIFF12_ID_NUMFMT ) getStyles().importNumFmt( rStrm );
break;
- case OOBIN_ID_FONTS:
- if( nRecId == OOBIN_ID_FONT ) getStyles().createFont()->importFont( rStrm );
+ case BIFF12_ID_FONTS:
+ if( nRecId == BIFF12_ID_FONT ) getStyles().createFont()->importFont( rStrm );
break;
- case OOBIN_ID_BORDERS:
- if( nRecId == OOBIN_ID_BORDER ) getStyles().createBorder()->importBorder( rStrm );
+ case BIFF12_ID_BORDERS:
+ if( nRecId == BIFF12_ID_BORDER ) getStyles().createBorder()->importBorder( rStrm );
break;
- case OOBIN_ID_FILLS:
- if( nRecId == OOBIN_ID_FILL ) getStyles().createFill()->importFill( rStrm );
+ case BIFF12_ID_FILLS:
+ if( nRecId == BIFF12_ID_FILL ) getStyles().createFill()->importFill( rStrm );
break;
- case OOBIN_ID_CELLXFS:
- if( nRecId == OOBIN_ID_XF ) getStyles().createCellXf()->importXf( rStrm, true );
+ case BIFF12_ID_CELLXFS:
+ if( nRecId == BIFF12_ID_XF ) getStyles().createCellXf()->importXf( rStrm, true );
break;
- case OOBIN_ID_CELLSTYLEXFS:
- if( nRecId == OOBIN_ID_XF ) getStyles().createStyleXf()->importXf( rStrm, false );
+ case BIFF12_ID_CELLSTYLEXFS:
+ if( nRecId == BIFF12_ID_XF ) getStyles().createStyleXf()->importXf( rStrm, false );
break;
- case OOBIN_ID_DXFS:
- if( nRecId == OOBIN_ID_DXF ) getStyles().createDxf()->importDxf( rStrm );
+ case BIFF12_ID_DXFS:
+ if( nRecId == BIFF12_ID_DXF ) getStyles().createDxf()->importDxf( rStrm );
break;
- case OOBIN_ID_CELLSTYLES:
- if( nRecId == OOBIN_ID_CELLSTYLE ) getStyles().importCellStyle( rStrm );
+ case BIFF12_ID_CELLSTYLES:
+ if( nRecId == BIFF12_ID_CELLSTYLE ) getStyles().importCellStyle( rStrm );
break;
}
return 0;
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxStylesFragment::getRecordInfos() const
+const RecordInfo* StylesFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_BORDERS, OOBIN_ID_BORDERS + 1 },
- { OOBIN_ID_CELLSTYLES, OOBIN_ID_CELLSTYLES + 1 },
- { OOBIN_ID_CELLSTYLEXFS, OOBIN_ID_CELLSTYLEXFS + 1 },
- { OOBIN_ID_CELLXFS, OOBIN_ID_CELLXFS + 1 },
- { OOBIN_ID_COLORS, OOBIN_ID_COLORS + 1 },
- { OOBIN_ID_DXFS, OOBIN_ID_DXFS + 1 },
- { OOBIN_ID_FILLS, OOBIN_ID_FILLS + 1 },
- { OOBIN_ID_FONTS, OOBIN_ID_FONTS + 1 },
- { OOBIN_ID_INDEXEDCOLORS, OOBIN_ID_INDEXEDCOLORS + 1 },
- { OOBIN_ID_MRUCOLORS, OOBIN_ID_MRUCOLORS + 1 },
- { OOBIN_ID_NUMFMTS, OOBIN_ID_NUMFMTS + 1 },
- { OOBIN_ID_STYLESHEET, OOBIN_ID_STYLESHEET + 1 },
- { OOBIN_ID_TABLESTYLES, OOBIN_ID_TABLESTYLES + 1 },
+ { BIFF12_ID_BORDERS, BIFF12_ID_BORDERS + 1 },
+ { BIFF12_ID_CELLSTYLES, BIFF12_ID_CELLSTYLES + 1 },
+ { BIFF12_ID_CELLSTYLEXFS, BIFF12_ID_CELLSTYLEXFS + 1 },
+ { BIFF12_ID_CELLXFS, BIFF12_ID_CELLXFS + 1 },
+ { BIFF12_ID_COLORS, BIFF12_ID_COLORS + 1 },
+ { BIFF12_ID_DXFS, BIFF12_ID_DXFS + 1 },
+ { BIFF12_ID_FILLS, BIFF12_ID_FILLS + 1 },
+ { BIFF12_ID_FONTS, BIFF12_ID_FONTS + 1 },
+ { BIFF12_ID_INDEXEDCOLORS, BIFF12_ID_INDEXEDCOLORS + 1 },
+ { BIFF12_ID_MRUCOLORS, BIFF12_ID_MRUCOLORS + 1 },
+ { BIFF12_ID_NUMFMTS, BIFF12_ID_NUMFMTS + 1 },
+ { BIFF12_ID_STYLESHEET, BIFF12_ID_STYLESHEET + 1 },
+ { BIFF12_ID_TABLESTYLES, BIFF12_ID_TABLESTYLES + 1 },
{ -1, -1 }
};
return spRecInfos;
}
-void OoxStylesFragment::finalizeImport()
+void StylesFragment::finalizeImport()
{
getStyles().finalizeImport();
}
@@ -330,4 +329,4 @@ void OoxStylesFragment::finalizeImport()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/tablebuffer.cxx b/oox/source/xls/tablebuffer.cxx
index f9b68b6f74f5..d7594f1eced0 100644
--- a/oox/source/xls/tablebuffer.cxx
+++ b/oox/source/xls/tablebuffer.cxx
@@ -27,28 +27,26 @@
************************************************************************/
#include "oox/xls/tablebuffer.hxx"
-#include <com/sun/star/sheet/XDatabaseRanges.hpp>
+
#include <com/sun/star/sheet/XDatabaseRange.hpp>
-#include "properties.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/helper/containerhelper.hxx"
+#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/addressconverter.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::sheet::XDatabaseRanges;
-using ::com::sun::star::sheet::XDatabaseRange;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
TableModel::TableModel() :
mnId( -1 ),
mnType( XML_worksheet ),
@@ -61,6 +59,7 @@ TableModel::TableModel() :
Table::Table( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper ),
+ maAutoFilters( rHelper ),
mnTokenIndex( -1 )
{
}
@@ -76,7 +75,7 @@ void Table::importTable( const AttributeList& rAttribs, sal_Int16 nSheet )
maModel.mnTotalsRows = rAttribs.getInteger( XML_totalsRowCount, 0 );
}
-void Table::importTable( RecordInputStream& rStrm, sal_Int16 nSheet )
+void Table::importTable( SequenceInputStream& rStrm, sal_Int16 nSheet )
{
BinRange aBinRange;
sal_Int32 nType;
@@ -91,22 +90,20 @@ void Table::importTable( RecordInputStream& rStrm, sal_Int16 nSheet )
void Table::finalizeImport()
{
- // validate cell range
- maDestRange = maModel.maRange;
- bool bValidRange = getAddressConverter().validateCellRange( maDestRange, true, true );
-
// create database range
- if( bValidRange && (maModel.mnId > 0) && (maModel.maDisplayName.getLength() > 0) ) try
+ if( (maModel.mnId > 0) && (maModel.maDisplayName.getLength() > 0) ) try
{
- // find an unused name
- Reference< XDatabaseRanges > xDatabaseRanges = getDatabaseRanges();
- Reference< XNameAccess > xNameAccess( xDatabaseRanges, UNO_QUERY_THROW );
- OUString aName = ContainerHelper::getUnusedName( xNameAccess, maModel.maDisplayName, '_' );
- xDatabaseRanges->addNewByName( aName, maModel.maRange );
- Reference< XDatabaseRange > xDatabaseRange( xDatabaseRanges->getByName( aName ), UNO_QUERY_THROW );
+ maDBRangeName = maModel.maDisplayName;
+ Reference< XDatabaseRange > xDatabaseRange( createDatabaseRangeObject( maDBRangeName, maModel.maRange ), UNO_SET_THROW );
+ maDestRange = xDatabaseRange->getDataArea();
+
+ // get formula token index of the database range
PropertySet aPropSet( xDatabaseRange );
if( !aPropSet.getProperty( mnTokenIndex, PROP_TokenIndex ) )
mnTokenIndex = -1;
+
+ // filter settings
+ maAutoFilters.finalizeImport( xDatabaseRange );
}
catch( Exception& )
{
@@ -121,24 +118,19 @@ TableBuffer::TableBuffer( const WorkbookHelper& rHelper ) :
{
}
-TableRef TableBuffer::importTable( const AttributeList& rAttribs, sal_Int16 nSheet )
-{
- TableRef xTable( new Table( *this ) );
- xTable->importTable( rAttribs, nSheet );
- insertTable( xTable );
- return xTable;
-}
-
-TableRef TableBuffer::importTable( RecordInputStream& rStrm, sal_Int16 nSheet )
+Table& TableBuffer::createTable()
{
- TableRef xTable( new Table( *this ) );
- xTable->importTable( rStrm, nSheet );
- insertTable( xTable );
- return xTable;
+ TableVector::value_type xTable( new Table( *this ) );
+ maTables.push_back( xTable );
+ return *xTable;
}
void TableBuffer::finalizeImport()
{
+ // map all tables by identifier and display name
+ for( TableVector::iterator aIt = maTables.begin(), aEnd = maTables.end(); aIt != aEnd; ++aIt )
+ insertTableToMaps( *aIt );
+ // finalize all valid tables
maIdTables.forEachMem( &Table::finalizeImport );
}
@@ -154,16 +146,16 @@ TableRef TableBuffer::getTable( const OUString& rDispName ) const
// private --------------------------------------------------------------------
-void TableBuffer::insertTable( TableRef xTable )
+void TableBuffer::insertTableToMaps( const TableRef& rxTable )
{
- sal_Int32 nTableId = xTable->getTableId();
- const OUString& rDispName = xTable->getDisplayName();
+ sal_Int32 nTableId = rxTable->getTableId();
+ const OUString& rDispName = rxTable->getDisplayName();
if( (nTableId > 0) && (rDispName.getLength() > 0) )
{
- OSL_ENSURE( maIdTables.find( nTableId ) == maIdTables.end(), "TableBuffer::insertTable - multiple table identifier" );
- maIdTables[ nTableId ] = xTable;
- OSL_ENSURE( maNameTables.find( rDispName ) == maNameTables.end(), "TableBuffer::insertTable - multiple table name" );
- maNameTables[ rDispName ] = xTable;
+ OSL_ENSURE( !maIdTables.has( nTableId ), "TableBuffer::insertTableToMaps - multiple table identifier" );
+ maIdTables[ nTableId ] = rxTable;
+ OSL_ENSURE( !maNameTables.has( rDispName ), "TableBuffer::insertTableToMaps - multiple table name" );
+ maNameTables[ rDispName ] = rxTable;
}
}
@@ -172,4 +164,4 @@ void TableBuffer::insertTable( TableRef xTable )
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/tablefragment.cxx b/oox/source/xls/tablefragment.cxx
index 096a8ca25cce..b33cb5c86562 100644
--- a/oox/source/xls/tablefragment.cxx
+++ b/oox/source/xls/tablefragment.cxx
@@ -28,54 +28,75 @@
#include "oox/xls/tablefragment.hxx"
-using ::rtl::OUString;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
+#include "oox/xls/autofilterbuffer.hxx"
+#include "oox/xls/autofiltercontext.hxx"
+#include "oox/xls/tablebuffer.hxx"
namespace oox {
namespace xls {
// ============================================================================
-OoxTableFragment::OoxTableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorksheetFragmentBase( rHelper, rFragmentPath )
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+TableFragment::TableFragment( const WorksheetHelper& rHelper, const OUString& rFragmentPath ) :
+ WorksheetFragmentBase( rHelper, rFragmentPath ),
+ mrTable( getTables().createTable() )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxTableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef TableFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
if( nElement == XLS_TOKEN( table ) )
- mxTable = getTables().importTable( rAttribs, getSheetIndex() );
+ {
+ mrTable.importTable( rAttribs, getSheetIndex() );
+ return this;
+ }
+ break;
+ case XLS_TOKEN( table ):
+ if( nElement == XLS_TOKEN( autoFilter ) )
+ return new AutoFilterContext( *this, mrTable.createAutoFilter() );
break;
}
return 0;
}
-ContextHandlerRef OoxTableFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef TableFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_TABLE )
- mxTable = getTables().importTable( rStrm, getSheetIndex() );
+ if( nRecId == BIFF12_ID_TABLE )
+ {
+ mrTable.importTable( rStrm, getSheetIndex() );
+ return this;
+ }
+ break;
+ case BIFF12_ID_TABLE:
+ if( nRecId == BIFF12_ID_AUTOFILTER )
+ return new AutoFilterContext( *this, mrTable.createAutoFilter() );
break;
}
return 0;
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxTableFragment::getRecordInfos() const
+const RecordInfo* TableFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_TABLE, OOBIN_ID_TABLE + 1 },
- { -1, -1 }
+ { BIFF12_ID_AUTOFILTER, BIFF12_ID_AUTOFILTER + 1 },
+ { BIFF12_ID_CUSTOMFILTERS, BIFF12_ID_CUSTOMFILTERS + 1 },
+ { BIFF12_ID_DISCRETEFILTERS, BIFF12_ID_DISCRETEFILTERS + 1 },
+ { BIFF12_ID_FILTERCOLUMN, BIFF12_ID_FILTERCOLUMN + 1 },
+ { BIFF12_ID_TABLE, BIFF12_ID_TABLE + 1 },
+ { -1, -1 }
};
return spRecInfos;
}
@@ -85,4 +106,4 @@ const RecordInfo* OoxTableFragment::getRecordInfos() const
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/themebuffer.cxx b/oox/source/xls/themebuffer.cxx
index fc1ec6ce987e..9738f74d9d04 100644
--- a/oox/source/xls/themebuffer.cxx
+++ b/oox/source/xls/themebuffer.cxx
@@ -27,16 +27,18 @@
************************************************************************/
#include "oox/xls/themebuffer.hxx"
-#include "oox/xls/stylesbuffer.hxx"
-#include "tokens.hxx"
-using ::oox::drawingml::ClrScheme;
+#include "oox/xls/stylesbuffer.hxx"
namespace oox {
namespace xls {
// ============================================================================
+using ::oox::drawingml::ClrScheme;
+
+// ============================================================================
+
namespace {
/** Specifies default theme fonts for a specific locale. */
@@ -92,7 +94,7 @@ ThemeBuffer::ThemeBuffer( const WorkbookHelper& rHelper ) :
{
switch( getFilterType() )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
//! TODO: locale dependent font name
mxDefFontModel->maName = CREATE_OUSTRING( "Cambria" );
mxDefFontModel->mfHeight = 11.0;
@@ -121,4 +123,4 @@ sal_Int32 ThemeBuffer::getColorByToken( sal_Int32 nToken ) const
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/unitconverter.cxx b/oox/source/xls/unitconverter.cxx
index 2cf7fae8f0cb..65c48e243edc 100644
--- a/oox/source/xls/unitconverter.cxx
+++ b/oox/source/xls/unitconverter.cxx
@@ -27,30 +27,31 @@
************************************************************************/
#include "oox/xls/unitconverter.hxx"
-#include <rtl/math.hxx>
+
+#include <com/sun/star/awt/DeviceInfo.hpp>
#include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/awt/XDevice.hpp>
-#include <com/sun/star/awt/DeviceInfo.hpp>
#include <com/sun/star/awt/XFont.hpp>
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/util/DateTime.hpp>
+#include <rtl/math.hxx>
#include "oox/core/filterbase.hxx"
+#include "oox/helper/propertyset.hxx"
#include "oox/xls/stylesbuffer.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::awt::FontDescriptor;
-using ::com::sun::star::awt::XDevice;
-using ::com::sun::star::awt::DeviceInfo;
-using ::com::sun::star::awt::XFont;
-using ::com::sun::star::util::Date;
-using ::com::sun::star::util::DateTime;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
const double MM100_PER_INCH = 2540.0;
@@ -133,7 +134,8 @@ UnitConverter::UnitConverter( const WorkbookHelper& rHelper ) :
void UnitConverter::finalizeImport()
{
- Reference< XDevice > xDevice = getReferenceDevice();
+ PropertySet aDocProps( getDocument() );
+ Reference< XDevice > xDevice( aDocProps.getAnyProperty( PROP_ReferenceDevice ), UNO_QUERY );
if( xDevice.is() )
{
// get reference device metric first, needed to get character widths below
@@ -257,4 +259,4 @@ double UnitConverter::getCoefficient( Unit eUnit ) const
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/viewsettings.cxx b/oox/source/xls/viewsettings.cxx
index 9f04cf3d8007..02bf78ba0527 100644
--- a/oox/source/xls/viewsettings.cxx
+++ b/oox/source/xls/viewsettings.cxx
@@ -27,128 +27,121 @@
************************************************************************/
#include "oox/xls/viewsettings.hxx"
+
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/document/XViewDataSupplier.hpp>
-#include <com/sun/star/text/WritingMode2.hpp>
#include <comphelper/mediadescriptor.hxx>
-#include "properties.hxx"
+#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertymap.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/unitconverter.hxx"
#include "oox/xls/workbooksettings.hxx"
#include "oox/xls/worksheetbuffer.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::container::XNameContainer;
-using ::com::sun::star::container::XIndexContainer;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::document::XViewDataSupplier;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::oox::core::FilterBase;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
+using ::oox::core::FilterBase;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
-const sal_Int32 OOX_BOOKVIEW_TABBARRATIO_DEF = 600; /// Default tabbar ratio.
-const sal_Int32 OOX_SHEETVIEW_NORMALZOOM_DEF = 100; /// Default zoom for normal view.
-const sal_Int32 OOX_SHEETVIEW_SHEETLAYZOOM_DEF = 60; /// Default zoom for pagebreak preview.
-const sal_Int32 OOX_SHEETVIEW_PAGELAYZOOM_DEF = 100; /// Default zoom for page layout view.
-
-const sal_uInt8 OOBIN_PANE_FROZEN = 0x01;
-const sal_uInt8 OOBIN_PANE_FROZENNOSPLIT = 0x02;
-
-const sal_uInt16 OOBIN_SHEETVIEW_WINPROTECTED = 0x0001;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWFORMULAS = 0x0002;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWGRID = 0x0004;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWHEADINGS = 0x0008;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWZEROS = 0x0010;
-const sal_uInt16 OOBIN_SHEETVIEW_RIGHTTOLEFT = 0x0020;
-const sal_uInt16 OOBIN_SHEETVIEW_SELECTED = 0x0040;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWRULER = 0x0080;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWOUTLINE = 0x0100;
-const sal_uInt16 OOBIN_SHEETVIEW_DEFGRIDCOLOR = 0x0200;
-const sal_uInt16 OOBIN_SHEETVIEW_SHOWWHITESPACE = 0x0400;
-
-const sal_uInt16 OOBIN_CHARTSHEETVIEW_SELECTED = 0x0001;
-const sal_uInt16 OOBIN_CHARTSHEETVIEW_ZOOMTOFIT = 0x0002;
-
-const sal_uInt8 OOBIN_WBVIEW_HIDDEN = 0x01;
-const sal_uInt8 OOBIN_WBVIEW_MINIMIZED = 0x02;
-const sal_uInt8 OOBIN_WBVIEW_SHOWHORSCROLL = 0x08;
-const sal_uInt8 OOBIN_WBVIEW_SHOWVERSCROLL = 0x10;
-const sal_uInt8 OOBIN_WBVIEW_SHOWTABBAR = 0x20;
-const sal_uInt8 OOBIN_WBVIEW_AUTOFILTERGROUP = 0x40;
-
-const sal_uInt8 BIFF_PANE_BOTTOMRIGHT = 0; /// Bottom-right pane.
-const sal_uInt8 BIFF_PANE_TOPRIGHT = 1; /// Right, or top-right pane.
-const sal_uInt8 BIFF_PANE_BOTTOMLEFT = 2; /// Bottom, or bottom-left pane.
-const sal_uInt8 BIFF_PANE_TOPLEFT = 3; /// Single, top, left, or top-left pane.
-
-const sal_uInt16 BIFF_WINDOW1_HIDDEN = 0x0001;
-const sal_uInt16 BIFF_WINDOW1_MINIMIZED = 0x0002;
-const sal_uInt16 BIFF_WINDOW1_SHOWHORSCROLL = 0x0008;
-const sal_uInt16 BIFF_WINDOW1_SHOWVERSCROLL = 0x0010;
-const sal_uInt16 BIFF_WINDOW1_SHOWTABBAR = 0x0020;
-
-const sal_uInt16 BIFF_WINDOW2_SHOWFORMULAS = 0x0001;
-const sal_uInt16 BIFF_WINDOW2_SHOWGRID = 0x0002;
-const sal_uInt16 BIFF_WINDOW2_SHOWHEADINGS = 0x0004;
-const sal_uInt16 BIFF_WINDOW2_FROZEN = 0x0008;
-const sal_uInt16 BIFF_WINDOW2_SHOWZEROS = 0x0010;
-const sal_uInt16 BIFF_WINDOW2_DEFGRIDCOLOR = 0x0020;
-const sal_uInt16 BIFF_WINDOW2_RIGHTTOLEFT = 0x0040;
-const sal_uInt16 BIFF_WINDOW2_SHOWOUTLINE = 0x0080;
-const sal_uInt16 BIFF_WINDOW2_FROZENNOSPLIT = 0x0100;
-const sal_uInt16 BIFF_WINDOW2_SELECTED = 0x0200;
-const sal_uInt16 BIFF_WINDOW2_DISPLAYED = 0x0400;
-const sal_uInt16 BIFF_WINDOW2_PAGEBREAKMODE = 0x0800;
+const sal_Int32 OOX_BOOKVIEW_TABBARRATIO_DEF = 600; /// Default tabbar ratio.
+const sal_Int32 OOX_SHEETVIEW_NORMALZOOM_DEF = 100; /// Default zoom for normal view.
+const sal_Int32 OOX_SHEETVIEW_SHEETLAYZOOM_DEF = 60; /// Default zoom for pagebreak preview.
+const sal_Int32 OOX_SHEETVIEW_PAGELAYZOOM_DEF = 100; /// Default zoom for page layout view.
+
+const sal_uInt8 BIFF12_PANE_FROZEN = 0x01;
+const sal_uInt8 BIFF12_PANE_FROZENNOSPLIT = 0x02;
+
+const sal_uInt16 BIFF12_SHEETVIEW_WINPROTECTED = 0x0001;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWFORMULAS = 0x0002;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWGRID = 0x0004;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWHEADINGS = 0x0008;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWZEROS = 0x0010;
+const sal_uInt16 BIFF12_SHEETVIEW_RIGHTTOLEFT = 0x0020;
+const sal_uInt16 BIFF12_SHEETVIEW_SELECTED = 0x0040;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWRULER = 0x0080;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWOUTLINE = 0x0100;
+const sal_uInt16 BIFF12_SHEETVIEW_DEFGRIDCOLOR = 0x0200;
+const sal_uInt16 BIFF12_SHEETVIEW_SHOWWHITESPACE = 0x0400;
+
+const sal_uInt16 BIFF12_CHARTSHEETVIEW_SELECTED = 0x0001;
+const sal_uInt16 BIFF12_CHARTSHEETVIEW_ZOOMTOFIT = 0x0002;
+
+const sal_uInt8 BIFF12_WBVIEW_HIDDEN = 0x01;
+const sal_uInt8 BIFF12_WBVIEW_MINIMIZED = 0x02;
+const sal_uInt8 BIFF12_WBVIEW_SHOWHORSCROLL = 0x08;
+const sal_uInt8 BIFF12_WBVIEW_SHOWVERSCROLL = 0x10;
+const sal_uInt8 BIFF12_WBVIEW_SHOWTABBAR = 0x20;
+const sal_uInt8 BIFF12_WBVIEW_AUTOFILTERGROUP = 0x40;
+
+const sal_uInt8 BIFF_PANE_BOTTOMRIGHT = 0; /// Bottom-right pane.
+const sal_uInt8 BIFF_PANE_TOPRIGHT = 1; /// Right, or top-right pane.
+const sal_uInt8 BIFF_PANE_BOTTOMLEFT = 2; /// Bottom, or bottom-left pane.
+const sal_uInt8 BIFF_PANE_TOPLEFT = 3; /// Single, top, left, or top-left pane.
+
+const sal_uInt16 BIFF_WINDOW1_HIDDEN = 0x0001;
+const sal_uInt16 BIFF_WINDOW1_MINIMIZED = 0x0002;
+const sal_uInt16 BIFF_WINDOW1_SHOWHORSCROLL = 0x0008;
+const sal_uInt16 BIFF_WINDOW1_SHOWVERSCROLL = 0x0010;
+const sal_uInt16 BIFF_WINDOW1_SHOWTABBAR = 0x0020;
+
+const sal_uInt16 BIFF_WINDOW2_SHOWFORMULAS = 0x0001;
+const sal_uInt16 BIFF_WINDOW2_SHOWGRID = 0x0002;
+const sal_uInt16 BIFF_WINDOW2_SHOWHEADINGS = 0x0004;
+const sal_uInt16 BIFF_WINDOW2_FROZEN = 0x0008;
+const sal_uInt16 BIFF_WINDOW2_SHOWZEROS = 0x0010;
+const sal_uInt16 BIFF_WINDOW2_DEFGRIDCOLOR = 0x0020;
+const sal_uInt16 BIFF_WINDOW2_RIGHTTOLEFT = 0x0040;
+const sal_uInt16 BIFF_WINDOW2_SHOWOUTLINE = 0x0080;
+const sal_uInt16 BIFF_WINDOW2_FROZENNOSPLIT = 0x0100;
+const sal_uInt16 BIFF_WINDOW2_SELECTED = 0x0200;
+const sal_uInt16 BIFF_WINDOW2_DISPLAYED = 0x0400;
+const sal_uInt16 BIFF_WINDOW2_PAGEBREAKMODE = 0x0800;
// Attention: view settings in Calc do not use com.sun.star.view.DocumentZoomType!
-const sal_Int16 API_ZOOMTYPE_PERCENT = 0; /// Zoom value in percent.
+const sal_Int16 API_ZOOMTYPE_PERCENT = 0; /// Zoom value in percent.
-const sal_Int32 API_ZOOMVALUE_MIN = 20; /// Minimum zoom in Calc.
-const sal_Int32 API_ZOOMVALUE_MAX = 400; /// Maximum zoom in Calc.
+const sal_Int32 API_ZOOMVALUE_MIN = 20; /// Minimum zoom in Calc.
+const sal_Int32 API_ZOOMVALUE_MAX = 400; /// Maximum zoom in Calc.
// no predefined constants for split mode
-const sal_Int16 API_SPLITMODE_NONE = 0; /// No splits in window.
-const sal_Int16 API_SPLITMODE_SPLIT = 1; /// Window is split.
-const sal_Int16 API_SPLITMODE_FREEZE = 2; /// Window has frozen panes.
+const sal_Int16 API_SPLITMODE_NONE = 0; /// No splits in window.
+const sal_Int16 API_SPLITMODE_SPLIT = 1; /// Window is split.
+const sal_Int16 API_SPLITMODE_FREEZE = 2; /// Window has frozen panes.
// no predefined constants for pane idetifiers
-const sal_Int16 API_SPLITPANE_TOPLEFT = 0; /// Top-left, or top pane.
-const sal_Int16 API_SPLITPANE_TOPRIGHT = 1; /// Top-right pane.
-const sal_Int16 API_SPLITPANE_BOTTOMLEFT = 2; /// Bottom-left, bottom, left, or single pane.
-const sal_Int16 API_SPLITPANE_BOTTOMRIGHT = 3; /// Bottom-right, or right pane.
+const sal_Int16 API_SPLITPANE_TOPLEFT = 0; /// Top-left, or top pane.
+const sal_Int16 API_SPLITPANE_TOPRIGHT = 1; /// Top-right pane.
+const sal_Int16 API_SPLITPANE_BOTTOMLEFT = 2; /// Bottom-left, bottom, left, or single pane.
+const sal_Int16 API_SPLITPANE_BOTTOMRIGHT = 3; /// Bottom-right, or right pane.
// ----------------------------------------------------------------------------
-/** Returns the OOXML pane identifier from the passed OOBIN or BIFF pane id. */
-sal_Int32 lclGetOoxPaneId( sal_Int32 nBinPaneId, sal_Int32 nDefaultPaneId )
+/** Returns the OOXML pane identifier from the passed BIFF pane id. */
+sal_Int32 lclGetOoxPaneId( sal_Int32 nBiffPaneId, sal_Int32 nDefaultPaneId )
{
static const sal_Int32 spnPaneIds[] = { XML_bottomRight, XML_topRight, XML_bottomLeft, XML_topLeft };
- return STATIC_ARRAY_SELECT( spnPaneIds, nBinPaneId, nDefaultPaneId );
+ return STATIC_ARRAY_SELECT( spnPaneIds, nBiffPaneId, nDefaultPaneId );
}
} // namespace
@@ -296,7 +289,7 @@ void SheetViewSettings::importChartSheetView( const AttributeList& rAttribs )
rModel.mbZoomToFit = rAttribs.getBool( XML_zoomToFit, false );
}
-void SheetViewSettings::importSheetView( RecordInputStream& rStrm )
+void SheetViewSettings::importSheetView( SequenceInputStream& rStrm )
{
SheetViewModel& rModel = *createSheetView();
sal_uInt16 nFlags;
@@ -313,17 +306,17 @@ void SheetViewSettings::importSheetView( RecordInputStream& rStrm )
rModel.maFirstPos = getAddressConverter().createValidCellAddress( aFirstPos, getSheetIndex(), false );
static const sal_Int32 spnViewTypes[] = { XML_normal, XML_pageBreakPreview, XML_pageLayout };
rModel.mnViewType = STATIC_ARRAY_SELECT( spnViewTypes, nViewType, XML_normal );
- rModel.mbSelected = getFlag( nFlags, OOBIN_SHEETVIEW_SELECTED );
- rModel.mbRightToLeft = getFlag( nFlags, OOBIN_SHEETVIEW_RIGHTTOLEFT );
- rModel.mbDefGridColor = getFlag( nFlags, OOBIN_SHEETVIEW_DEFGRIDCOLOR );
- rModel.mbShowFormulas = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWFORMULAS );
- rModel.mbShowGrid = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWGRID );
- rModel.mbShowHeadings = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWHEADINGS );
- rModel.mbShowZeros = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWZEROS );
- rModel.mbShowOutline = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWOUTLINE );
+ rModel.mbSelected = getFlag( nFlags, BIFF12_SHEETVIEW_SELECTED );
+ rModel.mbRightToLeft = getFlag( nFlags, BIFF12_SHEETVIEW_RIGHTTOLEFT );
+ rModel.mbDefGridColor = getFlag( nFlags, BIFF12_SHEETVIEW_DEFGRIDCOLOR );
+ rModel.mbShowFormulas = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWFORMULAS );
+ rModel.mbShowGrid = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWGRID );
+ rModel.mbShowHeadings = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWHEADINGS );
+ rModel.mbShowZeros = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWZEROS );
+ rModel.mbShowOutline = getFlag( nFlags, BIFF12_SHEETVIEW_SHOWOUTLINE );
}
-void SheetViewSettings::importPane( RecordInputStream& rStrm )
+void SheetViewSettings::importPane( SequenceInputStream& rStrm )
{
OSL_ENSURE( !maSheetViews.empty(), "SheetViewSettings::importPane - missing sheet view model" );
if( !maSheetViews.empty() )
@@ -337,11 +330,11 @@ void SheetViewSettings::importPane( RecordInputStream& rStrm )
rModel.maSecondPos = getAddressConverter().createValidCellAddress( aSecondPos, getSheetIndex(), false );
rModel.mnActivePaneId = lclGetOoxPaneId( nActivePaneId, XML_topLeft );
- rModel.mnPaneState = getFlagValue( nFlags, OOBIN_PANE_FROZEN, getFlagValue( nFlags, OOBIN_PANE_FROZENNOSPLIT, XML_frozen, XML_frozenSplit ), XML_split );
+ rModel.mnPaneState = getFlagValue( nFlags, BIFF12_PANE_FROZEN, getFlagValue( nFlags, BIFF12_PANE_FROZENNOSPLIT, XML_frozen, XML_frozenSplit ), XML_split );
}
}
-void SheetViewSettings::importSelection( RecordInputStream& rStrm )
+void SheetViewSettings::importSelection( SequenceInputStream& rStrm )
{
OSL_ENSURE( !maSheetViews.empty(), "SheetViewSettings::importSelection - missing sheet view model" );
if( !maSheetViews.empty() )
@@ -361,14 +354,14 @@ void SheetViewSettings::importSelection( RecordInputStream& rStrm )
}
}
-void SheetViewSettings::importChartSheetView( RecordInputStream& rStrm )
+void SheetViewSettings::importChartSheetView( SequenceInputStream& rStrm )
{
SheetViewModel& rModel = *createSheetView();
sal_uInt16 nFlags;
rStrm >> nFlags >> rModel.mnCurrentZoom >> rModel.mnWorkbookViewId;
- rModel.mbSelected = getFlag( nFlags, OOBIN_CHARTSHEETVIEW_SELECTED );
- rModel.mbZoomToFit = getFlag( nFlags, OOBIN_CHARTSHEETVIEW_ZOOMTOFIT );
+ rModel.mbSelected = getFlag( nFlags, BIFF12_CHARTSHEETVIEW_SELECTED );
+ rModel.mbZoomToFit = getFlag( nFlags, BIFF12_CHARTSHEETVIEW_ZOOMTOFIT );
}
void SheetViewSettings::importWindow2( BiffInputStream& rStrm )
@@ -503,13 +496,6 @@ void SheetViewSettings::finalizeImport()
xModel->mbShowOutline = true;
}
- // mirrored sheet (this is not a view setting in Calc)
- if( xModel->mbRightToLeft )
- {
- PropertySet aPropSet( getSheet() );
- aPropSet.setProperty( PROP_TableLayout, ::com::sun::star::text::WritingMode2::RL_TB );
- }
-
// sheet selected (active sheet must be selected)
bool bSelected = xModel->mbSelected || (getSheetIndex() == getViewSettings().getActiveCalcSheet());
@@ -600,6 +586,11 @@ void SheetViewSettings::finalizeImport()
getViewSettings().setSheetViewSettings( getSheetIndex(), xModel, Any( aPropMap.makePropertyValueSequence() ) );
}
+bool SheetViewSettings::isSheetRightToLeft() const
+{
+ return !maSheetViews.empty() && maSheetViews.front()->mbRightToLeft;
+}
+
// private --------------------------------------------------------------------
SheetViewModelRef SheetViewSettings::createSheetView()
@@ -658,19 +649,19 @@ void ViewSettings::importOleSize( const AttributeList& rAttribs )
mbValidOleSize = getAddressConverter().convertToCellRange( maOleSize, aRange, 0, true, false );
}
-void ViewSettings::importWorkbookView( RecordInputStream& rStrm )
+void ViewSettings::importWorkbookView( SequenceInputStream& rStrm )
{
WorkbookViewModel& rModel = createWorkbookView();
sal_uInt8 nFlags;
rStrm >> rModel.mnWinX >> rModel.mnWinY >> rModel.mnWinWidth >> rModel.mnWinHeight >> rModel.mnTabBarWidth >> rModel.mnFirstVisSheet >> rModel.mnActiveSheet >> nFlags;
- rModel.mnVisibility = getFlagValue( nFlags, OOBIN_WBVIEW_HIDDEN, XML_hidden, XML_visible );
- rModel.mbShowTabBar = getFlag( nFlags, OOBIN_WBVIEW_SHOWTABBAR );
- rModel.mbShowHorScroll = getFlag( nFlags, OOBIN_WBVIEW_SHOWHORSCROLL );
- rModel.mbShowVerScroll = getFlag( nFlags, OOBIN_WBVIEW_SHOWVERSCROLL );
- rModel.mbMinimized = getFlag( nFlags, OOBIN_WBVIEW_MINIMIZED );
+ rModel.mnVisibility = getFlagValue( nFlags, BIFF12_WBVIEW_HIDDEN, XML_hidden, XML_visible );
+ rModel.mbShowTabBar = getFlag( nFlags, BIFF12_WBVIEW_SHOWTABBAR );
+ rModel.mbShowHorScroll = getFlag( nFlags, BIFF12_WBVIEW_SHOWHORSCROLL );
+ rModel.mbShowVerScroll = getFlag( nFlags, BIFF12_WBVIEW_SHOWVERSCROLL );
+ rModel.mbMinimized = getFlag( nFlags, BIFF12_WBVIEW_MINIMIZED );
}
-void ViewSettings::importOleSize( RecordInputStream& rStrm )
+void ViewSettings::importOleSize( SequenceInputStream& rStrm )
{
BinRange aBinRange;
rStrm >> aBinRange;
diff --git a/oox/source/xls/webquerybuffer.cxx b/oox/source/xls/webquerybuffer.cxx
deleted file mode 100644
index 8bedc8c66d6a..000000000000
--- a/oox/source/xls/webquerybuffer.cxx
+++ /dev/null
@@ -1,201 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "oox/xls/webquerybuffer.hxx"
-#include "oox/helper/attributelist.hxx"
-
-#define DEBUG_OOX_WEBQUERY_BUFFER 1
-
-#if DEBUG_OOX_WEBQUERY_BUFFER
-#include <stdio.h>
-#endif
-
-using ::rtl::OUString;
-
-namespace oox {
-namespace xls {
-
-const sal_Int32 Connection::CONNECTION_ODBC_SOURCE = 1;
-const sal_Int32 Connection::CONNECTION_DAO_SOURCE = 2;
-const sal_Int32 Connection::CONNECTION_FILE_SOURCE = 3;
-const sal_Int32 Connection::CONNECTION_WEBQUERY = 4;
-const sal_Int32 Connection::CONNECTION_OLEDB_SOURCE = 5;
-const sal_Int32 Connection::CONNECTION_TEXT_SOURCE = 6;
-const sal_Int32 Connection::CONNECTION_ADO_RECORD_SET = 7;
-const sal_Int32 Connection::CONNECTION_DSP = 8;
-
-// ============================================================================
-
-WebQueryBuffer::WebQueryBuffer( const WorkbookHelper& rHelper ) :
- WorkbookHelper( rHelper )
-{
- maQueryTableMap.clear();
-}
-
-void WebQueryBuffer::importQueryTable( const AttributeList& rAttribs )
-{
- OUString aName = rAttribs.getString( XML_name, OUString() );
- if ( !aName.getLength() )
- return;
-
- QueryTable aQTable;
- aQTable.mnConnectionId = rAttribs.getInteger( XML_connectionId, 0 );
-
- maQueryTableMap.insert( QueryTableHashMap::value_type( aName, aQTable ) );
-
- // All documented attributes of queryTable:
- // adjustColumnWidth (bool)
- // applyAlignmentFormats (bool)
- // applyBorderFormats (bool)
- // applyFontFormats (bool)
- // applyNumberFormats (bool)
- // applyPatternFormats (bool)
- // applyWidthHeightFormats (bool)
- // autoFormatId (unsigned int)
- // backgroundRefresh (bool)
- // connectionId (unsigned int)
- // disableEdit (bool)
- // disableRefresh (bool)
- // fillFormulas (bool)
- // firstBackgroundRefresh (bool)
- // growShrinkType (insertClear, insertDelete, overwriteClear)
- // headers (bool)
- // intermediate (bool)
- // name (string)
- // preserveFormatting(bool)
- // refreshOnLoad (bool)
- // removeDataOnSave (bool)
- // rowNumbers (bool)
-}
-
-void WebQueryBuffer::importConnection( const AttributeList& rAttribs )
-{
- if ( !rAttribs.hasAttribute( XML_id ) || !rAttribs.hasAttribute( XML_name ) )
- {
- mnCurConnId = -1;
- return;
- }
-
- sal_uInt32 nId = rAttribs.getUnsigned( XML_id, 0 );
- if ( maConnections.size() < (nId + 1) )
- maConnections.resize(nId + 1);
-
- Connection aConn;
- aConn.maName = rAttribs.getString( XML_name, OUString() );
- aConn.mnType = rAttribs.getInteger( XML_type, 0 );
- maConnections[nId] = aConn;
- mnCurConnId = nId;
-
- // All documented attributes of connection.
- // background (bool)
- // credentials (integrated, none, prompt, stored)
- // deleted (bool)
- // description (string)
- // id (unsigned int)
- // interval (unsigned int)
- // keepAlive (bool)
- // minRefreshableVersion (unsigned byte)
- // name (string)
- // new (bool)
- // odcFile (string)
- // onlyUseConnectionFile (bool)
- // reconnectionMethod (unsigned int)
- // refreshedVersion (unsigned byte)
- // refreshOnLoad (bool)
- // saveData (bool)
- // savePassword (bool)
- // singleSignOnId (string)
- // sourceFile (string)
- // type (unsigned int)
-}
-
-void WebQueryBuffer::importWebPr( const AttributeList& rAttribs )
-{
- if ( 0 > mnCurConnId )
- return;
-
- Connection& rConn = maConnections[mnCurConnId];
- rConn.mpProperties.reset( new WebProperties );
- WebProperties* pWebPr = static_cast< WebProperties* >( rConn.mpProperties.get() );
- pWebPr->maURL = rAttribs.getString( XML_url, OUString() );
-
- // All available attributes:
- // consecutive (bool)
- // editPage (string)
- // firstRow (bool)
- // htmlFormat (all, none, rtf)
- // htmlTables (bool)
- // parsePre (bool)
- // post (string)
- // sourceData (bool)
- // textDates (bool)
- // url (string)
- // xl2000 (bool)
- // xl97 (bool)
- // xml (bool)
-}
-
-void WebQueryBuffer::dump() const
-{
-#if DEBUG_OOX_WEBQUERY_BUFFER
- fprintf(stdout, "----------------------------------------\n");
- {
- using ::std::vector;
- vector< Connection >::const_iterator itr = maConnections.begin(), itrEnd = maConnections.end();
- sal_Int32 nId = 0;
- for (; itr != itrEnd; ++itr, ++nId)
- {
- if ( itr->mnType == Connection::CONNECTION_WEBQUERY )
- {
- WebProperties* pWebPr = static_cast< WebProperties* >( itr->mpProperties.get() );
- fprintf(stdout, "WebQueryBuffer::dump: id = %d url = %s\n",
- (int)nId,
- OUStringToOString(pWebPr->maURL, RTL_TEXTENCODING_UTF8).getStr());
- }
- }
- }
-
- QueryTableHashMap::const_iterator itr = maQueryTableMap.begin(), itrEnd = maQueryTableMap.end();
- for (; itr != itrEnd; ++itr)
- {
- fprintf(stdout, "WebQueryBuffer::dump: name = %s connection ID = %d\n",
- OUStringToOString(itr->first, RTL_TEXTENCODING_UTF8).getStr(),
- (int)(itr->second.mnConnectionId));
- }
-
- fprintf(stdout, "----------------------------------------\n");
- fflush(stdout);
-#endif
-}
-
-// ============================================================================
-
-} // namespace xls
-} // namespace oox
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/xls/workbookfragment.cxx b/oox/source/xls/workbookfragment.cxx
index bb84b49e7cc5..210d53e09026 100644
--- a/oox/source/xls/workbookfragment.cxx
+++ b/oox/source/xls/workbookfragment.cxx
@@ -27,14 +27,14 @@
************************************************************************/
#include "oox/xls/workbookfragment.hxx"
+
#include <com/sun/star/table/CellAddress.hpp>
+#include "oox/core/filterbase.hxx"
+#include "oox/drawingml/themefragmenthandler.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/progressbar.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/ole/olestorage.hxx"
-#include "oox/core/filterbase.hxx"
-#include "oox/drawingml/themefragmenthandler.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/chartsheetfragment.hxx"
#include "oox/xls/connectionsfragment.hxx"
@@ -51,25 +51,21 @@
#include "oox/xls/worksheetbuffer.hxx"
#include "oox/xls/worksheetfragment.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::io::XInputStream;
-using ::com::sun::star::table::CellAddress;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::FragmentHandlerRef;
-using ::oox::core::RecordInfo;
-using ::oox::core::Relation;
-using ::oox::drawingml::ThemeFragmentHandler;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+using namespace ::oox::core;
+
+using ::oox::drawingml::ThemeFragmentHandler;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
const double PROGRESS_LENGTH_GLOBALS = 0.1; /// 10% of progress bar for globals import.
@@ -78,15 +74,12 @@ const double PROGRESS_LENGTH_GLOBALS = 0.1; /// 10% of progress bar
// ============================================================================
-OoxWorkbookFragment::OoxWorkbookFragment(
- const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
- OoxWorkbookFragmentBase( rHelper, rFragmentPath )
+WorkbookFragment::WorkbookFragment( const WorkbookHelper& rHelper, const OUString& rFragmentPath ) :
+ WorkbookFragmentBase( rHelper, rFragmentPath )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxWorkbookFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef WorkbookFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -129,108 +122,102 @@ ContextHandlerRef OoxWorkbookFragment::onCreateContext( sal_Int32 nElement, cons
return 0;
}
-void OoxWorkbookFragment::onEndElement( const OUString& rChars )
+void WorkbookFragment::onCharacters( const OUString& rChars )
{
- switch( getCurrentElement() )
- {
- case XLS_TOKEN( definedName ):
- if( mxCurrName.get() ) mxCurrName->setFormula( rChars );
- break;
- }
+ if( isCurrentElement( XLS_TOKEN( definedName ) ) && mxCurrName.get() )
+ mxCurrName->setFormula( rChars );
}
-ContextHandlerRef OoxWorkbookFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef WorkbookFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_WORKBOOK ) return this;
+ if( nRecId == BIFF12_ID_WORKBOOK ) return this;
break;
- case OOBIN_ID_WORKBOOK:
+ case BIFF12_ID_WORKBOOK:
switch( nRecId )
{
- case OOBIN_ID_SHEETS:
- case OOBIN_ID_BOOKVIEWS:
- case OOBIN_ID_EXTERNALREFS:
- case OOBIN_ID_PIVOTCACHES: return this;
-
- case OOBIN_ID_FILESHARING: getWorkbookSettings().importFileSharing( rStrm ); break;
- case OOBIN_ID_WORKBOOKPR: getWorkbookSettings().importWorkbookPr( rStrm ); break;
- case OOBIN_ID_CALCPR: getWorkbookSettings().importCalcPr( rStrm ); break;
- case OOBIN_ID_OLESIZE: getViewSettings().importOleSize( rStrm ); break;
- case OOBIN_ID_DEFINEDNAME: getDefinedNames().importDefinedName( rStrm ); break;
+ case BIFF12_ID_SHEETS:
+ case BIFF12_ID_BOOKVIEWS:
+ case BIFF12_ID_EXTERNALREFS:
+ case BIFF12_ID_PIVOTCACHES: return this;
+
+ case BIFF12_ID_FILESHARING: getWorkbookSettings().importFileSharing( rStrm ); break;
+ case BIFF12_ID_WORKBOOKPR: getWorkbookSettings().importWorkbookPr( rStrm ); break;
+ case BIFF12_ID_CALCPR: getWorkbookSettings().importCalcPr( rStrm ); break;
+ case BIFF12_ID_OLESIZE: getViewSettings().importOleSize( rStrm ); break;
+ case BIFF12_ID_DEFINEDNAME: getDefinedNames().importDefinedName( rStrm ); break;
}
break;
- case OOBIN_ID_SHEETS:
- if( nRecId == OOBIN_ID_SHEET ) getWorksheets().importSheet( rStrm );
+ case BIFF12_ID_SHEETS:
+ if( nRecId == BIFF12_ID_SHEET ) getWorksheets().importSheet( rStrm );
break;
- case OOBIN_ID_BOOKVIEWS:
- if( nRecId == OOBIN_ID_WORKBOOKVIEW ) getViewSettings().importWorkbookView( rStrm );
+ case BIFF12_ID_BOOKVIEWS:
+ if( nRecId == BIFF12_ID_WORKBOOKVIEW ) getViewSettings().importWorkbookView( rStrm );
break;
- case OOBIN_ID_EXTERNALREFS:
+ case BIFF12_ID_EXTERNALREFS:
switch( nRecId )
{
- case OOBIN_ID_EXTERNALREF: importExternalRef( rStrm ); break;
- case OOBIN_ID_EXTERNALSELF: getExternalLinks().importExternalSelf( rStrm ); break;
- case OOBIN_ID_EXTERNALSAME: getExternalLinks().importExternalSame( rStrm ); break;
- case OOBIN_ID_EXTERNALADDIN: getExternalLinks().importExternalAddin( rStrm ); break;
- case OOBIN_ID_EXTERNALSHEETS: getExternalLinks().importExternalSheets( rStrm ); break;
+ case BIFF12_ID_EXTERNALREF: importExternalRef( rStrm ); break;
+ case BIFF12_ID_EXTERNALSELF: getExternalLinks().importExternalSelf( rStrm ); break;
+ case BIFF12_ID_EXTERNALSAME: getExternalLinks().importExternalSame( rStrm ); break;
+ case BIFF12_ID_EXTERNALADDIN: getExternalLinks().importExternalAddin( rStrm ); break;
+ case BIFF12_ID_EXTERNALSHEETS: getExternalLinks().importExternalSheets( rStrm ); break;
}
break;
- case OOBIN_ID_PIVOTCACHES:
- if( nRecId == OOBIN_ID_PIVOTCACHE ) importPivotCache( rStrm );
+ case BIFF12_ID_PIVOTCACHES:
+ if( nRecId == BIFF12_ID_PIVOTCACHE ) importPivotCache( rStrm );
}
return 0;
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxWorkbookFragment::getRecordInfos() const
+const RecordInfo* WorkbookFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_BOOKVIEWS, OOBIN_ID_BOOKVIEWS + 1 },
- { OOBIN_ID_EXTERNALREFS, OOBIN_ID_EXTERNALREFS + 1 },
- { OOBIN_ID_FUNCTIONGROUPS, OOBIN_ID_FUNCTIONGROUPS + 2 },
- { OOBIN_ID_PIVOTCACHE, OOBIN_ID_PIVOTCACHE + 1 },
- { OOBIN_ID_PIVOTCACHES, OOBIN_ID_PIVOTCACHES + 1 },
- { OOBIN_ID_SHEETS, OOBIN_ID_SHEETS + 1 },
- { OOBIN_ID_WORKBOOK, OOBIN_ID_WORKBOOK + 1 },
- { -1, -1 }
+ { BIFF12_ID_BOOKVIEWS, BIFF12_ID_BOOKVIEWS + 1 },
+ { BIFF12_ID_EXTERNALREFS, BIFF12_ID_EXTERNALREFS + 1 },
+ { BIFF12_ID_FUNCTIONGROUPS, BIFF12_ID_FUNCTIONGROUPS + 2 },
+ { BIFF12_ID_PIVOTCACHE, BIFF12_ID_PIVOTCACHE + 1 },
+ { BIFF12_ID_PIVOTCACHES, BIFF12_ID_PIVOTCACHES + 1 },
+ { BIFF12_ID_SHEETS, BIFF12_ID_SHEETS + 1 },
+ { BIFF12_ID_WORKBOOK, BIFF12_ID_WORKBOOK + 1 },
+ { -1, -1 }
};
return spRecInfos;
}
-void OoxWorkbookFragment::finalizeImport()
+void WorkbookFragment::finalizeImport()
{
ISegmentProgressBarRef xGlobalSegment = getProgressBar().createSegment( PROGRESS_LENGTH_GLOBALS );
// read the theme substream
- OUString aThemeFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "theme" ) );
+ OUString aThemeFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "theme" ) );
if( aThemeFragmentPath.getLength() > 0 )
importOoxFragment( new ThemeFragmentHandler( getFilter(), aThemeFragmentPath, getTheme() ) );
xGlobalSegment->setPosition( 0.25 );
// read the styles substream (requires finalized theme buffer)
- OUString aStylesFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "styles" ) );
+ OUString aStylesFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "styles" ) );
if( aStylesFragmentPath.getLength() > 0 )
- importOoxFragment( new OoxStylesFragment( *this, aStylesFragmentPath ) );
+ importOoxFragment( new StylesFragment( *this, aStylesFragmentPath ) );
xGlobalSegment->setPosition( 0.5 );
// read the shared string table substream (requires finalized styles buffer)
- OUString aSstFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "sharedStrings" ) );
+ OUString aSstFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "sharedStrings" ) );
if( aSstFragmentPath.getLength() > 0 )
- importOoxFragment( new OoxSharedStringsFragment( *this, aSstFragmentPath ) );
+ importOoxFragment( new SharedStringsFragment( *this, aSstFragmentPath ) );
xGlobalSegment->setPosition( 0.75 );
// read the connections substream
- OUString aConnFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "connections" ) );
+ OUString aConnFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "connections" ) );
if( aConnFragmentPath.getLength() > 0 )
- importOoxFragment( new OoxConnectionsFragment( *this, aConnFragmentPath ) );
+ importOoxFragment( new ConnectionsFragment( *this, aConnFragmentPath ) );
xGlobalSegment->setPosition( 1.0 );
/* Create fragments for all sheets, before importing them. Needed to do
@@ -249,35 +236,35 @@ void OoxWorkbookFragment::finalizeImport()
{
// get fragment path of the sheet
OUString aFragmentPath = getFragmentPathFromRelation( *pRelation );
- OSL_ENSURE( aFragmentPath.getLength() > 0, "OoxWorkbookFragment::finalizeImport - cannot access sheet fragment" );
+ OSL_ENSURE( aFragmentPath.getLength() > 0, "WorkbookFragment::finalizeImport - cannot access sheet fragment" );
if( aFragmentPath.getLength() > 0 )
{
- ::rtl::Reference< OoxWorksheetFragmentBase > xFragment;
+ ::rtl::Reference< WorksheetFragmentBase > xFragment;
double fSegmentLength = getProgressBar().getFreeLength() / (nWorksheetCount - nWorksheet);
ISegmentProgressBarRef xSheetSegment = getProgressBar().createSegment( fSegmentLength );
// create the fragment according to the sheet type
- if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "worksheet" ) )
+ if( pRelation->maType == CREATE_OFFICEDOC_RELATION_TYPE( "worksheet" ) )
{
- xFragment.set( new OoxWorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_WORKSHEET, nCalcSheet ) );
+ xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_WORKSHEET, nCalcSheet ) );
}
- else if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "chartsheet" ) )
+ else if( pRelation->maType == CREATE_OFFICEDOC_RELATION_TYPE( "chartsheet" ) )
{
- xFragment.set( new OoxChartsheetFragment( *this, aFragmentPath, xSheetSegment, nCalcSheet ) );
+ xFragment.set( new ChartsheetFragment( *this, aFragmentPath, xSheetSegment, nCalcSheet ) );
}
- else if( (pRelation->maType == CREATE_MSOFFICE_RELATIONSTYPE( "xlMacrosheet" )) ||
- (pRelation->maType == CREATE_MSOFFICE_RELATIONSTYPE( "xlIntlMacrosheet" )) )
+ else if( (pRelation->maType == CREATE_MSOFFICE_RELATION_TYPE( "xlMacrosheet" )) ||
+ (pRelation->maType == CREATE_MSOFFICE_RELATION_TYPE( "xlIntlMacrosheet" )) )
{
- xFragment.set( new OoxWorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_MACROSHEET, nCalcSheet ) );
+ xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_MACROSHEET, nCalcSheet ) );
}
- else if( pRelation->maType == CREATE_OFFICEDOC_RELATIONSTYPE( "dialogsheet" ) )
+ else if( pRelation->maType == CREATE_OFFICEDOC_RELATION_TYPE( "dialogsheet" ) )
{
- xFragment.set( new OoxWorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_DIALOGSHEET, nCalcSheet ) );
+ xFragment.set( new WorksheetFragment( *this, aFragmentPath, xSheetSegment, SHEETTYPE_DIALOGSHEET, nCalcSheet ) );
}
// insert the fragment into the map
- OSL_ENSURE( xFragment.is(), "OoxWorkbookFragment::finalizeImport - unknown sheet type" );
- OSL_ENSURE( !xFragment.is() || xFragment->isValidSheet(), "OoxWorkbookFragment::finalizeImport - missing sheet in document" );
+ OSL_ENSURE( xFragment.is(), "WorkbookFragment::finalizeImport - unknown sheet type" );
+ OSL_ENSURE( !xFragment.is() || xFragment->isValidSheet(), "WorkbookFragment::finalizeImport - missing sheet in document" );
if( xFragment.is() && xFragment->isValidSheet() )
aSheetFragments.push_back( xFragment.get() );
}
@@ -298,7 +285,7 @@ void OoxWorkbookFragment::finalizeImport()
}
// open the VBA project storage
- OUString aVbaFragmentPath = getFragmentPathFromFirstType( CREATE_MSOFFICE_RELATIONSTYPE( "vbaProject" ) );
+ OUString aVbaFragmentPath = getFragmentPathFromFirstType( CREATE_MSOFFICE_RELATION_TYPE( "vbaProject" ) );
if( aVbaFragmentPath.getLength() > 0 )
{
Reference< XInputStream > xInStrm = getBaseFilter().openInputStream( aVbaFragmentPath );
@@ -312,45 +299,45 @@ void OoxWorkbookFragment::finalizeImport()
// private --------------------------------------------------------------------
-void OoxWorkbookFragment::importExternalReference( const AttributeList& rAttribs )
+void WorkbookFragment::importExternalReference( const AttributeList& rAttribs )
{
if( ExternalLink* pExtLink = getExternalLinks().importExternalReference( rAttribs ).get() )
importExternalLinkFragment( *pExtLink );
}
-void OoxWorkbookFragment::importDefinedName( const AttributeList& rAttribs )
+void WorkbookFragment::importDefinedName( const AttributeList& rAttribs )
{
mxCurrName = getDefinedNames().importDefinedName( rAttribs );
}
-void OoxWorkbookFragment::importPivotCache( const AttributeList& rAttribs )
+void WorkbookFragment::importPivotCache( const AttributeList& rAttribs )
{
sal_Int32 nCacheId = rAttribs.getInteger( XML_cacheId, -1 );
OUString aRelId = rAttribs.getString( R_TOKEN( id ), OUString() );
importPivotCacheDefFragment( aRelId, nCacheId );
}
-void OoxWorkbookFragment::importExternalRef( RecordInputStream& rStrm )
+void WorkbookFragment::importExternalRef( SequenceInputStream& rStrm )
{
if( ExternalLink* pExtLink = getExternalLinks().importExternalRef( rStrm ).get() )
importExternalLinkFragment( *pExtLink );
}
-void OoxWorkbookFragment::importPivotCache( RecordInputStream& rStrm )
+void WorkbookFragment::importPivotCache( SequenceInputStream& rStrm )
{
sal_Int32 nCacheId = rStrm.readInt32();
- OUString aRelId = rStrm.readString();
+ OUString aRelId = BiffHelper::readString( rStrm );
importPivotCacheDefFragment( aRelId, nCacheId );
}
-void OoxWorkbookFragment::importExternalLinkFragment( ExternalLink& rExtLink )
+void WorkbookFragment::importExternalLinkFragment( ExternalLink& rExtLink )
{
OUString aFragmentPath = getFragmentPathFromRelId( rExtLink.getRelId() );
if( aFragmentPath.getLength() > 0 )
- importOoxFragment( new OoxExternalLinkFragment( *this, aFragmentPath, rExtLink ) );
+ importOoxFragment( new ExternalLinkFragment( *this, aFragmentPath, rExtLink ) );
}
-void OoxWorkbookFragment::importPivotCacheDefFragment( const OUString& rRelId, sal_Int32 nCacheId )
+void WorkbookFragment::importPivotCacheDefFragment( const OUString& rRelId, sal_Int32 nCacheId )
{
// pivot caches will be imported on demand, here we just store the fragment path in the buffer
getPivotCaches().registerPivotCacheFragment( nCacheId, getFragmentPathFromRelId( rRelId ) );
@@ -432,14 +419,15 @@ bool BiffWorkbookFragment::importWorkspaceFragment()
// import the workspace globals
ISegmentProgressBarRef xGlobalsProgress = getProgressBar().createSegment( PROGRESS_LENGTH_GLOBALS );
bool bLoop = true;
- while( bRet && bLoop && mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
+ BiffInputStream& rStrm = getInputStream();
+ while( bRet && bLoop && rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
{
- switch( mrStrm.getRecId() )
+ switch( rStrm.getRecId() )
{
- case BIFF_ID_SHEET: rWorksheets.importSheet( mrStrm ); break;
- case BIFF_ID_CODEPAGE: setCodePage( mrStrm.readuInt16() ); break;
- case BIFF_ID_FILEPASS: bRet = getCodecHelper().importFilePass( mrStrm ); break;
- case BIFF_ID_SHEETHEADER: mrStrm.rewindRecord(); bLoop = false; break;
+ case BIFF_ID_SHEET: rWorksheets.importSheet( rStrm ); break;
+ case BIFF_ID_CODEPAGE: setCodePage( rStrm.readuInt16() ); break;
+ case BIFF_ID_FILEPASS: bRet = getCodecHelper().importFilePass( rStrm ); break;
+ case BIFF_ID_SHEETHEADER: rStrm.rewindRecord(); bLoop = false; break;
}
}
xGlobalsProgress->setPosition( 1.0 );
@@ -449,15 +437,15 @@ bool BiffWorkbookFragment::importWorkspaceFragment()
for( sal_Int32 nWorksheet = 0, nWorksheetCount = rWorksheets.getWorksheetCount(); bNextSheet && (nWorksheet < nWorksheetCount); ++nWorksheet )
{
// try to start a new sheet fragment (with leading SHEETHEADER record)
- bNextSheet = mrStrm.startNextRecord() && (mrStrm.getRecId() == BIFF_ID_SHEETHEADER);
+ bNextSheet = rStrm.startNextRecord() && (rStrm.getRecId() == BIFF_ID_SHEETHEADER);
if( bNextSheet )
{
double fSegmentLength = getProgressBar().getFreeLength() / (nWorksheetCount - nWorksheet);
ISegmentProgressBarRef xSheetProgress = getProgressBar().createSegment( fSegmentLength );
/* Read current sheet name (sheet substreams may not be in the
same order as SHEET records are). */
- mrStrm.skip( 4 );
- OUString aSheetName = mrStrm.readByteStringUC( false, getTextEncoding() );
+ rStrm.skip( 4 );
+ OUString aSheetName = rStrm.readByteStringUC( false, getTextEncoding() );
sal_Int16 nCurrSheet = rWorksheets.getCalcSheetIndex( aSheetName );
// load the sheet fragment records
BiffFragmentType eSheetFragment = startFragment( getBiff() );
@@ -486,27 +474,28 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
bool bRet = true;
bool bLoop = true;
- while( bRet && bLoop && mrStrm.startNextRecord() )
+ BiffInputStream& rStrm = getInputStream();
+ while( bRet && bLoop && rStrm.startNextRecord() )
{
- sal_uInt16 nRecId = mrStrm.getRecId();
+ sal_uInt16 nRecId = rStrm.getRecId();
bool bExtLinkRec = false;
/* #i56376# BIFF5-BIFF8: If an EOF record for globals is missing,
simulate it. The issue is about a document where the sheet fragment
starts directly after the EXTSST record, without terminating the
globals fragment with an EOF record. */
- if( isBofRecord() || (nRecId == BIFF_ID_EOF) )
+ if( BiffHelper::isBofRecord( rStrm ) || (nRecId == BIFF_ID_EOF) )
{
bLoop = false;
}
else switch( nRecId )
{
// records in all BIFF versions
- case BIFF_ID_CODEPAGE: setCodePage( mrStrm.readuInt16() ); break;
- case BIFF_ID_DATEMODE: rWorkbookSett.importDateMode( mrStrm ); break;
- case BIFF_ID_FILEPASS: bRet = getCodecHelper().importFilePass( mrStrm ); break;
- case BIFF_ID_PRECISION: rWorkbookSett.importPrecision( mrStrm ); break;
- case BIFF_ID_WINDOW1: rViewSett.importWindow1( mrStrm ); break;
+ case BIFF_ID_CODEPAGE: setCodePage( rStrm.readuInt16() ); break;
+ case BIFF_ID_DATEMODE: rWorkbookSett.importDateMode( rStrm ); break;
+ case BIFF_ID_FILEPASS: bRet = getCodecHelper().importFilePass( rStrm ); break;
+ case BIFF_ID_PRECISION: rWorkbookSett.importPrecision( rStrm ); break;
+ case BIFF_ID_WINDOW1: rViewSett.importWindow1( rStrm ); break;
// BIFF specific records
default: switch( getBiff() )
@@ -516,10 +505,10 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
case BIFF2_ID_DEFINEDNAME: bExtLinkRec = true; break;
case BIFF2_ID_EXTERNALNAME: bExtLinkRec = true; break;
case BIFF_ID_EXTERNSHEET: bExtLinkRec = true; break;
- case BIFF2_ID_FONT: rStyles.importFont( mrStrm ); break;
- case BIFF_ID_FONTCOLOR: rStyles.importFontColor( mrStrm ); break;
- case BIFF2_ID_FORMAT: rStyles.importFormat( mrStrm ); break;
- case BIFF2_ID_XF: rStyles.importXf( mrStrm ); break;
+ case BIFF2_ID_FONT: rStyles.importFont( rStrm ); break;
+ case BIFF_ID_FONTCOLOR: rStyles.importFontColor( rStrm ); break;
+ case BIFF2_ID_FORMAT: rStyles.importFormat( rStrm ); break;
+ case BIFF2_ID_XF: rStyles.importXf( rStrm ); break;
}
break;
@@ -529,14 +518,14 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
case BIFF3_ID_DEFINEDNAME: bExtLinkRec = true; break;
case BIFF3_ID_EXTERNALNAME: bExtLinkRec = true; break;
case BIFF_ID_EXTERNSHEET: bExtLinkRec = true; break;
- case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( mrStrm ); break;
- case BIFF3_ID_FONT: rStyles.importFont( mrStrm ); break;
- case BIFF2_ID_FORMAT: rStyles.importFormat( mrStrm ); break;
- case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( mrStrm ); break;
- case BIFF_ID_PALETTE: rStyles.importPalette( mrStrm ); break;
- case BIFF_ID_STYLE: rStyles.importStyle( mrStrm ); break;
+ case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( rStrm ); break;
+ case BIFF3_ID_FONT: rStyles.importFont( rStrm ); break;
+ case BIFF2_ID_FORMAT: rStyles.importFormat( rStrm ); break;
+ case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( rStrm ); break;
+ case BIFF_ID_PALETTE: rStyles.importPalette( rStrm ); break;
+ case BIFF_ID_STYLE: rStyles.importStyle( rStrm ); break;
case BIFF_ID_XCT: bExtLinkRec = true; break;
- case BIFF3_ID_XF: rStyles.importXf( mrStrm ); break;
+ case BIFF3_ID_XF: rStyles.importXf( rStrm ); break;
}
break;
@@ -546,62 +535,62 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
case BIFF3_ID_DEFINEDNAME: bExtLinkRec = true; break;
case BIFF3_ID_EXTERNALNAME: bExtLinkRec = true; break;
case BIFF_ID_EXTERNSHEET: bExtLinkRec = true; break;
- case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( mrStrm ); break;
- case BIFF3_ID_FONT: rStyles.importFont( mrStrm ); break;
- case BIFF4_ID_FORMAT: rStyles.importFormat( mrStrm ); break;
- case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( mrStrm ); break;
- case BIFF_ID_PALETTE: rStyles.importPalette( mrStrm ); break;
- case BIFF_ID_STYLE: rStyles.importStyle( mrStrm ); break;
+ case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( rStrm ); break;
+ case BIFF3_ID_FONT: rStyles.importFont( rStrm ); break;
+ case BIFF4_ID_FORMAT: rStyles.importFormat( rStrm ); break;
+ case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( rStrm ); break;
+ case BIFF_ID_PALETTE: rStyles.importPalette( rStrm ); break;
+ case BIFF_ID_STYLE: rStyles.importStyle( rStrm ); break;
case BIFF_ID_XCT: bExtLinkRec = true; break;
- case BIFF4_ID_XF: rStyles.importXf( mrStrm ); break;
+ case BIFF4_ID_XF: rStyles.importXf( rStrm ); break;
}
break;
case BIFF5: switch( nRecId )
{
- case BIFF_ID_BOOKBOOL: rWorkbookSett.importBookBool( mrStrm ); break;
+ case BIFF_ID_BOOKBOOL: rWorkbookSett.importBookBool( rStrm ); break;
case BIFF_ID_CRN: bExtLinkRec = true; break;
case BIFF5_ID_DEFINEDNAME: bExtLinkRec = true; break;
case BIFF5_ID_EXTERNALNAME: bExtLinkRec = true; break;
case BIFF_ID_EXTERNSHEET: bExtLinkRec = true; break;
- case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( mrStrm ); break;
- case BIFF5_ID_FONT: rStyles.importFont( mrStrm ); break;
- case BIFF4_ID_FORMAT: rStyles.importFormat( mrStrm ); break;
- case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( mrStrm ); break;
- case BIFF_ID_OLESIZE: rViewSett.importOleSize( mrStrm ); break;
- case BIFF_ID_PALETTE: rStyles.importPalette( mrStrm ); break;
- case BIFF_ID_PIVOTCACHE: rPivotCaches.importPivotCacheRef( mrStrm ); break;
- case BIFF_ID_SHEET: rWorksheets.importSheet( mrStrm ); break;
- case BIFF_ID_STYLE: rStyles.importStyle( mrStrm ); break;
+ case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( rStrm ); break;
+ case BIFF5_ID_FONT: rStyles.importFont( rStrm ); break;
+ case BIFF4_ID_FORMAT: rStyles.importFormat( rStrm ); break;
+ case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( rStrm ); break;
+ case BIFF_ID_OLESIZE: rViewSett.importOleSize( rStrm ); break;
+ case BIFF_ID_PALETTE: rStyles.importPalette( rStrm ); break;
+ case BIFF_ID_PIVOTCACHE: rPivotCaches.importPivotCacheRef( rStrm ); break;
+ case BIFF_ID_SHEET: rWorksheets.importSheet( rStrm ); break;
+ case BIFF_ID_STYLE: rStyles.importStyle( rStrm ); break;
case BIFF_ID_XCT: bExtLinkRec = true; break;
- case BIFF5_ID_XF: rStyles.importXf( mrStrm ); break;
+ case BIFF5_ID_XF: rStyles.importXf( rStrm ); break;
}
break;
case BIFF8: switch( nRecId )
{
- case BIFF_ID_BOOKBOOL: rWorkbookSett.importBookBool( mrStrm ); break;
- case BIFF_ID_CODENAME: rWorkbookSett.importCodeName( mrStrm ); break;
+ case BIFF_ID_BOOKBOOL: rWorkbookSett.importBookBool( rStrm ); break;
+ case BIFF_ID_CODENAME: rWorkbookSett.importCodeName( rStrm ); break;
case BIFF_ID_CRN: bExtLinkRec = true; break;
case BIFF5_ID_DEFINEDNAME: bExtLinkRec = true; break;
case BIFF_ID_EXTERNALBOOK: bExtLinkRec = true; break;
case BIFF5_ID_EXTERNALNAME: bExtLinkRec = true; break;
case BIFF_ID_EXTERNSHEET: bExtLinkRec = true; break;
- case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( mrStrm ); break;
- case BIFF5_ID_FONT: rStyles.importFont( mrStrm ); break;
- case BIFF4_ID_FORMAT: rStyles.importFormat( mrStrm ); break;
- case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( mrStrm ); break;
- case BIFF_ID_OLESIZE: rViewSett.importOleSize( mrStrm ); break;
- case BIFF_ID_PALETTE: rStyles.importPalette( mrStrm ); break;
- case BIFF_ID_PIVOTCACHE: rPivotCaches.importPivotCacheRef( mrStrm ); break;
- case BIFF_ID_SHEET: rWorksheets.importSheet( mrStrm ); break;
- case BIFF_ID_SST: rSharedStrings.importSst( mrStrm ); break;
- case BIFF_ID_STYLE: rStyles.importStyle( mrStrm ); break;
- case BIFF_ID_USESELFS: rWorkbookSett.importUsesElfs( mrStrm ); break;
+ case BIFF_ID_FILESHARING: rWorkbookSett.importFileSharing( rStrm ); break;
+ case BIFF5_ID_FONT: rStyles.importFont( rStrm ); break;
+ case BIFF4_ID_FORMAT: rStyles.importFormat( rStrm ); break;
+ case BIFF_ID_HIDEOBJ: rWorkbookSett.importHideObj( rStrm ); break;
+ case BIFF_ID_OLESIZE: rViewSett.importOleSize( rStrm ); break;
+ case BIFF_ID_PALETTE: rStyles.importPalette( rStrm ); break;
+ case BIFF_ID_PIVOTCACHE: rPivotCaches.importPivotCacheRef( rStrm ); break;
+ case BIFF_ID_SHEET: rWorksheets.importSheet( rStrm ); break;
+ case BIFF_ID_SST: rSharedStrings.importSst( rStrm ); break;
+ case BIFF_ID_STYLE: rStyles.importStyle( rStrm ); break;
+ case BIFF_ID_USESELFS: rWorkbookSett.importUsesElfs( rStrm ); break;
case BIFF_ID_VBAPROJECT: bHasVbaProject = true; break;
case BIFF_ID_VBAPROJECTEMPTY: bEmptyVbaProject = true; break;
case BIFF_ID_XCT: bExtLinkRec = true; break;
- case BIFF5_ID_XF: rStyles.importXf( mrStrm ); break;
+ case BIFF5_ID_XF: rStyles.importXf( rStrm ); break;
}
break;
@@ -610,7 +599,7 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
}
if( bExtLinkRec )
- aExtLinkRecs.push_back( mrStrm.getRecHandle() );
+ aExtLinkRecs.push_back( rStrm.getRecHandle() );
}
// finalize global buffers
@@ -627,16 +616,16 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
if( bRet && !aExtLinkRecs.empty() )
{
// remember current stream position (the EOF record)
- sal_Int64 nEofHandle = mrStrm.getRecHandle();
- // this fragment class implements import of external link records
- BiffExternalLinkFragment aLinkFragment( *this, true );
+ sal_Int64 nEofHandle = rStrm.getRecHandle();
+ // context handler implementing import of external link records
+ BiffExternalSheetDataContext aSheetContext( *this, true );
// import all records by using their cached record handle
- for( RecordHandleVec::const_iterator aIt = aExtLinkRecs.begin(), aEnd = aExtLinkRecs.end(); (aIt != aEnd) && mrStrm.startRecordByHandle( *aIt ); ++aIt )
- aLinkFragment.importRecord();
+ for( RecordHandleVec::const_iterator aIt = aExtLinkRecs.begin(), aEnd = aExtLinkRecs.end(); (aIt != aEnd) && rStrm.startRecordByHandle( *aIt ); ++aIt )
+ aSheetContext.importRecord( rStrm );
// finalize global buffers
- aLinkFragment.finalizeImport();
+ getDefinedNames().finalizeImport();
// seek back to the EOF record of the workbook globals fragment
- bRet = mrStrm.startRecordByHandle( nEofHandle );
+ bRet = rStrm.startRecordByHandle( nEofHandle );
}
// open the VBA project storage
@@ -644,8 +633,8 @@ bool BiffWorkbookFragment::importGlobalsFragment( ISegmentProgressBar& rProgress
setVbaProjectStorage( getBaseFilter().openSubStorage( CREATE_OUSTRING( "_VBA_PROJECT_CUR" ), false ) );
// #i56376# missing EOF - rewind before worksheet BOF record (see above)
- if( bRet && isBofRecord() )
- mrStrm.rewindRecord();
+ if( bRet && BiffHelper::isBofRecord( rStrm ) )
+ rStrm.rewindRecord();
rProgressBar.setPosition( 1.0 );
return bRet;
@@ -674,6 +663,7 @@ bool BiffWorkbookFragment::importSheetFragment( ISegmentProgressBar& rProgressBa
createBuffersPerSheet( nCalcSheet );
// preprocess some records
+ BiffInputStream& rStrm = getInputStream();
switch( getBiff() )
{
// load the workbook globals fragment records in BIFF2-BIFF4
@@ -682,12 +672,12 @@ bool BiffWorkbookFragment::importSheetFragment( ISegmentProgressBar& rProgressBa
case BIFF4:
{
// remember current record to seek back below
- sal_Int64 nRecHandle = mrStrm.getRecHandle();
+ sal_Int64 nRecHandle = rStrm.getRecHandle();
// import the global records
ISegmentProgressBarRef xGlobalsProgress = rProgressBar.createSegment( PROGRESS_LENGTH_GLOBALS );
importGlobalsFragment( *xGlobalsProgress );
// rewind stream to fragment BOF record
- mrStrm.startRecordByHandle( nRecHandle );
+ rStrm.startRecordByHandle( nRecHandle );
}
break;
@@ -695,11 +685,11 @@ bool BiffWorkbookFragment::importSheetFragment( ISegmentProgressBar& rProgressBa
case BIFF5:
{
// remember current record to seek back below
- sal_Int64 nRecHandle = mrStrm.getRecHandle();
+ sal_Int64 nRecHandle = rStrm.getRecHandle();
// fragment implementing import of external link records
- BiffExternalLinkFragment( *this, false ).importFragment();
+ BiffExternalLinkFragment( *this ).importFragment();
// rewind stream to fragment BOF record
- mrStrm.startRecordByHandle( nRecHandle );
+ rStrm.startRecordByHandle( nRecHandle );
}
break;
@@ -737,4 +727,4 @@ bool BiffWorkbookFragment::importSheetFragment( ISegmentProgressBar& rProgressBa
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/workbookhelper.cxx b/oox/source/xls/workbookhelper.cxx
index 6033601fb2d2..ed13bddadfa7 100644
--- a/oox/source/xls/workbookhelper.cxx
+++ b/oox/source/xls/workbookhelper.cxx
@@ -27,28 +27,28 @@
************************************************************************/
#include "oox/xls/workbookhelper.hxx"
-#include <osl/thread.h>
+
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/document/XActionLockable.hpp>
-#include <com/sun/star/table/CellAddress.hpp>
-#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include <com/sun/star/sheet/XSpreadsheet.hpp>
+#include <com/sun/star/sheet/XDatabaseRange.hpp>
+#include <com/sun/star/sheet/XDatabaseRanges.hpp>
#include <com/sun/star/sheet/XNamedRange.hpp>
#include <com/sun/star/sheet/XNamedRanges.hpp>
-#include <com/sun/star/sheet/XDatabaseRanges.hpp>
-#include <com/sun/star/sheet/XExternalDocLinks.hpp>
+#include <com/sun/star/sheet/XSpreadsheet.hpp>
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-#include "properties.hxx"
+#include <com/sun/star/table/CellAddress.hpp>
+#include <osl/thread.h>
+#include "oox/drawingml/theme.hxx"
#include "oox/helper/progressbar.hxx"
#include "oox/helper/propertyset.hxx"
#include "oox/ole/vbaproject.hxx"
-#include "oox/drawingml/theme.hxx"
#include "oox/xls/addressconverter.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/biffcodec.hxx"
+#include "oox/xls/connectionsbuffer.hxx"
#include "oox/xls/defnamesbuffer.hxx"
#include "oox/xls/excelchartconverter.hxx"
#include "oox/xls/excelfilter.hxx"
@@ -64,44 +64,29 @@
#include "oox/xls/themebuffer.hxx"
#include "oox/xls/unitconverter.hxx"
#include "oox/xls/viewsettings.hxx"
-#include "oox/xls/webquerybuffer.hxx"
#include "oox/xls/workbooksettings.hxx"
#include "oox/xls/worksheetbuffer.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNameContainer;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::awt::XDevice;
-using ::com::sun::star::document::XActionLockable;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::XCell;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::sheet::XSpreadsheetDocument;
-using ::com::sun::star::sheet::XSpreadsheet;
-using ::com::sun::star::sheet::XNamedRange;
-using ::com::sun::star::sheet::XNamedRanges;
-using ::com::sun::star::sheet::XDatabaseRanges;
-using ::com::sun::star::sheet::XExternalDocLinks;
-using ::com::sun::star::style::XStyle;
-using ::com::sun::star::style::XStyleFamiliesSupplier;
+namespace oox {
+namespace xls {
+
+// ============================================================================
+
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+
using ::oox::core::BinaryFilterBase;
using ::oox::core::FilterBase;
using ::oox::core::FragmentHandler;
using ::oox::core::XmlFilterBase;
using ::oox::drawingml::Theme;
-
-namespace oox {
-namespace xls {
+using ::rtl::OUString;
// ============================================================================
@@ -147,22 +132,14 @@ public:
/** Returns a reference to the source/target spreadsheet document model. */
inline Reference< XSpreadsheetDocument > getDocument() const { return mxDoc; }
- /** Returns the reference device of the document. */
- Reference< XDevice > getReferenceDevice() const;
- /** Returns the container for defined names from the Calc document. */
- Reference< XNamedRanges > getNamedRanges() const;
- /** Returns the container for database ranges from the Calc document. */
- Reference< XDatabaseRanges > getDatabaseRanges() const;
- /** Returns the container for external documents from the Calc document. */
- Reference< XExternalDocLinks > getExternalDocLinks() const;
- /** Returns the container for DDE links from the Calc document. */
- Reference< XNameAccess > getDdeLinks() const;
/** Returns the cell or page styles container from the Calc document. */
Reference< XNameContainer > getStyleFamily( bool bPageStyles ) const;
/** Returns the specified cell or page style from the Calc document. */
Reference< XStyle > getStyleObject( const OUString& rStyleName, bool bPageStyle ) const;
/** Creates and returns a defined name on-the-fly in the Calc document. */
Reference< XNamedRange > createNamedRangeObject( OUString& orName, sal_Int32 nNameFlags ) const;
+ /** Creates and returns a database range on-the-fly in the Calc document. */
+ Reference< XDatabaseRange > createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const;
/** Creates and returns a com.sun.star.style.Style object for cells or pages. */
Reference< XStyle > createStyleObject( OUString& orStyleName, bool bPageStyle ) const;
@@ -188,8 +165,8 @@ public:
inline TableBuffer& getTables() const { return *mxTables; }
/** Returns the scenarios collection. */
inline ScenarioBuffer& getScenarios() const { return *mxScenarios; }
- /** Returns the web queries. */
- inline WebQueryBuffer& getWebQueries() const { return *mxWebQueries; }
+ /** Returns the collection of external data connections. */
+ inline ConnectionsBuffer& getConnections() const { return *mxConnections; }
/** Returns the collection of pivot caches. */
inline PivotCacheBuffer& getPivotCaches() const { return *mxPivotCaches; }
/** Returns the collection of pivot tables. */
@@ -208,12 +185,12 @@ public:
/** Returns the page/print settings converter. */
inline PageSettingsConverter& getPageSettingsConverter() const { return *mxPageSettConverter; }
- // OOX specific -----------------------------------------------------------
+ // OOXML/BIFF12 specific --------------------------------------------------
- /** Returns the base OOX filter object. */
+ /** Returns the base OOXML/BIFF12 filter object. */
inline XmlFilterBase& getOoxFilter() const { return *mpOoxFilter; }
- // BIFF specific ----------------------------------------------------------
+ // BIFF2-BIFF8 specific ---------------------------------------------------
/** Returns the base BIFF filter object. */
inline BinaryFilterBase& getBiffFilter() const { return *mpBiffFilter; }
@@ -252,7 +229,7 @@ private:
typedef ::std::auto_ptr< DefinedNamesBuffer > DefNamesBfrPtr;
typedef ::std::auto_ptr< TableBuffer > TableBfrPtr;
typedef ::std::auto_ptr< ScenarioBuffer > ScenarioBfrPtr;
- typedef ::std::auto_ptr< WebQueryBuffer > WebQueryBfrPtr;
+ typedef ::std::auto_ptr< ConnectionsBuffer > ConnectionsBfrPtr;
typedef ::std::auto_ptr< PivotCacheBuffer > PivotCacheBfrPtr;
typedef ::std::auto_ptr< PivotTableBuffer > PivotTableBfrPtr;
typedef ::std::auto_ptr< FormulaParser > FormulaParserPtr;
@@ -286,7 +263,7 @@ private:
DefNamesBfrPtr mxDefNames; /// All defined names.
TableBfrPtr mxTables; /// All tables (database ranges).
ScenarioBfrPtr mxScenarios; /// All scenarios.
- WebQueryBfrPtr mxWebQueries; /// Web queries buffer.
+ ConnectionsBfrPtr mxConnections; /// All external data connections.
PivotCacheBfrPtr mxPivotCaches; /// All pivot caches in the document.
PivotTableBfrPtr mxPivotTables; /// All pivot tables in the document.
@@ -297,11 +274,11 @@ private:
ExcelChartConvPtr mxChartConverter; /// Chart object converter.
PageSettConvPtr mxPageSettConverter; /// Page/print settings converter.
- // OOX specific
- XmlFilterBase* mpOoxFilter; /// Base OOX filter object.
+ // OOXML/BIFF12 specific
+ XmlFilterBase* mpOoxFilter; /// Base OOXML/BIFF12 filter object.
- // BIFF specific
- BinaryFilterBase* mpBiffFilter; /// Base BIFF filter object.
+ // BIFF2-BIFF8 specific
+ BinaryFilterBase* mpBiffFilter; /// Base BIFF2-BIFF8 filter object.
BiffCodecHelperPtr mxCodecHelper; /// Encoder/decoder helper.
BiffType meBiff; /// BIFF version for BIFF import/export.
rtl_TextEncoding meTextEnc; /// BIFF byte string text encoding.
@@ -313,7 +290,7 @@ private:
WorkbookData::WorkbookData( ExcelFilter& rFilter ) :
mrBaseFilter( rFilter ),
mrExcelBase( rFilter ),
- meFilterType( FILTER_OOX ),
+ meFilterType( FILTER_OOXML ),
mpOoxFilter( &rFilter ),
mpBiffFilter( 0 ),
meBiff( BIFF_UNKNOWN )
@@ -344,46 +321,6 @@ WorkbookData::~WorkbookData()
// document model -------------------------------------------------------------
-Reference< XDevice > WorkbookData::getReferenceDevice() const
-{
- PropertySet aPropSet( mxDoc );
- Reference< XDevice > xDevice;
- aPropSet.getProperty( xDevice, PROP_ReferenceDevice );
- return xDevice;
-}
-
-Reference< XNamedRanges > WorkbookData::getNamedRanges() const
-{
- PropertySet aPropSet( mxDoc );
- Reference< XNamedRanges > xNamedRanges;
- aPropSet.getProperty( xNamedRanges, PROP_NamedRanges );
- return xNamedRanges;
-}
-
-Reference< XDatabaseRanges > WorkbookData::getDatabaseRanges() const
-{
- PropertySet aPropSet( mxDoc );
- Reference< XDatabaseRanges > xDatabaseRanges;
- aPropSet.getProperty( xDatabaseRanges, PROP_DatabaseRanges );
- return xDatabaseRanges;
-}
-
-Reference< XExternalDocLinks > WorkbookData::getExternalDocLinks() const
-{
- PropertySet aPropSet( mxDoc );
- Reference< XExternalDocLinks > xDocLinks;
- aPropSet.getProperty( xDocLinks, PROP_ExternalDocLinks );
- return xDocLinks;
-}
-
-Reference< XNameAccess > WorkbookData::getDdeLinks() const
-{
- PropertySet aPropSet( mxDoc );
- Reference< XNameAccess > xDdeLinks;
- aPropSet.getProperty( xDdeLinks, PROP_DDELinks );
- return xDdeLinks;
-}
-
Reference< XNameContainer > WorkbookData::getStyleFamily( bool bPageStyles ) const
{
Reference< XNameContainer > xStylesNC;
@@ -417,16 +354,16 @@ Reference< XStyle > WorkbookData::getStyleObject( const OUString& rStyleName, bo
Reference< XNamedRange > WorkbookData::createNamedRangeObject( OUString& orName, sal_Int32 nNameFlags ) const
{
- // find an unused name
- Reference< XNamedRanges > xNamedRanges = getNamedRanges();
- Reference< XNameAccess > xNameAccess( xNamedRanges, UNO_QUERY );
- if( xNameAccess.is() )
- orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' );
-
// create the name and insert it into the Calc document
Reference< XNamedRange > xNamedRange;
- if( xNamedRanges.is() && (orName.getLength() > 0) ) try
+ if( orName.getLength() > 0 ) try
{
+ // find an unused name
+ PropertySet aDocProps( mxDoc );
+ Reference< XNamedRanges > xNamedRanges( aDocProps.getAnyProperty( PROP_NamedRanges ), UNO_QUERY_THROW );
+ Reference< XNameAccess > xNameAccess( xNamedRanges, UNO_QUERY_THROW );
+ orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' );
+ // create the named range
xNamedRanges->addNewByName( orName, OUString(), CellAddress( 0, 0, 0 ), nNameFlags );
xNamedRange.set( xNamedRanges->getByName( orName ), UNO_QUERY );
}
@@ -437,6 +374,32 @@ Reference< XNamedRange > WorkbookData::createNamedRangeObject( OUString& orName,
return xNamedRange;
}
+Reference< XDatabaseRange > WorkbookData::createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const
+{
+ // validate cell range
+ CellRangeAddress aDestRange = rRangeAddr;
+ bool bValidRange = getAddressConverter().validateCellRange( aDestRange, true, true );
+
+ // create database range and insert it into the Calc document
+ Reference< XDatabaseRange > xDatabaseRange;
+ if( bValidRange && (orName.getLength() > 0) ) try
+ {
+ // find an unused name
+ PropertySet aDocProps( mxDoc );
+ Reference< XDatabaseRanges > xDatabaseRanges( aDocProps.getAnyProperty( PROP_DatabaseRanges ), UNO_QUERY_THROW );
+ Reference< XNameAccess > xNameAccess( xDatabaseRanges, UNO_QUERY_THROW );
+ orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' );
+ // create the database range
+ xDatabaseRanges->addNewByName( orName, aDestRange );
+ xDatabaseRange.set( xDatabaseRanges->getByName( orName ), UNO_QUERY );
+ }
+ catch( Exception& )
+ {
+ }
+ OSL_ENSURE( xDatabaseRange.is(), "WorkbookData::createDatabaseRangeObject - cannot create database range" );
+ return xDatabaseRange;
+}
+
Reference< XStyle > WorkbookData::createStyleObject( OUString& orStyleName, bool bPageStyle ) const
{
Reference< XStyle > xStyle;
@@ -544,7 +507,7 @@ void WorkbookData::initialize( bool bWorkbookFile )
mxDefNames.reset( new DefinedNamesBuffer( *this ) );
mxTables.reset( new TableBuffer( *this ) );
mxScenarios.reset( new ScenarioBuffer( *this ) );
- mxWebQueries.reset( new WebQueryBuffer( *this ) );
+ mxConnections.reset( new ConnectionsBuffer( *this ) );
mxPivotCaches.reset( new PivotCacheBuffer( *this ) );
mxPivotTables.reset( new PivotTableBuffer( *this ) );
@@ -566,7 +529,7 @@ void WorkbookData::initialize( bool bWorkbookFile )
// disable automatic update of linked sheets and DDE links
aPropSet.setProperty( PROP_IsExecuteLinkEnabled, false );
// #i79890# disable automatic update of defined names
- Reference< XActionLockable > xLockable( getNamedRanges(), UNO_QUERY );
+ Reference< XActionLockable > xLockable( aPropSet.getAnyProperty( PROP_NamedRanges ), UNO_QUERY );
if( xLockable.is() )
xLockable->addActionLock();
@@ -587,7 +550,7 @@ void WorkbookData::initialize( bool bWorkbookFile )
mxCodecHelper.reset( new BiffCodecHelper( *this ) );
break;
- case FILTER_OOX:
+ case FILTER_OOXML:
break;
case FILTER_UNKNOWN:
@@ -604,7 +567,7 @@ void WorkbookData::finalize()
// #i74668# do not insert default sheets
aPropSet.setProperty( PROP_IsLoaded, true );
// #i79890# enable automatic update of defined names (before IsAdjustHeightEnabled!)
- Reference< XActionLockable > xLockable( getNamedRanges(), UNO_QUERY );
+ Reference< XActionLockable > xLockable( aPropSet.getAnyProperty( PROP_NamedRanges ), UNO_QUERY );
if( xLockable.is() )
xLockable->removeActionLock();
// enable automatic update of linked sheets and DDE links
@@ -615,6 +578,8 @@ void WorkbookData::finalize()
aPropSet.setProperty( PROP_IsUndoEnabled, true );
// disable editing read-only documents (e.g. from read-only files)
aPropSet.setProperty( PROP_IsChangeReadOnlyEnabled, false );
+ // #111099# open forms in alive mode (has no effect, if no controls in document)
+ aPropSet.setProperty( PROP_ApplyFormDesignMode, false );
}
}
@@ -633,7 +598,7 @@ FilterBase& WorkbookHelper::getBaseFilter() const
Reference< XMultiServiceFactory > WorkbookHelper::getGlobalFactory() const
{
- return mrBookData.getBaseFilter().getGlobalFactory();
+ return mrBookData.getBaseFilter().getServiceFactory();
}
FilterType WorkbookHelper::getFilterType() const
@@ -692,10 +657,7 @@ void WorkbookHelper::finalizeWorkbookImport()
contains the workbook code name). */
StorageRef xVbaPrjStrg = mrBookData.getVbaProjectStorage();
if( xVbaPrjStrg.get() && xVbaPrjStrg->isStorage() )
- {
- ::oox::ole::VbaProject aVbaProject( getGlobalFactory(), getBaseFilter().getModel(), CREATE_OUSTRING( "Calc" ) );
- aVbaProject.importVbaProject( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() );
- }
+ getBaseFilter().getVbaProject().importVbaProject( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() );
}
// document model -------------------------------------------------------------
@@ -710,31 +672,6 @@ Reference< XMultiServiceFactory > WorkbookHelper::getDocumentFactory() const
return mrBookData.getBaseFilter().getModelFactory();
}
-Reference< XDevice > WorkbookHelper::getReferenceDevice() const
-{
- return mrBookData.getReferenceDevice();
-}
-
-Reference< XNamedRanges > WorkbookHelper::getNamedRanges() const
-{
- return mrBookData.getNamedRanges();
-}
-
-Reference< XDatabaseRanges > WorkbookHelper::getDatabaseRanges() const
-{
- return mrBookData.getDatabaseRanges();
-}
-
-Reference< XExternalDocLinks > WorkbookHelper::getExternalDocLinks() const
-{
- return mrBookData.getExternalDocLinks();
-}
-
-Reference< XNameAccess > WorkbookHelper::getDdeLinks() const
-{
- return mrBookData.getDdeLinks();
-}
-
Reference< XSpreadsheet > WorkbookHelper::getSheetFromDoc( sal_Int16 nSheet ) const
{
Reference< XSpreadsheet > xSheet;
@@ -806,6 +743,11 @@ Reference< XNamedRange > WorkbookHelper::createNamedRangeObject( OUString& orNam
return mrBookData.createNamedRangeObject( orName, nNameFlags );
}
+Reference< XDatabaseRange > WorkbookHelper::createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const
+{
+ return mrBookData.createDatabaseRangeObject( orName, rRangeAddr );
+}
+
Reference< XStyle > WorkbookHelper::createStyleObject( OUString& orStyleName, bool bPageStyle ) const
{
return mrBookData.createStyleObject( orStyleName, bPageStyle );
@@ -863,9 +805,9 @@ ScenarioBuffer& WorkbookHelper::getScenarios() const
return mrBookData.getScenarios();
}
-WebQueryBuffer& WorkbookHelper::getWebQueries() const
+ConnectionsBuffer& WorkbookHelper::getConnections() const
{
- return mrBookData.getWebQueries();
+ return mrBookData.getConnections();
}
PivotCacheBuffer& WorkbookHelper::getPivotCaches() const
@@ -905,11 +847,11 @@ PageSettingsConverter& WorkbookHelper::getPageSettingsConverter() const
return mrBookData.getPageSettingsConverter();
}
-// OOX specific ---------------------------------------------------------------
+// OOXML/BIFF12 specific ------------------------------------------------------
XmlFilterBase& WorkbookHelper::getOoxFilter() const
{
- OSL_ENSURE( mrBookData.getFilterType() == FILTER_OOX, "WorkbookHelper::getOoxFilter - invalid call" );
+ OSL_ENSURE( mrBookData.getFilterType() == FILTER_OOXML, "WorkbookHelper::getOoxFilter - invalid call" );
return mrBookData.getOoxFilter();
}
@@ -1005,4 +947,4 @@ bool WorkbookHelperRoot::isValid() const
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/workbooksettings.cxx b/oox/source/xls/workbooksettings.cxx
index 711cc9ac8e0d..2717642d2655 100644
--- a/oox/source/xls/workbooksettings.cxx
+++ b/oox/source/xls/workbooksettings.cxx
@@ -27,49 +27,46 @@
************************************************************************/
#include "oox/xls/workbooksettings.hxx"
+
#include <com/sun/star/sheet/XCalculatable.hpp>
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <comphelper/mediadescriptor.hxx>
-#include "properties.hxx"
+#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/core/xmlfilterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/unitconverter.hxx"
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::sheet::XCalculatable;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::util::Date;
-using ::com::sun::star::util::XNumberFormatsSupplier;
-using ::comphelper::MediaDescriptor;
-using ::oox::core::CodecHelper;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::comphelper::MediaDescriptor;
+using ::oox::core::CodecHelper;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
-const sal_uInt32 OOBIN_WORKBOOKPR_DATE1904 = 0x00000001;
-const sal_uInt32 OOBIN_WORKBOOKPR_STRIPEXT = 0x00000080;
+const sal_uInt32 BIFF12_WORKBOOKPR_DATE1904 = 0x00000001;
+const sal_uInt32 BIFF12_WORKBOOKPR_STRIPEXT = 0x00000080;
-const sal_uInt16 OOBIN_CALCPR_A1 = 0x0002;
-const sal_uInt16 OOBIN_CALCPR_ITERATE = 0x0004;
-const sal_uInt16 OOBIN_CALCPR_FULLPRECISION = 0x0008;
-const sal_uInt16 OOBIN_CALCPR_CALCCOMPLETED = 0x0010;
-const sal_uInt16 OOBIN_CALCPR_CALCONSAVE = 0x0020;
-const sal_uInt16 OOBIN_CALCPR_CONCURRENT = 0x0040;
-const sal_uInt16 OOBIN_CALCPR_MANUALPROC = 0x0080;
+const sal_uInt16 BIFF12_CALCPR_A1 = 0x0002;
+const sal_uInt16 BIFF12_CALCPR_ITERATE = 0x0004;
+const sal_uInt16 BIFF12_CALCPR_FULLPRECISION = 0x0008;
+const sal_uInt16 BIFF12_CALCPR_CALCCOMPLETED = 0x0010;
+const sal_uInt16 BIFF12_CALCPR_CALCONSAVE = 0x0020;
+const sal_uInt16 BIFF12_CALCPR_CONCURRENT = 0x0040;
+const sal_uInt16 BIFF12_CALCPR_MANUALPROC = 0x0080;
// no predefined constants for show objects mode
const sal_Int16 API_SHOWMODE_SHOW = 0; /// Show drawing objects.
@@ -97,7 +94,7 @@ WorkbookSettingsModel::WorkbookSettingsModel() :
{
}
-void WorkbookSettingsModel::setBinObjectMode( sal_uInt16 nObjMode )
+void WorkbookSettingsModel::setBiffObjectMode( sal_uInt16 nObjMode )
{
static const sal_Int32 spnObjModes[] = { XML_all, XML_placeholders, XML_none };
mnShowObjectMode = STATIC_ARRAY_SELECT( spnObjModes, nObjMode, XML_all );
@@ -160,37 +157,37 @@ void WorkbookSettings::importCalcPr( const AttributeList& rAttribs )
maCalcSettings.mbConcurrent = rAttribs.getBool( XML_concurrentCalc, true );
}
-void WorkbookSettings::importFileSharing( RecordInputStream& rStrm )
+void WorkbookSettings::importFileSharing( SequenceInputStream& rStrm )
{
maFileSharing.mbRecommendReadOnly = rStrm.readuInt16() != 0;
rStrm >> maFileSharing.mnPasswordHash >> maFileSharing.maUserName;
}
-void WorkbookSettings::importWorkbookPr( RecordInputStream& rStrm )
+void WorkbookSettings::importWorkbookPr( SequenceInputStream& rStrm )
{
sal_uInt32 nFlags;
rStrm >> nFlags >> maBookSettings.mnDefaultThemeVer >> maBookSettings.maCodeName;
- maBookSettings.setBinObjectMode( extractValue< sal_uInt16 >( nFlags, 13, 2 ) );
+ maBookSettings.setBiffObjectMode( extractValue< sal_uInt16 >( nFlags, 13, 2 ) );
// set flag means: strip external link values
- maBookSettings.mbSaveExtLinkValues = !getFlag( nFlags, OOBIN_WORKBOOKPR_STRIPEXT );
- setDateMode( getFlag( nFlags, OOBIN_WORKBOOKPR_DATE1904 ) );
+ maBookSettings.mbSaveExtLinkValues = !getFlag( nFlags, BIFF12_WORKBOOKPR_STRIPEXT );
+ setDateMode( getFlag( nFlags, BIFF12_WORKBOOKPR_DATE1904 ) );
}
-void WorkbookSettings::importCalcPr( RecordInputStream& rStrm )
+void WorkbookSettings::importCalcPr( SequenceInputStream& rStrm )
{
sal_Int32 nCalcMode, nProcCount;
sal_uInt16 nFlags;
rStrm >> maCalcSettings.mnCalcId >> nCalcMode >> maCalcSettings.mnIterateCount >> maCalcSettings.mfIterateDelta >> nProcCount >> nFlags;
static const sal_Int32 spnCalcModes[] = { XML_manual, XML_auto, XML_autoNoTable };
- maCalcSettings.mnRefMode = getFlagValue( nFlags, OOBIN_CALCPR_A1, XML_A1, XML_R1C1 );
+ maCalcSettings.mnRefMode = getFlagValue( nFlags, BIFF12_CALCPR_A1, XML_A1, XML_R1C1 );
maCalcSettings.mnCalcMode = STATIC_ARRAY_SELECT( spnCalcModes, nCalcMode, XML_auto );
- maCalcSettings.mnProcCount = getFlagValue< sal_Int32 >( nFlags, OOBIN_CALCPR_MANUALPROC, nProcCount, -1 );
- maCalcSettings.mbCalcOnSave = getFlag( nFlags, OOBIN_CALCPR_CALCONSAVE );
- maCalcSettings.mbCalcCompleted = getFlag( nFlags, OOBIN_CALCPR_CALCCOMPLETED );
- maCalcSettings.mbFullPrecision = getFlag( nFlags, OOBIN_CALCPR_FULLPRECISION );
- maCalcSettings.mbIterate = getFlag( nFlags, OOBIN_CALCPR_ITERATE );
- maCalcSettings.mbConcurrent = getFlag( nFlags, OOBIN_CALCPR_CONCURRENT );
+ maCalcSettings.mnProcCount = getFlagValue< sal_Int32 >( nFlags, BIFF12_CALCPR_MANUALPROC, nProcCount, -1 );
+ maCalcSettings.mbCalcOnSave = getFlag( nFlags, BIFF12_CALCPR_CALCONSAVE );
+ maCalcSettings.mbCalcCompleted = getFlag( nFlags, BIFF12_CALCPR_CALCCOMPLETED );
+ maCalcSettings.mbFullPrecision = getFlag( nFlags, BIFF12_CALCPR_FULLPRECISION );
+ maCalcSettings.mbIterate = getFlag( nFlags, BIFF12_CALCPR_ITERATE );
+ maCalcSettings.mbConcurrent = getFlag( nFlags, BIFF12_CALCPR_CONCURRENT );
}
void WorkbookSettings::setSaveExtLinkValues( bool bSaveExtLinks )
@@ -250,7 +247,7 @@ void WorkbookSettings::importFileSharing( BiffInputStream& rStrm )
void WorkbookSettings::importHideObj( BiffInputStream& rStrm )
{
- maBookSettings.setBinObjectMode( rStrm.readuInt16() );
+ maBookSettings.setBiffObjectMode( rStrm.readuInt16() );
}
void WorkbookSettings::importIteration( BiffInputStream& rStrm )
@@ -290,7 +287,7 @@ void WorkbookSettings::finalizeImport()
PropertySet aPropSet( getDocument() );
switch( getFilterType() )
{
- case FILTER_OOX:
+ case FILTER_OOXML:
case FILTER_BIFF:
aPropSet.setProperty( PROP_IgnoreCase, true ); // always in Excel
aPropSet.setProperty( PROP_RegularExpressions, false ); // not supported in Excel
@@ -384,4 +381,4 @@ void WorkbookSettings::setDateMode( bool bDateMode1904, bool bDateCompatibility
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/worksheetbuffer.cxx b/oox/source/xls/worksheetbuffer.cxx
index 3d0d882325c7..cc3a907d88c6 100644
--- a/oox/source/xls/worksheetbuffer.cxx
+++ b/oox/source/xls/worksheetbuffer.cxx
@@ -27,37 +27,35 @@
************************************************************************/
#include "oox/xls/worksheetbuffer.hxx"
-#include <rtl/ustrbuf.hxx>
+
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XExternalSheetName.hpp>
#include <com/sun/star/sheet/XSheetLinkable.hpp>
-#include "properties.hxx"
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
+#include <rtl/ustrbuf.hxx>
+#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
+#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/helper/recordinputstream.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/excelhandlers.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::container::XIndexAccess;
-using ::com::sun::star::container::XNameAccess;
-using ::com::sun::star::container::XNamed;
-using ::com::sun::star::sheet::XSpreadsheetDocument;
-using ::com::sun::star::sheet::XSpreadsheets;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::uno;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
SheetInfoModel::SheetInfoModel() :
mnBiffHandle( -1 ),
mnSheetId( -1 ),
@@ -98,7 +96,7 @@ void WorksheetBuffer::importSheet( const AttributeList& rAttribs )
insertSheet( aModel );
}
-void WorksheetBuffer::importSheet( RecordInputStream& rStrm )
+void WorksheetBuffer::importSheet( SequenceInputStream& rStrm )
{
sal_Int32 nState;
SheetInfoModel aModel;
@@ -260,4 +258,4 @@ void WorksheetBuffer::insertSheet( const SheetInfoModel& rModel )
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/worksheetfragment.cxx b/oox/source/xls/worksheetfragment.cxx
index a0f32ce86104..64ba8f71e196 100644
--- a/oox/source/xls/worksheetfragment.cxx
+++ b/oox/source/xls/worksheetfragment.cxx
@@ -27,11 +27,12 @@
************************************************************************/
#include "oox/xls/worksheetfragment.hxx"
-#include "oox/helper/attributelist.hxx"
-#include "oox/helper/recordinputstream.hxx"
+
#include "oox/core/filterbase.hxx"
#include "oox/core/relations.hxx"
+#include "oox/helper/attributelist.hxx"
#include "oox/xls/addressconverter.hxx"
+#include "oox/xls/autofilterbuffer.hxx"
#include "oox/xls/autofiltercontext.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/commentsfragment.hxx"
@@ -39,7 +40,6 @@
#include "oox/xls/drawingfragment.hxx"
#include "oox/xls/externallinkbuffer.hxx"
#include "oox/xls/pagesettings.hxx"
-#include "oox/xls/pivottablebuffer.hxx"
#include "oox/xls/pivottablefragment.hxx"
#include "oox/xls/querytablefragment.hxx"
#include "oox/xls/scenariobuffer.hxx"
@@ -50,23 +50,20 @@
#include "oox/xls/workbooksettings.hxx"
#include "oox/xls/worksheetsettings.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::oox::core::ContextHandlerRef;
-using ::oox::core::RecordInfo;
-using ::oox::core::Relations;
-using ::oox::core::RelationsRef;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::uno;
+using namespace ::oox::core;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
const sal_uInt16 BIFF_COLINFO_HIDDEN = 0x0001;
@@ -88,23 +85,23 @@ const sal_uInt32 BIFF_DATAVAL_SHOWERROR = 0x00080000;
const sal_uInt32 BIFF_SHRFEATHEAD_SHEETPROT = 2;
-const sal_Int32 OOBIN_OLEOBJECT_CONTENT = 1;
-const sal_Int32 OOBIN_OLEOBJECT_ICON = 4;
-const sal_Int32 OOBIN_OLEOBJECT_ALWAYS = 1;
-const sal_Int32 OOBIN_OLEOBJECT_ONCALL = 3;
-const sal_uInt16 OOBIN_OLEOBJECT_LINKED = 0x0001;
-const sal_uInt16 OOBIN_OLEOBJECT_AUTOLOAD = 0x0002;
+const sal_Int32 BIFF12_OLEOBJECT_CONTENT = 1;
+const sal_Int32 BIFF12_OLEOBJECT_ICON = 4;
+const sal_Int32 BIFF12_OLEOBJECT_ALWAYS = 1;
+const sal_Int32 BIFF12_OLEOBJECT_ONCALL = 3;
+const sal_uInt16 BIFF12_OLEOBJECT_LINKED = 0x0001;
+const sal_uInt16 BIFF12_OLEOBJECT_AUTOLOAD = 0x0002;
} // namespace
// ============================================================================
-OoxDataValidationsContext::OoxDataValidationsContext( OoxWorksheetFragmentBase& rFragment ) :
- OoxWorksheetContextBase( rFragment )
+DataValidationsContext::DataValidationsContext( WorksheetFragmentBase& rFragment ) :
+ WorksheetContextBase( rFragment )
{
}
-ContextHandlerRef OoxDataValidationsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef DataValidationsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -120,7 +117,7 @@ ContextHandlerRef OoxDataValidationsContext::onCreateContext( sal_Int32 nElement
{
case XLS_TOKEN( formula1 ):
case XLS_TOKEN( formula2 ):
- return this; // collect formulas in onEndElement()
+ return this; // collect formulas in onCharacters()
}
break;
}
@@ -139,7 +136,7 @@ ApiTokenSequence lclImportDataValFormula( FormulaParser& rParser, const OUString
} // namespace
-void OoxDataValidationsContext::onEndElement( const OUString& rChars )
+void DataValidationsContext::onCharacters( const OUString& rChars )
{
if( mxValModel.get() ) switch( getCurrentElement() )
{
@@ -154,22 +151,27 @@ void OoxDataValidationsContext::onEndElement( const OUString& rChars )
mxValModel->maTokens2 = lclImportDataValFormula(
getFormulaParser(), rChars, mxValModel->maRanges.getBaseAddress() );
break;
- case XLS_TOKEN( dataValidation ):
- setValidation( *mxValModel );
- mxValModel.reset();
- break;
}
}
+void DataValidationsContext::onEndElement()
+{
+ if( isCurrentElement( XLS_TOKEN( dataValidation ) ) && mxValModel.get() )
+ {
+ setValidation( *mxValModel );
+ mxValModel.reset();
+ }
+}
-ContextHandlerRef OoxDataValidationsContext::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+
+ContextHandlerRef DataValidationsContext::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
- if( nRecId == OOBIN_ID_DATAVALIDATION )
+ if( nRecId == BIFF12_ID_DATAVALIDATION )
importDataValidation( rStrm );
return 0;
}
-void OoxDataValidationsContext::importDataValidation( const AttributeList& rAttribs )
+void DataValidationsContext::importDataValidation( const AttributeList& rAttribs )
{
mxValModel.reset( new ValidationModel );
getAddressConverter().convertToCellRangeList( mxValModel->maRanges, rAttribs.getString( XML_sqref, OUString() ), getSheetIndex(), true );
@@ -189,7 +191,7 @@ void OoxDataValidationsContext::importDataValidation( const AttributeList& rAttr
mxValModel->mbAllowBlank = rAttribs.getBool( XML_allowBlank, false );
}
-void OoxDataValidationsContext::importDataValidation( RecordInputStream& rStrm )
+void DataValidationsContext::importDataValidation( SequenceInputStream& rStrm )
{
ValidationModel aModel;
@@ -197,10 +199,10 @@ void OoxDataValidationsContext::importDataValidation( RecordInputStream& rStrm )
BinRangeList aRanges;
rStrm >> nFlags >> aRanges >> aModel.maErrorTitle >> aModel.maErrorMessage >> aModel.maInputTitle >> aModel.maInputMessage;
- // equal flags in BIFF and OOBIN
- aModel.setBinType( extractValue< sal_uInt8 >( nFlags, 0, 4 ) );
- aModel.setBinOperator( extractValue< sal_uInt8 >( nFlags, 20, 4 ) );
- aModel.setBinErrorStyle( extractValue< sal_uInt8 >( nFlags, 4, 3 ) );
+ // equal flags in all BIFFs
+ aModel.setBiffType( extractValue< sal_uInt8 >( nFlags, 0, 4 ) );
+ aModel.setBiffOperator( extractValue< sal_uInt8 >( nFlags, 20, 4 ) );
+ aModel.setBiffErrorStyle( extractValue< sal_uInt8 >( nFlags, 4, 3 ) );
aModel.mbAllowBlank = getFlag( nFlags, BIFF_DATAVAL_ALLOWBLANK );
aModel.mbNoDropDown = getFlag( nFlags, BIFF_DATAVAL_NODROPDOWN );
aModel.mbShowInputMsg = getFlag( nFlags, BIFF_DATAVAL_SHOWINPUT );
@@ -227,24 +229,22 @@ void OoxDataValidationsContext::importDataValidation( RecordInputStream& rStrm )
// ============================================================================
-OoxWorksheetFragment::OoxWorksheetFragment( const WorkbookHelper& rHelper,
- const OUString& rFragmentPath, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
- OoxWorksheetFragmentBase( rHelper, rFragmentPath, xProgressBar, eSheetType, nSheet )
+WorksheetFragment::WorksheetFragment( const WorkbookHelper& rHelper,
+ const OUString& rFragmentPath, const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+ WorksheetFragmentBase( rHelper, rFragmentPath, rxProgressBar, eSheetType, nSheet )
{
// import data tables related to this worksheet
- RelationsRef xTableRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "table" ) );
+ RelationsRef xTableRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATION_TYPE( "table" ) );
for( Relations::const_iterator aIt = xTableRels->begin(), aEnd = xTableRels->end(); aIt != aEnd; ++aIt )
- importOoxFragment( new OoxTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
+ importOoxFragment( new TableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
// import comments related to this worksheet
- OUString aCommentsFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATIONSTYPE( "comments" ) );
+ OUString aCommentsFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "comments" ) );
if( aCommentsFragmentPath.getLength() > 0 )
- importOoxFragment( new OoxCommentsFragment( *this, aCommentsFragmentPath ) );
+ importOoxFragment( new CommentsFragment( *this, aCommentsFragmentPath ) );
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
-ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextHandlerRef WorksheetFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
@@ -253,7 +253,7 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con
case SHEETTYPE_WORKSHEET: return (nElement == XLS_TOKEN( worksheet )) ? this : 0;
case SHEETTYPE_CHARTSHEET: return 0;
case SHEETTYPE_MACROSHEET: return (nElement == XM_TOKEN( macrosheet )) ? this : 0;
- case SHEETTYPE_DIALOGSHEET: return (nElement == XM_TOKEN( dialogsheet )) ? this : 0;
+ case SHEETTYPE_DIALOGSHEET: return (nElement == XLS_TOKEN( dialogsheet )) ? this : 0;
case SHEETTYPE_MODULESHEET: return 0;
case SHEETTYPE_EMPTYSHEET: return 0;
}
@@ -261,12 +261,14 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con
case XLS_TOKEN( worksheet ):
case XM_TOKEN( macrosheet ):
+ case XLS_TOKEN( dialogsheet ):
switch( nElement )
{
- case XLS_TOKEN( sheetData ): return new OoxSheetDataContext( *this );
- case XLS_TOKEN( autoFilter ): return new OoxAutoFilterContext( *this );
- case XLS_TOKEN( conditionalFormatting ): return new OoxCondFormatContext( *this );
- case XLS_TOKEN( dataValidations ): return new OoxDataValidationsContext( *this );
+ case XLS_TOKEN( sheetData ): return new SheetDataContext( *this );
+ case XLS_TOKEN( conditionalFormatting ): return new CondFormatContext( *this );
+ case XLS_TOKEN( dataValidations ): return new DataValidationsContext( *this );
+ case XLS_TOKEN( autoFilter ): return new AutoFilterContext( *this, getAutoFilters().createAutoFilter() );
+ case XLS_TOKEN( scenarios ): return new ScenariosContext( *this );
case XLS_TOKEN( sheetViews ):
case XLS_TOKEN( cols ):
@@ -289,8 +291,6 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con
case XLS_TOKEN( picture ): getPageSettings().importPicture( getRelations(), rAttribs ); break;
case XLS_TOKEN( drawing ): importDrawing( rAttribs ); break;
case XLS_TOKEN( legacyDrawing ): importLegacyDrawing( rAttribs ); break;
- case XLS_TOKEN( scenarios ):
- return new OoxScenariosContext( *this );
}
break;
@@ -341,7 +341,7 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con
case XLS_TOKEN( oddHeader ):
case XLS_TOKEN( oddFooter ):
case XLS_TOKEN( evenHeader ):
- case XLS_TOKEN( evenFooter ): return this; // collect h/f contents in onEndElement()
+ case XLS_TOKEN( evenFooter ): return this; // collect h/f contents in onCharacters()
}
break;
@@ -355,7 +355,7 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con
return 0;
}
-void OoxWorksheetFragment::onEndElement( const OUString& rChars )
+void WorksheetFragment::onCharacters( const OUString& rChars )
{
switch( getCurrentElement() )
{
@@ -370,134 +370,136 @@ void OoxWorksheetFragment::onEndElement( const OUString& rChars )
}
}
-ContextHandlerRef OoxWorksheetFragment::onCreateRecordContext( sal_Int32 nRecId, RecordInputStream& rStrm )
+ContextHandlerRef WorksheetFragment::onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
{
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
- if( nRecId == OOBIN_ID_WORKSHEET ) return this;
+ if( nRecId == BIFF12_ID_WORKSHEET ) return this;
break;
- case OOBIN_ID_WORKSHEET:
+ case BIFF12_ID_WORKSHEET:
switch( nRecId )
{
- case OOBIN_ID_SHEETDATA: return new OoxSheetDataContext( *this );
- case OOBIN_ID_CONDFORMATTING: return new OoxCondFormatContext( *this );
- case OOBIN_ID_DATAVALIDATIONS: return new OoxDataValidationsContext( *this );
-
- case OOBIN_ID_SHEETVIEWS:
- case OOBIN_ID_COLS:
- case OOBIN_ID_MERGECELLS:
- case OOBIN_ID_ROWBREAKS:
- case OOBIN_ID_COLBREAKS:
- case OOBIN_ID_OLEOBJECTS:
- case OOBIN_ID_CONTROLS: return this;
-
- case OOBIN_ID_SHEETPR: getWorksheetSettings().importSheetPr( rStrm ); break;
- case OOBIN_ID_DIMENSION: importDimension( rStrm ); break;
- case OOBIN_ID_SHEETFORMATPR: importSheetFormatPr( rStrm ); break;
- case OOBIN_ID_HYPERLINK: importHyperlink( rStrm ); break;
- case OOBIN_ID_PAGEMARGINS: getPageSettings().importPageMargins( rStrm ); break;
- case OOBIN_ID_PAGESETUP: getPageSettings().importPageSetup( getRelations(), rStrm ); break;
- case OOBIN_ID_PRINTOPTIONS: getPageSettings().importPrintOptions( rStrm ); break;
- case OOBIN_ID_HEADERFOOTER: getPageSettings().importHeaderFooter( rStrm ); break;
- case OOBIN_ID_PICTURE: getPageSettings().importPicture( getRelations(), rStrm ); break;
- case OOBIN_ID_SHEETPROTECTION: getWorksheetSettings().importSheetProtection( rStrm ); break;
- case OOBIN_ID_PHONETICPR: getWorksheetSettings().importPhoneticPr( rStrm ); break;
- case OOBIN_ID_DRAWING: importDrawing( rStrm ); break;
- case OOBIN_ID_LEGACYDRAWING: importLegacyDrawing( rStrm ); break;
- case OOBIN_ID_SCENARIOS:
- return new OoxScenariosContext( *this );
+ case BIFF12_ID_SHEETDATA: return new SheetDataContext( *this );
+ case BIFF12_ID_CONDFORMATTING: return new CondFormatContext( *this );
+ case BIFF12_ID_DATAVALIDATIONS: return new DataValidationsContext( *this );
+ case BIFF12_ID_AUTOFILTER: return new AutoFilterContext( *this, getAutoFilters().createAutoFilter() );
+ case BIFF12_ID_SCENARIOS: return new ScenariosContext( *this );
+
+ case BIFF12_ID_SHEETVIEWS:
+ case BIFF12_ID_COLS:
+ case BIFF12_ID_MERGECELLS:
+ case BIFF12_ID_ROWBREAKS:
+ case BIFF12_ID_COLBREAKS:
+ case BIFF12_ID_OLEOBJECTS:
+ case BIFF12_ID_CONTROLS: return this;
+
+ case BIFF12_ID_SHEETPR: getWorksheetSettings().importSheetPr( rStrm ); break;
+ case BIFF12_ID_DIMENSION: importDimension( rStrm ); break;
+ case BIFF12_ID_SHEETFORMATPR: importSheetFormatPr( rStrm ); break;
+ case BIFF12_ID_HYPERLINK: importHyperlink( rStrm ); break;
+ case BIFF12_ID_PAGEMARGINS: getPageSettings().importPageMargins( rStrm ); break;
+ case BIFF12_ID_PAGESETUP: getPageSettings().importPageSetup( getRelations(), rStrm ); break;
+ case BIFF12_ID_PRINTOPTIONS: getPageSettings().importPrintOptions( rStrm ); break;
+ case BIFF12_ID_HEADERFOOTER: getPageSettings().importHeaderFooter( rStrm ); break;
+ case BIFF12_ID_PICTURE: getPageSettings().importPicture( getRelations(), rStrm ); break;
+ case BIFF12_ID_SHEETPROTECTION: getWorksheetSettings().importSheetProtection( rStrm ); break;
+ case BIFF12_ID_PHONETICPR: getWorksheetSettings().importPhoneticPr( rStrm ); break;
+ case BIFF12_ID_DRAWING: importDrawing( rStrm ); break;
+ case BIFF12_ID_LEGACYDRAWING: importLegacyDrawing( rStrm ); break;
}
break;
- case OOBIN_ID_SHEETVIEWS:
+ case BIFF12_ID_SHEETVIEWS:
switch( nRecId )
{
- case OOBIN_ID_SHEETVIEW: getSheetViewSettings().importSheetView( rStrm ); return this;
+ case BIFF12_ID_SHEETVIEW: getSheetViewSettings().importSheetView( rStrm ); return this;
}
break;
- case OOBIN_ID_SHEETVIEW:
+ case BIFF12_ID_SHEETVIEW:
switch( nRecId )
{
- case OOBIN_ID_PANE: getSheetViewSettings().importPane( rStrm ); break;
- case OOBIN_ID_SELECTION: getSheetViewSettings().importSelection( rStrm ); break;
+ case BIFF12_ID_PANE: getSheetViewSettings().importPane( rStrm ); break;
+ case BIFF12_ID_SELECTION: getSheetViewSettings().importSelection( rStrm ); break;
}
break;
- case OOBIN_ID_COLS:
- if( nRecId == OOBIN_ID_COL ) importCol( rStrm );
+ case BIFF12_ID_COLS:
+ if( nRecId == BIFF12_ID_COL ) importCol( rStrm );
break;
- case OOBIN_ID_MERGECELLS:
- if( nRecId == OOBIN_ID_MERGECELL ) importMergeCell( rStrm );
+ case BIFF12_ID_MERGECELLS:
+ if( nRecId == BIFF12_ID_MERGECELL ) importMergeCell( rStrm );
break;
- case OOBIN_ID_ROWBREAKS:
- if( nRecId == OOBIN_ID_BRK ) importBrk( rStrm, true );
+ case BIFF12_ID_ROWBREAKS:
+ if( nRecId == BIFF12_ID_BRK ) importBrk( rStrm, true );
break;
- case OOBIN_ID_COLBREAKS:
- if( nRecId == OOBIN_ID_BRK ) importBrk( rStrm, false );
+ case BIFF12_ID_COLBREAKS:
+ if( nRecId == BIFF12_ID_BRK ) importBrk( rStrm, false );
break;
- case OOBIN_ID_OLEOBJECTS:
- if( nRecId == OOBIN_ID_OLEOBJECT ) importOleObject( rStrm );
+ case BIFF12_ID_OLEOBJECTS:
+ if( nRecId == BIFF12_ID_OLEOBJECT ) importOleObject( rStrm );
break;
- case OOBIN_ID_CONTROLS:
- if( nRecId == OOBIN_ID_CONTROL ) importControl( rStrm );
+ case BIFF12_ID_CONTROLS:
+ if( nRecId == BIFF12_ID_CONTROL ) importControl( rStrm );
break;
}
return 0;
}
-// oox.core.FragmentHandler2 interface ----------------------------------------
-
-const RecordInfo* OoxWorksheetFragment::getRecordInfos() const
+const RecordInfo* WorksheetFragment::getRecordInfos() const
{
static const RecordInfo spRecInfos[] =
{
- { OOBIN_ID_CFRULE, OOBIN_ID_CFRULE + 1 },
- { OOBIN_ID_COLBREAKS, OOBIN_ID_COLBREAKS + 1 },
- { OOBIN_ID_COLORSCALE, OOBIN_ID_COLORSCALE + 1 },
- { OOBIN_ID_COLS, OOBIN_ID_COLS + 1 },
- { OOBIN_ID_CONDFORMATTING, OOBIN_ID_CONDFORMATTING + 1 },
- { OOBIN_ID_CONTROLS, OOBIN_ID_CONTROLS + 2 },
- { OOBIN_ID_CUSTOMSHEETVIEW, OOBIN_ID_CUSTOMSHEETVIEW + 1 },
- { OOBIN_ID_CUSTOMSHEETVIEWS, OOBIN_ID_CUSTOMSHEETVIEWS + 3 },
- { OOBIN_ID_DATABAR, OOBIN_ID_DATABAR + 1 },
- { OOBIN_ID_DATAVALIDATIONS, OOBIN_ID_DATAVALIDATIONS + 1 },
- { OOBIN_ID_HEADERFOOTER, OOBIN_ID_HEADERFOOTER + 1 },
- { OOBIN_ID_ICONSET, OOBIN_ID_ICONSET + 1 },
- { OOBIN_ID_MERGECELLS, OOBIN_ID_MERGECELLS + 1 },
- { OOBIN_ID_OLEOBJECTS, OOBIN_ID_OLEOBJECTS + 2 },
- { OOBIN_ID_ROW, -1 },
- { OOBIN_ID_ROWBREAKS, OOBIN_ID_ROWBREAKS + 1 },
- { OOBIN_ID_SCENARIO, OOBIN_ID_SCENARIO + 1 },
- { OOBIN_ID_SCENARIOS, OOBIN_ID_SCENARIOS + 1 },
- { OOBIN_ID_SHEETDATA, OOBIN_ID_SHEETDATA + 1 },
- { OOBIN_ID_SHEETVIEW, OOBIN_ID_SHEETVIEW + 1 },
- { OOBIN_ID_SHEETVIEWS, OOBIN_ID_SHEETVIEWS + 1 },
- { OOBIN_ID_TABLEPARTS, OOBIN_ID_TABLEPARTS + 2 },
- { OOBIN_ID_WORKSHEET, OOBIN_ID_WORKSHEET + 1 },
+ { BIFF12_ID_AUTOFILTER, BIFF12_ID_AUTOFILTER + 1 },
+ { BIFF12_ID_CFRULE, BIFF12_ID_CFRULE + 1 },
+ { BIFF12_ID_COLBREAKS, BIFF12_ID_COLBREAKS + 1 },
+ { BIFF12_ID_COLORSCALE, BIFF12_ID_COLORSCALE + 1 },
+ { BIFF12_ID_COLS, BIFF12_ID_COLS + 1 },
+ { BIFF12_ID_CONDFORMATTING, BIFF12_ID_CONDFORMATTING + 1 },
+ { BIFF12_ID_CONTROLS, BIFF12_ID_CONTROLS + 2 },
+ { BIFF12_ID_CUSTOMFILTERS, BIFF12_ID_CUSTOMFILTERS + 1 },
+ { BIFF12_ID_CUSTOMSHEETVIEW, BIFF12_ID_CUSTOMSHEETVIEW + 1 },
+ { BIFF12_ID_CUSTOMSHEETVIEWS, BIFF12_ID_CUSTOMSHEETVIEWS + 3 },
+ { BIFF12_ID_DATABAR, BIFF12_ID_DATABAR + 1 },
+ { BIFF12_ID_DATAVALIDATIONS, BIFF12_ID_DATAVALIDATIONS + 1 },
+ { BIFF12_ID_DISCRETEFILTERS, BIFF12_ID_DISCRETEFILTERS + 1 },
+ { BIFF12_ID_FILTERCOLUMN, BIFF12_ID_FILTERCOLUMN + 1 },
+ { BIFF12_ID_HEADERFOOTER, BIFF12_ID_HEADERFOOTER + 1 },
+ { BIFF12_ID_ICONSET, BIFF12_ID_ICONSET + 1 },
+ { BIFF12_ID_MERGECELLS, BIFF12_ID_MERGECELLS + 1 },
+ { BIFF12_ID_OLEOBJECTS, BIFF12_ID_OLEOBJECTS + 2 },
+ { BIFF12_ID_ROW, -1 },
+ { BIFF12_ID_ROWBREAKS, BIFF12_ID_ROWBREAKS + 1 },
+ { BIFF12_ID_SCENARIO, BIFF12_ID_SCENARIO + 1 },
+ { BIFF12_ID_SCENARIOS, BIFF12_ID_SCENARIOS + 1 },
+ { BIFF12_ID_SHEETDATA, BIFF12_ID_SHEETDATA + 1 },
+ { BIFF12_ID_SHEETVIEW, BIFF12_ID_SHEETVIEW + 1 },
+ { BIFF12_ID_SHEETVIEWS, BIFF12_ID_SHEETVIEWS + 1 },
+ { BIFF12_ID_TABLEPARTS, BIFF12_ID_TABLEPARTS + 2 },
+ { BIFF12_ID_WORKSHEET, BIFF12_ID_WORKSHEET + 1 },
{ -1, -1 }
};
return spRecInfos;
}
-void OoxWorksheetFragment::initializeImport()
+void WorksheetFragment::initializeImport()
{
// initial processing in base class WorksheetHelper
initializeWorksheetImport();
// import query table fragments related to this worksheet
- RelationsRef xQueryRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "queryTable" ) );
+ RelationsRef xQueryRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATION_TYPE( "queryTable" ) );
for( Relations::const_iterator aIt = xQueryRels->begin(), aEnd = xQueryRels->end(); aIt != aEnd; ++aIt )
- importOoxFragment( new OoxQueryTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
+ importOoxFragment( new QueryTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
// import pivot table fragments related to this worksheet
- RelationsRef xPivotRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATIONSTYPE( "pivotTable" ) );
+ RelationsRef xPivotRels = getRelations().getRelationsFromType( CREATE_OFFICEDOC_RELATION_TYPE( "pivotTable" ) );
for( Relations::const_iterator aIt = xPivotRels->begin(), aEnd = xPivotRels->end(); aIt != aEnd; ++aIt )
- importOoxFragment( new OoxPivotTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
+ importOoxFragment( new PivotTableFragment( *this, getFragmentPathFromRelation( aIt->second ) ) );
}
-void OoxWorksheetFragment::finalizeImport()
+void WorksheetFragment::finalizeImport()
{
// final processing in base class WorksheetHelper
finalizeWorksheetImport();
@@ -505,13 +507,13 @@ void OoxWorksheetFragment::finalizeImport()
// private --------------------------------------------------------------------
-void OoxWorksheetFragment::importPageSetUpPr( const AttributeList& rAttribs )
+void WorksheetFragment::importPageSetUpPr( const AttributeList& rAttribs )
{
// for whatever reason, this flag is still stored separated from the page settings
getPageSettings().setFitToPagesMode( rAttribs.getBool( XML_fitToPage, false ) );
}
-void OoxWorksheetFragment::importDimension( const AttributeList& rAttribs )
+void WorksheetFragment::importDimension( const AttributeList& rAttribs )
{
CellRangeAddress aRange;
getAddressConverter().convertToCellRangeUnchecked( aRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex() );
@@ -523,7 +525,7 @@ void OoxWorksheetFragment::importDimension( const AttributeList& rAttribs )
extendUsedArea( aRange );
}
-void OoxWorksheetFragment::importSheetFormatPr( const AttributeList& rAttribs )
+void WorksheetFragment::importSheetFormatPr( const AttributeList& rAttribs )
{
// default column settings
setBaseColumnWidth( rAttribs.getInteger( XML_baseColWidth, 8 ) );
@@ -537,7 +539,7 @@ void OoxWorksheetFragment::importSheetFormatPr( const AttributeList& rAttribs )
rAttribs.getBool( XML_thickBottom, false ) );
}
-void OoxWorksheetFragment::importCol( const AttributeList& rAttribs )
+void WorksheetFragment::importCol( const AttributeList& rAttribs )
{
ColumnModel aModel;
aModel.mnFirstCol = rAttribs.getInteger( XML_min, -1 );
@@ -552,14 +554,14 @@ void OoxWorksheetFragment::importCol( const AttributeList& rAttribs )
setColumnModel( aModel );
}
-void OoxWorksheetFragment::importMergeCell( const AttributeList& rAttribs )
+void WorksheetFragment::importMergeCell( const AttributeList& rAttribs )
{
CellRangeAddress aRange;
if( getAddressConverter().convertToCellRange( aRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex(), true, true ) )
setMergedRange( aRange );
}
-void OoxWorksheetFragment::importHyperlink( const AttributeList& rAttribs )
+void WorksheetFragment::importHyperlink( const AttributeList& rAttribs )
{
HyperlinkModel aModel;
if( getAddressConverter().convertToCellRange( aModel.maRange, rAttribs.getString( XML_ref, OUString() ), getSheetIndex(), true, true ) )
@@ -572,7 +574,7 @@ void OoxWorksheetFragment::importHyperlink( const AttributeList& rAttribs )
}
}
-void OoxWorksheetFragment::importBrk( const AttributeList& rAttribs, bool bRowBreak )
+void WorksheetFragment::importBrk( const AttributeList& rAttribs, bool bRowBreak )
{
PageBreakModel aModel;
aModel.mnColRow = rAttribs.getInteger( XML_id, 0 );
@@ -582,22 +584,22 @@ void OoxWorksheetFragment::importBrk( const AttributeList& rAttribs, bool bRowBr
setPageBreak( aModel, bRowBreak );
}
-void OoxWorksheetFragment::importDrawing( const AttributeList& rAttribs )
+void WorksheetFragment::importDrawing( const AttributeList& rAttribs )
{
setDrawingPath( getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ) );
}
-void OoxWorksheetFragment::importLegacyDrawing( const AttributeList& rAttribs )
+void WorksheetFragment::importLegacyDrawing( const AttributeList& rAttribs )
{
setVmlDrawingPath( getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ) );
}
-void OoxWorksheetFragment::importOleObject( const AttributeList& rAttribs )
+void WorksheetFragment::importOleObject( const AttributeList& rAttribs )
{
::oox::vml::OleObjectInfo aInfo;
aInfo.setShapeId( rAttribs.getInteger( XML_shapeId, 0 ) );
OSL_ENSURE( rAttribs.hasAttribute( XML_link ) != rAttribs.hasAttribute( R_TOKEN( id ) ),
- "OoxWorksheetFragment::importOleObject - OLE object must be either linked or embedded" );
+ "WorksheetFragment::importOleObject - OLE object must be either linked or embedded" );
aInfo.mbLinked = rAttribs.hasAttribute( XML_link );
if( aInfo.mbLinked )
aInfo.maTargetLink = getFormulaParser().importOleTargetLink( rAttribs.getString( XML_link, OUString() ) );
@@ -610,7 +612,7 @@ void OoxWorksheetFragment::importOleObject( const AttributeList& rAttribs )
getVmlDrawing().registerOleObject( aInfo );
}
-void OoxWorksheetFragment::importControl( const AttributeList& rAttribs )
+void WorksheetFragment::importControl( const AttributeList& rAttribs )
{
::oox::vml::ControlInfo aInfo;
aInfo.setShapeId( rAttribs.getInteger( XML_shapeId, 0 ) );
@@ -619,7 +621,7 @@ void OoxWorksheetFragment::importControl( const AttributeList& rAttribs )
getVmlDrawing().registerControl( aInfo );
}
-void OoxWorksheetFragment::importDimension( RecordInputStream& rStrm )
+void WorksheetFragment::importDimension( SequenceInputStream& rStrm )
{
BinRange aBinRange;
aBinRange.read( rStrm );
@@ -633,7 +635,7 @@ void OoxWorksheetFragment::importDimension( RecordInputStream& rStrm )
extendUsedArea( aRange );
}
-void OoxWorksheetFragment::importSheetFormatPr( RecordInputStream& rStrm )
+void WorksheetFragment::importSheetFormatPr( SequenceInputStream& rStrm )
{
sal_Int32 nDefaultWidth;
sal_uInt16 nBaseWidth, nDefaultHeight, nFlags;
@@ -641,9 +643,9 @@ void OoxWorksheetFragment::importSheetFormatPr( RecordInputStream& rStrm )
// base column with
setBaseColumnWidth( nBaseWidth );
- // default width is stored as 1/256th of a character in OOBIN, convert to entire character
+ // default width is stored as 1/256th of a character in BIFF12, convert to entire character
setDefaultColumnWidth( static_cast< double >( nDefaultWidth ) / 256.0 );
- // row height is in twips in OOBIN, convert to points; equal flags in BIFF and OOBIN
+ // row height is in twips in BIFF12, convert to points; equal flags in all BIFFs
setDefaultRowSettings(
nDefaultHeight / 20.0,
getFlag( nFlags, BIFF_DEFROW_CUSTOMHEIGHT ),
@@ -652,7 +654,7 @@ void OoxWorksheetFragment::importSheetFormatPr( RecordInputStream& rStrm )
getFlag( nFlags, BIFF_DEFROW_THICKBOTTOM ) );
}
-void OoxWorksheetFragment::importCol( RecordInputStream& rStrm )
+void WorksheetFragment::importCol( SequenceInputStream& rStrm )
{
ColumnModel aModel;
@@ -660,12 +662,12 @@ void OoxWorksheetFragment::importCol( RecordInputStream& rStrm )
sal_uInt16 nFlags;
rStrm >> aModel.mnFirstCol >> aModel.mnLastCol >> nWidth >> aModel.mnXfId >> nFlags;
- // column indexes are 0-based in OOBIN, but ColumnModel expects 1-based
+ // column indexes are 0-based in BIFF12, but ColumnModel expects 1-based
++aModel.mnFirstCol;
++aModel.mnLastCol;
- // width is stored as 1/256th of a character in OOBIN, convert to entire character
+ // width is stored as 1/256th of a character in BIFF12, convert to entire character
aModel.mfWidth = static_cast< double >( nWidth ) / 256.0;
- // equal flags in BIFF and OOBIN
+ // equal flags in all BIFFs
aModel.mnLevel = extractValue< sal_Int32 >( nFlags, 8, 3 );
aModel.mbShowPhonetic = getFlag( nFlags, BIFF_COLINFO_SHOWPHONETIC );
aModel.mbHidden = getFlag( nFlags, BIFF_COLINFO_HIDDEN );
@@ -674,7 +676,7 @@ void OoxWorksheetFragment::importCol( RecordInputStream& rStrm )
setColumnModel( aModel );
}
-void OoxWorksheetFragment::importMergeCell( RecordInputStream& rStrm )
+void WorksheetFragment::importMergeCell( SequenceInputStream& rStrm )
{
BinRange aBinRange;
rStrm >> aBinRange;
@@ -683,20 +685,20 @@ void OoxWorksheetFragment::importMergeCell( RecordInputStream& rStrm )
setMergedRange( aRange );
}
-void OoxWorksheetFragment::importHyperlink( RecordInputStream& rStrm )
+void WorksheetFragment::importHyperlink( SequenceInputStream& rStrm )
{
BinRange aBinRange;
rStrm >> aBinRange;
HyperlinkModel aModel;
if( getAddressConverter().convertToCellRange( aModel.maRange, aBinRange, getSheetIndex(), true, true ) )
{
- aModel.maTarget = getRelations().getExternalTargetFromRelId( rStrm.readString() );
+ aModel.maTarget = getRelations().getExternalTargetFromRelId( BiffHelper::readString( rStrm ) );
rStrm >> aModel.maLocation >> aModel.maTooltip >> aModel.maDisplay;
setHyperlink( aModel );
}
}
-void OoxWorksheetFragment::importBrk( RecordInputStream& rStrm, bool bRowBreak )
+void WorksheetFragment::importBrk( SequenceInputStream& rStrm, bool bRowBreak )
{
PageBreakModel aModel;
sal_Int32 nManual;
@@ -705,44 +707,44 @@ void OoxWorksheetFragment::importBrk( RecordInputStream& rStrm, bool bRowBreak )
setPageBreak( aModel, bRowBreak );
}
-void OoxWorksheetFragment::importDrawing( RecordInputStream& rStrm )
+void WorksheetFragment::importDrawing( SequenceInputStream& rStrm )
{
- setDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) );
+ setDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) );
}
-void OoxWorksheetFragment::importLegacyDrawing( RecordInputStream& rStrm )
+void WorksheetFragment::importLegacyDrawing( SequenceInputStream& rStrm )
{
- setVmlDrawingPath( getFragmentPathFromRelId( rStrm.readString() ) );
+ setVmlDrawingPath( getFragmentPathFromRelId( BiffHelper::readString( rStrm ) ) );
}
-void OoxWorksheetFragment::importOleObject( RecordInputStream& rStrm )
+void WorksheetFragment::importOleObject( SequenceInputStream& rStrm )
{
::oox::vml::OleObjectInfo aInfo;
sal_Int32 nAspect, nUpdateMode, nShapeId;
sal_uInt16 nFlags;
rStrm >> nAspect >> nUpdateMode >> nShapeId >> nFlags >> aInfo.maProgId;
- aInfo.mbLinked = getFlag( nFlags, OOBIN_OLEOBJECT_LINKED );
+ aInfo.mbLinked = getFlag( nFlags, BIFF12_OLEOBJECT_LINKED );
if( aInfo.mbLinked )
aInfo.maTargetLink = getFormulaParser().importOleTargetLink( rStrm );
else
- importEmbeddedOleData( aInfo.maEmbeddedData, rStrm.readString() );
+ importEmbeddedOleData( aInfo.maEmbeddedData, BiffHelper::readString( rStrm ) );
aInfo.setShapeId( nShapeId );
- aInfo.mbShowAsIcon = nAspect == OOBIN_OLEOBJECT_ICON;
- aInfo.mbAutoUpdate = nUpdateMode == OOBIN_OLEOBJECT_ALWAYS;
- aInfo.mbAutoLoad = getFlag( nFlags, OOBIN_OLEOBJECT_AUTOLOAD );
+ aInfo.mbShowAsIcon = nAspect == BIFF12_OLEOBJECT_ICON;
+ aInfo.mbAutoUpdate = nUpdateMode == BIFF12_OLEOBJECT_ALWAYS;
+ aInfo.mbAutoLoad = getFlag( nFlags, BIFF12_OLEOBJECT_AUTOLOAD );
getVmlDrawing().registerOleObject( aInfo );
}
-void OoxWorksheetFragment::importControl( RecordInputStream& rStrm )
+void WorksheetFragment::importControl( SequenceInputStream& rStrm )
{
::oox::vml::ControlInfo aInfo;
aInfo.setShapeId( rStrm.readInt32() );
- aInfo.maFragmentPath = getFragmentPathFromRelId( rStrm.readString() );
+ aInfo.maFragmentPath = getFragmentPathFromRelId( BiffHelper::readString( rStrm ) );
rStrm >> aInfo.maName;
getVmlDrawing().registerControl( aInfo );
}
-void OoxWorksheetFragment::importEmbeddedOleData( StreamDataSequence& orEmbeddedData, const OUString& rRelId )
+void WorksheetFragment::importEmbeddedOleData( StreamDataSequence& orEmbeddedData, const OUString& rRelId )
{
OUString aFragmentPath = getFragmentPathFromRelId( rRelId );
if( aFragmentPath.getLength() > 0 )
@@ -751,8 +753,9 @@ void OoxWorksheetFragment::importEmbeddedOleData( StreamDataSequence& orEmbedded
// ============================================================================
-BiffWorksheetFragment::BiffWorksheetFragment( const BiffWorkbookFragmentBase& rParent, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
- BiffWorksheetFragmentBase( rParent, xProgressBar, eSheetType, nSheet )
+BiffWorksheetFragment::BiffWorksheetFragment( const BiffWorkbookFragmentBase& rParent,
+ const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+ BiffWorksheetFragmentBase( rParent, rxProgressBar, eSheetType, nSheet )
{
}
@@ -775,9 +778,10 @@ bool BiffWorksheetFragment::importFragment()
PageSettings& rPageSett = getPageSettings();
// process all record in this sheet fragment
- while( mrStrm.startNextRecord() && (mrStrm.getRecId() != BIFF_ID_EOF) )
+ BiffInputStream& rStrm = getInputStream();
+ while( rStrm.startNextRecord() && (rStrm.getRecId() != BIFF_ID_EOF) )
{
- if( isBofRecord() )
+ if( BiffHelper::isBofRecord( rStrm ) )
{
// skip unknown embedded fragments (BOF/EOF blocks)
skipFragment();
@@ -785,126 +789,130 @@ bool BiffWorksheetFragment::importFragment()
else
{
// cache base stream position to detect if record is already processed
- sal_Int64 nStrmPos = mrStrm.tellBase();
- sal_uInt16 nRecId = mrStrm.getRecId();
+ sal_Int64 nStrmPos = rStrm.tellBase();
+ sal_uInt16 nRecId = rStrm.getRecId();
switch( nRecId )
{
// records in all BIFF versions
- case BIFF_ID_BOTTOMMARGIN: rPageSett.importBottomMargin( mrStrm ); break;
- case BIFF_ID_CALCCOUNT: rWorkbookSett.importCalcCount( mrStrm ); break;
- case BIFF_ID_CALCMODE: rWorkbookSett.importCalcMode( mrStrm ); break;
- case BIFF_ID_DEFCOLWIDTH: importDefColWidth(); break;
- case BIFF_ID_DELTA: rWorkbookSett.importDelta( mrStrm ); break;
- case BIFF2_ID_DIMENSION: importDimension(); break;
- case BIFF3_ID_DIMENSION: importDimension(); break;
- case BIFF_ID_FOOTER: rPageSett.importFooter( mrStrm ); break;
- case BIFF_ID_HEADER: rPageSett.importHeader( mrStrm ); break;
- case BIFF_ID_HORPAGEBREAKS: importPageBreaks( true ); break;
- case BIFF_ID_ITERATION: rWorkbookSett.importIteration( mrStrm ); break;
- case BIFF_ID_LEFTMARGIN: rPageSett.importLeftMargin( mrStrm ); break;
- case BIFF_ID_PANE: rSheetViewSett.importPane( mrStrm ); break;
- case BIFF_ID_PASSWORD: rWorksheetSett.importPassword( mrStrm ); break;
- case BIFF_ID_PRINTGRIDLINES: rPageSett.importPrintGridLines( mrStrm ); break;
- case BIFF_ID_PRINTHEADERS: rPageSett.importPrintHeaders( mrStrm ); break;
- case BIFF_ID_PROTECT: rWorksheetSett.importProtect( mrStrm ); break;
- case BIFF_ID_REFMODE: rWorkbookSett.importRefMode( mrStrm ); break;
- case BIFF_ID_RIGHTMARGIN: rPageSett.importRightMargin( mrStrm ); break;
- case BIFF_ID_SELECTION: rSheetViewSett.importSelection( mrStrm ); break;
- case BIFF_ID_TOPMARGIN: rPageSett.importTopMargin( mrStrm ); break;
- case BIFF_ID_VERPAGEBREAKS: importPageBreaks( false ); break;
+ case BIFF_ID_BOTTOMMARGIN: rPageSett.importBottomMargin( rStrm ); break;
+ case BIFF_ID_CALCCOUNT: rWorkbookSett.importCalcCount( rStrm ); break;
+ case BIFF_ID_CALCMODE: rWorkbookSett.importCalcMode( rStrm ); break;
+ case BIFF_ID_DEFCOLWIDTH: importDefColWidth( rStrm ); break;
+ case BIFF_ID_DELTA: rWorkbookSett.importDelta( rStrm ); break;
+ case BIFF2_ID_DIMENSION: importDimension( rStrm ); break;
+ case BIFF3_ID_DIMENSION: importDimension( rStrm ); break;
+ case BIFF_ID_FOOTER: rPageSett.importFooter( rStrm ); break;
+ case BIFF_ID_HEADER: rPageSett.importHeader( rStrm ); break;
+ case BIFF_ID_HORPAGEBREAKS: importPageBreaks( rStrm, true ); break;
+ case BIFF_ID_ITERATION: rWorkbookSett.importIteration( rStrm ); break;
+ case BIFF_ID_LEFTMARGIN: rPageSett.importLeftMargin( rStrm ); break;
+ case BIFF_ID_PANE: rSheetViewSett.importPane( rStrm ); break;
+ case BIFF_ID_PASSWORD: rWorksheetSett.importPassword( rStrm ); break;
+ case BIFF_ID_PRINTGRIDLINES: rPageSett.importPrintGridLines( rStrm ); break;
+ case BIFF_ID_PRINTHEADERS: rPageSett.importPrintHeaders( rStrm ); break;
+ case BIFF_ID_PROTECT: rWorksheetSett.importProtect( rStrm ); break;
+ case BIFF_ID_REFMODE: rWorkbookSett.importRefMode( rStrm ); break;
+ case BIFF_ID_RIGHTMARGIN: rPageSett.importRightMargin( rStrm ); break;
+ case BIFF_ID_SELECTION: rSheetViewSett.importSelection( rStrm ); break;
+ case BIFF_ID_TOPMARGIN: rPageSett.importTopMargin( rStrm ); break;
+ case BIFF_ID_VERPAGEBREAKS: importPageBreaks( rStrm, false ); break;
// BIFF specific records
default: switch( getBiff() )
{
case BIFF2: switch( nRecId )
{
- case BIFF_ID_COLUMNDEFAULT: importColumnDefault(); break;
- case BIFF_ID_COLWIDTH: importColWidth(); break;
- case BIFF2_ID_DEFROWHEIGHT: importDefRowHeight(); break;
- case BIFF2_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_COLUMNDEFAULT: importColumnDefault( rStrm ); break;
+ case BIFF_ID_COLWIDTH: importColWidth( rStrm ); break;
+ case BIFF2_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
+ case BIFF2_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF3: switch( nRecId )
{
- case BIFF_ID_COLINFO: importColInfo(); break;
- case BIFF_ID_DEFCOLWIDTH: importDefColWidth(); break;
- case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight(); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( mrStrm ); break;
- case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( mrStrm ); break;
- case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_COLINFO: importColInfo( rStrm ); break;
+ case BIFF_ID_DEFCOLWIDTH: importDefColWidth( rStrm ); break;
+ case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( rStrm ); break;
+ case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( rStrm ); break;
+ case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF4: switch( nRecId )
{
- case BIFF_ID_COLINFO: importColInfo(); break;
- case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight(); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( mrStrm ); break;
- case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( mrStrm ); break;
- case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( mrStrm ); break;
- case BIFF_ID_STANDARDWIDTH: importStandardWidth(); break;
- case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_COLINFO: importColInfo( rStrm ); break;
+ case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
+ case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( rStrm ); break;
+ case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( rStrm ); break;
+ case BIFF_ID_STANDARDWIDTH: importStandardWidth( rStrm ); break;
+ case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF5: switch( nRecId )
{
- case BIFF_ID_COLINFO: importColInfo(); break;
- case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight(); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_MERGEDCELLS: importMergedCells(); break; // #i62300# also in BIFF5
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( mrStrm ); break;
- case BIFF_ID_PTDEFINITION: importPTDefinition(); break;
- case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( mrStrm ); break;
- case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( mrStrm ); break;
- case BIFF_ID_SCL: rSheetViewSett.importScl( mrStrm ); break;
- case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( mrStrm ); break;
- case BIFF_ID_STANDARDWIDTH: importStandardWidth(); break;
- case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_AUTOFILTER: importAutoFilter( rStrm ); break;
+ case BIFF_ID_COLINFO: importColInfo( rStrm ); break;
+ case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_MERGEDCELLS: importMergedCells( rStrm ); break; // #i62300# also in BIFF5
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
+ case BIFF_ID_PTDEFINITION: importPTDefinition( rStrm ); break;
+ case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( rStrm ); break;
+ case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( rStrm ); break;
+ case BIFF_ID_SCL: rSheetViewSett.importScl( rStrm ); break;
+ case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( rStrm ); break;
+ case BIFF_ID_STANDARDWIDTH: importStandardWidth( rStrm ); break;
+ case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
case BIFF8: switch( nRecId )
{
- case BIFF_ID_CFHEADER: rCondFormats.importCfHeader( mrStrm ); break;
- case BIFF_ID_CODENAME: rWorksheetSett.importCodeName( mrStrm ); break;
- case BIFF_ID_COLINFO: importColInfo(); break;
- case BIFF_ID_DATAVALIDATION: importDataValidation(); break;
- case BIFF_ID_DATAVALIDATIONS: importDataValidations(); break;
- case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight(); break;
- case BIFF_ID_HCENTER: rPageSett.importHorCenter( mrStrm ); break;
- case BIFF_ID_HYPERLINK: importHyperlink(); break;
- case BIFF_ID_LABELRANGES: importLabelRanges(); break;
- case BIFF_ID_MERGEDCELLS: importMergedCells(); break;
- case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( mrStrm ); break;
- case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( mrStrm ); break;
- case BIFF_ID_PHONETICPR: rWorksheetSett.importPhoneticPr( mrStrm ); break;
- case BIFF_ID_PICTURE: rPageSett.importPicture( mrStrm ); break;
- case BIFF_ID_PTDEFINITION: importPTDefinition(); break;
- case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( mrStrm ); break;
- case BIFF_ID_SCENARIOS: importScenarios(); break;
- case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( mrStrm ); break;
- case BIFF_ID_SCL: rSheetViewSett.importScl( mrStrm ); break;
- case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( mrStrm ); break;
- case BIFF_ID_SHAREDFEATHEAD: importSharedFeatHead(); break;
- case BIFF_ID_STANDARDWIDTH: importStandardWidth(); break;
- case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( mrStrm ); break;
- case BIFF_ID_VCENTER: rPageSett.importVerCenter( mrStrm ); break;
- case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( mrStrm ); break;
+ case BIFF_ID_AUTOFILTER: importAutoFilter( rStrm ); break;
+ case BIFF_ID_CFHEADER: rCondFormats.importCfHeader( rStrm ); break;
+ case BIFF_ID_CODENAME: rWorksheetSett.importCodeName( rStrm ); break;
+ case BIFF_ID_COLINFO: importColInfo( rStrm ); break;
+ case BIFF_ID_DATAVALIDATION: importDataValidation( rStrm ); break;
+ case BIFF_ID_DATAVALIDATIONS: importDataValidations( rStrm ); break;
+ case BIFF3_ID_DEFROWHEIGHT: importDefRowHeight( rStrm ); break;
+ case BIFF_ID_HCENTER: rPageSett.importHorCenter( rStrm ); break;
+ case BIFF_ID_HYPERLINK: importHyperlink( rStrm ); break;
+ case BIFF_ID_LABELRANGES: importLabelRanges( rStrm ); break;
+ case BIFF_ID_MERGEDCELLS: importMergedCells( rStrm ); break;
+ case BIFF_ID_OBJECTPROTECT: rWorksheetSett.importObjectProtect( rStrm ); break;
+ case BIFF_ID_PAGESETUP: rPageSett.importPageSetup( rStrm ); break;
+ case BIFF_ID_PHONETICPR: rWorksheetSett.importPhoneticPr( rStrm ); break;
+ case BIFF_ID_PICTURE: rPageSett.importPicture( rStrm ); break;
+ case BIFF_ID_PTDEFINITION: importPTDefinition( rStrm ); break;
+ case BIFF_ID_QUERYTABLE: importQueryTable( rStrm ); break;
+ case BIFF_ID_SAVERECALC: rWorkbookSett.importSaveRecalc( rStrm ); break;
+ case BIFF_ID_SCENARIOS: importScenarios( rStrm ); break;
+ case BIFF_ID_SCENPROTECT: rWorksheetSett.importScenProtect( rStrm ); break;
+ case BIFF_ID_SCL: rSheetViewSett.importScl( rStrm ); break;
+ case BIFF_ID_SHEETEXT: rWorksheetSett.importSheetExt( rStrm ); break;
+ case BIFF_ID_SHEETPR: rWorksheetSett.importSheetPr( rStrm ); break;
+ case BIFF_ID_SHAREDFEATHEAD: importSharedFeatHead( rStrm ); break;
+ case BIFF_ID_STANDARDWIDTH: importStandardWidth( rStrm ); break;
+ case BIFF_ID_UNCALCED: rWorkbookSett.importUncalced( rStrm ); break;
+ case BIFF_ID_VCENTER: rPageSett.importVerCenter( rStrm ); break;
+ case BIFF3_ID_WINDOW2: rSheetViewSett.importWindow2( rStrm ); break;
}
break;
@@ -912,26 +920,41 @@ bool BiffWorksheetFragment::importFragment()
}
}
- // record not processed, try cell records
- if( mrStrm.tellBase() == nStrmPos )
- aSheetData.importRecord();
- // record still not processed, try pivot table records
- if( mxPTContext.get() && (mrStrm.tellBase() == nStrmPos) )
- mxPTContext->importRecord();
+ // record not processed, try record context objects
+ if( rStrm.tellBase() == nStrmPos )
+ {
+ // first, try cell table records
+ aSheetData.importRecord( rStrm );
+ // handle another open record context
+ if( mxContext.get() )
+ {
+ // if it was a cell table record, forget the other record context
+ if( rStrm.tellBase() == nStrmPos )
+ mxContext->importRecord( rStrm );
+ else
+ mxContext.reset();
+ }
+ }
}
}
// final processing in base class WorksheetHelper
finalizeWorksheetImport();
- return mrStrm.getRecId() == BIFF_ID_EOF;
+ return rStrm.getRecId() == BIFF_ID_EOF;
}
// private --------------------------------------------------------------------
-void BiffWorksheetFragment::importColInfo()
+void BiffWorksheetFragment::importAutoFilter( BiffInputStream& rStrm )
+{
+ mxContext.reset( new BiffAutoFilterContext( *this, getAutoFilters().createAutoFilter() ) );
+ mxContext->importRecord( rStrm );
+}
+
+void BiffWorksheetFragment::importColInfo( BiffInputStream& rStrm )
{
sal_uInt16 nFirstCol, nLastCol, nWidth, nXfId, nFlags;
- mrStrm >> nFirstCol >> nLastCol >> nWidth >> nXfId >> nFlags;
+ rStrm >> nFirstCol >> nLastCol >> nWidth >> nXfId >> nFlags;
ColumnModel aModel;
// column indexes are 0-based in BIFF, but ColumnModel expects 1-based
@@ -948,18 +971,18 @@ void BiffWorksheetFragment::importColInfo()
setColumnModel( aModel );
}
-void BiffWorksheetFragment::importColumnDefault()
+void BiffWorksheetFragment::importColumnDefault( BiffInputStream& rStrm )
{
sal_uInt16 nFirstCol, nLastCol, nXfId;
- mrStrm >> nFirstCol >> nLastCol >> nXfId;
+ rStrm >> nFirstCol >> nLastCol >> nXfId;
setDefaultColumnFormat( nFirstCol, nLastCol, nXfId );
}
-void BiffWorksheetFragment::importColWidth()
+void BiffWorksheetFragment::importColWidth( BiffInputStream& rStrm )
{
sal_uInt8 nFirstCol, nLastCol;
sal_uInt16 nWidth;
- mrStrm >> nFirstCol >> nLastCol >> nWidth;
+ rStrm >> nFirstCol >> nLastCol >> nWidth;
ColumnModel aModel;
// column indexes are 0-based in BIFF, but ColumnModel expects 1-based
@@ -971,20 +994,20 @@ void BiffWorksheetFragment::importColWidth()
setColumnModel( aModel );
}
-void BiffWorksheetFragment::importDefColWidth()
+void BiffWorksheetFragment::importDefColWidth( BiffInputStream& rStrm )
{
/* Stored as entire number of characters without padding pixels, which
will be added in setBaseColumnWidth(). Call has no effect, if a
width has already been set from the STANDARDWIDTH record. */
- setBaseColumnWidth( mrStrm.readuInt16() );
+ setBaseColumnWidth( rStrm.readuInt16() );
}
-void BiffWorksheetFragment::importDefRowHeight()
+void BiffWorksheetFragment::importDefRowHeight( BiffInputStream& rStrm )
{
sal_uInt16 nFlags = BIFF_DEFROW_CUSTOMHEIGHT, nHeight;
if( getBiff() != BIFF2 )
- mrStrm >> nFlags;
- mrStrm >> nHeight;
+ rStrm >> nFlags;
+ rStrm >> nHeight;
if( getBiff() == BIFF2 )
nHeight &= BIFF2_DEFROW_MASK;
// row height is in twips in BIFF, convert to points
@@ -996,11 +1019,11 @@ void BiffWorksheetFragment::importDefRowHeight()
getFlag( nFlags, BIFF_DEFROW_THICKBOTTOM ) );
}
-void BiffWorksheetFragment::importDataValidations()
+void BiffWorksheetFragment::importDataValidations( BiffInputStream& rStrm )
{
sal_Int32 nObjId;
- mrStrm.skip( 10 );
- mrStrm >> nObjId;
+ rStrm.skip( 10 );
+ rStrm >> nObjId;
//! TODO: invalidate object id in drawing object manager
}
@@ -1027,50 +1050,50 @@ ApiTokenSequence lclReadDataValFormula( BiffInputStream& rStrm, FormulaParser& r
} // namespace
-void BiffWorksheetFragment::importDataValidation()
+void BiffWorksheetFragment::importDataValidation( BiffInputStream& rStrm )
{
ValidationModel aModel;
// flags
sal_uInt32 nFlags;
- mrStrm >> nFlags;
- aModel.setBinType( extractValue< sal_uInt8 >( nFlags, 0, 4 ) );
- aModel.setBinOperator( extractValue< sal_uInt8 >( nFlags, 20, 4 ) );
- aModel.setBinErrorStyle( extractValue< sal_uInt8 >( nFlags, 4, 3 ) );
+ rStrm >> nFlags;
+ aModel.setBiffType( extractValue< sal_uInt8 >( nFlags, 0, 4 ) );
+ aModel.setBiffOperator( extractValue< sal_uInt8 >( nFlags, 20, 4 ) );
+ aModel.setBiffErrorStyle( extractValue< sal_uInt8 >( nFlags, 4, 3 ) );
aModel.mbAllowBlank = getFlag( nFlags, BIFF_DATAVAL_ALLOWBLANK );
aModel.mbNoDropDown = getFlag( nFlags, BIFF_DATAVAL_NODROPDOWN );
aModel.mbShowInputMsg = getFlag( nFlags, BIFF_DATAVAL_SHOWINPUT );
aModel.mbShowErrorMsg = getFlag( nFlags, BIFF_DATAVAL_SHOWERROR );
// message strings
- aModel.maInputTitle = lclReadDataValMessage( mrStrm );
- aModel.maErrorTitle = lclReadDataValMessage( mrStrm );
- aModel.maInputMessage = lclReadDataValMessage( mrStrm );
- aModel.maErrorMessage = lclReadDataValMessage( mrStrm );
+ aModel.maInputTitle = lclReadDataValMessage( rStrm );
+ aModel.maErrorTitle = lclReadDataValMessage( rStrm );
+ aModel.maInputMessage = lclReadDataValMessage( rStrm );
+ aModel.maErrorMessage = lclReadDataValMessage( rStrm );
// condition formula(s)
FormulaParser& rParser = getFormulaParser();
- aModel.maTokens1 = lclReadDataValFormula( mrStrm, rParser );
- aModel.maTokens2 = lclReadDataValFormula( mrStrm, rParser );
+ aModel.maTokens1 = lclReadDataValFormula( rStrm, rParser );
+ aModel.maTokens2 = lclReadDataValFormula( rStrm, rParser );
// process string list of a list validation (convert to list of string tokens)
if( (aModel.mnType == XML_list) && getFlag( nFlags, BIFF_DATAVAL_STRINGLIST ) )
rParser.convertStringToStringList( aModel.maTokens1, '\0', true );
// cell range list
BinRangeList aRanges;
- mrStrm >> aRanges;
+ rStrm >> aRanges;
getAddressConverter().convertToCellRangeList( aModel.maRanges, aRanges, getSheetIndex(), true );
// set validation data
setValidation( aModel );
}
-void BiffWorksheetFragment::importDimension()
+void BiffWorksheetFragment::importDimension( BiffInputStream& rStrm )
{
// 32-bit row indexes in BIFF8
- bool bInt32Rows = (mrStrm.getRecId() == BIFF3_ID_DIMENSION) && (getBiff() == BIFF8);
+ bool bInt32Rows = (rStrm.getRecId() == BIFF3_ID_DIMENSION) && (getBiff() == BIFF8);
BinRange aBinRange;
- aBinRange.read( mrStrm, true, bInt32Rows );
+ aBinRange.read( rStrm, true, bInt32Rows );
/* BIFF stores the used area with end column and end row increased by 1
(first unused column and row). */
if( (aBinRange.maFirst.mnCol < aBinRange.maLast.mnCol) && (aBinRange.maFirst.mnRow < aBinRange.maLast.mnRow) )
@@ -1084,13 +1107,13 @@ void BiffWorksheetFragment::importDimension()
}
}
-void BiffWorksheetFragment::importHyperlink()
+void BiffWorksheetFragment::importHyperlink( BiffInputStream& rStrm )
{
HyperlinkModel aModel;
// read cell range for the hyperlink
BinRange aBiffRange;
- mrStrm >> aBiffRange;
+ rStrm >> aBiffRange;
// #i80006# Excel silently ignores invalid hi-byte of column index (TODO: everywhere?)
aBiffRange.maFirst.mnCol &= 0xFF;
aBiffRange.maLast.mnCol &= 0xFF;
@@ -1098,15 +1121,15 @@ void BiffWorksheetFragment::importHyperlink()
return;
// try to read the StdHlink data
- if( !::oox::ole::OleHelper::importStdHlink( aModel, mrStrm, true ) )
+ if( !::oox::ole::OleHelper::importStdHlink( aModel, rStrm, true ) )
return;
// try to read the optional following SCREENTIP record
- if( (mrStrm.getNextRecId() == BIFF_ID_SCREENTIP) && mrStrm.startNextRecord() )
+ if( (rStrm.getNextRecId() == BIFF_ID_SCREENTIP) && rStrm.startNextRecord() )
{
- mrStrm.skip( 2 ); // repeated record id
+ rStrm.skip( 2 ); // repeated record id
// the cell range, again
- mrStrm >> aBiffRange;
+ rStrm >> aBiffRange;
CellRangeAddress aRange;
if( getAddressConverter().convertToCellRange( aRange, aBiffRange, getSheetIndex(), true, true ) &&
(aRange.StartColumn == aModel.maRange.StartColumn) &&
@@ -1116,7 +1139,7 @@ void BiffWorksheetFragment::importHyperlink()
{
/* This time, we have no string length, no flag field, and a
null-terminated 16-bit character array. */
- aModel.maTooltip = mrStrm.readNulUnicodeArray();
+ aModel.maTooltip = rStrm.readNulUnicodeArray();
}
}
@@ -1124,72 +1147,78 @@ void BiffWorksheetFragment::importHyperlink()
setHyperlink( aModel );
}
-void BiffWorksheetFragment::importLabelRanges()
+void BiffWorksheetFragment::importLabelRanges( BiffInputStream& rStrm )
{
BinRangeList aBiffRowRanges, aBiffColRanges;
- mrStrm >> aBiffRowRanges >> aBiffColRanges;
+ rStrm >> aBiffRowRanges >> aBiffColRanges;
ApiCellRangeList aColRanges, aRowRanges;
getAddressConverter().convertToCellRangeList( aColRanges, aBiffColRanges, getSheetIndex(), true );
getAddressConverter().convertToCellRangeList( aRowRanges, aBiffRowRanges, getSheetIndex(), true );
setLabelRanges( aColRanges, aRowRanges );
}
-void BiffWorksheetFragment::importMergedCells()
+void BiffWorksheetFragment::importMergedCells( BiffInputStream& rStrm )
{
BinRangeList aBiffRanges;
- mrStrm >> aBiffRanges;
+ rStrm >> aBiffRanges;
ApiCellRangeList aRanges;
getAddressConverter().convertToCellRangeList( aRanges, aBiffRanges, getSheetIndex(), true );
for( ApiCellRangeList::const_iterator aIt = aRanges.begin(), aEnd = aRanges.end(); aIt != aEnd; ++aIt )
setMergedRange( *aIt );
}
-void BiffWorksheetFragment::importPageBreaks( bool bRowBreak )
+void BiffWorksheetFragment::importPageBreaks( BiffInputStream& rStrm, bool bRowBreak )
{
PageBreakModel aModel;
aModel.mbManual = true; // only manual breaks stored in BIFF
bool bBiff8 = getBiff() == BIFF8; // skip start/end columns or rows in BIFF8
sal_uInt16 nCount;
- mrStrm >> nCount;
- for( sal_uInt16 nIndex = 0; !mrStrm.isEof() && (nIndex < nCount); ++nIndex )
+ rStrm >> nCount;
+ for( sal_uInt16 nIndex = 0; !rStrm.isEof() && (nIndex < nCount); ++nIndex )
{
- aModel.mnColRow = mrStrm.readuInt16();
+ aModel.mnColRow = rStrm.readuInt16();
setPageBreak( aModel, bRowBreak );
if( bBiff8 )
- mrStrm.skip( 4 );
+ rStrm.skip( 4 );
}
}
-void BiffWorksheetFragment::importPTDefinition()
+void BiffWorksheetFragment::importPTDefinition( BiffInputStream& rStrm )
+{
+ mxContext.reset( new BiffPivotTableContext( *this ) );
+ mxContext->importRecord( rStrm );
+}
+
+void BiffWorksheetFragment::importQueryTable( BiffInputStream& rStrm )
{
- mxPTContext.reset( new BiffPivotTableContext( *this, getPivotTables().createPivotTable() ) );
- mxPTContext->importRecord();
+ mxContext.reset( new BiffQueryTableContext( *this ) );
+ mxContext->importRecord( rStrm );
}
-void BiffWorksheetFragment::importScenarios()
+void BiffWorksheetFragment::importScenarios( BiffInputStream& rStrm )
{
- getScenarios().createSheetScenarios( getSheetIndex() ).importScenarios( mrStrm );
+ getScenarios().createSheetScenarios( getSheetIndex() ).importScenarios( rStrm );
}
-void BiffWorksheetFragment::importSharedFeatHead()
+void BiffWorksheetFragment::importSharedFeatHead( BiffInputStream& rStrm )
{
- mrStrm.skip( 12 );
- sal_uInt16 nType = mrStrm.readuInt16();
- mrStrm.skip( 5 );
+ rStrm.skip( 12 );
+ sal_uInt16 nType = rStrm.readuInt16();
+ rStrm.skip( 5 );
switch( nType )
{
case BIFF_SHRFEATHEAD_SHEETPROT:
- if( mrStrm.getRemaining() >= 4 )
- getWorksheetSettings().importSheetProtection( mrStrm );
+ if( rStrm.getRemaining() >= 4 )
+ getWorksheetSettings().importSheetProtection( rStrm );
break;
}
}
-void BiffWorksheetFragment::importStandardWidth()
+void BiffWorksheetFragment::importStandardWidth( BiffInputStream& rStrm )
{
sal_uInt16 nWidth;
- mrStrm >> nWidth;
+ rStrm >> nWidth;
// width is stored as 1/256th of a character in BIFF, convert to entire character
double fWidth = static_cast< double >( nWidth ) / 256.0;
// set as default width, will override the width from DEFCOLWIDTH record
@@ -1201,4 +1230,4 @@ void BiffWorksheetFragment::importStandardWidth()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx
index 48757b0c81a4..d644b80c8a2b 100644
--- a/oox/source/xls/worksheethelper.cxx
+++ b/oox/source/xls/worksheethelper.cxx
@@ -27,10 +27,10 @@
************************************************************************/
#include "oox/xls/worksheethelper.hxx"
+
#include <algorithm>
-#include <utility>
#include <list>
-#include <rtl/ustrbuf.hxx>
+#include <utility>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
@@ -38,33 +38,35 @@
#include <com/sun/star/sheet/TableValidationVisibility.hpp>
#include <com/sun/star/sheet/ValidationType.hpp>
#include <com/sun/star/sheet/ValidationAlertStyle.hpp>
-#include <com/sun/star/sheet/XSpreadsheet.hpp>
-#include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
-#include <com/sun/star/sheet/XSheetCondition2.hpp>
#include <com/sun/star/sheet/XCellAddressable.hpp>
#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
#include <com/sun/star/sheet/XFormulaTokens.hpp>
+#include <com/sun/star/sheet/XLabelRanges.hpp>
#include <com/sun/star/sheet/XMultiFormulaTokens.hpp>
-#include <com/sun/star/sheet/XSheetOutline.hpp>
#include <com/sun/star/sheet/XMultipleOperation.hpp>
-#include <com/sun/star/sheet/XLabelRanges.hpp>
+#include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
+#include <com/sun/star/sheet/XSheetCondition.hpp>
+#include <com/sun/star/sheet/XSheetOutline.hpp>
+#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/table/XColumnRowRange.hpp>
+#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/util/NumberFormat.hpp>
#include <com/sun/star/util/XMergeable.hpp>
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/util/XNumberFormatTypes.hpp>
-#include "properties.hxx"
-#include "tokens.hxx"
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <rtl/ustrbuf.hxx>
+#include "oox/core/filterbase.hxx"
#include "oox/helper/containerhelper.hxx"
#include "oox/helper/propertyset.hxx"
-#include "oox/core/filterbase.hxx"
#include "oox/xls/addressconverter.hxx"
+#include "oox/xls/autofilterbuffer.hxx"
#include "oox/xls/commentsbuffer.hxx"
#include "oox/xls/condformatbuffer.hxx"
#include "oox/xls/drawingfragment.hxx"
#include "oox/xls/formulaparser.hxx"
#include "oox/xls/pagesettings.hxx"
+#include "oox/xls/querytablebuffer.hxx"
#include "oox/xls/sharedformulabuffer.hxx"
#include "oox/xls/sharedstringsbuffer.hxx"
#include "oox/xls/stylesbuffer.hxx"
@@ -74,71 +76,42 @@
#include "oox/xls/worksheetbuffer.hxx"
#include "oox/xls/worksheetsettings.hxx"
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-using ::com::sun::star::awt::Point;
-using ::com::sun::star::awt::Rectangle;
-using ::com::sun::star::awt::Size;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::drawing::XDrawPage;
-using ::com::sun::star::drawing::XDrawPageSupplier;
-using ::com::sun::star::lang::Locale;
-using ::com::sun::star::lang::XMultiServiceFactory;
-using ::com::sun::star::sheet::ValidationType;
-using ::com::sun::star::sheet::ValidationAlertStyle;
-using ::com::sun::star::sheet::XCellAddressable;
-using ::com::sun::star::sheet::XCellRangeAddressable;
-using ::com::sun::star::sheet::XFormulaTokens;
-using ::com::sun::star::sheet::XLabelRanges;
-using ::com::sun::star::sheet::XMultiFormulaTokens;
-using ::com::sun::star::sheet::XMultipleOperation;
-using ::com::sun::star::sheet::XSheetCellRangeContainer;
-using ::com::sun::star::sheet::XSheetCellRanges;
-using ::com::sun::star::sheet::XSheetCondition2;
-using ::com::sun::star::sheet::XSheetOutline;
-using ::com::sun::star::sheet::XSpreadsheet;
-using ::com::sun::star::table::BorderLine;
-using ::com::sun::star::table::CellAddress;
-using ::com::sun::star::table::CellRangeAddress;
-using ::com::sun::star::table::XCell;
-using ::com::sun::star::table::XCellRange;
-using ::com::sun::star::table::XColumnRowRange;
-using ::com::sun::star::table::XTableColumns;
-using ::com::sun::star::table::XTableRows;
-using ::com::sun::star::text::XText;
-using ::com::sun::star::text::XTextContent;
-using ::com::sun::star::text::XTextRange;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::uno::UNO_SET_THROW;
-using ::com::sun::star::util::DateTime;
-using ::com::sun::star::util::XMergeable;
-using ::com::sun::star::util::XNumberFormatsSupplier;
-using ::com::sun::star::util::XNumberFormatTypes;
-
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::awt;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sheet;
+using namespace ::com::sun::star::table;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+// ============================================================================
+
namespace {
-void lclUpdateProgressBar( ISegmentProgressBarRef xProgressBar, const CellRangeAddress& rUsedArea, sal_Int32 nRow )
+void lclUpdateProgressBar( const ISegmentProgressBarRef& rxProgressBar, const CellRangeAddress& rUsedArea, sal_Int32 nRow )
{
- if( xProgressBar.get() && (rUsedArea.StartRow <= nRow) && (nRow <= rUsedArea.EndRow) )
+ if( rxProgressBar.get() && (rUsedArea.StartRow <= nRow) && (nRow <= rUsedArea.EndRow) )
{
double fPosition = static_cast< double >( nRow - rUsedArea.StartRow + 1 ) / (rUsedArea.EndRow - rUsedArea.StartRow + 1);
- if( xProgressBar->getPosition() < fPosition )
- xProgressBar->setPosition( fPosition );
+ if( rxProgressBar->getPosition() < fPosition )
+ rxProgressBar->setPosition( fPosition );
}
}
-void lclUpdateProgressBar( ISegmentProgressBarRef xProgressBar, double fPosition )
+void lclUpdateProgressBar( const ISegmentProgressBarRef& rxProgressBar, double fPosition )
{
- if( xProgressBar.get() )
- xProgressBar->setPosition( fPosition );
+ if( rxProgressBar.get() )
+ rxProgressBar->setPosition( fPosition );
}
// ----------------------------------------------------------------------------
@@ -328,14 +301,14 @@ ValidationModel::ValidationModel() :
{
}
-void ValidationModel::setBinType( sal_uInt8 nType )
+void ValidationModel::setBiffType( sal_uInt8 nType )
{
static const sal_Int32 spnTypeIds[] = {
XML_none, XML_whole, XML_decimal, XML_list, XML_date, XML_time, XML_textLength, XML_custom };
mnType = STATIC_ARRAY_SELECT( spnTypeIds, nType, XML_none );
}
-void ValidationModel::setBinOperator( sal_uInt8 nOperator )
+void ValidationModel::setBiffOperator( sal_uInt8 nOperator )
{
static const sal_Int32 spnOperators[] = {
XML_between, XML_notBetween, XML_equal, XML_notEqual,
@@ -343,7 +316,7 @@ void ValidationModel::setBinOperator( sal_uInt8 nOperator )
mnOperator = STATIC_ARRAY_SELECT( spnOperators, nOperator, XML_TOKEN_INVALID );
}
-void ValidationModel::setBinErrorStyle( sal_uInt8 nErrorStyle )
+void ValidationModel::setBiffErrorStyle( sal_uInt8 nErrorStyle )
{
static const sal_Int32 spnErrorStyles[] = { XML_stop, XML_warning, XML_information };
mnErrorStyle = STATIC_ARRAY_SELECT( spnErrorStyles, nErrorStyle, XML_stop );
@@ -357,7 +330,7 @@ class WorksheetData : public WorkbookHelper
public:
explicit WorksheetData(
const WorkbookHelper& rHelper,
- ISegmentProgressBarRef xProgressBar,
+ const ISegmentProgressBarRef& rxProgressBar,
WorksheetType eSheetType,
sal_Int16 nSheet );
@@ -415,11 +388,15 @@ public:
inline CondFormatBuffer& getCondFormats() { return maCondFormats; }
/** Returns the buffer for all cell comments in this sheet. */
inline CommentsBuffer& getComments() { return maComments; }
+ /** Returns the auto filters for the sheet. */
+ inline AutoFilterBuffer& getAutoFilters() { return maAutoFilters; }
+ /** Returns the buffer for all web query tables in this sheet. */
+ inline QueryTableBuffer& getQueryTables() { return maQueryTables; }
/** Returns the page/print settings for this sheet. */
inline PageSettings& getPageSettings() { return maPageSett; }
/** Returns the view settings for this sheet. */
inline SheetViewSettings& getSheetViewSettings() { return maSheetViewSett; }
- /** Returns the VML drawing page for this sheet (OOX only!). */
+ /** Returns the VML drawing page for this sheet (OOXML/BIFF12 only!). */
inline VmlDrawing& getVmlDrawing() { return *mxVmlDrawing; }
/** Changes the current sheet type. */
@@ -542,13 +519,6 @@ private:
/** Merges the passed merged range and updates right/bottom cell borders. */
void finalizeMergedRange( const CellRangeAddress& rRange );
- /** Imports the drawing layer of the sheet (DrawingML part). */
- void finalizeDrawing();
- /** Imports the drawing layer of the sheet (VML part). */
- void finalizeVmlDrawing();
- /** Extends the used cell area with the area used by drawing objects. */
- void finalizeUsedArea();
-
/** Converts column properties for all columns in the sheet. */
void convertColumns();
/** Converts column properties. */
@@ -564,6 +534,9 @@ private:
/** Groups columns or rows for the given range. */
void groupColumnsOrRows( sal_Int32 nFirstColRow, sal_Int32 nLastColRow, bool bCollapsed, bool bRows );
+ /** Imports the drawings of the sheet (DML, VML), and updates the used area. */
+ void finalizeDrawings();
+
private:
typedef ::std::auto_ptr< VmlDrawing > VmlDrawingPtr;
@@ -588,6 +561,8 @@ private:
SharedFormulaBuffer maSharedFmlas; /// Buffer for shared formulas in this sheet.
CondFormatBuffer maCondFormats; /// Buffer for conditional formattings.
CommentsBuffer maComments; /// Buffer for all cell comments in this sheet.
+ AutoFilterBuffer maAutoFilters; /// Sheet auto filters (not associated to a table).
+ QueryTableBuffer maQueryTables; /// Buffer for all web query tables in this sheet.
PageSettings maPageSett; /// Page/print settings for this sheet.
SheetViewSettings maSheetViewSett; /// View settings for this sheet.
VmlDrawingPtr mxVmlDrawing; /// Collection of all VML shapes.
@@ -604,7 +579,7 @@ private:
// ----------------------------------------------------------------------------
-WorksheetData::WorksheetData( const WorkbookHelper& rHelper, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+WorksheetData::WorksheetData( const WorkbookHelper& rHelper, const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
WorkbookHelper( rHelper ),
maTrueFormula( CREATE_OUSTRING( "=TRUE()" ) ),
maFalseFormula( CREATE_OUSTRING( "=FALSE()" ) ),
@@ -616,9 +591,11 @@ WorksheetData::WorksheetData( const WorkbookHelper& rHelper, ISegmentProgressBar
maSharedFmlas( *this ),
maCondFormats( *this ),
maComments( *this ),
+ maAutoFilters( *this ),
+ maQueryTables( *this ),
maPageSett( *this ),
maSheetViewSett( *this ),
- mxProgressBar( xProgressBar ),
+ mxProgressBar( rxProgressBar ),
meSheetType( eSheetType ),
mbHasDefWidth( false )
{
@@ -644,7 +621,7 @@ WorksheetData::WorksheetData( const WorkbookHelper& rHelper, ISegmentProgressBar
maDefRowModel.mbCollapsed = false;
// buffers
- if( getFilterType() == FILTER_OOX )
+ if( getFilterType() == FILTER_OOXML )
mxVmlDrawing.reset( new VmlDrawing( *this ) );
// prepare progress bars
@@ -1020,25 +997,17 @@ void WorksheetData::extendUsedArea( const CellRangeAddress& rRange )
void WorksheetData::extendShapeBoundingBox( const Rectangle& rShapeRect )
{
- // scale EMUs to 1/100 mm
- const UnitConverter& rUnitConv = getUnitConverter();
- Rectangle aShapeRectHmm(
- rUnitConv.scaleToMm100( rShapeRect.X, UNIT_EMU ),
- rUnitConv.scaleToMm100( rShapeRect.Y, UNIT_EMU ),
- rUnitConv.scaleToMm100( rShapeRect.Width, UNIT_EMU ),
- rUnitConv.scaleToMm100( rShapeRect.Height, UNIT_EMU ) );
-
if( (maShapeBoundingBox.Width == 0) && (maShapeBoundingBox.Height == 0) )
{
// width and height of maShapeBoundingBox are assumed to be zero on first cell
- maShapeBoundingBox = aShapeRectHmm;
+ maShapeBoundingBox = rShapeRect;
}
else
{
- sal_Int32 nEndX = ::std::max( maShapeBoundingBox.X + maShapeBoundingBox.Width, aShapeRectHmm.X + aShapeRectHmm.Width );
- sal_Int32 nEndY = ::std::max( maShapeBoundingBox.Y + maShapeBoundingBox.Height, aShapeRectHmm.Y + aShapeRectHmm.Height );
- maShapeBoundingBox.X = ::std::min( maShapeBoundingBox.X, aShapeRectHmm.X );
- maShapeBoundingBox.Y = ::std::min( maShapeBoundingBox.Y, aShapeRectHmm.Y );
+ sal_Int32 nEndX = ::std::max( maShapeBoundingBox.X + maShapeBoundingBox.Width, rShapeRect.X + rShapeRect.Width );
+ sal_Int32 nEndY = ::std::max( maShapeBoundingBox.Y + maShapeBoundingBox.Height, rShapeRect.Y + rShapeRect.Height );
+ maShapeBoundingBox.X = ::std::min( maShapeBoundingBox.X, rShapeRect.X );
+ maShapeBoundingBox.Y = ::std::min( maShapeBoundingBox.Y, rShapeRect.Y );
maShapeBoundingBox.Width = nEndX - maShapeBoundingBox.X;
maShapeBoundingBox.Height = nEndY - maShapeBoundingBox.Y;
}
@@ -1068,7 +1037,7 @@ void WorksheetData::setDefaultColumnWidth( double fWidth )
void WorksheetData::setColumnModel( const ColumnModel& rModel )
{
- // convert 1-based OOX column indexes to 0-based API column indexes
+ // convert 1-based OOXML column indexes to 0-based API column indexes
sal_Int32 nFirstCol = rModel.mnFirstCol - 1;
sal_Int32 nLastCol = rModel.mnLastCol - 1;
if( (0 <= nFirstCol) && (nFirstCol <= mrMaxApiPos.Column) )
@@ -1092,7 +1061,7 @@ void WorksheetData::setDefaultRowSettings( double fHeight, bool bCustomHeight, b
void WorksheetData::setRowModel( const RowModel& rModel )
{
- // convert 1-based OOX row indexes to 0-based API row indexes
+ // convert 1-based OOXML row indexes to 0-based API row indexes
sal_Int32 nFirstRow = rModel.mnFirstRow - 1;
sal_Int32 nLastRow = rModel.mnLastRow - 1;
if( (0 <= nFirstRow) && (nFirstRow <= mrMaxApiPos.Row) )
@@ -1160,8 +1129,10 @@ void WorksheetData::finalizeWorksheetImport()
finalizeHyperlinkRanges();
finalizeValidationRanges();
finalizeMergedRanges();
+ maAutoFilters.finalizeImport( getSheetIndex() );
maSheetSett.finalizeImport();
maCondFormats.finalizeImport();
+ maQueryTables.finalizeImport();
maPageSett.finalizeImport();
maSheetViewSett.finalizeImport();
maSheetSett.finalizeImport();
@@ -1170,10 +1141,7 @@ void WorksheetData::finalizeWorksheetImport()
convertColumns();
convertRows();
lclUpdateProgressBar( mxFinalProgress, 0.75 );
- finalizeDrawing();
- finalizeVmlDrawing();
- maComments.finalizeImport(); // after VML drawing
- finalizeUsedArea(); // after DML and VML drawing
+ finalizeDrawings();
lclUpdateProgressBar( mxFinalProgress, 1.0 );
// reset current sheet index in global data
@@ -1431,8 +1399,8 @@ void WorksheetData::finalizeValidationRanges() const
{
PropertySet aPropSet( getCellRangeList( aIt->maRanges ) );
- Reference< XPropertySet > xValidation;
- if( aPropSet.getProperty( xValidation, PROP_Validation ) && xValidation.is() )
+ Reference< XPropertySet > xValidation( aPropSet.getAnyProperty( PROP_Validation ), UNO_QUERY );
+ if( xValidation.is() )
{
PropertySet aValProps( xValidation );
namespace csss = ::com::sun::star::sheet;
@@ -1560,42 +1528,6 @@ void WorksheetData::finalizeMergedRange( const CellRangeAddress& rRange )
}
}
-void WorksheetData::finalizeDrawing()
-{
- OSL_ENSURE( (getFilterType() == FILTER_OOX) || (maDrawingPath.getLength() == 0),
- "WorksheetData::finalizeDrawing - unexpected DrawingML path" );
- if( (getFilterType() == FILTER_OOX) && (maDrawingPath.getLength() > 0) )
- importOoxFragment( new OoxDrawingFragment( *this, maDrawingPath ) );
-}
-
-void WorksheetData::finalizeVmlDrawing()
-{
- OSL_ENSURE( (getFilterType() == FILTER_OOX) || (maVmlDrawingPath.getLength() == 0),
- "WorksheetData::finalizeVmlDrawing - unexpected VML path" );
- if( (getFilterType() == FILTER_OOX) && (maVmlDrawingPath.getLength() > 0) )
- importOoxFragment( new OoxVmlDrawingFragment( *this, maVmlDrawingPath ) );
-}
-
-void WorksheetData::finalizeUsedArea()
-{
- /* Extend used area of the sheet by cells covered with drawing objects.
- Needed if the imported document is inserted as "OLE object from file"
- and thus does not provide an OLE size property by itself. */
- if( (maShapeBoundingBox.Width > 0) || (maShapeBoundingBox.Height > 0) )
- extendUsedArea( getCellRangeFromRectangle( maShapeBoundingBox ) );
-
- // if no used area is set, default to A1
- if( maUsedArea.StartColumn > maUsedArea.EndColumn )
- maUsedArea.StartColumn = maUsedArea.EndColumn = 0;
- if( maUsedArea.StartRow > maUsedArea.EndRow )
- maUsedArea.StartRow = maUsedArea.EndRow = 0;
-
- /* Register the used area of this sheet in global view settings. The
- global view settings will set the visible area if this document is an
- embedded OLE object. */
- getViewSettings().setSheetUsedArea( maUsedArea );
-}
-
void WorksheetData::convertColumns()
{
sal_Int32 nNextCol = 0;
@@ -1605,7 +1537,7 @@ void WorksheetData::convertColumns()
for( ColumnModelMap::const_iterator aIt = maColModels.begin(), aEnd = maColModels.end(); aIt != aEnd; ++aIt )
{
- // convert 1-based OOX column indexes to 0-based API column indexes
+ // convert 1-based OOXML column indexes to 0-based API column indexes
sal_Int32 nFirstCol = ::std::max( aIt->second.mnFirstCol - 1, nNextCol );
sal_Int32 nLastCol = ::std::min( aIt->second.mnLastCol - 1, nMaxCol );
@@ -1655,7 +1587,7 @@ void WorksheetData::convertRows()
for( RowModelMap::const_iterator aIt = maRowModels.begin(), aEnd = maRowModels.end(); aIt != aEnd; ++aIt )
{
- // convert 1-based OOX row indexes to 0-based API row indexes
+ // convert 1-based OOXML row indexes to 0-based API row indexes
sal_Int32 nFirstRow = ::std::max( aIt->second.mnFirstRow - 1, nNextRow );
sal_Int32 nLastRow = ::std::min( aIt->second.mnLastRow - 1, nMaxRow );
@@ -1760,6 +1692,55 @@ void WorksheetData::groupColumnsOrRows( sal_Int32 nFirstColRow, sal_Int32 nLastC
}
}
+void WorksheetData::finalizeDrawings()
+{
+ switch( getFilterType() )
+ {
+ case FILTER_OOXML:
+ // import DML and VML
+ if( maDrawingPath.getLength() > 0 )
+ importOoxFragment( new DrawingFragment( *this, maDrawingPath ) );
+ if( maVmlDrawingPath.getLength() > 0 )
+ importOoxFragment( new VmlDrawingFragment( *this, maVmlDrawingPath ) );
+ break;
+
+ case FILTER_BIFF:
+ // TODO: import DFF shapes
+ break;
+
+ case FILTER_UNKNOWN:
+ break;
+ }
+
+ // comments (after callout shapes have been imported from VML/DFF)
+ maComments.finalizeImport();
+
+ /* Extend used area of the sheet by cells covered with drawing objects.
+ Needed if the imported document is inserted as "OLE object from file"
+ and thus does not provide an OLE size property by itself. */
+ if( (maShapeBoundingBox.Width > 0) || (maShapeBoundingBox.Height > 0) )
+ extendUsedArea( getCellRangeFromRectangle( maShapeBoundingBox ) );
+
+ // if no used area is set, default to A1
+ if( maUsedArea.StartColumn > maUsedArea.EndColumn )
+ maUsedArea.StartColumn = maUsedArea.EndColumn = 0;
+ if( maUsedArea.StartRow > maUsedArea.EndRow )
+ maUsedArea.StartRow = maUsedArea.EndRow = 0;
+
+ /* Register the used area of this sheet in global view settings. The
+ global view settings will set the visible area if this document is an
+ embedded OLE object. */
+ getViewSettings().setSheetUsedArea( maUsedArea );
+
+ /* #i103686# Set right-to-left sheet layout. Must be done after all
+ drawing shapes to simplify calculation of shape coordinates. */
+ if( maSheetViewSett.isSheetRightToLeft() )
+ {
+ PropertySet aPropSet( mxSheet );
+ aPropSet.setProperty( PROP_TableLayout, ::com::sun::star::text::WritingMode2::RL_TB );
+ }
+}
+
// ============================================================================
// ============================================================================
@@ -1941,6 +1922,16 @@ CommentsBuffer& WorksheetHelper::getComments() const
return mrSheetData.getComments();
}
+AutoFilterBuffer& WorksheetHelper::getAutoFilters() const
+{
+ return mrSheetData.getAutoFilters();
+}
+
+QueryTableBuffer& WorksheetHelper::getQueryTables() const
+{
+ return mrSheetData.getQueryTables();
+}
+
PageSettings& WorksheetHelper::getPageSettings() const
{
return mrSheetData.getPageSettings();
@@ -2139,44 +2130,51 @@ void WorksheetHelper::setTableOperation( const CellRangeAddress& rRange, const D
void WorksheetHelper::setLabelRanges( const ApiCellRangeList& rColRanges, const ApiCellRangeList& rRowRanges )
{
const CellAddress& rMaxPos = getAddressConverter().getMaxApiAddress();
- Reference< XLabelRanges > xLabelRanges;
PropertySet aPropSet( getSheet() );
- if( !rColRanges.empty() && aPropSet.getProperty( xLabelRanges, PROP_ColumnLabelRanges ) && xLabelRanges.is() )
+ if( !rColRanges.empty() )
{
- for( ApiCellRangeList::const_iterator aIt = rColRanges.begin(), aEnd = rColRanges.end(); aIt != aEnd; ++aIt )
+ Reference< XLabelRanges > xLabelRanges( aPropSet.getAnyProperty( PROP_ColumnLabelRanges ), UNO_QUERY );
+ if( xLabelRanges.is() )
{
- CellRangeAddress aDataRange = *aIt;
- if( aDataRange.EndRow < rMaxPos.Row )
+ for( ApiCellRangeList::const_iterator aIt = rColRanges.begin(), aEnd = rColRanges.end(); aIt != aEnd; ++aIt )
{
- aDataRange.StartRow = aDataRange.EndRow + 1;
- aDataRange.EndRow = rMaxPos.Row;
- }
- else if( aDataRange.StartRow > 0 )
- {
- aDataRange.EndRow = aDataRange.StartRow - 1;
- aDataRange.StartRow = 0;
+ CellRangeAddress aDataRange = *aIt;
+ if( aDataRange.EndRow < rMaxPos.Row )
+ {
+ aDataRange.StartRow = aDataRange.EndRow + 1;
+ aDataRange.EndRow = rMaxPos.Row;
+ }
+ else if( aDataRange.StartRow > 0 )
+ {
+ aDataRange.EndRow = aDataRange.StartRow - 1;
+ aDataRange.StartRow = 0;
+ }
+ xLabelRanges->addNew( *aIt, aDataRange );
}
- xLabelRanges->addNew( *aIt, aDataRange );
}
}
- if( !rRowRanges.empty() && aPropSet.getProperty( xLabelRanges, PROP_RowLabelRanges ) && xLabelRanges.is() )
+ if( !rRowRanges.empty() )
{
- for( ApiCellRangeList::const_iterator aIt = rRowRanges.begin(), aEnd = rRowRanges.end(); aIt != aEnd; ++aIt )
+ Reference< XLabelRanges > xLabelRanges( aPropSet.getAnyProperty( PROP_RowLabelRanges ), UNO_QUERY );
+ if( xLabelRanges.is() )
{
- CellRangeAddress aDataRange = *aIt;
- if( aDataRange.EndColumn < rMaxPos.Column )
+ for( ApiCellRangeList::const_iterator aIt = rRowRanges.begin(), aEnd = rRowRanges.end(); aIt != aEnd; ++aIt )
{
- aDataRange.StartColumn = aDataRange.EndColumn + 1;
- aDataRange.EndColumn = rMaxPos.Column;
- }
- else if( aDataRange.StartColumn > 0 )
- {
- aDataRange.EndColumn = aDataRange.StartColumn - 1;
- aDataRange.StartColumn = 0;
+ CellRangeAddress aDataRange = *aIt;
+ if( aDataRange.EndColumn < rMaxPos.Column )
+ {
+ aDataRange.StartColumn = aDataRange.EndColumn + 1;
+ aDataRange.EndColumn = rMaxPos.Column;
+ }
+ else if( aDataRange.StartColumn > 0 )
+ {
+ aDataRange.EndColumn = aDataRange.StartColumn - 1;
+ aDataRange.StartColumn = 0;
+ }
+ xLabelRanges->addNew( *aIt, aDataRange );
}
- xLabelRanges->addNew( *aIt, aDataRange );
}
}
}
@@ -2263,8 +2261,8 @@ WorksheetDataOwner::~WorksheetDataOwner()
// ----------------------------------------------------------------------------
-WorksheetHelperRoot::WorksheetHelperRoot( const WorkbookHelper& rHelper, ISegmentProgressBarRef xProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
- prv::WorksheetDataOwner( prv::WorksheetDataRef( new WorksheetData( rHelper, xProgressBar, eSheetType, nSheet ) ) ),
+WorksheetHelperRoot::WorksheetHelperRoot( const WorkbookHelper& rHelper, const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) :
+ prv::WorksheetDataOwner( prv::WorksheetDataRef( new WorksheetData( rHelper, rxProgressBar, eSheetType, nSheet ) ) ),
WorksheetHelper( *mxSheetData )
{
}
@@ -2292,4 +2290,4 @@ bool WorksheetHelperRoot::isValidSheet() const
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/source/xls/worksheetsettings.cxx b/oox/source/xls/worksheetsettings.cxx
index 9743f2b74f0f..48a8a97a548f 100644
--- a/oox/source/xls/worksheetsettings.cxx
+++ b/oox/source/xls/worksheetsettings.cxx
@@ -27,41 +27,41 @@
************************************************************************/
#include "oox/xls/worksheetsettings.hxx"
+
+#include <com/sun/star/util/XProtectable.hpp>
+#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
-#include "oox/helper/recordinputstream.hxx"
#include "oox/xls/biffinputstream.hxx"
#include "oox/xls/pagesettings.hxx"
#include "oox/xls/workbooksettings.hxx"
-#include "oox/core/filterbase.hxx"
-#include "properties.hxx"
-
-#include <com/sun/star/util/XProtectable.hpp>
-
-using ::rtl::OUString;
-using ::com::sun::star::beans::XPropertySet;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::uno::Exception;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::UNO_QUERY_THROW;
-using ::com::sun::star::util::XProtectable;
-using ::oox::core::CodecHelper;
namespace oox {
namespace xls {
// ============================================================================
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+using ::oox::core::CodecHelper;
+using ::rtl::OUString;
+
+// ============================================================================
+
namespace {
-const sal_uInt8 OOBIN_SHEETPR_FILTERMODE = 0x01;
-const sal_uInt8 OOBIN_SHEETPR_EVAL_CF = 0x02;
+const sal_uInt8 BIFF12_SHEETPR_FILTERMODE = 0x01;
+const sal_uInt8 BIFF12_SHEETPR_EVAL_CF = 0x02;
+
+const sal_uInt32 BIFF_SHEETEXT_NOTABCOLOR = 0x7F;
const sal_uInt16 BIFF_SHEETPR_DIALOGSHEET = 0x0010;
const sal_uInt16 BIFF_SHEETPR_APPLYSTYLES = 0x0020;
const sal_uInt16 BIFF_SHEETPR_SYMBOLSBELOW = 0x0040;
const sal_uInt16 BIFF_SHEETPR_SYMBOLSRIGHT = 0x0080;
const sal_uInt16 BIFF_SHEETPR_FITTOPAGES = 0x0100;
-const sal_uInt16 BIFF_SHEETPR_SKIPEXT = 0x0200; /// BIFF3-BIFF4
+const sal_uInt16 BIFF_SHEETPR_SKIPEXT = 0x0200; // BIFF3-BIFF4
const sal_uInt32 BIFF_SHEETPROT_OBJECTS = 0x00000001;
const sal_uInt32 BIFF_SHEETPROT_SCENARIOS = 0x00000002;
@@ -178,7 +178,7 @@ void WorksheetSettings::importPhoneticPr( const AttributeList& rAttribs )
maPhoneticSett.importPhoneticPr( rAttribs );
}
-void WorksheetSettings::importSheetPr( RecordInputStream& rStrm )
+void WorksheetSettings::importSheetPr( SequenceInputStream& rStrm )
{
sal_uInt16 nFlags1;
sal_uInt8 nFlags2;
@@ -186,8 +186,8 @@ void WorksheetSettings::importSheetPr( RecordInputStream& rStrm )
rStrm.skip( 8 ); // sync anchor cell
rStrm >> maSheetSettings.maCodeName;
// sheet settings
- maSheetSettings.mbFilterMode = getFlag( nFlags2, OOBIN_SHEETPR_FILTERMODE );
- // outline settings, equal flags in BIFF and OOBIN
+ maSheetSettings.mbFilterMode = getFlag( nFlags2, BIFF12_SHEETPR_FILTERMODE );
+ // outline settings, equal flags in all BIFFs
maSheetSettings.mbApplyStyles = getFlag( nFlags1, BIFF_SHEETPR_APPLYSTYLES );
maSheetSettings.mbSummaryRight = getFlag( nFlags1, BIFF_SHEETPR_SYMBOLSRIGHT );
maSheetSettings.mbSummaryBelow = getFlag( nFlags1, BIFF_SHEETPR_SYMBOLSBELOW );
@@ -196,13 +196,13 @@ void WorksheetSettings::importSheetPr( RecordInputStream& rStrm )
getPageSettings().setFitToPagesMode( getFlag( nFlags1, BIFF_SHEETPR_FITTOPAGES ) );
}
-void WorksheetSettings::importChartSheetPr( RecordInputStream& rStrm )
+void WorksheetSettings::importChartSheetPr( SequenceInputStream& rStrm )
{
rStrm.skip( 2 ); // flags, contains only the 'published' flag
rStrm >> maSheetSettings.maTabColor >> maSheetSettings.maCodeName;
}
-void WorksheetSettings::importSheetProtection( RecordInputStream& rStrm )
+void WorksheetSettings::importSheetProtection( SequenceInputStream& rStrm )
{
rStrm >> maSheetProt.mnPasswordHash;
// no flags field for all these boolean flags?!?
@@ -224,7 +224,7 @@ void WorksheetSettings::importSheetProtection( RecordInputStream& rStrm )
maSheetProt.mbSelectUnlocked = rStrm.readInt32() != 0;
}
-void WorksheetSettings::importChartProtection( RecordInputStream& rStrm )
+void WorksheetSettings::importChartProtection( SequenceInputStream& rStrm )
{
rStrm >> maSheetProt.mnPasswordHash;
// no flags field for all these boolean flags?!?
@@ -232,11 +232,21 @@ void WorksheetSettings::importChartProtection( RecordInputStream& rStrm )
maSheetProt.mbObjects = rStrm.readInt32() != 0;
}
-void WorksheetSettings::importPhoneticPr( RecordInputStream& rStrm )
+void WorksheetSettings::importPhoneticPr( SequenceInputStream& rStrm )
{
maPhoneticSett.importPhoneticPr( rStrm );
}
+void WorksheetSettings::importSheetExt( BiffInputStream& rStrm )
+{
+ rStrm.skip( 16 );
+ sal_uInt32 nFlags;
+ rStrm >> nFlags;
+ sal_uInt8 nColorIdx = extractValue< sal_uInt8 >( nFlags, 0, 7 );
+ if( nColorIdx != BIFF_SHEETEXT_NOTABCOLOR )
+ maSheetSettings.maTabColor.setPaletteClr( nColorIdx );
+}
+
void WorksheetSettings::importSheetPr( BiffInputStream& rStrm )
{
sal_uInt16 nFlags;
@@ -325,10 +335,11 @@ void WorksheetSettings::finalizeImport()
PropertySet aPropSet( getSheet() );
aPropSet.setProperty( PROP_CodeName, maSheetSettings.maCodeName );
- if (!maSheetSettings.maTabColor.isAuto())
+ // sheet tab color
+ if( !maSheetSettings.maTabColor.isAuto() )
{
- sal_Int32 nColor = maSheetSettings.maTabColor.getColor(getBaseFilter().getGraphicHelper());
- aPropSet.setProperty(PROP_TabColor, nColor);
+ sal_Int32 nColor = maSheetSettings.maTabColor.getColor( getBaseFilter().getGraphicHelper() );
+ aPropSet.setProperty( PROP_TabColor, nColor );
}
}
@@ -337,4 +348,4 @@ void WorksheetSettings::finalizeImport()
} // namespace xls
} // namespace oox
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/oox/util/makefile.mk b/oox/util/makefile.mk
index ff4ca038a483..d6929112fe23 100644
--- a/oox/util/makefile.mk
+++ b/oox/util/makefile.mk
@@ -104,3 +104,11 @@ DEFLIB1NAME =$(TARGET)
.ENDIF # L10N_framework
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/oox.component
+
+$(MISC)/oox.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ oox.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt oox.component
diff --git a/oox/util/oox.component b/oox/util/oox.component
new file mode 100644
index 000000000000..f6519d5a8664
--- /dev/null
+++ b/oox/util/oox.component
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.oox.core.FastTokenHandler">
+ <service name="com.sun.star.xml.sax.FastTokenHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.oox.FormatDetector">
+ <service name="com.sun.star.frame.ExtendedTypeDetection"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.oox.docprop.DocumentPropertiesImporter">
+ <service name="com.sun.star.document.OOXMLDocumentPropertiesImporter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.oox.WordVbaProjectFilter">
+ <service name="com.sun.star.document.ImportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.oox.ppt.PowerPointImport">
+ <service name="com.sun.star.document.ImportFilter"/>
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.oox.ShapeContextHandler">
+ <service name="com.sun.star.xml.sax.FastShapeContextHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.oox.xls.BiffDetector">
+ <service name="com.sun.star.frame.ExtendedTypeDetection"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.oox.xls.ExcelFilter">
+ <service name="com.sun.star.document.ImportFilter"/>
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.oox.xls.ExcelBiffFilter">
+ <service name="com.sun.star.document.ImportFilter"/>
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.oox.xls.ExcelVbaProjectFilter">
+ <service name="com.sun.star.document.ImportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.oox.xls.FormulaParser">
+ <service name="com.sun.star.sheet.FilterFormulaParser"/>
+ </implementation>
+</component>