summaryrefslogtreecommitdiff
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
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
-rw-r--r--filter/inc/filter.hrc13
-rw-r--r--filter/inc/filter/msfilter/escherex.hxx278
-rw-r--r--filter/inc/filter/msfilter/mscodec.hxx67
-rw-r--r--filter/inc/filter/msfilter/msdffimp.hxx314
-rw-r--r--filter/inc/filter/msfilter/msocximex.hxx28
-rw-r--r--filter/inc/filter/msfilter/msoleexp.hxx8
-rw-r--r--filter/inc/filter/msfilter/msvbahelper.hxx94
-rw-r--r--filter/inc/filter/msfilter/svdfppt.hxx296
-rw-r--r--filter/inc/filter/msfilter/svxmsbas.hxx23
-rw-r--r--filter/inc/registration.hxx93
-rw-r--r--filter/prj/build.lst5
-rw-r--r--filter/prj/d.lst13
-rw-r--r--filter/qa/complex/filter/misc/FinalizedMandatoryTest.java217
-rw-r--r--filter/qa/complex/filter/misc/TypeDetection6FileFormat.java93
-rwxr-xr-xfilter/qa/complex/filter/misc/makefile.mk80
-rw-r--r--filter/source/config/cache/cacheitem.hxx12
-rw-r--r--filter/source/config/cache/constant.hxx2
-rw-r--r--filter/source/config/cache/filtercache.cxx6
-rw-r--r--filter/source/config/cache/filtercache.hxx4
-rw-r--r--filter/source/config/cache/filterconfig1.component46
-rw-r--r--filter/source/config/cache/makefile.mk8
-rw-r--r--filter/source/config/cache/registration.cxx24
-rw-r--r--filter/source/config/cache/typedetection.cxx11
-rw-r--r--filter/source/config/fragments/filters/MS_PowerPoint_97.xcu2
-rw-r--r--filter/source/config/fragments/filters/MS_PowerPoint_97_Vorlage.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarCalc_3_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarCalc_3_0_Vorlage_Template.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarCalc_4_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarCalc_4_0_Vorlage_Template.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarCalc_5_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarCalc_5_0_Vorlage_Template.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarChart_3_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarChart_4_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarChart_5_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_3_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_3_0_Vorlage.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_3_0_Vorlage__StarImpress_.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_3_0__StarImpress_.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_5_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_5_0_Vorlage.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_5_0_Vorlage__StarImpress_.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarDraw_5_0__StarImpress_.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarImpress_4_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarImpress_4_0_Vorlage.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarImpress_5_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarImpress_5_0_Vorlage.xcu2
-rw-r--r--filter/source/config/fragments/filters/StarMath_5_0.xcu2
-rw-r--r--filter/source/config/fragments/filters/calc_MS_Excel_2007_Binary.xcu2
-rw-r--r--filter/source/config/fragments/filters/calc_MS_Excel_2007_XML.xcu2
-rw-r--r--filter/source/config/fragments/filters/calc_MS_Excel_2007_XML_Template.xcu2
-rw-r--r--filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu2
-rw-r--r--filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu2
-rw-r--r--filter/source/config/fragments/internalgraphicfilters/ras_Export.xcu2
-rw-r--r--filter/source/config/fragments/internalgraphicfilters/svg_Export.xcu2
-rw-r--r--filter/source/config/fragments/internalgraphicfilters/tif_Export.xcu2
-rw-r--r--filter/source/config/fragments/internalgraphicfilters/xpm_Export.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_40.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_40_VorlageTemplate.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_5095.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_5095_VorlageTemplate.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_95.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_95_VorlageTemplate.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_97.xcu2
-rw-r--r--filter/source/config/fragments/types/calc_MS_Excel_97_VorlageTemplate.xcu2
-rw-r--r--filter/source/filtertracer/exports.dxp1
-rw-r--r--filter/source/filtertracer/filtertraceruno.cxx31
-rw-r--r--filter/source/flash/flash.component37
-rw-r--r--filter/source/flash/impswfdialog.cxx2
-rw-r--r--filter/source/flash/impswfdialog.src9
-rw-r--r--filter/source/flash/makefile.mk8
-rw-r--r--filter/source/flash/swfexporter.cxx4
-rw-r--r--filter/source/flash/swfuno.cxx35
-rw-r--r--filter/source/flash/swfwriter1.cxx20
-rw-r--r--filter/source/flash/swfwriter2.cxx2
-rw-r--r--filter/source/graphicfilter/egif/dlgegif.cxx109
-rw-r--r--filter/source/graphicfilter/egif/dlgegif.hrc36
-rw-r--r--filter/source/graphicfilter/egif/dlgegif.src118
-rw-r--r--filter/source/graphicfilter/egif/egif.cxx221
-rw-r--r--filter/source/graphicfilter/egif/exports.map1
-rw-r--r--filter/source/graphicfilter/egif/giflzwc.cxx46
-rw-r--r--filter/source/graphicfilter/egif/giflzwc.hxx14
-rw-r--r--filter/source/graphicfilter/egif/makefile.mk9
-rw-r--r--filter/source/graphicfilter/egif/strings.hrc28
-rw-r--r--filter/source/graphicfilter/eos2met/dlgeos2.cxx179
-rw-r--r--filter/source/graphicfilter/eos2met/dlgeos2.hrc41
-rw-r--r--filter/source/graphicfilter/eos2met/dlgeos2.hxx82
-rw-r--r--filter/source/graphicfilter/eos2met/dlgeos2.src162
-rw-r--r--filter/source/graphicfilter/eos2met/eos2met.cxx550
-rw-r--r--filter/source/graphicfilter/eos2met/exports.map1
-rw-r--r--filter/source/graphicfilter/eos2met/makefile.mk11
-rw-r--r--filter/source/graphicfilter/eos2met/strings.hrc29
-rw-r--r--filter/source/graphicfilter/epbm/dlgepbm.cxx100
-rw-r--r--filter/source/graphicfilter/epbm/dlgepbm.hrc34
-rw-r--r--filter/source/graphicfilter/epbm/dlgepbm.hxx74
-rw-r--r--filter/source/graphicfilter/epbm/dlgepbm.src106
-rw-r--r--filter/source/graphicfilter/epbm/epbm.cxx101
-rw-r--r--filter/source/graphicfilter/epbm/exports.map1
-rw-r--r--filter/source/graphicfilter/epbm/makefile.mk8
-rw-r--r--filter/source/graphicfilter/epbm/strings.hrc27
-rw-r--r--filter/source/graphicfilter/epgm/dlgepgm.cxx98
-rw-r--r--filter/source/graphicfilter/epgm/dlgepgm.hrc34
-rw-r--r--filter/source/graphicfilter/epgm/dlgepgm.hxx74
-rw-r--r--filter/source/graphicfilter/epgm/dlgepgm.src105
-rw-r--r--filter/source/graphicfilter/epgm/epgm.cxx119
-rw-r--r--filter/source/graphicfilter/epgm/exports.map1
-rw-r--r--filter/source/graphicfilter/epgm/makefile.mk8
-rw-r--r--filter/source/graphicfilter/epgm/strings.hrc27
-rw-r--r--filter/source/graphicfilter/epict/dlgepct.cxx185
-rw-r--r--filter/source/graphicfilter/epict/dlgepct.hrc41
-rw-r--r--filter/source/graphicfilter/epict/dlgepct.hxx82
-rw-r--r--filter/source/graphicfilter/epict/dlgepct.src163
-rw-r--r--filter/source/graphicfilter/epict/epict.cxx501
-rw-r--r--filter/source/graphicfilter/epict/exports.map1
-rw-r--r--filter/source/graphicfilter/epict/makefile.mk8
-rw-r--r--filter/source/graphicfilter/epict/strings.hrc29
-rw-r--r--filter/source/graphicfilter/eppm/dlgeppm.cxx98
-rw-r--r--filter/source/graphicfilter/eppm/dlgeppm.hrc34
-rw-r--r--filter/source/graphicfilter/eppm/dlgeppm.src106
-rw-r--r--filter/source/graphicfilter/eppm/eppm.cxx111
-rw-r--r--filter/source/graphicfilter/eppm/eppmstr.src35
-rw-r--r--filter/source/graphicfilter/eppm/exports.map1
-rw-r--r--filter/source/graphicfilter/eppm/makefile.mk12
-rw-r--r--filter/source/graphicfilter/eppm/strings.hrc27
-rw-r--r--filter/source/graphicfilter/eps/dlgeps.cxx207
-rw-r--r--filter/source/graphicfilter/eps/dlgeps.hrc43
-rw-r--r--filter/source/graphicfilter/eps/dlgeps.hxx85
-rw-r--r--filter/source/graphicfilter/eps/dlgeps.src160
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx388
-rw-r--r--filter/source/graphicfilter/eps/exports.map1
-rw-r--r--filter/source/graphicfilter/eps/makefile.mk9
-rw-r--r--filter/source/graphicfilter/eras/eras.cxx97
-rw-r--r--filter/source/graphicfilter/etiff/etiff.cxx187
-rw-r--r--filter/source/graphicfilter/expm/expm.cxx102
-rw-r--r--filter/source/graphicfilter/icgm/actimpr.cxx4
-rw-r--r--filter/source/graphicfilter/icgm/class4.cxx18
-rw-r--r--filter/source/graphicfilter/icgm/outact.cxx8
-rw-r--r--filter/source/graphicfilter/icgm/outact.hxx4
-rw-r--r--filter/source/graphicfilter/idxf/dxf2mtf.cxx96
-rw-r--r--filter/source/graphicfilter/idxf/dxf2mtf.hxx26
-rw-r--r--filter/source/graphicfilter/idxf/dxfgrprd.cxx52
-rw-r--r--filter/source/graphicfilter/idxf/dxfgrprd.hxx42
-rw-r--r--filter/source/graphicfilter/idxf/dxfreprd.cxx30
-rw-r--r--filter/source/graphicfilter/idxf/dxfreprd.hxx26
-rw-r--r--filter/source/graphicfilter/idxf/dxfvec.cxx22
-rw-r--r--filter/source/graphicfilter/idxf/dxfvec.hxx26
-rw-r--r--filter/source/graphicfilter/idxf/idxf.cxx40
-rw-r--r--filter/source/graphicfilter/ieps/ieps.cxx105
-rw-r--r--filter/source/graphicfilter/ios2met/ios2met.cxx567
-rw-r--r--filter/source/graphicfilter/ipbm/ipbm.cxx229
-rw-r--r--filter/source/graphicfilter/ipcd/ipcd.cxx124
-rw-r--r--filter/source/graphicfilter/ipcx/ipcx.cxx155
-rw-r--r--filter/source/graphicfilter/ipict/ipict.cxx1089
-rw-r--r--filter/source/graphicfilter/ipict/makefile.mk7
-rwxr-xr-xfilter/source/graphicfilter/ipict/shape.cxx266
-rwxr-xr-xfilter/source/graphicfilter/ipict/shape.hxx60
-rw-r--r--filter/source/graphicfilter/ipsd/ipsd.cxx212
-rw-r--r--filter/source/graphicfilter/iras/iras.cxx113
-rw-r--r--filter/source/graphicfilter/itga/itga.cxx261
-rw-r--r--filter/source/graphicfilter/itiff/ccidecom.cxx164
-rw-r--r--filter/source/graphicfilter/itiff/ccidecom.hxx64
-rw-r--r--filter/source/graphicfilter/itiff/itiff.cxx727
-rw-r--r--filter/source/graphicfilter/itiff/lzwdecom.cxx36
-rw-r--r--filter/source/graphicfilter/itiff/lzwdecom.hxx28
-rw-r--r--filter/source/msfilter/escherex.cxx212
-rw-r--r--filter/source/msfilter/eschesdo.cxx130
-rw-r--r--filter/source/msfilter/eschesdo.hxx72
-rw-r--r--filter/source/msfilter/makefile.mk24
-rw-r--r--filter/source/msfilter/mscodec.cxx140
-rw-r--r--filter/source/msfilter/msdffimp.cxx841
-rwxr-xr-xfilter/source/msfilter/msfilter.component34
-rw-r--r--filter/source/msfilter/msocximex.cxx22
-rw-r--r--filter/source/msfilter/msoleexp.cxx10
-rw-r--r--filter/source/msfilter/msvbahelper.cxx349
-rw-r--r--filter/source/msfilter/msvbasic.cxx4
-rw-r--r--filter/source/msfilter/powerpoint/pptimporteruno.cxx27
-rwxr-xr-xfilter/source/msfilter/services.cxx75
-rw-r--r--filter/source/msfilter/svdfppt.cxx656
-rw-r--r--filter/source/msfilter/svxmsbas.cxx42
-rw-r--r--filter/source/msfilter/svxmsbas2.cxx6
-rw-r--r--filter/source/msfilter/viscache.hxx24
-rw-r--r--filter/source/pdf/impdialog.cxx187
-rw-r--r--filter/source/pdf/impdialog.hrc9
-rw-r--r--filter/source/pdf/impdialog.hxx26
-rw-r--r--filter/source/pdf/impdialog.src106
-rw-r--r--filter/source/pdf/makefile.mk9
-rw-r--r--filter/source/pdf/pdfexport.cxx1184
-rw-r--r--filter/source/pdf/pdfexport.hxx15
-rw-r--r--filter/source/pdf/pdffilter.component40
-rw-r--r--filter/source/pdf/pdffilter.cxx5
-rw-r--r--filter/source/pdf/pdffilter.hxx1
-rw-r--r--filter/source/pdf/pdfinteract.cxx137
-rw-r--r--filter/source/pdf/pdfinteract.hxx91
-rw-r--r--filter/source/pdf/pdfuno.cxx43
-rw-r--r--filter/source/placeware/exports.dxp1
-rw-r--r--filter/source/placeware/makefile.mk8
-rw-r--r--filter/source/placeware/placeware.component34
-rw-r--r--filter/source/placeware/uno.cxx26
-rw-r--r--filter/source/svg/makefile.mk12
-rw-r--r--filter/source/svg/svgexport.cxx18
-rw-r--r--filter/source/svg/svgfilter.component34
-rw-r--r--filter/source/svg/svgfilter.hxx2
-rw-r--r--filter/source/svg/svgfontexport.cxx12
-rw-r--r--filter/source/svg/svguno.cxx26
-rw-r--r--filter/source/svg/svgwriter.cxx52
-rw-r--r--filter/source/t602/filterenv.cxx35
-rw-r--r--filter/source/t602/makefile.mk8
-rw-r--r--filter/source/t602/t602filter.component38
-rw-r--r--filter/source/xmlfilteradaptor/genericfilter.cxx28
-rw-r--r--filter/source/xmlfilteradaptor/makefile.mk8
-rw-r--r--filter/source/xmlfilteradaptor/xmlfa.component35
-rw-r--r--filter/source/xmlfilterdetect/fdcomp.cxx52
-rw-r--r--filter/source/xmlfilterdetect/makefile.mk8
-rw-r--r--filter/source/xmlfilterdetect/xmlfd.component34
-rw-r--r--filter/source/xslt/odf2xhtml/export/xhtml/body.xsl85
-rw-r--r--filter/source/xsltdialog/exports.dxp1
-rw-r--r--filter/source/xsltdialog/makefile.mk8
-rw-r--r--filter/source/xsltdialog/xmlfileview.cxx130
-rw-r--r--filter/source/xsltdialog/xmlfileview.hxx12
-rw-r--r--filter/source/xsltdialog/xmlfilterdialogcomponent.cxx30
-rw-r--r--filter/source/xsltdialog/xmlfilterhelpids.hrc93
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.cxx20
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.hrc2
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.src5
-rw-r--r--filter/source/xsltdialog/xmlfiltertabdialog.cxx6
-rw-r--r--filter/source/xsltdialog/xsltdlg.component34
-rw-r--r--filter/source/xsltfilter/XSLTFilter.cxx30
-rw-r--r--filter/source/xsltfilter/XSLTFilter.jar.component34
-rw-r--r--filter/source/xsltfilter/XSLTransformer.java10
-rw-r--r--filter/source/xsltfilter/makefile.mk14
-rw-r--r--filter/source/xsltfilter/xsltfilter.component34
-rw-r--r--filter/source/xsltvalidate/XSLTValidate.component34
-rw-r--r--filter/source/xsltvalidate/XSLTValidate.java19
-rw-r--r--filter/source/xsltvalidate/makefile.mk8
-rw-r--r--hwpfilter/prj/build.lst2
-rw-r--r--hwpfilter/prj/d.lst2
-rw-r--r--hwpfilter/source/hwp.component34
-rw-r--r--hwpfilter/source/hwpreader.hxx24
-rw-r--r--hwpfilter/source/makefile.mk12
-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-x[-rw-r--r--]oox/inc/oox/token/namespacemap.hxx (renamed from filter/source/graphicfilter/epgm/epgmstr.src)26
-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-x[-rw-r--r--]oox/source/token/namespaces.hxx.head (renamed from filter/source/graphicfilter/egif/egifstr.src)17
-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-x[-rw-r--r--]oox/source/token/properties.hxx.head (renamed from filter/source/graphicfilter/epbm/epbmstr.src)15
-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-x[-rw-r--r--]oox/source/token/tokens.hxx.head (renamed from filter/source/graphicfilter/eos2met/eos2mstr.src)16
-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
-rw-r--r--unoxml/prj/build.lst4
-rw-r--r--unoxml/prj/d.lst2
-rw-r--r--unoxml/qa/complex/tests.sce1
-rw-r--r--unoxml/qa/complex/unoxml/RDFRepositoryTest.java (renamed from unoxml/qa/complex/RDFRepositoryTest.java)332
-rw-r--r--unoxml/qa/complex/unoxml/TestDocument.java39
-rw-r--r--unoxml/qa/complex/unoxml/makefile.mk (renamed from unoxml/qa/complex/makefile.mk)44
-rw-r--r--unoxml/qa/complex/unoxml/testdocuments/example.rdf (renamed from unoxml/qa/complex/testdocuments/example.rdf)0
-rw-r--r--unoxml/source/rdf/librdf_services.cxx7
-rw-r--r--unoxml/source/rdf/makefile.mk8
-rw-r--r--unoxml/source/rdf/unordf.component43
-rw-r--r--unoxml/source/service/makefile.mk8
-rw-r--r--unoxml/source/service/services.cxx38
-rw-r--r--unoxml/source/service/unoxml.component43
-rw-r--r--unoxml/source/xpath/xpathapi.hxx2
-rw-r--r--writerfilter/inc/dmapper/DomainMapper.hxx62
-rw-r--r--writerfilter/inc/resourcemodel/Fraction.hxx (renamed from filter/source/graphicfilter/egif/dlgegif.hxx)62
-rw-r--r--writerfilter/inc/resourcemodel/LoggedResources.hxx128
-rw-r--r--writerfilter/inc/resourcemodel/TagLogger.hxx1
-rw-r--r--writerfilter/inc/resourcemodel/XPathLogger.hxx (renamed from filter/source/graphicfilter/epict/epictstr.src)40
-rw-r--r--writerfilter/prj/build.lst2
-rw-r--r--writerfilter/prj/d.lst1
-rw-r--r--writerfilter/qa/complex/ooxml/testdocuments/Table5CellBorders.docxbin0 -> 10420 bytes
-rw-r--r--writerfilter/qa/complex/ooxml/testdocuments/TableDifferentColumns.docxbin0 -> 10440 bytes
-rw-r--r--writerfilter/qa/complex/ooxml/testdocuments/TablePreferredWidth.docxbin0 -> 10393 bytes
-rw-r--r--writerfilter/qa/complex/ooxml/testdocuments/TableRowProperties.docxbin0 -> 10622 bytes
-rw-r--r--writerfilter/qa/cppunittests/doctok/makefile.mk2
-rw-r--r--writerfilter/qa/cppunittests/qname/makefile.mk2
-rw-r--r--writerfilter/qa/cppunittests/sl/makefile.mk2
-rw-r--r--writerfilter/qa/cppunittests/xxml/makefile.mk2
-rw-r--r--writerfilter/source/dmapper/BorderHandler.cxx33
-rw-r--r--writerfilter/source/dmapper/BorderHandler.hxx12
-rw-r--r--writerfilter/source/dmapper/CellColorHandler.cxx12
-rw-r--r--writerfilter/source/dmapper/CellColorHandler.hxx12
-rw-r--r--writerfilter/source/dmapper/CellMarginHandler.cxx24
-rw-r--r--writerfilter/source/dmapper/CellMarginHandler.hxx12
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx140
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx67
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx10
-rw-r--r--writerfilter/source/dmapper/FFDataHandler.cxx44
-rw-r--r--writerfilter/source/dmapper/FFDataHandler.hxx14
-rw-r--r--writerfilter/source/dmapper/FontTable.cxx56
-rw-r--r--writerfilter/source/dmapper/FontTable.hxx53
-rw-r--r--writerfilter/source/dmapper/GraphicHelpers.cxx26
-rw-r--r--writerfilter/source/dmapper/GraphicHelpers.hxx16
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx214
-rw-r--r--writerfilter/source/dmapper/GraphicImport.hxx60
-rw-r--r--writerfilter/source/dmapper/MeasureHandler.cxx12
-rw-r--r--writerfilter/source/dmapper/MeasureHandler.hxx12
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx20
-rw-r--r--writerfilter/source/dmapper/NumberingManager.hxx20
-rw-r--r--writerfilter/source/dmapper/OLEHandler.cxx11
-rw-r--r--writerfilter/source/dmapper/OLEHandler.hxx13
-rw-r--r--writerfilter/source/dmapper/PageBordersHandler.cxx11
-rw-r--r--writerfilter/source/dmapper/PageBordersHandler.hxx12
-rw-r--r--writerfilter/source/dmapper/PropertyIds.hxx508
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx39
-rw-r--r--writerfilter/source/dmapper/PropertyMap.hxx2
-rw-r--r--writerfilter/source/dmapper/SectionColumnHandler.cxx15
-rw-r--r--writerfilter/source/dmapper/SectionColumnHandler.hxx12
-rw-r--r--writerfilter/source/dmapper/SettingsTable.cxx44
-rw-r--r--writerfilter/source/dmapper/SettingsTable.hxx19
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx159
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.hxx39
-rw-r--r--writerfilter/source/dmapper/TDefTableHandler.cxx17
-rw-r--r--writerfilter/source/dmapper/TDefTableHandler.hxx13
-rw-r--r--writerfilter/source/dmapper/TblStylePrHandler.cxx15
-rw-r--r--writerfilter/source/dmapper/TblStylePrHandler.hxx12
-rw-r--r--writerfilter/source/dmapper/ThemeTable.cxx16
-rw-r--r--writerfilter/source/dmapper/ThemeTable.hxx15
-rw-r--r--writerfilter/source/dmapper/WrapPolygonHandler.cxx216
-rw-r--r--writerfilter/source/dmapper/WrapPolygonHandler.hxx91
-rw-r--r--writerfilter/source/dmapper/dmapperLoggers.hxx1
-rw-r--r--writerfilter/source/dmapper/makefile.mk8
-rw-r--r--writerfilter/source/filter/ImportFilter.cxx7
-rw-r--r--writerfilter/source/filter/WriterFilter.cxx5
-rw-r--r--writerfilter/source/filter/WriterFilterDetection.cxx2
-rw-r--r--writerfilter/source/ooxml/OOXMLFactory.cxx57
-rw-r--r--writerfilter/source/ooxml/OOXMLFactory.hxx3
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx326
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.hxx7
-rw-r--r--writerfilter/source/ooxml/OOXMLFastHelper.hxx73
-rw-r--r--writerfilter/source/ooxml/OOXMLParserState.cxx5
-rw-r--r--writerfilter/source/ooxml/OOXMLParserState.hxx5
-rw-r--r--writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx11
-rw-r--r--writerfilter/source/ooxml/analyzemodel.xsl1
-rw-r--r--writerfilter/source/ooxml/effort.xsl59
-rw-r--r--writerfilter/source/ooxml/factory_ns.xsl11
-rw-r--r--writerfilter/source/ooxml/factoryimpl.xsl24
-rw-r--r--writerfilter/source/ooxml/factoryimpl_ns.xsl230
-rw-r--r--writerfilter/source/ooxml/model.xml699
-rw-r--r--writerfilter/source/ooxml/namespaceids.xsl2
-rw-r--r--writerfilter/source/resourcemodel/Fraction.cxx150
-rw-r--r--writerfilter/source/resourcemodel/LoggedResources.cxx322
-rw-r--r--writerfilter/source/resourcemodel/TagLogger.cxx27
-rw-r--r--writerfilter/source/resourcemodel/XPathLogger.cxx (renamed from filter/source/graphicfilter/eppm/dlgeppm.hxx)81
-rw-r--r--writerfilter/source/resourcemodel/makefile.mk13
-rw-r--r--writerfilter/source/resourcemodel/namespace_preprocess.pl25
-rw-r--r--writerfilter/unocomponent/component.cxx6
-rw-r--r--writerfilter/unocomponent/exports.dxp1
-rw-r--r--writerfilter/util/makefile.mk6
-rw-r--r--writerfilter/util/writerfilter.component42
-rw-r--r--writerperfect/prj/build.lst2
-rw-r--r--writerperfect/prj/d.lst1
-rw-r--r--writerperfect/source/stream/WPXSvStream.cxx2
-rw-r--r--writerperfect/source/wpdimp/wpft_genericfilter.cxx50
-rw-r--r--writerperfect/util/makefile.mk8
-rw-r--r--writerperfect/util/wpft.component35
-rw-r--r--xmerge/prj/build.lst2
-rw-r--r--xmerge/prj/d.lst1
-rw-r--r--xmerge/source/bridge/XMergeBridge.component34
-rw-r--r--xmerge/source/bridge/java/XMergeBridge.java22
-rw-r--r--xmerge/source/bridge/makefile.mk8
776 files changed, 25438 insertions, 23130 deletions
diff --git a/filter/inc/filter.hrc b/filter/inc/filter.hrc
index 4bea3330f617..2bbf94ed50c7 100644
--- a/filter/inc/filter.hrc
+++ b/filter/inc/filter.hrc
@@ -55,12 +55,11 @@
// warning, next range is RID_FILTER_START + 100 !
-#define HID_FILTER_XSLT_START (HID_FILTER_START + 0) // see source/xsltdialog/xmlfilterhelpids.hrc for range
-#define HID_FILTER_XSLT_END (HID_FILTER_START + 99)
-#define HID_FILTER_PDF_OPTIONS (HID_FILTER_START + 100)
-#define HID_FILTER_PDF_INITIAL_VIEW (HID_FILTER_START + 101)
-#define HID_FILTER_PDF_USER_INTERFACE (HID_FILTER_START + 102)
-#define HID_FILTER_PDF_SECURITY (HID_FILTER_START + 103)
-#define HID_FILTER_PDF_LINKS (HID_FILTER_START + 104)
+#define HID_FILTER_PDF_OPTIONS "HID_FILTER_PDF_OPTIONS"
+#define HID_FILTER_PDF_INITIAL_VIEW "HID_FILTER_PDF_INITIAL_VIEW"
+#define HID_FILTER_PDF_USER_INTERFACE "HID_FILTER_PDF_USER_INTERFACE"
+#define HID_FILTER_PDF_SECURITY "HID_FILTER_PDF_SECURITY"
+#define HID_FILTER_PDF_LINKS "HID_FILTER_PDF_LINKS"
+
#endif
diff --git a/filter/inc/filter/msfilter/escherex.hxx b/filter/inc/filter/msfilter/escherex.hxx
index 35e560025a5f..b04a18e04041 100644
--- a/filter/inc/filter/msfilter/escherex.hxx
+++ b/filter/inc/filter/msfilter/escherex.hxx
@@ -656,15 +656,15 @@ enum ESCHER_LineCap
// Transform
#define ESCHER_Prop_Rotation 4 /* Fixed Point 16.16 degrees */
// Protection
-#define ESCHER_Prop_LockRotation 119 /* BOOL No rotation */
-#define ESCHER_Prop_LockAspectRatio 120 /* BOOL Don't allow changes in aspect ratio */
-#define ESCHER_Prop_LockPosition 121 /* BOOL Don't allow the shape to be moved */
-#define ESCHER_Prop_LockAgainstSelect 122 /* BOOL Shape may not be selected */
-#define ESCHER_Prop_LockCropping 123 /* BOOL No cropping this shape */
-#define ESCHER_Prop_LockVertices 124 /* BOOL Edit Points not allowed */
-#define ESCHER_Prop_LockText 125 /* BOOL Do not edit text */
-#define ESCHER_Prop_LockAdjustHandles 126 /* BOOL Do not adjust */
-#define ESCHER_Prop_LockAgainstGrouping 127 /* BOOL Do not group this shape */
+#define ESCHER_Prop_LockRotation 119 /* sal_Bool No rotation */
+#define ESCHER_Prop_LockAspectRatio 120 /* sal_Bool Don't allow changes in aspect ratio */
+#define ESCHER_Prop_LockPosition 121 /* sal_Bool Don't allow the shape to be moved */
+#define ESCHER_Prop_LockAgainstSelect 122 /* sal_Bool Shape may not be selected */
+#define ESCHER_Prop_LockCropping 123 /* sal_Bool No cropping this shape */
+#define ESCHER_Prop_LockVertices 124 /* sal_Bool Edit Points not allowed */
+#define ESCHER_Prop_LockText 125 /* sal_Bool Do not edit text */
+#define ESCHER_Prop_LockAdjustHandles 126 /* sal_Bool Do not adjust */
+#define ESCHER_Prop_LockAgainstGrouping 127 /* sal_Bool Do not group this shape */
// Text
#define ESCHER_Prop_lTxid 128 /* LONG id for the text, value determined by the host */
#define ESCHER_Prop_dxTextLeft 129 /* LONG margins relative to shape's inscribed */
@@ -678,11 +678,11 @@ enum ESCHER_LineCap
#define ESCHER_Prop_cdirFont 137 /* MSOCDIR Font rotation */
#define ESCHER_Prop_hspNext 138 /* MSOHSP ID of the next shape (used by Word for linked textboxes) */
#define ESCHER_Prop_txdir 139 /* MSOTXDIR Bi-Di Text direction */
-#define ESCHER_Prop_SelectText 187 /* BOOL TRUE if single click selects text, FALSE if two clicks */
-#define ESCHER_Prop_AutoTextMargin 188 /* BOOL use host's margin calculations */
-#define ESCHER_Prop_RotateText 189 /* BOOL Rotate text with shape */
-#define ESCHER_Prop_FitShapeToText 190 /* BOOL Size shape to fit text size */
-#define ESCHER_Prop_FitTextToShape 191 /* BOOL Size text to fit shape size */
+#define ESCHER_Prop_SelectText 187 /* sal_Bool sal_True if single click selects text, sal_False if two clicks */
+#define ESCHER_Prop_AutoTextMargin 188 /* sal_Bool use host's margin calculations */
+#define ESCHER_Prop_RotateText 189 /* sal_Bool Rotate text with shape */
+#define ESCHER_Prop_FitShapeToText 190 /* sal_Bool Size shape to fit text size */
+#define ESCHER_Prop_FitTextToShape 191 /* sal_Bool Size text to fit shape size */
// GeoText
#define ESCHER_Prop_gtextUNICODE 192 /* WCHAR* UNICODE text string */
#define ESCHER_Prop_gtextRTF 193 /* char* RTF text string */
@@ -690,22 +690,22 @@ enum ESCHER_LineCap
#define ESCHER_Prop_gtextSize 195 /* LONG default point size */
#define ESCHER_Prop_gtextSpacing 196 /* LONG fixed point 16.16 */
#define ESCHER_Prop_gtextFont 197 /* WCHAR* font family name */
-#define ESCHER_Prop_gtextFReverseRows 240 /* BOOL Reverse row order */
-#define ESCHER_Prop_fGtext 241 /* BOOL Has text effect */
-#define ESCHER_Prop_gtextFVertical 242 /* BOOL Rotate characters */
-#define ESCHER_Prop_gtextFKern 243 /* BOOL Kern characters */
-#define ESCHER_Prop_gtextFTight 244 /* BOOL Tightening or tracking */
-#define ESCHER_Prop_gtextFStretch 245 /* BOOL Stretch to fit shape */
-#define ESCHER_Prop_gtextFShrinkFit 246 /* BOOL Char bounding box */
-#define ESCHER_Prop_gtextFBestFit 247 /* BOOL Scale text-on-path */
-#define ESCHER_Prop_gtextFNormalize 248 /* BOOL Stretch char height */
-#define ESCHER_Prop_gtextFDxMeasure 249 /* BOOL Do not measure along path */
-#define ESCHER_Prop_gtextFBold 250 /* BOOL Bold font */
-#define ESCHER_Prop_gtextFItalic 251 /* BOOL Italic font */
-#define ESCHER_Prop_gtextFUnderline 252 /* BOOL Underline font */
-#define ESCHER_Prop_gtextFShadow 253 /* BOOL Shadow font */
-#define ESCHER_Prop_gtextFSmallcaps 254 /* BOOL Small caps font */
-#define ESCHER_Prop_gtextFStrikethrough 255 /* BOOL Strike through font */
+#define ESCHER_Prop_gtextFReverseRows 240 /* sal_Bool Reverse row order */
+#define ESCHER_Prop_fGtext 241 /* sal_Bool Has text effect */
+#define ESCHER_Prop_gtextFVertical 242 /* sal_Bool Rotate characters */
+#define ESCHER_Prop_gtextFKern 243 /* sal_Bool Kern characters */
+#define ESCHER_Prop_gtextFTight 244 /* sal_Bool Tightening or tracking */
+#define ESCHER_Prop_gtextFStretch 245 /* sal_Bool Stretch to fit shape */
+#define ESCHER_Prop_gtextFShrinkFit 246 /* sal_Bool Char bounding box */
+#define ESCHER_Prop_gtextFBestFit 247 /* sal_Bool Scale text-on-path */
+#define ESCHER_Prop_gtextFNormalize 248 /* sal_Bool Stretch char height */
+#define ESCHER_Prop_gtextFDxMeasure 249 /* sal_Bool Do not measure along path */
+#define ESCHER_Prop_gtextFBold 250 /* sal_Bool Bold font */
+#define ESCHER_Prop_gtextFItalic 251 /* sal_Bool Italic font */
+#define ESCHER_Prop_gtextFUnderline 252 /* sal_Bool Underline font */
+#define ESCHER_Prop_gtextFShadow 253 /* sal_Bool Shadow font */
+#define ESCHER_Prop_gtextFSmallcaps 254 /* sal_Bool Small caps font */
+#define ESCHER_Prop_gtextFStrikethrough 255 /* sal_Bool Strike through font */
// Blip
#define ESCHER_Prop_cropFromTop 256 /* LONG 16.16 fraction times total */
#define ESCHER_Prop_cropFromBottom 257 /* LONG image width or height, */
@@ -725,10 +725,10 @@ enum ESCHER_LineCap
#define ESCHER_Prop_pibPrint 271 /* IMsoBlip* Blip to display when printing */
#define ESCHER_Prop_pibPrintName 272 /* WCHAR* Blip file name */
#define ESCHER_Prop_pibPrintFlags 273 /* MSOBLIPFLAGS Blip flags */
-#define ESCHER_Prop_fNoHitTestPicture 316 /* BOOL Do not hit test the picture */
-#define ESCHER_Prop_pictureGray 317 /* BOOL grayscale display */
-#define ESCHER_Prop_pictureBiLevel 318 /* BOOL bi-level display */
-#define ESCHER_Prop_pictureActive 319 /* BOOL Server is active (OLE objects only) */
+#define ESCHER_Prop_fNoHitTestPicture 316 /* sal_Bool Do not hit test the picture */
+#define ESCHER_Prop_pictureGray 317 /* sal_Bool grayscale display */
+#define ESCHER_Prop_pictureBiLevel 318 /* sal_Bool bi-level display */
+#define ESCHER_Prop_pictureActive 319 /* sal_Bool Server is active (OLE objects only) */
// Geometry
#define ESCHER_Prop_geoLeft 320 /* LONG Defines the G (geometry) coordinate space. */
#define ESCHER_Prop_geoTop 321 /* LONG */
@@ -747,12 +747,12 @@ enum ESCHER_LineCap
#define ESCHER_Prop_adjust8Value 334 /* LONG */
#define ESCHER_Prop_adjust9Value 335 /* LONG */
#define ESCHER_Prop_adjust10Value 336 /* LONG */
-#define ESCHER_Prop_fShadowOK 378 /* BOOL Shadow may be set */
-#define ESCHER_Prop_f3DOK 379 /* BOOL 3D may be set */
-#define ESCHER_Prop_fLineOK 380 /* BOOL Line style may be set */
-#define ESCHER_Prop_fGtextOK 381 /* BOOL Text effect (FontWork) supported */
-#define ESCHER_Prop_fFillShadeShapeOK 382 /* BOOL */
-#define ESCHER_Prop_fFillOK 383 /* BOOL OK to fill the shape through the UI or VBA? */
+#define ESCHER_Prop_fShadowOK 378 /* sal_Bool Shadow may be set */
+#define ESCHER_Prop_f3DOK 379 /* sal_Bool 3D may be set */
+#define ESCHER_Prop_fLineOK 380 /* sal_Bool Line style may be set */
+#define ESCHER_Prop_fGtextOK 381 /* sal_Bool Text effect (FontWork) supported */
+#define ESCHER_Prop_fFillShadeShapeOK 382 /* sal_Bool */
+#define ESCHER_Prop_fFillOK 383 /* sal_Bool OK to fill the shape through the UI or VBA? */
// FillStyle
#define ESCHER_Prop_fillType 384 /* ESCHER_FillStyle Type of fill */
#define ESCHER_Prop_fillColor 385 /* MSOCLR Foreground color */
@@ -783,11 +783,11 @@ enum ESCHER_LineCap
#define ESCHER_Prop_fillShapeOriginX 410 /* LONG */
#define ESCHER_Prop_fillShapeOriginY 411 /* LONG */
#define ESCHER_Prop_fillShadeType 412 /* MSOSHADETYPE Type of shading, if a shaded (gradient) fill. */
-#define ESCHER_Prop_fFilled 443 /* BOOL Is shape filled? */
-#define ESCHER_Prop_fHitTestFill 444 /* BOOL Should we hit test fill? */
-#define ESCHER_Prop_fillShape 445 /* BOOL Register pattern on shape */
-#define ESCHER_Prop_fillUseRect 446 /* BOOL Use the large rect? */
-#define ESCHER_Prop_fNoFillHitTest 447 /* BOOL Hit test a shape as though filled */
+#define ESCHER_Prop_fFilled 443 /* sal_Bool Is shape filled? */
+#define ESCHER_Prop_fHitTestFill 444 /* sal_Bool Should we hit test fill? */
+#define ESCHER_Prop_fillShape 445 /* sal_Bool Register pattern on shape */
+#define ESCHER_Prop_fillUseRect 446 /* sal_Bool Use the large rect? */
+#define ESCHER_Prop_fNoFillHitTest 447 /* sal_Bool Hit test a shape as though filled */
// LineStyle
#define ESCHER_Prop_lineColor 448 /* MSOCLR Color of line */
#define ESCHER_Prop_lineOpacity 449 /* LONG Not implemented */
@@ -813,11 +813,11 @@ enum ESCHER_LineCap
#define ESCHER_Prop_lineEndArrowLength 469 /* MSOLINEENDLENGTH Arrow at end */
#define ESCHER_Prop_lineJoinStyle 470 /* MSOLINEJOIN How to join lines */
#define ESCHER_Prop_lineEndCapStyle 471 /* MSOLINECAP How to end lines */
-#define ESCHER_Prop_fArrowheadsOK 507 /* BOOL Allow arrowheads if prop. is set */
-#define ESCHER_Prop_fLine 508 /* BOOL Any line? */
-#define ESCHER_Prop_fHitTestLine 509 /* BOOL Should we hit test lines? */
-#define ESCHER_Prop_lineFillShape 510 /* BOOL Register pattern on shape */
-#define ESCHER_Prop_fNoLineDrawDash 511 /* BOOL Draw a dashed line if no line */
+#define ESCHER_Prop_fArrowheadsOK 507 /* sal_Bool Allow arrowheads if prop. is set */
+#define ESCHER_Prop_fLine 508 /* sal_Bool Any line? */
+#define ESCHER_Prop_fHitTestLine 509 /* sal_Bool Should we hit test lines? */
+#define ESCHER_Prop_lineFillShape 510 /* sal_Bool Register pattern on shape */
+#define ESCHER_Prop_fNoLineDrawDash 511 /* sal_Bool Draw a dashed line if no line */
// ShadowStyle
#define ESCHER_Prop_shadowType 512 /* MSOSHADOWTYPE Type of effect */
#define ESCHER_Prop_shadowColor 513 /* MSOCLR Foreground color */
@@ -837,8 +837,8 @@ enum ESCHER_LineCap
#define ESCHER_Prop_shadowWeight 527 /* LONG scaling factor */
#define ESCHER_Prop_shadowOriginX 528 /* LONG */
#define ESCHER_Prop_shadowOriginY 529 /* LONG */
-#define ESCHER_Prop_fShadow 574 /* BOOL Any shadow? */
-#define ESCHER_Prop_fshadowObscured 575 /* BOOL Excel5-style shadow */
+#define ESCHER_Prop_fShadow 574 /* sal_Bool Any shadow? */
+#define ESCHER_Prop_fshadowObscured 575 /* sal_Bool Excel5-style shadow */
// PerspectiveStyle
#define ESCHER_Prop_perspectiveType 576 /* MSOXFORMTYPE Where transform applies */
#define ESCHER_Prop_perspectiveOffsetX 577 /* LONG The LONG values define a */
@@ -852,7 +852,7 @@ enum ESCHER_LineCap
#define ESCHER_Prop_perspectiveWeight 585 /* LONG Scaling factor */
#define ESCHER_Prop_perspectiveOriginX 586 /* LONG */
#define ESCHER_Prop_perspectiveOriginY 587 /* LONG */
-#define ESCHER_Prop_fPerspective 639 /* BOOL On/off */
+#define ESCHER_Prop_fPerspective 639 /* sal_Bool On/off */
// 3D Object
#define ESCHER_Prop_c3DSpecularAmt 640 /* LONG Fixed-point 16.16 */
#define ESCHER_Prop_c3DDiffuseAmt 641 /* LONG Fixed-point 16.16 */
@@ -863,10 +863,10 @@ enum ESCHER_LineCap
#define ESCHER_Prop_c3DExtrudePlane 646 /* LONG Extrusion direction */
#define ESCHER_Prop_c3DExtrusionColor 647 /* MSOCLR Basic color of extruded part of shape; the lighting model used will determine the exact shades used when rendering. */
#define ESCHER_Prop_c3DCrMod 648 /* MSOCLR Modification for BW views */
-#define ESCHER_Prop_f3D 700 /* BOOL Does this shape have a 3D effect? */
-#define ESCHER_Prop_fc3DMetallic 701 /* BOOL Use metallic specularity? */
-#define ESCHER_Prop_fc3DUseExtrusionColor 702 /* BOOL */
-#define ESCHER_Prop_fc3DLightFace 703 /* BOOL */
+#define ESCHER_Prop_f3D 700 /* sal_Bool Does this shape have a 3D effect? */
+#define ESCHER_Prop_fc3DMetallic 701 /* sal_Bool Use metallic specularity? */
+#define ESCHER_Prop_fc3DUseExtrusionColor 702 /* sal_Bool */
+#define ESCHER_Prop_fc3DLightFace 703 /* sal_Bool */
// 3D Style
#define ESCHER_Prop_c3DYRotationAngle 704 /* LONG degrees (16.16) about y axis */
#define ESCHER_Prop_c3DXRotationAngle 705 /* LONG degrees (16.16) about x axis */
@@ -895,22 +895,22 @@ enum ESCHER_LineCap
#define ESCHER_Prop_c3DFillY 728 /* LONG tion; only their relative */
#define ESCHER_Prop_c3DFillZ 729 /* LONG magnitudes matter */
#define ESCHER_Prop_c3DFillIntensity 730 /* LONG Fixed point intensity */
-#define ESCHER_Prop_fc3DConstrainRotation 763 /* BOOL */
-#define ESCHER_Prop_fc3DRotationCenterAuto 764 /* BOOL */
-#define ESCHER_Prop_fc3DParallel 765 /* BOOL Parallel projection? */
-#define ESCHER_Prop_fc3DKeyHarsh 766 /* BOOL Is key lighting harsh? */
-#define ESCHER_Prop_fc3DFillHarsh 767 /* BOOL Is fill lighting harsh? */
+#define ESCHER_Prop_fc3DConstrainRotation 763 /* sal_Bool */
+#define ESCHER_Prop_fc3DRotationCenterAuto 764 /* sal_Bool */
+#define ESCHER_Prop_fc3DParallel 765 /* sal_Bool Parallel projection? */
+#define ESCHER_Prop_fc3DKeyHarsh 766 /* sal_Bool Is key lighting harsh? */
+#define ESCHER_Prop_fc3DFillHarsh 767 /* sal_Bool Is fill lighting harsh? */
// Shape
#define ESCHER_Prop_hspMaster 769 /* MSOHSP master shape */
#define ESCHER_Prop_cxstyle 771 /* MSOCXSTYLE Type of connector */
#define ESCHER_Prop_bWMode 772 /* ESCHERwMode Settings for modifications to */
#define ESCHER_Prop_bWModePureBW 773 /* ESCHERwMode be made when in different */
#define ESCHER_Prop_bWModeBW 774 /* ESCHERwMode forms of black-and-white mode. */
-#define ESCHER_Prop_fOleIcon 826 /* BOOL For OLE objects, whether the object is in icon form */
-#define ESCHER_Prop_fPreferRelativeResize 827 /* BOOL For UI only. Prefer relative resizing. */
-#define ESCHER_Prop_fLockShapeType 828 /* BOOL Lock the shape type (don't allow Change Shape) */
-#define ESCHER_Prop_fDeleteAttachedObject 830 /* BOOL */
-#define ESCHER_Prop_fBackground 831 /* BOOL If TRUE, this is the background shape. */
+#define ESCHER_Prop_fOleIcon 826 /* sal_Bool For OLE objects, whether the object is in icon form */
+#define ESCHER_Prop_fPreferRelativeResize 827 /* sal_Bool For UI only. Prefer relative resizing. */
+#define ESCHER_Prop_fLockShapeType 828 /* sal_Bool Lock the shape type (don't allow Change Shape) */
+#define ESCHER_Prop_fDeleteAttachedObject 830 /* sal_Bool */
+#define ESCHER_Prop_fBackground 831 /* sal_Bool If sal_True, this is the background shape. */
// Callout
#define ESCHER_Prop_spcot 832 /* MSOSPCOT Callout type */
#define ESCHER_Prop_dxyCalloutGap 833 /* LONG Distance from box to first point.(EMUs) */
@@ -918,13 +918,13 @@ enum ESCHER_LineCap
#define ESCHER_Prop_spcod 835 /* MSOSPCOD Callout drop type */
#define ESCHER_Prop_dxyCalloutDropSpecified 836 /* LONG if msospcodSpecified, the actual drop distance */
#define ESCHER_Prop_dxyCalloutLengthSpecified 837 /* LONG if fCalloutLengthSpecified, the actual distance */
-#define ESCHER_Prop_fCallout 889 /* BOOL Is the shape a callout? */
-#define ESCHER_Prop_fCalloutAccentBar 890 /* BOOL does callout have accent bar */
-#define ESCHER_Prop_fCalloutTextBorder 891 /* BOOL does callout have a text border */
-#define ESCHER_Prop_fCalloutMinusX 892 /* BOOL */
-#define ESCHER_Prop_fCalloutMinusY 893 /* BOOL */
-#define ESCHER_Prop_fCalloutDropAuto 894 /* BOOL If true, then we occasionally invert the drop distance */
-#define ESCHER_Prop_fCalloutLengthSpecified 895 /* BOOL if true, we look at dxyCalloutLengthSpecified */
+#define ESCHER_Prop_fCallout 889 /* sal_Bool Is the shape a callout? */
+#define ESCHER_Prop_fCalloutAccentBar 890 /* sal_Bool does callout have accent bar */
+#define ESCHER_Prop_fCalloutTextBorder 891 /* sal_Bool does callout have a text border */
+#define ESCHER_Prop_fCalloutMinusX 892 /* sal_Bool */
+#define ESCHER_Prop_fCalloutMinusY 893 /* sal_Bool */
+#define ESCHER_Prop_fCalloutDropAuto 894 /* sal_Bool If true, then we occasionally invert the drop distance */
+#define ESCHER_Prop_fCalloutLengthSpecified 895 /* sal_Bool if true, we look at dxyCalloutLengthSpecified */
// GroupShape
#define ESCHER_Prop_wzName 896 /* WCHAR* Shape Name (present only if explicitly set) */
#define ESCHER_Prop_wzDescription 897 /* WCHAR* alternate text */
@@ -937,13 +937,13 @@ enum ESCHER_LineCap
#define ESCHER_Prop_lidRegroup 904 /* LONG Regroup ID */
#define ESCHER_Prop_tableProperties 927
#define ESCHER_Prop_tableRowProperties 928
-#define ESCHER_Prop_fEditedWrap 953 /* BOOL Has the wrap polygon been edited? */
-#define ESCHER_Prop_fBehindDocument 954 /* BOOL Word-only (shape is behind text) */
-#define ESCHER_Prop_fOnDblClickNotify 955 /* BOOL Notify client on a double click */
-#define ESCHER_Prop_fIsButton 956 /* BOOL A button shape (i.e., clicking performs an action). Set for shapes with attached hyperlinks or macros. */
-#define ESCHER_Prop_fOneD 957 /* BOOL 1D adjustment */
-#define ESCHER_Prop_fHidden 958 /* BOOL Do not display */
-#define ESCHER_Prop_fPrint 959 /* BOOL Print this shape */
+#define ESCHER_Prop_fEditedWrap 953 /* sal_Bool Has the wrap polygon been edited? */
+#define ESCHER_Prop_fBehindDocument 954 /* sal_Bool Word-only (shape is behind text) */
+#define ESCHER_Prop_fOnDblClickNotify 955 /* sal_Bool Notify client on a double click */
+#define ESCHER_Prop_fIsButton 956 /* sal_Bool A button shape (i.e., clicking performs an action). Set for shapes with attached hyperlinks or macros. */
+#define ESCHER_Prop_fOneD 957 /* sal_Bool 1D adjustment */
+#define ESCHER_Prop_fHidden 958 /* sal_Bool Do not display */
+#define ESCHER_Prop_fPrint 959 /* sal_Bool Print this shape */
#define ESCHER_PERSISTENTRY_PREALLOCATE 64
@@ -1027,9 +1027,9 @@ struct EscherPropertyValueHelper
struct EscherPersistEntry
{
- UINT32 mnID;
- UINT32 mnOffset;
- EscherPersistEntry( UINT32 nId, UINT32 nOffset ) { mnID = nId; mnOffset = nOffset; };
+ sal_uInt32 mnID;
+ sal_uInt32 mnOffset;
+ EscherPersistEntry( sal_uInt32 nId, sal_uInt32 nOffset ) { mnID = nId; mnOffset = nOffset; };
};
@@ -1043,12 +1043,12 @@ class EscherBlibEntry
protected:
- UINT32 mnIdentifier[ 4 ];
- UINT32 mnPictureOffset; // offset auf die grafik im PictureStreams
- UINT32 mnSize; // size of real graphic
+ sal_uInt32 mnIdentifier[ 4 ];
+ sal_uInt32 mnPictureOffset; // offset auf die grafik im PictureStreams
+ sal_uInt32 mnSize; // size of real graphic
- UINT32 mnRefCount; // !! reference count
- UINT32 mnSizeExtra; // !! size of preceding header
+ sal_uInt32 mnRefCount; // !! reference count
+ sal_uInt32 mnSizeExtra; // !! size of preceding header
ESCHER_BlibType meBlibType;
@@ -1068,7 +1068,7 @@ class EscherBlibEntry
void WriteBlibEntry( SvStream& rSt, sal_Bool bWritePictureOffset, sal_uInt32 nResize = 0 );
sal_Bool IsEmpty() const { return mbIsEmpty; };
- BOOL operator==( const EscherBlibEntry& ) const;
+ sal_Bool operator==( const EscherBlibEntry& ) const;
};
// ---------------------------------------------------------------------------------------------
@@ -1086,7 +1086,7 @@ class MSFILTER_DLLPUBLIC EscherGraphicProvider
protected :
- UINT32 ImplInsertBlib( EscherBlibEntry* p_EscherBlibEntry );
+ sal_uInt32 ImplInsertBlib( EscherBlibEntry* p_EscherBlibEntry );
public :
@@ -1263,13 +1263,13 @@ class MSFILTER_DLLPUBLIC EscherPersistTable
public:
List maPersistTable;
- BOOL PtIsID( UINT32 nID );
- void PtInsert( UINT32 nID, UINT32 nOfs );
- UINT32 PtDelete( UINT32 nID );
- UINT32 PtGetOffsetByID( UINT32 nID );
- UINT32 PtReplace( UINT32 nID, UINT32 nOfs );
- UINT32 PtReplaceOrInsert( UINT32 nID, UINT32 nOfs );
- UINT32 PtGetCount() const { return maPersistTable.Count(); };
+ sal_Bool PtIsID( sal_uInt32 nID );
+ void PtInsert( sal_uInt32 nID, sal_uInt32 nOfs );
+ sal_uInt32 PtDelete( sal_uInt32 nID );
+ sal_uInt32 PtGetOffsetByID( sal_uInt32 nID );
+ sal_uInt32 PtReplace( sal_uInt32 nID, sal_uInt32 nOfs );
+ sal_uInt32 PtReplaceOrInsert( sal_uInt32 nID, sal_uInt32 nOfs );
+ sal_uInt32 PtGetCount() const { return maPersistTable.Count(); };
EscherPersistTable();
virtual ~EscherPersistTable();
@@ -1309,7 +1309,7 @@ public:
class InteractionInfo
{
- bool mbHasInteraction;
+ bool mbHasInteraction;
std::auto_ptr<SvMemoryStream> mpHyperlinkRecord;
InteractionInfo();
public:
@@ -1329,11 +1329,11 @@ private:
EscherExClientRecord_Base* pClientTextbox;
InteractionInfo* pInteractionInfo;
// ignore single shape if entire pages are written
- BOOL bDontWriteShape;
+ sal_Bool bDontWriteShape;
public:
EscherExHostAppData() : pClientAnchor(0), pClientData(0),
- pClientTextbox(0), pInteractionInfo(0), bDontWriteShape(FALSE)
+ pClientTextbox(0), pInteractionInfo(0), bDontWriteShape(sal_False)
{}
void SetInteractionInfo( InteractionInfo* p )
@@ -1344,7 +1344,7 @@ public:
{ pClientData = p; }
void SetClientTextbox( EscherExClientRecord_Base* p )
{ pClientTextbox = p; }
- void SetDontWriteShape( BOOL b )
+ void SetDontWriteShape( sal_Bool b )
{ bDontWriteShape = b; }
InteractionInfo* GetInteractionInfo() const
{ return pInteractionInfo; }
@@ -1356,13 +1356,13 @@ public:
{ return pClientTextbox; }
void WriteClientAnchor( EscherEx& rEx, const Rectangle& rRect )
- { if( pClientAnchor ) pClientAnchor->WriteData( rEx, rRect ); }
+ { if( pClientAnchor ) pClientAnchor->WriteData( rEx, rRect ); }
void WriteClientData( EscherEx& rEx )
- { if( pClientData ) pClientData->WriteData( rEx ); }
+ { if( pClientData ) pClientData->WriteData( rEx ); }
void WriteClientTextbox( EscherEx& rEx )
- { if( pClientTextbox ) pClientTextbox->WriteData( rEx ); }
+ { if( pClientTextbox ) pClientTextbox->WriteData( rEx ); }
- BOOL DontWriteShape() const { return bDontWriteShape; }
+ sal_Bool DontWriteShape() const { return bDontWriteShape; }
};
@@ -1462,22 +1462,22 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable
EscherExGlobalRef mxGlobal;
ImplEscherExSdrPtr mpImplEscherExSdr;
SvStream* mpOutStrm;
- UINT32 mnStrmStartOfs;
+ sal_uInt32 mnStrmStartOfs;
std::vector< sal_uInt32 > mOffsets;
std::vector< sal_uInt16 > mRecTypes;
- UINT32 mnCurrentDg;
- UINT32 mnCountOfs;
+ sal_uInt32 mnCurrentDg;
+ sal_uInt32 mnCountOfs;
- UINT32 mnGroupLevel;
- UINT16 mnHellLayerId;
+ sal_uInt32 mnGroupLevel;
+ sal_uInt16 mnHellLayerId;
- BOOL mbEscherSpgr;
- BOOL mbEscherDg;
- BOOL mbOleEmf; // OLE is EMF instead of WMF
+ sal_Bool mbEscherSpgr;
+ sal_Bool mbEscherDg;
+ sal_Bool mbOleEmf; // OLE is EMF instead of WMF
- virtual BOOL DoSeek( UINT32 nKey );
+ virtual sal_Bool DoSeek( sal_uInt32 nKey );
public:
explicit EscherEx( const EscherExGlobalRef& rxGlobal, SvStream& rOutStrm );
@@ -1525,17 +1525,17 @@ public:
*/
void InsertAtCurrentPos( sal_uInt32 nBytes, bool bExpandEndOfAtom );
- void InsertPersistOffset( UINT32 nKey, UINT32 nOffset ); // Es wird nicht geprueft, ob sich jener schluessel schon in der PersistantTable befindet
- void ReplacePersistOffset( UINT32 nKey, UINT32 nOffset );
- UINT32 GetPersistOffset( UINT32 nKey );
- BOOL SeekToPersistOffset( UINT32 nKey );
- virtual BOOL InsertAtPersistOffset( UINT32 nKey, UINT32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die
+ void InsertPersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset ); // Es wird nicht geprueft, ob sich jener schluessel schon in der PersistantTable befindet
+ void ReplacePersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset );
+ sal_uInt32 GetPersistOffset( sal_uInt32 nKey );
+ sal_Bool SeekToPersistOffset( sal_uInt32 nKey );
+ virtual sal_Bool InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die
// aktuelle StreamPosition aendert
SvStream& GetStream() const { return *mpOutStrm; }
- ULONG GetStreamPos() const { return mpOutStrm->Tell(); }
+ sal_uLong GetStreamPos() const { return mpOutStrm->Tell(); }
- virtual BOOL SeekBehindRecHeader( UINT16 nRecType ); // der stream muss vor einem gueltigen Record Header oder Atom stehen
+ virtual sal_Bool SeekBehindRecHeader( sal_uInt16 nRecType ); // der stream muss vor einem gueltigen Record Header oder Atom stehen
// features beim erzeugen folgender Container:
//
@@ -1544,29 +1544,29 @@ public:
// ESCHER_SpgrContainer:
// ESCHER_SpContainer:
- virtual void OpenContainer( UINT16 nEscherContainer, int nRecInstance = 0 );
+ virtual void OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance = 0 );
virtual void CloseContainer();
virtual void BeginAtom();
- virtual void EndAtom( UINT16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
- virtual void AddAtom( UINT32 nAtomSitze, UINT16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
+ virtual void EndAtom( sal_uInt16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
+ virtual void AddAtom( sal_uInt32 nAtomSitze, sal_uInt16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
virtual void AddChildAnchor( const Rectangle& rRectangle );
virtual void AddClientAnchor( const Rectangle& rRectangle );
- virtual UINT32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
- UINT32 EnterGroup( const Rectangle* pBoundRect = NULL );
- UINT32 GetGroupLevel() const { return mnGroupLevel; };
- virtual BOOL SetGroupSnapRect( UINT32 nGroupLevel, const Rectangle& rRect );
- virtual BOOL SetGroupLogicRect( UINT32 nGroupLevel, const Rectangle& rRect );
+ virtual sal_uInt32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
+ sal_uInt32 EnterGroup( const Rectangle* pBoundRect = NULL );
+ sal_uInt32 GetGroupLevel() const { return mnGroupLevel; };
+ virtual sal_Bool SetGroupSnapRect( sal_uInt32 nGroupLevel, const Rectangle& rRect );
+ virtual sal_Bool SetGroupLogicRect( sal_uInt32 nGroupLevel, const Rectangle& rRect );
virtual void LeaveGroup();
// ein ESCHER_Sp wird geschrieben ( Ein ESCHER_DgContainer muss dazu geoeffnet sein !!)
- virtual void AddShape( UINT32 nShpInstance, UINT32 nFlagIds, UINT32 nShapeID = 0 );
+ virtual void AddShape( sal_uInt32 nShpInstance, sal_uInt32 nFlagIds, sal_uInt32 nShapeID = 0 );
virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
- UINT32 GetColor( const UINT32 nColor, BOOL bSwap = TRUE );
- UINT32 GetColor( const Color& rColor, BOOL bSwap = TRUE );
+ sal_uInt32 GetColor( const sal_uInt32 nColor, sal_Bool bSwap = sal_True );
+ sal_uInt32 GetColor( const Color& rColor, sal_Bool bSwap = sal_True );
// ...Sdr... implemented in eschesdo.cxx
@@ -1574,7 +1574,7 @@ public:
void AddUnoShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
/// returns the ShapeID
- UINT32 AddSdrObject( const SdrObject& rObj );
+ sal_uInt32 AddSdrObject( const SdrObject& rObj );
/// If objects are written through AddSdrObject the
/// SolverContainer has to be written, and maybe some
@@ -1590,7 +1590,7 @@ public:
/// Called after a shape is written to inform the application
/// of the resulted shape type and ID.
- virtual void EndShape( UINT16 nShapeType, UINT32 nShapeID );
+ virtual void EndShape( sal_uInt16 nShapeType, sal_uInt32 nShapeID );
/// Called before an AdditionalText EnterGroup occurs.
/// The current shape will be written in three parts:
@@ -1611,14 +1611,14 @@ public:
virtual EscherExHostAppData* EnterAdditionalTextGroup();
/// Called if an ESCHER_Prop_lTxid shall be written
- virtual UINT32 QueryTextID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >&, UINT32 nShapeId );
+ virtual sal_uInt32 QueryTextID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >&, sal_uInt32 nShapeId );
// add an dummy rectangle shape into the escher stream
- UINT32 AddDummyShape();
+ sal_uInt32 AddDummyShape();
static const SdrObject* GetSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rXShape );
- void SetHellLayerId( UINT16 nId ) { mnHellLayerId = nId; }
- UINT16 GetHellLayerId() const { return mnHellLayerId; }
+ void SetHellLayerId( sal_uInt16 nId ) { mnHellLayerId = nId; }
+ sal_uInt16 GetHellLayerId() const { return mnHellLayerId; }
private:
EscherEx( const EscherEx& );
diff --git a/filter/inc/filter/msfilter/mscodec.hxx b/filter/inc/filter/msfilter/mscodec.hxx
index b455267b0154..63afd9456078 100644
--- a/filter/inc/filter/msfilter/mscodec.hxx
+++ b/filter/inc/filter/msfilter/mscodec.hxx
@@ -29,8 +29,11 @@
#ifndef SVX_MSCODEC_HXX
#define SVX_MSCODEC_HXX
-#include "rtl/cipher.h"
-#include "rtl/digest.h"
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
+
+#include <rtl/cipher.h>
+#include <rtl/digest.h>
#include "filter/msfilter/msfilterdllapi.h"
namespace msfilter {
@@ -53,6 +56,23 @@ 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.
+ */
+ sal_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
@@ -106,16 +126,6 @@ public:
*/
void Skip( sal_Size 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_Size nSize );
-
protected:
sal_uInt8 mpnKey[ 16 ]; /// Encryption key.
sal_Size mnOffset; /// Key offset.
@@ -186,17 +196,34 @@ public:
explicit MSCodec_Std97();
~MSCodec_Std97();
+ /** Initializes the algorithm with the encryption data.
+
+ @param aData
+ The sequence contains the necessary data to initialize
+ the codec.
+ */
+ sal_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 pPassData
Wide character array containing the password. Must be zero
terminated, which results in a maximum length of 15 characters.
- @param pUnique
+ @param pDocId
Unique document identifier read from or written to the file.
*/
void InitKey(
const sal_uInt16 pPassData[ 16 ],
- const sal_uInt8 pUnique[ 16 ] );
+ const sal_uInt8 pDocId[ 16 ] );
/** Verifies the validity of the password using the passed salt data.
@@ -321,16 +348,26 @@ public:
sal_uInt8 pSaltData[16],
sal_uInt8 pSaltDigest[16]);
-private:
+ /* allows to get the unique document id from the codec
+ */
+ void GetDocId( sal_uInt8 pDocId[16] );
+
void GetDigestFromSalt( const sal_uInt8 pSaltData[16], sal_uInt8 pDigest[16] );
private:
+ void InitKeyImpl(
+ const sal_uInt8 pKeyData[64],
+ const sal_uInt8 pDocId[16] );
+
+
+private:
MSFILTER_DLLPRIVATE MSCodec_Std97( const MSCodec_Std97& );
MSFILTER_DLLPRIVATE MSCodec_Std97& operator=( const MSCodec_Std97& );
rtlCipher m_hCipher;
rtlDigest m_hDigest;
sal_uInt8 m_pDigestValue[ RTL_DIGEST_LENGTH_MD5 ];
+ sal_uInt8 m_pDocId[16];
};
// ============================================================================
diff --git a/filter/inc/filter/msfilter/msdffimp.hxx b/filter/inc/filter/msfilter/msdffimp.hxx
index a75b8e455f7d..ffe80ed493e7 100644
--- a/filter/inc/filter/msfilter/msdffimp.hxx
+++ b/filter/inc/filter/msfilter/msdffimp.hxx
@@ -66,17 +66,17 @@ class MSFILTER_DLLPUBLIC DffRecordHeader
{
public:
- BYTE nRecVer; // may be DFF_PSFLAG_CONTAINER
- UINT16 nRecInstance;
- UINT16 nImpVerInst;
- UINT16 nRecType;
- UINT32 nRecLen;
- ULONG nFilePos;
+ sal_uInt8 nRecVer; // may be DFF_PSFLAG_CONTAINER
+ sal_uInt16 nRecInstance;
+ sal_uInt16 nImpVerInst;
+ sal_uInt16 nRecType;
+ sal_uInt32 nRecLen;
+ sal_uLong nFilePos;
public:
DffRecordHeader() : nRecVer(0), nRecInstance(0), nImpVerInst(0), nRecType(0), nRecLen(0), nFilePos(0) {}
bool IsContainer() const { return nRecVer == DFF_PSFLAG_CONTAINER; }
- ULONG GetRecBegFilePos() const { return nFilePos; }
- ULONG GetRecEndFilePos() const { return nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen; }
+ sal_uLong GetRecBegFilePos() const { return nFilePos; }
+ sal_uLong GetRecEndFilePos() const { return nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen; }
void SeekToEndOfRecord(SvStream& rIn) const { rIn.Seek(nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen ); }
void SeekToContent( SvStream& rIn) const { rIn.Seek(nFilePos + DFF_COMMON_RECORD_HEADER_SIZE ); }
void SeekToBegOfRecord(SvStream& rIn) const { rIn.Seek( nFilePos ); }
@@ -87,10 +87,10 @@ public:
struct DffPropFlags
{
- BYTE bSet : 1;
- BYTE bComplex : 1;
- BYTE bBlip : 1;
- BYTE bSoftAttr : 1;
+ sal_uInt8 bSet : 1;
+ sal_uInt8 bComplex : 1;
+ sal_uInt8 bBlip : 1;
+ sal_uInt8 bSoftAttr : 1;
};
class SvxMSDffManager;
@@ -99,23 +99,23 @@ class MSFILTER_DLLPUBLIC DffPropSet : public Table
{
protected :
- UINT32 mpContents[ 1024 ];
+ sal_uInt32 mpContents[ 1024 ];
DffPropFlags mpFlags[ 1024 ];
public :
- DffPropSet( BOOL bInitialize = FALSE ){ if ( bInitialize )
+ DffPropSet( sal_Bool bInitialize = sal_False ){ if ( bInitialize )
memset( mpFlags, 0, 0x400 * sizeof( DffPropFlags ) ); };
- inline BOOL IsProperty( UINT32 nRecType ) const { return ( mpFlags[ nRecType & 0x3ff ].bSet ); };
- BOOL IsHardAttribute( UINT32 nId ) const;
- UINT32 GetPropertyValue( UINT32 nId, UINT32 nDefault = 0 ) const;
+ inline sal_Bool IsProperty( sal_uInt32 nRecType ) const { return ( mpFlags[ nRecType & 0x3ff ].bSet ); };
+ sal_Bool IsHardAttribute( sal_uInt32 nId ) const;
+ sal_uInt32 GetPropertyValue( sal_uInt32 nId, sal_uInt32 nDefault = 0 ) const;
/** Returns a boolean property by its real identifier. */
- bool GetPropertyBool( UINT32 nId, bool bDefault = false ) const;
+ bool GetPropertyBool( sal_uInt32 nId, bool bDefault = false ) const;
/** Returns a string property. */
- ::rtl::OUString GetPropertyString( UINT32 nId, SvStream& rStrm ) const;
- void SetPropertyValue( UINT32 nId, UINT32 nValue ) const;
- BOOL SeekToContent( UINT32 nRecType, SvStream& rSt ) const;
+ ::rtl::OUString GetPropertyString( sal_uInt32 nId, SvStream& rStrm ) const;
+ void SetPropertyValue( sal_uInt32 nId, sal_uInt32 nValue ) const;
+ sal_Bool SeekToContent( sal_uInt32 nRecType, SvStream& rSt ) const;
void Merge( DffPropSet& rMasterPropSet ) const;
void InitializePropSet() const;
friend SvStream& operator>>( SvStream& rIn, DffPropSet& rPropSet );
@@ -138,19 +138,19 @@ class MSFILTER_DLLPUBLIC DffPropertyReader : public DffPropSet
public:
- INT32 mnFix16Angle;
+ sal_Int32 mnFix16Angle;
DffPropertyReader( const SvxMSDffManager& rManager );
~DffPropertyReader();
- INT32 Fix16ToAngle( INT32 nAngle ) const;
+ sal_Int32 Fix16ToAngle( sal_Int32 nAngle ) const;
#ifdef DBG_CUSTOMSHAPE
- void ReadPropSet( SvStream& rIn, void* pClientData, UINT32 nShapeType = 0 ) const;
+ void ReadPropSet( SvStream& rIn, void* pClientData, sal_uInt32 nShapeType = 0 ) const;
#else
void ReadPropSet( SvStream& rIn, void* pClientData ) const;
#endif
- void SetDefaultPropSet( SvStream& rIn, UINT32 nOffDgg ) const;
+ void SetDefaultPropSet( SvStream& rIn, sal_uInt32 nOffDgg ) const;
void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet ) const;
void ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const;
};
@@ -237,8 +237,8 @@ struct MSFILTER_DLLPUBLIC SvxMSDffSolverContainer
struct FIDCL
{
- UINT32 dgid; // DG owning the SPIDs in this cluster
- UINT32 cspidCur; // number of SPIDs used so far
+ sal_uInt32 dgid; // DG owning the SPIDs in this cluster
+ sal_uInt32 cspidCur; // number of SPIDs used so far
};
//---------------------------------------------------------------------------
@@ -246,9 +246,9 @@ struct FIDCL
//---------------------------------------------------------------------------
struct MSDffTxId
{
- USHORT nTxBxS;
- USHORT nSequence;
- MSDffTxId(USHORT nTxBxS_, USHORT nSequence_ )
+ sal_uInt16 nTxBxS;
+ sal_uInt16 nSequence;
+ MSDffTxId(sal_uInt16 nTxBxS_, sal_uInt16 nSequence_ )
: nTxBxS( nTxBxS_ ),
nSequence( nSequence_ ){}
MSDffTxId(const MSDffTxId& rCopy)
@@ -263,15 +263,15 @@ struct MSFILTER_DLLPUBLIC SvxMSDffImportRec
SdrObject* pObj;
Polygon* pWrapPolygon;
char* pClientAnchorBuffer;
- UINT32 nClientAnchorLen;
+ sal_uInt32 nClientAnchorLen;
char* pClientDataBuffer;
- UINT32 nClientDataLen;
- UINT32 nXAlign;
- UINT32 *pXRelTo;
- UINT32 nYAlign;
- UINT32 *pYRelTo;
- UINT32 nLayoutInTableCell;
- UINT32 nFlags;
+ sal_uInt32 nClientDataLen;
+ sal_uInt32 nXAlign;
+ sal_uInt32 *pXRelTo;
+ sal_uInt32 nYAlign;
+ sal_uInt32 *pYRelTo;
+ sal_uInt32 nLayoutInTableCell;
+ sal_uInt32 nFlags;
long nTextRotationAngle;
long nDxTextLeft; // Abstand der Textbox vom umgebenden Shape
long nDyTextTop;
@@ -286,26 +286,26 @@ struct MSFILTER_DLLPUBLIC SvxMSDffImportRec
long nCropFromLeft;
long nCropFromRight;
MSDffTxId aTextId; // Kennungen fuer Textboxen
- ULONG nNextShapeId; // fuer verlinkte Textboxen
- ULONG nShapeId;
+ sal_uLong nNextShapeId; // fuer verlinkte Textboxen
+ sal_uLong nShapeId;
MSO_SPT eShapeType;
MSO_LineStyle eLineStyle; // Umrandungs-Arten
MSO_LineDashing eLineDashing;
- BOOL bDrawHell :1;
- BOOL bHidden :1;
- BOOL bReplaceByFly :1;
- BOOL bLastBoxInChain :1;
- BOOL bHasUDefProp :1;
- BOOL bVFlip :1;
- BOOL bHFlip :1;
- BOOL bAutoWidth :1;
+ sal_Bool bDrawHell :1;
+ sal_Bool bHidden :1;
+ sal_Bool bReplaceByFly :1;
+ sal_Bool bLastBoxInChain :1;
+ sal_Bool bHasUDefProp :1;
+ sal_Bool bVFlip :1;
+ sal_Bool bHFlip :1;
+ sal_Bool bAutoWidth :1;
SvxMSDffImportRec();
SvxMSDffImportRec(const SvxMSDffImportRec& rCopy);
~SvxMSDffImportRec();
- BOOL operator==( const SvxMSDffImportRec& rEntry ) const
+ sal_Bool operator==( const SvxMSDffImportRec& rEntry ) const
{ return nShapeId == rEntry.nShapeId; }
- BOOL operator<( const SvxMSDffImportRec& rEntry ) const
+ sal_Bool operator<( const SvxMSDffImportRec& rEntry ) const
{ return nShapeId < rEntry.nShapeId; }
private:
SvxMSDffImportRec &operator=(const SvxMSDffImportRec&);
@@ -330,13 +330,13 @@ struct SvxMSDffImportData
SvxMSDffImportData(const Rectangle& rParentRect)
:aParentRect( rParentRect )
{}
- void SetNewRect(INT32 l, INT32 o,
- INT32 r, INT32 u ){ aNewRect = Rectangle(l,o, r,u); }
- BOOL HasParRect() const { return aParentRect.IsEmpty(); }
- BOOL HasNewRect() const { return aNewRect.IsEmpty() ; }
- BOOL HasRecords() const { return 0 != aRecords.Count(); }
- USHORT GetRecCount() const { return aRecords.Count(); }
- SvxMSDffImportRec* GetRecord(USHORT iRecord) const
+ void SetNewRect(sal_Int32 l, sal_Int32 o,
+ sal_Int32 r, sal_Int32 u ){ aNewRect = Rectangle(l,o, r,u); }
+ sal_Bool HasParRect() const { return aParentRect.IsEmpty(); }
+ sal_Bool HasNewRect() const { return aNewRect.IsEmpty() ; }
+ sal_Bool HasRecords() const { return 0 != aRecords.Count(); }
+ sal_uInt16 GetRecCount() const { return aRecords.Count(); }
+ SvxMSDffImportRec* GetRecord(sal_uInt16 iRecord) const
{ return aRecords.GetObject( iRecord ); }
};
@@ -347,16 +347,16 @@ struct DffObjData
Rectangle aBoundRect;
Rectangle aChildAnchor;
- UINT32 nShapeId;
- UINT32 nSpFlags;
+ sal_uInt32 nShapeId;
+ sal_uInt32 nSpFlags;
MSO_SPT eShapeType;
- BOOL bShapeType : 1;
- BOOL bClientAnchor : 1;
- BOOL bClientData : 1;
- BOOL bChildAnchor : 1;
- BOOL bOpt : 1;
- BOOL bIsAutoText : 1;
+ sal_Bool bShapeType : 1;
+ sal_Bool bClientAnchor : 1;
+ sal_Bool bClientData : 1;
+ sal_Bool bChildAnchor : 1;
+ sal_Bool bOpt : 1;
+ sal_Bool bIsAutoText : 1;
int nCalledByGroup;
@@ -368,12 +368,12 @@ struct DffObjData
nShapeId( 0 ),
nSpFlags( 0 ),
eShapeType( mso_sptNil ),
- bShapeType( FALSE ),
- bClientAnchor( FALSE ),
- bClientData( FALSE ),
- bChildAnchor( FALSE ),
- bOpt( FALSE ),
- bIsAutoText( FALSE ),
+ bShapeType( sal_False ),
+ bClientAnchor( sal_False ),
+ bClientData( sal_False ),
+ bChildAnchor( sal_False ),
+ bOpt( sal_False ),
+ bIsAutoText( sal_False ),
nCalledByGroup( nClByGroup ){}
};
@@ -381,8 +381,8 @@ struct DffObjData
struct DffRecordList
{
- UINT32 nCount;
- UINT32 nCurrent;
+ sal_uInt32 nCount;
+ sal_uInt32 nCurrent;
DffRecordList* pPrev;
DffRecordList* pNext;
@@ -406,10 +406,10 @@ class MSFILTER_DLLPUBLIC DffRecordManager : public DffRecordList
DffRecordList* pCList;
void Clear();
- void Consume( SvStream& rIn, BOOL bAppend = FALSE, UINT32 nStOfs = 0 );
+ void Consume( SvStream& rIn, sal_Bool bAppend = sal_False, sal_uInt32 nStOfs = 0 );
- BOOL SeekToContent( SvStream& rIn, UINT16 nRecType, DffSeekToContentMode eMode = SEEK_FROM_BEGINNING );
- DffRecordHeader* GetRecordHeader( UINT16 nRecType, DffSeekToContentMode eMode = SEEK_FROM_BEGINNING );
+ sal_Bool SeekToContent( SvStream& rIn, sal_uInt16 nRecType, DffSeekToContentMode eMode = SEEK_FROM_BEGINNING );
+ DffRecordHeader* GetRecordHeader( sal_uInt16 nRecType, DffSeekToContentMode eMode = SEEK_FROM_BEGINNING );
DffRecordManager();
DffRecordManager( SvStream& rIn );
@@ -439,10 +439,10 @@ class MSFILTER_DLLPUBLIC SvxMSDffManager : public DffPropertyReader
SvxMSDffBLIPInfos* pBLIPInfos;
SvxMSDffShapeInfos* pShapeInfos;
SvxMSDffShapeOrders* pShapeOrders;
- ULONG nDefaultFontHeight;
+ sal_uLong nDefaultFontHeight;
long nOffsDgg;
- USHORT nBLIPCount;
- USHORT nShapeCount;
+ sal_uInt16 nBLIPCount;
+ sal_uInt16 nShapeCount;
sal_uInt32 nGroupShapeFlags;
void CheckTxBxStoryChain();
@@ -451,9 +451,9 @@ class MSFILTER_DLLPUBLIC SvxMSDffManager : public DffPropertyReader
protected :
String maBaseURL;
- UINT32 mnCurMaxShapeId; // we need this information to
- UINT32 mnDrawingsSaved; // access the right drawing
- UINT32 mnIdClusters; // while only knowing the shapeid
+ sal_uInt32 mnCurMaxShapeId; // we need this information to
+ sal_uInt32 mnDrawingsSaved; // access the right drawing
+ sal_uInt32 mnIdClusters; // while only knowing the shapeid
FIDCL* mpFidcls;
Table maDgOffsetTable; // array of fileoffsets
@@ -473,8 +473,8 @@ protected :
long nPntMul;
long nPntDiv;
bool bNeedMap;
- UINT32 nSvxMSDffSettings;
- UINT32 nSvxMSDffOLEConvFlags;
+ sal_uInt32 nSvxMSDffSettings;
+ sal_uInt32 nSvxMSDffOLEConvFlags;
/** stores a reference to an imported SdrObject with its shape id if
it has one
@@ -483,25 +483,25 @@ protected :
void GetCtrlData( long nOffsDgg );
void GetDrawingGroupContainerData( SvStream& rSt,
- ULONG nLenDgg );
+ sal_uLong nLenDgg );
// #156763#
// Add internal drawing container id as parameter to the sub methods of
// reading the control information about the drawing objects.
// The drawing container id is used to distinguish the text ids of drawing
// objects in different drawing containers.
void GetDrawingContainerData( SvStream& rSt,
- ULONG nLenDg,
+ sal_uLong nLenDg,
const unsigned long nDrawingContainerId );
- BOOL GetShapeGroupContainerData( SvStream& rSt,
- ULONG nLenShapeGroupCont,
- BOOL bPatriarch,
+ sal_Bool GetShapeGroupContainerData( SvStream& rSt,
+ sal_uLong nLenShapeGroupCont,
+ sal_Bool bPatriarch,
const unsigned long nDrawingContainerId );
- BOOL GetShapeContainerData( SvStream& rSt,
- ULONG nLenShapeCont,
- ULONG nPosGroup,
+ sal_Bool GetShapeContainerData( SvStream& rSt,
+ sal_uLong nLenShapeCont,
+ sal_uLong nPosGroup,
const unsigned long nDrawingContainerId );
- bool ReadGraphic( SvStream& rSt, ULONG nIndex, Graphic& rGraphic ) const;
+ bool ReadGraphic( SvStream& rSt, sal_uLong nIndex, Graphic& rGraphic ) const;
SdrObject* ImportFontWork( SvStream&, SfxItemSet&, Rectangle& rBoundRect ) const;
SdrObject* ImportGraphic( SvStream&, SfxItemSet&, const DffObjData& ) const;
// #i32596# - pass <nCalledByGroup> to method
@@ -517,7 +517,7 @@ protected :
static const GDIMetaFile* lcl_GetMetaFileFromGrf_Impl( const Graphic& rGrf, GDIMetaFile& rMtf );
#ifndef SVX_LIGHT
static com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > CheckForConvertToSOObj(
- UINT32 nConvertFlags, SotStorage& rSrcStg,
+ sal_uInt32 nConvertFlags, SotStorage& rSrcStg,
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xDestStg,
const Graphic& rGrf,
const Rectangle& rVisArea );
@@ -526,12 +526,12 @@ protected :
/*
folgende Methoden sind zum Excel-Import zu ueberschreiben:
*/
- virtual BOOL ProcessClientAnchor(SvStream& rStData, ULONG nDatLen, char*& rpBuff, UINT32& rBuffLen ) const;
+ virtual sal_Bool ProcessClientAnchor(SvStream& rStData, sal_uLong nDatLen, char*& rpBuff, sal_uInt32& rBuffLen ) const;
virtual void ProcessClientAnchor2( SvStream& rStData, DffRecordHeader& rHd, void* pData, DffObjData& );
- virtual BOOL ProcessClientData( SvStream& rStData, ULONG nDatLen, char*& rpBuff, UINT32& rBuffLen ) const;
+ virtual sal_Bool ProcessClientData( SvStream& rStData, sal_uLong nDatLen, char*& rpBuff, sal_uInt32& rBuffLen ) const;
virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, Rectangle& rTextRect, SdrObject* pObj = NULL);
- virtual ULONG Calc_nBLIPPos( ULONG nOrgVal, ULONG nStreamPos ) const;
- virtual bool GetColorFromPalette(USHORT nNum, Color& rColor) const;
+ virtual sal_uLong Calc_nBLIPPos( sal_uLong nOrgVal, sal_uLong nStreamPos ) const;
+ virtual bool GetColorFromPalette(sal_uInt16 nNum, Color& rColor) const;
bool ReadDffString(SvStream& rSt, String& rTxt) const;
bool ReadObjText(SvStream& rSt, SdrObject* pObj) const;
@@ -544,7 +544,7 @@ protected :
folgende Methode ist von allen zu ueberschreiben, die OLE-Objecte
importieren moechten:
*/
- virtual BOOL GetOLEStorageName( long nOLEId, String& rStorageName,
+ virtual sal_Bool GetOLEStorageName( long nOLEId, String& rStorageName,
SotStorageRef& rSrcStorage,
com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xDestStg
) const;
@@ -553,9 +553,9 @@ protected :
folgende Methode ist von allen zu ueberschreiben, die verhindern
moechten, dass (abgerundete) Rechtecke mit umgebrochenem Text
immer in SdrRectObj( OBJ_TEXT ) umgewandelt werden:
- TRUE bedeutet umwandeln.
+ sal_True bedeutet umwandeln.
*/
- virtual BOOL ShapeHasText(ULONG nShapeId, ULONG nFilePos) const;
+ virtual sal_Bool ShapeHasText(sal_uLong nShapeId, sal_uLong nFilePos) const;
public:
@@ -572,18 +572,18 @@ public:
Color MSO_TEXT_CLR_ToColor( sal_uInt32 nColorCode ) const;
Color MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nContextProperty = DFF_Prop_lineColor ) const;
- virtual BOOL SeekToShape( SvStream& rSt, void* pClientData, UINT32 nId ) const;
- bool SeekToRec( SvStream& rSt, USHORT nRecId, ULONG nMaxFilePos, DffRecordHeader* pRecHd = NULL, ULONG nSkipCount = 0 ) const;
- bool SeekToRec2( USHORT nRecId1, USHORT nRecId2, ULONG nMaxFilePos, DffRecordHeader* pRecHd = NULL, ULONG nSkipCount = 0 ) const;
-
- static void MSDFFReadZString( SvStream& rIn, String& rStr, ULONG nMaxLen, bool bUniCode = FALSE );
-
- static BOOL ReadCommonRecordHeader( DffRecordHeader& rRec, SvStream& rIn );
- static BOOL ReadCommonRecordHeader( SvStream& rSt,
- BYTE& rVer,
- USHORT& rInst,
- USHORT& rFbt,
- UINT32& rLength );
+ virtual sal_Bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const;
+ bool SeekToRec( SvStream& rSt, sal_uInt16 nRecId, sal_uLong nMaxFilePos, DffRecordHeader* pRecHd = NULL, sal_uLong nSkipCount = 0 ) const;
+ bool SeekToRec2( sal_uInt16 nRecId1, sal_uInt16 nRecId2, sal_uLong nMaxFilePos, DffRecordHeader* pRecHd = NULL, sal_uLong nSkipCount = 0 ) const;
+
+ static void MSDFFReadZString( SvStream& rIn, String& rStr, sal_uLong nMaxLen, bool bUniCode = FALSE );
+
+ static sal_Bool ReadCommonRecordHeader( DffRecordHeader& rRec, SvStream& rIn );
+ static sal_Bool ReadCommonRecordHeader( SvStream& rSt,
+ sal_uInt8& rVer,
+ sal_uInt16& rInst,
+ sal_uInt16& rFbt,
+ sal_uInt32& rLength );
/*
Konstruktor
===========
@@ -610,7 +610,7 @@ public:
SdrModel* pSdrModel_ = 0,
long nApplicationScale = 0,
ColorData mnDefaultColor_ = COL_DEFAULT,
- ULONG nDefaultFontHeight_ = 24,
+ sal_uLong nDefaultFontHeight_ = 24,
SvStream* pStData2_ = 0,
MSFilterTracer* pTracer = NULL );
@@ -622,11 +622,11 @@ public:
virtual ~SvxMSDffManager();
- UINT32 GetSvxMSDffSettings() const { return nSvxMSDffSettings; };
- void SetSvxMSDffSettings( UINT32 nSettings ) { nSvxMSDffSettings = nSettings; };
+ sal_uInt32 GetSvxMSDffSettings() const { return nSvxMSDffSettings; };
+ void SetSvxMSDffSettings( sal_uInt32 nSettings ) { nSvxMSDffSettings = nSettings; };
- static BOOL MakeContentStream( SotStorage * pStor, const GDIMetaFile & );
- static BOOL ConvertToOle2( SvStream& rStm, UINT32 nLen, const GDIMetaFile*,
+ static sal_Bool MakeContentStream( SotStorage * pStor, const GDIMetaFile & );
+ static sal_Bool ConvertToOle2( SvStream& rStm, sal_uInt32 nLen, const GDIMetaFile*,
const SotStorageRef & rDest );
void SetModel(SdrModel* pModel, long nApplicationScale);
@@ -638,8 +638,8 @@ public:
void Scale(Polygon& rPoly) const;
void Scale(PolyPolygon& rPoly) const;
void ScaleEmu(sal_Int32& rVal) const;
- UINT32 ScalePt( UINT32 nPt ) const;
- INT32 ScalePoint( INT32 nVal ) const;
+ sal_uInt32 ScalePt( sal_uInt32 nPt ) const;
+ sal_Int32 ScalePoint( sal_Int32 nVal ) const;
/*
GetBLIP() - Anforderung eines bestimmten BLIP
@@ -650,9 +650,9 @@ public:
Output: rData - bereits fertig konvertierte Daten
( direkt als Grafik in unsere Dokumente einzusetzen )
- Rueckgabewert: TRUE, im Erfolgsfalls, FALSE bei Fehler
+ Rueckgabewert: sal_True, im Erfolgsfalls, sal_False bei Fehler
*/
- BOOL GetBLIP( ULONG nIdx, Graphic& rData, Rectangle* pVisArea = NULL ) const;
+ sal_Bool GetBLIP( sal_uLong nIdx, Graphic& rData, Rectangle* pVisArea = NULL ) const;
/*
GetBLIPDirect() -Einlesen eines BLIP aus schon positioniertem Stream
@@ -663,11 +663,11 @@ public:
Output: rData -bereits fertig konvertierte Daten
( direkt als Grafik in unsere Dokumente einzusetzen )
- Rueckgabewert: TRUE, im Erfolgsfalls, FALSE bei Fehler
+ Rueckgabewert: sal_True, im Erfolgsfalls, sal_False bei Fehler
*/
- BOOL GetBLIPDirect(SvStream& rBLIPStream, Graphic& rData, Rectangle* pVisArea = NULL ) const;
+ sal_Bool GetBLIPDirect(SvStream& rBLIPStream, Graphic& rData, Rectangle* pVisArea = NULL ) const;
- BOOL GetShape(ULONG nId,
+ sal_Bool GetShape(sal_uLong nId,
SdrObject*& rpData, SvxMSDffImportData& rData);
/*
@@ -682,7 +682,7 @@ public:
1.. - Anzahl der BLIPs
USHRT_MAX - Fehler: kein korrektes Drawing File Format
*/
- USHORT GetBLIPCount() const{ return nBLIPCount; }
+ sal_uInt16 GetBLIPCount() const{ return nBLIPCount; }
/*
ZCodecDecompressed() - Dekomprimierung eines komp. WMF oder Enhanced WMF
@@ -692,9 +692,9 @@ public:
rOut -bereits korrekt positionierter Ausgabe-Stream,
bLookForEnd -Flag, ob das komp. Bild bis zum Stream-Ende reicht.
- Falls TRUE, wird jeweils geprueft, ob das gelesene noch
+ Falls sal_True, wird jeweils geprueft, ob das gelesene noch
zum Bild gehoert.
- Falls FALSE, wird bis zum Stream-Ende gelesen.
+ Falls sal_False, wird bis zum Stream-Ende gelesen.
Output: rIn -Der Stream steht hinter dem Ende des komp. Bildes.
(es kann aber noch eine Ende-Kennung und CRC-Sum folgen)
@@ -702,12 +702,12 @@ public:
Der Stream wird auf den Anfang des Bildes positioniert.
(also dorthin, wo der Stream vor der Verarbeitung stand)
- Rueckgabewert: TRUE, im Erfolgsfall
- FALSE bei Fehler oder Null Bytes geschrieben
+ Rueckgabewert: sal_True, im Erfolgsfall
+ sal_False bei Fehler oder Null Bytes geschrieben
*/
-// static BOOL ZCodecDecompressed( SvStream& rIn,
+// static sal_Bool ZCodecDecompressed( SvStream& rIn,
// SvStream& rOut,
-// BOOL bLookForEnd );
+// sal_Bool bLookForEnd );
//
SdrObject* ImportObj(SvStream& rSt, void* pData,
Rectangle& rClientRect, const Rectangle& rGlobalChildRect, int nCalledByGroup = 0, sal_Int32* pShapeId = NULL);
@@ -733,20 +733,20 @@ public:
return pShapeOrders;
}
- void StoreShapeOrder(ULONG nId,
- ULONG nTxBx,
+ void StoreShapeOrder(sal_uLong nId,
+ sal_uLong nTxBx,
SdrObject* pObject,
SwFlyFrmFmt* pFly = 0,
short nHdFtSection = 0) const;
void ExchangeInShapeOrder(SdrObject* pOldObject,
- ULONG nTxBx,
+ sal_uLong nTxBx,
SwFlyFrmFmt* pFly,
SdrObject* pObject) const;
void RemoveFromShapeOrder( SdrObject* pObject ) const;
- UINT32 GetConvertFlags() const { return nSvxMSDffOLEConvFlags; }
+ sal_uInt32 GetConvertFlags() const { return nSvxMSDffOLEConvFlags; }
static SdrOle2Obj* CreateSdrOLEFromStorage( const String& rStorageName,
SotStorageRef& rSrcStorage,
@@ -756,7 +756,7 @@ public:
const Rectangle& rVisArea,
SvStream* pDataStrrm,
ErrCode& rError,
- UINT32 nConvertFlags,
+ sal_uInt32 nConvertFlags,
sal_Int64 nAspect );
/* the method SolveSolver will create connections between shapes, it should be called after a page is imported.
@@ -777,33 +777,33 @@ public:
struct SvxMSDffBLIPInfo
{
- USHORT nBLIPType; // Art des BLIP: z.B. 6 fuer PNG
- ULONG nFilePos; // Offset des BLIP im Daten-Stream
- ULONG nBLIPSize; // Anzahl Bytes, die der BLIP im Stream einnimmt
- SvxMSDffBLIPInfo(USHORT nBType, ULONG nFPos, ULONG nBSize):
+ sal_uInt16 nBLIPType; // Art des BLIP: z.B. 6 fuer PNG
+ sal_uLong nFilePos; // Offset des BLIP im Daten-Stream
+ sal_uLong nBLIPSize; // Anzahl Bytes, die der BLIP im Stream einnimmt
+ SvxMSDffBLIPInfo(sal_uInt16 nBType, sal_uLong nFPos, sal_uLong nBSize):
nBLIPType( nBType ), nFilePos( nFPos ), nBLIPSize( nBSize ){}
};
struct SvxMSDffShapeInfo
{
sal_uInt32 nShapeId; // Shape Id, verwendet im PLCF SPA und im mso_fbtSp (FSP)
- ULONG nFilePos; // Offset des Shape im Kontroll-Stream fuer eventuelle
+ sal_uLong nFilePos; // Offset des Shape im Kontroll-Stream fuer eventuelle
// erneute Zugriffe auf dieses Shape
sal_uInt32 nTxBxComp;
- BOOL bReplaceByFly :1; // Shape darf im Writer durch Rahmen ersetzt werden.
- BOOL bSortByShapeId :1;
- BOOL bLastBoxInChain:1;
+ sal_Bool bReplaceByFly :1; // Shape darf im Writer durch Rahmen ersetzt werden.
+ sal_Bool bSortByShapeId :1;
+ sal_Bool bLastBoxInChain:1;
- SvxMSDffShapeInfo(ULONG nFPos, sal_uInt32 nId=0, // ULONG nBIdx=0,
- USHORT nSeqId=0, USHORT nBoxId=0):
+ SvxMSDffShapeInfo(sal_uLong nFPos, sal_uInt32 nId=0, // sal_uLong nBIdx=0,
+ sal_uInt16 nSeqId=0, sal_uInt16 nBoxId=0):
nShapeId( nId ),
nFilePos( nFPos ),
nTxBxComp( (nSeqId << 16) + nBoxId )
{
- bReplaceByFly = FALSE;
- bSortByShapeId = FALSE;
- bLastBoxInChain = TRUE;
+ bReplaceByFly = sal_False;
+ bSortByShapeId = sal_False;
+ bLastBoxInChain = sal_True;
}
SvxMSDffShapeInfo(SvxMSDffShapeInfo& rInfo):
nShapeId( rInfo.nShapeId ),
@@ -814,12 +814,12 @@ struct SvxMSDffShapeInfo
bSortByShapeId = rInfo.bSortByShapeId;
bLastBoxInChain = rInfo.bLastBoxInChain;
}
- BOOL operator==( const SvxMSDffShapeInfo& rEntry ) const
+ sal_Bool operator==( const SvxMSDffShapeInfo& rEntry ) const
{
return bSortByShapeId ? (nShapeId == rEntry.nShapeId)
: (nTxBxComp == rEntry.nTxBxComp && this == &rEntry);
}
- BOOL operator<( const SvxMSDffShapeInfo& rEntry ) const
+ sal_Bool operator<( const SvxMSDffShapeInfo& rEntry ) const
{
return bSortByShapeId ? (nShapeId < rEntry.nShapeId)
: (nTxBxComp < rEntry.nTxBxComp);
@@ -828,9 +828,9 @@ struct SvxMSDffShapeInfo
struct SvxMSDffShapeOrder
{
- ULONG nShapeId; // Shape Id, verwendet im PLCF SPA und im mso_fbtSp (FSP)
+ sal_uLong nShapeId; // Shape Id, verwendet im PLCF SPA und im mso_fbtSp (FSP)
- ULONG nTxBxComp; // Ketten- und Boxnummer in der Text-Box-Story (bzw. Null)
+ sal_uLong nTxBxComp; // Ketten- und Boxnummer in der Text-Box-Story (bzw. Null)
SwFlyFrmFmt* pFly; // Frame-Format eines statt des Sdr-Text-Objektes im
// Writer eingefuegten Rahmens: zur Verkettung benoetigt!
@@ -844,14 +844,14 @@ struct SvxMSDffShapeOrder
// nur die Shape-Ids vermerkt,
// Text-Box-Nummer und der Objekt-Pointer werden nur dann
// gespeichert, wenn das Shape tatsaechlich importiert wird!
- SvxMSDffShapeOrder( ULONG nId ):
+ SvxMSDffShapeOrder( sal_uLong nId ):
nShapeId( nId ), nTxBxComp( 0 ), pFly( 0 ), nHdFtSection( 0 ), pObj( 0 ){}
- BOOL operator==( const SvxMSDffShapeOrder& rEntry ) const
+ sal_Bool operator==( const SvxMSDffShapeOrder& rEntry ) const
{
return (nTxBxComp == rEntry.nTxBxComp);
}
- BOOL operator<( const SvxMSDffShapeOrder& rEntry ) const
+ sal_Bool operator<( const SvxMSDffShapeOrder& rEntry ) const
{
return (nTxBxComp < rEntry.nTxBxComp);
}
diff --git a/filter/inc/filter/msfilter/msocximex.hxx b/filter/inc/filter/msfilter/msocximex.hxx
index e88108d05363..9e09d67bd80b 100644
--- a/filter/inc/filter/msfilter/msocximex.hxx
+++ b/filter/inc/filter/msfilter/msocximex.hxx
@@ -99,14 +99,14 @@ public:
sal_Bool ReadOCXStream( SotStorageRef& rSrc1,
com::sun::star::uno::Reference<
com::sun::star::drawing::XShape > *pShapeRef=0,
- BOOL bFloatingCtrl=FALSE );
+ sal_Bool bFloatingCtrl=sal_False );
//Excel has a nasty kludged mechanism for this, read
//the comments in the source to follow it
sal_Bool ReadOCXExcelKludgeStream(SotStorageStreamRef& rSrc1,
com::sun::star::uno::Reference <
- com::sun::star::drawing::XShape > *pShapeRef,BOOL bFloatingCtrl);
+ com::sun::star::drawing::XShape > *pShapeRef,sal_Bool bFloatingCtrl);
//Writes the given Uno Control into the given storage
@@ -137,7 +137,7 @@ public:
const com::sun::star::awt::Size& /*rSize*/,
com::sun::star::uno::Reference<
com::sun::star::drawing::XShape >* /*pShape*/,
- BOOL /*bFloatingCtrl*/ ) {return sal_False;}
+ sal_Bool /*bFloatingCtrl*/ ) {return sal_False;}
/*begin: Backwards compatability with office 95 import, modify later*/
const com::sun::star::uno::Reference<
@@ -179,7 +179,7 @@ class OCX_FontData
public:
OCX_FontData() : nFontNameLen(0), fBold(0), fItalic(0), fUnderline(0),
fStrike(0), nFontSize(12), nJustification(1), pFontName(0),
- bHasAlign(FALSE), bHasFont(TRUE) {}
+ bHasAlign(sal_False), bHasFont(sal_True) {}
~OCX_FontData() {
if (pFontName)
delete [] pFontName;
@@ -230,7 +230,7 @@ class MSFILTER_DLLPUBLIC OCX_Control
public:
OCX_Control(UniString sN, OCX_Control* parent = NULL ) : nWidth( 0 ), nHeight( 0 ), mnLeft(0), mnTop(0),
mnStep(0), mnBackColor(0x8000000FL), mnForeColor(0), mnTabPos(0), mbVisible(true), sName(sN), pDocSh(0),
- bSetInDialog(FALSE), mpParent( parent ) {}
+ bSetInDialog(sal_False), mpParent( parent ) {}
sal_Bool FullRead(SotStorageStream *pS)
{
return Read(pS) && ReadFontData(pS);
@@ -698,7 +698,7 @@ public:
msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlCheckBoxModel" ));
mnBackColor = 0x80000005L;
mnForeColor = 0x80000008L;
- aFontData.SetHasAlign(TRUE);
+ aFontData.SetHasAlign(sal_True);
}
using OCX_ModernControl::Import; // to not hide the other two import methods
@@ -725,7 +725,7 @@ public:
msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.RadioButton" ));
mnBackColor = 0x80000005L;
mnForeColor = 0x80000008L;
- aFontData.SetHasAlign(TRUE);
+ aFontData.SetHasAlign(sal_True);
}
using OCX_ModernControl::Import; // to not hide the other two import methods
@@ -753,7 +753,7 @@ public:
mnBackColor = 0x80000005L;
mnForeColor = 0x80000008L;
nBorderColor = 0x80000006L;
- aFontData.SetHasAlign(TRUE);
+ aFontData.SetHasAlign(sal_True);
}
using OCX_ModernControl::Import; // to not hide the other two import methods
@@ -800,7 +800,7 @@ public:
mnBackColor = 0x8000000F;
mnForeColor = 0x80000012;
- aFontData.SetHasAlign(TRUE);
+ aFontData.SetHasAlign(sal_True);
aFontData.nJustification = 3; // centered by default
}
static OCX_Control *Create() { return new OCX_ToggleButton;}
@@ -827,7 +827,7 @@ public:
mnBackColor = 0x80000005;
mnForeColor = 0x80000008;
nBorderColor = 0x80000006;
- aFontData.SetHasAlign(TRUE);
+ aFontData.SetHasAlign(sal_True);
}
static OCX_Control *Create() { return new OCX_ComboBox;}
using OCX_ModernControl::Import; // to not hide the other two import methods
@@ -853,7 +853,7 @@ public:
mnBackColor = 0x80000005;
mnForeColor = 0x80000008;
nBorderColor = 0x80000006;
- aFontData.SetHasAlign(TRUE);
+ aFontData.SetHasAlign(sal_True);
}
static OCX_Control *Create() { return new OCX_ListBox;}
using OCX_ModernControl::Import; // to not hide the other two import methods
@@ -952,8 +952,8 @@ class OCX_ImageButton: public OCX_CommandButton
{
public:
OCX_ImageButton() {
- aFontData.SetHasAlign(FALSE);
- aFontData.SetHasFont(FALSE);
+ aFontData.SetHasAlign(sal_False);
+ aFontData.SetHasFont(sal_False);
}
static OCX_Control *Create() { return new OCX_ImageButton;}
sal_Bool Export(SotStorageRef &rObj,
@@ -997,7 +997,7 @@ public:
msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlFixedTextModel" ));
mnForeColor = 0x80000008;
mnBackColor = 0x80000005;
- aFontData.SetHasAlign(TRUE);
+ aFontData.SetHasAlign(sal_True);
}
~OCX_Label() {
diff --git a/filter/inc/filter/msfilter/msoleexp.hxx b/filter/inc/filter/msfilter/msoleexp.hxx
index 3611d11a077d..9693215833f3 100644
--- a/filter/inc/filter/msfilter/msoleexp.hxx
+++ b/filter/inc/filter/msfilter/msoleexp.hxx
@@ -44,12 +44,12 @@ class SotStorage;
class MSFILTER_DLLPUBLIC SvxMSExportOLEObjects
{
- UINT32 nConvertFlags;
+ sal_uInt32 nConvertFlags;
public:
- SvxMSExportOLEObjects( UINT32 nCnvrtFlgs ) : nConvertFlags(nCnvrtFlgs) {}
+ SvxMSExportOLEObjects( sal_uInt32 nCnvrtFlgs ) : nConvertFlags(nCnvrtFlgs) {}
- void SetFlags( UINT32 n ) { nConvertFlags = n; }
- UINT32 GetFlags() const { return nConvertFlags; }
+ void SetFlags( sal_uInt32 n ) { nConvertFlags = n; }
+ sal_uInt32 GetFlags() const { return nConvertFlags; }
void ExportOLEObject( svt::EmbeddedObjectRef& rObj, SotStorage& rDestStg );
void ExportOLEObject( const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject>& rObj, SotStorage& rDestStg );
diff --git a/filter/inc/filter/msfilter/msvbahelper.hxx b/filter/inc/filter/msfilter/msvbahelper.hxx
index 6acdb690ae20..04fb21c57a14 100644
--- a/filter/inc/filter/msfilter/msvbahelper.hxx
+++ b/filter/inc/filter/msfilter/msvbahelper.hxx
@@ -29,30 +29,82 @@
#define _MSVBAHELPER_HXX
#include <sfx2/objsh.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/script/vba/XVBAMacroResolver.hpp>
#include "filter/msfilter/msfilterdllapi.h"
-namespace ooo { namespace vba
+namespace ooo {
+namespace vba {
+
+// ============================================================================
+
+struct MSFILTER_DLLPUBLIC MacroResolvedInfo
+{
+ SfxObjectShell* mpDocContext;
+ String msResolvedMacro;
+ bool mbFound;
+
+ inline explicit MacroResolvedInfo( SfxObjectShell* pDocContext = 0 ) : mpDocContext( pDocContext ), mbFound( false ) {}
+};
+
+MSFILTER_DLLPUBLIC String makeMacroURL( const String& sMacroName );
+MSFILTER_DLLPUBLIC ::rtl::OUString extractMacroName( const ::rtl::OUString& rMacroUrl );
+MSFILTER_DLLPUBLIC MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const ::rtl::OUString& rMacroName, bool bSearchGlobalTemplates = false );
+MSFILTER_DLLPUBLIC sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArgs, com::sun::star::uno::Any& aRet, const com::sun::star::uno::Any& aCaller );
+
+// ============================================================================
+
+typedef ::cppu::WeakImplHelper3<
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XInitialization,
+ ::com::sun::star::script::vba::XVBAMacroResolver > VBAMacroResolverBase;
+
+class VBAMacroResolver : public VBAMacroResolverBase
{
- class MSFILTER_DLLPUBLIC VBAMacroResolvedInfo
- {
- SfxObjectShell* mpDocContext;
- bool mbFound;
- String msResolvedMacro;
- public:
- VBAMacroResolvedInfo() : mpDocContext(NULL), mbFound( false ){}
- void SetResolved( bool bRes ) { mbFound = bRes; }
- bool IsResolved() { return mbFound; }
- void SetMacroDocContext(SfxObjectShell* pShell ) { mpDocContext = pShell; }
- SfxObjectShell* MacroDocContext() { return mpDocContext; }
- String ResolvedMacro() { return msResolvedMacro; }
- void SetResolvedMacro(const String& sMacro ) { msResolvedMacro = sMacro; }
- };
-
- MSFILTER_DLLPUBLIC String makeMacroURL( const String& sMacroName );
- MSFILTER_DLLPUBLIC ::rtl::OUString extractMacroName( const ::rtl::OUString& rMacroUrl );
- MSFILTER_DLLPUBLIC VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& sMod, bool bSearchGlobalTemplates = false );
- MSFILTER_DLLPUBLIC sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArgs, com::sun::star::uno::Any& aRet, const com::sun::star::uno::Any& aCaller );
-} }
+public:
+ explicit VBAMacroResolver();
+ virtual ~VBAMacroResolver();
+
+ // com.sun.star.lang.XServiceInfo interface -------------------------------
+
+ virtual ::rtl::OUString SAL_CALL
+ getImplementationName() throw (::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL
+ supportsService( const ::rtl::OUString& rService )
+ 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.lang.XInitialization interface ----------------------------
+
+ virtual void SAL_CALL initialize(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rArgs )
+ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // com.sun.star.script.vba.XVBAMacroResolver interface --------------------
+
+ virtual ::rtl::OUString SAL_CALL
+ resolveVBAMacroToScriptURL( const ::rtl::OUString& rVBAMacroName )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ virtual ::rtl::OUString SAL_CALL
+ resolveScriptURLtoVBAMacro( const ::rtl::OUString& rScriptURL )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
+ SfxObjectShell* mpObjShell;
+ ::rtl::OUString maProjectName;
+};
+
+// ============================================================================
+
+} // namespace vba
+} // namespace ooo
#endif
diff --git a/filter/inc/filter/msfilter/svdfppt.hxx b/filter/inc/filter/msfilter/svdfppt.hxx
index 1bdf54fbb774..b4c3f9a4d928 100644
--- a/filter/inc/filter/msfilter/svdfppt.hxx
+++ b/filter/inc/filter/msfilter/svdfppt.hxx
@@ -121,18 +121,18 @@ struct SdHyperlinkEntry
// Hilfsklasse zum Einlesen der PPT InteractiveInfoAtom
struct MSFILTER_DLLPUBLIC PptInteractiveInfoAtom
{
- UINT32 nSoundRef;
- UINT32 nExHyperlinkId;
- UINT8 nAction;
- UINT8 nOleVerb;
- UINT8 nJump;
- UINT8 nFlags;
- UINT8 nHyperlinkType;
+ sal_uInt32 nSoundRef;
+ sal_uInt32 nExHyperlinkId;
+ sal_uInt8 nAction;
+ sal_uInt8 nOleVerb;
+ sal_uInt8 nJump;
+ sal_uInt8 nFlags;
+ sal_uInt8 nHyperlinkType;
// unknown, da Gesamtgroesse 16 ist
- UINT8 nUnknown1;
- UINT8 nUnknown2;
- UINT8 nUnknown3;
+ sal_uInt8 nUnknown1;
+ sal_uInt8 nUnknown2;
+ sal_uInt8 nUnknown3;
public:
@@ -150,7 +150,7 @@ enum PptPageFormat
PPTPF_CUSTOM
};
-// Werte fuer den ULONG im PPT_PST_TextHeaderAtom
+// Werte fuer den sal_uLong im PPT_PST_TextHeaderAtom
enum PPT_TextHeader
{
PPTTH_TITLE,
@@ -175,10 +175,10 @@ enum PPT_TextHeader
#define TSS_TYPE_QUARTERBODY (8)
// Inventor-Id fuer PPT UserData
-const UINT32 PPTInventor =UINT32('P')*0x00000001+
- UINT32('P')*0x00000100+
- UINT32('T')*0x00010000+
- UINT32('0')*0x01000000;
+const sal_uInt32 PPTInventor =sal_uInt32('P')*0x00000001+
+ sal_uInt32('P')*0x00000100+
+ sal_uInt32('T')*0x00010000+
+ sal_uInt32('0')*0x01000000;
// Object-Ids fuer StarDraw UserData
#define PPT_OBJECTINFO_ID (1)
@@ -188,9 +188,9 @@ struct MSFILTER_DLLPUBLIC PptDocumentAtom
Size aSlidesPageSize; // Seitengroesse der Slides in 576DPI
Size aNotesPageSize; // Seitengroesse der Notes in 576DPI
// RatioAtom erstmal weggelassen
- UINT32 nNotesMasterPersist; // 0=nicht vorhanden
- UINT32 nHandoutMasterPersist; // 0=nicht vorhanden
- UINT16 n1stPageNumber; // Seitennummer des ersten Slides
+ sal_uInt32 nNotesMasterPersist; // 0=nicht vorhanden
+ sal_uInt32 nHandoutMasterPersist; // 0=nicht vorhanden
+ sal_uInt16 n1stPageNumber; // Seitennummer des ersten Slides
PptPageFormat eSlidesPageFormat; // Seitenformat der Slides
sal_Bool bEmbeddedTrueType : 1; // TrueType direkt im File?
sal_Bool bTitlePlaceholdersOmitted : 1;
@@ -208,9 +208,9 @@ public:
struct PptSlideLayoutAtom
{
- INT32 eLayout; // 0..18
- BYTE aPlaceholderId[ 8 ];
- ULONG aPlacementId[ 8 ];
+ sal_Int32 eLayout; // 0..18
+ sal_uInt8 aPlaceholderId[ 8 ];
+ sal_uLong aPlacementId[ 8 ];
public:
@@ -224,9 +224,9 @@ public:
struct PptSlideAtom
{
PptSlideLayoutAtom aLayout;
- UINT32 nMasterId;
- UINT32 nNotesId;
- UINT16 nFlags;
+ sal_uInt32 nMasterId;
+ sal_uInt32 nNotesId;
+ sal_uInt16 nFlags;
public:
@@ -238,11 +238,11 @@ public:
struct PptSlidePersistAtom
{
- UINT32 nPsrReference;
- UINT32 nFlags;
- UINT32 nNumberTexts;
- UINT32 nSlideId;
- UINT32 nReserved; // we will use nReserved temporarly to set the offset to SSSlideInfoAtom ( if possible )
+ sal_uInt32 nPsrReference;
+ sal_uInt32 nFlags;
+ sal_uInt32 nNumberTexts;
+ sal_uInt32 nSlideId;
+ sal_uInt32 nReserved; // we will use nReserved temporarly to set the offset to SSSlideInfoAtom ( if possible )
public:
@@ -254,8 +254,8 @@ public:
struct PptNotesAtom
{
- UINT32 nSlideId;
- UINT16 nFlags;
+ sal_uInt32 nSlideId;
+ sal_uInt16 nFlags;
public:
@@ -267,12 +267,12 @@ public:
struct PptColorSchemeAtom
{
- BYTE aData[32];
+ sal_uInt8 aData[32];
public:
PptColorSchemeAtom () { Clear(); }
void Clear();
- Color GetColor( USHORT nNum ) const;
+ Color GetColor( sal_uInt16 nNum ) const;
friend SvStream& operator>>(SvStream& rIn, PptColorSchemeAtom& rAtom);
};
@@ -297,13 +297,13 @@ class PptFontCollection;
struct PptUserEditAtom
{
DffRecordHeader aHd;
- INT32 nLastSlideID; // ID of last visible slide
- UINT32 nVersion; // This is major/minor/build which did the edit
- UINT32 nOffsetLastEdit; // File offset of prev PptUserEditAtom
- UINT32 nOffsetPersistDirectory; // Offset to PersistPtrs for this file version.
- UINT32 nDocumentRef;
- UINT32 nMaxPersistWritten; // Gesamtanzahl der Persisteintraege bis hierher.
- INT16 eLastViewType; // enum view type
+ sal_Int32 nLastSlideID; // ID of last visible slide
+ sal_uInt32 nVersion; // This is major/minor/build which did the edit
+ sal_uInt32 nOffsetLastEdit; // File offset of prev PptUserEditAtom
+ sal_uInt32 nOffsetPersistDirectory; // Offset to PersistPtrs for this file version.
+ sal_uInt32 nDocumentRef;
+ sal_uInt32 nMaxPersistWritten; // Gesamtanzahl der Persisteintraege bis hierher.
+ sal_Int16 eLastViewType; // enum view type
public:
@@ -314,9 +314,9 @@ public:
struct PptOEPlaceholderAtom
{
- UINT32 nPlacementId;
- BYTE nPlaceholderId;
- BYTE nPlaceholderSize; // 0=Full size, 1=Half size, 2=Quarter of Slide
+ sal_uInt32 nPlacementId;
+ sal_uInt8 nPlaceholderId;
+ sal_uInt8 nPlaceholderSize; // 0=Full size, 1=Half size, 2=Quarter of Slide
public:
@@ -358,7 +358,7 @@ struct PptSlidePersistEntry
public:
PptSlidePersistEntry();
~PptSlidePersistEntry();
- UINT32 GetSlideId() const { return aPersistAtom.nSlideId; }
+ sal_uInt32 GetSlideId() const { return aPersistAtom.nSlideId; }
};
SV_DECL_PTRARR_DEL(_PptSlidePersistList,PptSlidePersistEntry*,16,16)
@@ -370,7 +370,7 @@ class MSFILTER_DLLPUBLIC PptSlidePersistList: public _PptSlidePersistList
public:
- USHORT FindPage( UINT32 nId ) const;
+ sal_uInt16 FindPage( sal_uInt32 nId ) const;
};
class SfxObjectShell;
@@ -393,12 +393,12 @@ struct PPTOleEntry
struct PptExOleObjAtom
{
- UINT32 nAspect;
- UINT32 nDummy1;
- UINT32 nId;
- UINT32 nDummy2;
- UINT32 nPersistPtr;
- UINT32 nDummy4;
+ sal_uInt32 nAspect;
+ sal_uInt32 nDummy1;
+ sal_uInt32 nId;
+ sal_uInt32 nDummy2;
+ sal_uInt32 nPersistPtr;
+ sal_uInt32 nDummy4;
public:
@@ -454,11 +454,11 @@ public:
SdrEscherImport( PowerPointImportParam&, const String& rBaseURL );
virtual ~SdrEscherImport();
- virtual bool GetColorFromPalette( USHORT nNum, Color& rColor ) const;
- virtual BOOL SeekToShape( SvStream& rSt, void* pClientData, UINT32 nId ) const;
- PptFontEntityAtom* GetFontEnityAtom( UINT32 nNum ) const;
- CharSet GetCharSet( UINT32 nNum ) const;
- BOOL IsFontAvailable( UINT32 nNum ) const;
+ virtual bool GetColorFromPalette( sal_uint16 nNum, Color& rColor ) const;
+ virtual sal_Bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const;
+ PptFontEntityAtom* GetFontEnityAtom( sal_uInt32 nNum ) const;
+ CharSet GetCharSet( sal_uInt32 nNum ) const;
+ sal_Bool IsFontAvailable( sal_uInt32 nNum ) const;
void RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic& rGraph );
using SvxMSDffManager::ReadObjText;
virtual SdrObject* ReadObjText( PPTTextObj* pTextObj, SdrObject* pObj, SdPage* pPage ) const;
@@ -479,8 +479,8 @@ public:
class SvxFieldItem;
struct MSFILTER_DLLPUBLIC PPTFieldEntry
{
- UINT16 nPos;
- UINT16 nTextRangeEnd;
+ sal_uInt16 nPos;
+ sal_uInt16 nTextRangeEnd;
SvxFieldItem* pField1;
SvxFieldItem* pField2;
String* pString;
@@ -488,7 +488,7 @@ struct MSFILTER_DLLPUBLIC PPTFieldEntry
PPTFieldEntry() : nPos( 0 ), nTextRangeEnd( 0 ), pField1( NULL ), pField2( NULL ), pString( NULL ) {};
~PPTFieldEntry();
- void SetDateTime( UINT32 nType );
+ void SetDateTime( sal_uInt32 nType );
// converting PPT date time format:
static void GetDateTime( const sal_uInt32 nVal, SvxDateFormat& eDateFormat, SvxTimeFormat& eTimeFormat );
@@ -500,8 +500,8 @@ struct MSFILTER_DLLPUBLIC HeaderFooterEntry
String pPlaceholder[ 4 ];
sal_uInt32 nAtom;
- sal_uInt32 GetMaskForInstance( UINT32 nInstance );
- sal_uInt32 IsToDisplay( UINT32 nInstance );
+ sal_uInt32 GetMaskForInstance( sal_uInt32 nInstance );
+ sal_uInt32 IsToDisplay( sal_uInt32 nInstance );
sal_uInt32 NeedToImportInstance( const sal_uInt32 nInstance, const PptSlidePersistEntry& rSlidePersist );
HeaderFooterEntry( const PptSlidePersistEntry* pMaster = NULL );
@@ -537,12 +537,12 @@ protected:
friend struct PPTStyleSheet;
friend class PPTNumberFormatCreator;
- BOOL bOk;
+ sal_Bool bOk;
PptUserEditAtom aUserEditAtom;
PptColorSchemeAtom aPageColors;
List aHyperList;
- UINT32* pPersistPtr;
- ULONG nPersistPtrAnz;
+ sal_uInt32* pPersistPtr;
+ sal_uLong nPersistPtrAnz;
const PPTStyleSheet* pPPTStyleSheet; // this is the current stylesheet;
const PPTStyleSheet* pDefaultSheet; // this is a sheet we are using if no masterpage can be found, but that should
@@ -550,9 +550,9 @@ protected:
PptSlidePersistList* pMasterPages;
PptSlidePersistList* pSlidePages;
PptSlidePersistList* pNotePages;
- USHORT nAktPageNum;
- ULONG nDocStreamPos;
- USHORT nPageColorsNum;
+ sal_uInt16 nAktPageNum;
+ sal_uLong nDocStreamPos;
+ sal_uInt16 nPageColorsNum;
PptPageKind ePageColorsKind;
PptPageKind eAktPageKind;
@@ -573,35 +573,35 @@ protected:
const Rectangle& rVisArea,
const int _nCalledByGroup,
sal_Int64 nAspect ) const;
- SvMemoryStream* ImportExOleObjStg( UINT32 nPersistPtr, UINT32& nOleId ) const;
+ SvMemoryStream* ImportExOleObjStg( sal_uInt32 nPersistPtr, sal_uInt32& nOleId ) const;
SdrPage* MakeBlancPage(sal_Bool bMaster) const;
sal_Bool ReadFontCollection();
- sal_Bool ForceFontCollection() const { return pFonts!=NULL?TRUE:((SdrPowerPointImport*)this)->ReadFontCollection(); }
+ sal_Bool ForceFontCollection() const { return pFonts!=NULL?sal_True:((SdrPowerPointImport*)this)->ReadFontCollection(); }
PptSlidePersistList* GetPageList(PptPageKind ePageKind) const;
- UINT32 GetAktPageId();
- UINT32 GetMasterPageId(USHORT nPageNum, PptPageKind ePageKind) const;
- UINT32 GetNotesPageId(USHORT nPageNum ) const;
+ sal_uInt32 GetAktPageId();
+ sal_uInt32 GetMasterPageId(sal_uInt16 nPageNum, PptPageKind ePageKind) const;
+ sal_uInt32 GetNotesPageId(sal_uInt16 nPageNum ) const;
SdrOutliner* GetDrawOutliner( SdrTextObj* pSdrText ) const;
void SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOptions );
public:
SdrPowerPointImport( PowerPointImportParam&, const String& rBaseURL );
virtual ~SdrPowerPointImport();
- USHORT GetPageCount( PptPageKind eKind = PPT_SLIDEPAGE ) const;
- void SetPageNum( USHORT nPageNum, PptPageKind = PPT_SLIDEPAGE );
- USHORT GetPageNum() const { return nAktPageNum; }
+ sal_uInt16 GetPageCount( PptPageKind eKind = PPT_SLIDEPAGE ) const;
+ void SetPageNum( sal_uInt16 nPageNum, PptPageKind = PPT_SLIDEPAGE );
+ sal_uInt16 GetPageNum() const { return nAktPageNum; }
PptPageKind GetPageKind() const { return eAktPageKind; }
Size GetPageSize() const;
SdrObject* ImportPageBackgroundObject( const SdrPage& rPage, sal_uInt32& nBgFileOffset, sal_Bool bForce );
- sal_Bool IsNoteOrHandout( USHORT nPageNum, PptPageKind ePageKind ) const;
- sal_Bool HasMasterPage( USHORT nPageNum, PptPageKind ePageKind = PPT_SLIDEPAGE ) const;
- USHORT GetMasterPageIndex( USHORT nPageNum, PptPageKind ePageKind = PPT_SLIDEPAGE ) const;
+ sal_Bool IsNoteOrHandout( sal_uInt16 nPageNum, PptPageKind ePageKind ) const;
+ sal_Bool HasMasterPage( sal_uInt16 nPageNum, PptPageKind ePageKind = PPT_SLIDEPAGE ) const;
+ sal_uInt16 GetMasterPageIndex( sal_uInt16 nPageNum, PptPageKind ePageKind = PPT_SLIDEPAGE ) const;
void ImportPage( SdrPage* pPage, const PptSlidePersistEntry* pMasterPersist = NULL );
- virtual bool GetColorFromPalette(USHORT nNum, Color& rColor) const;
- virtual BOOL SeekToShape( SvStream& rSt, void* pClientData, UINT32 nId ) const;
- sal_Unicode PPTSubstitute( UINT16 nFont, sal_Unicode nChar,
- UINT32& nMappedFontId, Font& rFont, char nDefault ) const;
+ virtual bool GetColorFromPalette(sal_uInt16 nNum, Color& rColor) const;
+ virtual sal_Bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const;
+ sal_Unicode PPTSubstitute( sal_uInt16 nFont, sal_Unicode nChar,
+ sal_uInt32& nMappedFontId, Font& rFont, char nDefault ) const;
const PptDocumentAtom& GetDocumentAtom() const { return aDocAtom; }
virtual const PptSlideLayoutAtom* GetSlideLayoutAtom() const;
SdrObject* CreateTable( SdrObject* pGroupObject, sal_uInt32* pTableArry, SvxMSDffSolverContainer* );
@@ -684,10 +684,10 @@ struct PPTExtParaSheet
struct PPTBuGraEntry
{
- UINT32 nInstance;
+ sal_uInt32 nInstance;
Graphic aBuGra;
- PPTBuGraEntry( Graphic& rGraphic, UINT32 nInstance );
+ PPTBuGraEntry( Graphic& rGraphic, sal_uInt32 nInstance );
};
class PPTExtParaProv
@@ -695,13 +695,13 @@ class PPTExtParaProv
List aBuGraList;
public :
- BOOL bStyles;
- BOOL bGraphics;
+ sal_Bool bStyles;
+ sal_Bool bGraphics;
DffRecordManager aExtendedPresRules;
PPTExtParaSheet aExtParaSheet[ PPT_STYLESHEETENTRYS ];
- BOOL GetGraphic( UINT32 nInstance, Graphic& rGraphic ) const;
+ sal_Bool GetGraphic( sal_uInt32 nInstance, Graphic& rGraphic ) const;
PPTExtParaProv( SdrPowerPointImport& rManager, SvStream& rSt,
const DffRecordHeader* pMainMasterHd );
@@ -766,18 +766,18 @@ struct PPTParaSheet
class PPTParagraphObj;
class PPTNumberFormatCreator
{
- UINT32 nIsBullet;
- UINT32 nBulletChar;
- UINT32 nBulletFont;
- UINT32 nBulletHeight;
- UINT32 nBulletColor;
- UINT32 nTextOfs;
- UINT32 nBulletOfs;
-
- void ImplGetNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat, UINT32 nLevel );
- BOOL ImplGetExtNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat, UINT32 nLevel,
- UINT32 nInstance, UINT32 nInstanceInSheet, boost::optional< sal_Int16 >& rStartNumbering,
- UINT32 nFontHeight, PPTParagraphObj* pPara );
+ sal_uInt32 nIsBullet;
+ sal_uInt32 nBulletChar;
+ sal_uInt32 nBulletFont;
+ sal_uInt32 nBulletHeight;
+ sal_uInt32 nBulletColor;
+ sal_uInt32 nTextOfs;
+ sal_uInt32 nBulletOfs;
+
+ void ImplGetNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat, sal_uInt32 nLevel );
+ sal_Bool ImplGetExtNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat, sal_uInt32 nLevel,
+ sal_uInt32 nInstance, sal_uInt32 nInstanceInSheet, boost::optional< sal_Int16 >& rStartNumbering,
+ sal_uInt32 nFontHeight, PPTParagraphObj* pPara );
protected :
@@ -788,11 +788,11 @@ class PPTNumberFormatCreator
PPTExtParaProv* pExtParaProv;
- void GetNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat, UINT32 nLevel,
- const PPTParaLevel& rParaLevel, const PPTCharLevel& rCharLevel, UINT32 nInstance );
+ void GetNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat, sal_uInt32 nLevel,
+ const PPTParaLevel& rParaLevel, const PPTCharLevel& rCharLevel, sal_uInt32 nInstance );
- BOOL GetNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat,
- PPTParagraphObj* pPara, UINT32 nInstanceInSheet, boost::optional< sal_Int16 >& rStartNumbering );
+ sal_Bool GetNumberFormat( SdrPowerPointImport& rMan, SvxNumberFormat& rNumberFormat,
+ PPTParagraphObj* pPara, sal_uInt32 nInstanceInSheet, boost::optional< sal_Int16 >& rStartNumbering );
};
class SvxNumBulletItem;
@@ -870,7 +870,7 @@ struct PPTCharPropSet
ImplPPTCharPropSet* pCharSet;
- void SetFont( UINT16 nFont );
+ void SetFont( sal_uInt16 nFont );
void SetColor( sal_uInt32 nColor );
PPTCharPropSet( sal_uInt32 nParagraph );
@@ -893,14 +893,14 @@ struct PPTTabEntry
struct PPTRuler
{
- UINT32 nRefCount;
+ sal_uInt32 nRefCount;
- INT32 nFlags;
- UINT16 nDefaultTab;
- UINT16 nTextOfs[ 5 ];
- UINT16 nBulletOfs[ 5 ];
+ sal_Int32 nFlags;
+ sal_uInt16 nDefaultTab;
+ sal_uInt16 nTextOfs[ 5 ];
+ sal_uInt16 nBulletOfs[ 5 ];
PPTTabEntry* pTab;
- UINT16 nTabCount;
+ sal_uInt16 nTabCount;
PPTRuler();
~PPTRuler();
@@ -912,15 +912,15 @@ struct PPTTextRulerInterpreter
PPTTextRulerInterpreter();
PPTTextRulerInterpreter( PPTTextRulerInterpreter& rRuler );
- PPTTextRulerInterpreter( UINT32 nFileOfs, SdrPowerPointImport&, DffRecordHeader& rHd, SvStream& rIn );
+ PPTTextRulerInterpreter( sal_uInt32 nFileOfs, SdrPowerPointImport&, DffRecordHeader& rHd, SvStream& rIn );
~PPTTextRulerInterpreter();
sal_uInt16 GetTabOffsetByIndex( sal_uInt16 nIndex ) const { return mpImplRuler->pTab[ nIndex ].nOffset; };
sal_uInt16 GetTabStyleByIndex( sal_uInt16 nIndex ) const { return mpImplRuler->pTab[ nIndex ].nStyle; };
- UINT16 GetTabCount() const { return mpImplRuler->nTabCount; };
- BOOL GetDefaultTab( UINT32 nLevel, UINT16& nValue ) const;
- BOOL GetTextOfs( UINT32 nLevel, UINT16& nValue ) const;
- BOOL GetBulletOfs( UINT32 nLevel, UINT16& nValue ) const;
+ sal_uInt16 GetTabCount() const { return mpImplRuler->nTabCount; };
+ sal_Bool GetDefaultTab( sal_uInt32 nLevel, sal_uInt16& nValue ) const;
+ sal_Bool GetTextOfs( sal_uInt32 nLevel, sal_uInt16& nValue ) const;
+ sal_Bool GetBulletOfs( sal_uInt32 nLevel, sal_uInt16& nValue ) const;
PPTTextRulerInterpreter& operator=( PPTTextRulerInterpreter& rRuler );
};
@@ -989,24 +989,24 @@ class MSFILTER_DLLPUBLIC PPTPortionObj : public PPTCharPropSet
friend class PPTParagraphObj;
const PPTStyleSheet& mrStyleSheet;
- UINT32 mnInstance;
- UINT32 mnDepth;
+ sal_uInt32 mnInstance;
+ sal_uInt32 mnDepth;
public :
- BOOL GetAttrib( UINT32 nAttr, UINT32& nVal, UINT32 nInstanceInSheet );
+ sal_Bool GetAttrib( sal_uInt32 nAttr, sal_uInt32& nVal, sal_uInt32 nInstanceInSheet );
SvxFieldItem* GetTextField();
- PPTPortionObj( const PPTStyleSheet&, UINT32 nInstance, UINT32 nDepth );
- PPTPortionObj( PPTCharPropSet&, const PPTStyleSheet&, UINT32 nInstance, UINT32 nDepth );
+ PPTPortionObj( const PPTStyleSheet&, sal_uInt32 nInstance, sal_uInt32 nDepth );
+ PPTPortionObj( PPTCharPropSet&, const PPTStyleSheet&, sal_uInt32 nInstance, sal_uInt32 nDepth );
PPTPortionObj( PPTPortionObj& );
~PPTPortionObj();
// the following function should be removed during next full update
- void ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, UINT32 nInstanceInSheet );
- void ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, UINT32 nInstanceInSheet, const PPTTextObj* pTextObj );
- UINT32 Count() const { return ( mpFieldItem ) ? 1 : maString.Len(); };
- BOOL HasTabulator();
+ void ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, sal_uInt32 nInstanceInSheet );
+ void ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, sal_uInt32 nInstanceInSheet, const PPTTextObj* pTextObj );
+ sal_uInt32 Count() const { return ( mpFieldItem ) ? 1 : maString.Len(); };
+ sal_Bool HasTabulator();
};
class MSFILTER_DLLPUBLIC PPTParagraphObj : public PPTParaPropSet, public PPTNumberFormatCreator, public PPTTextRulerInterpreter
@@ -1015,7 +1015,7 @@ class MSFILTER_DLLPUBLIC PPTParagraphObj : public PPTParaPropSet, public PPTNumb
friend class PPTNumberFormatCreator;
const PPTStyleSheet& mrStyleSheet;
- UINT32 mnInstance;
+ sal_uInt32 mnInstance;
protected :
@@ -1023,25 +1023,25 @@ class MSFILTER_DLLPUBLIC PPTParagraphObj : public PPTParaPropSet, public PPTNumb
public :
- BOOL mbTab; // if true, this paragraph has tabulators in text
+ sal_Bool mbTab; // if true, this paragraph has tabulators in text
- UINT32 mnCurrentObject;
- UINT32 mnPortionCount;
+ sal_uInt32 mnCurrentObject;
+ sal_uInt32 mnPortionCount;
PPTPortionObj** mpPortionList;
void UpdateBulletRelSize( sal_uInt32& nBulletRelSize ) const;
- BOOL GetAttrib( UINT32 nAttr, UINT32& nVal, UINT32 nInstanceInSheet );
+ sal_Bool GetAttrib( sal_uInt32 nAttr, sal_uInt32& nVal, sal_uInt32 nInstanceInSheet );
- PPTParagraphObj( const PPTStyleSheet&, UINT32 nInstance, UINT16 nDepth );
- PPTParagraphObj( PPTStyleTextPropReader&, const PPTStyleSheet&, UINT32 nInstance, PPTTextRulerInterpreter& rRuler );
+ PPTParagraphObj( const PPTStyleSheet&, sal_uInt32 nInstance, sal_uInt16 nDepth );
+ PPTParagraphObj( PPTStyleTextPropReader&, const PPTStyleSheet&, sal_uInt32 nInstance, PPTTextRulerInterpreter& rRuler );
~PPTParagraphObj();
- UINT32 GetTextSize();
+ sal_uInt32 GetTextSize();
PPTPortionObj* First();
PPTPortionObj* Next();
void AppendPortion( PPTPortionObj& rPortion );
- void ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& rStartNumbering, SdrPowerPointImport& rManager, UINT32 nInstanceInSheet, const PPTParagraphObj* pPrev );
+ void ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& rStartNumbering, SdrPowerPointImport& rManager, sal_uInt32 nInstanceInSheet, const PPTParagraphObj* pPrev );
};
#define PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT 1
@@ -1052,16 +1052,16 @@ class MSFILTER_DLLPUBLIC PPTParagraphObj : public PPTParaPropSet, public PPTNumb
struct ImplPPTTextObj
{
- UINT32 mnRefCount;
- UINT32 mnShapeId;
- UINT32 mnShapeMaster;
+ sal_uInt32 mnRefCount;
+ sal_uInt32 mnShapeId;
+ sal_uInt32 mnShapeMaster;
PptOEPlaceholderAtom* mpPlaceHolderAtom;
- UINT16 mnInstance;
- UINT16 mnDestinationInstance;
+ sal_uInt16 mnInstance;
+ sal_uInt16 mnDestinationInstance;
MSO_SPT meShapeType;
- UINT32 mnCurrentObject;
- UINT32 mnParagraphCount;
+ sal_uInt32 mnCurrentObject;
+ sal_uInt32 mnParagraphCount;
PPTParagraphObj** mpParagraphList;
PptSlidePersistEntry& mrPersistEntry;
@@ -1081,15 +1081,15 @@ class PPTTextObj
PPTTextObj( PPTTextObj& rTextObj );
~PPTTextObj();
- UINT32 GetCurrentIndex() const { return mpImplTextObj->mnCurrentObject; };
- UINT32 Count() const { return mpImplTextObj->mnParagraphCount; };
+ sal_uInt32 GetCurrentIndex() const { return mpImplTextObj->mnCurrentObject; };
+ sal_uInt32 Count() const { return mpImplTextObj->mnParagraphCount; };
PPTParagraphObj* First();
PPTParagraphObj* Next();
MSO_SPT GetShapeType() const { return mpImplTextObj->meShapeType; };
- UINT32 GetInstance() const { return mpImplTextObj->mnInstance; };
- void SetInstance( UINT16 nInstance ) { mpImplTextObj->mnInstance = nInstance; };
- UINT32 GetDestinationInstance() const { return mpImplTextObj->mnDestinationInstance; };
- void SetDestinationInstance( UINT16 nInstance ) { mpImplTextObj->mnDestinationInstance = nInstance; };
+ sal_uInt32 GetInstance() const { return mpImplTextObj->mnInstance; };
+ void SetInstance( sal_uInt16 nInstance ) { mpImplTextObj->mnInstance = nInstance; };
+ sal_uInt32 GetDestinationInstance() const { return mpImplTextObj->mnDestinationInstance; };
+ void SetDestinationInstance( sal_uInt16 nInstance ) { mpImplTextObj->mnDestinationInstance = nInstance; };
PptOEPlaceholderAtom* GetOEPlaceHolderAtom() const { return mpImplTextObj->mpPlaceHolderAtom; };
sal_uInt32 GetTextFlags() const { return mpImplTextObj->mnTextFlags; };
void SetVertical( sal_Bool bVertical )
@@ -1120,7 +1120,7 @@ class PPTConvertOCXControls : public SvxMSConvertOCXControls
com::sun::star::form::XFormComponent > &rFComp,
const com::sun::star::awt::Size& rSize,
com::sun::star::uno::Reference< com::sun::star::drawing::XShape > *pShape,
- BOOL bFloatingCtrl );
+ sal_Bool bFloatingCtrl );
};
// Powerpoint Recordtypen
@@ -1222,7 +1222,7 @@ class PPTConvertOCXControls : public SvxMSConvertOCXControls
#define PPT_PST_ExtendedParagraphMasterAtom 4013
#define PPT_PST_ExtendedPresRuleContainer 4014 // consist of 4012, 4015,
#define PPT_PST_ExtendedParagraphHeaderAtom 4015 // the instance of this atom indices the current presobj
- // the first UINT32 in this atom indices the current slideId
+ // the first sal_uInt32 in this atom indices the current slideId
#define PPT_PST_NewlyAddedAtom4016 4016
#define PPT_PST_FontEntityAtom 4023
diff --git a/filter/inc/filter/msfilter/svxmsbas.hxx b/filter/inc/filter/msfilter/svxmsbas.hxx
index 76138ec6ebea..bf8adf3bd179 100644
--- a/filter/inc/filter/msfilter/svxmsbas.hxx
+++ b/filter/inc/filter/msfilter/svxmsbas.hxx
@@ -63,7 +63,7 @@ class MSFILTER_DLLPUBLIC SvxImportMSVBasic
{
public:
SvxImportMSVBasic( SfxObjectShell &rDocS, SotStorage &rRoot,
- BOOL bImportCode = TRUE, BOOL bCopyStorage = TRUE )
+ sal_Bool bImportCode = sal_True, sal_Bool bCopyStorage = sal_True )
: xRoot(&rRoot), rDocSh(rDocS),
bImport(bImportCode), bCopy(bCopyStorage)
{}
@@ -72,40 +72,39 @@ public:
// bit 0 = 1 -> any code is imported to the SO-Basic
// bit 1 = 1 -> the VBA - storage is copy to the ObjectShell storage
int Import( const String& rStorageName, const String &rSubStorageName,
- BOOL bAsComment=TRUE, BOOL bStripped=TRUE );
+ sal_Bool bAsComment=sal_True, sal_Bool bStripped=sal_True );
int Import( const String& rStorageName, const String &rSubStorageName,
const std::vector< String >& codeNames,
- BOOL bAsComment=TRUE, BOOL bStripped=TRUE );
+ sal_Bool bAsComment=sal_True, sal_Bool bStripped=sal_True );
// only for the export - copy or delete the saved VBA-macro-storage
// form the ObjectShell
// - returns a warning code if a modified basic exist, in all other
// cases return ERRCODE_NONE.
- ULONG SaveOrDelMSVBAStorage( BOOL bSaveInto, const String& rStorageName );
+ sal_uLong SaveOrDelMSVBAStorage( sal_Bool bSaveInto, const String& rStorageName );
// check if the MS-VBA-Storage exist in the RootStorage of the DocShell.
// If it exist, then return the WarningId for loosing the information.
-
- const ControlAttributeInfo& ControlNameForObjectId(){ return m_ModuleNameToObjIdHash; }
- static ULONG GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS );
+ static sal_uLong GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS );
+ const ControlAttributeInfo& ControlNameForObjectId(){ return m_ModuleNameToObjIdHash; }
static String GetMSBasicStorageName();
rtl::OUString GetVBAProjectName() { return msProjectName; }
private:
SotStorageRef xRoot;
SfxObjectShell &rDocSh;
- BOOL bImport;
- BOOL bCopy;
+ sal_Bool bImport;
+ sal_Bool bCopy;
ControlAttributeInfo m_ModuleNameToObjIdHash;
MSFILTER_DLLPRIVATE void extractAttribute( const String& rAttribute, const String& rModName );
- MSFILTER_DLLPRIVATE BOOL ImportCode_Impl( const String& rStorageName,
+ MSFILTER_DLLPRIVATE sal_Bool ImportCode_Impl( const String& rStorageName,
const String &rSubStorageName,
const std::vector< String >& codeNames,
- BOOL bAsComment, BOOL bStripped);
+ sal_Bool bAsComment, sal_Bool bStripped);
MSFILTER_DLLPRIVATE bool ImportForms_Impl(const String& rStorageName,
const String &rSubStorageName, BOOL bVBAMode);
- MSFILTER_DLLPRIVATE BOOL CopyStorage_Impl( const String& rStorageName,
+ MSFILTER_DLLPRIVATE sal_Bool CopyStorage_Impl( const String& rStorageName,
const String &rSubStorageName);
rtl::OUString msProjectName;
MSFILTER_DLLPRIVATE BOOL ImportCode_Impl( VBA_Impl&, const std::vector< String >&, BOOL, BOOL );
diff --git a/filter/inc/registration.hxx b/filter/inc/registration.hxx
index 76c54cf23eec..8c46eaa52b35 100644
--- a/filter/inc/registration.hxx
+++ b/filter/inc/registration.hxx
@@ -32,10 +32,8 @@
//_______________________________________________
// includes
-#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/registry/InvalidRegistryException.hpp>
#include <rtl/ustrbuf.hxx>
#include <cppuhelper/factory.hxx>
@@ -60,97 +58,6 @@ namespace comphelper{
//_______________________________________________
-/** @short creates a new key inside component registry.
-
- @descr using: a) _COMPHELPER_COMPONENTINFO( MyClass,
- MyClass::st_getImplName(),
- MyClass::st_getServNames())
-
- b) _COMPHELPER_COMPONENTINFO( MyClass,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "css.MyClass" )),
- lServiceNames)
-
- @param CLASS
- must be the class name of the implementation
- of an uno service, which should be registered here.
-
- @param IMPLEMENTATIONNAME
- can be an uno implementation name from type [::rtl::OUString]
- directly or any possible method call, which returns such
- name.
-
- @param SERVICENAME
- a list of supported uno service names from type
- [::com::sun::star::uno::Sequence< ::rtl::OUString >]
- or any possible method call, which returns such
- list.
- */
-#define _COMPHELPER_COMPONENTINFO(CLASS, IMPLEMENTATIONNAME, SERVICENAMES) \
- /*define new scope to prevent multiple using of the same variables ... */ \
- { \
- /* build new key name */ \
- ::rtl::OUStringBuffer sKeyBuf(256); \
- sKeyBuf.appendAscii("/" ); \
- sKeyBuf.append (IMPLEMENTATIONNAME); \
- sKeyBuf.appendAscii("/UNO/SERVICES" ); \
- ::rtl::OUString sKey = sKeyBuf.makeStringAndClear(); \
- \
- /* try to register this service ... thrown exception will be catched by COMPONENT_WRITEINFO! */ \
- ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xKey = xRoot->createKey(sKey); \
- if (!xKey.is()) \
- throw ::com::sun::star::registry::InvalidRegistryException(sKey, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >()); \
- \
- /* dont optimize it! it must work for simple types and function calls! */ \
- const ::com::sun::star::uno::Sequence< ::rtl::OUString > lServiceNames = SERVICENAMES; \
- const ::rtl::OUString* pServiceNames = lServiceNames.getConstArray(); \
- sal_Int32 nCount = lServiceNames.getLength(); \
- \
- for (sal_Int32 i=0; i<nCount; ++i) \
- xKey->createKey(pServiceNames[i]); \
- }
-
-//_______________________________________________
-
-/** @short implments extern C function component_writeInfo
-
- @descr using: _COMPHELPER_COMPONENT_WRITEINFO
- (
- _COMPHELPER_COMPONENTINFO(...)
- ..
- _COMPHELPER_COMPONENTINFO(...)
- )
-
- @param INFOLIST
- list of macros of type COMPONENTINFO without(!) any
- seperator signs between two elements.
- */
-#define _COMPHELPER_COMPONENT_WRITEINFO(INFOLIST) \
- extern "C" sal_Bool SAL_CALL component_writeInfo(void* pServiceManager, \
- void* pRegistryKey ) \
- { \
- if (!pServiceManager || !pRegistryKey) \
- return sal_False; \
- \
- ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xRoot = reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >(pRegistryKey); \
- \
- /*if one of following registration will fail ... an exception is thrown! */ \
- try \
- { \
- /* This parameter will expand to: */ \
- /* _COMPHELPER_COMPONENTINFO(1) */ \
- /* ... */ \
- /* _COMPHELPER_COMPONENTINFO(n) */ \
- INFOLIST \
- } \
- catch(const ::com::sun::star::registry::InvalidRegistryException&) \
- { \
- return sal_False; \
- } \
- return sal_True; \
- }
-
-//_______________________________________________
-
/** TODO doc
*/
#define _COMPHELPER_MULTIINSTANCEFACTORY(IMPLEMENTATIONNAME, SERVICENAMES, FACTORYMETHOD) \
diff --git a/filter/prj/build.lst b/filter/prj/build.lst
index 502ecffd4fa5..e11b4c9b5023 100644
--- a/filter/prj/build.lst
+++ b/filter/prj/build.lst
@@ -1,4 +1,4 @@
-fl filter : l10n svtools unotools xmloff cppu tools cppuhelper sal svx javaunohelper XPDF:xpdf jvmaccess canvas SAXON:saxon LIBXSLT:libxslt NULL
+fl filter : L10N:l10n svtools unotools xmloff cppu tools cppuhelper sal svx javaunohelper XPDF:xpdf jvmaccess canvas SAXON:saxon LIBXSLT:libxslt basegfx NULL
fl filter usr1 - all fl_mkout NULL
fl filter\prj get - all fl_prj NULL
fl filter\inc nmake - all fl_inc NULL
@@ -43,3 +43,6 @@ fl filter\source\config\cache nmake - all fl_config
fl filter\source\config\fragments\types nmake - all fl_fcfg_fragments_types fl_inc NULL
fl filter\source\config\fragments\filters nmake - all fl_fcfg_fragments_filters fl_inc NULL
fl filter\source\config\fragments nmake - all fl_fcfg_fragments fl_fcfg_fragments_filters fl_inc NULL
+
+# took very long
+# fl filter\qa\complex\filter\misc nmake - all fl_qa_complex NULL
diff --git a/filter/prj/d.lst b/filter/prj/d.lst
index 6983a3bfae15..8957db6e285e 100644
--- a/filter/prj/d.lst
+++ b/filter/prj/d.lst
@@ -51,9 +51,22 @@ mkdir: %_DEST%\bin%_EXT%\pdfimport
..\%__SRC%\bin\pdfunzip.* %_DEST%\bin%_EXT%\pdfunzip.*
..\%__SRC%\misc\filters\modulepacks\fcfg_*.xcu %_DEST%\xml%_EXT%\registry\spool\fcfg_*.xcu
..\%COMMON_OUTDIR%\bin\fcfg_langpack_*.zip %_DEST%\pck%_EXT%\fcfg_langpack_*.zip
+..\%__SRC%\misc\t602filter.component %_DEST%\xml%_EXT%\t602filter.component
mkdir: %_DEST%\inc%_EXT%\filter
mkdir: %_DEST%\inc%_EXT%\filter\msfilter
..\inc\filter\msfilter\*.hxx %_DEST%\inc%_EXT%\filter\msfilter\*.hxx
..\inc\filter\msfilter\*.h %_DEST%\inc%_EXT%\filter\msfilter\*.h
+..\%__SRC%\misc\XSLTFilter.jar.component %_DEST%\xml%_EXT%\XSLTFilter.jar.component
+..\%__SRC%\misc\XSLTValidate.component %_DEST%\xml%_EXT%\XSLTValidate.component
+..\%__SRC%\misc\filterconfig1.component %_DEST%\xml%_EXT%\filterconfig1.component
+..\%__SRC%\misc\flash.component %_DEST%\xml%_EXT%\flash.component
+..\%__SRC%\misc\msfilter.component %_DEST%\xml%_EXT%\msfilter.component
+..\%__SRC%\misc\pdffilter.component %_DEST%\xml%_EXT%\pdffilter.component
+..\%__SRC%\misc\placeware.component %_DEST%\xml%_EXT%\placeware.component
+..\%__SRC%\misc\svgfilter.component %_DEST%\xml%_EXT%\svgfilter.component
+..\%__SRC%\misc\xmlfa.component %_DEST%\xml%_EXT%\xmlfa.component
+..\%__SRC%\misc\xmlfd.component %_DEST%\xml%_EXT%\xmlfd.component
+..\%__SRC%\misc\xsltdlg.component %_DEST%\xml%_EXT%\xsltdlg.component
+..\%__SRC%\misc\xsltfilter.component %_DEST%\xml%_EXT%\xsltfilter.component
diff --git a/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java b/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java
index e32b81caa85b..a269afec836d 100644
--- a/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java
+++ b/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java
@@ -24,7 +24,6 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
package complex.filter.misc;
import com.sun.star.beans.PropertyValue;
@@ -39,10 +38,18 @@ import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import com.sun.star.util.XFlushable;
-import complexlib.ComplexTestCase;
-import util.utils;
-
-
+// import complexlib.ComplexTestCase;
+// import util.utils;
+
+// ---------- junit imports -----------------
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+// ------------------------------------------
/**
* This complex test checks the functionality of the properties "Finalized" and "Mandatory" of
@@ -74,7 +81,8 @@ import util.utils;
* <CODE>Mandatory=true</CODE>
* <CODE>Mandatory=false</CODE>
*/
-public class FinalizedMandatoryTest extends ComplexTestCase {
+public class FinalizedMandatoryTest
+{
static XMultiServiceFactory xMSF;
@@ -82,21 +90,21 @@ public class FinalizedMandatoryTest extends ComplexTestCase {
* A function to tell the framework, which test functions are available.
* @return All test methods.
*/
- public String[] getTestMethodNames() {
- return new String[]{"checkReadonlySupportFilterFactory",
- "checkReadonlySupportTypeDetection"};
- }
-
+// public String[] getTestMethodNames() {
+// return new String[]{"checkReadonlySupportFilterFactory",
+// "checkReadonlySupportTypeDetection"};
+// }
/** Create the environment for following tests.
* Use either a component loader from desktop or
* from frame
* @throws Exception Exception
*/
- public void before() throws Exception {
+ @Before public void before() throws Exception
+ {
// create TypeDetection
- xMSF = (XMultiServiceFactory)param.getMSF();
- assure("Could not get XMultiServiceFactory", xMSF != null);
+ xMSF = getMSF();
+ assertNotNull("Could not get XMultiServiceFactory", xMSF);
}
@@ -106,14 +114,16 @@ public class FinalizedMandatoryTest extends ComplexTestCase {
* @throws Exception was thrown if creataion failes
* @return <CODE>XInterface</CODE> of service
*/
- public XInterface getTestObject(String serviceName) throws Exception{
+ private XInterface getTestObject(String serviceName) throws Exception
+ {
Object oInterface = xMSF.createInstance(serviceName);
- if (oInterface == null) {
- failed("Service wasn't created") ;
- throw new Exception("could not create service '"+serviceName+"'");
- }
+ assertNotNull("Service wan't created", oInterface);
+// if (oInterface == null) {
+// failed("Service wasn't created") ;
+// throw new Exception("could not create service '"+serviceName+"'");
+// }
return (XInterface) oInterface;
}
@@ -121,7 +131,8 @@ public class FinalizedMandatoryTest extends ComplexTestCase {
* call the function <CODE>checkReadonlySupport</CODE> to test <CODE>com.sun.star.document.FilterFactory</CODE>
* @see com.sun.star.document.FilterFactory
*/
- public void checkReadonlySupportFilterFactory(){
+ @Test public void checkReadonlySupportFilterFactory()
+ {
checkReadonlySupport("com.sun.star.document.FilterFactory");
}
@@ -129,26 +140,30 @@ public class FinalizedMandatoryTest extends ComplexTestCase {
* call the function <CODE>checkReadonlySupport</CODE> to test <CODE>com.sun.star.document.TypeDetection</CODE>
* @see com.sun.star.document.TypeDetection
*/
- public void checkReadonlySupportTypeDetection(){
+ @Test public void checkReadonlySupportTypeDetection()
+ {
checkReadonlySupport("com.sun.star.document.TypeDetection");
}
-
/**
* test the given service <CODE>serviceName</CODE>.
* For every filter a new instace was created and the tests started.
* @param serviceName the name of the service to test
*/
- private void checkReadonlySupport(String serviceName){
- log.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
- log.println("testing service '" + serviceName + "'");
+ private void checkReadonlySupport(String serviceName)
+ {
+ System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
+ System.out.println("testing service '" + serviceName + "'");
XInterface oObj = null;
- try{
+ try
+ {
oObj = getTestObject(serviceName);
- log.println("ImplName: "+utils.getImplName(oObj));
- } catch (java.lang.Exception e){
- failed("could not get test object");
+ System.out.println("ImplName: " + util.utils.getImplName(oObj));
+ }
+ catch (java.lang.Exception e)
+ {
+ fail("could not get test object");
}
boolean mandantoryTrue = false;
@@ -157,19 +172,21 @@ public class FinalizedMandatoryTest extends ComplexTestCase {
boolean finalizedFalse = false;
- XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface
- (XNameAccess.class, oObj);
+ XNameAccess xNA = UnoRuntime.queryInterface(XNameAccess.class, oObj);
String[] filterNames = xNA.getElementNames();
// XNameContainer; XNameReplace
String filterName = filterNames[0];
- Object[] instance = null;;
- for (int i = 0; i < filterNames.length; i++) {
- log.println("------------------------------------------------");
- try{
+ Object[] instance = null;
+
+ for (int i = 0; i < filterNames.length; i++)
+ {
+ System.out.println("------------------------------------------------");
+ try
+ {
PropertyValue instanceProp = new PropertyValue();
filterName = filterNames[i];
- log.println(filterName);
+ System.out.println(filterName);
// testobject must new created for every test.
// We change in a loop the container and try to flush this changes.
@@ -177,16 +194,19 @@ public class FinalizedMandatoryTest extends ComplexTestCase {
// similar to a document which could not be saved beacuse of invalid
// contend. While you don't remove the invalid conted you will never
// be able to save the document. Same here.
- try{
+ try
+ {
oObj = getTestObject(serviceName);
- } catch (java.lang.Exception e){
- failed("could not get test object", CONTINUE);
+ }
+ catch (java.lang.Exception e)
+ {
+ fail("could not get test object");
}
- xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oObj);
- XNameContainer xNC = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, oObj);
- XNameReplace xNR = (XNameReplace) UnoRuntime.queryInterface(XNameReplace.class, oObj);
- XFlushable xFlush = (XFlushable) UnoRuntime.queryInterface(XFlushable.class, oObj);
+ xNA = UnoRuntime.queryInterface(XNameAccess.class, oObj);
+ XNameContainer xNC = UnoRuntime.queryInterface(XNameContainer.class, oObj);
+ XNameReplace xNR = UnoRuntime.queryInterface(XNameReplace.class, oObj);
+ XFlushable xFlush = UnoRuntime.queryInterface(XFlushable.class, oObj);
instance = (Object[]) xNA.getByName(filterName);
PropertyValue[] props = (PropertyValue[]) instance;
@@ -204,59 +224,75 @@ public class FinalizedMandatoryTest extends ComplexTestCase {
finalizedFalse |= !isFinalized;
//change the filter
- setPropertyValueValue((PropertyValue[])instance, "UIName", "dummy");
+ setPropertyValueValue((PropertyValue[]) instance, "UIName", "dummy");
// 1a.) try to change the filter in the container
- try{
+ try
+ {
xNR.replaceByName(filterName, instance);
- }catch (IllegalArgumentException e){
- failed("could not replace filter properties ('" + filterName + "')", CONTINUE);
+ }
+ catch (IllegalArgumentException e)
+ {
+ fail("could not replace filter properties ('" + filterName + "')");
}
// 1b.) try to wirte the changed filter to the configuration.
// This must result in a exception if the filter is finalized.
boolean flushError = false;
- try{
+ try
+ {
xFlush.flush();
- } catch (WrappedTargetRuntimeException e){
+ }
+ catch (WrappedTargetRuntimeException e)
+ {
flushError = true;
- assure("Unexpected exception wihle flushing changed filter '"+ filterName + "'", isFinalized,CONTINUE);
+ assertTrue("Unexpected exception wihle flushing changed filter '" + filterName + "'", isFinalized);
}
- assure("Expected exception was not thorwn while flushing changed filter '"+ filterName + "' Finalized:" + isFinalized,
- !(flushError ^ isFinalized), CONTINUE);
+ assertTrue("Expected exception was not thorwn while flushing changed filter '" + filterName + "' Finalized:" + isFinalized,
+ !(flushError ^ isFinalized));
// 2a.) try to remove the filter from the container
- try{
+ try
+ {
xNC.removeByName(filterName);
- }catch (NoSuchElementException e){
- failed("could not remove filter from container ('" + filterName + "')", CONTINUE);
+ }
+ catch (NoSuchElementException e)
+ {
+ fail("could not remove filter from container ('" + filterName + "')");
}
// 1b.) try to wirte the changed filter to the configuration.
// This must result in a exception if the filter is mandatory
flushError = false;
- try{
+ try
+ {
xFlush.flush();
- } catch (WrappedTargetRuntimeException e){
+ }
+ catch (WrappedTargetRuntimeException e)
+ {
flushError = true;
- assure("Unexpected exception wihle flushing removed filter '"+ filterName + "'", isMandatory,CONTINUE);
+ assertTrue("Unexpected exception wihle flushing removed filter '" + filterName + "'", isMandatory);
}
- assure("Expected exception was not thorwn while flushing removed filter '"+ filterName + "' Mandatory:" + isMandatory,
- !(flushError ^ isMandatory), CONTINUE);
+ assertTrue("Expected exception was not thorwn while flushing removed filter '" + filterName + "' Mandatory:" + isMandatory,
+ !(flushError ^ isMandatory));
- } catch (NoSuchElementException e){
- failed("Couldn't get elements from object", true);
- } catch (WrappedTargetException e){
- failed("Couldn't get elements from object", true);
+ }
+ catch (NoSuchElementException e)
+ {
+ fail("Couldn't get elements from object");
+ }
+ catch (WrappedTargetException e)
+ {
+ fail("Couldn't get elements from object");
}
}
String preMsg = "Could not find filter with state ";
String postMsg = " Please check if such filter is installed!";
- assure(preMsg + "'Mandatory=true'" + postMsg ,mandantoryTrue, CONTINUE);
- assure(preMsg + "'Mandatory=false'" + postMsg ,mandantoryFalse, CONTINUE);
- assure(preMsg + "'Finalized=true'" + postMsg ,finalizedTrue, CONTINUE);
- assure(preMsg + "'Finalized=false'" + postMsg ,finalizedFalse, CONTINUE);
+ assertTrue(preMsg + "'Mandatory=true'" + postMsg, mandantoryTrue);
+ assertTrue(preMsg + "'Mandatory=false'" + postMsg, mandantoryFalse);
+ assertTrue(preMsg + "'Finalized=true'" + postMsg, finalizedTrue);
+ assertTrue(preMsg + "'Finalized=false'" + postMsg, finalizedFalse);
}
/**
@@ -265,13 +301,18 @@ public class FinalizedMandatoryTest extends ComplexTestCase {
* @see com.sun.star.beans.PropertyValue
* @param props Sequenze of PropertyValue
*/
- protected void printPropertyValues(PropertyValue[] props) {
+ protected void printPropertyValues(PropertyValue[] props)
+ {
int i = 0;
- while (i < props.length ) {
- log.println(props[i].Name + ":" + props[i].Value.toString());
+ while (i < props.length)
+ {
+ System.out.println(props[i].Name + ":" + props[i].Value.toString());
i++;
}
- if (i < props.length) log.println(props[i].Name + ":" + props[i].Value.toString());
+ if (i < props.length)
+ {
+ System.out.println(props[i].Name + ":" + props[i].Value.toString());
+ }
}
/**
@@ -280,9 +321,11 @@ public class FinalizedMandatoryTest extends ComplexTestCase {
* @param pName the name of the property the value shoud be returned
* @return the value of the property
*/
- protected Object getPropertyValueValue(PropertyValue[] props, String pName) {
+ protected Object getPropertyValueValue(PropertyValue[] props, String pName)
+ {
int i = 0;
- while (i < props.length && !props[i].Name.equals(pName)) {
+ while (i < props.length && !props[i].Name.equals(pName))
+ {
i++;
}
return i < props.length ? props[i].Value : null;
@@ -294,14 +337,36 @@ public class FinalizedMandatoryTest extends ComplexTestCase {
* @param pName name of the property which should be changed
* @param pValue the value the property should be assigned
*/
- protected void setPropertyValueValue(PropertyValue[] props, String pName, Object pValue) {
+ protected void setPropertyValueValue(PropertyValue[] props, String pName, Object pValue)
+ {
int i = 0;
- while (i < props.length && !props[i].Name.equals(pName)) {
+ while (i < props.length && !props[i].Name.equals(pName))
+ {
i++;
}
props[i].Value = pValue;
}
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+ // setup and close connections
+ @BeforeClass
+ public static void setUpConnection() throws Exception
+ {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+ @AfterClass
+ public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+ private static final OfficeConnection connection = new OfficeConnection();
}
diff --git a/filter/qa/complex/filter/misc/TypeDetection6FileFormat.java b/filter/qa/complex/filter/misc/TypeDetection6FileFormat.java
index 842a365d4714..6fda574ae8f5 100644
--- a/filter/qa/complex/filter/misc/TypeDetection6FileFormat.java
+++ b/filter/qa/complex/filter/misc/TypeDetection6FileFormat.java
@@ -3,21 +3,31 @@
*
* Created on 26. April 2004, 10:37
*/
-
package complex.filter.misc;
import com.sun.star.container.XNameAccess;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
-import complexlib.ComplexTestCase;
+
import util.utils;
+// ---------- junit imports -----------------
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+// ------------------------------------------
+
/**
*
* @author cn93815
*/
-public class TypeDetection6FileFormat extends ComplexTestCase {
+public class TypeDetection6FileFormat
+{
static XMultiServiceFactory xMSF;
@@ -25,20 +35,20 @@ public class TypeDetection6FileFormat extends ComplexTestCase {
* A function to tell the framework, which test functions are available.
* @return All test methods.
*/
- public String[] getTestMethodNames() {
- return new String[]{"checkFilterFactory",
- "checkTypeDetection"};
- }
-
+// public String[] getTestMethodNames() {
+// return new String[]{"checkFilterFactory",
+// "checkTypeDetection"};
+// }
/** Create the environment for following tests.
* Use either a component loader from desktop or
* from frame
* @throws Exception Exception
*/
- public void before() throws Exception {
+ @Before public void before() throws Exception
+ {
- xMSF = (XMultiServiceFactory)param.getMSF();
- assure("Could not get XMultiServiceFactory", xMSF != null);
+ xMSF = getMSF();
+ assertNotNull("Could not get XMultiServiceFactory", xMSF);
}
@@ -46,7 +56,8 @@ public class TypeDetection6FileFormat extends ComplexTestCase {
* call the function <CODE>checkFileFormatSupport</CODE> to test <CODE>com.sun.star.document.FilterFactory</CODE>
* @see com.sun.star.document.FilterFactory
*/
- public void checkFilterFactory(){
+ @Test public void checkFilterFactory()
+ {
checkFileFormatSupport("com.sun.star.document.FilterFactory");
}
@@ -54,7 +65,8 @@ public class TypeDetection6FileFormat extends ComplexTestCase {
* call the function <CODE>checkFileFormatSupport</CODE> to test <CODE>com.sun.star.document.TypeDetection</CODE>
* @see com.sun.star.document.TypeDetection
*/
- public void checkTypeDetection(){
+ @Test public void checkTypeDetection()
+ {
checkFileFormatSupport("com.sun.star.document.TypeDetection");
}
@@ -64,42 +76,67 @@ public class TypeDetection6FileFormat extends ComplexTestCase {
* The serve was created and the filter 'TypeDetection6FileFormat' was searched
* @param serviceName the name of the service to test
*/
- private void checkFileFormatSupport(String serviceName){
- log.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
- log.println("testing service '" + serviceName + "'");
+ private void checkFileFormatSupport(String serviceName)
+ {
+ System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
+ System.out.println("testing service '" + serviceName + "'");
XInterface oObj = null;
- try{
+ try
+ {
oObj = getTestObject(serviceName);
- log.println("ImplName: "+utils.getImplName(oObj));
- } catch (java.lang.Exception e){
- failed("could not get test object");
+ System.out.println("ImplName: " + utils.getImplName(oObj));
+ }
+ catch (java.lang.Exception e)
+ {
+ fail("could not get test object");
}
- XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface
- (XNameAccess.class, oObj);
+ XNameAccess xNA = UnoRuntime.queryInterface(XNameAccess.class, oObj);
String msg = "Could not find filter 'TypeDetection6FileFormat'!";
msg += "\nMaybe 'TypeDetection6FileFormat.xcu' is not registered.";
- assure(msg, xNA.hasByName("TypeDetection6FileFormat"),CONTINUE);
+ assertTrue(msg, xNA.hasByName("TypeDetection6FileFormat"));
}
- /**
+ /**
* Creates an instance for the given <CODE>serviceName</CODE>
* @param serviceName the name of the service which should be created
* @throws Exception was thrown if creataion failes
* @return <CODE>XInterface</CODE> of service
*/
- public XInterface getTestObject(String serviceName) throws Exception{
+ public XInterface getTestObject(String serviceName) throws Exception
+ {
Object oInterface = xMSF.createInstance(serviceName);
- if (oInterface == null) {
- failed("Service wasn't created") ;
- throw new Exception("could not create service '"+serviceName+"'");
+ if (oInterface == null)
+ {
+ fail("Service wasn't created");
+ throw new Exception("could not create service '" + serviceName + "'");
}
return (XInterface) oInterface;
}
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
}
diff --git a/filter/qa/complex/filter/misc/makefile.mk b/filter/qa/complex/filter/misc/makefile.mk
index 2792b2438b6e..5ac072a2e071 100755
--- a/filter/qa/complex/filter/misc/makefile.mk
+++ b/filter/qa/complex/filter/misc/makefile.mk
@@ -25,73 +25,35 @@
#
#*************************************************************************
-PRJ = ..$/..$/..$/..
-PRJNAME = filter
-TARGET = Filter
-PACKAGE = complex$/filter$/misc
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
-
-JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = FinalizedMandatoryTest.java TypeDetection6FileFormat.java
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
-
-#----- make a jar from compiled files ------------------------------
-
-MAXLINELENGTH = 100000
-
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
-
-# --- Parameters for the test --------------------------------------
-
-# start an office if the parameter is set for the makefile
-.IF "$(OFFICE)" == ""
-CT_APPEXECCOMMAND =
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
.ELSE
-CT_APPEXECCOMMAND = -AppExecutionCommand \
- "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
-.ENDIF
-
-# test base is java complex
-CT_TESTBASE = -TestBase java_complex
-
-# replace $/ with . in package name
-CT_PACKAGE = -o $(PACKAGE:s\$/\.\)
-
-# start the runner application
-CT_APP = org.openoffice.Runner
+PRJ = ../../../..
+PRJNAME = filter
+TARGET = qa_complex_filter_misc
-# --- Targets ------------------------------------------------------
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/filter/misc
+JAVATESTFILES = \
+ TypeDetection6FileFormat.java \
+ FinalizedMandatoryTest.java
-.IF "$(depend)" == ""
-DisplayHint : ALLTAR
-.ELSE
-DisplayHint : ALLDEP
-.ENDIF
+JAVAFILES = $(JAVATESTFILES)
-.INCLUDE : target.mk
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
-DisplayHint:
- @echo "\ntype 'dmake FinalizedMandatoryTest'"
- @echo "\ntype 'dmake TypeDetection6FileFormat'"
- @echo "! BE SHURE YOU HAVE 'TypeDetection6FileFormat.xcu' SUCCESSFUL REGISTERED IN YOU OFFICE !"
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
-RUN: run
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-run: \
- DisplayHint
+ALLTAR : javatest
+.END
-FinalizedMandatoryTest:
- java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_PACKAGE).FinalizedMandatoryTest
-
-TypeDetection6FileFormat:
- java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_PACKAGE).TypeDetection6FileFormat
diff --git a/filter/source/config/cache/cacheitem.hxx b/filter/source/config/cache/cacheitem.hxx
index 4080e43f7bd4..742e994ad3e0 100644
--- a/filter/source/config/cache/cacheitem.hxx
+++ b/filter/source/config/cache/cacheitem.hxx
@@ -115,8 +115,8 @@ class CacheItem : public ::comphelper::SequenceAsHashMap
@param lProps
contains all properties, which must exist at this item.
- @return TRUE if all given properties exists
- at this item; FALSE otherwhise.
+ @return sal_True if all given properties exists
+ at this item; sal_False otherwhise.
*/
sal_Bool haveProps(const CacheItem& lProps) const;
@@ -132,8 +132,8 @@ class CacheItem : public ::comphelper::SequenceAsHashMap
@param lProps
contains all properties, which should not exists at this item.
- @return FALSE if at least on property exists at this item(!);
- TRUE otherwhise.
+ @return sal_False if at least on property exists at this item(!);
+ sal_True otherwhise.
*/
sal_Bool dontHaveProps(const CacheItem& lProps) const;
@@ -149,8 +149,8 @@ class CacheItem : public ::comphelper::SequenceAsHashMap
@param lProps
contains all properties, which should be checked.
- @return TRUE if all given properties dont exists
- at this item; FALSE otherwhise.
+ @return sal_True if all given properties dont exists
+ at this item; sal_False otherwhise.
*/
sal_Bool excludeProps(const CacheItem& lProps) const;
diff --git a/filter/source/config/cache/constant.hxx b/filter/source/config/cache/constant.hxx
index 46ccb5c839b3..c175f59dbb70 100644
--- a/filter/source/config/cache/constant.hxx
+++ b/filter/source/config/cache/constant.hxx
@@ -135,7 +135,6 @@ extern rtl::OUString pFilterStrings[];
#define FLAGNAME_PREFERRED _FILTER_CONFIG_FROM_ASCII_("PREFERRED" )
#define FLAGNAME_STARTPRESENTATION _FILTER_CONFIG_FROM_ASCII_("STARTPRESENTATION")
#define FLAGNAME_READONLY _FILTER_CONFIG_FROM_ASCII_("READONLY" )
-#define FLAGNAME_SILENTEXPORT _FILTER_CONFIG_FROM_ASCII_("SILENTEXPORT" )
#define FLAGNAME_SUPPORTSSELECTION _FILTER_CONFIG_FROM_ASCII_("SUPPORTSSELECTION")
#define FLAGNAME_TEMPLATE _FILTER_CONFIG_FROM_ASCII_("TEMPLATE" )
#define FLAGNAME_TEMPLATEPATH _FILTER_CONFIG_FROM_ASCII_("TEMPLATEPATH" )
@@ -161,7 +160,6 @@ extern rtl::OUString pFilterStrings[];
#define FLAGVAL_CONSULTSERVICE 0x00040000 // 262144
#define FLAGVAL_3RDPARTYFILTER 0x00080000 // 524288
#define FLAGVAL_PACKED 0x00100000 // 1048576
-#define FLAGVAL_SILENTEXPORT 0x00200000 // 2097152
#define FLAGVAL_BROWSERPREFERRED 0x00400000 // 4194304
#define FLAGVAL_COMBINED 0x00800000 // 8388608
#define FLAGVAL_ENCRYPTION 0x01000000 // 16777216
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index c439482379f4..24da6611ec72 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -2073,7 +2073,6 @@ css::uno::Sequence< ::rtl::OUString > FilterCache::impl_convertFlagField2FlagNam
if ((nFlags & FLAGVAL_PREFERRED ) == FLAGVAL_PREFERRED ) lFlagNames.push_back(FLAGNAME_PREFERRED );
if ((nFlags & FLAGVAL_STARTPRESENTATION) == FLAGVAL_STARTPRESENTATION) lFlagNames.push_back(FLAGNAME_STARTPRESENTATION);
if ((nFlags & FLAGVAL_READONLY ) == FLAGVAL_READONLY ) lFlagNames.push_back(FLAGNAME_READONLY );
- if ((nFlags & FLAGVAL_SILENTEXPORT ) == FLAGVAL_SILENTEXPORT ) lFlagNames.push_back(FLAGNAME_SILENTEXPORT );
if ((nFlags & FLAGVAL_SUPPORTSSELECTION) == FLAGVAL_SUPPORTSSELECTION) lFlagNames.push_back(FLAGNAME_SUPPORTSSELECTION);
if ((nFlags & FLAGVAL_TEMPLATE ) == FLAGVAL_TEMPLATE ) lFlagNames.push_back(FLAGNAME_TEMPLATE );
if ((nFlags & FLAGVAL_TEMPLATEPATH ) == FLAGVAL_TEMPLATEPATH ) lFlagNames.push_back(FLAGNAME_TEMPLATEPATH );
@@ -2190,11 +2189,6 @@ sal_Int32 FilterCache::impl_convertFlagNames2FlagField(const css::uno::Sequence<
nField |= FLAGVAL_READONLY;
continue;
}
- if (pNames[i].equals(FLAGNAME_SILENTEXPORT))
- {
- nField |= FLAGVAL_SILENTEXPORT;
- continue;
- }
if (pNames[i].equals(FLAGNAME_SUPPORTSSELECTION))
{
nField |= FLAGVAL_SUPPORTSSELECTION;
diff --git a/filter/source/config/cache/filtercache.hxx b/filter/source/config/cache/filtercache.hxx
index 0804ccb03033..c0623fc8cbae 100644
--- a/filter/source/config/cache/filtercache.hxx
+++ b/filter/source/config/cache/filtercache.hxx
@@ -383,7 +383,7 @@ class FilterCache : public BaseLock
cache items seems to be available after calling of "loadAll()"
on this cache and first search does not had any valid results.
- @return TRUE if the required fill state exists for this cache; FALSE
+ @return sal_True if the required fill state exists for this cache; FALSE
otherwise.
*/
virtual sal_Bool isFillState(EFillState eRequired) const
@@ -1032,7 +1032,7 @@ class FilterCache : public BaseLock
@param sModule
the long name of the module (e.g. "com.sun.star.text.TextDocument").
- @return TRUE if the requested module is installed; FALSE otherwise.
+ @return sal_True if the requested module is installed; sal_False otherwise.
*/
sal_Bool impl_isModuleInstalled(const ::rtl::OUString& sModule);
diff --git a/filter/source/config/cache/filterconfig1.component b/filter/source/config/cache/filterconfig1.component
new file mode 100644
index 000000000000..9d3c7c90fb31
--- /dev/null
+++ b/filter/source/config/cache/filterconfig1.component
@@ -0,0 +1,46 @@
+<?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.filter.config.ConfigFlush">
+ <service name="com.sun.star.document.FilterConfigRefresh"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.filter.config.ContentHandlerFactory">
+ <service name="com.sun.star.frame.ContentHandlerFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.filter.config.FilterFactory">
+ <service name="com.sun.star.document.FilterFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.filter.config.FrameLoaderFactory">
+ <service name="com.sun.star.frame.FrameLoaderFactory"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.filter.config.TypeDetection">
+ <service name="com.sun.star.document.TypeDetection"/>
+ </implementation>
+</component>
diff --git a/filter/source/config/cache/makefile.mk b/filter/source/config/cache/makefile.mk
index fbc4806b0a32..d94c81e35010 100644
--- a/filter/source/config/cache/makefile.mk
+++ b/filter/source/config/cache/makefile.mk
@@ -77,3 +77,11 @@ SHL1VERSIONMAP= $(SOLARENV)/src/component.map
# --- Targets ----------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/filterconfig1.component
+
+$(MISC)/filterconfig1.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt filterconfig1.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt filterconfig1.component
diff --git a/filter/source/config/cache/registration.cxx b/filter/source/config/cache/registration.cxx
index d9422c750721..40419258834d 100644
--- a/filter/source/config/cache/registration.cxx
+++ b/filter/source/config/cache/registration.cxx
@@ -95,30 +95,6 @@ static void InitConstants()
// extern "C" component_getImplementationEnvironment()
_COMPHELPER_COMPONENT_GETIMPLEMENTATIONENVIRONMENT
-// extern "C" component_writeInfo()
-_COMPHELPER_COMPONENT_WRITEINFO
-(
- _COMPHELPER_COMPONENTINFO( TypeDetection ,
- TypeDetection::impl_getImplementationName() ,
- TypeDetection::impl_getSupportedServiceNames())
-
- _COMPHELPER_COMPONENTINFO( FilterFactory ,
- FilterFactory::impl_getImplementationName() ,
- FilterFactory::impl_getSupportedServiceNames())
-
- _COMPHELPER_COMPONENTINFO( ContentHandlerFactory ,
- ContentHandlerFactory::impl_getImplementationName() ,
- ContentHandlerFactory::impl_getSupportedServiceNames())
-
- _COMPHELPER_COMPONENTINFO( FrameLoaderFactory ,
- FrameLoaderFactory::impl_getImplementationName() ,
- FrameLoaderFactory::impl_getSupportedServiceNames())
-
- _COMPHELPER_COMPONENTINFO( ConfigFlush ,
- ConfigFlush::impl_getImplementationName() ,
- ConfigFlush::impl_getSupportedServiceNames())
-)
-
// extern "C" component_getFactory()
_COMPHELPER_COMPONENT_GETFACTORY
(
diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx
index a98a5c0610d3..93b926cc3cc6 100644
--- a/filter/source/config/cache/typedetection.cxx
+++ b/filter/source/config/cache/typedetection.cxx
@@ -169,7 +169,7 @@ TypeDetection::~TypeDetection()
// by calling its registered deep detection service.
// But break this loop if a type match to the given descriptor
// by an URL pattern(!) or if deep detection isnt allowed from
- // outside (bAllowDeep=FALSE) or break the whole detection by
+ // outside (bAllowDeep=sal_False) or break the whole detection by
// throwing an exception if creation of the might needed input
// stream failed by e.g. an IO exception ...
OUStringList lUsedDetectors;
@@ -1083,12 +1083,11 @@ void TypeDetection::impl_seekStreamToZero(comphelper::MediaDescriptor& rDescript
try
{
// create a new request to ask user for it's decision about the usable filter
- ::framework::RequestFilterSelect* pRequest = new ::framework::RequestFilterSelect(sURL);
- css::uno::Reference< css::task::XInteractionRequest > xRequest(static_cast< css::task::XInteractionRequest* >(pRequest), css::uno::UNO_QUERY_THROW);
- xInteraction->handle(xRequest);
+ ::framework::RequestFilterSelect aRequest(sURL);
+ xInteraction->handle(aRequest.GetRequest());
// "Cancel" pressed? => return with error
- if (pRequest->isAbort())
+ if (aRequest.isAbort())
return ::rtl::OUString();
// "OK" pressed => verify the selected filter, get it's coressponding
@@ -1097,7 +1096,7 @@ void TypeDetection::impl_seekStreamToZero(comphelper::MediaDescriptor& rDescript
// a type here only. But we must be shure, that the selected filter is used
// too and no ambigous filter registration disturb us .-)
- ::rtl::OUString sFilter = pRequest->getFilter();
+ ::rtl::OUString sFilter = aRequest.getFilter();
if (!impl_validateAndSetFilterOnDescriptor(rDescriptor, sFilter))
return ::rtl::OUString();
diff --git a/filter/source/config/fragments/filters/MS_PowerPoint_97.xcu b/filter/source/config/fragments/filters/MS_PowerPoint_97.xcu
index 7c61f7c14084..20c55429e465 100644
--- a/filter/source/config/fragments/filters/MS_PowerPoint_97.xcu
+++ b/filter/source/config/fragments/filters/MS_PowerPoint_97.xcu
@@ -1,5 +1,5 @@
<node oor:name="MS PowerPoint 97" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN ENCRYPTION PASSWORDTOMODIFY</value></prop>
+ <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"/>
<prop oor:name="UserData"><value>sdfilt</value></prop>
diff --git a/filter/source/config/fragments/filters/MS_PowerPoint_97_Vorlage.xcu b/filter/source/config/fragments/filters/MS_PowerPoint_97_Vorlage.xcu
index 505084d4d39f..b0776fda9500 100644
--- a/filter/source/config/fragments/filters/MS_PowerPoint_97_Vorlage.xcu
+++ b/filter/source/config/fragments/filters/MS_PowerPoint_97_Vorlage.xcu
@@ -1,5 +1,5 @@
<node oor:name="MS PowerPoint 97 Vorlage" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN ENCRYPTION PASSWORDTOMODIFY</value></prop>
+ <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"/>
<prop oor:name="UserData"><value>sdfilt</value></prop>
diff --git a/filter/source/config/fragments/filters/StarCalc_3_0.xcu b/filter/source/config/fragments/filters/StarCalc_3_0.xcu
index fc96b7d6cd99..59d1682d5e91 100644
--- a/filter/source/config/fragments/filters/StarCalc_3_0.xcu
+++ b/filter/source/config/fragments/filters/StarCalc_3_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarCalc 3.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarCalc_3_0_Vorlage_Template.xcu b/filter/source/config/fragments/filters/StarCalc_3_0_Vorlage_Template.xcu
index 1dce482b0fdf..d71f4625baa8 100644
--- a/filter/source/config/fragments/filters/StarCalc_3_0_Vorlage_Template.xcu
+++ b/filter/source/config/fragments/filters/StarCalc_3_0_Vorlage_Template.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarCalc 3.0 Vorlage/Template" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarCalc_4_0.xcu b/filter/source/config/fragments/filters/StarCalc_4_0.xcu
index c12d34b3ee8e..8ce6a5224426 100644
--- a/filter/source/config/fragments/filters/StarCalc_4_0.xcu
+++ b/filter/source/config/fragments/filters/StarCalc_4_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarCalc 4.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarCalc_4_0_Vorlage_Template.xcu b/filter/source/config/fragments/filters/StarCalc_4_0_Vorlage_Template.xcu
index b27b0cd4fcc1..caa58a176d00 100644
--- a/filter/source/config/fragments/filters/StarCalc_4_0_Vorlage_Template.xcu
+++ b/filter/source/config/fragments/filters/StarCalc_4_0_Vorlage_Template.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarCalc 4.0 Vorlage/Template" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarCalc_5_0.xcu b/filter/source/config/fragments/filters/StarCalc_5_0.xcu
index 7378d4d7a405..4f9838bb5e95 100644
--- a/filter/source/config/fragments/filters/StarCalc_5_0.xcu
+++ b/filter/source/config/fragments/filters/StarCalc_5_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarCalc 5.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarCalc_5_0_Vorlage_Template.xcu b/filter/source/config/fragments/filters/StarCalc_5_0_Vorlage_Template.xcu
index edefd738acfa..ad43c3b0e1c9 100644
--- a/filter/source/config/fragments/filters/StarCalc_5_0_Vorlage_Template.xcu
+++ b/filter/source/config/fragments/filters/StarCalc_5_0_Vorlage_Template.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarCalc 5.0 Vorlage/Template" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarChart_3_0.xcu b/filter/source/config/fragments/filters/StarChart_3_0.xcu
index ca7c4ab13867..fa756883f332 100644
--- a/filter/source/config/fragments/filters/StarChart_3_0.xcu
+++ b/filter/source/config/fragments/filters/StarChart_3_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarChart 3.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER SILENTEXPORT</value></prop>
+ <prop oor:name="Flags"><value>IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarChart_4_0.xcu b/filter/source/config/fragments/filters/StarChart_4_0.xcu
index d6b909ed2537..ed5e69c88ade 100644
--- a/filter/source/config/fragments/filters/StarChart_4_0.xcu
+++ b/filter/source/config/fragments/filters/StarChart_4_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarChart 4.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER SILENTEXPORT</value></prop>
+ <prop oor:name="Flags"><value>IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarChart_5_0.xcu b/filter/source/config/fragments/filters/StarChart_5_0.xcu
index 8f095aef9c79..43326bd6e82a 100644
--- a/filter/source/config/fragments/filters/StarChart_5_0.xcu
+++ b/filter/source/config/fragments/filters/StarChart_5_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarChart 5.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER SILENTEXPORT</value></prop>
+ <prop oor:name="Flags"><value>IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_3_0.xcu b/filter/source/config/fragments/filters/StarDraw_3_0.xcu
index e4c22be3a3ee..3f9ca691236d 100644
--- a/filter/source/config/fragments/filters/StarDraw_3_0.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_3_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 3.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage.xcu b/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage.xcu
index ab1dd6f0ad23..ce8eda7943b0 100644
--- a/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 3.0 Vorlage" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage__StarImpress_.xcu b/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage__StarImpress_.xcu
index f255fb901937..f44f7da0dac8 100644
--- a/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage__StarImpress_.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_3_0_Vorlage__StarImpress_.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 3.0 Vorlage (StarImpress)" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_3_0__StarImpress_.xcu b/filter/source/config/fragments/filters/StarDraw_3_0__StarImpress_.xcu
index b0ce586e9ee9..1dcce8b34680 100644
--- a/filter/source/config/fragments/filters/StarDraw_3_0__StarImpress_.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_3_0__StarImpress_.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 3.0 (StarImpress)" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_5_0.xcu b/filter/source/config/fragments/filters/StarDraw_5_0.xcu
index da5376827a41..ef5075ef066e 100644
--- a/filter/source/config/fragments/filters/StarDraw_5_0.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_5_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 5.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage.xcu b/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage.xcu
index 298ab1215761..7168ce984f8f 100644
--- a/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 5.0 Vorlage" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage__StarImpress_.xcu b/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage__StarImpress_.xcu
index 8261bc648b93..2956522f2e67 100644
--- a/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage__StarImpress_.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_5_0_Vorlage__StarImpress_.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 5.0 Vorlage (StarImpress)" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarDraw_5_0__StarImpress_.xcu b/filter/source/config/fragments/filters/StarDraw_5_0__StarImpress_.xcu
index a76ebfc3f3c2..67d03c77af17 100644
--- a/filter/source/config/fragments/filters/StarDraw_5_0__StarImpress_.xcu
+++ b/filter/source/config/fragments/filters/StarDraw_5_0__StarImpress_.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarDraw 5.0 (StarImpress)" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarImpress_4_0.xcu b/filter/source/config/fragments/filters/StarImpress_4_0.xcu
index b8bd8c51bbb0..ef28390774b5 100644
--- a/filter/source/config/fragments/filters/StarImpress_4_0.xcu
+++ b/filter/source/config/fragments/filters/StarImpress_4_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarImpress 4.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarImpress_4_0_Vorlage.xcu b/filter/source/config/fragments/filters/StarImpress_4_0_Vorlage.xcu
index 68ad61d1270e..b4d73953bd00 100644
--- a/filter/source/config/fragments/filters/StarImpress_4_0_Vorlage.xcu
+++ b/filter/source/config/fragments/filters/StarImpress_4_0_Vorlage.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarImpress 4.0 Vorlage" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarImpress_5_0.xcu b/filter/source/config/fragments/filters/StarImpress_5_0.xcu
index 544b9187d1f2..1c1377cf3ab7 100644
--- a/filter/source/config/fragments/filters/StarImpress_5_0.xcu
+++ b/filter/source/config/fragments/filters/StarImpress_5_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarImpress 5.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarImpress_5_0_Vorlage.xcu b/filter/source/config/fragments/filters/StarImpress_5_0_Vorlage.xcu
index c73995cca8c6..9da35f9745e4 100644
--- a/filter/source/config/fragments/filters/StarImpress_5_0_Vorlage.xcu
+++ b/filter/source/config/fragments/filters/StarImpress_5_0_Vorlage.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarImpress 5.0 Vorlage" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value></value></prop>
diff --git a/filter/source/config/fragments/filters/StarMath_5_0.xcu b/filter/source/config/fragments/filters/StarMath_5_0.xcu
index e583d4bf32ec..6d52188d81dd 100644
--- a/filter/source/config/fragments/filters/StarMath_5_0.xcu
+++ b/filter/source/config/fragments/filters/StarMath_5_0.xcu
@@ -1,5 +1,5 @@
<node oor:name="StarMath 5.0" oor:op="replace">
- <prop oor:name="Flags"><value>IMPORT EXPORT OWN ALIEN 3RDPARTYFILTER</value></prop>
+ <prop oor:name="Flags"><value>IMPORT OWN ALIEN 3RDPARTYFILTER</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.office.BF_MigrateFilter</value></prop>
<prop oor:name="UserData"><value>0</value></prop>
diff --git a/filter/source/config/fragments/filters/calc_MS_Excel_2007_Binary.xcu b/filter/source/config/fragments/filters/calc_MS_Excel_2007_Binary.xcu
index 650c0cf980fb..2402d74084e3 100644
--- a/filter/source/config/fragments/filters/calc_MS_Excel_2007_Binary.xcu
+++ b/filter/source/config/fragments/filters/calc_MS_Excel_2007_Binary.xcu
@@ -1,7 +1,7 @@
<node oor:name="Calc MS Excel 2007 Binary" oor:op="replace">
<prop oor:name="Flags"><value>IMPORT ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
- <prop oor:name="FilterService"><value>com.sun.star.comp.oox.ExcelFilter</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.oox.xls.ExcelFilter</value></prop>
<prop oor:name="UserData"/>
<prop oor:name="FileFormatVersion"/>
<prop oor:name="Type"><value>MS Excel 2007 Binary</value></prop>
diff --git a/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML.xcu b/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML.xcu
index 50d29ce8edaf..2e98250789bf 100644
--- a/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML.xcu
+++ b/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML.xcu
@@ -1,7 +1,7 @@
<node oor:name="Calc MS Excel 2007 XML" oor:op="replace">
<prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
- <prop oor:name="FilterService"><value>com.sun.star.comp.oox.ExcelFilter</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.oox.xls.ExcelFilter</value></prop>
<prop oor:name="UserData"/>
<prop oor:name="FileFormatVersion"/>
<prop oor:name="Type"><value>MS Excel 2007 XML</value></prop>
diff --git a/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML_Template.xcu b/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML_Template.xcu
index 46f1eca86085..d5a14a27d0e2 100644
--- a/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML_Template.xcu
+++ b/filter/source/config/fragments/filters/calc_MS_Excel_2007_XML_Template.xcu
@@ -1,7 +1,7 @@
<node oor:name="Calc MS Excel 2007 XML Template" oor:op="replace">
<prop oor:name="Flags"><value>IMPORT ALIEN 3RDPARTYFILTER TEMPLATE TEMPLATEPATH</value></prop>
<prop oor:name="UIComponent"/>
- <prop oor:name="FilterService"><value>com.sun.star.comp.oox.ExcelFilter</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.oox.xls.ExcelFilter</value></prop>
<prop oor:name="UserData"/>
<prop oor:name="FileFormatVersion"/>
<prop oor:name="Type"><value>MS Excel 2007 XML Template</value></prop>
diff --git a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu
index 138d449fcd24..30a06ca05c07 100644
--- a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu
+++ b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu
@@ -1,7 +1,7 @@
<node oor:name="Impress MS PowerPoint 2007 XML" oor:op="replace">
<prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
- <prop oor:name="FilterService"><value>com.sun.star.comp.Impress.oox.PowerPointImport</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.oox.ppt.PowerPointImport</value></prop>
<prop oor:name="UserData"/>
<prop oor:name="FileFormatVersion"/>
<prop oor:name="Type"><value>MS PowerPoint 2007 XML</value></prop>
diff --git a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu
index eb9fea60875c..b0a3261282dd 100644
--- a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu
+++ b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu
@@ -1,7 +1,7 @@
<node oor:name="Impress MS PowerPoint 2007 XML Template" oor:op="replace">
<prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER TEMPLATE TEMPLATEPATH PREFERRED</value></prop>
<prop oor:name="UIComponent"/>
- <prop oor:name="FilterService"><value>com.sun.star.comp.Impress.oox.PowerPointImport</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.oox.ppt.PowerPointImport</value></prop>
<prop oor:name="UserData"/>
<prop oor:name="UIName"><value xml:lang="x-default">Microsoft PowerPoint 2007 XML Template</value></prop>
<prop oor:name="FileFormatVersion"/>
diff --git a/filter/source/config/fragments/internalgraphicfilters/ras_Export.xcu b/filter/source/config/fragments/internalgraphicfilters/ras_Export.xcu
index aabae28a10c4..69aa0147ea36 100644
--- a/filter/source/config/fragments/internalgraphicfilters/ras_Export.xcu
+++ b/filter/source/config/fragments/internalgraphicfilters/ras_Export.xcu
@@ -2,7 +2,7 @@
<prop oor:name="Type"><value>ras_Sun_Rasterfile</value></prop>
<prop oor:name="FormatName"><value>era</value></prop>
<prop oor:name="RealFilterName"/>
- <prop oor:name="UIComponent"/>
+ <prop oor:name="UIComponent"><value>com.sun.star.svtools.SvFilterOptionsDialog</value></prop>
<prop oor:name="UIName">
<value xml:lang="en-US">RAS - Sun Raster Image</value>
</prop>
diff --git a/filter/source/config/fragments/internalgraphicfilters/svg_Export.xcu b/filter/source/config/fragments/internalgraphicfilters/svg_Export.xcu
index 72653869a68d..30b7122a654d 100644
--- a/filter/source/config/fragments/internalgraphicfilters/svg_Export.xcu
+++ b/filter/source/config/fragments/internalgraphicfilters/svg_Export.xcu
@@ -2,7 +2,7 @@
<prop oor:name="Type"><value>svg_Scalable_Vector_Graphics</value></prop>
<prop oor:name="FormatName"><value>SVESVG</value></prop>
<prop oor:name="RealFilterName"/>
- <prop oor:name="UIComponent"/>
+ <prop oor:name="UIComponent"><value>com.sun.star.svtools.SvFilterOptionsDialog</value></prop>
<prop oor:name="UIName">
<value xml:lang="en-US">SVG - Scalable Vector Graphics</value>
</prop>
diff --git a/filter/source/config/fragments/internalgraphicfilters/tif_Export.xcu b/filter/source/config/fragments/internalgraphicfilters/tif_Export.xcu
index a7d39ebdc8a4..791335acce1f 100644
--- a/filter/source/config/fragments/internalgraphicfilters/tif_Export.xcu
+++ b/filter/source/config/fragments/internalgraphicfilters/tif_Export.xcu
@@ -2,7 +2,7 @@
<prop oor:name="Type"><value>tif_Tag_Image_File</value></prop>
<prop oor:name="FormatName"><value>eti</value></prop>
<prop oor:name="RealFilterName"/>
- <prop oor:name="UIComponent"/>
+ <prop oor:name="UIComponent"><value>com.sun.star.svtools.SvFilterOptionsDialog</value></prop>
<prop oor:name="UIName">
<value xml:lang="en-US">TIFF - Tagged Image File Format</value>
</prop>
diff --git a/filter/source/config/fragments/internalgraphicfilters/xpm_Export.xcu b/filter/source/config/fragments/internalgraphicfilters/xpm_Export.xcu
index ee1effb786e9..660a240a6678 100644
--- a/filter/source/config/fragments/internalgraphicfilters/xpm_Export.xcu
+++ b/filter/source/config/fragments/internalgraphicfilters/xpm_Export.xcu
@@ -2,7 +2,7 @@
<prop oor:name="Type"><value>xpm_XPM</value></prop>
<prop oor:name="FormatName"><value>exp</value></prop>
<prop oor:name="RealFilterName"/>
- <prop oor:name="UIComponent"/>
+ <prop oor:name="UIComponent"><value>com.sun.star.svtools.SvFilterOptionsDialog</value></prop>
<prop oor:name="UIName">
<value xml:lang="en-US">XPM - X PixMap</value>
</prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_40.xcu b/filter/source/config/fragments/types/calc_MS_Excel_40.xcu
index b45c21fa33bd..939a0a4025ad 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_40.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_40.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_40" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xls xlw xlc xlm</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_40_VorlageTemplate.xcu b/filter/source/config/fragments/types/calc_MS_Excel_40_VorlageTemplate.xcu
index 42bb10ed09c8..291382df43b6 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_40_VorlageTemplate.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_40_VorlageTemplate.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_40_VorlageTemplate" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xlt</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_5095.xcu b/filter/source/config/fragments/types/calc_MS_Excel_5095.xcu
index 3f450f0cb85f..5656b73f57dd 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_5095.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_5095.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_5095" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xls xlc xlm xlw</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_5095_VorlageTemplate.xcu b/filter/source/config/fragments/types/calc_MS_Excel_5095_VorlageTemplate.xcu
index 8dbb02c0170e..9c1799dfe405 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_5095_VorlageTemplate.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_5095_VorlageTemplate.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_5095_VorlageTemplate" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xlt</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_95.xcu b/filter/source/config/fragments/types/calc_MS_Excel_95.xcu
index 0ea10dddc31e..8e02ea8f088d 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_95.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_95.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_95" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xls xlc xlm xlw</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_95_VorlageTemplate.xcu b/filter/source/config/fragments/types/calc_MS_Excel_95_VorlageTemplate.xcu
index fb3e41014f85..bc80367624f3 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_95_VorlageTemplate.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_95_VorlageTemplate.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_95_VorlageTemplate" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xlt</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_97.xcu b/filter/source/config/fragments/types/calc_MS_Excel_97.xcu
index 9f1949d9f413..ab71bc304247 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_97.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_97.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_97" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xls xlc xlm xlw</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/config/fragments/types/calc_MS_Excel_97_VorlageTemplate.xcu b/filter/source/config/fragments/types/calc_MS_Excel_97_VorlageTemplate.xcu
index 26f4bca3a725..ff390ce3d376 100644
--- a/filter/source/config/fragments/types/calc_MS_Excel_97_VorlageTemplate.xcu
+++ b/filter/source/config/fragments/types/calc_MS_Excel_97_VorlageTemplate.xcu
@@ -1,5 +1,5 @@
<node oor:name="calc_MS_Excel_97_VorlageTemplate" oor:op="replace" >
- <prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
+ <prop oor:name="DetectService"><value>com.sun.star.comp.oox.xls.BiffDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xlt</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
diff --git a/filter/source/filtertracer/exports.dxp b/filter/source/filtertracer/exports.dxp
index 0c2e3e7cddd7..0cb5620a1603 100644
--- a/filter/source/filtertracer/exports.dxp
+++ b/filter/source/filtertracer/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory \ No newline at end of file
diff --git a/filter/source/filtertracer/filtertraceruno.cxx b/filter/source/filtertracer/filtertraceruno.cxx
index 2e98140b2668..bcde78fc8e8e 100644
--- a/filter/source/filtertracer/filtertraceruno.cxx
+++ b/filter/source/filtertracer/filtertraceruno.cxx
@@ -52,37 +52,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-// -----------------------
-// - component_writeInfo -
-// -----------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey )
-{
- sal_Bool bRet = sal_False;
-
- if( pRegistryKey )
- {
- try
- {
- NMSP_UNO::Reference< com::sun::star::registry::XRegistryKey > xNewKey(
- reinterpret_cast< com::sun::star::registry::XRegistryKey * >( pRegistryKey )->createKey(
- FilterTracer_getImplementationName() ) );
- xNewKey = xNewKey->createKey( B2UCONST( "/UNO/SERVICES" ) );
- const SEQ( rtl::OUString )& rSNL = FilterTracer_getSupportedServiceNames();
- const rtl::OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
- bRet = sal_True;
- }
- catch( com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
-
- return bRet;
-}
-
// ------------------------
// - component_getFactory -
// ------------------------
diff --git a/filter/source/flash/flash.component b/filter/source/flash/flash.component
new file mode 100644
index 000000000000..1ce69b3549bc
--- /dev/null
+++ b/filter/source/flash/flash.component
@@ -0,0 +1,37 @@
+<?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.Impress.FlashExportDialog">
+ <service name="com.sun.star.Impress.FlashExportDialog"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Impress.FlashExportFilter">
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
+</component>
diff --git a/filter/source/flash/impswfdialog.cxx b/filter/source/flash/impswfdialog.cxx
index 86ed934acf3f..c7e897dd6abb 100644
--- a/filter/source/flash/impswfdialog.cxx
+++ b/filter/source/flash/impswfdialog.cxx
@@ -65,7 +65,7 @@ ImpSWFDialog::ImpSWFDialog( Window* pParent, ResMgr& rResMgr, Sequence< Property
maBtnHelp( this, ResId( BTN_HELP, rResMgr ) ),
maConfigItem( String( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Flash/Export/" ) ), &rFilterData )
{
- const ULONG nCompressMode = maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "CompressMode" ) ), 75 );
+ const sal_uLong nCompressMode = maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "CompressMode" ) ), 75 );
maNumFldQuality.SetValue( nCompressMode );
maCheckExportAll.Check();
diff --git a/filter/source/flash/impswfdialog.src b/filter/source/flash/impswfdialog.src
index 3e38dde68441..83015a3adfeb 100644
--- a/filter/source/flash/impswfdialog.src
+++ b/filter/source/flash/impswfdialog.src
@@ -29,6 +29,7 @@
ModalDialog DLG_OPTIONS
{
+ HelpID = "filter:ModalDialog:DLG_OPTIONS";
Size = MAP_APPFONT ( 200 , 200 ) ;
OutputSize = TRUE ;
SVLook = TRUE ;
@@ -44,6 +45,7 @@ ModalDialog DLG_OPTIONS
};
NumericField NUM_FLD_QUALITY
{
+ HelpID = "filter:NumericField:DLG_OPTIONS:NUM_FLD_QUALITY";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 33 ) ;
Size = MAP_APPFONT ( 50 , 12 ) ;
@@ -57,6 +59,7 @@ ModalDialog DLG_OPTIONS
};
CheckBox BOOL_EXPORT_ALL
{
+ HelpID = "filter:CheckBox:DLG_OPTIONS:BOOL_EXPORT_ALL";
Pos = MAP_APPFONT ( 12 , 65 ) ;
Size = MAP_APPFONT ( 10 , 14 ) ;
TabStop = TRUE ;
@@ -69,6 +72,7 @@ ModalDialog DLG_OPTIONS
};
CheckBox BOOL_EXPORT_MULTIPLE_FILES
{
+ HelpID = "filter:CheckBox:DLG_OPTIONS:BOOL_EXPORT_MULTIPLE_FILES";
Pos = MAP_APPFONT ( 12 , 80 ) ;
Size = MAP_APPFONT ( 10 , 14 ) ;
TabStop = TRUE ;
@@ -81,6 +85,7 @@ ModalDialog DLG_OPTIONS
};
CheckBox BOOL_EXPORT_BACKGROUNDS
{
+ HelpID = "filter:CheckBox:DLG_OPTIONS:BOOL_EXPORT_BACKGROUNDS";
Pos = MAP_APPFONT ( 22 , 95 ) ;
Size = MAP_APPFONT ( 10 , 14 ) ;
TabStop = TRUE ;
@@ -93,6 +98,7 @@ ModalDialog DLG_OPTIONS
};
CheckBox BOOL_EXPORT_BACKGROUND_OBJECTS
{
+ HelpID = "filter:CheckBox:DLG_OPTIONS:BOOL_EXPORT_BACKGROUND_OBJECTS";
Pos = MAP_APPFONT ( 22 , 107) ;
Size = MAP_APPFONT ( 10 , 14 ) ;
TabStop = TRUE ;
@@ -105,6 +111,7 @@ ModalDialog DLG_OPTIONS
};
CheckBox BOOL_EXPORT_SLIDE_CONTENTS
{
+ HelpID = "filter:CheckBox:DLG_OPTIONS:BOOL_EXPORT_SLIDE_CONTENTS";
Pos = MAP_APPFONT ( 22 , 119 ) ;
Size = MAP_APPFONT ( 10 , 14 ) ;
TabStop = TRUE ;
@@ -117,6 +124,7 @@ ModalDialog DLG_OPTIONS
};
CheckBox BOOL_EXPORT_SOUND
{
+ HelpID = "filter:CheckBox:DLG_OPTIONS:BOOL_EXPORT_SOUND";
Pos = MAP_APPFONT ( 12 , 134 ) ;
Size = MAP_APPFONT ( 10 , 14 ) ;
TabStop = TRUE ;
@@ -129,6 +137,7 @@ ModalDialog DLG_OPTIONS
};
CheckBox BOOL_EXPORT_OLE_AS_JPEG
{
+ HelpID = "filter:CheckBox:DLG_OPTIONS:BOOL_EXPORT_OLE_AS_JPEG";
Pos = MAP_APPFONT ( 12 , 146 ) ;
Size = MAP_APPFONT ( 10 , 14 ) ;
TabStop = TRUE ;
diff --git a/filter/source/flash/makefile.mk b/filter/source/flash/makefile.mk
index e5ff1bf21c5e..69da217234d8 100644
--- a/filter/source/flash/makefile.mk
+++ b/filter/source/flash/makefile.mk
@@ -96,3 +96,11 @@ DEF1NAME=$(SHL1TARGET)
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/flash.component
+
+$(MISC)/flash.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ flash.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt flash.component
diff --git a/filter/source/flash/swfexporter.cxx b/filter/source/flash/swfexporter.cxx
index 7efa0daf03a7..6f2fb3b69321 100644
--- a/filter/source/flash/swfexporter.cxx
+++ b/filter/source/flash/swfexporter.cxx
@@ -703,10 +703,10 @@ bool FlashExporter::getMetaFile( Reference< XComponent >&xComponent, GDIMetaFile
BitmapEx rBitmapEx( aGraphic.GetBitmap(), Color(255,255,255) );
Rectangle clipRect;
- for( ULONG i = 0, nCount = rMtf.GetActionCount(); i < nCount; i++ )
+ for( sal_uLong i = 0, nCount = rMtf.GetActionCount(); i < nCount; i++ )
{
const MetaAction* pAction = rMtf.GetAction( i );
- const USHORT nType = pAction->GetType();
+ const sal_uInt16 nType = pAction->GetType();
switch( nType )
{
diff --git a/filter/source/flash/swfuno.cxx b/filter/source/flash/swfuno.cxx
index 22f33980a898..908b12b28bd9 100644
--- a/filter/source/flash/swfuno.cxx
+++ b/filter/source/flash/swfuno.cxx
@@ -62,42 +62,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//==================================================================================================
-
-void singlecomponent_writeInfo( Reference< XRegistryKey >& xNewKey, const Sequence< OUString > & rSNL )
-{
- const OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-}
-
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void * /* pServiceManager */, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( FlashExportFilter_getImplementationName() ) );
- xNewKey = xNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" )) );
- singlecomponent_writeInfo( xNewKey, FlashExportFilter_getSupportedServiceNames() );
-
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( SWFDialog_getImplementationName() );
- xNewKey = xNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" )) );
-
- singlecomponent_writeInfo( xNewKey, SWFDialog_getSupportedServiceNames() );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
//==================================================================================================
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index 692f7049a681..7082b0852acf 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -143,7 +143,7 @@ void Writer::Impl_addPolygon( BitStream& rBits, const Polygon& rPoly, sal_Bool b
Impl_addShapeRecordChange( rBits, _Int16(aLastPoint.X()),_Int16(aLastPoint.Y()), bFilled );
- USHORT i = 0, nSize = rPoly.GetSize();
+ sal_uInt16 i = 0, nSize = rPoly.GetSize();
double d = 16.0f;
@@ -540,7 +540,7 @@ void Writer::Impl_writeText( const Point& rPos, const String& rText, const sal_I
{
// todo: optimize me as this will generate a huge amount of duplicate polygons
PolyPolygon aPolyPoygon;
- mpVDev->GetTextOutline( aPolyPoygon, rText, 0, 0, (USHORT)nLen, TRUE, nWidth, pDXArray );
+ mpVDev->GetTextOutline( aPolyPoygon, rText, 0, 0, (sal_uInt16)nLen, sal_True, nWidth, pDXArray );
aPolyPoygon.Translate( rPos );
Impl_writePolyPolygon( aPolyPoygon, sal_True, aTextColor, aTextColor );
}
@@ -566,7 +566,7 @@ void Writer::Impl_writeText( const Point& rPos, const String& rText, const sal_I
if( nLen > 1 )
{
- aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( rText.GetChar( (USHORT) nLen - 1 ) );
+ aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( rText.GetChar( (sal_uInt16) nLen - 1 ) );
if( nWidth && aNormSize.Width() && ( nWidth != aNormSize.Width() ) )
{
@@ -816,7 +816,7 @@ void getBitmapData( const BitmapEx& aBmpEx, sal_uInt8*& tgadata, sal_uInt8*& tga
// -----------------------------------------------------------------------------
sal_uInt16 Writer::defineBitmap( const BitmapEx &bmpSource, sal_Int32 nJPEGQualityLevel )
{
- ULONG bmpChecksum = bmpSource.GetChecksum();
+ sal_uLong bmpChecksum = bmpSource.GetChecksum();
ChecksumCache::iterator it = mBitmapCache.find(bmpChecksum);
@@ -1235,7 +1235,7 @@ bool Writer::Impl_writeStroke( SvtGraphicStroke& rStroke )
Color aColor( mpVDev->GetLineColor() );
if( 0.0 != rStroke.getTransparency() )
- aColor.SetTransparency( sal::static_int_cast<UINT8>( MinMax( (long int)( rStroke.getTransparency() * 0xff ), 0, 0xff ) ) );
+ aColor.SetTransparency( sal::static_int_cast<sal_uInt8>( MinMax( (long int)( rStroke.getTransparency() * 0xff ), 0, 0xff ) ) );
sal_uInt16 nShapeId = defineShape( aPolyPolygon, sal::static_int_cast<sal_uInt16>( mapRelative( (sal_Int32)( rStroke.getStrokeWidth() ) ) ), aColor );
maShapeIds.push_back( nShapeId );
@@ -1265,7 +1265,7 @@ bool Writer::Impl_writeFilling( SvtGraphicFill& rFilling )
Color aColor( rFilling.getFillColor() );
if( 0.0 != rFilling.getTransparency() )
- aColor.SetTransparency( sal::static_int_cast<UINT8>( MinMax( (long int)( rFilling.getTransparency() * 0xff ) , 0, 0xff ) ) );
+ aColor.SetTransparency( sal::static_int_cast<sal_uInt8>( MinMax( (long int)( rFilling.getTransparency() * 0xff ) , 0, 0xff ) ) );
FillStyle aFillStyle( aColor );
@@ -1414,10 +1414,10 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf )
{
Rectangle clipRect;
int bMap = 0;
- for( ULONG i = 0, nCount = rMtf.GetActionCount(); i < nCount; i++ )
+ for( sal_uLong i = 0, nCount = rMtf.GetActionCount(); i < nCount; i++ )
{
const MetaAction* pAction = rMtf.GetAction( i );
- const USHORT nType = pAction->GetType();
+ const sal_uInt16 nType = pAction->GetType();
switch( nType )
{
@@ -1635,7 +1635,7 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf )
const GDIMetaFile aGDIMetaFile( pA->GetSubstitute() );
sal_Bool bFound = sal_False;
- for( ULONG j = 0, nC = aGDIMetaFile.GetActionCount(); ( j < nC ) && !bFound; j++ )
+ for( sal_uLong j = 0, nC = aGDIMetaFile.GetActionCount(); ( j < nC ) && !bFound; j++ )
{
const MetaAction* pSubstAct = aGDIMetaFile.GetAction( j );
@@ -1654,7 +1654,7 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf )
case( META_COMMENT_ACTION ):
{
const MetaCommentAction* pA = (const MetaCommentAction*) pAction;
- const BYTE* pData = pA->GetData();
+ const sal_uInt8* pData = pA->GetData();
String aSkipComment;
if( pA->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL )
diff --git a/filter/source/flash/swfwriter2.cxx b/filter/source/flash/swfwriter2.cxx
index 09eae898174a..32ea94aea611 100644
--- a/filter/source/flash/swfwriter2.cxx
+++ b/filter/source/flash/swfwriter2.cxx
@@ -482,7 +482,7 @@ sal_uInt16 FlashFont::getGlyph( sal_uInt16 nChar, VirtualDevice* pVDev )
{
Polygon& rPoly = aPolyPoly[ i ];
- const USHORT nSize = rPoly.GetSize();
+ const sal_uInt16 nSize = rPoly.GetSize();
if( nSize )
{
// convert polygon to flash EM_SQUARE (1024x1024)
diff --git a/filter/source/graphicfilter/egif/dlgegif.cxx b/filter/source/graphicfilter/egif/dlgegif.cxx
deleted file mode 100644
index bfa7d1b44bfc..000000000000
--- a/filter/source/graphicfilter/egif/dlgegif.cxx
+++ /dev/null
@@ -1,109 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_filter.hxx"
-
-#include <tools/ref.hxx>
-#include <svtools/FilterConfigItem.hxx>
-#include <vcl/msgbox.hxx>
-#include "dlgegif.hxx"
-#include "dlgegif.hrc"
-#include "strings.hrc"
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportEGIF::DlgExportEGIF( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_GIF, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aCbxInterlaced ( this, ResId( CBX_INTERLACED, *rPara.pResMgr ) ),
- aCbxTranslucent ( this, ResId( CBX_TRANSLUCENT, *rPara.pResMgr ) ),
- aGrpMode ( this, ResId( GRP_MODE, *rPara.pResMgr ) ),
- aGrpDraw ( this, ResId( GRP_DRAW, *rPara.pResMgr ) ),
- aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr )
-{
- FreeResource();
-
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/GIF" ) );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
-
- String aInterlaceStr( ResId( KEY_INTER, *pMgr ) );
- String aTranslucentStr( ResId( KEY_TRANS, *pMgr ) );
- // Config-Parameter lesen
- sal_Bool bInterlaced = pConfigItem->ReadInt32( aInterlaceStr, 1 ) != 0;
- sal_Bool bTranslucent = pConfigItem->ReadInt32( aTranslucentStr, 1 ) != 0;
-
- aCbxInterlaced.Check( bInterlaced );
- aCbxTranslucent.Check( bTranslucent );
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportEGIF, OK ) );
-}
-
-DlgExportEGIF::~DlgExportEGIF()
-{
- delete pConfigItem;
-}
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEGIF, OK, void *, EMPTYARG )
-{
-
- // Config-Parameter schreiben
- String aInterlaceStr( ResId( KEY_INTER, *pMgr ) );
- String aTranslucentStr( ResId( KEY_TRANS, *pMgr ) );
-
- sal_Int32 nValue = 0;
- if ( aCbxInterlaced.IsChecked() )
- nValue++;
- pConfigItem->WriteInt32( aInterlaceStr, nValue );
-
- nValue = 0;
- if ( aCbxTranslucent.IsChecked() )
- nValue++;
- pConfigItem->WriteInt32( aTranslucentStr, nValue );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/egif/dlgegif.hrc b/filter/source/graphicfilter/egif/dlgegif.hrc
deleted file mode 100644
index a2f9f4feb488..000000000000
--- a/filter/source/graphicfilter/egif/dlgegif.hrc
+++ /dev/null
@@ -1,36 +0,0 @@
-/*************************************************************************
- *
- * 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 "filter.hrc"
-
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define FI_DESCR 1
-#define GRP_MODE 1
-#define GRP_DRAW 2
-#define CBX_INTERLACED 1
-#define CBX_TRANSLUCENT 2
diff --git a/filter/source/graphicfilter/egif/dlgegif.src b/filter/source/graphicfilter/egif/dlgegif.src
deleted file mode 100644
index 39f96bb7ac7a..000000000000
--- a/filter/source/graphicfilter/egif/dlgegif.src
+++ /dev/null
@@ -1,118 +0,0 @@
-/*************************************************************************
- *
- * 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 "dlgegif.hrc"
-ModalDialog DLG_EXPORT_GIF
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 169 , 70 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Text [ en-US ] = "GIF Options" ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 113 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 113 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 113 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedLine GRP_MODE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Text [ en-US ] = "Mode" ;
- };
- CheckBox CBX_INTERLACED
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 86 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Interlaced" ;
- };
- FixedLine GRP_DRAW
- {
- Pos = MAP_APPFONT ( 6 , 32 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Text [ en-US ] = "Drawing objects" ;
- };
- CheckBox CBX_TRANSLUCENT
- {
- Pos = MAP_APPFONT ( 12 , 43 ) ;
- Size = MAP_APPFONT ( 86 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Save ~transparency" ;
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/filter/source/graphicfilter/egif/egif.cxx b/filter/source/graphicfilter/egif/egif.cxx
index 0d0d5b826212..609c7bc8e18b 100644
--- a/filter/source/graphicfilter/egif/egif.cxx
+++ b/filter/source/graphicfilter/egif/egif.cxx
@@ -37,9 +37,6 @@
#include <svtools/fltcall.hxx>
#include <svtools/FilterConfigItem.hxx>
#include "giflzwc.hxx"
-#include "strings.hrc"
-#include "dlgegif.hrc"
-#include "dlgegif.hxx"
// -------------
// - GIFWriter -
@@ -50,17 +47,17 @@ class GIFWriter
Bitmap aAccBmp;
SvStream& m_rGIF;
BitmapReadAccess* m_pAcc;
- ULONG nMinPercent;
- ULONG nMaxPercent;
- ULONG nLastPercent;
+ sal_uLong nMinPercent;
+ sal_uLong nMaxPercent;
+ sal_uLong nLastPercent;
long nActX;
long nActY;
sal_Int32 nInterlaced;
- BOOL bStatus;
- BOOL bTransparent;
+ sal_Bool bStatus;
+ sal_Bool bTransparent;
- void MayCallback( ULONG nPercent );
- void WriteSignature( BOOL bGIF89a );
+ void MayCallback( sal_uLong nPercent );
+ void WriteSignature( sal_Bool bGIF89a );
void WriteGlobalHeader( const Size& rSize );
void WriteLoopExtension( const Animation& rAnimation );
void WriteLogSizeExtension( const Size& rSize100 );
@@ -70,11 +67,11 @@ class GIFWriter
void WriteAccess();
void WriteTerminator();
- BOOL CreateAccess( const BitmapEx& rBmpEx );
+ sal_Bool CreateAccess( const BitmapEx& rBmpEx );
void DestroyAccess();
void WriteAnimation( const Animation& rAnimation );
- void WriteBitmapEx( const BitmapEx& rBmpEx, const Point& rPoint, BOOL bExtended,
+ void WriteBitmapEx( const BitmapEx& rBmpEx, const Point& rPoint, sal_Bool bExtended,
long nTimer = 0, Disposal eDisposal = DISPOSE_NOT );
com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;
@@ -84,7 +81,7 @@ public:
GIFWriter(SvStream &rStream);
~GIFWriter() {}
- BOOL WriteGIF( const Graphic& rGraphic, FilterConfigItem* pConfigItem );
+ sal_Bool WriteGIF( const Graphic& rGraphic, FilterConfigItem* pConfigItem );
};
GIFWriter::GIFWriter(SvStream &rStream)
@@ -97,7 +94,7 @@ GIFWriter::GIFWriter(SvStream &rStream)
// ------------------------------------------------------------------------
-BOOL GIFWriter::WriteGIF(const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem)
+sal_Bool GIFWriter::WriteGIF(const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem)
{
if ( pFilterConfigItem )
{
@@ -111,12 +108,12 @@ BOOL GIFWriter::WriteGIF(const Graphic& rGraphic, FilterConfigItem* pFilterConfi
Size aSize100;
const MapMode aMap( rGraphic.GetPrefMapMode() );
- BOOL bLogSize = ( aMap.GetMapUnit() != MAP_PIXEL );
+ sal_Bool bLogSize = ( aMap.GetMapUnit() != MAP_PIXEL );
if( bLogSize )
aSize100 = Application::GetDefaultDevice()->LogicToLogic( rGraphic.GetPrefSize(), aMap, MAP_100TH_MM );
- bStatus = TRUE;
+ bStatus = sal_True;
nLastPercent = 0;
nInterlaced = 0;
m_pAcc = NULL;
@@ -130,7 +127,7 @@ BOOL GIFWriter::WriteGIF(const Graphic& rGraphic, FilterConfigItem* pFilterConfi
{
const Animation& rAnimation = rGraphic.GetAnimation();
- WriteSignature( TRUE );
+ WriteSignature( sal_True );
if ( bStatus )
{
@@ -147,7 +144,7 @@ BOOL GIFWriter::WriteGIF(const Graphic& rGraphic, FilterConfigItem* pFilterConfi
}
else
{
- const BOOL bGrafTrans = rGraphic.IsTransparent();
+ const sal_Bool bGrafTrans = rGraphic.IsTransparent();
BitmapEx aBmpEx;
@@ -187,7 +184,7 @@ BOOL GIFWriter::WriteGIF(const Graphic& rGraphic, FilterConfigItem* pFilterConfi
// ------------------------------------------------------------------------
void GIFWriter::WriteBitmapEx( const BitmapEx& rBmpEx, const Point& rPoint,
- BOOL bExtended, long nTimer, Disposal eDisposal )
+ sal_Bool bExtended, long nTimer, Disposal eDisposal )
{
if( CreateAccess( rBmpEx ) )
{
@@ -218,30 +215,30 @@ void GIFWriter::WriteBitmapEx( const BitmapEx& rBmpEx, const Point& rPoint,
void GIFWriter::WriteAnimation( const Animation& rAnimation )
{
- const USHORT nCount = rAnimation.Count();
+ const sal_uInt16 nCount = rAnimation.Count();
if( nCount )
{
const double fStep = 100. / nCount;
nMinPercent = 0L;
- nMaxPercent = (ULONG) fStep;
+ nMaxPercent = (sal_uLong) fStep;
- for( USHORT i = 0; i < nCount; i++ )
+ for( sal_uInt16 i = 0; i < nCount; i++ )
{
const AnimationBitmap& rAnimBmp = rAnimation.Get( i );
- WriteBitmapEx( rAnimBmp.aBmpEx, rAnimBmp.aPosPix, TRUE,
+ WriteBitmapEx( rAnimBmp.aBmpEx, rAnimBmp.aPosPix, sal_True,
rAnimBmp.nWait, rAnimBmp.eDisposal );
nMinPercent = nMaxPercent;
- nMaxPercent = (ULONG) ( nMaxPercent + fStep );
+ nMaxPercent = (sal_uLong) ( nMaxPercent + fStep );
}
}
}
// ------------------------------------------------------------------------
-void GIFWriter::MayCallback( ULONG nPercent )
+void GIFWriter::MayCallback( sal_uLong nPercent )
{
if ( xStatusIndicator.is() )
{
@@ -256,14 +253,14 @@ void GIFWriter::MayCallback( ULONG nPercent )
// ------------------------------------------------------------------------
-BOOL GIFWriter::CreateAccess( const BitmapEx& rBmpEx )
+sal_Bool GIFWriter::CreateAccess( const BitmapEx& rBmpEx )
{
if( bStatus )
{
Bitmap aMask( rBmpEx.GetMask() );
aAccBmp = rBmpEx.GetBitmap();
- bTransparent = FALSE;
+ bTransparent = sal_False;
if( !!aMask )
{
@@ -271,7 +268,7 @@ BOOL GIFWriter::CreateAccess( const BitmapEx& rBmpEx )
{
aMask.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
aAccBmp.Replace( aMask, BMP_COL_TRANS );
- bTransparent = TRUE;
+ bTransparent = sal_True;
}
else
aAccBmp.Convert( BMP_CONVERSION_8BIT_COLORS );
@@ -282,7 +279,7 @@ BOOL GIFWriter::CreateAccess( const BitmapEx& rBmpEx )
m_pAcc = aAccBmp.AcquireReadAccess();
if( !m_pAcc )
- bStatus = FALSE;
+ bStatus = sal_False;
}
return bStatus;
@@ -298,14 +295,14 @@ void GIFWriter::DestroyAccess()
// ------------------------------------------------------------------------
-void GIFWriter::WriteSignature( BOOL bGIF89a )
+void GIFWriter::WriteSignature( sal_Bool bGIF89a )
{
if( bStatus )
{
m_rGIF.Write( bGIF89a ? "GIF89a" : "GIF87a" , 6 );
if( m_rGIF.GetError() )
- bStatus = FALSE;
+ bStatus = sal_False;
}
}
@@ -316,26 +313,26 @@ void GIFWriter::WriteGlobalHeader( const Size& rSize )
if( bStatus )
{
// 256 Farben
- const UINT16 nWidth = (UINT16) rSize.Width();
- const UINT16 nHeight = (UINT16) rSize.Height();
- const BYTE cFlags = 128 | ( 7 << 4 );
+ const sal_uInt16 nWidth = (sal_uInt16) rSize.Width();
+ const sal_uInt16 nHeight = (sal_uInt16) rSize.Height();
+ const sal_uInt8 cFlags = 128 | ( 7 << 4 );
// Werte rausschreiben
m_rGIF << nWidth;
m_rGIF << nHeight;
m_rGIF << cFlags;
- m_rGIF << (BYTE) 0x00;
- m_rGIF << (BYTE) 0x00;
+ m_rGIF << (sal_uInt8) 0x00;
+ m_rGIF << (sal_uInt8) 0x00;
// Dummy-Palette mit zwei Eintraegen (Schwarz/Weiss) schreiben;
// dieses nur wegen Photoshop-Bug, da die keine Bilder ohne
// globale Farbpalette lesen koennen
- m_rGIF << (UINT16) 0;
- m_rGIF << (UINT16) 255;
- m_rGIF << (UINT16) 65535;
+ m_rGIF << (sal_uInt16) 0;
+ m_rGIF << (sal_uInt16) 255;
+ m_rGIF << (sal_uInt16) 65535;
if( m_rGIF.GetError() )
- bStatus = FALSE;
+ bStatus = sal_False;
}
}
@@ -345,7 +342,7 @@ void GIFWriter::WriteLoopExtension( const Animation& rAnimation )
{
DBG_ASSERT( rAnimation.Count() > 0, "Animation has no bitmaps!" );
- USHORT nLoopCount = (USHORT) rAnimation.GetLoopCount();
+ sal_uInt16 nLoopCount = (sal_uInt16) rAnimation.GetLoopCount();
// falls nur ein Durchlauf stattfinden soll,
// wird keine LoopExtension geschrieben;
@@ -357,18 +354,18 @@ void GIFWriter::WriteLoopExtension( const Animation& rAnimation )
if( nLoopCount )
nLoopCount--;
- const BYTE cLoByte = (const BYTE) nLoopCount;
- const BYTE cHiByte = (const BYTE) ( nLoopCount >> 8 );
+ const sal_uInt8 cLoByte = (const sal_uInt8) nLoopCount;
+ const sal_uInt8 cHiByte = (const sal_uInt8) ( nLoopCount >> 8 );
- m_rGIF << (BYTE) 0x21;
- m_rGIF << (BYTE) 0xff;
- m_rGIF << (BYTE) 0x0b;
+ m_rGIF << (sal_uInt8) 0x21;
+ m_rGIF << (sal_uInt8) 0xff;
+ m_rGIF << (sal_uInt8) 0x0b;
m_rGIF.Write( "NETSCAPE2.0", 11 );
- m_rGIF << (BYTE) 0x03;
- m_rGIF << (BYTE) 0x01;
+ m_rGIF << (sal_uInt8) 0x03;
+ m_rGIF << (sal_uInt8) 0x01;
m_rGIF << cLoByte;
m_rGIF << cHiByte;
- m_rGIF << (BYTE) 0x00;
+ m_rGIF << (sal_uInt8) 0x00;
}
}
@@ -379,15 +376,15 @@ void GIFWriter::WriteLogSizeExtension( const Size& rSize100 )
// PrefSize in 100th-mm als ApplicationExtension schreiben
if( rSize100.Width() && rSize100.Height() )
{
- m_rGIF << (BYTE) 0x21;
- m_rGIF << (BYTE) 0xff;
+ m_rGIF << (sal_uint8) 0x21;
+ m_rGIF << (sal_uInt8) 0xff;
m_rGIF << (BYTE) 0x0b;
m_rGIF.Write( "STARDIV 5.0", 11 );
- m_rGIF << (BYTE) 0x09;
- m_rGIF << (BYTE) 0x01;
- m_rGIF << (UINT32) rSize100.Width();
- m_rGIF << (UINT32) rSize100.Height();
- m_rGIF << (BYTE) 0x00;
+ m_rGIF << (sal_uInt8) 0x09;
+ m_rGIF << (sal_uInt8) 0x01;
+ m_rGIF << (sal_uInt32) rSize100.Width();
+ m_rGIF << (sal_uInt32) rSize100.Height();
+ m_rGIF << (sal_uint8) 0x00;
}
}
@@ -397,8 +394,8 @@ void GIFWriter::WriteImageExtension( long nTimer, Disposal eDisposal )
{
if( bStatus )
{
- const UINT16 nDelay = (UINT16) nTimer;
- BYTE cFlags = 0;
+ const sal_uInt16 nDelay = (sal_uInt16) nTimer;
+ sal_uInt8 cFlags = 0;
// Transparent-Flag setzen
if( bTransparent )
@@ -410,16 +407,16 @@ void GIFWriter::WriteImageExtension( long nTimer, Disposal eDisposal )
else if( eDisposal == DISPOSE_PREVIOUS )
cFlags |= ( 3 << 2 );
- m_rGIF << (BYTE) 0x21;
- m_rGIF << (BYTE) 0xf9;
- m_rGIF << (BYTE) 0x04;
+ m_rGIF << (sal_uInt8) 0x21;
+ m_rGIF << (sal_uInt8) 0xf9;
+ m_rGIF << (sal_uInt8) 0x04;
m_rGIF << cFlags;
m_rGIF << nDelay;
- m_rGIF << (BYTE) m_pAcc->GetBestPaletteIndex( BMP_COL_TRANS );
- m_rGIF << (BYTE) 0x00;
+ m_rGIF << (sal_uInt8) m_pAcc->GetBestPaletteIndex( BMP_COL_TRANS );
+ m_rGIF << (sal_uInt8) 0x00;
if( m_rGIF.GetError() )
- bStatus = FALSE;
+ bStatus = sal_False;
}
}
@@ -429,11 +426,11 @@ void GIFWriter::WriteLocalHeader()
{
if( bStatus )
{
- const UINT16 nPosX = (UINT16) nActX;
- const UINT16 nPosY = (UINT16) nActY;
- const UINT16 nWidth = (UINT16) m_pAcc->Width();
- const UINT16 nHeight = (UINT16) m_pAcc->Height();
- BYTE cFlags = (BYTE) ( m_pAcc->GetBitCount() - 1 );
+ const sal_uInt16 nPosX = (sal_uInt16) nActX;
+ const sal_uInt16 nPosY = (sal_uInt16) nActY;
+ const sal_uInt16 nWidth = (sal_uInt16) m_pAcc->Width();
+ const sal_uInt16 nHeight = (sal_uInt16) m_pAcc->Height();
+ sal_uInt8 cFlags = (sal_uInt8) ( m_pAcc->GetBitCount() - 1 );
// Interlaced-Flag setzen
if( nInterlaced )
@@ -443,7 +440,7 @@ void GIFWriter::WriteLocalHeader()
cFlags |= 0x80;
// alles rausschreiben
- m_rGIF << (BYTE) 0x2c;
+ m_rGIF << (sal_uInt8) 0x2c;
m_rGIF << nPosX;
m_rGIF << nPosY;
m_rGIF << nWidth;
@@ -451,7 +448,7 @@ void GIFWriter::WriteLocalHeader()
m_rGIF << cFlags;
if( m_rGIF.GetError() )
- bStatus = FALSE;
+ bStatus = sal_False;
}
}
@@ -461,10 +458,10 @@ void GIFWriter::WritePalette()
{
if( bStatus && m_pAcc->HasPalette() )
{
- const USHORT nCount = m_pAcc->GetPaletteEntryCount();
- const USHORT nMaxCount = ( 1 << m_pAcc->GetBitCount() );
+ const sal_uInt16 nCount = m_pAcc->GetPaletteEntryCount();
+ const sal_uInt16 nMaxCount = ( 1 << m_pAcc->GetBitCount() );
- for ( USHORT i = 0; i < nCount; i++ )
+ for ( sal_uInt16 i = 0; i < nCount; i++ )
{
const BitmapColor& rColor = m_pAcc->GetPaletteColor( i );
@@ -478,7 +475,7 @@ void GIFWriter::WritePalette()
m_rGIF.SeekRel( ( nMaxCount - nCount ) * 3 );
if( m_rGIF.GetError() )
- bStatus = FALSE;
+ bStatus = sal_False;
}
}
@@ -489,12 +486,12 @@ void GIFWriter::WriteAccess()
GIFLZWCompressor aCompressor;
const long nWidth = m_pAcc->Width();
const long nHeight = m_pAcc->Height();
- BYTE* pBuffer = NULL;
- const ULONG nFormat = m_pAcc->GetScanlineFormat();
- BOOL bNative = ( BMP_FORMAT_8BIT_PAL == nFormat );
+ sal_uInt8* pBuffer = NULL;
+ const sal_uLong nFormat = m_pAcc->GetScanlineFormat();
+ sal_Bool bNative = ( BMP_FORMAT_8BIT_PAL == nFormat );
if( !bNative )
- pBuffer = new BYTE[ nWidth ];
+ pBuffer = new sal_uInt8[ nWidth ];
if( bStatus && ( 8 == m_pAcc->GetBitCount() ) && m_pAcc->HasPalette() )
{
@@ -534,13 +531,13 @@ void GIFWriter::WriteAccess()
else
{
for( long nX = 0L; nX < nWidth; nX++ )
- pBuffer[ nX ] = (BYTE) m_pAcc->GetPixel( nY, nX );
+ pBuffer[ nX ] = (sal_uInt8) m_pAcc->GetPixel( nY, nX );
aCompressor.Compress( pBuffer, nWidth );
}
if ( m_rGIF.GetError() )
- bStatus = FALSE;
+ bStatus = sal_False;
MayCallback( nMinPercent + ( nMaxPercent - nMinPercent ) * i / nHeight );
@@ -551,7 +548,7 @@ void GIFWriter::WriteAccess()
aCompressor.EndCompression();
if ( m_rGIF.GetError() )
- bStatus = FALSE;
+ bStatus = sal_False;
}
delete[] pBuffer;
@@ -563,17 +560,17 @@ void GIFWriter::WriteTerminator()
{
if( bStatus )
{
- m_rGIF << (BYTE) 0x3b;
+ m_rGIF << (sal_uInt8) 0x3b;
if( m_rGIF.GetError() )
- bStatus = FALSE;
+ bStatus = sal_False;
}
}
// ------------------------------------------------------------------------
-extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic,
- FilterConfigItem* pConfigItem, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic,
+ FilterConfigItem* pConfigItem, sal_Bool )
{
GIFWriter aWriter(rStream);
return aWriter.WriteGIF(rGraphic, pConfigItem);
@@ -581,55 +578,5 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGrap
// ------------------------------------------------------------------------
-extern "C" BOOL __LOADONCALLAPI DoExportDialog( FltCallDialogParameter& rPara )
-{
- BOOL bRet = FALSE;
-
- if ( rPara.pWindow )
- {
- ByteString aResMgrName( "egi" );
- ResMgr* pResMgr;
-
- pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
-
- if( pResMgr )
- {
- rPara.pResMgr = pResMgr;
- bRet = ( DlgExportEGIF( rPara ).Execute() == RET_OK );
- delete pResMgr;
- }
- else
- bRet = TRUE;
- }
-
- return bRet;
-}
-
-// ------------------------------------------------------------------------
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0;
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-// ------------------------------------------------------------------------
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/filter/source/graphicfilter/egif/exports.map b/filter/source/graphicfilter/egif/exports.map
index 61e4682c6551..d4e28c44700c 100644
--- a/filter/source/graphicfilter/egif/exports.map
+++ b/filter/source/graphicfilter/egif/exports.map
@@ -1,7 +1,6 @@
UDK_3_0_0 {
global:
GraphicExport;
- DoExportDialog;
local:
*;
diff --git a/filter/source/graphicfilter/egif/giflzwc.cxx b/filter/source/graphicfilter/egif/giflzwc.cxx
index f245c7173c60..0ec21b892ad6 100644
--- a/filter/source/graphicfilter/egif/giflzwc.cxx
+++ b/filter/source/graphicfilter/egif/giflzwc.cxx
@@ -44,17 +44,17 @@ private:
inline void FlushBitsBufsFullBytes();
SvStream& rStream;
- BYTE* pBlockBuf;
- BYTE nBlockBufSize;
- ULONG nBitsBuf;
- USHORT nBitsBufSize;
+ sal_uInt8* pBlockBuf;
+ sal_uInt8 nBlockBufSize;
+ sal_uLong nBitsBuf;
+ sal_uInt16 nBitsBufSize;
public:
- GIFImageDataOutputStream( SvStream & rGIF, BYTE nLZWDataSize );
+ GIFImageDataOutputStream( SvStream & rGIF, sal_uInt8 nLZWDataSize );
~GIFImageDataOutputStream();
- inline void WriteBits( USHORT nCode, USHORT nCodeLen );
+ inline void WriteBits( sal_uInt16 nCode, sal_uInt16 nCodeLen );
};
// ------------------------------------------------------------------------
@@ -66,7 +66,7 @@ inline void GIFImageDataOutputStream::FlushBitsBufsFullBytes()
if( nBlockBufSize==255 )
FlushBlockBuf();
- pBlockBuf[nBlockBufSize++] = (BYTE) nBitsBuf;
+ pBlockBuf[nBlockBufSize++] = (sal_uInt8) nBitsBuf;
nBitsBuf >>= 8;
nBitsBufSize -= 8;
}
@@ -74,21 +74,21 @@ inline void GIFImageDataOutputStream::FlushBitsBufsFullBytes()
// ------------------------------------------------------------------------
-inline void GIFImageDataOutputStream::WriteBits( USHORT nCode, USHORT nCodeLen )
+inline void GIFImageDataOutputStream::WriteBits( sal_uInt16 nCode, sal_uInt16 nCodeLen )
{
if( nBitsBufSize+nCodeLen>32 )
FlushBitsBufsFullBytes();
- nBitsBuf |= (ULONG) nCode << nBitsBufSize;
+ nBitsBuf |= (sal_uLong) nCode << nBitsBufSize;
nBitsBufSize = nBitsBufSize + nCodeLen;
}
// ------------------------------------------------------------------------
-GIFImageDataOutputStream::GIFImageDataOutputStream( SvStream & rGIF, BYTE nLZWDataSize ) :
+GIFImageDataOutputStream::GIFImageDataOutputStream( SvStream & rGIF, sal_uInt8 nLZWDataSize ) :
rStream(rGIF)
{
- pBlockBuf = new BYTE[ 255 ];
+ pBlockBuf = new sal_uInt8[ 255 ];
nBlockBufSize = 0;
nBitsBufSize = 0;
nBitsBuf = 0;
@@ -103,7 +103,7 @@ GIFImageDataOutputStream::~GIFImageDataOutputStream()
WriteBits(0,7);
FlushBitsBufsFullBytes();
FlushBlockBuf();
- rStream << (BYTE)0;
+ rStream << (sal_uInt8)0;
delete[] pBlockBuf;
}
@@ -113,7 +113,7 @@ void GIFImageDataOutputStream::FlushBlockBuf()
{
if( nBlockBufSize )
{
- rStream << (BYTE) nBlockBufSize;
+ rStream << (sal_uInt8) nBlockBufSize;
rStream.Write( pBlockBuf,nBlockBufSize );
nBlockBufSize = 0;
}
@@ -128,8 +128,8 @@ struct GIFLZWCTreeNode
GIFLZWCTreeNode* pBrother; // naechster Knoten, der den selben Vater hat
GIFLZWCTreeNode* pFirstChild; // erster Sohn
- USHORT nCode; // Der Code fuer den String von Pixelwerten, der sich ergibt, wenn
- USHORT nValue; // Der Pixelwert
+ sal_uInt16 nCode; // Der Code fuer den String von Pixelwerten, der sich ergibt, wenn
+ sal_uInt16 nValue; // Der Pixelwert
};
// --------------------
@@ -150,11 +150,11 @@ GIFLZWCompressor::~GIFLZWCompressor()
// ------------------------------------------------------------------------
-void GIFLZWCompressor::StartCompression( SvStream& rGIF, USHORT nPixelSize )
+void GIFLZWCompressor::StartCompression( SvStream& rGIF, sal_uInt16 nPixelSize )
{
if( !pIDOS )
{
- USHORT i;
+ sal_uInt16 i;
nDataSize = nPixelSize;
@@ -166,13 +166,13 @@ void GIFLZWCompressor::StartCompression( SvStream& rGIF, USHORT nPixelSize )
nTableSize=nEOICode+1;
nCodeSize=nDataSize+1;
- pIDOS=new GIFImageDataOutputStream(rGIF,(BYTE)nDataSize);
+ pIDOS=new GIFImageDataOutputStream(rGIF,(sal_uInt8)nDataSize);
pTable=new GIFLZWCTreeNode[4096];
for (i=0; i<4096; i++)
{
pTable[i].pBrother = pTable[i].pFirstChild = NULL;
- pTable[i].nValue = (BYTE) ( pTable[i].nCode = i );
+ pTable[i].nValue = (sal_uInt8) ( pTable[i].nCode = i );
}
pPrefix = NULL;
@@ -182,13 +182,13 @@ void GIFLZWCompressor::StartCompression( SvStream& rGIF, USHORT nPixelSize )
// ------------------------------------------------------------------------
-void GIFLZWCompressor::Compress( HPBYTE pSrc, ULONG nSize )
+void GIFLZWCompressor::Compress( HPBYTE pSrc, sal_uLong nSize )
{
if( pIDOS )
{
GIFLZWCTreeNode* p;
- USHORT i;
- BYTE nV;
+ sal_uInt16 i;
+ sal_uInt8 nV;
if( !pPrefix && nSize )
{
@@ -224,7 +224,7 @@ void GIFLZWCompressor::Compress( HPBYTE pSrc, ULONG nSize )
}
else
{
- if(nTableSize==(USHORT)(1<<nCodeSize))
+ if(nTableSize==(sal_uInt16)(1<<nCodeSize))
nCodeSize++;
p=pTable+(nTableSize++);
diff --git a/filter/source/graphicfilter/egif/giflzwc.hxx b/filter/source/graphicfilter/egif/giflzwc.hxx
index 1a6ba13f303d..4d8fcc0b0168 100644
--- a/filter/source/graphicfilter/egif/giflzwc.hxx
+++ b/filter/source/graphicfilter/egif/giflzwc.hxx
@@ -45,19 +45,19 @@ private:
GIFImageDataOutputStream* pIDOS;
GIFLZWCTreeNode* pTable;
GIFLZWCTreeNode* pPrefix;
- USHORT nDataSize;
- USHORT nClearCode;
- USHORT nEOICode;
- USHORT nTableSize;
- USHORT nCodeSize;
+ sal_uInt16 nDataSize;
+ sal_uInt16 nClearCode;
+ sal_uInt16 nEOICode;
+ sal_uInt16 nTableSize;
+ sal_uInt16 nCodeSize;
public:
GIFLZWCompressor();
~GIFLZWCompressor();
- void StartCompression( SvStream& rGIF, USHORT nPixelSize );
- void Compress( HPBYTE pSrc, ULONG nSize );
+ void StartCompression( SvStream& rGIF, sal_uInt16 nPixelSize );
+ void Compress( HPBYTE pSrc, sal_uLong nSize );
void EndCompression();
};
diff --git a/filter/source/graphicfilter/egif/makefile.mk b/filter/source/graphicfilter/egif/makefile.mk
index 3a26053d61f9..bb61a796cdfb 100644
--- a/filter/source/graphicfilter/egif/makefile.mk
+++ b/filter/source/graphicfilter/egif/makefile.mk
@@ -42,25 +42,18 @@ DEPTARGET=vegif
CDEFS+= -DEDITDEBUG
.ENDIF
-SRS1NAME=$(TARGET)
-SRC1FILES = dlgegif.src \
- egifstr.src
.IF "$(L10N_framework)"==""
SLOFILES= \
$(EXCEPTIONSFILES) \
- $(SLO)$/giflzwc.obj
+ $(SLO)$/giflzwc.obj
EXCEPTIONSFILES= \
- $(SLO)$/dlgegif.obj \
$(SLO)$/egif.obj
.ENDIF
# ==========================================================================
-RESLIB1NAME=$(TARGET2)
-RESLIB1SRSFILES=$(SRS)$/$(TARGET).srs
-
.IF "$(L10N_framework)"==""
SHL1TARGET= egi$(DLLPOSTFIX)
SHL1IMPLIB= egif
diff --git a/filter/source/graphicfilter/egif/strings.hrc b/filter/source/graphicfilter/egif/strings.hrc
deleted file mode 100644
index 1566c0dfee81..000000000000
--- a/filter/source/graphicfilter/egif/strings.hrc
+++ /dev/null
@@ -1,28 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-#define KEY_INTER 256
-#define KEY_TRANS 257
diff --git a/filter/source/graphicfilter/eos2met/dlgeos2.cxx b/filter/source/graphicfilter/eos2met/dlgeos2.cxx
deleted file mode 100644
index 049d304ef1a3..000000000000
--- a/filter/source/graphicfilter/eos2met/dlgeos2.cxx
+++ /dev/null
@@ -1,179 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_filter.hxx"
-#include <com/sun/star/awt/Size.hpp>
-#include <vcl/msgbox.hxx>
-#include <svtools/FilterConfigItem.hxx>
-#include "dlgeos2.hxx"
-#include "dlgeos2.hrc"
-#include "strings.hrc"
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportEMET::DlgExportEMET( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EMET, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
- aRbOriginal ( this, ResId( RB_ORIGINAL, *rPara.pResMgr ) ),
- aRbSize ( this, ResId( RB_SIZE, *rPara.pResMgr ) ),
- aGrpMode ( this, ResId( GRP_MODE, *rPara.pResMgr ) ),
- aFtSizeX ( this, ResId( FT_SIZEX, *rPara.pResMgr ) ),
- aMtfSizeX ( this, ResId( MTF_SIZEX, *rPara.pResMgr ) ),
- aFtSizeY ( this, ResId( FT_SIZEY, *rPara.pResMgr ) ),
- aMtfSizeY ( this, ResId( MTF_SIZEY, *rPara.pResMgr ) ),
- aGrpSize ( this, ResId( GRP_SIZE, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr )
-{
- FreeResource();
-
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/MET" ) );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportEMET, OK ) );
- aRbOriginal.SetClickHdl( LINK( this, DlgExportEMET, ClickRbOriginal ) );
- aRbSize.SetClickHdl( LINK( this, DlgExportEMET, ClickRbSize ) );
-
- // Config-Parameter lesen
- sal_Int32 nMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, *pMgr ) ), 0 );
- ::com::sun::star::awt::Size aDefault( 10000, 10000 );
- ::com::sun::star::awt::Size aSize;
- aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, *pMgr ) ), aDefault );
-
- aMtfSizeX.SetDefaultUnit( FUNIT_MM );
- aMtfSizeY.SetDefaultUnit( FUNIT_MM );
-
- aMtfSizeX.SetValue( aSize.Width );
- aMtfSizeY.SetValue( aSize.Height );
-
- switch ( rPara.eFieldUnit )
- {
-// case FUNIT_NONE :
-// case FUNIT_KM :
-// case FUNIT_PERCENT :
-// case FUNIT_CUSTOM :
-// case FUNIT_MILE :
-// case FUNIT_FOOT :
-// case FUNIT_M :
- case FUNIT_MM :
- case FUNIT_CM :
- case FUNIT_TWIP :
- case FUNIT_POINT :
- case FUNIT_PICA :
- case FUNIT_INCH :
- case FUNIT_100TH_MM :
- {
- aMtfSizeX.SetUnit( rPara.eFieldUnit );
- aMtfSizeY.SetUnit( rPara.eFieldUnit );
- }
- break;
- default:
- break; // multiple other value not handled -Wall
- }
- if ( nMode == 1 )
- {
- aRbSize.Check( TRUE );
- ClickRbSize( NULL );
- }
- else
- {
- aRbOriginal.Check( TRUE );
- ClickRbOriginal( NULL );
- }
-}
-
-DlgExportEMET::~DlgExportEMET()
-{
- delete pConfigItem;
-}
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEMET, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
- ::com::sun::star::awt::Size aSize(
- (sal_Int32)MetricField::ConvertDoubleValue( aMtfSizeX.GetValue(), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM ),
- (sal_Int32)MetricField::ConvertDoubleValue( aMtfSizeY.GetValue(), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM ) );
- sal_Int32 nStrMode = ( aRbSize.IsChecked() ) ? 1 : 0;
-
- pConfigItem->WriteInt32( String( ResId( KEY_MODE, *pMgr ) ), nStrMode );
- pConfigItem->WriteSize( String( ResId( KEY_SIZE, *pMgr ) ), aSize );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEMET, ClickRbOriginal, void*, EMPTYARG )
-{
- aGrpSize.Disable();
- aFtSizeX.Disable();
- aMtfSizeX.Disable();
- aFtSizeY.Disable();
- aMtfSizeY.Disable();
-
- return 0;
-}
-
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEMET, ClickRbSize, void*, EMPTYARG )
-{
- aGrpSize.Enable();
- aFtSizeX.Enable();
- aMtfSizeX.Enable();
- aFtSizeY.Enable();
- aMtfSizeY.Enable();
-
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/eos2met/dlgeos2.hrc b/filter/source/graphicfilter/eos2met/dlgeos2.hrc
deleted file mode 100644
index 5e4ec5b160fc..000000000000
--- a/filter/source/graphicfilter/eos2met/dlgeos2.hrc
+++ /dev/null
@@ -1,41 +0,0 @@
-/*************************************************************************
- *
- * 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 "filter.hrc"
-
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define CBX_SIZE 2
-#define MTF_SIZEX 1
-#define MTF_SIZEY 2
-#define FT_SIZEX 1
-#define FT_SIZEY 2
-#define GRP_SIZE 1
-#define GRP_MODE 2
-#define RB_ORIGINAL 1
-#define RB_SIZE 2
-
diff --git a/filter/source/graphicfilter/eos2met/dlgeos2.hxx b/filter/source/graphicfilter/eos2met/dlgeos2.hxx
deleted file mode 100644
index cf87fec084f6..000000000000
--- a/filter/source/graphicfilter/eos2met/dlgeos2.hxx
+++ /dev/null
@@ -1,82 +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 _DLGEOS2_HXX_
-#define _DLGEOS2_HXX_
-#include <svtools/fltcall.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen bei Vektorformaten
-|*
-\************************************************************************/
-
-class FilterConfigItem;
-class ResMgr;
-
-class DlgExportEMET : public ModalDialog
-{
-private:
-
- FltCallDialogParameter& rFltCallPara;
-
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
-
- RadioButton aRbOriginal;
- RadioButton aRbSize;
- FixedLine aGrpMode;
-
- FixedText aFtSizeX;
- MetricField aMtfSizeX;
- FixedText aFtSizeY;
- MetricField aMtfSizeY;
- FixedLine aGrpSize;
-
- FilterConfigItem* pConfigItem;
- ResMgr* pMgr;
-
- DECL_LINK( OK, void* p );
- DECL_LINK( ClickRbOriginal,void* p );
- DECL_LINK( ClickRbSize,void* p );
-
-public:
- DlgExportEMET( FltCallDialogParameter& rPara );
- ~DlgExportEMET();
-};
-
-
-#endif // _DLGEMET_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/eos2met/dlgeos2.src b/filter/source/graphicfilter/eos2met/dlgeos2.src
deleted file mode 100644
index 6c9e474e25db..000000000000
--- a/filter/source/graphicfilter/eos2met/dlgeos2.src
+++ /dev/null
@@ -1,162 +0,0 @@
-/*************************************************************************
- *
- * 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 "dlgeos2.hrc"
-
-ModalDialog DLG_EXPORT_EMET
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 178 , 89 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Text [ en-US ] = "MET Options" ;
- MetricField MTF_SIZEX
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 55 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- MetricField MTF_SIZEY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 71 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- FixedLine GRP_SIZE
- {
- Pos = MAP_APPFONT ( 6 , 44 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Size" ;
- };
- FixedText FT_SIZEX
- {
- Pos = MAP_APPFONT ( 12 , 56 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "Width" ;
- };
- FixedText FT_SIZEY
- {
- Pos = MAP_APPFONT ( 12 , 72 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- Text [ en-US ] = "Height" ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 122 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 122 , 24 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 122 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- RadioButton RB_ORIGINAL
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Original" ;
- };
- RadioButton RB_SIZE
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Size" ;
- };
- FixedLine GRP_MODE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Mode" ;
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx
index ee5d9c664615..614418118664 100644
--- a/filter/source/graphicfilter/eos2met/eos2met.cxx
+++ b/filter/source/graphicfilter/eos2met/eos2met.cxx
@@ -46,8 +46,6 @@
#include <vcl/svapp.hxx>
#include <vcl/msgbox.hxx>
#include <svl/solar.hrc>
-#include "strings.hrc"
-#include "dlgeos2.hxx"
// -----------------------------Feld-Typen-------------------------------
@@ -115,7 +113,7 @@
struct METChrSet
{
struct METChrSet * pSucc;
- BYTE nSet;
+ sal_uInt8 nSet;
String aName;
FontWeight eWeight;
};
@@ -135,14 +133,14 @@ class METWriter
{
private:
- BOOL bStatus;
- ULONG nLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde.
+ sal_Bool bStatus;
+ sal_uLong nLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde.
SvStream* pMET;
Rectangle aPictureRect;
MapMode aPictureMapMode;
MapMode aTargetMapMode;
- ULONG nActualFieldStartPos; // Anfangs-Position des aktuellen 'Field'
- ULONG nNumberOfDataFields; // Anzahl der angefangenen 'Graphcis Data Fields'
+ sal_uLong nActualFieldStartPos; // Anfangs-Position des aktuellen 'Field'
+ sal_uLong nNumberOfDataFields; // Anzahl der angefangenen 'Graphcis Data Fields'
Color aGDILineColor;
Color aGDIFillColor;
RasterOp eGDIRasterOp;
@@ -157,57 +155,57 @@ private:
long nMETStrokeLineWidth;
Size aMETChrCellSize;
short nMETChrAngle;
- BYTE nMETChrSet;
+ sal_uInt8 nMETChrSet;
METChrSet* pChrSetList; // Liste der Character-Sets
- BYTE nNextChrSetId; // die erste unbenutzte ChrSet-Id
- ULONG nActBitmapId; // Field-Id der naechsten Bitmap
- ULONG nNumberOfActions; // Anzahl der Actions im GDIMetafile
- ULONG nNumberOfBitmaps; // Anzahl der Bitmaps
- ULONG nWrittenActions; // Anzahl der bereits verarbeiteten Actions beim Schreiben der Orders
- ULONG nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps
- ULONG nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist.
+ sal_uInt8 nNextChrSetId; // die erste unbenutzte ChrSet-Id
+ sal_uLong nActBitmapId; // Field-Id der naechsten Bitmap
+ sal_uLong nNumberOfActions; // Anzahl der Actions im GDIMetafile
+ sal_uLong nNumberOfBitmaps; // Anzahl der Bitmaps
+ sal_uLong nWrittenActions; // Anzahl der bereits verarbeiteten Actions beim Schreiben der Orders
+ sal_uLong nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps
+ sal_uLong nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist.
com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;
void MayCallback();
// Berechnet anhand der obigen 5 Parameter eine Prozentzahl
- // und macht dann ggf. einen Callback. Setzt bStatus auf FALSE wenn User abbrechen
+ // und macht dann ggf. einen Callback. Setzt bStatus auf sal_False wenn User abbrechen
// moechte.
void CountActionsAndBitmaps(const GDIMetaFile * pMTF);
// Zaehlt die Bitmaps und Actions (nNumberOfActions und nNumberOfBitmaps muessen
// zu Anfang auf 0 gesetzt werden, weil diese Methode rekursiv ist)
- void WriteBigEndianShort(USHORT nWord);
- void WriteBigEndianLong(ULONG nLong);
+ void WriteBigEndianShort(sal_uInt16 nWord);
+ void WriteBigEndianLong(sal_uLong nLong);
void WritePoint(Point aPt);
void WriteClipRect( const Rectangle& rRect );
- void WriteFieldIntroducer(USHORT nFieldSize, USHORT nFieldType,
- BYTE nFlags, USHORT nSegSeqNum);
+ void WriteFieldIntroducer(sal_uInt16 nFieldSize, sal_uInt16 nFieldType,
+ sal_uInt8 nFlags, sal_uInt16 nSegSeqNum);
void UpdateFieldSize();
- void WriteFieldId(ULONG nId);
+ void WriteFieldId(sal_uLong nId);
void CreateChrSets(const GDIMetaFile * pMTF);
void CreateChrSet(const Font & rFont);
void WriteChrSets();
- BYTE FindChrSet(const Font & rFont);
+ sal_uInt8 FindChrSet(const Font & rFont);
- void WriteColorAttributeTable(ULONG nFieldId=4, BitmapPalette* pPalette=NULL,
- BYTE nBasePartFlags=0x40, BYTE nBasePartLCTID=0);
+ void WriteColorAttributeTable(sal_uLong nFieldId=4, BitmapPalette* pPalette=NULL,
+ sal_uInt8 nBasePartFlags=0x40, sal_uInt8 nBasePartLCTID=0);
void WriteImageObject(const Bitmap & rBitmap);
void WriteImageObjects(const GDIMetaFile * pMTF);
void WriteDataDescriptor(const GDIMetaFile * pMTF);
- void WillWriteOrder(ULONG nNextOrderMaximumLength);
+ void WillWriteOrder(sal_uLong nNextOrderMaximumLength);
void METSetAndPushLineInfo( const LineInfo& rLineInfo );
void METPopLineInfo( const LineInfo& rLineInfo );
void METBitBlt(Point aPt, Size aSize, const Bitmap & rBitmap);
- void METBeginArea(BOOL bBoundaryLine);
+ void METBeginArea(sal_Bool bBoundaryLine);
void METEndArea();
void METBeginPath(sal_uInt32 nPathId);
void METEndPath();
@@ -219,7 +217,7 @@ private:
void METLine(const Polygon & rPolygon);
void METLine(const PolyPolygon & rPolyPolygon);
void METLineAtCurPos(Point aPt);
- void METBox(BOOL bFill, BOOL bBoundary,
+ void METBox(sal_Bool bFill, sal_Bool bBoundary,
Rectangle aRect, sal_uInt32 nHAxis, sal_uInt32 nVAxis);
void METFullArc(Point aCenter, double fMultiplier);
void METPartialArcAtCurPos(Point aCenter, double fMultiplier,
@@ -231,7 +229,7 @@ private:
void METSetMix(RasterOp eROP);
void METSetChrCellSize(Size aSize);
void METSetChrAngle(short nAngle);
- void METSetChrSet(BYTE nSet);
+ void METSetChrSet(sal_uInt8 nSet);
void WriteOrders(const GDIMetaFile * pMTF);
@@ -247,7 +245,7 @@ public:
METWriter() {}
- BOOL WriteMET( const GDIMetaFile & rMTF, SvStream & rTargetStream,
+ sal_Bool WriteMET( const GDIMetaFile & rMTF, SvStream & rTargetStream,
FilterConfigItem* pConfigItem );
};
@@ -258,7 +256,7 @@ void METWriter::MayCallback()
{
if ( xStatusIndicator.is() )
{
- ULONG nPercent;
+ sal_uLong nPercent;
nPercent=((nWrittenBitmaps<<14)+(nActBitmapPercent<<14)/100+nWrittenActions)
*100/((nNumberOfBitmaps<<14)+nNumberOfActions);
@@ -283,15 +281,15 @@ void METWriter::WriteClipRect( const Rectangle& rRect )
METEndPath();
}
WillWriteOrder(8);
- *pMET << (BYTE)0xb4 << (BYTE)6
- << (BYTE)0x00 << (BYTE)0 << nPathId;
+ *pMET << (sal_uInt8)0xb4 << (sal_uInt8)6
+ << (sal_uInt8)0x00 << (sal_uInt8)0 << nPathId;
}
void METWriter::CountActionsAndBitmaps(const GDIMetaFile * pMTF)
{
const MetaAction* pMA;
- for( ULONG nAction = 0, nActionCount=pMTF->GetActionCount(); nAction < nActionCount; nAction++ )
+ for( sal_uLong nAction = 0, nActionCount=pMTF->GetActionCount(); nAction < nActionCount; nAction++ )
{
pMA = pMTF->GetAction(nAction);
@@ -300,8 +298,8 @@ void METWriter::CountActionsAndBitmaps(const GDIMetaFile * pMTF)
case META_EPS_ACTION :
{
const GDIMetaFile aGDIMetaFile( ((const MetaEPSAction*)pMA)->GetSubstitute() );
- INT32 nCount = aGDIMetaFile.GetActionCount();
- INT32 i;
+ sal_Int32 nCount = aGDIMetaFile.GetActionCount();
+ sal_Int32 i;
for ( i = 0; i < nCount; i++ )
if ( ((const MetaAction*)aGDIMetaFile.GetAction( i ))->GetType() == META_BMPSCALE_ACTION )
break;
@@ -322,16 +320,16 @@ void METWriter::CountActionsAndBitmaps(const GDIMetaFile * pMTF)
}
-void METWriter::WriteBigEndianShort(USHORT nWord)
+void METWriter::WriteBigEndianShort(sal_uInt16 nWord)
{
- *pMET << ((BYTE)(nWord>>8)) << ((BYTE)(nWord&0x00ff));
+ *pMET << ((sal_uInt8)(nWord>>8)) << ((sal_uInt8)(nWord&0x00ff));
}
-void METWriter::WriteBigEndianLong(ULONG nLong)
+void METWriter::WriteBigEndianLong(sal_uLong nLong)
{
- WriteBigEndianShort((USHORT)(nLong>>16));
- WriteBigEndianShort((USHORT)(nLong&0x0000ffff));
+ WriteBigEndianShort((sal_uInt16)(nLong>>16));
+ WriteBigEndianShort((sal_uInt16)(nLong&0x0000ffff));
}
@@ -344,33 +342,33 @@ void METWriter::WritePoint(Point aPt)
}
-void METWriter::WriteFieldIntroducer(USHORT nFieldSize, USHORT nFieldType,
- BYTE nFlags, USHORT nSegSeqNum)
+void METWriter::WriteFieldIntroducer(sal_uInt16 nFieldSize, sal_uInt16 nFieldType,
+ sal_uInt8 nFlags, sal_uInt16 nSegSeqNum)
{
nActualFieldStartPos=pMET->Tell();
WriteBigEndianShort(nFieldSize);
- *pMET << (BYTE)0xd3 << nFieldType << nFlags << nSegSeqNum;
+ *pMET << (sal_uInt8)0xd3 << nFieldType << nFlags << nSegSeqNum;
}
void METWriter::UpdateFieldSize()
{
- ULONG nPos;
+ sal_uLong nPos;
nPos=pMET->Tell();
pMET->Seek(nActualFieldStartPos);
- WriteBigEndianShort((USHORT)(nPos-nActualFieldStartPos));
+ WriteBigEndianShort((sal_uInt16)(nPos-nActualFieldStartPos));
pMET->Seek(nPos);
}
-void METWriter::WriteFieldId(ULONG nId)
+void METWriter::WriteFieldId(sal_uLong nId)
{
- BYTE nbyte;
+ sal_uInt8 nbyte;
short i;
for (i=1; i<=8; i++) {
- nbyte= '0' + (BYTE)((nId >> (32-i*4)) & 0x0f);
+ nbyte= '0' + (sal_uInt8)((nId >> (32-i*4)) & 0x0f);
*pMET << nbyte;
}
}
@@ -378,10 +376,10 @@ void METWriter::WriteFieldId(ULONG nId)
void METWriter::CreateChrSets(const GDIMetaFile * pMTF)
{
- ULONG nAction, nActionCount;
+ sal_uLong nAction, nActionCount;
const MetaAction * pMA;
- if (bStatus==FALSE)
+ if (bStatus==sal_False)
return;
nActionCount=pMTF->GetActionCount();
@@ -418,7 +416,7 @@ void METWriter::CreateChrSet(const Font & rFont)
}
-BYTE METWriter::FindChrSet(const Font & rFont)
+sal_uInt8 METWriter::FindChrSet(const Font & rFont)
{
METChrSet* pCS;
@@ -434,10 +432,10 @@ BYTE METWriter::FindChrSet(const Font & rFont)
void METWriter::WriteChrSets()
{
- USHORT i;
+ sal_uInt16 i;
char c = 0;
METChrSet * pCS;
- BYTE nbyte;
+ sal_uInt8 nbyte;
for (pCS=pChrSetList; pCS!=NULL; pCS=pCS->pSucc)
{
@@ -446,13 +444,13 @@ void METWriter::WriteChrSets()
WriteBigEndianShort(0x0050);
- *pMET << (BYTE)0x0c << (BYTE)0x02 << (BYTE)0x84 << (BYTE)0x00;
- *pMET << (BYTE)0xa4 << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x01;
- *pMET << (BYTE)0x01 << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x00;
+ *pMET << (sal_uInt8)0x0c << (sal_uInt8)0x02 << (sal_uInt8)0x84 << (sal_uInt8)0x00;
+ *pMET << (sal_uInt8)0xa4 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x01;
+ *pMET << (sal_uInt8)0x01 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00;
- *pMET << (BYTE)0x04 << (BYTE)0x24 << (BYTE)0x05 << (BYTE)pCS->nSet;
+ *pMET << (sal_uInt8)0x04 << (sal_uInt8)0x24 << (sal_uInt8)0x05 << (sal_uInt8)pCS->nSet;
- *pMET << (BYTE)0x14 << (BYTE)0x1f;
+ *pMET << (sal_uInt8)0x14 << (sal_uInt8)0x1f;
switch (pCS->eWeight)
{
case WEIGHT_THIN: nbyte=1; break;
@@ -467,16 +465,16 @@ void METWriter::WriteChrSets()
default: nbyte=5;
}
*pMET << nbyte;
- *pMET << (BYTE)0x05;
- *pMET << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x00;
- *pMET << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x00;
- *pMET << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x00;
- *pMET << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x0c;
+ *pMET << (sal_uInt8)0x05;
+ *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00;
+ *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00;
+ *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00;
+ *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x0c;
- *pMET << (BYTE)0x06 << (BYTE)0x20 << (BYTE)0x03 << (BYTE)0xd4;
- *pMET << (BYTE)0x03 << (BYTE)0x52;
+ *pMET << (sal_uInt8)0x06 << (sal_uInt8)0x20 << (sal_uInt8)0x03 << (sal_uInt8)0xd4;
+ *pMET << (sal_uInt8)0x03 << (sal_uInt8)0x52;
- *pMET << (BYTE)0x24 << (BYTE)0x02 << (BYTE)0x08 << (BYTE)0x00;
+ *pMET << (sal_uInt8)0x24 << (sal_uInt8)0x02 << (sal_uInt8)0x08 << (sal_uInt8)0x00;
ByteString n(pCS->aName, gsl_getSystemTextEncoding());
for (i=0; i<32; i++)
{
@@ -488,11 +486,11 @@ void METWriter::WriteChrSets()
}
-void METWriter::WriteColorAttributeTable(ULONG nFieldId, BitmapPalette* pPalette, BYTE nBasePartFlags, BYTE nBasePartLCTID)
+void METWriter::WriteColorAttributeTable(sal_uLong nFieldId, BitmapPalette* pPalette, sal_uInt8 nBasePartFlags, sal_uInt8 nBasePartLCTID)
{
- USHORT nIndex,nNumI,i;
+ sal_uInt16 nIndex,nNumI,i;
- if (bStatus==FALSE) return;
+ if (bStatus==sal_False) return;
//--- Das Feld 'Begin Color Attribute Table':
WriteFieldIntroducer(16,BegColAtrMagic,0,0);
@@ -500,7 +498,7 @@ void METWriter::WriteColorAttributeTable(ULONG nFieldId, BitmapPalette* pPalette
//--- Das Feld 'Color Attribute Table':
WriteFieldIntroducer(0,BlkColAtrMagic,0,0);
- *pMET << nBasePartFlags << (BYTE)0x00 << nBasePartLCTID; // 'Base Part'
+ *pMET << nBasePartFlags << (sal_uInt8)0x00 << nBasePartLCTID; // 'Base Part'
if (pPalette!=NULL)
{
nIndex=0;
@@ -508,18 +506,18 @@ void METWriter::WriteColorAttributeTable(ULONG nFieldId, BitmapPalette* pPalette
{
nNumI=pPalette->GetEntryCount()-nIndex;
if (nNumI>81) nNumI=81;
- *pMET << (BYTE)(11+nNumI*3); // Laenge des Parameters
- *pMET << (BYTE)1 << (BYTE)0 << (BYTE)1; // typ: element list, Reserved, Format: RGB
- *pMET << (BYTE)0; WriteBigEndianShort(nIndex); // Start-Index (3 Bytes)
- *pMET << (BYTE)8 << (BYTE)8 << (BYTE)8; // Bits je Komponente R,G,B
- *pMET << (BYTE)3; // Anzahl Bytes je Eintrag
+ *pMET << (sal_uInt8)(11+nNumI*3); // Laenge des Parameters
+ *pMET << (sal_uInt8)1 << (sal_uInt8)0 << (sal_uInt8)1; // typ: element list, Reserved, Format: RGB
+ *pMET << (sal_uInt8)0; WriteBigEndianShort(nIndex); // Start-Index (3 Bytes)
+ *pMET << (sal_uInt8)8 << (sal_uInt8)8 << (sal_uInt8)8; // Bits je Komponente R,G,B
+ *pMET << (sal_uInt8)3; // Anzahl Bytes je Eintrag
for (i=0; i<nNumI; i++)
{
const BitmapColor& rCol = (*pPalette)[ nIndex ];
- *pMET << (BYTE) rCol.GetRed();
- *pMET << (BYTE) rCol.GetGreen();
- *pMET << (BYTE) rCol.GetBlue();
+ *pMET << (sal_uInt8) rCol.GetRed();
+ *pMET << (sal_uInt8) rCol.GetGreen();
+ *pMET << (sal_uInt8) rCol.GetBlue();
nIndex++;
}
}
@@ -527,8 +525,8 @@ void METWriter::WriteColorAttributeTable(ULONG nFieldId, BitmapPalette* pPalette
else
{
// 'Trible Generating'
- *pMET << (BYTE)0x0a << (BYTE)0x02 << (BYTE)0x00 << (BYTE)0x01 << (BYTE)0x00;
- *pMET << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x08 << (BYTE)0x08 << (BYTE)0x08;
+ *pMET << (sal_uInt8)0x0a << (sal_uInt8)0x02 << (sal_uInt8)0x00 << (sal_uInt8)0x01 << (sal_uInt8)0x00;
+ *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x08 << (sal_uInt8)0x08 << (sal_uInt8)0x08;
}
UpdateFieldSize();
@@ -537,7 +535,7 @@ void METWriter::WriteColorAttributeTable(ULONG nFieldId, BitmapPalette* pPalette
WriteFieldId(nFieldId);
if (pMET->GetError())
- bStatus=FALSE;
+ bStatus=sal_False;
}
@@ -545,12 +543,12 @@ void METWriter::WriteImageObject(const Bitmap & rBitmap)
{
SvMemoryStream aTemp(0x00010000,0x00010000);
sal_uInt32 nWidth,nHeight,nResX,nResY;
- ULONG nBytesPerLine,i,j,nNumColors,ny,nLines;
- ULONG nActColMapId;
- USHORT nBitsPerPixel;
- BYTE nbyte, * pBuf;
+ sal_uLong nBytesPerLine,i,j,nNumColors,ny,nLines;
+ sal_uLong nActColMapId;
+ sal_uInt16 nBitsPerPixel;
+ sal_uInt8 nbyte, * pBuf;
- if (bStatus==FALSE)
+ if (bStatus==sal_False)
return;
nActColMapId=((nActBitmapId>>24)&0x000000ff) | ((nActBitmapId>> 8)&0x0000ff00) |
@@ -579,13 +577,13 @@ void METWriter::WriteImageObject(const Bitmap & rBitmap)
// ggf. Farbpalette einlesen und in die MET-Datei schreiben:
if (nBitsPerPixel<=8)
{
- BitmapPalette aPal( (USHORT) nNumColors );
- BYTE nr,ng,nb;
+ BitmapPalette aPal( (sal_uInt16) nNumColors );
+ sal_uInt8 nr,ng,nb;
for (i=0; i<nNumColors; i++)
{
aTemp >> nb >> ng >> nr; aTemp.SeekRel(1);
- aPal[ (USHORT) i ] = BitmapColor( nr, ng, nb );
+ aPal[ (sal_uInt16) i ] = BitmapColor( nr, ng, nb );
}
//--- Das Feld 'Begin Resource Group':
@@ -606,9 +604,9 @@ void METWriter::WriteImageObject(const Bitmap & rBitmap)
//--- Das Feld 'Map Color Attribute Table':
WriteFieldIntroducer(26,MapColAtrMagic,0,0);
WriteBigEndianShort(0x0012);
- *pMET << (BYTE)0x0c << (BYTE)0x02 << (BYTE)0x84 << (BYTE)0x00;
+ *pMET << (sal_uInt8)0x0c << (sal_uInt8)0x02 << (sal_uInt8)0x84 << (sal_uInt8)0x00;
WriteFieldId(nActColMapId);
- *pMET << (BYTE)0x04 << (BYTE)0x24 << (BYTE)0x07 << (BYTE)0x01;
+ *pMET << (sal_uInt8)0x04 << (sal_uInt8)0x24 << (sal_uInt8)0x07 << (sal_uInt8)0x01;
//--- Das Feld 'End Object Environment Group':
WriteFieldIntroducer(16,EndObjEnvMagic,0,0);
@@ -617,45 +615,45 @@ void METWriter::WriteImageObject(const Bitmap & rBitmap)
//--- Das Feld 'Image Data Descriptor':
WriteFieldIntroducer(17,DscImgObjMagic,0,0);
- *pMET << (BYTE)0x01; // Unit of measure: tens of centimeters
- WriteBigEndianShort((USHORT)nResX);
- WriteBigEndianShort((USHORT)nResY);
- WriteBigEndianShort((USHORT)nWidth);
- WriteBigEndianShort((USHORT)nHeight);
+ *pMET << (sal_uInt8)0x01; // Unit of measure: tens of centimeters
+ WriteBigEndianShort((sal_uInt16)nResX);
+ WriteBigEndianShort((sal_uInt16)nResY);
+ WriteBigEndianShort((sal_uInt16)nWidth);
+ WriteBigEndianShort((sal_uInt16)nHeight);
//--- Das erste Feld 'Image Picture Data':
WriteFieldIntroducer(0,DatImgObjMagic,0,0);
// Begin Segment:
- *pMET << (BYTE)0x70 << (BYTE)0x00;
+ *pMET << (sal_uInt8)0x70 << (sal_uInt8)0x00;
// Begin Image Content:
- *pMET << (BYTE)0x91 << (BYTE)0x01 << (BYTE)0xff;
+ *pMET << (sal_uInt8)0x91 << (sal_uInt8)0x01 << (sal_uInt8)0xff;
// Image Size:
- *pMET << (BYTE)0x94 << (BYTE)0x09 << (BYTE)0x02;
- *pMET << (USHORT) 0 << (USHORT) 0;
- WriteBigEndianShort((USHORT)nHeight);
- WriteBigEndianShort((USHORT)nWidth);
+ *pMET << (sal_uInt8)0x94 << (sal_uInt8)0x09 << (sal_uInt8)0x02;
+ *pMET << (sal_uInt16) 0 << (sal_uInt16) 0;
+ WriteBigEndianShort((sal_uInt16)nHeight);
+ WriteBigEndianShort((sal_uInt16)nWidth);
// Image Encoding:
- *pMET << (BYTE)0x95 << (BYTE)0x02 << (BYTE)0x03 << (BYTE)0x03;
+ *pMET << (sal_uInt8)0x95 << (sal_uInt8)0x02 << (sal_uInt8)0x03 << (sal_uInt8)0x03;
// Image IDE-Size:
- *pMET << (BYTE)0x96 << (BYTE)0x01 << (BYTE)nBitsPerPixel;
+ *pMET << (sal_uInt8)0x96 << (sal_uInt8)0x01 << (sal_uInt8)nBitsPerPixel;
if (nBitsPerPixel<=8) {
// Image LUT-ID
- *pMET << (BYTE)0x97 << (BYTE)0x01 << (BYTE)0x01;
+ *pMET << (sal_uInt8)0x97 << (sal_uInt8)0x01 << (sal_uInt8)0x01;
}
else {
// IDE Structure
- *pMET << (BYTE)0x9b << (BYTE)0x08 << (BYTE)0x00 << (BYTE)0x01;
- *pMET << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x08;
- *pMET << (BYTE)0x08 << (BYTE)0x08;
+ *pMET << (sal_uInt8)0x9b << (sal_uInt8)0x08 << (sal_uInt8)0x00 << (sal_uInt8)0x01;
+ *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x08;
+ *pMET << (sal_uInt8)0x08 << (sal_uInt8)0x08;
}
- pBuf=new BYTE[nBytesPerLine];
+ pBuf=new sal_uInt8[nBytesPerLine];
ny=0;
while (ny<nHeight) {
@@ -670,7 +668,7 @@ void METWriter::WriteImageObject(const Bitmap & rBitmap)
if (nLines*nBytesPerLine>30000) nLines=30000/nBytesPerLine;
if (nLines<1) nLines=1;
WriteBigEndianShort(0xfe92);
- WriteBigEndianShort((USHORT)(nLines*nBytesPerLine));
+ WriteBigEndianShort((sal_uInt16)(nLines*nBytesPerLine));
for (i=0; i<nLines; i++) {
aTemp.Read(pBuf,nBytesPerLine);
if (nBitsPerPixel==24) {
@@ -681,18 +679,18 @@ void METWriter::WriteImageObject(const Bitmap & rBitmap)
pMET->Write(pBuf,nBytesPerLine);
ny++;
}
- if (aTemp.GetError() || pMET->GetError()) bStatus=FALSE;
+ if (aTemp.GetError() || pMET->GetError()) bStatus=sal_False;
nActBitmapPercent=(ny+1)*100/nHeight;
MayCallback();
- if (bStatus==FALSE) { delete[] pBuf; return; }
+ if (bStatus==sal_False) { delete[] pBuf; return; }
}
delete[] pBuf;
// End Image Content:
- *pMET << (BYTE)0x93 << (BYTE)0x00;
+ *pMET << (sal_uInt8)0x93 << (sal_uInt8)0x00;
// End Segment:
- *pMET << (BYTE)0x71 << (BYTE)0x00;
+ *pMET << (sal_uInt8)0x71 << (sal_uInt8)0x00;
// Abschliessen des letzten Feldes 'Image Picture Data':
UpdateFieldSize();
@@ -708,7 +706,7 @@ void METWriter::WriteImageObject(const Bitmap & rBitmap)
nWrittenBitmaps++;
nActBitmapPercent=0;
- if (pMET->GetError()) bStatus=FALSE;
+ if (pMET->GetError()) bStatus=sal_False;
}
@@ -716,10 +714,10 @@ void METWriter::WriteImageObjects(const GDIMetaFile * pMTF)
{
const MetaAction* pMA;
- if (bStatus==FALSE)
+ if (bStatus==sal_False)
return;
- for ( ULONG nAction = 0, nActionCount = pMTF->GetActionCount(); nAction < nActionCount; nAction++)
+ for ( sal_uLong nAction = 0, nActionCount = pMTF->GetActionCount(); nAction < nActionCount; nAction++)
{
pMA = pMTF->GetAction(nAction);
@@ -772,8 +770,8 @@ void METWriter::WriteImageObjects(const GDIMetaFile * pMTF)
const MetaEPSAction* pA = (const MetaEPSAction*)pMA;
const GDIMetaFile aGDIMetaFile( pA->GetSubstitute() );
- INT32 nCount = aGDIMetaFile.GetActionCount();
- for ( INT32 i = 0; i < nCount; i++ )
+ sal_Int32 nCount = aGDIMetaFile.GetActionCount();
+ for ( sal_Int32 i = 0; i < nCount; i++ )
{
const MetaAction* pMetaAct = aGDIMetaFile.GetAction( i );
if ( pMetaAct->GetType() == META_BMPSCALE_ACTION )
@@ -788,17 +786,17 @@ void METWriter::WriteImageObjects(const GDIMetaFile * pMTF)
break;
}
- if (bStatus==FALSE)
+ if (bStatus==sal_False)
break;
}
if (pMET->GetError())
- bStatus=FALSE;
+ bStatus=sal_False;
}
void METWriter::WriteDataDescriptor(const GDIMetaFile *)
{
- if (bStatus==FALSE)
+ if (bStatus==sal_False)
return;
WriteFieldIntroducer(0,DscGrfObjMagic,0,0);
@@ -819,9 +817,9 @@ void METWriter::WriteDataDescriptor(const GDIMetaFile *)
// 8 Coordinate types in data
// 0x04Intel16
// 0x05Intel32
- *pMET << (BYTE)0xf7 << (BYTE)0x07 << (BYTE)0xb0 << (BYTE)0x00
- << (BYTE)0x00 << (BYTE)0x23 << (BYTE)0x01 << (BYTE)0x01
- << (BYTE)0x05;
+ *pMET << (sal_uInt8)0xf7 << (sal_uInt8)0x07 << (sal_uInt8)0xb0 << (sal_uInt8)0x00
+ << (sal_uInt8)0x00 << (sal_uInt8)0x23 << (sal_uInt8)0x01 << (sal_uInt8)0x01
+ << (sal_uInt8)0x05;
// 0 0xF6 Set Picture Descriptor
// 1 Length of following data
@@ -851,8 +849,8 @@ void METWriter::WriteDataDescriptor(const GDIMetaFile *)
// GPS Y bottom, Y top
// GPS Z near, Z far
Size aUnitsPerDecimeter=OutputDevice::LogicToLogic(Size(10,10),MapMode(MAP_CM),aPictureMapMode);
- *pMET << (BYTE)0xf6 << (BYTE)0x28 << (BYTE)0x40 << (BYTE)0x00
- << (BYTE)0x05 << (BYTE)0x01
+ *pMET << (sal_uInt8)0xf6 << (sal_uInt8)0x28 << (sal_uInt8)0x40 << (sal_uInt8)0x00
+ << (sal_uInt8)0x05 << (sal_uInt8)0x01
<< (sal_uInt32)(aUnitsPerDecimeter.Width())
<< (sal_uInt32)(aUnitsPerDecimeter.Height())
<< (sal_uInt32)0
@@ -873,9 +871,9 @@ void METWriter::WriteDataDescriptor(const GDIMetaFile *)
// 8 Geometrics
// 0x04 Intel16
// 0x05 Intel32
- *pMET << (BYTE)0x21 << (BYTE)0x07 << (BYTE)0x08 << (BYTE)0xe0
- << (BYTE)0x00 << (BYTE)0x8f << (BYTE)0x00 << (BYTE)0x05
- << (BYTE)0x05;
+ *pMET << (sal_uInt8)0x21 << (sal_uInt8)0x07 << (sal_uInt8)0x08 << (sal_uInt8)0xe0
+ << (sal_uInt8)0x00 << (sal_uInt8)0x8f << (sal_uInt8)0x00 << (sal_uInt8)0x05
+ << (sal_uInt8)0x05;
// 0 0x21 Set Current Defaults
// 1 Length of following data
@@ -883,8 +881,8 @@ void METWriter::WriteDataDescriptor(const GDIMetaFile *)
// 3-4 Mask 0xCC0C
// 5 Names 0x8F
// 6-n M11, M12, M21, M22, M41, M42 Matrix elements
- *pMET << (BYTE)0x21 << (BYTE)0x1c << (BYTE)0x07 << (BYTE)0xcc
- << (BYTE)0x0c << (BYTE)0x8f
+ *pMET << (sal_uInt8)0x21 << (sal_uInt8)0x1c << (sal_uInt8)0x07 << (sal_uInt8)0xcc
+ << (sal_uInt8)0x0c << (sal_uInt8)0x8f
<< (sal_uInt32)0x00010000 << (sal_uInt32)0x00000000 << (sal_uInt32)0x00000000
<< (sal_uInt32)0x00010000 << (sal_uInt32)0x00000000 << (sal_uInt32)0x00000000;
@@ -955,11 +953,11 @@ void METWriter::WriteDataDescriptor(const GDIMetaFile *)
// (1 byte) - Character mix
// (1 byte) - Character background mix (G=2 or 4 depending on the Geometrics
// parameter of Set Default Parameter Format)
- *pMET << (BYTE)0x21 << (BYTE)0x10 << (BYTE)0x02 << (BYTE)0x40
- << (BYTE)0x00 << (BYTE)0x8f
- << (BYTE)0xaa << (BYTE)0x02 << (BYTE)0x00 << (BYTE)0x00
- << (BYTE)0x44 << (BYTE)0x04 << (BYTE)0x00 << (BYTE)0x00
- << (BYTE)0xa8 << (BYTE)0xaa << (BYTE)0x40 << (BYTE)0x44;
+ *pMET << (sal_uInt8)0x21 << (sal_uInt8)0x10 << (sal_uInt8)0x02 << (sal_uInt8)0x40
+ << (sal_uInt8)0x00 << (sal_uInt8)0x8f
+ << (sal_uInt8)0xaa << (sal_uInt8)0x02 << (sal_uInt8)0x00 << (sal_uInt8)0x00
+ << (sal_uInt8)0x44 << (sal_uInt8)0x04 << (sal_uInt8)0x00 << (sal_uInt8)0x00
+ << (sal_uInt8)0xa8 << (sal_uInt8)0xaa << (sal_uInt8)0x40 << (sal_uInt8)0x44;
// 0 0x21 Set Current Defaults
// 1 Length of following data
@@ -989,10 +987,10 @@ void METWriter::WriteDataDescriptor(const GDIMetaFile *)
// (1 byte) - Marker mix
// (1 byte) - Marker background mix (G=2 or 4 depending on the Geometrics
// parameter of Set Default Parameter Format)
- *pMET << (BYTE)0x21 << (BYTE)0x0c << (BYTE)0x03 << (BYTE)0x40
- << (BYTE)0x00 << (BYTE)0x8f
- << (BYTE)0x66 << (BYTE)0x02 << (BYTE)0x00 << (BYTE)0x00
- << (BYTE)0x66 << (BYTE)0x02 << (BYTE)0x00 << (BYTE)0x00;
+ *pMET << (sal_uInt8)0x21 << (sal_uInt8)0x0c << (sal_uInt8)0x03 << (sal_uInt8)0x40
+ << (sal_uInt8)0x00 << (sal_uInt8)0x8f
+ << (sal_uInt8)0x66 << (sal_uInt8)0x02 << (sal_uInt8)0x00 << (sal_uInt8)0x00
+ << (sal_uInt8)0x66 << (sal_uInt8)0x02 << (sal_uInt8)0x00 << (sal_uInt8)0x00;
// 0 0x21 Set Current Defaults
// 1 Length of following data
@@ -1101,18 +1099,18 @@ void METWriter::WriteDataDescriptor(const GDIMetaFile *)
// 4-7 Bit-map handle
// 8 Lcid
if (nNumberOfBitmaps>0) {
- *pMET << (BYTE)0xe7 << (BYTE)0x07 << (BYTE)0x80 << (BYTE)0x00;
+ *pMET << (sal_uInt8)0xe7 << (sal_uInt8)0x07 << (sal_uInt8)0x80 << (sal_uInt8)0x00;
WriteBigEndianLong(nActBitmapId);
- *pMET << (BYTE)0xfe;
+ *pMET << (sal_uInt8)0xfe;
}
UpdateFieldSize();
- if (pMET->GetError()) bStatus=FALSE;
+ if (pMET->GetError()) bStatus=sal_False;
}
-void METWriter::WillWriteOrder(ULONG nNextOrderMaximumLength)
+void METWriter::WillWriteOrder(sal_uLong nNextOrderMaximumLength)
{
// Die Parameter eines 'Graphics Data Fields' duerfen (laut OS2-Doku)
// hoechstens 32759 Bytes umfassen. Gemeint ist die Laenge des Feldes minus
@@ -1133,9 +1131,9 @@ void METWriter::WillWriteOrder(ULONG nNextOrderMaximumLength)
void METWriter::METBitBlt(Point aPt, Size aSize, const Bitmap & rBitmap)
{
WillWriteOrder(46);
- *pMET << (BYTE)0xd6 << (BYTE)44 << (USHORT)0 << (USHORT) 0x00cc;
+ *pMET << (sal_uInt8)0xd6 << (sal_uInt8)44 << (sal_uInt16)0 << (sal_uInt16) 0x00cc;
WriteBigEndianLong(nActBitmapId++);
- *pMET << (BYTE)0x02 << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x00;
+ *pMET << (sal_uInt8)0x02 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00;
WritePoint(Point(aPt.X(),aPt.Y()+aSize.Height()));
WritePoint(Point(aPt.X()+aSize.Width(),aPt.Y()));
*pMET << (sal_uInt32)0 << (sal_uInt32)0
@@ -1145,18 +1143,18 @@ void METWriter::METBitBlt(Point aPt, Size aSize, const Bitmap & rBitmap)
void METWriter::METSetAndPushLineInfo( const LineInfo& rLineInfo )
{
- INT32 nWidth = OutputDevice::LogicToLogic( Size( rLineInfo.GetWidth(),0 ), aPictureMapMode, aTargetMapMode ).Width();
+ sal_Int32 nWidth = OutputDevice::LogicToLogic( Size( rLineInfo.GetWidth(),0 ), aPictureMapMode, aTargetMapMode ).Width();
WillWriteOrder( 8 ); // set stroke linewidth
- *pMET << (BYTE)0x15
- << (BYTE)6
- << (BYTE)0 // Flags
- << (BYTE)0
+ *pMET << (sal_uInt8)0x15
+ << (sal_uInt8)6
+ << (sal_uInt8)0 // Flags
+ << (sal_uInt8)0
<< nWidth;
if ( rLineInfo.GetStyle() != LINE_SOLID )
{
- BYTE nStyle = 0; // LineDefault;
+ sal_uInt8 nStyle = 0; // LineDefault;
switch ( rLineInfo.GetStyle() )
{
@@ -1182,83 +1180,83 @@ void METWriter::METSetAndPushLineInfo( const LineInfo& rLineInfo )
break; // not handled -Wall
}
WillWriteOrder( 2 );
- *pMET << (BYTE)0x18 << nStyle; // set LineType
+ *pMET << (sal_uInt8)0x18 << nStyle; // set LineType
}
}
void METWriter::METPopLineInfo( const LineInfo& rLineInfo )
{
WillWriteOrder( 8 ); // set stroke linewidth
- *pMET << (BYTE)0x15
- << (BYTE)6
- << (BYTE)0 // Flags
- << (BYTE)0
- << (UINT32)1;
+ *pMET << (sal_uInt8)0x15
+ << (sal_uInt8)6
+ << (sal_uInt8)0 // Flags
+ << (sal_uInt8)0
+ << (sal_uInt32)1;
if ( rLineInfo.GetStyle() != LINE_SOLID )
{
WillWriteOrder( 2 );
- *pMET << (BYTE)0x18 << (BYTE)0; // set LineType
+ *pMET << (sal_uInt8)0x18 << (sal_uInt8)0; // set LineType
}
}
-void METWriter::METBeginArea(BOOL bBoundaryLine)
+void METWriter::METBeginArea(sal_Bool bBoundaryLine)
{
WillWriteOrder(2);
- *pMET << (BYTE)0x68;
- if (bBoundaryLine) *pMET << (BYTE)0xc0;
- else *pMET << (BYTE)0x80;
+ *pMET << (sal_uInt8)0x68;
+ if (bBoundaryLine) *pMET << (sal_uInt8)0xc0;
+ else *pMET << (sal_uInt8)0x80;
}
void METWriter::METEndArea()
{
WillWriteOrder(2);
- *pMET << (BYTE)0x60 << (BYTE)0;
+ *pMET << (sal_uInt8)0x60 << (sal_uInt8)0;
}
void METWriter::METBeginPath(sal_uInt32 nPathId)
{
WillWriteOrder(8);
- *pMET << (BYTE)0xd0 << (BYTE)6 << (USHORT) 0 << nPathId;
+ *pMET << (sal_uInt8)0xd0 << (sal_uInt8)6 << (sal_uInt16) 0 << nPathId;
}
void METWriter::METEndPath()
{
WillWriteOrder(2);
- *pMET << (BYTE)0x7f << (BYTE)0;
+ *pMET << (sal_uInt8)0x7f << (sal_uInt8)0;
}
void METWriter::METFillPath(sal_uInt32 nPathId)
{
WillWriteOrder(8);
- *pMET << (BYTE)0xd7 << (BYTE)6
- << (BYTE)0x00 << (BYTE)0 << nPathId;
+ *pMET << (sal_uInt8)0xd7 << (sal_uInt8)6
+ << (sal_uInt8)0x00 << (sal_uInt8)0 << nPathId;
}
void METWriter::METOutlinePath(sal_uInt32 nPathId)
{
WillWriteOrder(8);
- *pMET << (BYTE)0xd4 << (BYTE)6
- << (BYTE)0 << (BYTE)0 << nPathId;
+ *pMET << (sal_uInt8)0xd4 << (sal_uInt8)6
+ << (sal_uInt8)0 << (sal_uInt8)0 << nPathId;
}
void METWriter::METCloseFigure()
{
WillWriteOrder(2);
- *pMET << (BYTE)0x7d << (BYTE)0;
+ *pMET << (sal_uInt8)0x7d << (sal_uInt8)0;
}
void METWriter::METMove(Point aPt)
{
WillWriteOrder(10);
- *pMET << (BYTE)0x21 << (BYTE)8;
+ *pMET << (sal_uInt8)0x21 << (sal_uInt8)8;
WritePoint(aPt);
}
@@ -1266,30 +1264,30 @@ void METWriter::METMove(Point aPt)
void METWriter::METLine(Point aPt1, Point aPt2)
{
WillWriteOrder(18);
- *pMET << (BYTE)0xc1 << (BYTE)16;
+ *pMET << (sal_uInt8)0xc1 << (sal_uInt8)16;
WritePoint(aPt1); WritePoint(aPt2);
}
void METWriter::METLine(const Polygon & rPolygon)
{
- USHORT nNumPoints,i,j,nOrderPoints;
- BOOL bFirstOrder;
+ sal_uInt16 nNumPoints,i,j,nOrderPoints;
+ sal_Bool bFirstOrder;
- bFirstOrder=TRUE;
+ bFirstOrder=sal_True;
i=0; nNumPoints=rPolygon.GetSize();
while (i<nNumPoints) {
nOrderPoints=nNumPoints-i;
if (nOrderPoints>30) nOrderPoints=30;
WillWriteOrder(nOrderPoints*8+2);
- if (bFirstOrder==TRUE) {
- *pMET << (BYTE)0xc1; // Line at given pos
- bFirstOrder=FALSE;
+ if (bFirstOrder==sal_True) {
+ *pMET << (sal_uInt8)0xc1; // Line at given pos
+ bFirstOrder=sal_False;
}
else {
- *pMET << (BYTE)0x81; // Line at current pos
+ *pMET << (sal_uInt8)0x81; // Line at current pos
}
- *pMET << (BYTE)(nOrderPoints*8);
+ *pMET << (sal_uInt8)(nOrderPoints*8);
for (j=0; j<nOrderPoints; j++) WritePoint(rPolygon.GetPoint(i++));
}
}
@@ -1297,7 +1295,7 @@ void METWriter::METLine(const Polygon & rPolygon)
void METWriter::METLine(const PolyPolygon & rPolyPolygon)
{
- USHORT i,nCount;
+ sal_uInt16 i,nCount;
nCount=rPolyPolygon.Count();
for (i=0; i<nCount; i++) {
METLine(rPolyPolygon.GetObject(i));
@@ -1309,20 +1307,20 @@ void METWriter::METLine(const PolyPolygon & rPolyPolygon)
void METWriter::METLineAtCurPos(Point aPt)
{
WillWriteOrder(10);
- *pMET << (BYTE)0x81 << (BYTE)8;
+ *pMET << (sal_uInt8)0x81 << (sal_uInt8)8;
WritePoint(aPt);
}
-void METWriter::METBox(BOOL bFill, BOOL bBoundary,
+void METWriter::METBox(sal_Bool bFill, sal_Bool bBoundary,
Rectangle aRect, sal_uInt32 nHAxis, sal_uInt32 nVAxis)
{
- BYTE nFlags=0;
+ sal_uInt8 nFlags=0;
if (bFill) nFlags|=0x40;
if (bBoundary) nFlags|=0x20;
WillWriteOrder(28);
- *pMET << (BYTE)0xc0 << (BYTE)26 << nFlags << (BYTE)0;
+ *pMET << (sal_uInt8)0xc0 << (sal_uInt8)26 << nFlags << (sal_uInt8)0;
WritePoint(aRect.BottomLeft());
WritePoint(aRect.TopRight());
*pMET << nHAxis << nVAxis;
@@ -1332,7 +1330,7 @@ void METWriter::METBox(BOOL bFill, BOOL bBoundary,
void METWriter::METFullArc(Point aCenter, double fMultiplier)
{
WillWriteOrder(14);
- *pMET << (BYTE)0xc7 << (BYTE)12;
+ *pMET << (sal_uInt8)0xc7 << (sal_uInt8)12;
WritePoint(aCenter);
*pMET << (long)(fMultiplier*65536.0+0.5);
}
@@ -1348,7 +1346,7 @@ void METWriter::METPartialArcAtCurPos(Point aCenter, double fMultiplier,
while (fSweepAngle>360.0) fSweepAngle-=360.0;
while (fSweepAngle<.00) fSweepAngle+=360.0;
WillWriteOrder(22);
- *pMET << (BYTE)0xa3 << (BYTE)20;
+ *pMET << (sal_uInt8)0xa3 << (sal_uInt8)20;
WritePoint(aCenter);
*pMET << (long)(fMultiplier*65536.0+0.5);
*pMET << (long)(fStartAngle*65536.0+0.5);
@@ -1358,22 +1356,22 @@ void METWriter::METPartialArcAtCurPos(Point aCenter, double fMultiplier,
void METWriter::METChrStr( Point aPt, String aUniStr )
{
- USHORT nLen,i;
+ sal_uInt16 nLen,i;
ByteString aStr( aUniStr, gsl_getSystemTextEncoding() );
nLen = aStr.Len();
WillWriteOrder( 11 + nLen );
- *pMET << (BYTE)0xc3 << (BYTE)( 9 + nLen );
+ *pMET << (sal_uInt8)0xc3 << (sal_uInt8)( 9 + nLen );
WritePoint(aPt);
for ( i = 0; i < nLen; i++ )
*pMET << aStr.GetChar( i );
- *pMET << (BYTE)0;
+ *pMET << (sal_uInt8)0;
}
void METWriter::METSetArcParams(long nP, long nQ, long nR, long nS)
{
WillWriteOrder(18);
- *pMET << (BYTE)0x22 << (BYTE)16 << nP << nQ << nR << nS;
+ *pMET << (sal_uInt8)0x22 << (sal_uInt8)16 << nP << nQ << nR << nS;
}
@@ -1383,10 +1381,10 @@ void METWriter::METSetColor(Color aColor)
aMETColor=aColor;
WillWriteOrder(6);
- *pMET << (BYTE)0xa6 << (BYTE)4 << (BYTE)0
- << (BYTE)(aColor.GetBlue())
- << (BYTE)(aColor.GetGreen())
- << (BYTE)(aColor.GetRed());
+ *pMET << (sal_uInt8)0xa6 << (sal_uInt8)4 << (sal_uInt8)0
+ << (sal_uInt8)(aColor.GetBlue())
+ << (sal_uInt8)(aColor.GetGreen())
+ << (sal_uInt8)(aColor.GetRed());
}
@@ -1396,15 +1394,15 @@ void METWriter::METSetBackgroundColor(Color aColor)
aMETBackgroundColor=aColor;
WillWriteOrder(6);
- *pMET << (BYTE)0xa7 << (BYTE)4 << (BYTE)0
- << (BYTE)(aColor.GetBlue())
- << (BYTE)(aColor.GetGreen())
- << (BYTE)(aColor.GetRed());
+ *pMET << (sal_uInt8)0xa7 << (sal_uInt8)4 << (sal_uInt8)0
+ << (sal_uInt8)(aColor.GetBlue())
+ << (sal_uInt8)(aColor.GetGreen())
+ << (sal_uInt8)(aColor.GetRed());
}
void METWriter::METSetMix(RasterOp eROP)
{
- BYTE nMix;
+ sal_uInt8 nMix;
if (eMETMix==eROP)
return;
@@ -1419,7 +1417,7 @@ void METWriter::METSetMix(RasterOp eROP)
}
WillWriteOrder(2);
- *pMET << (BYTE)0x0c << nMix;
+ *pMET << (sal_uInt8)0x0c << nMix;
}
@@ -1431,7 +1429,7 @@ void METWriter::METSetChrCellSize(Size aSize)
aMETChrCellSize=aSize;
WillWriteOrder(10);
if (aSize.Width()==0) aSize.Width()=aSize.Height();
- *pMET << (BYTE)0x33 << (BYTE)8 << (long)aSize.Width() << (long)aSize.Height();
+ *pMET << (sal_uInt8)0x33 << (sal_uInt8)8 << (long)aSize.Width() << (long)aSize.Height();
}
@@ -1456,27 +1454,27 @@ void METWriter::METSetChrAngle(short nAngle)
}
WillWriteOrder(10);
- *pMET << (BYTE)0x34 << (BYTE)8 << nax << nay;
+ *pMET << (sal_uInt8)0x34 << (sal_uInt8)8 << nax << nay;
}
-void METWriter::METSetChrSet(BYTE nSet)
+void METWriter::METSetChrSet(sal_uInt8 nSet)
{
if (nMETChrSet==nSet)
return;
nMETChrSet=nSet;
WillWriteOrder(2);
- *pMET << (BYTE)0x38 << nSet;
+ *pMET << (sal_uInt8)0x38 << nSet;
}
void METWriter::WriteOrders( const GDIMetaFile* pMTF )
{
- if(bStatus==FALSE)
+ if(bStatus==sal_False)
return;
- for( ULONG nA = 0, nACount = pMTF->GetActionCount(); nA < nACount; nA++ )
+ for( sal_uLong nA = 0, nACount = pMTF->GetActionCount(); nA < nACount; nA++ )
{
const MetaAction* pMA = pMTF->GetAction( nA );
@@ -1498,7 +1496,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
METSetArcParams(1,1,0,0);
METSetMix(eGDIRasterOp);
METSetColor(aGDILineColor);
- METBeginArea(FALSE);
+ METBeginArea(sal_False);
METFullArc(pA->GetPoint(),0.5);
METEndArea();
}
@@ -1536,14 +1534,14 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
METSetMix( eGDIRasterOp );
METSetColor( aGDIFillColor );
METSetBackgroundColor( aGDIFillColor );
- METBox( TRUE, FALSE, pA->GetRect(), 0, 0 );
+ METBox( sal_True, sal_False, pA->GetRect(), 0, 0 );
}
if( aGDILineColor != Color( COL_TRANSPARENT ) )
{
METSetMix( eGDIRasterOp );
METSetColor( aGDILineColor );
- METBox( FALSE, TRUE, pA->GetRect(), 0, 0 );
+ METBox( sal_False, sal_True, pA->GetRect(), 0, 0 );
}
}
break;
@@ -1557,14 +1555,14 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
METSetMix( eGDIRasterOp );
METSetColor( aGDIFillColor );
METSetBackgroundColor( aGDIFillColor );
- METBox( TRUE, FALSE, pA->GetRect(), pA->GetHorzRound(), pA->GetVertRound() );
+ METBox( sal_True, sal_False, pA->GetRect(), pA->GetHorzRound(), pA->GetVertRound() );
}
if( aGDILineColor != Color( COL_TRANSPARENT ) )
{
METSetMix( eGDIRasterOp );
METSetColor( aGDILineColor );
- METBox( FALSE, TRUE, pA->GetRect(), pA->GetHorzRound(), pA->GetVertRound() );
+ METBox( sal_False, sal_True, pA->GetRect(), pA->GetHorzRound(), pA->GetVertRound() );
}
}
break;
@@ -1584,7 +1582,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
METSetMix( eGDIRasterOp );
METSetColor( aGDIFillColor );
METSetBackgroundColor( aGDIFillColor );
- METBeginArea(FALSE);
+ METBeginArea(sal_False);
METFullArc(aCenter,0.5);
METEndArea();
}
@@ -1862,7 +1860,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
case META_TEXTARRAY_ACTION:
{
const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pMA;
- USHORT i;
+ sal_uInt16 i;
String aStr;
Polygon aPolyDummy(1);
short nOrientation;
@@ -1914,7 +1912,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
{
const MetaStretchTextAction* pA = (const MetaStretchTextAction*) pMA;
VirtualDevice aVDev;
- USHORT i;
+ sal_uInt16 i;
sal_Int32* pDXAry;
sal_Int32 nNormSize;
String aStr;
@@ -2034,8 +2032,8 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
const MetaEPSAction* pA = (const MetaEPSAction*)pMA;
const GDIMetaFile aGDIMetaFile( pA->GetSubstitute() );
- INT32 nCount = aGDIMetaFile.GetActionCount();
- for ( INT32 i = 0; i < nCount; i++ )
+ sal_Int32 nCount = aGDIMetaFile.GetActionCount();
+ for ( sal_Int32 i = 0; i < nCount; i++ )
{
const MetaAction* pMetaAct = aGDIMetaFile.GetAction( i );
if ( pMetaAct->GetType() == META_BMPSCALE_ACTION )
@@ -2314,16 +2312,16 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
MayCallback();
if( pMET->GetError() )
- bStatus=FALSE;
+ bStatus=sal_False;
- if( bStatus == FALSE )
+ if( bStatus == sal_False )
break;
}
}
void METWriter::WriteObjectEnvironmentGroup(const GDIMetaFile * pMTF)
{
- ULONG i, nId;
+ sal_uLong i, nId;
//--- Das Feld 'Begin Object Environment Group':
WriteFieldIntroducer(16,BegObjEnvMagic,0,0);
@@ -2332,18 +2330,18 @@ void METWriter::WriteObjectEnvironmentGroup(const GDIMetaFile * pMTF)
//--- Das Feld 'Map Color Attribute Table':
WriteFieldIntroducer(22,MapColAtrMagic,0,0);
WriteBigEndianShort(0x000e);
- *pMET << (BYTE)0x0c << (BYTE)0x02 << (BYTE)0x84 << (BYTE)0x00;
+ *pMET << (sal_uInt8)0x0c << (sal_uInt8)0x02 << (sal_uInt8)0x84 << (sal_uInt8)0x00;
WriteFieldId(4);
//--- Das erste Feld 'Map Coded Font':
WriteFieldIntroducer(32,MapCodFntMagic,0,0);
WriteBigEndianShort(0x0018);
- *pMET << (BYTE)0x0c << (BYTE)0x02 << (BYTE)0x84 << (BYTE)0x00;
- *pMET << (BYTE)0xff << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x00;
- *pMET << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x00 << (BYTE)0x00;
- *pMET << (BYTE)0x04 << (BYTE)0x24 << (BYTE)0x05 << (BYTE)0x00;
- *pMET << (BYTE)0x06 << (BYTE)0x20;
- *pMET << (BYTE)0x03 << (BYTE)0x97 << (BYTE)0x01 << (BYTE)0xb5;
+ *pMET << (sal_uInt8)0x0c << (sal_uInt8)0x02 << (sal_uInt8)0x84 << (sal_uInt8)0x00;
+ *pMET << (sal_uInt8)0xff << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00;
+ *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00 << (sal_uInt8)0x00;
+ *pMET << (sal_uInt8)0x04 << (sal_uInt8)0x24 << (sal_uInt8)0x05 << (sal_uInt8)0x00;
+ *pMET << (sal_uInt8)0x06 << (sal_uInt8)0x20;
+ *pMET << (sal_uInt8)0x03 << (sal_uInt8)0x97 << (sal_uInt8)0x01 << (sal_uInt8)0xb5;
//--- Die weiteren Felder 'Map Coded Font':
CreateChrSets(pMTF);
@@ -2355,9 +2353,9 @@ void METWriter::WriteObjectEnvironmentGroup(const GDIMetaFile * pMTF)
{
WriteFieldIntroducer(29,MapDatResMagic,0,0);
WriteBigEndianShort(0x0015);
- *pMET << (BYTE)0x0c << (BYTE)0x02 << (BYTE)0x84 << (BYTE)0x00;
+ *pMET << (sal_uInt8)0x0c << (sal_uInt8)0x02 << (sal_uInt8)0x84 << (sal_uInt8)0x00;
WriteFieldId(nId);
- *pMET << (BYTE)0x07 << (BYTE)0x22 << (BYTE)0x10;
+ *pMET << (sal_uInt8)0x07 << (sal_uInt8)0x22 << (sal_uInt8)0x10;
*pMET << (sal_uInt32)nId;
nId++;
}
@@ -2370,9 +2368,9 @@ void METWriter::WriteObjectEnvironmentGroup(const GDIMetaFile * pMTF)
void METWriter::WriteGraphicsObject(const GDIMetaFile * pMTF)
{
- ULONG nSegmentSize,nPos,nDataFieldsStartPos;
+ sal_uLong nSegmentSize,nPos,nDataFieldsStartPos;
- if( bStatus==FALSE )
+ if( bStatus==sal_False )
return;
//--- Das Feld 'Begin Graphics Object':
@@ -2396,11 +2394,11 @@ void METWriter::WriteGraphicsObject(const GDIMetaFile * pMTF)
nNumberOfDataFields++;
// Nun schreiben wir zunaechst den Kopf des Segments:
- *pMET << (BYTE)0x70 << (BYTE)0x0e << (sal_uInt32)0;
- *pMET << (BYTE)0x70 << (BYTE)0x10; // Flags
- *pMET << (USHORT)0; // Lo-Wort der Laenge der Segementdaten (Big Endian)
+ *pMET << (sal_uInt8)0x70 << (sal_uInt8)0x0e << (sal_uInt32)0;
+ *pMET << (sal_uInt8)0x70 << (sal_uInt8)0x10; // Flags
+ *pMET << (sal_uInt16)0; // Lo-Wort der Laenge der Segementdaten (Big Endian)
*pMET << (sal_uInt32)0; // Reserved
- *pMET << (USHORT)0; // Hi-Wort der Laenge der Segementdaten (Big Endian) (Ohh Ohh OS2)
+ *pMET << (sal_uInt16)0; // Hi-Wort der Laenge der Segementdaten (Big Endian) (Ohh Ohh OS2)
// Anmerkung: die richtige Daten-Laenge schreiben wir weiter unten nochmal
// Jetzt werden alle Orders rausgeschrieben:
@@ -2416,9 +2414,9 @@ void METWriter::WriteGraphicsObject(const GDIMetaFile * pMTF)
nSegmentSize=nPos-nDataFieldsStartPos;
nSegmentSize-=nNumberOfDataFields*8; // Structured Field Introducers zaehlen nicht mit
pMET->Seek(nDataFieldsStartPos+16); // Zum Lo-Wort der Segmentgroesse seeken
- WriteBigEndianShort((USHORT)(nSegmentSize&0x0000ffff)); // Und schreiben
+ WriteBigEndianShort((sal_uInt16)(nSegmentSize&0x0000ffff)); // Und schreiben
pMET->Seek(nDataFieldsStartPos+22); // Zum Hi-Wort der Segmentgroesse seeken
- WriteBigEndianShort((USHORT)(nSegmentSize>>16)); // Und schreiben
+ WriteBigEndianShort((sal_uInt16)(nSegmentSize>>16)); // Und schreiben
pMET->Seek(nPos); // Zurueck zur Tagesordnung
//--- Das Feld 'End Graphic Objects':
@@ -2426,13 +2424,13 @@ void METWriter::WriteGraphicsObject(const GDIMetaFile * pMTF)
WriteFieldId(7);
if( pMET->GetError() )
- bStatus=FALSE;
+ bStatus=sal_False;
}
void METWriter::WriteResourceGroup(const GDIMetaFile * pMTF)
{
- if( bStatus==FALSE )
+ if( bStatus==sal_False )
return;
//--- Das Feld 'Begin Resource Group':
@@ -2451,22 +2449,22 @@ void METWriter::WriteResourceGroup(const GDIMetaFile * pMTF)
WriteFieldId(2);
if( pMET->GetError() )
- bStatus=FALSE;
+ bStatus=sal_False;
}
void METWriter::WriteDocument(const GDIMetaFile * pMTF)
{
- if( bStatus==FALSE )
+ if( bStatus==sal_False )
return;
//--- Das Feld 'Begin Document':
WriteFieldIntroducer(0,BegDocumnMagic,0,0);
WriteFieldId(1);
- *pMET << (BYTE)0x00 << (BYTE)0x00;
- *pMET << (BYTE)0x05 << (BYTE)0x18 << (BYTE)0x03 << (BYTE)0x0c << (BYTE)0x00;
- *pMET << (BYTE)0x06 << (BYTE)0x01 << (BYTE)0x03 << (BYTE)0xd4 << (BYTE)0x03 << (BYTE)0x52;
- *pMET << (BYTE)0x03 << (BYTE)0x65 << (BYTE)0x00;
+ *pMET << (sal_uInt8)0x00 << (sal_uInt8)0x00;
+ *pMET << (sal_uInt8)0x05 << (sal_uInt8)0x18 << (sal_uInt8)0x03 << (sal_uInt8)0x0c << (sal_uInt8)0x00;
+ *pMET << (sal_uInt8)0x06 << (sal_uInt8)0x01 << (sal_uInt8)0x03 << (sal_uInt8)0xd4 << (sal_uInt8)0x03 << (sal_uInt8)0x52;
+ *pMET << (sal_uInt8)0x03 << (sal_uInt8)0x65 << (sal_uInt8)0x00;
UpdateFieldSize();
//--- Der Inhalt:
@@ -2477,10 +2475,10 @@ void METWriter::WriteDocument(const GDIMetaFile * pMTF)
WriteFieldId(1);
if( pMET->GetError() )
- bStatus=FALSE;
+ bStatus=sal_False;
}
-BOOL METWriter::WriteMET( const GDIMetaFile& rMTF, SvStream& rTargetStream, FilterConfigItem* pFilterConfigItem )
+sal_Bool METWriter::WriteMET( const GDIMetaFile& rMTF, SvStream& rTargetStream, FilterConfigItem* pFilterConfigItem )
{
if ( pFilterConfigItem )
{
@@ -2495,7 +2493,7 @@ BOOL METWriter::WriteMET( const GDIMetaFile& rMTF, SvStream& rTargetStream, Filt
METChrSet* pCS;
METGDIStackMember* pGS;
- bStatus=TRUE;
+ bStatus=sal_True;
nLastPercent=0;
pMET=&rTargetStream;
@@ -2552,7 +2550,7 @@ BOOL METWriter::WriteMET( const GDIMetaFile& rMTF, SvStream& rTargetStream, Filt
//================== GraphicExport - die exportierte Funktion ================
-extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pFilterConfigItem, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicExport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool )
{ METWriter aMETWriter;
if ( rGraphic.GetType() == GRAPHIC_GDIMETAFILE )
@@ -2571,55 +2569,5 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream & rStream, Graphic & rGr
}
}
-//================== GraphicDialog - die exportierte Funktion ================
-
-extern "C" BOOL SAL_CALL DoExportDialog( FltCallDialogParameter& rPara )
-{
- BOOL bRet = FALSE;
-
- if ( rPara.pWindow )
- {
- ByteString aResMgrName( "eme" );
- ResMgr* pResMgr;
-
- pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
-
- if( pResMgr )
- {
- rPara.pResMgr = pResMgr;
- bRet = ( DlgExportEMET( rPara ).Execute() == RET_OK );
- delete pResMgr;
- }
- else
- bRet = TRUE;
- }
-
- return bRet;
-}
-
-//================== ein bischen Muell fuer Windows ==========================
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/eos2met/exports.map b/filter/source/graphicfilter/eos2met/exports.map
index 61e4682c6551..d4e28c44700c 100644
--- a/filter/source/graphicfilter/eos2met/exports.map
+++ b/filter/source/graphicfilter/eos2met/exports.map
@@ -1,7 +1,6 @@
UDK_3_0_0 {
global:
GraphicExport;
- DoExportDialog;
local:
*;
diff --git a/filter/source/graphicfilter/eos2met/makefile.mk b/filter/source/graphicfilter/eos2met/makefile.mk
index af9043489ac3..921ffa5071f5 100644
--- a/filter/source/graphicfilter/eos2met/makefile.mk
+++ b/filter/source/graphicfilter/eos2met/makefile.mk
@@ -42,20 +42,13 @@ DEPTARGET=veos2met
CDEFS+= -DEDITDEBUG
.ENDIF
-SRS1NAME=$(TARGET)
-SRC1FILES= dlgeos2.src \
- eos2mstr.src
.IF "$(L10N_framework)"==""
-SLOFILES = $(EXCEPTIONSFILES)
-EXCEPTIONSFILES= \
- $(SLO)$/eos2met.obj \
- $(SLO)$/dlgeos2.obj
+SLOFILES = $(SLO)$/eos2met.obj
+
.ENDIF
# ==========================================================================
-RESLIB1NAME=$(TARGET2)
-RESLIB1SRSFILES=$(SRS)$/$(TARGET).srs
.IF "$(L10N_framework)"==""
SHL1TARGET= eme$(DLLPOSTFIX)
SHL1IMPLIB= eos2met
diff --git a/filter/source/graphicfilter/eos2met/strings.hrc b/filter/source/graphicfilter/eos2met/strings.hrc
deleted file mode 100644
index 7834e3ea2bc0..000000000000
--- a/filter/source/graphicfilter/eos2met/strings.hrc
+++ /dev/null
@@ -1,29 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-#define KEY_MODE 260
-#define KEY_SIZE 261
-
diff --git a/filter/source/graphicfilter/epbm/dlgepbm.cxx b/filter/source/graphicfilter/epbm/dlgepbm.cxx
deleted file mode 100644
index ff95642f43d6..000000000000
--- a/filter/source/graphicfilter/epbm/dlgepbm.cxx
+++ /dev/null
@@ -1,100 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_filter.hxx"
-
-#include <tools/ref.hxx>
-#include <svtools/FilterConfigItem.hxx>
-#include <vcl/msgbox.hxx>
-#include "dlgepbm.hxx"
-#include "dlgepbm.hrc"
-#include "strings.hrc"
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportEPBM::DlgExportEPBM( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPBM, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aGrpFormat ( this, ResId( GRP_FORMAT, *rPara.pResMgr ) ),
- aRBRaw ( this, ResId( RB_RAW, *rPara.pResMgr ) ),
- aRBASCII ( this, ResId( RB_ASCII, *rPara.pResMgr ) ),
- aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr )
-{
- FreeResource();
-
- // Config-Parameter lesen
-
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PBM" ) );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
- sal_Int32 nFormat = pConfigItem->ReadInt32( String( ResId( KEY_FORMAT, *pMgr ) ), 1 );
-
- BOOL bCheck = FALSE;
- if ( !nFormat )
- bCheck ^= TRUE;
-
- aRBRaw.Check( bCheck );
- bCheck ^= TRUE;
- aRBASCII.Check( bCheck );
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportEPBM, OK ) );
-}
-
-DlgExportEPBM::~DlgExportEPBM()
-{
- delete pConfigItem;
-}
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEPBM, OK, void *, EMPTYARG )
-{
-
- // Config-Parameter schreiben
- sal_Int32 nFormat = 0;
- if ( aRBASCII.IsChecked() )
- nFormat++;
- pConfigItem->WriteInt32( String( ResId( KEY_FORMAT, *pMgr ) ), nFormat );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/epbm/dlgepbm.hrc b/filter/source/graphicfilter/epbm/dlgepbm.hrc
deleted file mode 100644
index 876dfa840997..000000000000
--- a/filter/source/graphicfilter/epbm/dlgepbm.hrc
+++ /dev/null
@@ -1,34 +0,0 @@
-/*************************************************************************
- *
- * 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 "filter.hrc"
-
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define GRP_FORMAT 1
-#define RB_RAW 1
-#define RB_ASCII 2
diff --git a/filter/source/graphicfilter/epbm/dlgepbm.hxx b/filter/source/graphicfilter/epbm/dlgepbm.hxx
deleted file mode 100644
index 0c7a1688fdab..000000000000
--- a/filter/source/graphicfilter/epbm/dlgepbm.hxx
+++ /dev/null
@@ -1,74 +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 _DLGEPBM_HXX_
-#define _DLGEPBM_HXX_
-#include <svtools/fltcall.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <svtools/stdctrl.hxx>
-
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen
-|*
-\************************************************************************/
-
-class ResMgr;
-
-class FilterConfigItem;
-class DlgExportEPBM : public ModalDialog
-{
-private:
-
- FltCallDialogParameter& rFltCallPara;
-
- FixedLine aGrpFormat;
- RadioButton aRBRaw;
- RadioButton aRBASCII;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
-
- FilterConfigItem* pConfigItem;
- ResMgr* pMgr;
-
- DECL_LINK( OK, void * );
-
-public:
- DlgExportEPBM( FltCallDialogParameter& rPara );
- ~DlgExportEPBM();
-};
-
-#endif // _DLGEPBM_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/epbm/dlgepbm.src b/filter/source/graphicfilter/epbm/dlgepbm.src
deleted file mode 100644
index b4e6eb2decf2..000000000000
--- a/filter/source/graphicfilter/epbm/dlgepbm.src
+++ /dev/null
@@ -1,106 +0,0 @@
-/*************************************************************************
- *
- * 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 "dlgepbm.hrc"
-ModalDialog DLG_EXPORT_EPBM
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 133 , 63 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Text [ en-US ] = "PBM Options" ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 73 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 73 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 73 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedLine GRP_FORMAT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "File format";
- };
- RadioButton RB_RAW
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Binary";
- };
- RadioButton RB_ASCII
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Text";
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/filter/source/graphicfilter/epbm/epbm.cxx b/filter/source/graphicfilter/epbm/epbm.cxx
index 82436563efd4..8178001f2579 100644
--- a/filter/source/graphicfilter/epbm/epbm.cxx
+++ b/filter/source/graphicfilter/epbm/epbm.cxx
@@ -36,9 +36,6 @@
#include <svl/solar.hrc>
#include <svtools/fltcall.hxx>
#include <svtools/FilterConfigItem.hxx>
-#include "strings.hrc"
-#include "dlgepbm.hrc"
-#include "dlgepbm.hxx"
//============================ PBMWriter ==================================
@@ -47,14 +44,14 @@ class PBMWriter {
private:
SvStream& m_rOStm; // Die auszugebende PBM-Datei
- USHORT mpOStmOldModus;
+ sal_uInt16 mpOStmOldModus;
- BOOL mbStatus;
+ sal_Bool mbStatus;
sal_Int32 mnMode; // 0 -> raw, 1-> ascii
BitmapReadAccess* mpAcc;
- ULONG mnWidth, mnHeight; // Bildausmass in Pixeln
+ sal_uLong mnWidth, mnHeight; // Bildausmass in Pixeln
- BOOL ImplWriteHeader();
+ sal_Bool ImplWriteHeader();
void ImplWriteBody();
void ImplWriteNumber( sal_Int32 );
@@ -64,14 +61,14 @@ public:
PBMWriter(SvStream &rPBM);
~PBMWriter();
- BOOL WritePBM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem );
+ sal_Bool WritePBM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem );
};
//=================== Methoden von PBMWriter ==============================
PBMWriter::PBMWriter(SvStream &rPBM)
: m_rOStm(rPBM)
- , mbStatus(TRUE)
+ , mbStatus(sal_True)
, mpAcc(NULL)
{
}
@@ -84,7 +81,7 @@ PBMWriter::~PBMWriter()
// ------------------------------------------------------------------------
-BOOL PBMWriter::WritePBM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem )
+sal_Bool PBMWriter::WritePBM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem )
{
if ( pFilterConfigItem )
{
@@ -114,7 +111,7 @@ BOOL PBMWriter::WritePBM( const Graphic& rGraphic, FilterConfigItem* pFilterConf
aBmp.ReleaseAccess( mpAcc );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
m_rOStm.SetNumberFormatInt( mpOStmOldModus );
@@ -126,7 +123,7 @@ BOOL PBMWriter::WritePBM( const Graphic& rGraphic, FilterConfigItem* pFilterConf
// ------------------------------------------------------------------------
-BOOL PBMWriter::ImplWriteHeader()
+sal_Bool PBMWriter::ImplWriteHeader()
{
mnWidth = mpAcc->Width();
mnHeight = mpAcc->Height();
@@ -138,11 +135,11 @@ BOOL PBMWriter::ImplWriteHeader()
m_rOStm << "P1\x0a";
ImplWriteNumber( mnWidth );
- m_rOStm << (BYTE)32;
+ m_rOStm << (sal_uint8)32;
ImplWriteNumber( mnHeight );
- m_rOStm << (BYTE)10;
+ m_rOStm << (sal_uInt8)10;
}
- else mbStatus = FALSE;
+ else mbStatus = sal_False;
return mbStatus;
}
@@ -152,10 +149,10 @@ void PBMWriter::ImplWriteBody()
{
if ( mnMode == 0 )
{
- BYTE nBYTE = 0;
- for ( ULONG y = 0; y < mnHeight; y++ )
+ sal_uInt8 nBYTE = 0;
+ for ( sal_uLong y = 0; y < mnHeight; y++ )
{
- ULONG x;
+ sal_uLong x;
for ( x = 0; x < mnWidth; x++ )
{
nBYTE <<= 1;
@@ -165,25 +162,25 @@ void PBMWriter::ImplWriteBody()
m_rOStm << nBYTE;
}
if ( ( x & 7 ) != 0 )
- m_rOStm << (BYTE)( nBYTE << ( ( x ^ 7 ) + 1 ) );
+ m_rOStm << (sal_uInt8)( nBYTE << ( ( x ^ 7 ) + 1 ) );
}
}
else
{
int nxCount;
- for ( ULONG y = 0; y < mnHeight; y++ )
+ for ( sal_uLong y = 0; y < mnHeight; y++ )
{
nxCount = 70;
- for ( ULONG x = 0; x < mnWidth; x++ )
+ for ( sal_uLong x = 0; x < mnWidth; x++ )
{
if (!( --nxCount ) )
{
nxCount = 69;
- m_rOStm << (BYTE)10;
+ m_rOStm << (sal_uInt8)10;
}
- m_rOStm << (BYTE)( ( mpAcc->GetPixel( y, x ) ^ 1 ) + '0' ) ;
+ m_rOStm << (sal_uInt8)( ( mpAcc->GetPixel( y, x ) ^ 1 ) + '0' ) ;
}
- m_rOStm << (BYTE)10;
+ m_rOStm << (sal_uInt8)10;
}
}
}
@@ -206,7 +203,7 @@ void PBMWriter::ImplWriteNumber( sal_Int32 nNumber )
// - exported function -
// ---------------------
-extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool )
{
PBMWriter aPBMWriter(rStream);
@@ -215,57 +212,5 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGrap
// ------------------------------------------------------------------------
-extern "C" BOOL __LOADONCALLAPI DoExportDialog( FltCallDialogParameter& rPara )
-{
- BOOL bRet = FALSE;
-
- if ( rPara.pWindow )
- {
- ByteString aResMgrName( "epb" );
- ResMgr* pResMgr;
-
- pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
-
- if( pResMgr )
- {
- rPara.pResMgr = pResMgr;
- bRet = ( DlgExportEPBM( rPara ).Execute() == RET_OK );
- delete pResMgr;
- }
- else
- bRet = TRUE;
- }
-
- return bRet;
-}
-
-// ------------------------------------------------------------------------
-
-// ---------------
-// - Win16 trash -
-// ---------------
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0;
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
- if ( nHeap )
- UnlockData( 0 );
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-// ------------------------------------------------------------------------
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/filter/source/graphicfilter/epbm/exports.map b/filter/source/graphicfilter/epbm/exports.map
index 61e4682c6551..d4e28c44700c 100644
--- a/filter/source/graphicfilter/epbm/exports.map
+++ b/filter/source/graphicfilter/epbm/exports.map
@@ -1,7 +1,6 @@
UDK_3_0_0 {
global:
GraphicExport;
- DoExportDialog;
local:
*;
diff --git a/filter/source/graphicfilter/epbm/makefile.mk b/filter/source/graphicfilter/epbm/makefile.mk
index 6cf6531dd46b..e7e596b40336 100644
--- a/filter/source/graphicfilter/epbm/makefile.mk
+++ b/filter/source/graphicfilter/epbm/makefile.mk
@@ -42,20 +42,14 @@ DEPTARGET=vepbm
CDEFS+= -DEDITDEBUG
.ENDIF
-SRS1NAME=$(TARGET)
-SRC1FILES= dlgepbm.src \
- epbmstr.src
.IF "$(L10N_framework)"==""
SLOFILES = \
$(EXCEPTIONSFILES)
EXCEPTIONSFILES = \
- $(SLO)$/epbm.obj \
- $(SLO)$/dlgepbm.obj
+ $(SLO)$/epbm.obj
.ENDIF
# ==========================================================================
-RESLIB1NAME=$(TARGET2)
-RESLIB1SRSFILES=$(SRS)$/$(TARGET).srs
.IF "$(L10N_framework)"==""
SHL1TARGET= epb$(DLLPOSTFIX)
SHL1IMPLIB= epbm
diff --git a/filter/source/graphicfilter/epbm/strings.hrc b/filter/source/graphicfilter/epbm/strings.hrc
deleted file mode 100644
index 122719e87d4b..000000000000
--- a/filter/source/graphicfilter/epbm/strings.hrc
+++ /dev/null
@@ -1,27 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-#define KEY_FORMAT 256
diff --git a/filter/source/graphicfilter/epgm/dlgepgm.cxx b/filter/source/graphicfilter/epgm/dlgepgm.cxx
deleted file mode 100644
index 6d3d6113b822..000000000000
--- a/filter/source/graphicfilter/epgm/dlgepgm.cxx
+++ /dev/null
@@ -1,98 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_filter.hxx"
-
-#include <tools/ref.hxx>
-#include <svtools/FilterConfigItem.hxx>
-#include <vcl/msgbox.hxx>
-#include "dlgepgm.hxx"
-#include "dlgepgm.hrc"
-#include "strings.hrc"
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportEPGM::DlgExportEPGM( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPGM, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aGrpFormat ( this, ResId( GRP_FORMAT, *rPara.pResMgr ) ),
- aRBRaw ( this, ResId( RB_RAW, *rPara.pResMgr ) ),
- aRBASCII ( this, ResId( RB_ASCII, *rPara.pResMgr ) ),
- aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr )
-{
- FreeResource();
-
- // Config-Parameter lesen
-
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PGM" ) );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
- sal_Int32 nFormat = pConfigItem->ReadInt32( String( ResId( KEY_FORMAT, *pMgr ) ), 0 );
-
- BOOL bCheck = FALSE;
- if ( !nFormat )
- bCheck ^= TRUE;
- aRBRaw.Check( bCheck );
- bCheck ^= TRUE;
- aRBASCII.Check( bCheck );
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportEPGM, OK ) );
-}
-
-DlgExportEPGM::~DlgExportEPGM()
-{
- delete pConfigItem;
-}
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEPGM, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
- sal_Int32 nFormat = 0;
- if ( aRBASCII.IsChecked() )
- nFormat++;
- pConfigItem->WriteInt32( String( ResId( KEY_FORMAT, *pMgr ) ), nFormat );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/epgm/dlgepgm.hrc b/filter/source/graphicfilter/epgm/dlgepgm.hrc
deleted file mode 100644
index 876dfa840997..000000000000
--- a/filter/source/graphicfilter/epgm/dlgepgm.hrc
+++ /dev/null
@@ -1,34 +0,0 @@
-/*************************************************************************
- *
- * 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 "filter.hrc"
-
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define GRP_FORMAT 1
-#define RB_RAW 1
-#define RB_ASCII 2
diff --git a/filter/source/graphicfilter/epgm/dlgepgm.hxx b/filter/source/graphicfilter/epgm/dlgepgm.hxx
deleted file mode 100644
index 23773e59a204..000000000000
--- a/filter/source/graphicfilter/epgm/dlgepgm.hxx
+++ /dev/null
@@ -1,74 +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 _DLGEPGM_HXX_
-#define _DLGEPGM_HXX_
-#include <svtools/fltcall.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <svtools/stdctrl.hxx>
-
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen
-|*
-\************************************************************************/
-
-class FilterConfigItem;
-class ResMgr;
-
-class DlgExportEPGM : public ModalDialog
-{
-private:
-
- FltCallDialogParameter& rFltCallPara;
-
- FixedLine aGrpFormat;
- RadioButton aRBRaw;
- RadioButton aRBASCII;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
-
- FilterConfigItem* pConfigItem;
- ResMgr* pMgr;
-
- DECL_LINK( OK, void * );
-
-public:
- DlgExportEPGM( FltCallDialogParameter& rPara );
- ~DlgExportEPGM();
-};
-
-#endif // _DLGEPGM_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/epgm/dlgepgm.src b/filter/source/graphicfilter/epgm/dlgepgm.src
deleted file mode 100644
index 39e91d29fdf5..000000000000
--- a/filter/source/graphicfilter/epgm/dlgepgm.src
+++ /dev/null
@@ -1,105 +0,0 @@
-/*************************************************************************
- *
- * 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 "dlgepgm.hrc"
-ModalDialog DLG_EXPORT_EPGM
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 133 , 63 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Text [ en-US ] = "PGM Options" ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 73 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 73 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 73 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedLine GRP_FORMAT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "File format";
- };
- RadioButton RB_RAW
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Binary";
- };
- RadioButton RB_ASCII
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Text";
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/filter/source/graphicfilter/epgm/epgm.cxx b/filter/source/graphicfilter/epgm/epgm.cxx
index 3de263501db8..68d8fad51313 100644
--- a/filter/source/graphicfilter/epgm/epgm.cxx
+++ b/filter/source/graphicfilter/epgm/epgm.cxx
@@ -36,9 +36,6 @@
#include <svl/solar.hrc>
#include <svtools/fltcall.hxx>
#include <svtools/FilterConfigItem.hxx>
-#include "strings.hrc"
-#include "dlgepgm.hrc"
-#include "dlgepgm.hxx"
//============================ PGMWriter ==================================
@@ -47,14 +44,14 @@ class PGMWriter {
private:
SvStream& m_rOStm; // Die auszugebende PGM-Datei
- USHORT mpOStmOldModus;
+ sal_uInt16 mpOStmOldModus;
- BOOL mbStatus;
- UINT32 mnMode;
+ sal_Bool mbStatus;
+ sal_uInt32 mnMode;
BitmapReadAccess* mpAcc;
- ULONG mnWidth, mnHeight; // Bildausmass in Pixeln
+ sal_uLong mnWidth, mnHeight; // Bildausmass in Pixeln
- BOOL ImplWriteHeader();
+ sal_Bool ImplWriteHeader();
void ImplWriteBody();
void ImplWriteNumber( sal_Int32 );
@@ -64,14 +61,14 @@ public:
PGMWriter(SvStream &rStream);
~PGMWriter();
- BOOL WritePGM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem );
+ sal_Bool WritePGM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem );
};
//=================== Methoden von PGMWriter ==============================
PGMWriter::PGMWriter(SvStream &rStream)
: m_rOStm(rStream)
- , mbStatus(TRUE)
+ , mbStatus(sal_True)
, mpAcc(NULL)
{
}
@@ -84,7 +81,7 @@ PGMWriter::~PGMWriter()
// ------------------------------------------------------------------------
-BOOL PGMWriter::WritePGM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem )
+sal_Bool PGMWriter::WritePGM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem )
{
if ( pFilterConfigItem )
{
@@ -115,7 +112,7 @@ BOOL PGMWriter::WritePGM( const Graphic& rGraphic, FilterConfigItem* pFilterConf
aBmp.ReleaseAccess( mpAcc );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
m_rOStm.SetNumberFormatInt( mpOStmOldModus );
@@ -127,7 +124,7 @@ BOOL PGMWriter::WritePGM( const Graphic& rGraphic, FilterConfigItem* pFilterConf
// ------------------------------------------------------------------------
-BOOL PGMWriter::ImplWriteHeader()
+sal_Bool PGMWriter::ImplWriteHeader()
{
mnWidth = mpAcc->Width();
mnHeight = mpAcc->Height();
@@ -139,14 +136,14 @@ BOOL PGMWriter::ImplWriteHeader()
m_rOStm << "P2\x0a";
ImplWriteNumber( mnWidth );
- m_rOStm << (BYTE)32;
+ m_rOStm << (sal_uInt8)32;
ImplWriteNumber( mnHeight );
- m_rOStm << (BYTE)32;
+ m_rOStm << (sal_uInt8)32;
ImplWriteNumber( 255 ); // max. gray value
- m_rOStm << (BYTE)10;
+ m_rOStm << (sal_uInt8)10;
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
return mbStatus;
}
@@ -157,37 +154,37 @@ void PGMWriter::ImplWriteBody()
{
if ( mnMode == 0 )
{
- for ( ULONG y = 0; y < mnHeight; y++ )
+ for ( sal_uLong y = 0; y < mnHeight; y++ )
{
- for ( ULONG x = 0; x < mnWidth; x++ )
+ for ( sal_uLong x = 0; x < mnWidth; x++ )
{
- m_rOStm << (BYTE)( mpAcc->GetPixel( y, x ) );
+ m_rOStm << (sal_uInt8)( mpAcc->GetPixel( y, x ) );
}
}
}
else
{
- for ( ULONG y = 0; y < mnHeight; y++ )
+ for ( sal_uLong y = 0; y < mnHeight; y++ )
{
int nCount = 70;
- for ( ULONG x = 0; x < mnWidth; x++ )
+ for ( sal_uLong x = 0; x < mnWidth; x++ )
{
- BYTE nDat, nNumb;
+ sal_uInt8 nDat, nNumb;
if ( nCount < 0 )
{
nCount = 69;
- m_rOStm << (BYTE)10;
+ m_rOStm << (sal_uInt8)10;
}
- nDat = (BYTE)mpAcc->GetPixel( y, x );
+ nDat = (sal_uInt8)mpAcc->GetPixel( y, x );
nNumb = nDat / 100;
if ( nNumb )
{
- m_rOStm << (BYTE)( nNumb + '0' );
+ m_rOStm << (sal_uInt8)( nNumb + '0' );
nDat -= ( nNumb * 100 );
nNumb = nDat / 10;
- m_rOStm << (BYTE)( nNumb + '0' );
+ m_rOStm << (sal_uInt8)( nNumb + '0' );
nDat -= ( nNumb * 10 );
- m_rOStm << (BYTE)( nDat + '0' );
+ m_rOStm << (sal_uInt8)( nDat + '0' );
nCount -= 4;
}
else
@@ -195,20 +192,20 @@ void PGMWriter::ImplWriteBody()
nNumb = nDat / 10;
if ( nNumb )
{
- m_rOStm << (BYTE)( nNumb + '0' );
+ m_rOStm << (sal_uInt8)( nNumb + '0' );
nDat -= ( nNumb * 10 );
- m_rOStm << (BYTE)( nDat + '0' );
+ m_rOStm << (sal_uInt8)( nDat + '0' );
nCount -= 3;
}
else
{
- m_rOStm << (BYTE)( nDat + '0' );
+ m_rOStm << (sal_uInt8)( nDat + '0' );
nCount -= 2;
}
}
- m_rOStm << (BYTE)' ';
+ m_rOStm << (sal_uInt8)' ';
}
- m_rOStm << (BYTE)10;
+ m_rOStm << (sal_uInt8)10;
}
}
}
@@ -231,7 +228,7 @@ void PGMWriter::ImplWriteNumber( sal_Int32 nNumber )
// - exported function -
// ---------------------
-extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool )
{
PGMWriter aPGMWriter(rStream);
@@ -240,57 +237,5 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGrap
// ------------------------------------------------------------------------
-extern "C" BOOL __LOADONCALLAPI DoExportDialog( FltCallDialogParameter& rPara )
-{
- BOOL bRet = FALSE;
-
- if ( rPara.pWindow )
- {
- ByteString aResMgrName( "epg" );
- ResMgr* pResMgr;
-
- pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
-
- if( pResMgr )
- {
- rPara.pResMgr = pResMgr;
- bRet = ( DlgExportEPGM( rPara ).Execute() == RET_OK );
- delete pResMgr;
- }
- else
- bRet = TRUE;
- }
-
- return bRet;
-}
-
-// ------------------------------------------------------------------------
-
-// ---------------
-// - Win16 trash -
-// ---------------
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0;
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
- if ( nHeap )
- UnlockData( 0 );
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-// ------------------------------------------------------------------------
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/filter/source/graphicfilter/epgm/exports.map b/filter/source/graphicfilter/epgm/exports.map
index 61e4682c6551..d4e28c44700c 100644
--- a/filter/source/graphicfilter/epgm/exports.map
+++ b/filter/source/graphicfilter/epgm/exports.map
@@ -1,7 +1,6 @@
UDK_3_0_0 {
global:
GraphicExport;
- DoExportDialog;
local:
*;
diff --git a/filter/source/graphicfilter/epgm/makefile.mk b/filter/source/graphicfilter/epgm/makefile.mk
index edfd9b448724..99a15d0318c7 100644
--- a/filter/source/graphicfilter/epgm/makefile.mk
+++ b/filter/source/graphicfilter/epgm/makefile.mk
@@ -43,20 +43,14 @@ DEPTARGET=vepgm
CDEFS+= -DEDITDEBUG
.ENDIF
-SRS1NAME=$(TARGET)
-SRC1FILES= dlgepgm.src \
- epgmstr.src
.IF "$(L10N_framework)"==""
SLOFILES = \
$(EXCEPTIONSFILES)
EXCEPTIONSFILES = \
- $(SLO)$/epgm.obj \
- $(SLO)$/dlgepgm.obj
+ $(SLO)$/epgm.obj
.ENDIF
# ==========================================================================
-RESLIB1NAME=$(TARGET2)
-RESLIB1SRSFILES=$(SRS)$/$(TARGET).srs
.IF "$(L10N_framework)"==""
SHL1TARGET= epg$(DLLPOSTFIX)
SHL1IMPLIB= epgm
diff --git a/filter/source/graphicfilter/epgm/strings.hrc b/filter/source/graphicfilter/epgm/strings.hrc
deleted file mode 100644
index 122719e87d4b..000000000000
--- a/filter/source/graphicfilter/epgm/strings.hrc
+++ /dev/null
@@ -1,27 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-#define KEY_FORMAT 256
diff --git a/filter/source/graphicfilter/epict/dlgepct.cxx b/filter/source/graphicfilter/epict/dlgepct.cxx
deleted file mode 100644
index ddeffc2c4e93..000000000000
--- a/filter/source/graphicfilter/epict/dlgepct.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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_filter.hxx"
-
-#include <vcl/msgbox.hxx>
-#include <svtools/FilterConfigItem.hxx>
-#include <com/sun/star/awt/Size.hpp>
-#include "dlgepct.hxx"
-#include "dlgepct.hrc"
-#include "strings.hrc"
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportEPCT::DlgExportEPCT( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPCT, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
- aRbOriginal ( this, ResId( RB_ORIGINAL, *rPara.pResMgr ) ),
- aRbSize ( this, ResId( RB_SIZE, *rPara.pResMgr ) ),
- aGrpMode ( this, ResId( GRP_MODE, *rPara.pResMgr ) ),
- aFtSizeX ( this, ResId( FT_SIZEX, *rPara.pResMgr ) ),
- aMtfSizeX ( this, ResId( MTF_SIZEX, *rPara.pResMgr ) ),
- aFtSizeY ( this, ResId( FT_SIZEY, *rPara.pResMgr ) ),
- aMtfSizeY ( this, ResId( MTF_SIZEY, *rPara.pResMgr ) ),
- aGrpSize ( this, ResId( GRP_SIZE, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr )
-{
- FreeResource();
-
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PCT" ) );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportEPCT, OK ) );
- aRbOriginal.SetClickHdl( LINK( this, DlgExportEPCT, ClickRbOriginal ) );
- aRbSize.SetClickHdl( LINK( this, DlgExportEPCT, ClickRbSize ) );
-
- // Config-Parameter lesen
- sal_Int32 nStrMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, *pMgr ) ), 0 );
- ::com::sun::star::awt::Size aDefault( 10000, 10000 );
- ::com::sun::star::awt::Size aSize;
- aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, *pMgr ) ), aDefault );
-
- aMtfSizeX.SetDefaultUnit( FUNIT_MM );
- aMtfSizeY.SetDefaultUnit( FUNIT_MM );
- aMtfSizeX.SetValue( aSize.Width );
- aMtfSizeY.SetValue( aSize.Height );
-
- switch ( rPara.eFieldUnit )
- {
- case FUNIT_NONE :
- case FUNIT_KM :
- case FUNIT_PERCENT :
- case FUNIT_CUSTOM :
- case FUNIT_MILE :
- case FUNIT_FOOT :
- case FUNIT_M :
- case FUNIT_CHAR :
- case FUNIT_LINE :
- break; // -Wall not handled.
- case FUNIT_MM :
- case FUNIT_CM :
- case FUNIT_TWIP :
- case FUNIT_POINT :
- case FUNIT_PICA :
- case FUNIT_INCH :
- case FUNIT_100TH_MM :
- {
- aMtfSizeX.SetUnit( rPara.eFieldUnit );
- aMtfSizeY.SetUnit( rPara.eFieldUnit );
- }
- break;
- }
- if ( nStrMode == 1 )
- {
- aRbSize.Check( TRUE );
- ClickRbSize( NULL );
- }
- else
- {
- aRbOriginal.Check( TRUE );
- ClickRbOriginal( NULL );
- }
-}
-
-DlgExportEPCT::~DlgExportEPCT()
-{
- delete pConfigItem;
-}
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\**************************************** ********************************/
-
-IMPL_LINK( DlgExportEPCT, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
- ::com::sun::star::awt::Size aSize(
- (sal_Int32)MetricField::ConvertDoubleValue( aMtfSizeX.GetValue(), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM ),
- (sal_Int32)MetricField::ConvertDoubleValue( aMtfSizeY.GetValue(), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM ) );
-
- sal_Int32 nStrMode = 0;
- if ( aRbSize.IsChecked() )
- nStrMode++;
-
- pConfigItem->WriteInt32( String( ResId( KEY_MODE, *pMgr ) ), nStrMode );
- pConfigItem->WriteSize( String( ResId( KEY_SIZE, *pMgr ) ), aSize );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEPCT, ClickRbOriginal, void*, EMPTYARG )
-{
- aGrpSize.Disable();
- aFtSizeX.Disable();
- aMtfSizeX.Disable();
- aFtSizeY.Disable();
- aMtfSizeY.Disable();
-
- return 0;
-}
-
-
-/*************************************************************************
-|*
-|* Enabled/Disabled Controls
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEPCT, ClickRbSize, void*, EMPTYARG )
-{
- aGrpSize.Enable();
- aFtSizeX.Enable();
- aMtfSizeX.Enable();
- aFtSizeY.Enable();
- aMtfSizeY.Enable();
-
- return 0;
-}
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/epict/dlgepct.hrc b/filter/source/graphicfilter/epict/dlgepct.hrc
deleted file mode 100644
index 0f92aa9bda3c..000000000000
--- a/filter/source/graphicfilter/epict/dlgepct.hrc
+++ /dev/null
@@ -1,41 +0,0 @@
-/*************************************************************************
- *
- * 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 <filter.hrc>
-
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define CBX_SIZE 2
-#define MTF_SIZEX 1
-#define MTF_SIZEY 2
-#define FT_SIZEX 1
-#define FT_SIZEY 2
-#define GRP_SIZE 1
-#define GRP_MODE 2
-#define RB_ORIGINAL 1
-#define RB_SIZE 2
-
diff --git a/filter/source/graphicfilter/epict/dlgepct.hxx b/filter/source/graphicfilter/epict/dlgepct.hxx
deleted file mode 100644
index 462b42f5ca87..000000000000
--- a/filter/source/graphicfilter/epict/dlgepct.hxx
+++ /dev/null
@@ -1,82 +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 _DLGEPCT_HXX_
-#define _DLGEPCT_HXX_
-
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <svtools/fltcall.hxx>
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen bei Vektorformaten
-|*
-\************************************************************************/
-
-class FilterConfigItem;
-class ResMgr;
-
-class DlgExportEPCT : public ModalDialog
-{
-private:
-
- FltCallDialogParameter& rFltCallPara;
-
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
-
- RadioButton aRbOriginal;
- RadioButton aRbSize;
- FixedLine aGrpMode;
-
- FixedText aFtSizeX;
- MetricField aMtfSizeX;
- FixedText aFtSizeY;
- MetricField aMtfSizeY;
- FixedLine aGrpSize;
-
- FilterConfigItem* pConfigItem;
- ResMgr* pMgr;
-
- DECL_LINK( OK, void* p );
- DECL_LINK( ClickRbOriginal,void* p );
- DECL_LINK( ClickRbSize,void* p );
-
-public:
- DlgExportEPCT( FltCallDialogParameter& rPara );
- ~DlgExportEPCT();
-};
-
-#endif // _DLGEPCT_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/epict/dlgepct.src b/filter/source/graphicfilter/epict/dlgepct.src
deleted file mode 100644
index d503c53cf89c..000000000000
--- a/filter/source/graphicfilter/epict/dlgepct.src
+++ /dev/null
@@ -1,163 +0,0 @@
-/*************************************************************************
- *
- * 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 "dlgepct.hrc"
-
-ModalDialog DLG_EXPORT_EPCT
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 178 , 89 ) ;
- Text [ en-US ] = "PICT Options" ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- MetricField MTF_SIZEX
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 55 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- MetricField MTF_SIZEY
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 60 , 71 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- TabStop = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 100 ;
- Maximum = 99999 ;
- StrictFormat = TRUE ;
- DecimalDigits = 2 ;
- Unit = FUNIT_MM ;
- First = 100 ;
- Last = 99999 ;
- SpinSize = 100 ;
- };
- FixedLine GRP_SIZE
- {
- Pos = MAP_APPFONT ( 6 , 44 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Size" ;
- };
- FixedText FT_SIZEX
- {
- Pos = MAP_APPFONT ( 12 , 57 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Width" ;
- };
- FixedText FT_SIZEY
- {
- Pos = MAP_APPFONT ( 12 , 73 ) ;
- Size = MAP_APPFONT ( 45 , 8 ) ;
- Text [ en-US ] = "Height" ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 122 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 122 , 24 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 122 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- RadioButton RB_ORIGINAL
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Original" ;
- };
- RadioButton RB_SIZE
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 98 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Size" ;
- };
- FixedLine GRP_MODE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 110 , 8 ) ;
- Text [ en-US ] = "Mode" ;
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/filter/source/graphicfilter/epict/epict.cxx b/filter/source/graphicfilter/epict/epict.cxx
index 14340d3fa34a..53da35e677f7 100644
--- a/filter/source/graphicfilter/epict/epict.cxx
+++ b/filter/source/graphicfilter/epict/epict.cxx
@@ -49,9 +49,6 @@
#include <vcl/gdimtf.hxx>
#include <tools/bigint.hxx>
-#include "strings.hrc"
-#include "dlgepct.hrc"
-#include "dlgepct.hxx"
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
@@ -82,8 +79,8 @@ class PictWriter {
private:
- BOOL bStatus;
- ULONG nLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde.
+ sal_Bool bStatus;
+ sal_uLong nLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde.
com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;
SvStream * pPict;
@@ -99,29 +96,29 @@ private:
PictWriterAttrStackMember * pAttrStack;
// Aktuelle Attribute im Ziel-Metafile, und ob sie gueltig sind
- BOOL bDstBkPatVisible; BOOL bDstBkPatValid;
- BYTE nDstTxFace; BOOL bDstTxFaceValid;
- RasterOp eDstTxMode; BOOL bDstTxModeValid;
- USHORT nDstPnSize; BOOL bDstPnSizeValid;
- RasterOp eDstPnMode; BOOL bDstPnModeValid;
- PictPattern aDstPnPat; BOOL bDstPnPatValid;
- BOOL bDstFillPatVisible; BOOL bDstFillPatValid;
- USHORT nDstTxSize; BOOL bDstTxSizeValid;
- Color aDstFgCol; BOOL bDstFgColValid;
- Color aDstBkCol; BOOL bDstBkColValid;
- Point aDstPenPosition; BOOL bDstPenPositionValid;
- Point aDstTextPosition; BOOL bDstTextPositionValid;
- String aDstFontName; USHORT nDstFontNameId; BOOL bDstFontNameValid;
-
- ULONG nNumberOfActions; // Anzahl der Actions im GDIMetafile
- ULONG nNumberOfBitmaps; // Anzahl der Bitmaps
- ULONG nWrittenActions; // Anzahl der bereits verarbeiteten Actions beim Schreiben der Opcodes
- ULONG nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps
- ULONG nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist.
+ sal_Bool bDstBkPatVisible; sal_Bool bDstBkPatValid;
+ sal_uInt8 nDstTxFace; sal_Bool bDstTxFaceValid;
+ RasterOp eDstTxMode; sal_Bool bDstTxModeValid;
+ sal_uInt16 nDstPnSize; sal_Bool bDstPnSizeValid;
+ RasterOp eDstPnMode; sal_Bool bDstPnModeValid;
+ PictPattern aDstPnPat; sal_Bool bDstPnPatValid;
+ sal_Bool bDstFillPatVisible; sal_Bool bDstFillPatValid;
+ sal_uInt16 nDstTxSize; sal_Bool bDstTxSizeValid;
+ Color aDstFgCol; sal_Bool bDstFgColValid;
+ Color aDstBkCol; sal_Bool bDstBkColValid;
+ Point aDstPenPosition; sal_Bool bDstPenPositionValid;
+ Point aDstTextPosition; sal_Bool bDstTextPositionValid;
+ String aDstFontName; sal_uInt16 nDstFontNameId; sal_Bool bDstFontNameValid;
+
+ sal_uLong nNumberOfActions; // Anzahl der Actions im GDIMetafile
+ sal_uLong nNumberOfBitmaps; // Anzahl der Bitmaps
+ sal_uLong nWrittenActions; // Anzahl der bereits verarbeiteten Actions beim Schreiben der Opcodes
+ sal_uLong nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps
+ sal_uLong nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist.
void MayCallback();
// Berechnet anhand der obigen 5 Parameter eine Prozentzahl
- // und macht dann ggf. einen Callback. Setzt bStatus auf FALSE wenn User abbrechen
+ // und macht dann ggf. einen Callback. Setzt bStatus auf sal_False wenn User abbrechen
// moechte.
void CountActionsAndBitmaps(const GDIMetaFile & rMTF);
@@ -140,22 +137,22 @@ private:
void WritePolygon(const Polygon & rPoly);
void WriteArcAngles(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt);
- void ConvertLinePattern(PictPattern & rPat, BOOL bVisible);
- void ConvertFillPattern(PictPattern & rPat, BOOL bVisible);
+ void ConvertLinePattern(PictPattern & rPat, sal_Bool bVisible);
+ void ConvertFillPattern(PictPattern & rPat, sal_Bool bVisible);
void WriteOpcode_TxFace(const Font & rFont);
void WriteOpcode_TxMode(RasterOp eMode);
- void WriteOpcode_PnSize(USHORT nSize);
+ void WriteOpcode_PnSize(sal_uInt16 nSize);
void WriteOpcode_PnMode(RasterOp eMode);
- void WriteOpcode_PnLinePat(BOOL bVisible);
- void WriteOpcode_PnFillPat(BOOL bVisible);
+ void WriteOpcode_PnLinePat(sal_Bool bVisible);
+ void WriteOpcode_PnFillPat(sal_Bool bVisible);
void WriteOpcode_OvSize(const Size & rSize);
- void WriteOpcode_TxSize(USHORT nSize);
+ void WriteOpcode_TxSize(sal_uInt16 nSize);
void WriteOpcode_RGBFgCol(const Color & rColor);
void WriteOpcode_RGBBkCol(const Color & rColor);
void WriteOpcode_Line(const Point & rLocPt, const Point & rNewPt);
void WriteOpcode_LineFrom(const Point & rNewPt);
- void WriteOpcode_Text(const Point & rPoint, const String& rString, BOOL bDelta);
+ void WriteOpcode_Text(const Point & rPoint, const String& rString, sal_Bool bDelta);
void WriteOpcode_FontName(const Font & rFont);
void WriteOpcode_ClipRect( const Rectangle& rRect );
void WriteOpcode_Rect(PictDrawingMethod eMethod, const Rectangle & rRect);
@@ -186,7 +183,7 @@ private:
public:
- BOOL WritePict( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem );
+ sal_Bool WritePict( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem );
};
@@ -197,7 +194,7 @@ void PictWriter::MayCallback()
{
if ( xStatusIndicator.is() )
{
- ULONG nPercent;
+ sal_uLong nPercent;
nPercent=((nWrittenBitmaps<<14)+(nActBitmapPercent<<14)/100+nWrittenActions)
*100
/((nNumberOfBitmaps<<14)+nNumberOfActions);
@@ -213,7 +210,7 @@ void PictWriter::MayCallback()
void PictWriter::CountActionsAndBitmaps(const GDIMetaFile & rMTF)
{
- ULONG nAction, nActionCount;
+ sal_uLong nAction, nActionCount;
const MetaAction* pMA;
nActionCount = rMTF.GetActionCount();
@@ -241,7 +238,7 @@ void PictWriter::CountActionsAndBitmaps(const GDIMetaFile & rMTF)
Polygon PictWriter::PolyPolygonToPolygon(const PolyPolygon & rPolyPoly)
{
- USHORT nCount,nSize1,nSize2,np,i1,i2,i3,nBestIdx1,nBestIdx2;
+ sal_uInt16 nCount,nSize1,nSize2,np,i1,i2,i3,nBestIdx1,nBestIdx2;
long nDistSqr,nBestDistSqr, nCountdownTests;
Point aP1,aPRel;
Polygon aPoly1, aPoly2, aPoly3;
@@ -320,9 +317,9 @@ void PictWriter::WriteSize(const Size & rSize)
void PictWriter::WriteRGBColor(const Color & rColor)
{
- const UINT16 nR = ( (UINT16) rColor.GetRed() << 8 ) | (UINT16) rColor.GetRed();
- const UINT16 nG = ( (UINT16) rColor.GetGreen() << 8 ) | (UINT16) rColor.GetGreen();
- const UINT16 nB = ( (UINT16) rColor.GetBlue() << 8 ) | (UINT16) rColor.GetBlue();
+ const sal_uInt16 nR = ( (sal_uInt16) rColor.GetRed() << 8 ) | (sal_uInt16) rColor.GetRed();
+ const sal_uInt16 nG = ( (sal_uInt16) rColor.GetGreen() << 8 ) | (sal_uInt16) rColor.GetGreen();
+ const sal_uInt16 nB = ( (sal_uInt16) rColor.GetBlue() << 8 ) | (sal_uInt16) rColor.GetBlue();
*pPict << nR << nG << nB;
}
@@ -330,13 +327,13 @@ void PictWriter::WriteRGBColor(const Color & rColor)
void PictWriter::WriteString( const String & rString )
{
- USHORT i,nLen;
+ sal_uInt16 i,nLen;
ByteString aByteString( rString, gsl_getSystemTextEncoding() );
nLen = aByteString.Len();
if ( nLen > 255 )
nLen = 255;
- *pPict << ( (BYTE)nLen );
+ *pPict << ( (sal_uInt8)nLen );
for ( i = 0; i < nLen; i++ )
*pPict << aByteString.GetChar( i );
}
@@ -361,7 +358,7 @@ void PictWriter::WriteRectangle(const Rectangle & rRect)
void PictWriter::WritePolygon(const Polygon & rPoly)
{
- USHORT nDataSize,i,nSize;
+ sal_uInt16 nDataSize,i,nSize;
short nMinX = 0, nMinY = 0, nMaxX = 0, nMaxY = 0;
short nx,ny;
Polygon aPoly(rPoly);
@@ -444,7 +441,7 @@ void PictWriter::WriteArcAngles(const Rectangle & rRect, const Point & rStartPt,
}
-void PictWriter::ConvertLinePattern(PictPattern & rPat, BOOL bVisible)
+void PictWriter::ConvertLinePattern(PictPattern & rPat, sal_Bool bVisible)
{
if( bVisible )
{
@@ -458,7 +455,7 @@ void PictWriter::ConvertLinePattern(PictPattern & rPat, BOOL bVisible)
}
}
-void PictWriter::ConvertFillPattern(PictPattern & rPat, BOOL bVisible)
+void PictWriter::ConvertFillPattern(PictPattern & rPat, sal_Bool bVisible)
{
if( bVisible )
{
@@ -475,7 +472,7 @@ void PictWriter::ConvertFillPattern(PictPattern & rPat, BOOL bVisible)
void PictWriter::WriteOpcode_TxFace(const Font & rFont)
{
- BYTE nFace;
+ sal_uInt8 nFace;
FontWeight eWeight;
nFace=0;
@@ -486,127 +483,127 @@ void PictWriter::WriteOpcode_TxFace(const Font & rFont)
eWeight==WEIGHT_BLACK) nFace|=0x01;
if (rFont.GetItalic()!=ITALIC_NONE) nFace|=0x02;
if (rFont.GetUnderline()!=UNDERLINE_NONE) nFace|=0x04;
- if (rFont.IsOutline()==TRUE) nFace|=0x08;
- if (rFont.IsShadow()==TRUE) nFace|=0x10;
+ if (rFont.IsOutline()==sal_True) nFace|=0x08;
+ if (rFont.IsShadow()==sal_True) nFace|=0x10;
- if (bDstTxFaceValid==FALSE || nDstTxFace!=nFace) {
- *pPict << (USHORT)0x0004 << nFace << (BYTE)0;
+ if (bDstTxFaceValid==sal_False || nDstTxFace!=nFace) {
+ *pPict << (sal_uInt16)0x0004 << nFace << (sal_uInt8)0;
nDstTxFace=nFace;
- bDstTxFaceValid=TRUE;
+ bDstTxFaceValid=sal_True;
}
}
void PictWriter::WriteOpcode_TxMode(RasterOp eMode)
{
- USHORT nVal;
+ sal_uInt16 nVal;
- if (bDstTxModeValid==FALSE || eDstTxMode!=eMode) {
+ if (bDstTxModeValid==sal_False || eDstTxMode!=eMode) {
switch (eMode) {
case ROP_INVERT: nVal=0x000c; break;
case ROP_XOR: nVal=0x000a; break;
default: nVal=0x0008;
}
- *pPict << (USHORT)0x0005 << nVal;
+ *pPict << (sal_uInt16)0x0005 << nVal;
eDstTxMode=eMode;
- bDstTxModeValid=TRUE;
+ bDstTxModeValid=sal_True;
}
}
-void PictWriter::WriteOpcode_PnSize(USHORT nSize)
+void PictWriter::WriteOpcode_PnSize(sal_uInt16 nSize)
{
if (nSize==0) nSize=1;
- if (bDstPnSizeValid==FALSE || nDstPnSize!=nSize) {
- *pPict << (USHORT)0x0007 << nSize << nSize;
+ if (bDstPnSizeValid==sal_False || nDstPnSize!=nSize) {
+ *pPict << (sal_uInt16)0x0007 << nSize << nSize;
nDstPnSize=nSize;
- bDstPnSizeValid=TRUE;
+ bDstPnSizeValid=sal_True;
}
}
void PictWriter::WriteOpcode_PnMode(RasterOp eMode)
{
- USHORT nVal;
+ sal_uInt16 nVal;
- if (bDstPnModeValid==FALSE || eDstPnMode!=eMode) {
+ if (bDstPnModeValid==sal_False || eDstPnMode!=eMode) {
switch (eMode)
{
case ROP_INVERT: nVal=0x000c; break;
case ROP_XOR: nVal=0x000a; break;
default: nVal=0x0008;
}
- *pPict << (USHORT)0x0008 << nVal;
+ *pPict << (sal_uInt16)0x0008 << nVal;
eDstPnMode=eMode;
- bDstPnModeValid=TRUE;
+ bDstPnModeValid=sal_True;
}
}
-void PictWriter::WriteOpcode_PnLinePat(BOOL bVisible)
+void PictWriter::WriteOpcode_PnLinePat(sal_Bool bVisible)
{
PictPattern aPat;
ConvertLinePattern(aPat,bVisible);
- if (bDstPnPatValid==FALSE || aDstPnPat.nHi!=aPat.nHi || aDstPnPat.nLo!=aPat.nLo) {
- *pPict << (USHORT)0x0009 << aPat.nHi << aPat.nLo;
+ if (bDstPnPatValid==sal_False || aDstPnPat.nHi!=aPat.nHi || aDstPnPat.nLo!=aPat.nLo) {
+ *pPict << (sal_uInt16)0x0009 << aPat.nHi << aPat.nLo;
aDstPnPat=aPat;
- bDstPnPatValid=TRUE;
+ bDstPnPatValid=sal_True;
}
}
-void PictWriter::WriteOpcode_PnFillPat(BOOL bVisible)
+void PictWriter::WriteOpcode_PnFillPat(sal_Bool bVisible)
{
PictPattern aPat;
ConvertFillPattern(aPat,bVisible);
- if (bDstPnPatValid==FALSE || aDstPnPat.nHi!=aPat.nHi || aDstPnPat.nLo!=aPat.nLo) {
- *pPict << (USHORT)0x0009 << aPat.nHi << aPat.nLo;
+ if (bDstPnPatValid==sal_False || aDstPnPat.nHi!=aPat.nHi || aDstPnPat.nLo!=aPat.nLo) {
+ *pPict << (sal_uInt16)0x0009 << aPat.nHi << aPat.nLo;
aDstPnPat=aPat;
- bDstPnPatValid=TRUE;
+ bDstPnPatValid=sal_True;
}
}
void PictWriter::WriteOpcode_OvSize(const Size & rSize)
{
- *pPict << (USHORT)0x000b;
+ *pPict << (sal_uInt16)0x000b;
WriteSize(rSize);
}
-void PictWriter::WriteOpcode_TxSize(USHORT nSize)
+void PictWriter::WriteOpcode_TxSize(sal_uInt16 nSize)
{
- if (bDstTxSizeValid==FALSE || nDstTxSize!=nSize) {
+ if (bDstTxSizeValid==sal_False || nDstTxSize!=nSize) {
- nDstTxSize = (USHORT) OutputDevice::LogicToLogic( Size( 0, nSize ),
+ nDstTxSize = (sal_uInt16) OutputDevice::LogicToLogic( Size( 0, nSize ),
aSrcMapMode, aTargetMapMode ).Height();
- *pPict << (USHORT)0x000d << nDstTxSize;
- bDstTxSizeValid=TRUE;
+ *pPict << (sal_uInt16)0x000d << nDstTxSize;
+ bDstTxSizeValid=sal_True;
}
}
void PictWriter::WriteOpcode_RGBFgCol(const Color & rColor)
{
- if (bDstFgColValid==FALSE || aDstFgCol!=rColor) {
- *pPict << (USHORT)0x001a;
+ if (bDstFgColValid==sal_False || aDstFgCol!=rColor) {
+ *pPict << (sal_uInt16)0x001a;
WriteRGBColor(rColor);
aDstFgCol=rColor;
- bDstFgColValid=TRUE;
+ bDstFgColValid=sal_True;
}
}
void PictWriter::WriteOpcode_RGBBkCol(const Color & rColor)
{
- if (bDstBkColValid==FALSE || aDstBkCol!=rColor) {
- *pPict << (USHORT)0x001b;
+ if (bDstBkColValid==sal_False || aDstBkCol!=rColor) {
+ *pPict << (sal_uInt16)0x001b;
WriteRGBColor(rColor);
aDstBkCol=rColor;
- bDstBkColValid=TRUE;
+ bDstBkColValid=sal_True;
}
}
@@ -625,18 +622,18 @@ void PictWriter::WriteOpcode_Line(const Point & rLocPt, const Point & rNewPt)
dv=aNewPt.Y()-aLocPt.Y();
if (dh<=127 && dh>=-128 && dv<=127 && dv>=-128)
{ // ShortLine
- *pPict << (USHORT)0x0022;
+ *pPict << (sal_uInt16)0x0022;
WritePoint(rLocPt);
*pPict << (char)dh << (char)dv;
}
else
{
- *pPict << (USHORT)0x0020;
+ *pPict << (sal_uInt16)0x0020;
WritePoint(rLocPt);
WritePoint(rNewPt);
}
aDstPenPosition=rNewPt;
- bDstPenPositionValid=TRUE;
+ bDstPenPositionValid=sal_True;
}
@@ -652,61 +649,61 @@ void PictWriter::WriteOpcode_LineFrom(const Point & rNewPt)
if (dh<=127 && dh>=-128 && dv<=127 && dv>=-128)
{ // ShortLine
- *pPict << (USHORT)0x0023;
+ *pPict << (sal_uInt16)0x0023;
*pPict << (char)dh << (char)dv;
}
else
{
- *pPict << (USHORT)0x0021;
+ *pPict << (sal_uInt16)0x0021;
WritePoint(rNewPt);
}
aDstPenPosition=rNewPt;
- bDstPenPositionValid=TRUE;
+ bDstPenPositionValid=sal_True;
}
-void PictWriter::WriteOpcode_Text(const Point & rPoint, const String& rString, BOOL bDelta)
+void PictWriter::WriteOpcode_Text(const Point & rPoint, const String& rString, sal_Bool bDelta)
{
Point aPoint = OutputDevice::LogicToLogic( rPoint,
aSrcMapMode,
aTargetMapMode );
long dh,dv;
- ULONG nPos;
+ sal_uLong nPos;
nPos = pPict->Tell();
dh = aPoint.X()-aDstTextPosition.X();
dv = aPoint.Y()-aDstTextPosition.Y();
- if (bDstTextPositionValid==FALSE || dh<0 || dh>255 || dv<0 || dv>0 || bDelta==FALSE)
+ if (bDstTextPositionValid==sal_False || dh<0 || dh>255 || dv<0 || dv>0 || bDelta==sal_False)
{
- *pPict << (USHORT)0x0028;
+ *pPict << (sal_uInt16)0x0028;
WritePoint(rPoint);
}
else if (dv==0)
{
- *pPict << (USHORT)0x0029 << (BYTE)dh;
+ *pPict << (sal_uInt16)0x0029 << (sal_uInt8)dh;
}
else if (dh==0)
{
- *pPict << (USHORT)0x002a << (BYTE)dv;
+ *pPict << (sal_uInt16)0x002a << (sal_uInt8)dv;
}
else
{
- *pPict << (USHORT)0x002b << (BYTE)dh << (BYTE)dv;
+ *pPict << (sal_uInt16)0x002b << (sal_uInt8)dh << (sal_uInt8)dv;
}
WriteString( rString );
if (((pPict->Tell()-nPos)&1)!=0)
- *pPict << (BYTE)0;
+ *pPict << (sal_uInt8)0;
aDstTextPosition = aPoint;
- bDstTextPositionValid=TRUE;
+ bDstTextPositionValid=sal_True;
}
void PictWriter::WriteOpcode_FontName(const Font & rFont)
{
- USHORT nDataLen,nFontId;
+ sal_uInt16 nDataLen,nFontId;
switch (rFont.GetFamily()) {
case FAMILY_MODERN: nFontId=22; break;
@@ -715,22 +712,22 @@ void PictWriter::WriteOpcode_FontName(const Font & rFont)
default: nFontId=1;
}
- if (bDstFontNameValid==FALSE || nDstFontNameId!=nFontId || aDstFontName!=rFont.GetName())
+ if (bDstFontNameValid==sal_False || nDstFontNameId!=nFontId || aDstFontName!=rFont.GetName())
{
ByteString aByteString( rFont.GetName(), gsl_getSystemTextEncoding() );
sal_uInt16 nFontNameLen = aByteString.Len();
if ( nFontNameLen )
{
nDataLen = 3 + nFontNameLen;
- *pPict << (USHORT)0x002c << nDataLen << nFontId;
+ *pPict << (sal_uInt16)0x002c << nDataLen << nFontId;
WriteString( rFont.GetName() );
if ( ( nFontNameLen & 1 ) == 0 )
- *pPict << (BYTE)0;
+ *pPict << (sal_uInt8)0;
}
- *pPict << (USHORT)0x0003 << nFontId;
+ *pPict << (sal_uInt16)0x0003 << nFontId;
aDstFontName=rFont.GetName();
nDstFontNameId=nFontId;
- bDstFontNameValid=TRUE;
+ bDstFontNameValid=sal_True;
}
}
@@ -748,7 +745,7 @@ void PictWriter::WriteOpcode_ClipRect( const Rectangle& rRect )
void PictWriter::WriteOpcode_Rect(PictDrawingMethod eMethod, const Rectangle & rRect)
{
- USHORT oc;
+ sal_uInt16 oc;
switch (eMethod) {
case PDM_FRAME: oc=0x0030; break;
case PDM_PAINT: oc=0x0031; break;
@@ -764,7 +761,7 @@ void PictWriter::WriteOpcode_Rect(PictDrawingMethod eMethod, const Rectangle & r
void PictWriter::WriteOpcode_SameRect(PictDrawingMethod eMethod)
{
- USHORT oc;
+ sal_uInt16 oc;
switch (eMethod) {
case PDM_FRAME: oc=0x0038; break;
case PDM_PAINT: oc=0x0039; break;
@@ -779,7 +776,7 @@ void PictWriter::WriteOpcode_SameRect(PictDrawingMethod eMethod)
void PictWriter::WriteOpcode_RRect(PictDrawingMethod eMethod, const Rectangle & rRect)
{
- USHORT oc;
+ sal_uInt16 oc;
switch (eMethod) {
case PDM_FRAME: oc=0x0040; break;
case PDM_PAINT: oc=0x0041; break;
@@ -795,7 +792,7 @@ void PictWriter::WriteOpcode_RRect(PictDrawingMethod eMethod, const Rectangle &
void PictWriter::WriteOpcode_SameRRect(PictDrawingMethod eMethod)
{
- USHORT oc;
+ sal_uInt16 oc;
switch (eMethod) {
case PDM_FRAME: oc=0x0048; break;
case PDM_PAINT: oc=0x0049; break;
@@ -810,7 +807,7 @@ void PictWriter::WriteOpcode_SameRRect(PictDrawingMethod eMethod)
void PictWriter::WriteOpcode_Oval(PictDrawingMethod eMethod, const Rectangle & rRect)
{
- USHORT oc;
+ sal_uInt16 oc;
switch (eMethod) {
case PDM_FRAME: oc=0x0050; break;
case PDM_PAINT: oc=0x0051; break;
@@ -826,7 +823,7 @@ void PictWriter::WriteOpcode_Oval(PictDrawingMethod eMethod, const Rectangle & r
void PictWriter::WriteOpcode_SameOval(PictDrawingMethod eMethod)
{
- USHORT oc;
+ sal_uInt16 oc;
switch (eMethod) {
case PDM_FRAME: oc=0x0058; break;
case PDM_PAINT: oc=0x0059; break;
@@ -842,7 +839,7 @@ void PictWriter::WriteOpcode_SameOval(PictDrawingMethod eMethod)
void PictWriter::WriteOpcode_Arc(PictDrawingMethod eMethod, const Rectangle & rRect,
const Point & rStartPt, const Point & rEndPt)
{
- USHORT oc;
+ sal_uInt16 oc;
switch (eMethod) {
case PDM_FRAME: oc=0x0060; break;
case PDM_PAINT: oc=0x0061; break;
@@ -860,7 +857,7 @@ void PictWriter::WriteOpcode_Arc(PictDrawingMethod eMethod, const Rectangle & rR
void PictWriter::WriteOpcode_SameArc(PictDrawingMethod eMethod, const Rectangle & rRect,
const Point & rStartPt, const Point & rEndPt)
{
- USHORT oc;
+ sal_uInt16 oc;
switch (eMethod) {
case PDM_FRAME: oc=0x0068; break;
case PDM_PAINT: oc=0x0069; break;
@@ -876,7 +873,7 @@ void PictWriter::WriteOpcode_SameArc(PictDrawingMethod eMethod, const Rectangle
void PictWriter::WriteOpcode_Poly(PictDrawingMethod eMethod, const Polygon & rPoly)
{
- USHORT oc;
+ sal_uInt16 oc;
if (rPoly.GetSize()<3) return;
switch (eMethod) {
@@ -897,12 +894,12 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
BitmapReadAccess* pAcc = NULL;
Bitmap aBitmap( rBitmap );
- ULONG nWidth, nHeight, nDstRowBytes, nx, nc, ny, nCount, nColTabSize, i;
- ULONG nDstRowPos, nSrcRowBytes, nEqu3, nPos, nDstMapPos;
- USHORT nBitsPerPixel, nPackType;
- BYTE *pComp[4], *pPix, *pTemp;
- BYTE nEquData = 0;
- BYTE nFlagCounterByte, nRed, nGreen, nBlue;
+ sal_uLong nWidth, nHeight, nDstRowBytes, nx, nc, ny, nCount, nColTabSize, i;
+ sal_uLong nDstRowPos, nSrcRowBytes, nEqu3, nPos, nDstMapPos;
+ sal_uInt16 nBitsPerPixel, nPackType;
+ sal_uInt8 *pComp[4], *pPix, *pTemp;
+ sal_uInt8 nEquData = 0;
+ sal_uInt8 nFlagCounterByte, nRed, nGreen, nBlue;
SetAttrForPaint();
@@ -910,7 +907,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
nActBitmapPercent=30;
MayCallback();
- if ( bStatus == FALSE )
+ if ( bStatus == sal_False )
return;
if ( ( pAcc = aBitmap.AcquireReadAccess() ) == NULL )
return;
@@ -933,7 +930,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
nDstRowBytes = nWidth * 4;
// Opcode und BaseAddr (?) schreiben:
- *pPict << (USHORT)0x009a << (sal_uInt32)0x000000ff;
+ *pPict << (sal_uInt16)0x009a << (sal_uInt32)0x000000ff;
// Normalerweise wollen wir den Packing-Type 4 (Run length encoding
// for 32-Bit Pixels) erzeugen. Wenn aber RowBytes<8 gilt, sind die Daten
@@ -947,36 +944,36 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
nPackType = 4;
// PixMap-Struktur schreiben:
- *pPict << (USHORT)(nDstRowBytes|0x8000) // Bytes pro Zeile und dass es eine 'PixMap' ist
- << (USHORT)0x0000 // Y1-Position der Bitmap in der Quelle
- << (USHORT)0x0000 // X1-Position der Bitmap in der Quelle
- << (USHORT)nHeight // Y2-Position der Bitmap in der Quelle
- << (USHORT)nWidth // X2-Position der Bitmap in der Quelle
- << (USHORT)0x0000 // Version
- << (USHORT)nPackType // Packing type
+ *pPict << (sal_uInt16)(nDstRowBytes|0x8000) // Bytes pro Zeile und dass es eine 'PixMap' ist
+ << (sal_uInt16)0x0000 // Y1-Position der Bitmap in der Quelle
+ << (sal_uInt16)0x0000 // X1-Position der Bitmap in der Quelle
+ << (sal_uInt16)nHeight // Y2-Position der Bitmap in der Quelle
+ << (sal_uInt16)nWidth // X2-Position der Bitmap in der Quelle
+ << (sal_uInt16)0x0000 // Version
+ << (sal_uInt16)nPackType // Packing type
<< (sal_uInt32) 0x00000000 // Packing size (?)
<< (sal_uInt32) 0x00480000 // H-Res
<< (sal_uInt32) 0x00480000 // V-Res
- << (USHORT)0x0010 // Pixel type (?)
- << (USHORT)0x0020 // Pixel size: 32 bit
- << (USHORT)0x0004 // CmpCount: 4 Komponenten
- << (USHORT)0x0008 // CmpSize: 8 Bits
+ << (sal_uInt16)0x0010 // Pixel type (?)
+ << (sal_uInt16)0x0020 // Pixel size: 32 bit
+ << (sal_uInt16)0x0004 // CmpCount: 4 Komponenten
+ << (sal_uInt16)0x0008 // CmpSize: 8 Bits
<< (sal_uInt32) 0x00000000 // PlaneBytes (?)
<< (sal_uInt32) 0x00000000 // (?)
<< (sal_uInt32) 0x00000000; // (?)
// Source-Rectangle schreiben:
- *pPict << (USHORT)0x0000 // Y1-Position auf der Bitmap
- << (USHORT)0x0000 // X1-Position auf der Bitmap
- << (USHORT)nHeight // Y2-Position auf der Bitmap
- << (USHORT)nWidth; // X2-Position auf der Bitmap
+ *pPict << (sal_uInt16)0x0000 // Y1-Position auf der Bitmap
+ << (sal_uInt16)0x0000 // X1-Position auf der Bitmap
+ << (sal_uInt16)nHeight // Y2-Position auf der Bitmap
+ << (sal_uInt16)nWidth; // X2-Position auf der Bitmap
// Destination-Rectangle schreiben:
WritePoint( rPoint );
WritePoint( Point( rPoint.X() + rSize.Width(), rPoint.Y() + rSize.Height() ) );
// Transfer mode schreiben:
- *pPict << (USHORT)0x0000; // (?)
+ *pPict << (sal_uInt16)0x0000; // (?)
// Position der Map-Daten in Ziel merken:
nDstMapPos=pPict->Tell();
@@ -985,10 +982,10 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
{ // nicht packen
for ( ny = 0; ny < nHeight; ny++ )
{
- *pPict << (BYTE)0;
- *pPict << (BYTE)pAcc->GetPixel( ny, 0 ).GetRed();
- *pPict << (BYTE)pAcc->GetPixel( ny, 0 ).GetGreen();
- *pPict << (BYTE)pAcc->GetPixel( ny, 0 ).GetBlue();
+ *pPict << (sal_uInt8)0;
+ *pPict << (sal_uInt8)pAcc->GetPixel( ny, 0 ).GetRed();
+ *pPict << (sal_uInt8)pAcc->GetPixel( ny, 0 ).GetGreen();
+ *pPict << (sal_uInt8)pAcc->GetPixel( ny, 0 ).GetBlue();
// Prozente zaehlen, Callback, Fehler pruefen:
nActBitmapPercent = ( ny * 70 / nHeight ) + 30; // (30% machten schon das Schreiben der Win-BMP-Datei aus)
MayCallback();
@@ -998,7 +995,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
{
// Speicher fuer Zeilen-Zwischen-Datenstruktur allozieren:
for ( nc = 0; nc < 4; nc++ )
- pComp[ nc ] = new BYTE[ nWidth ];
+ pComp[ nc ] = new sal_uInt8[ nWidth ];
// Schleife ueber Zeilen:
for ( ny = 0; ny < nHeight; ny++ )
@@ -1007,9 +1004,9 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
for ( nx = 0; nx < nWidth; nx++ )
{
- pComp[ 1 ][ nx ] = (BYTE)pAcc->GetPixel( ny, nx ) .GetRed();
- pComp[ 2 ][ nx ] = (BYTE)pAcc->GetPixel( ny, nx ) .GetGreen();
- pComp[ 3 ][ nx ] = (BYTE)pAcc->GetPixel( ny, nx ) .GetBlue();
+ pComp[ 1 ][ nx ] = (sal_uInt8)pAcc->GetPixel( ny, nx ) .GetRed();
+ pComp[ 2 ][ nx ] = (sal_uInt8)pAcc->GetPixel( ny, nx ) .GetGreen();
+ pComp[ 3 ][ nx ] = (sal_uInt8)pAcc->GetPixel( ny, nx ) .GetBlue();
pComp[ 0 ][ nx ] = 0;
}
@@ -1018,9 +1015,9 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
// ByteCount (das ist die Groesse der gepackten Zeile) zunaechst 0 (wird spaeter berichtigt):
if ( nDstRowBytes > 250 )
- *pPict << (USHORT)0;
+ *pPict << (sal_uInt16)0;
else
- *pPict << (BYTE)0;
+ *pPict << (sal_uInt8)0;
// Schleife ueber Componenten:
for ( nc = 0; nc < 4; nc++ )
@@ -1052,7 +1049,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
nCount = nEqu3 - nx;
if ( nCount > 128 )
nCount=128;
- nFlagCounterByte = (BYTE)(nCount-1);
+ nFlagCounterByte = (sal_uInt8)(nCount-1);
*pPict << nFlagCounterByte;
do
{
@@ -1075,7 +1072,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
nCount++;
}
// nCount gleiche Bytes komprimiert schreiben:
- nFlagCounterByte = (BYTE)( 1 - (long)nCount );
+ nFlagCounterByte = (sal_uInt8)( 1 - (long)nCount );
*pPict << nFlagCounterByte << nEquData;
nx += nCount;
}
@@ -1085,9 +1082,9 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
nPos = pPict->Tell();
pPict->Seek( nDstRowPos );
if ( nDstRowBytes > 250 )
- *pPict << ( (USHORT)( nPos - nDstRowPos - 2 ) );
+ *pPict << ( (sal_uInt16)( nPos - nDstRowPos - 2 ) );
else
- *pPict << ( (BYTE)( nPos - nDstRowPos - 1 ) );
+ *pPict << ( (sal_uInt8)( nPos - nDstRowPos - 1 ) );
pPict->Seek( nPos );
// Prozente zaehlen, Callback, Fehler pruefen:
@@ -1120,7 +1117,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
nSrcRowBytes = ( nDstRowBytes + 3 ) & 0xfffffffc;
// Opcode schreiben:
- *pPict << (USHORT)0x0098;
+ *pPict << (sal_uInt16)0x0098;
// Normalerweise wollen wir den Packing-Type 0 (default Packing) erzeugen.
// Wenn aber RowBytes<8 gilt, sind die Daten grundsaetzlich ungepackt,
@@ -1133,48 +1130,48 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
nPackType = 0;
// PixMap-Struktur schreiben:
- *pPict << (USHORT)(nDstRowBytes|0x8000) // Bytes pro Zeile und dass es eine 'PixMap' ist
- << (USHORT)0x0000 // Y1-Position der Bitmap in der Quelle
- << (USHORT)0x0000 // X1-Position der Bitmap in der Quelle
- << (USHORT)nHeight // Y2-Position der Bitmap in der Quelle
- << (USHORT)nWidth // X2-Position der Bitmap in der Quelle
- << (USHORT)0x0000 // Version
- << (USHORT)nPackType // Packing type
+ *pPict << (sal_uInt16)(nDstRowBytes|0x8000) // Bytes pro Zeile und dass es eine 'PixMap' ist
+ << (sal_uInt16)0x0000 // Y1-Position der Bitmap in der Quelle
+ << (sal_uInt16)0x0000 // X1-Position der Bitmap in der Quelle
+ << (sal_uInt16)nHeight // Y2-Position der Bitmap in der Quelle
+ << (sal_uInt16)nWidth // X2-Position der Bitmap in der Quelle
+ << (sal_uInt16)0x0000 // Version
+ << (sal_uInt16)nPackType // Packing type
<< (sal_uInt32) 0x00000000 // Packing size (?)
<< (sal_uInt32) 0x00480000 // H-Res
<< (sal_uInt32) 0x00480000 // V-Res
- << (USHORT)0x0000 // Pixel type (?)
- << (USHORT)nBitsPerPixel // Pixel size
- << (USHORT)0x0001 // CmpCount: 1 Komponente
- << (USHORT)nBitsPerPixel // CmpSize
+ << (sal_uInt16)0x0000 // Pixel type (?)
+ << (sal_uInt16)nBitsPerPixel // Pixel size
+ << (sal_uInt16)0x0001 // CmpCount: 1 Komponente
+ << (sal_uInt16)nBitsPerPixel // CmpSize
<< (sal_uInt32) 0x00000000 // PlaneBytes (?)
<< (sal_uInt32) 0x00000000 // (?)
<< (sal_uInt32) 0x00000000; // (?)
// Palette lesen und schreiben:
nColTabSize = pAcc->GetPaletteEntryCount();
- *pPict << (sal_uInt32)0 << (USHORT)0x8000 << (USHORT)( nColTabSize - 1 );
+ *pPict << (sal_uInt32)0 << (sal_uInt16)0x8000 << (sal_uInt16)( nColTabSize - 1 );
for ( i = 0; i < nColTabSize; i++ )
{
- nRed = (BYTE)pAcc->GetPaletteColor( (USHORT)i ).GetRed();
- nGreen = (BYTE)pAcc->GetPaletteColor( (USHORT)i ).GetGreen();
- nBlue = (BYTE)pAcc->GetPaletteColor( (USHORT)i ).GetBlue();
- *pPict << (UINT16)0 << nRed << nRed << nGreen << nGreen << nBlue << nBlue;
+ nRed = (sal_uInt8)pAcc->GetPaletteColor( (sal_uInt16)i ).GetRed();
+ nGreen = (sal_uInt8)pAcc->GetPaletteColor( (sal_uInt16)i ).GetGreen();
+ nBlue = (sal_uInt8)pAcc->GetPaletteColor( (sal_uInt16)i ).GetBlue();
+ *pPict << (sal_uInt16)0 << nRed << nRed << nGreen << nGreen << nBlue << nBlue;
}
// Source-Rectangle schreiben:
- *pPict << (USHORT)0 << (USHORT)0 << (USHORT)nHeight << (USHORT)nWidth;
+ *pPict << (sal_uInt16)0 << (sal_uInt16)0 << (sal_uInt16)nHeight << (sal_uInt16)nWidth;
// Destination-Rectangle schreiben:
WritePoint( rPoint );
WritePoint( Point( rPoint.X() + rSize.Width(), rPoint.Y() + rSize.Height() ) );
// Transfer mode schreiben:
- *pPict << (USHORT)0; // (?)
+ *pPict << (sal_uInt16)0; // (?)
// Speicher fuer eine Zeile allozieren:
- pPix = new BYTE[ nSrcRowBytes ];
+ pPix = new sal_uInt8[ nSrcRowBytes ];
// Position der Map-Daten in Ziel merken:
nDstMapPos=pPict->Tell();
@@ -1189,19 +1186,19 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
{
case 1 :
for ( pTemp = pPix, i = 0; i < nSrcRowBytes; i++ )
- *pTemp++ = (BYTE)0;
+ *pTemp++ = (sal_uInt8)0;
for ( i = 0; i < nWidth; i++ )
- pPix[ ( i >> 3 ) ] |= (BYTE)( pAcc->GetPixel( ny, i ) & 1 ) << ( ( i & 7 ) ^ 7 );
+ pPix[ ( i >> 3 ) ] |= (sal_uInt8)( pAcc->GetPixel( ny, i ) & 1 ) << ( ( i & 7 ) ^ 7 );
break;
case 4 :
for ( pTemp = pPix, i = 0; i < nSrcRowBytes; i++ )
- *pTemp++ = (BYTE)0;
+ *pTemp++ = (sal_uInt8)0;
for ( i = 0; i < nWidth; i++ )
- pPix[ ( i >> 1 ) ] |= (BYTE)( pAcc->GetPixel( ny, i ) & 15 ) << ( ( i & 1 ) << 2 ) ;
+ pPix[ ( i >> 1 ) ] |= (sal_uInt8)( pAcc->GetPixel( ny, i ) & 15 ) << ( ( i & 1 ) << 2 ) ;
break;
case 8 :
for ( i = 0; i < nWidth; i++ )
- pPix[ i ] = (BYTE)pAcc->GetPixel( ny, i );
+ pPix[ i ] = (sal_uInt8)pAcc->GetPixel( ny, i );
break;
}
@@ -1217,9 +1214,9 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
// ByteCount (das ist die Groesse der gepackten Zeile) zunaechst 0 (wird spaeter berichtigt):
if ( nDstRowBytes > 250 )
- *pPict << (USHORT)0;
+ *pPict << (sal_uInt16)0;
else
- *pPict << (BYTE)0;
+ *pPict << (sal_uInt8)0;
// Schleife ueber Bytes der Zeile:
nx=0;
@@ -1248,7 +1245,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
nCount = nEqu3 - nx;
if ( nCount > 128 )
nCount = 128;
- nFlagCounterByte = (BYTE)( nCount - 1 );
+ nFlagCounterByte = (sal_uInt8)( nCount - 1 );
*pPict << nFlagCounterByte;
do
{
@@ -1270,7 +1267,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
nCount++;
}
// nCount gleiche Bytes komprimiert schreiben:
- nFlagCounterByte = (BYTE)( 1 - (long)nCount );
+ nFlagCounterByte = (sal_uInt8)( 1 - (long)nCount );
*pPict << nFlagCounterByte << nEquData;
nx += nCount;
}
@@ -1280,9 +1277,9 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
nPos = pPict->Tell();
pPict->Seek( nDstRowPos );
if ( nDstRowBytes > 250 )
- *pPict << ( (USHORT)( nPos - nDstRowPos - 2 ) );
+ *pPict << ( (sal_uInt16)( nPos - nDstRowPos - 2 ) );
else
- *pPict << ( (BYTE)( nPos - nDstRowPos - 1 ) );
+ *pPict << ( (sal_uInt8)( nPos - nDstRowPos - 1 ) );
pPict->Seek( nPos );
}
@@ -1290,7 +1287,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
nActBitmapPercent =( ny * 70 / nHeight ) + 30; // (30% machten schon das Schreiben der Win-BMP-Datei aus)
MayCallback();
if ( pPict->GetError() )
- bStatus = FALSE;
+ bStatus = sal_False;
}
// Aufraeumen:
delete[] pPix;
@@ -1298,7 +1295,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
// Map-Daten muessen gerade Anzahl von Bytes sein:
if ( ( ( pPict->Tell() - nDstMapPos ) & 1 ) != 0 )
- *pPict << (BYTE)0;
+ *pPict << (sal_uInt8)0;
// Bitmaps zaehlen:
nWrittenBitmaps++;
@@ -1309,7 +1306,7 @@ void PictWriter::WriteOpcode_BitsRect(const Point & rPoint, const Size & rSize,
void PictWriter::WriteOpcode_EndOfFile()
{
- *pPict << (USHORT)0x00ff;
+ *pPict << (sal_uInt16)0x00ff;
}
@@ -1335,9 +1332,9 @@ void PictWriter::SetAttrForText()
{
WriteOpcode_RGBFgCol(aSrcFont.GetColor());
WriteOpcode_RGBBkCol(aSrcFont.GetFillColor());
- WriteOpcode_PnLinePat(TRUE);
+ WriteOpcode_PnLinePat(sal_True);
WriteOpcode_FontName(aSrcFont);
- WriteOpcode_TxSize((USHORT)(aSrcFont.GetSize().Height()));
+ WriteOpcode_TxSize((sal_uInt16)(aSrcFont.GetSize().Height()));
WriteOpcode_TxMode(eSrcRasterOp);
WriteOpcode_TxFace(aSrcFont);
}
@@ -1345,16 +1342,16 @@ void PictWriter::SetAttrForText()
void PictWriter::WriteTextArray(Point & rPoint, const String& rString, const sal_Int32 * pDXAry)
{
- USHORT i,nLen;
+ sal_uInt16 i,nLen;
sal_Unicode c;
- BOOL bDelta;
+ sal_Bool bDelta;
Point aPt;
if ( pDXAry == NULL )
- WriteOpcode_Text( rPoint, rString, FALSE );
+ WriteOpcode_Text( rPoint, rString, sal_False );
else
{
- bDelta = FALSE;
+ bDelta = sal_False;
nLen = rString.Len();
for ( i = 0; i < nLen; i++ )
{
@@ -1366,7 +1363,7 @@ void PictWriter::WriteTextArray(Point & rPoint, const String& rString, const sal
aPt.X() += pDXAry[ i - 1 ];
WriteOpcode_Text( aPt, String( c ), bDelta );
- bDelta = TRUE;
+ bDelta = sal_True;
}
}
}
@@ -1434,7 +1431,7 @@ void PictWriter::HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx
void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
{
- ULONG nA, nACount;
+ sal_uLong nA, nACount;
const MetaAction* pMA;
if( !bStatus)
@@ -1454,7 +1451,7 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
WriteOpcode_PnMode(eSrcRasterOp);
WriteOpcode_PnSize(1);
WriteOpcode_RGBFgCol(pA->GetColor());
- WriteOpcode_PnLinePat(TRUE);
+ WriteOpcode_PnLinePat(sal_True);
WriteOpcode_Line(pA->GetPoint(),pA->GetPoint());
}
break;
@@ -1652,7 +1649,7 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
else
aSimplePoly = rPoly;
- const USHORT nSize = aSimplePoly.GetSize();
+ const sal_uInt16 nSize = aSimplePoly.GetSize();
Point aLast;
if ( nSize )
@@ -1660,7 +1657,7 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
SetAttrForFrame();
aLast = aSimplePoly[0];
- for ( USHORT i = 1; i < nSize; i++ )
+ for ( sal_uInt16 i = 1; i < nSize; i++ )
{
WriteOpcode_Line( aLast, aSimplePoly[i] );
aLast = aSimplePoly[i];
@@ -1726,7 +1723,7 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
if (aLineColor!=Color( COL_TRANSPARENT ))
{
- USHORT nCount,i;
+ sal_uInt16 nCount,i;
SetAttrForFrame();
nCount = aSimplePolyPoly.Count();
for ( i = 0; i < nCount; i++ )
@@ -1752,7 +1749,7 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
SetAttrForText();
String aStr( pA->GetText(),pA->GetIndex(),pA->GetLen() );
- WriteOpcode_Text( aPt, aStr, FALSE );
+ WriteOpcode_Text( aPt, aStr, sal_False );
}
break;
@@ -1784,7 +1781,7 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
VirtualDevice aVirDev;
sal_Int32* pDXAry = new sal_Int32[ aStr.Len() ];
sal_Int32 nNormSize( aVirDev.GetTextArray( aStr,pDXAry ) );
- USHORT i;
+ sal_uInt16 i;
if (aSrcFont.GetAlign()!=ALIGN_BASELINE)
{
@@ -1866,8 +1863,8 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
const MetaEPSAction* pA = (const MetaEPSAction*)pMA;
const GDIMetaFile aGDIMetaFile( pA->GetSubstitute() );
- INT32 nCount = aGDIMetaFile.GetActionCount();
- for ( INT32 i = 0; i < nCount; i++ )
+ sal_Int32 nCount = aGDIMetaFile.GetActionCount();
+ for ( sal_Int32 i = 0; i < nCount; i++ )
{
const MetaAction* pMetaAct = aGDIMetaFile.GetAction( i );
if ( pMetaAct->GetType() == META_BMPSCALE_ACTION )
@@ -2121,7 +2118,7 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
if (aLineColor!=Color( COL_TRANSPARENT ))
{
SetAttrForFrame();
- for( USHORT i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ )
WriteOpcode_Poly( PDM_FRAME, rPolyPoly.GetObject( i ) );
}
}
@@ -2160,9 +2157,9 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
MayCallback();
if (pPict->GetError())
- bStatus=FALSE;
+ bStatus=sal_False;
- if (bStatus==FALSE)
+ if (bStatus==sal_False)
break;
}
}
@@ -2170,7 +2167,7 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
void PictWriter::WriteHeader(const GDIMetaFile & rMTF)
{
- USHORT i;
+ sal_uInt16 i;
Size aSize( rMTF.GetPrefSize() );
Point aPoint;
Rectangle aRect( aPoint, aSize );
@@ -2179,7 +2176,7 @@ void PictWriter::WriteHeader(const GDIMetaFile & rMTF)
for (i=0;i<128;i++) *pPict << (sal_uInt32)0;
// Lo-16-Bits der Groesse der Datei ohne die 512 Bytes Muell:
- *pPict << (USHORT)0; // wird spaeter durch UpdateHeader() berichtigt
+ *pPict << (sal_uInt16)0; // wird spaeter durch UpdateHeader() berichtigt
// Das Bounding-Rectangle (y1,x1,y2,x2 !):
WriteRectangle( aRect );
@@ -2188,9 +2185,9 @@ void PictWriter::WriteHeader(const GDIMetaFile & rMTF)
*pPict << (sal_uInt32)0x001102ff;
// Extended-Version-2-Header:
- *pPict << (USHORT)0x0c00 // Opcode
- << (USHORT)0xfffe // Version (?)
- << (USHORT)0x0000 // Reserved
+ *pPict << (sal_uInt16)0x0c00 // Opcode
+ << (sal_uInt16)0xfffe // Version (?)
+ << (sal_uInt16)0x0000 // Reserved
<< (sal_uInt32) 0x00480000 // hRes
<< (sal_uInt32) 0x00480000;
WriteRectangle( aRect );
@@ -2205,23 +2202,23 @@ void PictWriter::WriteHeader(const GDIMetaFile & rMTF)
void PictWriter::UpdateHeader()
{
- ULONG nPos;
+ sal_uLong nPos;
// Lo-16-Bits der Groesse der Datei ohne die 512 Bytes Muell berichtigen:
nPos=pPict->Tell();
pPict->Seek(512);
- *pPict << (USHORT)((nPos-512)&0x0000ffff);
+ *pPict << (sal_uInt16)((nPos-512)&0x0000ffff);
pPict->Seek(nPos);
}
-BOOL PictWriter::WritePict(const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem )
+sal_Bool PictWriter::WritePict(const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pFilterConfigItem )
{
PictWriterAttrStackMember* pAt;
MapMode aMap72( MAP_INCH );
Fraction aDPIFrac( 1, 72 );
- bStatus=TRUE;
+ bStatus=sal_True;
nLastPercent=0;
if ( pFilterConfigItem )
@@ -2249,19 +2246,19 @@ BOOL PictWriter::WritePict(const GDIMetaFile & rMTF, SvStream & rTargetStream, F
pAttrStack=NULL;
- bDstBkPatValid=FALSE;
- bDstTxFaceValid=FALSE;
- bDstTxModeValid=FALSE;
- bDstPnSizeValid=FALSE;
- bDstPnModeValid=FALSE;
- bDstPnPatValid=FALSE;
- bDstFillPatValid=FALSE;
- bDstTxSizeValid=FALSE;
- bDstFgColValid=FALSE;
- bDstBkColValid=FALSE;
- bDstPenPositionValid=FALSE;
- bDstTextPositionValid=FALSE;
- bDstFontNameValid=FALSE;
+ bDstBkPatValid=sal_False;
+ bDstTxFaceValid=sal_False;
+ bDstTxModeValid=sal_False;
+ bDstPnSizeValid=sal_False;
+ bDstPnModeValid=sal_False;
+ bDstPnPatValid=sal_False;
+ bDstFillPatValid=sal_False;
+ bDstTxSizeValid=sal_False;
+ bDstFgColValid=sal_False;
+ bDstBkColValid=sal_False;
+ bDstPenPositionValid=sal_False;
+ bDstTextPositionValid=sal_False;
+ bDstFontNameValid=sal_False;
nNumberOfActions=0;
nNumberOfBitmaps=0;
@@ -2290,7 +2287,7 @@ BOOL PictWriter::WritePict(const GDIMetaFile & rMTF, SvStream & rTargetStream, F
//================== GraphicExport - die exportierte Funktion ================
-extern "C" BOOL __LOADONCALLAPI GraphicExport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pFilterConfigItem, BOOL)
+extern "C" sal_Bool __LOADONCALLAPI GraphicExport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool)
{
PictWriter aPictWriter;
@@ -2332,56 +2329,4 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport(SvStream & rStream, Graphic & rGra
}
}
-//================== GraphicDialog - die exportierte Funktion ================
-
-extern "C" BOOL SAL_CALL DoExportDialog( FltCallDialogParameter& rPara )
-{
- BOOL bRet = FALSE;
-
- if ( rPara.pWindow )
- {
- ByteString aResMgrName( "ept" );
- ResMgr* pResMgr;
-
- pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
-
- if( pResMgr )
- {
- rPara.pResMgr = pResMgr;
- bRet = ( DlgExportEPCT( rPara ).Execute() == RET_OK );
- delete pResMgr;
- }
- else
- bRet = TRUE;
- }
-
- return bRet;
-}
-
-
-//=============================== fuer Windows ==============================
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/epict/exports.map b/filter/source/graphicfilter/epict/exports.map
index 61e4682c6551..d4e28c44700c 100644
--- a/filter/source/graphicfilter/epict/exports.map
+++ b/filter/source/graphicfilter/epict/exports.map
@@ -1,7 +1,6 @@
UDK_3_0_0 {
global:
GraphicExport;
- DoExportDialog;
local:
*;
diff --git a/filter/source/graphicfilter/epict/makefile.mk b/filter/source/graphicfilter/epict/makefile.mk
index bf32b0e899d1..4e47fdef0663 100644
--- a/filter/source/graphicfilter/epict/makefile.mk
+++ b/filter/source/graphicfilter/epict/makefile.mk
@@ -43,19 +43,13 @@ DEPTARGET=vepict
CDEFS+= -DEDITDEBUG
.ENDIF
-SRS1NAME=$(TARGET)
-SRC1FILES = dlgepct.src \
- epictstr.src
.IF "$(L10N_framework)"==""
-SLOFILES = $(SLO)$/epict.obj \
- $(SLO)$/dlgepct.obj
+SLOFILES = $(SLO)$/epict.obj
EXCEPTIONSFILES = $(SLO)$/epict.obj \
$(SLO)$/dlgepct.obj
.ENDIF
# ==========================================================================
-RESLIB1NAME=$(TARGET2)
-RESLIB1SRSFILES=$(SRS)$/$(TARGET).srs
.IF "$(L10N_framework)"==""
SHL1TARGET= ept$(DLLPOSTFIX)
SHL1IMPLIB= epict
diff --git a/filter/source/graphicfilter/epict/strings.hrc b/filter/source/graphicfilter/epict/strings.hrc
deleted file mode 100644
index 7834e3ea2bc0..000000000000
--- a/filter/source/graphicfilter/epict/strings.hrc
+++ /dev/null
@@ -1,29 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-#define KEY_MODE 260
-#define KEY_SIZE 261
-
diff --git a/filter/source/graphicfilter/eppm/dlgeppm.cxx b/filter/source/graphicfilter/eppm/dlgeppm.cxx
deleted file mode 100644
index 87dff3784813..000000000000
--- a/filter/source/graphicfilter/eppm/dlgeppm.cxx
+++ /dev/null
@@ -1,98 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_filter.hxx"
-
-#include <tools/ref.hxx>
-#include <svtools/FilterConfigItem.hxx>
-#include <vcl/msgbox.hxx>
-#include "dlgeppm.hxx"
-#include "dlgeppm.hrc"
-#include "strings.hrc"
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportEPPM::DlgExportEPPM( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPPM, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aGrpFormat ( this, ResId( GRP_FORMAT, *rPara.pResMgr ) ),
- aRBRaw ( this, ResId( RB_RAW, *rPara.pResMgr ) ),
- aRBASCII ( this, ResId( RB_ASCII, *rPara.pResMgr ) ),
- aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr )
-{
- FreeResource();
-
- // Config-Parameter lesen
-
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PPM" ) );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
- sal_Int32 nFormat = pConfigItem->ReadInt32( String( ResId( KEY_FORMAT, *pMgr ) ), 0 );
-
- BOOL bCheck = FALSE;
- if ( !nFormat )
- bCheck ^= TRUE;
- aRBRaw.Check( bCheck );
- bCheck ^= TRUE;
- aRBASCII.Check( bCheck );
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportEPPM, OK ) );
-}
-
-DlgExportEPPM::~DlgExportEPPM()
-{
- delete pConfigItem;
-}
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEPPM, OK, void *, EMPTYARG )
-{
- // Config-Parameter schreiben
- sal_Int32 nFormat = 0;
- if ( aRBASCII.IsChecked() )
- nFormat++;
- pConfigItem->WriteInt32( String( ResId( KEY_FORMAT, *pMgr ) ), nFormat );
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/eppm/dlgeppm.hrc b/filter/source/graphicfilter/eppm/dlgeppm.hrc
deleted file mode 100644
index 876dfa840997..000000000000
--- a/filter/source/graphicfilter/eppm/dlgeppm.hrc
+++ /dev/null
@@ -1,34 +0,0 @@
-/*************************************************************************
- *
- * 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 "filter.hrc"
-
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define GRP_FORMAT 1
-#define RB_RAW 1
-#define RB_ASCII 2
diff --git a/filter/source/graphicfilter/eppm/dlgeppm.src b/filter/source/graphicfilter/eppm/dlgeppm.src
deleted file mode 100644
index bf6c6ec653cb..000000000000
--- a/filter/source/graphicfilter/eppm/dlgeppm.src
+++ /dev/null
@@ -1,106 +0,0 @@
-/*************************************************************************
- *
- * 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 "dlgeppm.hrc"
-ModalDialog DLG_EXPORT_EPPM
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 133 , 63 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Text [ en-US ] = "PPM Options" ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 73 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 73 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 73 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedLine GRP_FORMAT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "File format";
- };
- RadioButton RB_RAW
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Binary";
- };
- RadioButton RB_ASCII
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 45 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Text";
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/filter/source/graphicfilter/eppm/eppm.cxx b/filter/source/graphicfilter/eppm/eppm.cxx
index 66a83e73e046..cbe20d7a0668 100644
--- a/filter/source/graphicfilter/eppm/eppm.cxx
+++ b/filter/source/graphicfilter/eppm/eppm.cxx
@@ -36,9 +36,6 @@
#include <svl/solar.hrc>
#include <svtools/fltcall.hxx>
#include <svtools/FilterConfigItem.hxx>
-#include "strings.hrc"
-#include "dlgeppm.hrc"
-#include "dlgeppm.hxx"
//============================ PPMWriter ==================================
@@ -47,14 +44,14 @@ class PPMWriter {
private:
SvStream& m_rOStm; // Die auszugebende PPM-Datei
- USHORT mpOStmOldModus;
+ sal_uInt16 mpOStmOldModus;
- BOOL mbStatus;
+ sal_Bool mbStatus;
sal_Int32 mnMode;
BitmapReadAccess* mpAcc;
- ULONG mnWidth, mnHeight; // Bildausmass in Pixeln
+ sal_uLong mnWidth, mnHeight; // Bildausmass in Pixeln
- BOOL ImplWriteHeader();
+ sal_Bool ImplWriteHeader();
void ImplWriteBody();
void ImplWriteNumber( sal_Int32 );
@@ -64,14 +61,14 @@ public:
PPMWriter(SvStream &rStrm);
~PPMWriter();
- BOOL WritePPM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem );
+ sal_Bool WritePPM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem );
};
//=================== Methoden von PPMWriter ==============================
PPMWriter::PPMWriter(SvStream &rStrm)
: m_rOStm(rStrm)
- , mbStatus ( TRUE )
+ , mbStatus ( sal_True )
, mpAcc ( NULL )
{
}
@@ -84,7 +81,7 @@ PPMWriter::~PPMWriter()
// ------------------------------------------------------------------------
-BOOL PPMWriter::WritePPM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem )
+sal_Bool PPMWriter::WritePPM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem )
{
if ( pFilterConfigItem )
{
@@ -115,7 +112,7 @@ BOOL PPMWriter::WritePPM( const Graphic& rGraphic, FilterConfigItem* pFilterConf
aBmp.ReleaseAccess( mpAcc );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
m_rOStm.SetNumberFormatInt( mpOStmOldModus );
@@ -127,7 +124,7 @@ BOOL PPMWriter::WritePPM( const Graphic& rGraphic, FilterConfigItem* pFilterConf
// ------------------------------------------------------------------------
-BOOL PPMWriter::ImplWriteHeader()
+sal_Bool PPMWriter::ImplWriteHeader()
{
mnWidth = mpAcc->Width();
mnHeight = mpAcc->Height();
@@ -139,14 +136,14 @@ BOOL PPMWriter::ImplWriteHeader()
m_rOStm << "P3\x0a";
ImplWriteNumber( mnWidth );
- m_rOStm << (BYTE)32;
+ m_rOStm << (sal_uInt8)32;
ImplWriteNumber( mnHeight );
- m_rOStm << (BYTE)32;
+ m_rOStm << (sal_uInt8)32;
ImplWriteNumber( 255 ); // max. col.
- m_rOStm << (BYTE)10;
+ m_rOStm << (sal_uInt8)10;
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
return mbStatus;
}
@@ -157,9 +154,9 @@ void PPMWriter::ImplWriteBody()
{
if ( mnMode == 0 )
{
- for ( ULONG y = 0; y < mnHeight; y++ )
+ for ( sal_uLong y = 0; y < mnHeight; y++ )
{
- for ( ULONG x = 0; x < mnWidth; x++ )
+ for ( sal_uLong x = 0; x < mnWidth; x++ )
{
const BitmapColor& rColor = mpAcc->GetPixel( y, x );
m_rOStm << rColor.GetRed();
@@ -170,16 +167,16 @@ void PPMWriter::ImplWriteBody()
}
else
{
- for ( ULONG y = 0; y < mnHeight; y++ )
+ for ( sal_uLong y = 0; y < mnHeight; y++ )
{
int nCount = 70;
- for ( ULONG x = 0; x < mnWidth; x++ )
+ for ( sal_uLong x = 0; x < mnWidth; x++ )
{
- BYTE i, nDat[3], nNumb;
+ sal_uInt8 i, nDat[3], nNumb;
if ( nCount < 0 )
{
nCount = 69;
- m_rOStm << (BYTE)10;
+ m_rOStm << (sal_uInt8)10;
}
nDat[0] = mpAcc->GetPixel( y, x ).GetRed();
nDat[1] = mpAcc->GetPixel( y, x ).GetGreen();
@@ -189,12 +186,12 @@ void PPMWriter::ImplWriteBody()
nNumb = nDat[ i ] / 100;
if ( nNumb )
{
- m_rOStm << (BYTE)( nNumb + '0' );
+ m_rOStm << (sal_uInt8)( nNumb + '0' );
nDat[ i ] -= ( nNumb * 100 );
nNumb = nDat[ i ] / 10;
- m_rOStm << (BYTE)( nNumb + '0' );
+ m_rOStm << (sal_uInt8)( nNumb + '0' );
nDat[ i ] -= ( nNumb * 10 );
- m_rOStm << (BYTE)( nDat[ i ] + '0' );
+ m_rOStm << (sal_uInt8)( nDat[ i ] + '0' );
nCount -= 4;
}
else
@@ -202,21 +199,21 @@ void PPMWriter::ImplWriteBody()
nNumb = nDat[ i ] / 10;
if ( nNumb )
{
- m_rOStm << (BYTE)( nNumb + '0' );
+ m_rOStm << (sal_uInt8)( nNumb + '0' );
nDat[ i ] -= ( nNumb * 10 );
- m_rOStm << (BYTE)( nDat[ i ] + '0' );
+ m_rOStm << (sal_uInt8)( nDat[ i ] + '0' );
nCount -= 3;
}
else
{
- m_rOStm << (BYTE)( nDat[ i ] + '0' );
+ m_rOStm << (sal_uInt8)( nDat[ i ] + '0' );
nCount -= 2;
}
}
- m_rOStm << (BYTE)' ';
+ m_rOStm << (sal_uInt8)' ';
}
}
- m_rOStm << (BYTE)10;
+ m_rOStm << (sal_uInt8)10;
}
}
}
@@ -239,7 +236,7 @@ void PPMWriter::ImplWriteNumber( sal_Int32 nNumber )
// - exported function -
// ---------------------
-extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool )
{
PPMWriter aPPMWriter(rStream);
return aPPMWriter.WritePPM( rGraphic, pFilterConfigItem );
@@ -247,57 +244,5 @@ extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGrap
// ------------------------------------------------------------------------
-extern "C" BOOL __LOADONCALLAPI DoExportDialog( FltCallDialogParameter& rPara )
-{
- BOOL bRet = FALSE;
-
- if ( rPara.pWindow )
- {
- ByteString aResMgrName( "epp" );
- ResMgr* pResMgr;
-
- pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
-
- if( pResMgr )
- {
- rPara.pResMgr = pResMgr;
- bRet = ( DlgExportEPPM( rPara ).Execute() == RET_OK );
- delete pResMgr;
- }
- else
- bRet = TRUE;
- }
-
- return bRet;
-}
-
-// ------------------------------------------------------------------------
-
-// ---------------
-// - Win16 trash -
-// ---------------
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0;
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
- if ( nHeap )
- UnlockData( 0 );
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-// ------------------------------------------------------------------------
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/eppm/eppmstr.src b/filter/source/graphicfilter/eppm/eppmstr.src
deleted file mode 100644
index 8424505dbcd1..000000000000
--- a/filter/source/graphicfilter/eppm/eppmstr.src
+++ /dev/null
@@ -1,35 +0,0 @@
-/*************************************************************************
- *
- * 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 "strings.hrc"
-
-// Key fuer den Dialog
-String KEY_FORMAT
-{
- Text = "FileFormat";
-};
diff --git a/filter/source/graphicfilter/eppm/exports.map b/filter/source/graphicfilter/eppm/exports.map
index 61e4682c6551..d4e28c44700c 100644
--- a/filter/source/graphicfilter/eppm/exports.map
+++ b/filter/source/graphicfilter/eppm/exports.map
@@ -1,7 +1,6 @@
UDK_3_0_0 {
global:
GraphicExport;
- DoExportDialog;
local:
*;
diff --git a/filter/source/graphicfilter/eppm/makefile.mk b/filter/source/graphicfilter/eppm/makefile.mk
index 62d5f201d51f..6a41d81f1da6 100644
--- a/filter/source/graphicfilter/eppm/makefile.mk
+++ b/filter/source/graphicfilter/eppm/makefile.mk
@@ -42,21 +42,11 @@ DEPTARGET=veppm
CDEFS+= -DEDITDEBUG
.ENDIF
-SRS1NAME=$(TARGET)
-SRC1FILES= dlgeppm.src \
- eppmstr.src
.IF "$(L10N_framework)"==""
-SLOFILES = \
- $(SLO)$/eppm.obj \
- $(SLO)$/dlgeppm.obj
-EXCEPTIONSFILES= \
- $(SLO)$/eppm.obj \
- $(SLO)$/dlgeppm.obj
+SLOFILES = $(SLO)$/eppm.obj
.ENDIF
# ==========================================================================
-RESLIB1NAME=$(TARGET2)
-RESLIB1SRSFILES=$(SRS)$/$(TARGET).srs
.IF "$(L10N_framework)"==""
SHL1TARGET= epp$(DLLPOSTFIX)
SHL1IMPLIB= eppm
diff --git a/filter/source/graphicfilter/eppm/strings.hrc b/filter/source/graphicfilter/eppm/strings.hrc
deleted file mode 100644
index 122719e87d4b..000000000000
--- a/filter/source/graphicfilter/eppm/strings.hrc
+++ /dev/null
@@ -1,27 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-#define KEY_FORMAT 256
diff --git a/filter/source/graphicfilter/eps/dlgeps.cxx b/filter/source/graphicfilter/eps/dlgeps.cxx
deleted file mode 100644
index a2ddc39f8d2f..000000000000
--- a/filter/source/graphicfilter/eps/dlgeps.cxx
+++ /dev/null
@@ -1,207 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_filter.hxx"
-
-#include <tools/ref.hxx>
-#include <vcl/msgbox.hxx>
-#include <svtools/FilterConfigItem.hxx>
-#include "dlgeps.hxx"
-#include "dlgeps.hrc"
-#include "strings.hrc"
-
-/*************************************************************************
-|*
-|* Ctor
-|*
-\************************************************************************/
-
-DlgExportEPS::DlgExportEPS( FltCallDialogParameter& rPara ) :
- ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPS, *rPara.pResMgr ) ),
- rFltCallPara ( rPara ),
- aGrpPreview ( this, ResId( GRP_PREVIEW, *rPara.pResMgr ) ),
- aCBPreviewTiff ( this, ResId( CB_PREVIEW_TIFF, *rPara.pResMgr ) ),
- aCBPreviewEPSI ( this, ResId( CB_PREVIEW_EPSI, *rPara.pResMgr ) ),
- aGrpVersion ( this, ResId( GRP_VERSION, *rPara.pResMgr ) ),
- aRBLevel1 ( this, ResId( RB_LEVEL1, *rPara.pResMgr ) ),
- aRBLevel2 ( this, ResId( RB_LEVEL2, *rPara.pResMgr ) ),
- aGrpColor ( this, ResId( GRP_COLOR, *rPara.pResMgr ) ),
- aRBColor ( this, ResId( RB_COLOR, *rPara.pResMgr ) ),
- aRBGrayscale ( this, ResId( RB_GRAYSCALE, *rPara.pResMgr ) ),
- aGrpCompression ( this, ResId( GRP_COMPRESSION, *rPara.pResMgr ) ),
- aRBCompressionLZW ( this, ResId( RB_COMPRESSION_LZW, *rPara.pResMgr ) ),
- aRBCompressionNone ( this, ResId( RB_COMPRESSION_NONE, *rPara.pResMgr ) ),
- aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
- aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
- aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
- pMgr ( rPara.pResMgr )
-{
- FreeResource();
-
- String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/EPS" ) );
- pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
-
- // Config-Parameter lesen
- String sPreview( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) );
- String sVersion( RTL_CONSTASCII_USTRINGPARAM( "Version" ) );
- String sColorFormat( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) );
- String sCompressionMode( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) );
- String sTextMode( RTL_CONSTASCII_USTRINGPARAM( "TextMode" ) );
-
- sal_Int32 nPreview = pConfigItem->ReadInt32( sPreview, 0 );
- sal_Int32 nVersion = pConfigItem->ReadInt32( sVersion, 2 );
- sal_Int32 nColor = pConfigItem->ReadInt32( sColorFormat, 0 );
- sal_Int32 nCompr = pConfigItem->ReadInt32( sCompressionMode, 2 );
-
- /* SJ: The following line is not superfluous, reading the item will also #106652#
- create the corresponding FilterData Property. Since all filter
- are no longer accessing the configuration itself, we have fill the
- FilterData sequence with all available configuration items */
- pConfigItem->ReadInt32( sTextMode, 0 );
-
- BOOL bCheck = FALSE;
- if ( nPreview & 1 )
- bCheck = TRUE;
- aCBPreviewTiff.Check( bCheck );
- if ( nPreview & 2 )
- bCheck = TRUE;
- aCBPreviewEPSI.Check( bCheck );
-
- bCheck = FALSE;
- if ( nVersion == 1 )
- bCheck ^= TRUE;
- aRBLevel1.Check( bCheck );
- bCheck ^= TRUE;
- aRBLevel2.Check( bCheck );
-
- bCheck = FALSE;
- if ( nColor == 1 )
- bCheck ^= TRUE;
- aRBColor.Check( bCheck );
- bCheck ^= TRUE;
- aRBGrayscale.Check( bCheck );
-
- bCheck = FALSE;
- if ( nCompr == 1 )
- bCheck ^= TRUE;
- aRBCompressionLZW.Check( bCheck );
- bCheck ^= TRUE;
- aRBCompressionNone.Check( bCheck );
-
- if ( aRBLevel1.IsChecked() )
- {
- aRBColor.Disable();
- aRBGrayscale.Disable();
- aRBCompressionNone.Disable();
- aRBCompressionLZW.Disable();
- aRBCompressionNone.Disable();
- }
-
- aBtnOK.SetClickHdl( LINK( this, DlgExportEPS, OK ) );
- aRBLevel1.SetClickHdl( LINK( this, DlgExportEPS, LEVEL1 ) );
- aRBLevel2.SetClickHdl( LINK( this, DlgExportEPS, LEVEL2 ) );
-}
-
-DlgExportEPS::~DlgExportEPS()
-{
- delete pConfigItem;
-}
-
-/*************************************************************************
-|*
-|* Speichert eingestellte Werte in ini-Datei
-|*
-\************************************************************************/
-
-IMPL_LINK( DlgExportEPS, OK, void *, EMPTYARG )
-{
-
- // Config-Parameter schreiben
- sal_Int32 nCheck = 0;
- if ( aCBPreviewTiff.IsChecked() )
- nCheck++;
- if ( aCBPreviewEPSI.IsChecked() )
- nCheck += 2;
-
- String sPreview( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) );
- pConfigItem->WriteInt32( sPreview, nCheck );
-
- nCheck = 1;
- if ( aRBLevel2.IsChecked() )
- nCheck++;
- String sVersion( RTL_CONSTASCII_USTRINGPARAM( "Version" ) );
- pConfigItem->WriteInt32( sVersion, nCheck );
-
- nCheck = 1;
- if ( aRBGrayscale.IsChecked() )
- nCheck++;
- String sColorFormat( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) );
- pConfigItem->WriteInt32( sColorFormat, nCheck );
-
- nCheck = 1;
- if ( aRBCompressionNone.IsChecked() )
- nCheck++;
- String sCompressionMode( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) );
- pConfigItem->WriteInt32( sCompressionMode, nCheck );
-
- rFltCallPara.aFilterData = pConfigItem->GetFilterData();
- EndDialog( RET_OK );
-
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( DlgExportEPS, LEVEL1, void*, EMPTYARG )
-{
- if ( aRBLevel1.IsChecked() )
- {
- aRBColor.Disable();
- aRBGrayscale.Disable();
- aRBCompressionLZW.Disable();
- aRBCompressionNone.Disable();
- }
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( DlgExportEPS, LEVEL2, void*, EMPTYARG )
-{
- if ( aRBLevel2.IsChecked() )
- {
- aRBColor.Enable();
- aRBGrayscale.Enable();
- aRBCompressionLZW.Enable();
- aRBCompressionNone.Enable();
- }
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/eps/dlgeps.hrc b/filter/source/graphicfilter/eps/dlgeps.hrc
deleted file mode 100644
index 061c8b2db6cb..000000000000
--- a/filter/source/graphicfilter/eps/dlgeps.hrc
+++ /dev/null
@@ -1,43 +0,0 @@
-/*************************************************************************
- *
- * 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 "filter.hrc"
-
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-#define GRP_PREVIEW 1
-#define GRP_VERSION 2
-#define GRP_COLOR 3
-#define GRP_COMPRESSION 4
-#define CB_PREVIEW_TIFF 1
-#define CB_PREVIEW_EPSI 2
-#define RB_LEVEL1 1
-#define RB_LEVEL2 2
-#define RB_COLOR 3
-#define RB_GRAYSCALE 4
-#define RB_COMPRESSION_LZW 5
-#define RB_COMPRESSION_NONE 6
diff --git a/filter/source/graphicfilter/eps/dlgeps.hxx b/filter/source/graphicfilter/eps/dlgeps.hxx
deleted file mode 100644
index 88908fe6d7f6..000000000000
--- a/filter/source/graphicfilter/eps/dlgeps.hxx
+++ /dev/null
@@ -1,85 +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 _DLGEPS_HXX_
-#define _DLGEPS_HXX_
-#include <svtools/fltcall.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/lstbox.hxx>
-#include <svtools/stdctrl.hxx>
-
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen
-|*
-\************************************************************************/
-
-class FilterConfigItem;
-class ResMgr;
-
-class DlgExportEPS : public ModalDialog
-{
-private:
-
- FltCallDialogParameter& rFltCallPara;
-
- FixedLine aGrpPreview;
- CheckBox aCBPreviewTiff;
- CheckBox aCBPreviewEPSI;
- FixedLine aGrpVersion;
- RadioButton aRBLevel1;
- RadioButton aRBLevel2;
- FixedLine aGrpColor;
- RadioButton aRBColor;
- RadioButton aRBGrayscale;
- FixedLine aGrpCompression;
- RadioButton aRBCompressionLZW;
- RadioButton aRBCompressionNone;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
-
- FilterConfigItem* pConfigItem;
- ResMgr* pMgr;
-
- DECL_LINK( OK, void * );
- DECL_LINK( LEVEL1, void* );
- DECL_LINK( LEVEL2, void* );
-
-public:
- DlgExportEPS( FltCallDialogParameter& rPara );
- ~DlgExportEPS();
-};
-
-#endif // _DLGEPS_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/eps/dlgeps.src b/filter/source/graphicfilter/eps/dlgeps.src
deleted file mode 100644
index 31ddccd5be4f..000000000000
--- a/filter/source/graphicfilter/eps/dlgeps.src
+++ /dev/null
@@ -1,160 +0,0 @@
-/*************************************************************************
- *
- * 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 "dlgeps.hrc"
-ModalDialog DLG_EXPORT_EPS
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 230, 161 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Text [ en-US ] = "EPS Export Options";
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 174 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 174, 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 174 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-
- FixedLine GRP_PREVIEW
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 162 , 8 ) ;
- Text [ en-US ] = "Preview";
- };
- CheckBox CB_PREVIEW_TIFF
- {
- Pos = MAP_APPFONT ( 12, 14 ) ;
- Size = MAP_APPFONT ( 150 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Image ~preview (TIFF)";
- };
- CheckBox CB_PREVIEW_EPSI
- {
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 150, 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Interchange (EPSI)";
- };
- FixedLine GRP_VERSION
- {
- Pos = MAP_APPFONT ( 6, 41 ) ;
- Size = MAP_APPFONT ( 162 , 8 ) ;
- Text [ en-US ] = "Version";
- };
- RadioButton RB_LEVEL1
- {
- Pos = MAP_APPFONT ( 12 , 52 ) ;
- Size = MAP_APPFONT ( 150 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Level ~1";
- };
- RadioButton RB_LEVEL2
- {
- Pos = MAP_APPFONT ( 12 , 66 ) ;
- Size = MAP_APPFONT ( 150, 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Level ~2";
- };
-
- FixedLine GRP_COLOR
- {
- Pos = MAP_APPFONT ( 6 , 79 ) ;
- Size = MAP_APPFONT ( 162 , 8 ) ;
- Text [ en-US ] = "Color format";
- };
- RadioButton RB_COLOR
- {
- Pos = MAP_APPFONT ( 12 , 90 ) ;
- Size = MAP_APPFONT ( 150, 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Color";
- };
- RadioButton RB_GRAYSCALE
- {
- Pos = MAP_APPFONT ( 12 , 104 ) ;
- Size = MAP_APPFONT ( 150, 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Grayscale";
- };
-
- FixedLine GRP_COMPRESSION
- {
- Pos = MAP_APPFONT ( 6 , 117 ) ;
- Size = MAP_APPFONT ( 162 , 8 ) ;
- Text [ en-US ] = "Compression";
- };
- RadioButton RB_COMPRESSION_LZW
- {
- Pos = MAP_APPFONT ( 12, 128 );
- Size = MAP_APPFONT ( 150, 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "LZW encoding";
- };
- RadioButton RB_COMPRESSION_NONE
- {
- Pos = MAP_APPFONT ( 12, 141 ) ;
- Size = MAP_APPFONT ( 150, 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "None";
- };
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 628c3f1177f5..c3c1a913baca 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -50,8 +50,6 @@
#include <svtools/FilterConfigItem.hxx>
#include <vcl/graphictools.hxx>
#include "strings.hrc"
-#include "dlgeps.hrc"
-#include "dlgeps.hxx"
#include <math.h>
@@ -75,7 +73,7 @@ using namespace ::com::sun::star::uno;
struct ChrSet
{
struct ChrSet * pSucc;
- BYTE nSet;
+ sal_uInt8 nSet;
String aName;
FontWeight eWeight;
};
@@ -84,12 +82,12 @@ struct StackMember
{
struct StackMember * pSucc;
Color aGlobalCol;
- BOOL bLineCol;
+ sal_Bool bLineCol;
Color aLineCol;
- BOOL bFillCol;
+ sal_Bool bFillCol;
Color aFillCol;
Color aTextCol;
- BOOL bTextFillCol;
+ sal_Bool bTextFillCol;
Color aTextFillCol;
Color aBackgroundCol;
Font aFont;
@@ -107,17 +105,17 @@ struct PSLZWCTreeNode
PSLZWCTreeNode* pBrother; // naechster Knoten, der den selben Vater hat
PSLZWCTreeNode* pFirstChild; // erster Sohn
- USHORT nCode; // Der Code fuer den String von Pixelwerten, der sich ergibt, wenn
- USHORT nValue; // Der Pixelwert
+ sal_uInt16 nCode; // Der Code fuer den String von Pixelwerten, der sich ergibt, wenn
+ sal_uInt16 nValue; // Der Pixelwert
};
class PSWriter
{
private:
- BOOL mbStatus;
- ULONG mnLevelWarning; // number of embedded eps files which was not exported
- ULONG mnLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde.
- UINT32 mnLatestPush; // offset auf streamposition, an der zuletzt gepusht wurde
+ sal_Bool mbStatus;
+ sal_uLong mnLevelWarning; // number of embedded eps files which was not exported
+ sal_uLong mnLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde.
+ sal_uInt32 mnLatestPush; // offset auf streamposition, an der zuletzt gepusht wurde
long mnLevel; // dialog options
sal_Bool mbGrayScale;
@@ -136,17 +134,17 @@ private:
double nBoundingY2;
//
StackMember* pGDIStack;
- ULONG mnCursorPos; // aktuelle Cursorposition im Output
+ sal_uLong mnCursorPos; // aktuelle Cursorposition im Output
Color aColor; // aktuelle Farbe die fuer den Output benutzt wird
- BOOL bLineColor;
+ sal_Bool bLineColor;
Color aLineColor; // aktuelle GDIMetafile Farbeinstellungen
- BOOL bFillColor; //
+ sal_Bool bFillColor; //
Color aFillColor; //
Color aTextColor; //
- BOOL bTextFillColor; //
+ sal_Bool bTextFillColor; //
Color aTextFillColor; //
Color aBackgroundColor; //
- BOOL bRegionChanged;
+ sal_Bool bRegionChanged;
TextAlign eTextAlign; //
double fLineWidth;
@@ -157,19 +155,19 @@ private:
Font maFont;
Font maLastFont;
- BYTE nChrSet;
+ sal_uInt8 nChrSet;
ChrSet* pChrSetList; // Liste der Character-Sets
- BYTE nNextChrSetId; // die erste unbenutzte ChrSet-Id
+ sal_uInt8 nNextChrSetId; // die erste unbenutzte ChrSet-Id
PSLZWCTreeNode* pTable; // LZW compression data
PSLZWCTreeNode* pPrefix; // the compression is as same as the TIFF compression
- USHORT nDataSize;
- USHORT nClearCode;
- USHORT nEOICode;
- USHORT nTableSize;
- USHORT nCodeSize;
- ULONG nOffset;
- ULONG dwShift;
+ sal_uInt16 nDataSize;
+ sal_uInt16 nClearCode;
+ sal_uInt16 nEOICode;
+ sal_uInt16 nTableSize;
+ sal_uInt16 nCodeSize;
+ sal_uLong nOffset;
+ sal_uLong dwShift;
com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;
@@ -179,28 +177,28 @@ private:
// this method makes LF's, space inserting and word wrapping as used in all nMode
// parameters
- inline void ImplExecMode( ULONG nMode );
+ inline void ImplExecMode( sal_uLong nMode );
// writes char[] + LF to stream
- inline void ImplWriteLine( const char*, ULONG nMode = PS_RET );
+ inline void ImplWriteLine( const char*, sal_uLong nMode = PS_RET );
// writes ( nNumb / 10^nCount ) in ASCII format to stream
- void ImplWriteF( sal_Int32 nNumb, ULONG nCount = 3, ULONG nMode = PS_SPACE );
+ void ImplWriteF( sal_Int32 nNumb, sal_uLong nCount = 3, sal_uLong nMode = PS_SPACE );
// writes a double in ASCII format to stream
- void ImplWriteDouble( double, ULONG nMode = PS_SPACE );
+ void ImplWriteDouble( double, sal_uLong nMode = PS_SPACE );
// writes a long in ASCII format to stream
- void ImplWriteLong( sal_Int32 nNumb, ULONG nMode = PS_SPACE );
+ void ImplWriteLong( sal_Int32 nNumb, sal_uLong nMode = PS_SPACE );
// writes a byte in ASCII format to stream
- void ImplWriteByte( BYTE nNumb, ULONG nMode = PS_SPACE );
+ void ImplWriteByte( sal_uInt8 nNumb, sal_uLong nMode = PS_SPACE );
// writes a byte in ASCII (hex) format to stream
- void ImplWriteHexByte( BYTE nNumb, ULONG nMode = PS_WRAP );
+ void ImplWriteHexByte( sal_uInt8 nNumb, sal_uLong nMode = PS_WRAP );
// writes nNumb as number from 0.000 till 1.000 in ASCII format to stream
- void ImplWriteB1( BYTE nNumb, ULONG nMode = PS_SPACE );
+ void ImplWriteB1( sal_uInt8 nNumb, sal_uLong nMode = PS_SPACE );
inline void ImplWritePoint( const Point&, sal_uInt32 nMode = PS_SPACE );
void ImplMoveTo( const Point&, sal_uInt32 nMode = PS_SPACE );
@@ -223,33 +221,33 @@ private:
void ImplSetClipRegion( Region& rRegion );
void ImplBmp( Bitmap*, Bitmap*, const Point &, double nWidth, double nHeight );
- void ImplText( const String& rUniString, const Point& rPos, const INT32* pDXArry, sal_Int32 nWidth, VirtualDevice& rVDev );
+ void ImplText( const String& rUniString, const Point& rPos, const sal_Int32* pDXArry, sal_Int32 nWidth, VirtualDevice& rVDev );
void ImplSetAttrForText( const Point & rPoint );
void ImplWriteCharacter( sal_Char );
- void ImplWriteString( const ByteString&, VirtualDevice& rVDev, const INT32* pDXArry = NULL, BOOL bStretch = FALSE );
+ void ImplWriteString( const ByteString&, VirtualDevice& rVDev, const sal_Int32* pDXArry = NULL, sal_Bool bStretch = sal_False );
void ImplDefineFont( const char*, const char* );
- void ImplClosePathDraw( ULONG nMode = PS_RET );
+ void ImplClosePathDraw( sal_uLong nMode = PS_RET );
void ImplPathDraw();
- inline void ImplWriteLineColor( ULONG nMode = PS_RET );
- inline void ImplWriteFillColor( ULONG nMode = PS_RET );
- inline void ImplWriteTextColor( ULONG nMode = PS_RET );
- inline void ImplWriteTextFillColor( ULONG nMode = PS_RET );
- void ImplWriteColor( ULONG nMode );
+ inline void ImplWriteLineColor( sal_uLong nMode = PS_RET );
+ inline void ImplWriteFillColor( sal_uLong nMode = PS_RET );
+ inline void ImplWriteTextColor( sal_uLong nMode = PS_RET );
+ inline void ImplWriteTextFillColor( sal_uLong nMode = PS_RET );
+ void ImplWriteColor( sal_uLong nMode );
double ImplGetScaling( const MapMode& );
void ImplGetMapMode( const MapMode& );
- BOOL ImplGetBoundingBox( double* nNumb, BYTE* pSource, ULONG nSize );
- BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize );
+ sal_Bool ImplGetBoundingBox( double* nNumb, sal_uInt8* pSource, sal_uLong nSize );
+ sal_uInt8* ImplSearchEntry( sal_uInt8* pSource, sal_uInt8* pDest, sal_uLong nComp, sal_uLong nSize );
// LZW methods
void StartCompression();
- void Compress( BYTE nSrc );
+ void Compress( sal_uInt8 nSrc );
void EndCompression();
- inline void WriteBits( USHORT nCode, USHORT nCodeLen );
+ inline void WriteBits( sal_uInt16 nCode, sal_uInt16 nCodeLen );
public:
- BOOL WritePS( const Graphic& rGraphic, SvStream& rTargetStream, FilterConfigItem* );
+ sal_Bool WritePS( const Graphic& rGraphic, SvStream& rTargetStream, FilterConfigItem* );
PSWriter();
~PSWriter();
};
@@ -271,11 +269,11 @@ PSWriter::~PSWriter()
//---------------------------------------------------------------------------------
-BOOL PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, FilterConfigItem* pFilterConfigItem )
+sal_Bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, FilterConfigItem* pFilterConfigItem )
{
- UINT32 nStreamPosition = 0, nPSPosition = 0; // -Wall warning, unset, check
+ sal_uInt32 nStreamPosition = 0, nPSPosition = 0; // -Wall warning, unset, check
- mbStatus = TRUE;
+ mbStatus = sal_True;
mnPreview = 0;
mnLevelWarning = 0;
mnLastPercent = 0;
@@ -296,8 +294,8 @@ BOOL PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
// default values for the dialog options
mnLevel = 2;
- mbGrayScale = FALSE;
- mbCompression = TRUE;
+ mbGrayScale = sal_False;
+ mbCompression = sal_True;
mnTextMode = 0; // default0 : export glyph outlines
// try to get the dialog selection
@@ -331,18 +329,18 @@ BOOL PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
// compression is not available for Level 1
if ( mnLevel == 1 )
{
- mbGrayScale = TRUE;
- mbCompression = FALSE;
+ mbGrayScale = sal_True;
+ mbCompression = sal_False;
}
if ( mnPreview & EPS_PREVIEW_TIFF )
{
- rTargetStream << (UINT32)0xC6D3D0C5;
+ rTargetStream << (sal_uInt32)0xC6D3D0C5;
nStreamPosition = rTargetStream.Tell();
- rTargetStream << (UINT32)0 << (UINT32)0 << (UINT32)0 << (UINT32)0
- << nStreamPosition + 26 << (UINT32)0 << (UINT16)0xffff;
+ rTargetStream << (sal_uInt32)0 << (sal_uInt32)0 << (sal_uInt32)0 << (sal_uInt32)0
+ << nStreamPosition + 26 << (sal_uInt32)0 << (sal_uInt16)0xffff;
- UINT32 nErrCode;
+ sal_uInt32 nErrCode;
if ( mbGrayScale )
{
BitmapEx aTempBitmapEx( rGraphic.GetBitmapEx() );
@@ -393,11 +391,11 @@ BOOL PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
pGDIStack = NULL;
aColor = Color( COL_TRANSPARENT );
- bLineColor = TRUE;
+ bLineColor = sal_True;
aLineColor = Color( COL_BLACK );
- bFillColor = TRUE;
+ bFillColor = sal_True;
aFillColor = Color( COL_WHITE );
- bTextFillColor = TRUE;
+ bTextFillColor = sal_True;
aTextFillColor = Color( COL_BLACK );
fLineWidth = 1;
fMiterLimit = 15; // use same limit as most graphic systems and basegfx
@@ -405,7 +403,7 @@ BOOL PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
eJoinType = SvtGraphicStroke::joinMiter;
aBackgroundColor = Color( COL_WHITE );
eTextAlign = ALIGN_BASELINE;
- bRegionChanged = FALSE;
+ bRegionChanged = sal_False;
nChrSet = 0x00;
pChrSetList = NULL;
@@ -419,7 +417,7 @@ BOOL PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
ImplWriteEpilog();
if ( mnPreview & EPS_PREVIEW_TIFF )
{
- UINT32 nPosition = rTargetStream.Tell();
+ sal_uInt32 nPosition = rTargetStream.Tell();
rTargetStream.Seek( nStreamPosition );
rTargetStream << nPSPosition;
rTargetStream << nPosition - nPSPosition;
@@ -439,7 +437,7 @@ BOOL PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
}
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
if ( mbStatus && mnLevelWarning && pFilterConfigItem )
{
@@ -508,13 +506,13 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview )
ImplWriteLong( aSizeBitmap.Width() );
ImplWriteLong( aSizeBitmap.Height() );
*mpPS << "1 ";
- INT32 nLines = aSizeBitmap.Width() / 312;
+ sal_Int32 nLines = aSizeBitmap.Width() / 312;
if ( ( nLines * 312 ) != aSizeBitmap.Width() )
nLines++;
nLines *= aSizeBitmap.Height();
ImplWriteLong( nLines );
char nVal;
- INT32 nX, nY, nCount2, nCount = 4;
+ sal_Int32 nX, nY, nCount2, nCount = 4;
const BitmapColor aBlack( pAcc->GetBestMatchingColor( Color( COL_BLACK ) ) );
for ( nY = 0; nY < aSizeBitmap.Height(); nY++ )
{
@@ -628,7 +626,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
{
PolyPolygon aFillPath;
- for( ULONG nCurAction = 0, nCount = rMtf.GetActionCount(); nCurAction < nCount; nCurAction++ )
+ for( sal_uLong nCurAction = 0, nCount = rMtf.GetActionCount(); nCurAction < nCount; nCurAction++ )
{
MetaAction* pMA = rMtf.GetAction( nCurAction );
@@ -1004,11 +1002,11 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
{
if ( ( (const MetaLineColorAction*) pMA)->IsSetting() )
{
- bLineColor = TRUE;
+ bLineColor = sal_True;
aLineColor = ( (const MetaLineColorAction*) pMA )->GetColor();
}
else
- bLineColor = FALSE;
+ bLineColor = sal_False;
}
break;
@@ -1016,11 +1014,11 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
{
if ( ( (const MetaFillColorAction*) pMA )->IsSetting() )
{
- bFillColor = TRUE;
+ bFillColor = sal_True;
aFillColor = ( (const MetaFillColorAction*) pMA )->GetColor();
}
else
- bFillColor = FALSE;
+ bFillColor = sal_False;
}
break;
@@ -1034,11 +1032,11 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
{
if ( ( (const MetaTextFillColorAction*) pMA )->IsSetting() )
{
- bTextFillColor = TRUE;
+ bTextFillColor = sal_True;
aTextFillColor = ( (const MetaTextFillColorAction*) pMA )->GetColor();
}
else
- bTextFillColor = FALSE;
+ bTextFillColor = sal_False;
}
break;
@@ -1083,7 +1081,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
pGS->bTextFillCol = bTextFillColor;
pGS->aTextFillCol = aTextFillColor;
pGS->aBackgroundCol = aBackgroundColor;
- bRegionChanged = FALSE;
+ bRegionChanged = sal_False;
pGS->aFont = maFont;
mnLatestPush = mpPS->Tell();
ImplWriteLine( "gs" );
@@ -1134,10 +1132,10 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
GfxLink aGfxLink = ( (const MetaEPSAction*) pMA )->GetLink();
const GDIMetaFile aSubstitute( ( ( const MetaEPSAction*) pMA )->GetSubstitute() );
- BOOL bLevelConflict = FALSE;
- BYTE* pSource = (BYTE*) aGfxLink.GetData();
- ULONG nSize = aGfxLink.GetDataSize();
- ULONG nParseThis = POSTSCRIPT_BOUNDINGSEARCH;
+ sal_Bool bLevelConflict = sal_False;
+ sal_uInt8* pSource = (sal_uInt8*) aGfxLink.GetData();
+ sal_uLong nSize = aGfxLink.GetDataSize();
+ sal_uLong nParseThis = POSTSCRIPT_BOUNDINGSEARCH;
if ( nSize < 64 ) // assuming eps is larger than 64 bytes
pSource = NULL;
if ( nParseThis > nSize )
@@ -1145,10 +1143,10 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
if ( pSource && ( mnLevel == 1 ) )
{
- BYTE* pFound = ImplSearchEntry( pSource, (BYTE*)"%%LanguageLevel:", nParseThis - 10, 16 );
+ sal_uInt8* pFound = ImplSearchEntry( pSource, (sal_uInt8*)"%%LanguageLevel:", nParseThis - 10, 16 );
if ( pFound )
{
- BYTE k, i = 10;
+ sal_uInt8 k, i = 10;
pFound += 16;
while ( --i )
{
@@ -1157,7 +1155,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
{
if ( k != '1' )
{
- bLevelConflict = TRUE;
+ bLevelConflict = sal_True;
mnLevelWarning++;
}
break;
@@ -1260,7 +1258,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
}
else
{
- const BYTE* pData = pA->GetData();
+ const sal_uInt8* pData = pA->GetData();
if ( pData )
{
SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), STREAM_READ );
@@ -1509,7 +1507,7 @@ void PSWriter::ImplRect( const Rectangle & rRect )
*mpPS << "neg 0 rl ";
ImplClosePathDraw();
}
- *mpPS << (BYTE)10;
+ *mpPS << (sal_uInt8)10;
mnCursorPos = 0;
}
@@ -1537,8 +1535,8 @@ void PSWriter::ImplRectFill( const Rectangle & rRect )
void PSWriter::ImplAddPath( const Polygon & rPolygon )
{
- USHORT i = 1;
- USHORT nPointCount = rPolygon.GetSize();
+ sal_uInt16 i = 1;
+ sal_uInt16 nPointCount = rPolygon.GetSize();
if ( nPointCount > 1 )
{
ImplMoveTo( rPolygon.GetPoint( 0 ) );
@@ -1713,8 +1711,8 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi
if ( !pBitmap )
return;
- INT32 nHeightOrg = pBitmap->GetSizePixel().Height();
- INT32 nHeightLeft = nHeightOrg;
+ sal_Int32 nHeightOrg = pBitmap->GetSizePixel().Height();
+ sal_Int32 nHeightLeft = nHeightOrg;
long nWidth = pBitmap->GetSizePixel().Width();
Point aSourcePos( rPoint );
@@ -1724,15 +1722,15 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi
long nHeight = nHeightLeft;
double nYHeight = nYHeightOrg;
- BOOL bDoTrans = FALSE;
+ sal_Bool bDoTrans = sal_False;
Rectangle aRect;
Region aRegion;
if ( pMaskBitmap )
{
- bDoTrans = TRUE;
- while (TRUE)
+ bDoTrans = sal_True;
+ while (sal_True)
{
if ( mnLevel == 1 )
{
@@ -1811,10 +1809,10 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi
{
for ( long x = 0; x < nWidth; x++ )
{
- ImplWriteHexByte( (BYTE)pAcc->GetPixel( y, x ) );
+ ImplWriteHexByte( (sal_uInt8)pAcc->GetPixel( y, x ) );
}
}
- *mpPS << (BYTE)10;
+ *mpPS << (sal_uInt8)10;
}
else // Level 2
{
@@ -1849,7 +1847,7 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi
{
for ( long x = 0; x < nWidth; x++ )
{
- Compress( (BYTE)pAcc->GetPixel( y, x ) );
+ Compress( (sal_uInt8)pAcc->GetPixel( y, x ) );
}
}
EndCompression();
@@ -1860,7 +1858,7 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi
{
for ( long x = 0; x < nWidth; x++ )
{
- ImplWriteHexByte( (BYTE)pAcc->GetPixel( y, x ) );
+ ImplWriteHexByte( (sal_uInt8)pAcc->GetPixel( y, x ) );
}
}
}
@@ -1874,7 +1872,7 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi
ImplWriteLine( "[/Indexed /DeviceRGB " );
ImplWriteLong( pAcc->GetPaletteEntryCount() - 1, PS_RET );
ImplWriteByte( '<', PS_NONE );
- for ( USHORT i = 0; i < pAcc->GetPaletteEntryCount(); i++ )
+ for ( sal_uInt16 i = 0; i < pAcc->GetPaletteEntryCount(); i++ )
{
BitmapColor aBitmapColor = pAcc->GetPaletteColor( i );
ImplWriteHexByte( aBitmapColor.GetRed(), PS_NONE );
@@ -1912,7 +1910,7 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi
{
for ( long x = 0; x < nWidth; x++ )
{
- Compress( (BYTE)pAcc->GetPixel( y, x ) );
+ Compress( (sal_uInt8)pAcc->GetPixel( y, x ) );
}
}
EndCompression();
@@ -1923,7 +1921,7 @@ void PSWriter::ImplBmp( Bitmap* pBitmap, Bitmap* pMaskBitmap, const Point & rPoi
{
for ( long x = 0; x < nWidth; x++ )
{
- ImplWriteHexByte( (BYTE)pAcc->GetPixel( y, x ) );
+ ImplWriteHexByte( (sal_uInt8)pAcc->GetPixel( y, x ) );
}
}
}
@@ -2008,19 +2006,19 @@ void PSWriter::ImplWriteCharacter( sal_Char nChar )
case '(' :
case ')' :
case '\\' :
- ImplWriteByte( (BYTE)'\\', PS_NONE );
+ ImplWriteByte( (sal_uInt8)'\\', PS_NONE );
}
- ImplWriteByte( (BYTE)nChar, PS_NONE );
+ ImplWriteByte( (sal_uInt8)nChar, PS_NONE );
}
//---------------------------------------------------------------------------------
-void PSWriter::ImplWriteString( const ByteString& rString, VirtualDevice& rVDev, const INT32* pDXArry, BOOL bStretch )
+void PSWriter::ImplWriteString( const ByteString& rString, VirtualDevice& rVDev, const sal_Int32* pDXArry, sal_Bool bStretch )
{
- USHORT nLen = rString.Len();
+ sal_uInt16 nLen = rString.Len();
if ( nLen )
{
- USHORT i;
+ sal_uInt16 i;
if ( pDXArry )
{
double nx = 0;
@@ -2048,7 +2046,7 @@ void PSWriter::ImplWriteString( const ByteString& rString, VirtualDevice& rVDev,
// ------------------------------------------------------------------------
-void PSWriter::ImplText( const String& rUniString, const Point& rPos, const INT32* pDXArry, sal_Int32 nWidth, VirtualDevice& rVDev )
+void PSWriter::ImplText( const String& rUniString, const Point& rPos, const sal_Int32* pDXArry, sal_Int32 nWidth, VirtualDevice& rVDev )
{
sal_uInt16 nLen = rUniString.Len();
if ( !nLen )
@@ -2077,7 +2075,7 @@ void PSWriter::ImplText( const String& rUniString, const Point& rPos, const INT3
sal_Bool bOldLineColor = bLineColor;
bLineColor = sal_False;
std::vector<PolyPolygon> aPolyPolyVec;
- if ( aVirDev.GetTextOutlines( aPolyPolyVec, rUniString, 0, 0, STRING_LEN, TRUE, nWidth, pDXArry ) )
+ if ( aVirDev.GetTextOutlines( aPolyPolyVec, rUniString, 0, 0, STRING_LEN, sal_True, nWidth, pDXArry ) )
{
// always adjust text position to match baseline alignment
ImplWriteLine( "pum" );
@@ -2155,7 +2153,7 @@ void PSWriter::ImplSetAttrForText( const Point& rPoint )
void PSWriter::ImplDefineFont( const char* pOriginalName, const char* pItalic )
{
- *mpPS << (BYTE)'/'; //convert the font pOriginalName using ISOLatin1Encoding
+ *mpPS << (sal_uInt8)'/'; //convert the font pOriginalName using ISOLatin1Encoding
*mpPS << pOriginalName;
switch ( maFont.GetWeight() )
{
@@ -2179,7 +2177,7 @@ void PSWriter::ImplDefineFont( const char* pOriginalName, const char* pItalic )
//---------------------------------------------------------------------------------
//---------------------------------------------------------------------------------
-void PSWriter::ImplClosePathDraw( ULONG nMode )
+void PSWriter::ImplClosePathDraw( sal_uLong nMode )
{
*mpPS << "pc";
mnCursorPos += 2;
@@ -2195,7 +2193,7 @@ void PSWriter::ImplPathDraw()
//---------------------------------------------------------------------------------
-inline void PSWriter::ImplWriteLineColor( ULONG nMode )
+inline void PSWriter::ImplWriteLineColor( sal_uLong nMode )
{
if ( aColor != aLineColor )
{
@@ -2203,7 +2201,7 @@ inline void PSWriter::ImplWriteLineColor( ULONG nMode )
ImplWriteColor( nMode );
}
}
-inline void PSWriter::ImplWriteFillColor( ULONG nMode )
+inline void PSWriter::ImplWriteFillColor( sal_uLong nMode )
{
if ( aColor != aFillColor )
{
@@ -2211,7 +2209,7 @@ inline void PSWriter::ImplWriteFillColor( ULONG nMode )
ImplWriteColor( nMode );
}
}
-inline void PSWriter::ImplWriteTextColor( ULONG nMode )
+inline void PSWriter::ImplWriteTextColor( sal_uLong nMode )
{
if ( aColor != aTextColor )
{
@@ -2219,7 +2217,7 @@ inline void PSWriter::ImplWriteTextColor( ULONG nMode )
ImplWriteColor( nMode );
}
}
-inline void PSWriter::ImplWriteTextFillColor( ULONG nMode )
+inline void PSWriter::ImplWriteTextFillColor( sal_uLong nMode )
{
if ( aColor != aTextFillColor )
{
@@ -2230,20 +2228,20 @@ inline void PSWriter::ImplWriteTextFillColor( ULONG nMode )
//---------------------------------------------------------------------------------
-void PSWriter::ImplWriteColor( ULONG nMode )
+void PSWriter::ImplWriteColor( sal_uLong nMode )
{
if ( mbGrayScale )
{
// writes the Color (grayscale) as a Number from 0.000 up to 1.000
- ImplWriteF( 1000 * ( (BYTE)aColor.GetRed() * 77 + (BYTE)aColor.GetGreen() * 151 +
- (BYTE)aColor.GetBlue() * 28 + 1 ) / 65536, 3, nMode );
+ ImplWriteF( 1000 * ( (sal_uInt8)aColor.GetRed() * 77 + (sal_uInt8)aColor.GetGreen() * 151 +
+ (sal_uInt8)aColor.GetBlue() * 28 + 1 ) / 65536, 3, nMode );
}
else
{
- ImplWriteB1 ( (BYTE)aColor.GetRed() );
- ImplWriteB1 ( (BYTE)aColor.GetGreen() );
- ImplWriteB1 ( (BYTE)aColor.GetBlue() );
+ ImplWriteB1 ( (sal_uInt8)aColor.GetRed() );
+ ImplWriteB1 ( (sal_uInt8)aColor.GetGreen() );
+ ImplWriteB1 ( (sal_uInt8)aColor.GetBlue() );
}
*mpPS << "c"; // ( c is defined as setrgbcolor or setgray )
ImplExecMode( nMode );
@@ -2311,37 +2309,37 @@ void PSWriter::ImplGetMapMode( const MapMode& rMapMode )
//---------------------------------------------------------------------------------
-inline void PSWriter::ImplExecMode( ULONG nMode )
+inline void PSWriter::ImplExecMode( sal_uLong nMode )
{
if ( nMode & PS_WRAP )
{
if ( mnCursorPos >= PS_LINESIZE )
{
mnCursorPos = 0;
- *mpPS << (BYTE)0xa;
+ *mpPS << (sal_uInt8)0xa;
return;
}
}
if ( nMode & PS_SPACE )
{
- *mpPS << (BYTE)32;
+ *mpPS << (sal_uInt8)32;
mnCursorPos++;
}
if ( nMode & PS_RET )
{
- *mpPS << (BYTE)0xa;
+ *mpPS << (sal_uInt8)0xa;
mnCursorPos = 0;
}
}
//---------------------------------------------------------------------------------
-inline void PSWriter::ImplWriteLine( const char* pString, ULONG nMode )
+inline void PSWriter::ImplWriteLine( const char* pString, sal_uLong nMode )
{
- ULONG i = 0;
+ sal_uLong i = 0;
while ( pString[ i ] )
{
- *mpPS << (BYTE)pString[ i++ ];
+ *mpPS << (sal_uInt8)pString[ i++ ];
}
mnCursorPos += i;
ImplExecMode( nMode );
@@ -2425,19 +2423,19 @@ void PSWriter::ImplWriteLineInfo( const LineInfo& rLineInfo )
//---------------------------------------------------------------------------------
-void PSWriter::ImplWriteLong( sal_Int32 nNumber, ULONG nMode )
+void PSWriter::ImplWriteLong( sal_Int32 nNumber, sal_uLong nMode )
{
const ByteString aNumber( ByteString::CreateFromInt32( nNumber ) );
- ULONG nLen = aNumber.Len();
+ sal_uLong nLen = aNumber.Len();
mnCursorPos += nLen;
- for ( USHORT n = 0; n < nLen; n++ )
+ for ( sal_uInt16 n = 0; n < nLen; n++ )
*mpPS << aNumber.GetChar( n );
ImplExecMode( nMode );
}
//---------------------------------------------------------------------------------
-void PSWriter::ImplWriteDouble( double fNumber, ULONG nMode )
+void PSWriter::ImplWriteDouble( double fNumber, sal_uLong nMode )
{
sal_Int32 nLength;
@@ -2456,7 +2454,7 @@ void PSWriter::ImplWriteDouble( double fNumber, ULONG nMode )
int zCount = 0;
if ( nATemp )
{
- *mpPS << (BYTE)'.';
+ *mpPS << (sal_uInt8)'.';
mnCursorPos++;
const ByteString aNumber2( ByteString::CreateFromInt32( nATemp ) );
@@ -2466,7 +2464,7 @@ void PSWriter::ImplWriteDouble( double fNumber, ULONG nMode )
mnCursorPos += 6 - nLen;
for ( n = 0; n < ( 5 - nLen ); n++ )
{
- *mpPS << (BYTE)'0';
+ *mpPS << (sal_uInt8)'0';
}
}
mnCursorPos += nLen;
@@ -2487,37 +2485,37 @@ void PSWriter::ImplWriteDouble( double fNumber, ULONG nMode )
// writes the number to stream: nNumber / ( 10^nCount )
-void PSWriter::ImplWriteF( sal_Int32 nNumber, ULONG nCount, ULONG nMode )
+void PSWriter::ImplWriteF( sal_Int32 nNumber, sal_uLong nCount, sal_uLong nMode )
{
if ( nNumber < 0 )
{
- *mpPS << (BYTE)'-';
+ *mpPS << (sal_uInt8)'-';
nNumber = -nNumber;
mnCursorPos++;
}
const ByteString aScaleFactor( ByteString::CreateFromInt32( nNumber ) );
- ULONG nLen = aScaleFactor.Len();
+ sal_uLong nLen = aScaleFactor.Len();
long nStSize = ( nCount + 1 ) - nLen;
if ( nStSize >= 1 )
{
- *mpPS << (BYTE)'0';
+ *mpPS << (sal_uInt8)'0';
mnCursorPos++;
}
if ( nStSize >= 2 )
{
- *mpPS << (BYTE)'.';
+ *mpPS << (sal_uInt8)'.';
for ( long i = 1; i < nStSize; i++ )
{
- *mpPS << (BYTE)'0';
+ *mpPS << (sal_uInt8)'0';
mnCursorPos++;
}
}
mnCursorPos += nLen;
- for( USHORT n = 0UL; n < nLen; n++ )
+ for( sal_uInt16 n = 0UL; n < nLen; n++ )
{
if ( n == nLen - nCount )
{
- *mpPS << (BYTE)'.';
+ *mpPS << (sal_uInt8)'.';
mnCursorPos++;
}
*mpPS << aScaleFactor.GetChar( n );
@@ -2527,7 +2525,7 @@ void PSWriter::ImplWriteF( sal_Int32 nNumber, ULONG nCount, ULONG nMode )
//---------------------------------------------------------------------------------
-void PSWriter::ImplWriteByte( BYTE nNumb, ULONG nMode )
+void PSWriter::ImplWriteByte( sal_uInt8 nNumb, sal_uLong nMode )
{
*mpPS << ( nNumb );
mnCursorPos++;
@@ -2536,26 +2534,26 @@ void PSWriter::ImplWriteByte( BYTE nNumb, ULONG nMode )
//---------------------------------------------------------------------------------
-void PSWriter::ImplWriteHexByte( BYTE nNumb, ULONG nMode )
+void PSWriter::ImplWriteHexByte( sal_uInt8 nNumb, sal_uLong nMode )
{
if ( ( nNumb >> 4 ) > 9 )
- *mpPS << (BYTE)( ( nNumb >> 4 ) + 'A' - 10 );
+ *mpPS << (sal_uInt8)( ( nNumb >> 4 ) + 'A' - 10 );
else
- *mpPS << (BYTE)( ( nNumb >> 4 ) + '0' );
+ *mpPS << (sal_uInt8)( ( nNumb >> 4 ) + '0' );
if ( ( nNumb & 0xf ) > 9 )
- *mpPS << (BYTE)( ( nNumb & 0xf ) + 'A' - 10 );
+ *mpPS << (sal_uInt8)( ( nNumb & 0xf ) + 'A' - 10 );
else
- *mpPS << (BYTE)( ( nNumb & 0xf ) + '0' );
+ *mpPS << (sal_uInt8)( ( nNumb & 0xf ) + '0' );
mnCursorPos += 2;
ImplExecMode( nMode );
}
//---------------------------------------------------------------------------------
-// writes the BYTE nNumb as a Number from 0.000 up to 1.000
+// writes the sal_uInt8 nNumb as a Number from 0.000 up to 1.000
-void PSWriter::ImplWriteB1( BYTE nNumb, ULONG nMode )
+void PSWriter::ImplWriteB1( sal_uInt8 nNumb, sal_uLong nMode )
{
ImplWriteF( 1000 * ( nNumb + 1 ) / 256 , 3, nMode );
}
@@ -2563,25 +2561,25 @@ void PSWriter::ImplWriteB1( BYTE nNumb, ULONG nMode )
// ------------------------------------------------------------------------
-inline void PSWriter::WriteBits( USHORT nCode, USHORT nCodeLen )
+inline void PSWriter::WriteBits( sal_uInt16 nCode, sal_uInt16 nCodeLen )
{
dwShift |= ( nCode << ( nOffset - nCodeLen ) );
nOffset -= nCodeLen;
while ( nOffset < 24 )
{
- ImplWriteHexByte( (BYTE)( dwShift >> 24 ) );
+ ImplWriteHexByte( (sal_uInt8)( dwShift >> 24 ) );
dwShift <<= 8;
nOffset += 8;
}
if ( nCode == 257 && nOffset != 32 )
- ImplWriteHexByte( (BYTE)( dwShift >> 24 ) );
+ ImplWriteHexByte( (sal_uInt8)( dwShift >> 24 ) );
}
// ------------------------------------------------------------------------
void PSWriter::StartCompression()
{
- USHORT i;
+ sal_uInt16 i;
nDataSize = 8;
nClearCode = 1 << nDataSize;
@@ -2597,7 +2595,7 @@ void PSWriter::StartCompression()
for ( i = 0; i < 4096; i++ )
{
pTable[ i ].pBrother = pTable[ i ].pFirstChild = NULL;
- pTable[ i ].nValue = (BYTE)( pTable[ i ].nCode = i );
+ pTable[ i ].nValue = (sal_uInt8)( pTable[ i ].nCode = i );
}
pPrefix = NULL;
WriteBits( nClearCode, nCodeSize );
@@ -2605,11 +2603,11 @@ void PSWriter::StartCompression()
// ------------------------------------------------------------------------
-void PSWriter::Compress( BYTE nCompThis )
+void PSWriter::Compress( sal_uInt8 nCompThis )
{
PSLZWCTreeNode* p;
- USHORT i;
- BYTE nV;
+ sal_uInt16 i;
+ sal_uInt8 nV;
if( !pPrefix )
{
@@ -2642,7 +2640,7 @@ void PSWriter::Compress( BYTE nCompThis )
}
else
{
- if( nTableSize == (USHORT)( ( 1 << nCodeSize ) - 1 ) )
+ if( nTableSize == (sal_uInt16)( ( 1 << nCodeSize ) - 1 ) )
nCodeSize++;
p = pTable + ( nTableSize++ );
@@ -2670,11 +2668,11 @@ void PSWriter::EndCompression()
// ------------------------------------------------------------------------
-BYTE* PSWriter::ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize )
+sal_uInt8* PSWriter::ImplSearchEntry( sal_uInt8* pSource, sal_uInt8* pDest, sal_uLong nComp, sal_uLong nSize )
{
while ( nComp-- >= nSize )
{
- ULONG i;
+ sal_uLong i;
for ( i = 0; i < nSize; i++ )
{
if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) )
@@ -2689,20 +2687,20 @@ BYTE* PSWriter::ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG
// ------------------------------------------------------------------------
-BOOL PSWriter::ImplGetBoundingBox( double* nNumb, BYTE* pSource, ULONG nSize )
+sal_Bool PSWriter::ImplGetBoundingBox( double* nNumb, sal_uInt8* pSource, sal_uLong nSize )
{
- BOOL bRetValue = FALSE;
- ULONG nBytesRead;
+ sal_Bool bRetValue = sal_False;
+ sal_uLong nBytesRead;
if ( nSize < 256 ) // we assume that the file is greater than 256 bytes
- return FALSE;
+ return sal_False;
if ( nSize < POSTSCRIPT_BOUNDINGSEARCH )
nBytesRead = nSize;
else
nBytesRead = POSTSCRIPT_BOUNDINGSEARCH;
- BYTE* pDest = ImplSearchEntry( pSource, (BYTE*)"%%BoundingBox:", nBytesRead, 14 );
+ sal_uInt8* pDest = ImplSearchEntry( pSource, (sal_uInt8*)"%%BoundingBox:", nBytesRead, 14 );
if ( pDest )
{
int nSecurityCount = 100; // only 100 bytes following the bounding box will be checked
@@ -2711,25 +2709,25 @@ BOOL PSWriter::ImplGetBoundingBox( double* nNumb, BYTE* pSource, ULONG nSize )
for ( int i = 0; ( i < 4 ) && nSecurityCount; i++ )
{
int nDivision = 1;
- BOOL bDivision = FALSE;
- BOOL bNegative = FALSE;
- BOOL bValid = TRUE;
+ sal_Bool bDivision = sal_False;
+ sal_Bool bNegative = sal_False;
+ sal_Bool bValid = sal_True;
while ( ( --nSecurityCount ) && ( ( *pDest == ' ' ) || ( *pDest == 0x9 ) ) )
pDest++;
- BYTE nByte = *pDest;
+ sal_uInt8 nByte = *pDest;
while ( nSecurityCount && ( nByte != ' ' ) && ( nByte != 0x9 ) && ( nByte != 0xd ) && ( nByte != 0xa ) )
{
switch ( nByte )
{
case '.' :
if ( bDivision )
- bValid = FALSE;
+ bValid = sal_False;
else
- bDivision = TRUE;
+ bDivision = sal_True;
break;
case '-' :
- bNegative = TRUE;
+ bNegative = sal_True;
break;
default :
if ( ( nByte < '0' ) || ( nByte > '9' ) )
@@ -2752,68 +2750,18 @@ BOOL PSWriter::ImplGetBoundingBox( double* nNumb, BYTE* pSource, ULONG nSize )
nNumb[i] /= nDivision;
}
if ( nSecurityCount)
- bRetValue = TRUE;
+ bRetValue = sal_True;
}
return bRetValue;
}
//================== GraphicExport - die exportierte Funktion ================
-extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pFilterConfigItem, BOOL)
+extern "C" sal_Bool __LOADONCALLAPI GraphicExport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool)
{
PSWriter aPSWriter;
return aPSWriter.WritePS( rGraphic, rStream, pFilterConfigItem );
}
-//---------------------------------------------------------------------------------
-
-extern "C" BOOL __LOADONCALLAPI DoExportDialog( FltCallDialogParameter& rPara )
-{
- BOOL bRet = FALSE;
-
- if ( rPara.pWindow )
- {
- ByteString aResMgrName( "eps" );
- ResMgr* pResMgr;
-
- pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
-
- if( pResMgr )
- {
- rPara.pResMgr = pResMgr;
- bRet = ( DlgExportEPS( rPara ).Execute() == RET_OK );
- delete pResMgr;
- }
- else
- bRet = TRUE;
- }
-
- return bRet;
-}
-
-//================== ein bischen Muell fuer Windows ==========================
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/eps/exports.map b/filter/source/graphicfilter/eps/exports.map
index 61e4682c6551..d4e28c44700c 100644
--- a/filter/source/graphicfilter/eps/exports.map
+++ b/filter/source/graphicfilter/eps/exports.map
@@ -1,7 +1,6 @@
UDK_3_0_0 {
global:
GraphicExport;
- DoExportDialog;
local:
*;
diff --git a/filter/source/graphicfilter/eps/makefile.mk b/filter/source/graphicfilter/eps/makefile.mk
index 0124a1efa662..7aa96eed929b 100644
--- a/filter/source/graphicfilter/eps/makefile.mk
+++ b/filter/source/graphicfilter/eps/makefile.mk
@@ -42,13 +42,10 @@ CDEFS+= -DEDITDEBUG
.ENDIF
SRS1NAME=$(TARGET)
-SRC1FILES = dlgeps.src \
- epsstr.src
+SRC1FILES = epsstr.src
.IF "$(L10N_framework)"==""
-EXCEPTIONSFILES= \
- $(SLO)$/eps.obj \
- $(SLO)$/dlgeps.obj
-SLOFILES = $(EXCEPTIONSFILES)
+EXCEPTIONSFILES=$(SLO)$/eps.obj
+SLOFILES = $(SLO)$/eps.obj
.ENDIF
# ==========================================================================
diff --git a/filter/source/graphicfilter/eras/eras.cxx b/filter/source/graphicfilter/eras/eras.cxx
index e28025ff1370..938ad3ef2ab5 100644
--- a/filter/source/graphicfilter/eras/eras.cxx
+++ b/filter/source/graphicfilter/eras/eras.cxx
@@ -41,37 +41,37 @@ class RASWriter {
private:
SvStream & m_rOStm;
- USHORT mpOStmOldModus;
+ sal_uInt16 mpOStmOldModus;
- BOOL mbStatus;
+ sal_Bool mbStatus;
BitmapReadAccess* mpAcc;
- ULONG mnWidth, mnHeight;
- USHORT mnColors, mnDepth;
+ sal_uLong mnWidth, mnHeight;
+ sal_uInt16 mnColors, mnDepth;
- ULONG mnRepCount;
- BYTE mnRepVal;
+ sal_uLong mnRepCount;
+ sal_uInt8 mnRepVal;
com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;
- void ImplCallback( ULONG nCurrentYPos );
- BOOL ImplWriteHeader();
+ void ImplCallback( sal_uLong nCurrentYPos );
+ sal_Bool ImplWriteHeader();
void ImplWritePalette();
void ImplWriteBody();
- void ImplPutByte( BYTE ); // RLE decoding
+ void ImplPutByte( sal_uInt8 ); // RLE decoding
public:
RASWriter(SvStream &rStream);
~RASWriter();
- BOOL WriteRAS( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem );
+ sal_Bool WriteRAS( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem );
};
//=================== Methoden von RASWriter ==============================
RASWriter::RASWriter(SvStream &rStream)
: m_rOStm(rStream)
- , mbStatus(TRUE)
+ , mbStatus(sal_True)
, mpAcc(NULL)
, mnRepCount( 0xffffffff )
{
@@ -85,15 +85,15 @@ RASWriter::~RASWriter()
// ------------------------------------------------------------------------
-void RASWriter::ImplCallback( ULONG nYPos )
+void RASWriter::ImplCallback( sal_uLong nYPos )
{
if ( xStatusIndicator.is() )
- xStatusIndicator->setValue( (USHORT)( ( 100 * nYPos ) / mnHeight ) );
+ xStatusIndicator->setValue( (sal_uInt16)( ( 100 * nYPos ) / mnHeight ) );
}
// ------------------------------------------------------------------------
-BOOL RASWriter::WriteRAS( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem)
+sal_Bool RASWriter::WriteRAS( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem)
{
Bitmap aBmp;
@@ -133,7 +133,7 @@ BOOL RASWriter::WriteRAS( const Graphic& rGraphic, FilterConfigItem* pFilterConf
aBmp.ReleaseAccess( mpAcc );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
m_rOStm.SetNumberFormatInt( mpOStmOldModus );
@@ -145,7 +145,7 @@ BOOL RASWriter::WriteRAS( const Graphic& rGraphic, FilterConfigItem* pFilterConf
// ------------------------------------------------------------------------
-BOOL RASWriter::ImplWriteHeader()
+sal_Bool RASWriter::ImplWriteHeader()
{
mnWidth = mpAcc->Width();
mnHeight = mpAcc->Height();
@@ -153,24 +153,24 @@ BOOL RASWriter::ImplWriteHeader()
{
mnColors = mpAcc->GetPaletteEntryCount();
if (mnColors == 0)
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
if ( mbStatus && mnWidth && mnHeight && mnDepth )
{
- m_rOStm << (UINT32)0x59a66a95 << (UINT32)mnWidth << (UINT32)mnHeight
- << (UINT32)mnDepth
- << (UINT32)(( ( ( ( mnWidth * mnDepth ) + 15 ) >> 4 ) << 1 ) * mnHeight)
- << (UINT32)2;
+ m_rOStm << (sal_uInt32)0x59a66a95 << (sal_uInt32)mnWidth << (sal_uInt32)mnHeight
+ << (sal_uInt32)mnDepth
+ << (sal_uInt32)(( ( ( ( mnWidth * mnDepth ) + 15 ) >> 4 ) << 1 ) * mnHeight)
+ << (sal_uInt32)2;
if ( mnDepth > 8 )
- m_rOStm << (UINT32)0 << (UINT32)0;
+ m_rOStm << (sal_uInt32)0 << (sal_uInt32)0;
else
{
- m_rOStm << (UINT32)1 << (UINT32)( mnColors * 3 );
+ m_rOStm << (sal_uInt32)1 << (sal_uInt32)( mnColors * 3 );
}
}
- else mbStatus = FALSE;
+ else mbStatus = sal_False;
return mbStatus;
}
@@ -179,7 +179,7 @@ BOOL RASWriter::ImplWriteHeader()
void RASWriter::ImplWritePalette()
{
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i < mnColors; m_rOStm << mpAcc->GetPaletteColor( i++ ).GetRed() ) ;
for ( i = 0; i < mnColors; m_rOStm << mpAcc->GetPaletteColor( i++ ).GetGreen() ) ;
@@ -190,7 +190,7 @@ void RASWriter::ImplWritePalette()
void RASWriter::ImplWriteBody()
{
- ULONG x, y;
+ sal_uLong x, y;
if ( mnDepth == 24 )
{
@@ -221,7 +221,7 @@ void RASWriter::ImplWriteBody()
}
else if ( mnDepth == 1 )
{
- BYTE nDat = 0;
+ sal_uInt8 nDat = 0;
for ( y = 0; y < mnHeight; y++ )
{
@@ -233,7 +233,7 @@ void RASWriter::ImplWriteBody()
ImplPutByte( nDat );
}
if ( x & 7 )
- ImplPutByte( sal::static_int_cast< BYTE >(nDat << ( ( ( x & 7 ) ^ 7 ) + 1)) );// write remaining bits
+ ImplPutByte( sal::static_int_cast< sal_uInt8 >(nDat << ( ( ( x & 7 ) ^ 7 ) + 1)) );// write remaining bits
if (!( ( x - 1 ) & 0x8 ) )
ImplPutByte( 0 ); // WORD ALIGNMENT ???
}
@@ -243,7 +243,7 @@ void RASWriter::ImplWriteBody()
// ------------------------------------------------------------------------
-void RASWriter::ImplPutByte( BYTE nPutThis )
+void RASWriter::ImplPutByte( sal_uInt8 nPutThis )
{
if ( mnRepCount == 0xffffffff )
{
@@ -258,15 +258,15 @@ void RASWriter::ImplPutByte( BYTE nPutThis )
{
if ( mnRepCount == 0 )
{
- m_rOStm << (BYTE)mnRepVal;
+ m_rOStm << (sal_uInt8)mnRepVal;
if ( mnRepVal == 0x80 )
- m_rOStm << (BYTE)0;
+ m_rOStm << (sal_uInt8)0;
}
else
{
- m_rOStm << (BYTE)0x80;
- m_rOStm << (BYTE)mnRepCount;
- m_rOStm << (BYTE)mnRepVal;
+ m_rOStm << (sal_uInt8)0x80;
+ m_rOStm << (sal_uInt8)mnRepCount;
+ m_rOStm << (sal_uInt8)mnRepVal;
}
mnRepVal = nPutThis;
mnRepCount = 0;
@@ -280,38 +280,11 @@ void RASWriter::ImplPutByte( BYTE nPutThis )
// - exported function -
// ---------------------
-extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool )
{
RASWriter aRASWriter(rStream);
return aRASWriter.WriteRAS( rGraphic, pFilterConfigItem );
}
-// ---------------
-// - Win16 trash -
-// ---------------
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0;
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
- if ( nHeap )
- UnlockData( 0 );
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-// ------------------------------------------------------------------------
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/etiff/etiff.cxx b/filter/source/graphicfilter/etiff/etiff.cxx
index 1bbb4814f73e..053f1085990c 100644
--- a/filter/source/graphicfilter/etiff/etiff.cxx
+++ b/filter/source/graphicfilter/etiff/etiff.cxx
@@ -63,8 +63,8 @@ struct TIFFLZWCTreeNode
TIFFLZWCTreeNode* pBrother; // naechster Knoten, der den selben Vater hat
TIFFLZWCTreeNode* pFirstChild; // erster Sohn
- USHORT nCode; // Der Code fuer den String von Pixelwerten, der sich ergibt, wenn
- USHORT nValue; // Der Pixelwert
+ sal_uInt16 nCode; // Der Code fuer den String von Pixelwerten, der sich ergibt, wenn
+ sal_uInt16 nValue; // Der Pixelwert
};
class TIFFWriter
@@ -72,64 +72,64 @@ class TIFFWriter
private:
SvStream& m_rOStm;
- UINT32 mnStreamOfs;
+ sal_uInt32 mnStreamOfs;
- BOOL mbStatus;
+ sal_Bool mbStatus;
BitmapReadAccess* mpAcc;
- UINT32 mnWidth, mnHeight, mnColors;
- UINT32 mnCurAllPictHeight;
- UINT32 mnSumOfAllPictHeight;
- UINT32 mnBitsPerPixel;
- UINT32 mnLastPercent;
+ sal_uInt32 mnWidth, mnHeight, mnColors;
+ sal_uInt32 mnCurAllPictHeight;
+ sal_uInt32 mnSumOfAllPictHeight;
+ sal_uInt32 mnBitsPerPixel;
+ sal_uInt32 mnLastPercent;
- UINT32 mnLatestIfdPos;
- UINT16 mnTagCount; // number of tags already written
- UINT32 mnCurrentTagCountPos; // offset to the position where the current
+ sal_uInt32 mnLatestIfdPos;
+ sal_uInt16 mnTagCount; // number of tags already written
+ sal_uInt32 mnCurrentTagCountPos; // offset to the position where the current
// tag count is to insert
- UINT32 mnXResPos; // if != 0 this DWORDs stores the
- UINT32 mnYResPos; // actual streamposition of the
- UINT32 mnPalPos; // Tag Entry
- UINT32 mnBitmapPos;
- UINT32 mnStripByteCountPos;
+ sal_uInt32 mnXResPos; // if != 0 this DWORDs stores the
+ sal_uInt32 mnYResPos; // actual streamposition of the
+ sal_uInt32 mnPalPos; // Tag Entry
+ sal_uInt32 mnBitmapPos;
+ sal_uInt32 mnStripByteCountPos;
TIFFLZWCTreeNode* pTable;
TIFFLZWCTreeNode* pPrefix;
- USHORT nDataSize;
- USHORT nClearCode;
- USHORT nEOICode;
- USHORT nTableSize;
- USHORT nCodeSize;
- ULONG nOffset;
- ULONG dwShift;
+ sal_uInt16 nDataSize;
+ sal_uInt16 nClearCode;
+ sal_uInt16 nEOICode;
+ sal_uInt16 nTableSize;
+ sal_uInt16 nCodeSize;
+ sal_uLong nOffset;
+ sal_uLong dwShift;
com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;
- void ImplCallback( UINT32 nPercent );
- BOOL ImplWriteHeader( BOOL bMultiPage );
+ void ImplCallback( sal_uInt32 nPercent );
+ sal_Bool ImplWriteHeader( sal_Bool bMultiPage );
void ImplWritePalette();
- BOOL ImplWriteBody();
- void ImplWriteTag( UINT16 TagID, UINT16 DataType, UINT32 NumberOfItems, UINT32 Value);
- void ImplWriteResolution( ULONG nStreamPos, sal_uInt32 nResolutionUnit );
+ sal_Bool ImplWriteBody();
+ void ImplWriteTag( sal_uInt16 TagID, sal_uInt16 DataType, sal_uInt32 NumberOfItems, sal_uInt32 Value);
+ void ImplWriteResolution( sal_uLong nStreamPos, sal_uInt32 nResolutionUnit );
void StartCompression();
- void Compress( BYTE nSrc );
+ void Compress( sal_uInt8 nSrc );
void EndCompression();
- inline void WriteBits( USHORT nCode, USHORT nCodeLen );
+ inline void WriteBits( sal_uInt16 nCode, sal_uInt16 nCodeLen );
public:
TIFFWriter(SvStream &rStream);
~TIFFWriter();
- BOOL WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem );
+ sal_Bool WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem );
};
// ------------------------------------------------------------------------
TIFFWriter::TIFFWriter(SvStream &rStream)
: m_rOStm(rStream)
- , mbStatus(TRUE)
+ , mbStatus(sal_True)
, mpAcc(NULL)
, mnCurAllPictHeight(0)
, mnSumOfAllPictHeight(0)
@@ -149,9 +149,9 @@ TIFFWriter::~TIFFWriter()
// ------------------------------------------------------------------------
-BOOL TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem)
+sal_Bool TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem)
{
- ULONG* pDummy = new ULONG; delete pDummy; // damit unter OS/2
+ sal_uLong* pDummy = new sal_uLong; delete pDummy; // damit unter OS/2
// das richtige (Tools-)new
// verwendet wird, da es sonst
// in dieser DLL nur Vector-news
@@ -173,9 +173,9 @@ BOOL TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilterCo
// we will use the BIG Endian Mode
// TIFF header
m_rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
- m_rOStm << (UINT32)0x4d4d002a; // TIFF identifier
+ m_rOStm << (sal_uInt32)0x4d4d002a; // TIFF identifier
mnLatestIfdPos = m_rOStm.Tell();
- m_rOStm << (UINT32)0;
+ m_rOStm << (sal_uInt32)0;
Animation aAnimation;
Bitmap aBmp;
@@ -190,7 +190,7 @@ BOOL TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilterCo
aAnimation.Insert( aAnimationBitmap );
}
- USHORT i;
+ sal_uInt16 i;
for ( i = 0; i < aAnimation.Count(); i++ )
mnSumOfAllPictHeight += aAnimation.Get( i ).aBmpEx.GetSizePixel().Height();
@@ -223,7 +223,7 @@ BOOL TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilterCo
ImplWritePalette();
ImplWriteBody();
}
- UINT32 nCurPos = m_rOStm.Tell();
+ sal_uInt32 nCurPos = m_rOStm.Tell();
m_rOStm.Seek( mnCurrentTagCountPos );
m_rOStm << mnTagCount;
m_rOStm.Seek( nCurPos );
@@ -231,7 +231,7 @@ BOOL TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilterCo
aBmp.ReleaseAccess( mpAcc );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
}
m_rOStm.SetNumberFormatInt( nOldFormat );
@@ -244,7 +244,7 @@ BOOL TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilterCo
// ------------------------------------------------------------------------
-void TIFFWriter::ImplCallback( UINT32 nPercent )
+void TIFFWriter::ImplCallback( sal_uInt32 nPercent )
{
if ( xStatusIndicator.is() )
{
@@ -260,7 +260,7 @@ void TIFFWriter::ImplCallback( UINT32 nPercent )
// ------------------------------------------------------------------------
-BOOL TIFFWriter::ImplWriteHeader( BOOL bMultiPage )
+sal_Bool TIFFWriter::ImplWriteHeader( sal_Bool bMultiPage )
{
mnTagCount = 0;
mnWidth = mpAcc->Width();
@@ -268,16 +268,16 @@ BOOL TIFFWriter::ImplWriteHeader( BOOL bMultiPage )
if ( mnWidth && mnHeight && mnBitsPerPixel && mbStatus )
{
- UINT32 nCurrentPos = m_rOStm.Tell();
+ sal_uInt32 nCurrentPos = m_rOStm.Tell();
m_rOStm.Seek( mnLatestIfdPos );
- m_rOStm << (UINT32)( nCurrentPos - mnStreamOfs ); // offset to the IFD
+ m_rOStm << (sl_uInt32)( nCurrentPos - mnStreamOfs ); // offset to the IFD
m_rOStm.Seek( nCurrentPos );
// (OFS8) TIFF image file directory (IFD)
mnCurrentTagCountPos = m_rOStm.Tell();
- m_rOStm << (UINT16)0; // the number of tagentrys is to insert later
+ m_rOStm << (sal_uInt16)0; // the number of tagentrys is to insert later
- UINT32 nSubFileFlags = 0;
+ sal_uInt32 nSubFileFlags = 0;
if ( bMultiPage )
nSubFileFlags |= 2;
ImplWriteTag( NewSubfileType, 4, 1, nSubFileFlags );
@@ -285,7 +285,7 @@ BOOL TIFFWriter::ImplWriteHeader( BOOL bMultiPage )
ImplWriteTag( ImageLength, 4, 1, mnHeight);
ImplWriteTag( BitsPerSample, 3, 1, ( mnBitsPerPixel == 24 ) ? 8 : mnBitsPerPixel );
ImplWriteTag( Compression, 3, 1, 5 );
- BYTE nTemp;
+ sal_uInt8 nTemp;
switch ( mnBitsPerPixel )
{
case 1 :
@@ -325,10 +325,10 @@ BOOL TIFFWriter::ImplWriteHeader( BOOL bMultiPage )
// and last we write zero to close the num dir entries list
mnLatestIfdPos = m_rOStm.Tell();
- m_rOStm << (UINT32)0; // there are no more IFD
+ m_rOStm << (sal_uInt32)0; // there are no more IFD
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
return mbStatus;
}
@@ -337,8 +337,8 @@ BOOL TIFFWriter::ImplWriteHeader( BOOL bMultiPage )
void TIFFWriter::ImplWritePalette()
{
- USHORT i;
- ULONG nCurrentPos = m_rOStm.Tell();
+ sal_uInt16 i;
+ sal_uLong nCurrentPos = m_rOStm.Tell();
m_rOStm.Seek( mnPalPos + 8 ); // the palette tag entry needs the offset
m_rOStm << static_cast<sal_uInt32>(nCurrentPos - mnStreamOfs); // to the palette colors
m_rOStm.Seek( nCurrentPos );
@@ -346,29 +346,29 @@ void TIFFWriter::ImplWritePalette()
for ( i = 0; i < mnColors; i++ )
{
const BitmapColor& rColor = mpAcc->GetPaletteColor( i );
- m_rOStm << (UINT16)( rColor.GetRed() << 8 );
+ m_rOStm << (sal_uInt16)( rColor.GetRed() << 8 );
}
for ( i = 0; i < mnColors; i++ )
{
const BitmapColor& rColor = mpAcc->GetPaletteColor( i );
- m_rOStm << (UINT16)( rColor.GetGreen() << 8 );
+ m_rOStm << (sal_uInt16)( rColor.GetGreen() << 8 );
}
for ( i = 0; i < mnColors; i++ )
{
const BitmapColor& rColor = mpAcc->GetPaletteColor( i );
- m_rOStm << (UINT16)( rColor.GetBlue() << 8 );
+ m_rOStm << (sal_uInt16)( rColor.GetBlue() << 8 );
}
}
// ------------------------------------------------------------------------
-BOOL TIFFWriter::ImplWriteBody()
+sal_Bool TIFFWriter::ImplWriteBody()
{
- BYTE nTemp = 0;
- BYTE nShift;
- ULONG j, x, y;
+ sal_uInt8 nTemp = 0;
+ sal_uInt8 nShift;
+ sal_uLong j, x, y;
- ULONG nGfxBegin = m_rOStm.Tell();
+ sal_uLong nGfxBegin = m_rOStm.Tell();
m_rOStm.Seek( mnBitmapPos + 8 ); // the strip offset tag entry needs the offset
m_rOStm << static_cast<sal_uInt32>(nGfxBegin - mnStreamOfs); // to the bitmap data
m_rOStm.Seek( nGfxBegin );
@@ -414,9 +414,9 @@ BOOL TIFFWriter::ImplWriteBody()
for ( x = 0; x < mnWidth; x++, nShift++ )
{
if (!( nShift & 1 ))
- nTemp = ( (BYTE)mpAcc->GetPixel( y, x ) << 4 );
+ nTemp = ( (sal_uInt8)mpAcc->GetPixel( y, x ) << 4 );
else
- Compress( (BYTE)( nTemp | ( mpAcc->GetPixel( y, x ) & 0xf ) ) );
+ Compress( (sal_uInt8)( nTemp | ( mpAcc->GetPixel( y, x ) & 0xf ) ) );
}
if ( nShift & 1 )
Compress( nTemp );
@@ -436,13 +436,13 @@ BOOL TIFFWriter::ImplWriteBody()
j |= ( ( ~mpAcc->GetPixel( y, x ) ) & 1 );
if ( j & 0x100 )
{
- Compress( (BYTE)j );
+ Compress( (sal_uInt8)j );
j = 1;
}
}
if ( j != 1 )
{
- Compress( (BYTE)(j << ( ( ( x & 7) ^ 7 ) + 1 ) ) );
+ Compress( (sal_uInt8)(j << ( ( ( x & 7) ^ 7 ) + 1 ) ) );
j = 1;
}
}
@@ -451,7 +451,7 @@ BOOL TIFFWriter::ImplWriteBody()
default:
{
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
break;
}
@@ -460,7 +460,7 @@ BOOL TIFFWriter::ImplWriteBody()
if ( mnStripByteCountPos && mbStatus )
{
- ULONG nGfxEnd = m_rOStm.Tell();
+ sal_uLong nGfxEnd = m_rOStm.Tell();
m_rOStm.Seek( mnStripByteCountPos + 8 );
m_rOStm << static_cast<sal_uInt32>( nGfxEnd - nGfxBegin ); // mnStripByteCountPos needs the size of the compression data
m_rOStm.Seek( nGfxEnd );
@@ -470,19 +470,19 @@ BOOL TIFFWriter::ImplWriteBody()
// ------------------------------------------------------------------------
-void TIFFWriter::ImplWriteResolution( ULONG nStreamPos, sal_uInt32 nResolutionUnit )
+void TIFFWriter::ImplWriteResolution( sal_uLong nStreamPos, sal_uInt32 nResolutionUnit )
{
- ULONG nCurrentPos = m_rOStm.Tell();
+ sal_uLong nCurrentPos = m_rOStm.Tell();
m_rOStm.Seek( nStreamPos + 8 );
- m_rOStm << (UINT32)nCurrentPos - mnStreamOfs;
+ m_rOStm << (sal_uInt32)nCurrentPos - mnStreamOfs;
m_rOStm.Seek( nCurrentPos );
- m_rOStm << (UINT32)1;
+ m_rOStm << (sal_uInt32)1;
m_rOStm << nResolutionUnit;
}
// ------------------------------------------------------------------------
-void TIFFWriter::ImplWriteTag( UINT16 nTagID, UINT16 nDataType, UINT32 nNumberOfItems, UINT32 nValue)
+void TIFFWriter::ImplWriteTag( sal_uInt16 nTagID, sal_uInt16 nDataType, sal_uInt32 nNumberOfItems, sal_uInt32 nValue)
{
mnTagCount++;
@@ -496,19 +496,19 @@ void TIFFWriter::ImplWriteTag( UINT16 nTagID, UINT16 nDataType, UINT32 nNumberOf
// ------------------------------------------------------------------------
-inline void TIFFWriter::WriteBits( USHORT nCode, USHORT nCodeLen )
+inline void TIFFWriter::WriteBits( sal_uInt16 nCode, sal_uInt16 nCodeLen )
{
dwShift |= ( nCode << ( nOffset - nCodeLen ) );
nOffset -= nCodeLen;
while ( nOffset < 24 )
{
- m_rOStm << (BYTE)( dwShift >> 24 );
+ m_rOStm << (sal_uInt8)( dwShift >> 24 );
dwShift <<= 8;
nOffset += 8;
}
if ( nCode == 257 && nOffset != 32 )
{
- m_rOStm << (BYTE)( dwShift >> 24 );
+ m_rOStm << (sal_uInt8)( dwShift >> 24 );
}
}
@@ -516,7 +516,7 @@ inline void TIFFWriter::WriteBits( USHORT nCode, USHORT nCodeLen )
void TIFFWriter::StartCompression()
{
- USHORT i;
+ sal_uInt16 i;
nDataSize = 8;
nClearCode = 1 << nDataSize;
@@ -532,7 +532,7 @@ void TIFFWriter::StartCompression()
for ( i = 0; i < 4096; i++)
{
pTable[ i ].pBrother = pTable[ i ].pFirstChild = NULL;
- pTable[ i ].nValue = (BYTE)( pTable[ i ].nCode = i );
+ pTable[ i ].nValue = (sal_uInt8)( pTable[ i ].nCode = i );
}
pPrefix = NULL;
@@ -541,11 +541,11 @@ void TIFFWriter::StartCompression()
// ------------------------------------------------------------------------
-void TIFFWriter::Compress( BYTE nCompThis )
+void TIFFWriter::Compress( sal_uInt8 nCompThis )
{
TIFFLZWCTreeNode* p;
- USHORT i;
- BYTE nV;
+ sal_uInt16 i;
+ sal_uInt8 nV;
if( !pPrefix )
{
@@ -578,7 +578,7 @@ void TIFFWriter::Compress( BYTE nCompThis )
}
else
{
- if( nTableSize == (USHORT)( ( 1 << nCodeSize ) - 1 ) )
+ if( nTableSize == (sal_uInt16)( ( 1 << nCodeSize ) - 1 ) )
nCodeSize++;
p = pTable + ( nTableSize++ );
@@ -610,37 +610,10 @@ void TIFFWriter::EndCompression()
// - exported function -
// ---------------------
-extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool )
{
TIFFWriter aWriter(rStream);
return aWriter.WriteTIFF( rGraphic, pFilterConfigItem );
}
-// ---------------
-// - Win16 trash -
-// ---------------
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0;
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
- if ( nHeap )
- UnlockData( 0 );
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-// ------------------------------------------------------------------------
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/expm/expm.cxx b/filter/source/graphicfilter/expm/expm.cxx
index 239bbafd1e01..114bf0190c3f 100644
--- a/filter/source/graphicfilter/expm/expm.cxx
+++ b/filter/source/graphicfilter/expm/expm.cxx
@@ -40,29 +40,29 @@ class XPMWriter {
private:
SvStream& m_rOStm; // Die auszugebende XPM-Datei
- USHORT mpOStmOldModus;
+ sal_uInt16 mpOStmOldModus;
- BOOL mbStatus;
- BOOL mbTrans;
+ sal_Bool mbStatus;
+ sal_Bool mbTrans;
BitmapReadAccess* mpAcc;
- ULONG mnWidth, mnHeight; // Bildausmass in Pixeln
- USHORT mnColors;
+ sal_uLong mnWidth, mnHeight; // Bildausmass in Pixeln
+ sal_uInt16 mnColors;
com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;
- void ImplCallback( USHORT nPercent );
- BOOL ImplWriteHeader();
+ void ImplCallback( sal_uInt16 nPercent );
+ sal_Bool ImplWriteHeader();
void ImplWritePalette();
- void ImplWriteColor( USHORT );
+ void ImplWriteColor( sal_uInt16 );
void ImplWriteBody();
void ImplWriteNumber( sal_Int32 );
- void ImplWritePixel( ULONG );
+ void ImplWritePixel( sal_uLong );
public:
XPMWriter(SvStream& rOStm);
~XPMWriter();
- BOOL WriteXPM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem );
+ sal_Bool WriteXPM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem );
};
//=================== Methoden von XPMWriter ==============================
@@ -70,7 +70,7 @@ public:
XPMWriter::XPMWriter(SvStream& rOStm)
: m_rOStm(rOStm)
, mbStatus(TRUE)
- , mbTrans(FALSE)
+ , mbTrans(sal_False)
, mpAcc(NULL)
{
}
@@ -83,7 +83,7 @@ XPMWriter::~XPMWriter()
// ------------------------------------------------------------------------
-void XPMWriter::ImplCallback( USHORT nPercent )
+void XPMWriter::ImplCallback( sal_uInt16 nPercent )
{
if ( xStatusIndicator.is() )
{
@@ -94,7 +94,7 @@ void XPMWriter::ImplCallback( USHORT nPercent )
// ------------------------------------------------------------------------
-BOOL XPMWriter::WriteXPM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem)
+sal_Bool XPMWriter::WriteXPM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem)
{
Bitmap aBmp;
@@ -113,7 +113,7 @@ BOOL XPMWriter::WriteXPM( const Graphic& rGraphic, FilterConfigItem* pFilterConf
if ( rGraphic.IsTransparent() ) // event. transparente Farbe erzeugen
{
- mbTrans = TRUE;
+ mbTrans = sal_True;
if ( aBmp.GetBitCount() >= 8 ) // wenn noetig Bild auf 8 bit konvertieren
aBmp.Convert( BMP_CONVERSION_8BIT_TRANS );
else
@@ -141,7 +141,7 @@ BOOL XPMWriter::WriteXPM( const Graphic& rGraphic, FilterConfigItem* pFilterConf
aBmp.ReleaseAccess( mpAcc );
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
m_rOStm.SetNumberFormatInt( mpOStmOldModus );
@@ -153,7 +153,7 @@ BOOL XPMWriter::WriteXPM( const Graphic& rGraphic, FilterConfigItem* pFilterConf
// ------------------------------------------------------------------------
-BOOL XPMWriter::ImplWriteHeader()
+sal_Bool XPMWriter::ImplWriteHeader()
{
mnWidth = mpAcc->Width();
mnHeight = mpAcc->Height();
@@ -161,15 +161,15 @@ BOOL XPMWriter::ImplWriteHeader()
{
m_rOStm << "/* XPM */\x0astatic char * image[] = \x0a{\x0a\x22";
ImplWriteNumber( mnWidth );
- m_rOStm << (BYTE)32;
+ m_rOStm << (sal_uInt8)32;
ImplWriteNumber( mnHeight );
- m_rOStm << (BYTE)32;
+ m_rOStm << (sal_uInt8)32;
ImplWriteNumber( mnColors );
- m_rOStm << (BYTE)32;
+ m_rOStm << (sal_uInt8)32;
ImplWriteNumber( ( mnColors > 26 ) ? 2 : 1 );
m_rOStm << "\x22,\x0a";
}
- else mbStatus = FALSE;
+ else mbStatus = sal_False;
return mbStatus;
}
@@ -177,15 +177,15 @@ BOOL XPMWriter::ImplWriteHeader()
void XPMWriter::ImplWritePalette()
{
- USHORT nTransIndex = 0xffff;
+ sal_uInt16 nTransIndex = 0xffff;
if ( mbTrans )
nTransIndex = mpAcc->GetBestMatchingColor( BMP_COL_TRANS );
- for ( USHORT i = 0; i < mnColors; i++ )
+ for ( sal_uInt16 i = 0; i < mnColors; i++ )
{
m_rOStm << "\x22";
ImplWritePixel( i );
- m_rOStm << (BYTE)32;
+ m_rOStm << (sal_uInt8)32;
if ( nTransIndex != i )
{
ImplWriteColor( i );
@@ -200,13 +200,13 @@ void XPMWriter::ImplWritePalette()
void XPMWriter::ImplWriteBody()
{
- for ( ULONG y = 0; y < mnHeight; y++ )
+ for ( sal_uLong y = 0; y < mnHeight; y++ )
{
- ImplCallback( (USHORT)( ( 100 * y ) / mnHeight ) ); // processing output in percent
- m_rOStm << (BYTE)0x22;
- for ( ULONG x = 0; x < mnWidth; x++ )
+ ImplCallback( (sal_uInt16)( ( 100 * y ) / mnHeight ) ); // processing output in percent
+ m_rOStm << (sal_uInt8)0x22;
+ for ( sal_uLong x = 0; x < mnWidth; x++ )
{
- ImplWritePixel( (BYTE)(mpAcc->GetPixel( y, x ) ) );
+ ImplWritePixel( (sal_uInt8)(mpAcc->GetPixel( y, x ) ) );
}
m_rOStm << "\x22,\x0a";
}
@@ -226,31 +226,31 @@ void XPMWriter::ImplWriteNumber( sal_Int32 nNumber )
// ------------------------------------------------------------------------
-void XPMWriter::ImplWritePixel( ULONG nCol )
+void XPMWriter::ImplWritePixel( sal_uLong nCol )
{
if ( mnColors > 26 )
{
- BYTE nDiff = (BYTE) ( nCol / 26 );
- m_rOStm << (BYTE)( nDiff + 'A' );
- m_rOStm << (BYTE)( nCol - ( nDiff*26 ) + 'A' );
+ sal_uInt8 nDiff = (sal_uInt8) ( nCol / 26 );
+ m_rOStm << (sal_uInt8)( nDiff + 'A' );
+ m_rOStm << (sal_uInt8)( nCol - ( nDiff*26 ) + 'A' );
}
else
- m_rOStm << (BYTE)( nCol + 'A' );
+ m_rOStm << (sal_uInt8)( nCol + 'A' );
}
// ------------------------------------------------------------------------
// ein Farbwert wird im Hexadezimalzahlformat in den Stream geschrieben
-void XPMWriter::ImplWriteColor( USHORT nNumber )
+void XPMWriter::ImplWriteColor( sal_uInt16 nNumber )
{
- ULONG nTmp;
- BYTE j;
+ sal_uLong nTmp;
+ sal_uInt8 j;
m_rOStm << "c #"; // # zeigt einen folgenden Hexwert an
const BitmapColor& rColor = mpAcc->GetPaletteColor( nNumber );
nTmp = ( rColor.GetRed() << 16 ) | ( rColor.GetGreen() << 8 ) | rColor.GetBlue();
for ( signed char i = 20; i >= 0 ; i-=4 )
{
- if ( ( j = (BYTE)( nTmp >> i ) & 0xf ) > 9 )
+ if ( ( j = (sal_uInt8)( nTmp >> i ) & 0xf ) > 9 )
j += 'A' - 10;
else
j += '0';
@@ -264,38 +264,12 @@ void XPMWriter::ImplWriteColor( USHORT nNumber )
// - exported function -
// ---------------------
-extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool )
{
XPMWriter aXPMWriter(rStream);
return aXPMWriter.WriteXPM( rGraphic, pFilterConfigItem );
}
-// ---------------
-// - Win16 trash -
-// ---------------
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0;
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
- if ( nHeap )
- UnlockData( 0 );
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-// ------------------------------------------------------------------------
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx
index f6ecc3c39a73..50a9df31df01 100644
--- a/filter/source/graphicfilter/icgm/actimpr.cxx
+++ b/filter/source/graphicfilter/icgm/actimpr.cxx
@@ -709,7 +709,7 @@ void CGMImpressOutAct::DrawPolyLine( Polygon& rPoly )
void CGMImpressOutAct::DrawPolybezier( Polygon& rPolygon )
{
- USHORT nPoints = rPolygon.GetSize();
+ sal_uInt16 nPoints = rPolygon.GetSize();
if ( ( nPoints > 1 ) && ImplCreateShape( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.OpenBezierShape" )) ) )
{
drawing::PolyPolygonBezierCoords aRetval;
@@ -728,7 +728,7 @@ void CGMImpressOutAct::DrawPolybezier( Polygon& rPolygon )
awt::Point* pInnerSequence = pOuterSequence->getArray();
drawing::PolygonFlags* pInnerFlags = pOuterFlags->getArray();
- for( USHORT i = 0; i < nPoints; i++ )
+ for( sal_uInt16 i = 0; i < nPoints; i++ )
{
*pInnerSequence++ = awt::Point( rPolygon[ i ].X(), rPolygon[ i ].Y() );
*pInnerFlags++ = (drawing::PolygonFlags)rPolygon.GetFlags( i );
diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx
index 04937099e6d7..3f95fbd04e4f 100644
--- a/filter/source/graphicfilter/icgm/class4.cxx
+++ b/filter/source/graphicfilter/icgm/class4.cxx
@@ -152,7 +152,7 @@ void CGM::ImplDoClass4()
case 0x02 : ComOut( CGM_LEVEL1 | CGM_EXTENDED_PRIMITIVES_SET, "Disjoint PolyLine" )
{
- USHORT nPoints = sal::static_int_cast< USHORT >(
+ sal_uInt16 nPoints = sal::static_int_cast< sal_uInt16 >(
mnElementSize / ImplGetPointSize());
if ( ! ( nPoints & 1 ) )
{
@@ -271,10 +271,10 @@ void CGM::ImplDoClass4()
if ( mbFigure )
mpOutAct->CloseRegion();
- USHORT nPoints = sal::static_int_cast< USHORT >(
+ sal_uInt16 nPoints = sal::static_int_cast< sal_uInt16 >(
mnElementSize / ImplGetPointSize());
Polygon aPolygon( nPoints );
- for ( USHORT i = 0; i < nPoints; i++)
+ for ( sal_uInt16 i = 0; i < nPoints; i++)
{
FloatPoint aFloatPoint;
ImplGetPoint( aFloatPoint, sal_True );
@@ -289,7 +289,7 @@ void CGM::ImplDoClass4()
if ( mbFigure )
mpOutAct->CloseRegion();
- USHORT nPoints = 0;
+ sal_uInt16 nPoints = 0;
Point* pPoints = new Point[ 0x4000 ];
PolyPolygon aPolyPolygon;
@@ -303,7 +303,7 @@ void CGM::ImplDoClass4()
if ( ( nEdgeFlag & 2 ) || ( mnParaSize == mnElementSize ) )
{
Polygon aPolygon( nPoints );
- for ( USHORT i = 0; i < nPoints; i++ )
+ for ( sal_uInt16 i = 0; i < nPoints; i++ )
{
aPolygon.SetPoint( pPoints[ i ], i );
}
@@ -727,11 +727,11 @@ void CGM::ImplDoClass4()
{
sal_uInt32 nOrder = ImplGetI( pElement->nIntegerPrecision );
- USHORT nNumberOfPoints = sal::static_int_cast< USHORT >(( mnElementSize - pElement->nIntegerPrecision ) / ImplGetPointSize());
+ sal_uInt16 nNumberOfPoints = sal::static_int_cast< sal_uInt16 >(( mnElementSize - pElement->nIntegerPrecision ) / ImplGetPointSize());
Polygon aPolygon( nNumberOfPoints );
- for ( USHORT i = 0; i < nNumberOfPoints; i++)
+ for ( sal_uInt16 i = 0; i < nNumberOfPoints; i++)
{
FloatPoint aFloatPoint;
ImplGetPoint( aFloatPoint, sal_True );
@@ -739,7 +739,7 @@ void CGM::ImplDoClass4()
}
if ( nOrder & 4 )
{
- for ( USHORT i = 0; i < nNumberOfPoints; i++ )
+ for ( sal_uInt16 i = 0; i < nNumberOfPoints; i++ )
{
if ( ( i % 3 ) == 0 )
aPolygon.SetFlags( i, POLY_NORMAL );
@@ -749,7 +749,7 @@ void CGM::ImplDoClass4()
}
else
{
- for ( USHORT i = 0; i < nNumberOfPoints; i++ )
+ for ( sal_uInt16 i = 0; i < nNumberOfPoints; i++ )
{
switch ( i & 3 )
{
diff --git a/filter/source/graphicfilter/icgm/outact.cxx b/filter/source/graphicfilter/icgm/outact.cxx
index a4d41160574b..7c3ca4be4289 100644
--- a/filter/source/graphicfilter/icgm/outact.cxx
+++ b/filter/source/graphicfilter/icgm/outact.cxx
@@ -43,7 +43,7 @@ CGMOutAct::CGMOutAct( CGM& rCGM )
mnGroupActCount = mnGroupLevel = 0;
mpGroupLevel = new sal_uInt32[ CGM_OUTACT_MAX_GROUP_LEVEL ];
mpPoints = (Point*)new sal_Int8[ 0x2000 * sizeof( Point ) ];
- mpFlags = new BYTE[ 0x2000 ];
+ mpFlags = new sal_uInt8[ 0x2000 ];
mnIndex = 0;
mpGradient = NULL;
@@ -111,12 +111,12 @@ void CGMOutAct::EndFigure()
void CGMOutAct::RegPolyLine( Polygon& rPolygon, sal_Bool bReverse )
{
- USHORT nPoints = rPolygon.GetSize();
+ sal_uInt16 nPoints = rPolygon.GetSize();
if ( nPoints )
{
if ( bReverse )
{
- for ( USHORT i = 0; i < nPoints; i++ )
+ for ( sal_uInt16 i = 0; i < nPoints; i++ )
{
mpPoints[ mnIndex + i ] = rPolygon.GetPoint( nPoints - i - 1 );
mpFlags[ mnIndex + i ] = (sal_Int8)rPolygon.GetFlags( nPoints - i - 1 );
@@ -124,7 +124,7 @@ void CGMOutAct::RegPolyLine( Polygon& rPolygon, sal_Bool bReverse )
}
else
{
- for ( USHORT i = 0; i < nPoints; i++ )
+ for ( sal_uInt16 i = 0; i < nPoints; i++ )
{
mpPoints[ mnIndex + i ] = rPolygon.GetPoint( i );
mpFlags[ mnIndex + i ] = (sal_Int8)rPolygon.GetFlags( i );
diff --git a/filter/source/graphicfilter/icgm/outact.hxx b/filter/source/graphicfilter/icgm/outact.hxx
index eacb0f035744..9e77acec277a 100644
--- a/filter/source/graphicfilter/icgm/outact.hxx
+++ b/filter/source/graphicfilter/icgm/outact.hxx
@@ -61,8 +61,8 @@ class CGMOutAct
sal_uInt32 mnGroupLevel;
sal_uInt32* mpGroupLevel;
- USHORT mnIndex; // figure
- BYTE* mpFlags;
+ sal_uInt16 mnIndex; // figure
+ sal_uInt8* mpFlags;
Point* mpPoints;
PolyPolygon maPolyPolygon;
::com::sun::star::awt::Gradient* mpGradient;
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
index 3090f3b604fc..5ddc966d0ef6 100644
--- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx
+++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
@@ -38,17 +38,17 @@
#include <math.h>
-ULONG DXF2GDIMetaFile::CountEntities(const DXFEntities & rEntities)
+sal_uLong DXF2GDIMetaFile::CountEntities(const DXFEntities & rEntities)
{
const DXFBasicEntity * pBE;
- ULONG nRes;
+ sal_uLong nRes;
nRes=0;
for (pBE=rEntities.pFirst; pBE!=NULL; pBE=pBE->pSucc) nRes++;
return nRes;
}
-Color DXF2GDIMetaFile::ConvertColor(BYTE nColor)
+Color DXF2GDIMetaFile::ConvertColor(sal_uInt8 nColor)
{
return Color(
pDXF->aPalette.GetRed( nColor ),
@@ -164,14 +164,14 @@ DXFLineInfo DXF2GDIMetaFile::GetEntityDXFLineInfo(const DXFBasicEntity & rE)
}
-BOOL DXF2GDIMetaFile::SetLineAttribute(const DXFBasicEntity & rE, ULONG /*nWidth*/)
+sal_Bool DXF2GDIMetaFile::SetLineAttribute(const DXFBasicEntity & rE, sal_uLong /*nWidth*/)
{
long nColor;
Color aColor;
nColor=GetEntityColor(rE);
- if (nColor<0) return FALSE;
- aColor=ConvertColor((BYTE)nColor);
+ if (nColor<0) return sal_False;
+ aColor=ConvertColor((sal_uInt8)nColor);
if (aActLineColor!=aColor) {
pVirDev->SetLineColor( aActLineColor = aColor );
@@ -180,18 +180,18 @@ BOOL DXF2GDIMetaFile::SetLineAttribute(const DXFBasicEntity & rE, ULONG /*nWidth
if (aActFillColor!=Color( COL_TRANSPARENT )) {
pVirDev->SetFillColor(aActFillColor = Color( COL_TRANSPARENT ));
}
- return TRUE;
+ return sal_True;
}
-BOOL DXF2GDIMetaFile::SetAreaAttribute(const DXFBasicEntity & rE)
+sal_Bool DXF2GDIMetaFile::SetAreaAttribute(const DXFBasicEntity & rE)
{
long nColor;
Color aColor;
nColor=GetEntityColor(rE);
- if (nColor<0) return FALSE;
- aColor=ConvertColor((BYTE)nColor);
+ if (nColor<0) return sal_False;
+ aColor=ConvertColor((sal_uInt8)nColor);
if (aActLineColor!=aColor) {
pVirDev->SetLineColor( aActLineColor = aColor );
@@ -200,11 +200,11 @@ BOOL DXF2GDIMetaFile::SetAreaAttribute(const DXFBasicEntity & rE)
if ( aActFillColor == Color( COL_TRANSPARENT ) || aActFillColor != aColor) {
pVirDev->SetFillColor( aActFillColor = aColor );
}
- return TRUE;
+ return sal_True;
}
-BOOL DXF2GDIMetaFile::SetFontAttribute(const DXFBasicEntity & rE, short nAngle, USHORT nHeight, double /*fWidthScale*/)
+sal_Bool DXF2GDIMetaFile::SetFontAttribute(const DXFBasicEntity & rE, short nAngle, sal_uInt16 nHeight, double /*fWidthScale*/)
{
long nColor;
Color aColor;
@@ -215,11 +215,11 @@ BOOL DXF2GDIMetaFile::SetFontAttribute(const DXFBasicEntity & rE, short nAngle,
while (nAngle<0) nAngle+=3600;
nColor=GetEntityColor(rE);
- if (nColor<0) return FALSE;
- aColor=ConvertColor((BYTE)nColor);
+ if (nColor<0) return sal_False;
+ aColor=ConvertColor((sal_uInt8)nColor);
aFont.SetColor(aColor);
- aFont.SetTransparent(TRUE);
+ aFont.SetTransparent(sal_True);
aFont.SetFamily(FAMILY_SWISS);
aFont.SetSize(Size(0,nHeight));
aFont.SetAlign(ALIGN_BASELINE);
@@ -229,7 +229,7 @@ BOOL DXF2GDIMetaFile::SetFontAttribute(const DXFBasicEntity & rE, short nAngle,
pVirDev->SetFont(aActFont);
}
- return TRUE;
+ return sal_True;
}
@@ -290,12 +290,12 @@ void DXF2GDIMetaFile::DrawPointEntity(const DXFPointEntity & rE, const DXFTransf
void DXF2GDIMetaFile::DrawCircleEntity(const DXFCircleEntity & rE, const DXFTransform & rTransform)
{
double frx,fry,fAng;
- USHORT nPoints,i;
+ sal_uInt16 nPoints,i;
DXFVector aC;
- if (SetLineAttribute(rE)==FALSE) return;
+ if (SetLineAttribute(rE)==sal_False) return;
rTransform.Transform(rE.aP0,aC);
- if (rE.fThickness==0 && rTransform.TransCircleToEllipse(rE.fRadius,frx,fry)==TRUE) {
+ if (rE.fThickness==0 && rTransform.TransCircleToEllipse(rE.fRadius,frx,fry)==sal_True) {
pVirDev->DrawEllipse(
Rectangle((long)(aC.fx-frx+0.5),(long)(aC.fy-fry+0.5),
(long)(aC.fx+frx+0.5),(long)(aC.fy+fry+0.5)));
@@ -331,24 +331,24 @@ void DXF2GDIMetaFile::DrawCircleEntity(const DXFCircleEntity & rE, const DXFTran
void DXF2GDIMetaFile::DrawArcEntity(const DXFArcEntity & rE, const DXFTransform & rTransform)
{
double frx,fry,fA1,fdA,fAng;
- USHORT nPoints,i;
+ sal_uInt16 nPoints,i;
DXFVector aC;
Point aPS,aPE;
- if (SetLineAttribute(rE)==FALSE) return;
+ if (SetLineAttribute(rE)==sal_False) return;
fA1=rE.fStart;
fdA=rE.fEnd-fA1;
while (fdA>=360.0) fdA-=360.0;
while (fdA<=0) fdA+=360.0;
rTransform.Transform(rE.aP0,aC);
- if (rE.fThickness==0 && fdA>5.0 && rTransform.TransCircleToEllipse(rE.fRadius,frx,fry)==TRUE) {
+ if (rE.fThickness==0 && fdA>5.0 && rTransform.TransCircleToEllipse(rE.fRadius,frx,fry)==sal_True) {
DXFVector aVS(cos(fA1/180.0*3.14159265359),sin(fA1/180.0*3.14159265359),0.0);
aVS*=rE.fRadius;
aVS+=rE.aP0;
DXFVector aVE(cos((fA1+fdA)/180.0*3.14159265359),sin((fA1+fdA)/180.0*3.14159265359),0.0);
aVE*=rE.fRadius;
aVE+=rE.aP0;
- if (rTransform.Mirror()==TRUE) {
+ if (rTransform.Mirror()==sal_True) {
rTransform.Transform(aVS,aPS);
rTransform.Transform(aVE,aPE);
}
@@ -363,7 +363,7 @@ void DXF2GDIMetaFile::DrawArcEntity(const DXFArcEntity & rE, const DXFTransform
);
}
else {
- nPoints=(USHORT)(fdA/360.0*(double)OptPointsPerCircle+0.5);
+ nPoints=(sal_uInt16)(fdA/360.0*(double)OptPointsPerCircle+0.5);
if (nPoints<2) nPoints=2;
Polygon aPoly(nPoints);
for (i=0; i<nPoints; i++) {
@@ -400,7 +400,7 @@ void DXF2GDIMetaFile::DrawTraceEntity(const DXFTraceEntity & rE, const DXFTransf
rTransform.Transform(rE.aP2,aPoly[3]);
pVirDev->DrawPolygon(aPoly);
if (rE.fThickness!=0) {
- USHORT i;
+ sal_uInt16 i;
Polygon aPoly2(4);
DXFVector aVAdd(0,0,rE.fThickness);
rTransform.Transform(rE.aP0+aVAdd,aPoly2[0]);
@@ -417,7 +417,7 @@ void DXF2GDIMetaFile::DrawTraceEntity(const DXFTraceEntity & rE, const DXFTransf
void DXF2GDIMetaFile::DrawSolidEntity(const DXFSolidEntity & rE, const DXFTransform & rTransform)
{
if (SetAreaAttribute(rE)) {
- USHORT nN;
+ sal_uInt16 nN;
if (rE.aP2==rE.aP3) nN=3; else nN=4;
Polygon aPoly(nN);
rTransform.Transform(rE.aP0,aPoly[0]);
@@ -434,7 +434,7 @@ void DXF2GDIMetaFile::DrawSolidEntity(const DXFSolidEntity & rE, const DXFTransf
if (nN>3) rTransform.Transform(rE.aP2+aVAdd,aPoly2[3]);
pVirDev->DrawPolygon(aPoly2);
if (SetLineAttribute(rE)) {
- USHORT i;
+ sal_uInt16 i;
for (i=0; i<nN; i++) pVirDev->DrawLine(aPoly[i],aPoly2[i]);
}
}
@@ -447,12 +447,12 @@ void DXF2GDIMetaFile::DrawTextEntity(const DXFTextEntity & rE, const DXFTransfor
DXFVector aV;
Point aPt;
double fA;
- USHORT nHeight;
+ sal_uInt16 nHeight;
short nAng;
ByteString aStr( rE.sText );
DXFTransform aT( DXFTransform(rE.fXScale,rE.fHeight,1.0,rE.fRotAngle,rE.aP0), rTransform );
aT.TransDir(DXFVector(0,1,0),aV);
- nHeight=(USHORT)(aV.Abs()+0.5);
+ nHeight=(sal_uInt16)(aV.Abs()+0.5);
fA=aT.CalcRotAngle();
nAng=(short)(fA*10.0+0.5);
aT.TransDir(DXFVector(1,0,0),aV);
@@ -506,12 +506,12 @@ void DXF2GDIMetaFile::DrawAttribEntity(const DXFAttribEntity & rE, const DXFTran
DXFVector aV;
Point aPt;
double fA;
- USHORT nHeight;
+ sal_uInt16 nHeight;
short nAng;
ByteString aStr( rE.sText );
DXFTransform aT( DXFTransform( rE.fXScale, rE.fHeight, 1.0, rE.fRotAngle, rE.aP0 ), rTransform );
aT.TransDir(DXFVector(0,1,0),aV);
- nHeight=(USHORT)(aV.Abs()+0.5);
+ nHeight=(sal_uInt16)(aV.Abs()+0.5);
fA=aT.CalcRotAngle();
nAng=(short)(fA*10.0+0.5);
aT.TransDir(DXFVector(1,0,0),aV);
@@ -527,7 +527,7 @@ void DXF2GDIMetaFile::DrawAttribEntity(const DXFAttribEntity & rE, const DXFTran
void DXF2GDIMetaFile::DrawPolyLineEntity(const DXFPolyLineEntity & rE, const DXFTransform & rTransform)
{
- USHORT i,nPolySize;
+ sal_uInt16 i,nPolySize;
double fW;
const DXFBasicEntity * pBE;
@@ -639,7 +639,7 @@ void DXF2GDIMetaFile::DrawHatchEntity(const DXFHatchEntity & rE, const DXFTransf
{
/*
double frx,fry,fA1,fdA,fAng;
- USHORT nPoints,i;
+ sal_uInt16 nPoints,i;
DXFVector aC;
Point aPS,aPE;
fA1=((DXFEdgeTypeCircularArc*)pEdge)->fStartAngle;
@@ -649,7 +649,7 @@ void DXF2GDIMetaFile::DrawHatchEntity(const DXFHatchEntity & rE, const DXFTransf
while ( fdA <= 0 )
fdA += 360.0;
rTransform.Transform(((DXFEdgeTypeCircularArc*)pEdge)->aCenter, aC);
- if ( fdA > 5.0 && rTransform.TransCircleToEllipse(((DXFEdgeTypeCircularArc*)pEdge)->fRadius,frx,fry ) == TRUE )
+ if ( fdA > 5.0 && rTransform.TransCircleToEllipse(((DXFEdgeTypeCircularArc*)pEdge)->fRadius,frx,fry ) == sal_True )
{
DXFVector aVS(cos(fA1/180.0*3.14159265359),sin(fA1/180.0*3.14159265359),0.0);
aVS*=((DXFEdgeTypeCircularArc*)pEdge)->fRadius;
@@ -657,7 +657,7 @@ void DXF2GDIMetaFile::DrawHatchEntity(const DXFHatchEntity & rE, const DXFTransf
DXFVector aVE(cos((fA1+fdA)/180.0*3.14159265359),sin((fA1+fdA)/180.0*3.14159265359),0.0);
aVE*=((DXFEdgeTypeCircularArc*)pEdge)->fRadius;
aVE+=((DXFEdgeTypeCircularArc*)pEdge)->aCenter;
- if ( rTransform.Mirror() == TRUE )
+ if ( rTransform.Mirror() == sal_True )
{
rTransform.Transform(aVS,aPS);
rTransform.Transform(aVE,aPE);
@@ -698,7 +698,7 @@ void DXF2GDIMetaFile::DrawHatchEntity(const DXFHatchEntity & rE, const DXFTransf
void DXF2GDIMetaFile::Draw3DFaceEntity(const DXF3DFaceEntity & rE, const DXFTransform & rTransform)
{
- USHORT nN,i;
+ sal_uInt16 nN,i;
if (SetLineAttribute(rE)) {
if (rE.aP2==rE.aP3) nN=3; else nN=4;
Polygon aPoly(nN);
@@ -754,13 +754,13 @@ void DXF2GDIMetaFile::DrawDimensionEntity(const DXFDimensionEntity & rE, const D
void DXF2GDIMetaFile::DrawEntities(const DXFEntities & rEntities,
const DXFTransform & rTransform)
{
- ULONG nCount=0;
+ sal_uLong nCount=0;
DXFTransform aET;
const DXFTransform * pT;
const DXFBasicEntity * pE=rEntities.pFirst;
- while (pE!=NULL && bStatus==TRUE) {
+ while (pE!=NULL && bStatus==sal_True) {
if (pE->nSpace==0) {
if (pE->aExtrusion.fz==1.0) {
pT=&rTransform;
@@ -832,7 +832,7 @@ DXF2GDIMetaFile::~DXF2GDIMetaFile()
}
-BOOL DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF, USHORT nminpercent, USHORT nmaxpercent)
+sal_Bool DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF, sal_uInt16 nminpercent, sal_uInt16 nmaxpercent)
{
double fWidth,fHeight,fScale;
DXFTransform aTransform;
@@ -842,12 +842,12 @@ BOOL DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF
pVirDev = new VirtualDevice;
pDXF = &rDXF;
- bStatus = TRUE;
+ bStatus = sal_True;
OptPointsPerCircle=50;
- nMinPercent=(ULONG)nminpercent;
- nMaxPercent=(ULONG)nmaxpercent;
+ nMinPercent=(sal_uLong)nminpercent;
+ nMaxPercent=(sal_uLong)nmaxpercent;
nLastPercent=nMinPercent;
nMainEntitiesCount=CountEntities(pDXF->aEntities);
@@ -876,7 +876,7 @@ BOOL DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF
aParentLayerDXFLineInfo.fDistance = 0;
}
- pVirDev->EnableOutput(FALSE);
+ pVirDev->EnableOutput(sal_False);
rMTF.Record(pVirDev);
aActLineColor = pVirDev->GetLineColor();
@@ -890,13 +890,13 @@ BOOL DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF
}
if (pVPort==NULL) {
- if (pDXF->aBoundingBox.bEmpty==TRUE)
- bStatus=FALSE;
+ if (pDXF->aBoundingBox.bEmpty==sal_True)
+ bStatus=sal_False;
else {
fWidth=pDXF->aBoundingBox.fMaxX-pDXF->aBoundingBox.fMinX;
fHeight=pDXF->aBoundingBox.fMaxY-pDXF->aBoundingBox.fMinY;
if (fWidth<=0 || fHeight<=0) {
- bStatus=FALSE;
+ bStatus=sal_False;
fScale = 0; // -Wall added this...
}
else {
@@ -939,12 +939,12 @@ BOOL DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF
aPrefSize.Height()=(long)(fHeight*fScale+1.5);
}
- if (bStatus==TRUE)
+ if (bStatus==sal_True)
DrawEntities(pDXF->aEntities,aTransform);
rMTF.Stop();
- if ( bStatus==TRUE )
+ if ( bStatus==sal_True )
{
rMTF.SetPrefSize( aPrefSize );
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.hxx b/filter/source/graphicfilter/idxf/dxf2mtf.hxx
index 56915314f91c..8cf0b0a41181 100644
--- a/filter/source/graphicfilter/idxf/dxf2mtf.hxx
+++ b/filter/source/graphicfilter/idxf/dxf2mtf.hxx
@@ -46,14 +46,14 @@ private:
VirtualDevice * pVirDev;
const DXFRepresentation * pDXF;
- BOOL bStatus;
+ sal_Bool bStatus;
- USHORT OptPointsPerCircle;
+ sal_uInt16 OptPointsPerCircle;
- ULONG nMinPercent;
- ULONG nMaxPercent;
- ULONG nLastPercent;
- ULONG nMainEntitiesCount;
+ sal_uLong nMinPercent;
+ sal_uLong nMaxPercent;
+ sal_uLong nLastPercent;
+ sal_uLong nMainEntitiesCount;
long nBlockColor;
DXFLineInfo aBlockDXFLineInfo;
@@ -63,9 +63,9 @@ private:
Color aActFillColor;
Font aActFont;
- ULONG CountEntities(const DXFEntities & rEntities);
+ sal_uLong CountEntities(const DXFEntities & rEntities);
- Color ConvertColor(BYTE nColor);
+ Color ConvertColor(sal_uInt8 nColor);
long GetEntityColor(const DXFBasicEntity & rE);
@@ -73,12 +73,12 @@ private:
DXFLineInfo GetEntityDXFLineInfo(const DXFBasicEntity & rE);
- BOOL SetLineAttribute(const DXFBasicEntity & rE, ULONG nWidth=0);
+ sal_Bool SetLineAttribute(const DXFBasicEntity & rE, sal_uLong nWidth=0);
- BOOL SetAreaAttribute(const DXFBasicEntity & rE);
+ sal_Bool SetAreaAttribute(const DXFBasicEntity & rE);
- BOOL SetFontAttribute(const DXFBasicEntity & rE, short nAngle,
- USHORT nHeight, double fWidthScale);
+ sal_Bool SetFontAttribute(const DXFBasicEntity & rE, short nAngle,
+ sal_uInt16 nHeight, double fWidthScale);
void DrawLineEntity(const DXFLineEntity & rE, const DXFTransform & rTransform);
@@ -116,7 +116,7 @@ public:
DXF2GDIMetaFile();
~DXF2GDIMetaFile();
- BOOL Convert( const DXFRepresentation & rDXF, GDIMetaFile & rMTF, USHORT nMinPercent, USHORT nMaxPercent);
+ sal_Bool Convert( const DXFRepresentation & rDXF, GDIMetaFile & rMTF, sal_uInt16 nMinPercent, sal_uInt16 nMaxPercent);
};
diff --git a/filter/source/graphicfilter/idxf/dxfgrprd.cxx b/filter/source/graphicfilter/idxf/dxfgrprd.cxx
index c27ef74c7575..176db97c0ba5 100644
--- a/filter/source/graphicfilter/idxf/dxfgrprd.cxx
+++ b/filter/source/graphicfilter/idxf/dxfgrprd.cxx
@@ -40,11 +40,11 @@
// a 0-sign occurs; this functions converts 0-signs to blanks and reads
// a complete line until a cr/lf is found
-BOOL DXFReadLine( SvStream& rIStm, ByteString& rStr )
+sal_Bool DXFReadLine( SvStream& rIStm, ByteString& rStr )
{
char buf[256 + 1];
- BOOL bEnd = FALSE;
- ULONG nOldFilePos = rIStm.Tell();
+ sal_Bool bEnd = sal_False;
+ sal_uLong nOldFilePos = rIStm.Tell();
char c = 0;
rStr.Erase();
@@ -53,16 +53,16 @@ BOOL DXFReadLine( SvStream& rIStm, ByteString& rStr )
// !!! weil wir blockweise
// !!! lesen
{
- USHORT nLen = (USHORT)rIStm.Read( buf, sizeof(buf)-1 );
+ sal_uInt16 nLen = (sal_uInt16)rIStm.Read( buf, sizeof(buf)-1 );
if( !nLen )
{
if( rStr.Len() == 0 )
- return FALSE;
+ return sal_False;
else
break;
}
- for( USHORT n = 0; n < nLen ; n++ )
+ for( sal_uInt16 n = 0; n < nLen ; n++ )
{
c = buf[n];
if( c != '\n' && c != '\r' )
@@ -73,14 +73,14 @@ BOOL DXFReadLine( SvStream& rIStm, ByteString& rStr )
}
else
{
- bEnd = TRUE;
+ bEnd = sal_True;
break;
}
}
}
if( !bEnd && !rIStm.GetError() && rStr.Len() )
- bEnd = TRUE;
+ bEnd = sal_True;
nOldFilePos += rStr.Len();
if( rIStm.Tell() > nOldFilePos )
@@ -100,19 +100,19 @@ BOOL DXFReadLine( SvStream& rIStm, ByteString& rStr )
// ------------------
-DXFGroupReader::DXFGroupReader(SvStream & rIStream, USHORT nminpercent, USHORT nmaxpercent ) :
+DXFGroupReader::DXFGroupReader(SvStream & rIStream, sal_uInt16 nminpercent, sal_uInt16 nmaxpercent ) :
rIS(rIStream)
{
- USHORT i;
+ sal_uInt16 i;
nIBuffPos=0;
nIBuffSize=0;
- bStatus=TRUE;
+ bStatus=sal_True;
nLastG=0;
nGCount=0;
- nMinPercent=(ULONG)nminpercent;
- nMaxPercent=(ULONG)nmaxpercent;
+ nMinPercent=(sal_uLong)nminpercent;
+ nMaxPercent=(sal_uLong)nmaxpercent;
nLastPercent=nMinPercent;
rIS.Seek(STREAM_SEEK_TO_END);
@@ -134,7 +134,7 @@ DXFGroupReader::DXFGroupReader(SvStream & rIStream, USHORT nminpercent, USHORT n
}
-USHORT DXFGroupReader::Read()
+sal_uInt16 DXFGroupReader::Read()
{
sal_uInt16 nG = 0;
if ( bStatus )
@@ -185,7 +185,7 @@ USHORT DXFGroupReader::Read()
}
-long DXFGroupReader::GetI(USHORT nG) const
+long DXFGroupReader::GetI(sal_uInt16 nG) const
{
sal_Int32 nRetValue = 0;
if ( ( nG >= 60 ) && ( nG <= 79 ) )
@@ -199,7 +199,7 @@ long DXFGroupReader::GetI(USHORT nG) const
return nRetValue;
}
-double DXFGroupReader::GetF(USHORT nG) const
+double DXFGroupReader::GetF(sal_uInt16 nG) const
{
nG-=10;
if (nG<50) return F10_59[nG];
@@ -218,7 +218,7 @@ double DXFGroupReader::GetF(USHORT nG) const
}
}
-const char * DXFGroupReader::GetS(USHORT nG) const
+const char * DXFGroupReader::GetS(sal_uInt16 nG) const
{
if (nG<10) return S0_9[nG];
else if ( nG == 100 )
@@ -233,7 +233,7 @@ const char * DXFGroupReader::GetS(USHORT nG) const
}
}
-void DXFGroupReader::SetF(USHORT nG, double fF)
+void DXFGroupReader::SetF(sal_uInt16 nG, double fF)
{
nG-=10;
if (nG<50) F10_59[nG]=fF;
@@ -252,7 +252,7 @@ void DXFGroupReader::SetF(USHORT nG, double fF)
}
-void DXFGroupReader::SetS(USHORT nG, const char * sS)
+void DXFGroupReader::SetS(sal_uInt16 nG, const char * sS)
{
char* pPtr = NULL;
if ( nG < 10 )
@@ -275,7 +275,7 @@ void DXFGroupReader::SetS(USHORT nG, const char * sS)
void DXFGroupReader::ReadLine(char * ptgt)
{
ByteString aStr;
- ULONG nLen;
+ sal_uLong nLen;
DXFReadLine( rIS, aStr );
@@ -288,13 +288,13 @@ void DXFGroupReader::ReadLine(char * ptgt)
/*
if ( pCallback )
{
- const ULONG nPercent= nMinPercent + (nMaxPercent-nMinPercent)*rIS.Tell() / nFileSize;
+ const sal_uLong nPercent= nMinPercent + (nMaxPercent-nMinPercent)*rIS.Tell() / nFileSize;
if ( nPercent >= nLastPercent + 4 )
{
nLastPercent=nPercent;
- if (((*pCallback)(pCallerData,(USHORT)nPercent))==TRUE)
- bStatus=FALSE;
+ if (((*pCallback)(pCallerData,(sal_uInt16)nPercent))==sal_True)
+ bStatus=sal_False;
}
}
*/
@@ -313,7 +313,7 @@ long DXFGroupReader::ReadI()
while(*p==0x20) p++;
if ((*p<'0' || *p>'9') && *p!='-') {
- bStatus=FALSE;
+ bStatus=sal_False;
return 0;
}
@@ -331,7 +331,7 @@ long DXFGroupReader::ReadI()
while (*p==0x20) p++;
if (*p!=0) {
- bStatus=FALSE;
+ bStatus=sal_False;
return 0;
}
@@ -347,7 +347,7 @@ double DXFGroupReader::ReadF()
p=sl;
while(*p==0x20) p++;
if ((*p<'0' || *p>'9') && *p!='.' && *p!='-') {
- bStatus=FALSE;
+ bStatus=sal_False;
return 0.0;
}
return atof(p);
diff --git a/filter/source/graphicfilter/idxf/dxfgrprd.hxx b/filter/source/graphicfilter/idxf/dxfgrprd.hxx
index 0e5855790450..ebb56788434a 100644
--- a/filter/source/graphicfilter/idxf/dxfgrprd.hxx
+++ b/filter/source/graphicfilter/idxf/dxfgrprd.hxx
@@ -42,18 +42,18 @@ public:
// Anmerkkung:
// sizeof(DXFGroupReader) ist gross, also nur dynamisch anlegen!
- DXFGroupReader( SvStream & rIStream, USHORT nMinPercent, USHORT nMaxPercent );
+ DXFGroupReader( SvStream & rIStream, sal_uInt16 nMinPercent, sal_uInt16 nMaxPercent );
- BOOL GetStatus() const;
+ sal_Bool GetStatus() const;
void SetError();
- USHORT Read();
+ sal_uInt16 Read();
// Liesst die naechste Gruppe ein und liefert den Gruppencode zurueck.
- // Im Falle eines Fehlers liefert GetStatus() FALSE, Gruppencode wird 0
+ // Im Falle eines Fehlers liefert GetStatus() sal_False, Gruppencode wird 0
// gesetzt, und es wird SetS(0,"EOF") ausgefuehrt.
- USHORT GetG() const;
+ sal_uInt16 GetG() const;
// Liefert den letzten Gruppencode (also was Read() zuletzt lieferte)
long GetI() const;
@@ -75,15 +75,15 @@ public:
// aktuelle Gruppencode angegeben werden. (DXFGroupReader speichert die Parameter
// zu allen Gruppencodes. Dadurch ist es moeglich, dass zunaechst mit Read() einige
// verschiedene Gruppen eingelesen werden, bevor sie ausgewertet werden.)
- long GetI(USHORT nG) const;
- double GetF(USHORT nG) const;
- const char * GetS(USHORT nG) const;
+ long GetI(sal_uInt16 nG) const;
+ double GetF(sal_uInt16 nG) const;
+ const char * GetS(sal_uInt16 nG) const;
// Mit folgenden Methoden koennen die aktuell gespeicherten Werte zu den
// Gruppencodes veraendert werden. (z.B. um Defaultwerte zu setzen, bevor
// 'blind' eine Menge von Gruppen eingelesen wird.)
- void SetF(USHORT nG, double fF);
- void SetS(USHORT nG, const char * sS); // (wird kopiert)
+ void SetF(sal_uInt16 nG, double fF);
+ void SetS(sal_uInt16 nG, const char * sS); // (wird kopiert)
private:
@@ -93,15 +93,15 @@ private:
void ReadS(char * ptgt);
SvStream & rIS;
- USHORT nIBuffSize,nIBuffPos;
- BOOL bStatus;
- USHORT nLastG;
- ULONG nGCount;
+ sal_uInt16 nIBuffSize,nIBuffPos;
+ sal_Bool bStatus;
+ sal_uInt16 nLastG;
+ sal_uLong nGCount;
- ULONG nMinPercent;
- ULONG nMaxPercent;
- ULONG nLastPercent;
- ULONG nFileSize;
+ sal_uLong nMinPercent;
+ sal_uLong nMaxPercent;
+ sal_uLong nLastPercent;
+ sal_uLong nFileSize;
char S0_9 [10][DXF_MAX_STRING_LEN+1]; // Strings Gruppencodes 0..9
double F10_59 [50]; // Floats Gruppencodes 10..59
@@ -119,7 +119,7 @@ private:
};
-inline BOOL DXFGroupReader::GetStatus() const
+inline sal_Bool DXFGroupReader::GetStatus() const
{
return bStatus;
}
@@ -127,10 +127,10 @@ inline BOOL DXFGroupReader::GetStatus() const
inline void DXFGroupReader::SetError()
{
- bStatus=FALSE;
+ bStatus=sal_False;
}
-inline USHORT DXFGroupReader::GetG() const
+inline sal_uInt16 DXFGroupReader::GetG() const
{
return nLastG;
}
diff --git a/filter/source/graphicfilter/idxf/dxfreprd.cxx b/filter/source/graphicfilter/idxf/dxfreprd.cxx
index 9f36a6ebdcf8..21982ce82d09 100644
--- a/filter/source/graphicfilter/idxf/dxfreprd.cxx
+++ b/filter/source/graphicfilter/idxf/dxfreprd.cxx
@@ -38,14 +38,14 @@
void DXFBoundingBox::Union(const DXFVector & rVector)
{
- if (bEmpty==TRUE) {
+ if (bEmpty==sal_True) {
fMinX=rVector.fx;
fMinY=rVector.fy;
fMinZ=rVector.fz;
fMaxX=rVector.fx;
fMaxY=rVector.fy;
fMaxZ=rVector.fz;
- bEmpty=FALSE;
+ bEmpty=sal_False;
}
else {
if (fMinX>rVector.fx) fMinX=rVector.fx;
@@ -64,11 +64,11 @@ void DXFBoundingBox::Union(const DXFVector & rVector)
DXFPalette::DXFPalette()
{
short i,j,nHue,nNSat,nVal,nC[3],nmax,nmed,nmin;
- BYTE nV;
+ sal_uInt8 nV;
- pRed =new BYTE[256];
- pGreen=new BYTE[256];
- pBlue =new BYTE[256];
+ pRed =new sal_uInt8[256];
+ pGreen=new sal_uInt8[256];
+ pBlue =new sal_uInt8[256];
// Farben 0 - 9 (normale Farben)
SetColor(0, 0x00, 0x00, 0x00); // eigentlich nie benutzt
@@ -106,15 +106,15 @@ DXFPalette::DXFPalette()
for (j=0; j<3; j++) nC[j]=(nC[j]>>1)+128;
}
for (j=0; j<3; j++) nC[j]=nC[j]*nVal/5;
- SetColor((BYTE)(i++),(BYTE)nC[0],(BYTE)nC[1],(BYTE)nC[2]);
+ SetColor((sal_uInt8)(i++),(sal_uInt8)nC[0],(sal_uInt8)nC[1],(sal_uInt8)nC[2]);
}
}
}
// Farben 250 - 255 (Grautoenne)
for (i=0; i<6; i++) {
- nV=(BYTE)(i*38+65);
- SetColor((BYTE)(250+i),nV,nV,nV);
+ nV=(sal_uInt8)(i*38+65);
+ SetColor((sal_uInt8)(250+i),nV,nV,nV);
}
}
@@ -127,7 +127,7 @@ DXFPalette::~DXFPalette()
}
-void DXFPalette::SetColor(BYTE nIndex, BYTE nRed, BYTE nGreen, BYTE nBlue)
+void DXFPalette::SetColor(sal_uInt8 nIndex, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
{
pRed[nIndex]=nRed;
pGreen[nIndex]=nGreen;
@@ -150,10 +150,10 @@ DXFRepresentation::~DXFRepresentation()
}
-BOOL DXFRepresentation::Read( SvStream & rIStream, USHORT nMinPercent, USHORT nMaxPercent)
+sal_Bool DXFRepresentation::Read( SvStream & rIStream, sal_uInt16 nMinPercent, sal_uInt16 nMaxPercent)
{
DXFGroupReader * pDGR;
- BOOL bRes;
+ sal_Bool bRes;
aTables.Clear();
aBlocks.Clear();
@@ -181,7 +181,7 @@ BOOL DXFRepresentation::Read( SvStream & rIStream, USHORT nMinPercent, USHORT nM
delete pDGR;
- if (bRes==TRUE && aBoundingBox.bEmpty==TRUE)
+ if (bRes==sal_True && aBoundingBox.bEmpty==sal_True)
CalcBoundingBox(aEntities,aBoundingBox);
return bRes;
@@ -313,7 +313,7 @@ void DXFRepresentation::CalcBoundingBox(const DXFEntities & rEntities,
pB=aBlocks.Search(pE->sName);
if (pB==NULL) break;
CalcBoundingBox(*pB,aBox);
- if (aBox.bEmpty==TRUE) break;
+ if (aBox.bEmpty==sal_True) break;
aP.fx=(aBox.fMinX-pB->aBasePoint.fx)*pE->fXScale+pE->aP0.fx;
aP.fy=(aBox.fMinY-pB->aBasePoint.fy)*pE->fYScale+pE->aP0.fy;
aP.fz=(aBox.fMinZ-pB->aBasePoint.fz)*pE->fZScale+pE->aP0.fz;
@@ -355,7 +355,7 @@ void DXFRepresentation::CalcBoundingBox(const DXFEntities & rEntities,
pB=aBlocks.Search(pE->sPseudoBlock);
if (pB==NULL) break;
CalcBoundingBox(*pB,aBox);
- if (aBox.bEmpty==TRUE) break;
+ if (aBox.bEmpty==sal_True) break;
aP.fx=aBox.fMinX-pB->aBasePoint.fx;
aP.fy=aBox.fMinY-pB->aBasePoint.fy;
aP.fz=aBox.fMinZ-pB->aBasePoint.fz;
diff --git a/filter/source/graphicfilter/idxf/dxfreprd.hxx b/filter/source/graphicfilter/idxf/dxfreprd.hxx
index 58dd7fa3139e..a9c52915d717 100644
--- a/filter/source/graphicfilter/idxf/dxfreprd.hxx
+++ b/filter/source/graphicfilter/idxf/dxfreprd.hxx
@@ -41,7 +41,7 @@
class DXFBoundingBox {
public:
- BOOL bEmpty;
+ sal_Bool bEmpty;
double fMinX;
double fMinY;
double fMinZ;
@@ -49,7 +49,7 @@ public:
double fMaxY;
double fMaxZ;
- DXFBoundingBox() { bEmpty=TRUE; }
+ DXFBoundingBox() { bEmpty=sal_True; }
void Union(const DXFVector & rVector);
};
@@ -63,15 +63,15 @@ public:
DXFPalette();
~DXFPalette();
- BYTE GetRed(BYTE nIndex) const;
- BYTE GetGreen(BYTE nIndex) const;
- BYTE GetBlue(BYTE nIndex) const;
+ sal_uInt8 GetRed(sal_uInt8 nIndex) const;
+ sal_uInt8 GetGreen(sal_uInt8 nIndex) const;
+ sal_uInt8 GetBlue(sal_uInt8 nIndex) const;
private:
- BYTE * pRed;
- BYTE * pGreen;
- BYTE * pBlue;
- void SetColor(BYTE nIndex, BYTE nRed, BYTE nGreen, BYTE nBlue);
+ sal_uInt8 * pRed;
+ sal_uInt8 * pGreen;
+ sal_uInt8 * pBlue;
+ void SetColor(sal_uInt8 nIndex, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue);
};
@@ -112,7 +112,7 @@ public:
double getGlobalLineTypeScale() const;
void setGlobalLineTypeScale(double fGlobalLineTypeScale);
- BOOL Read( SvStream & rIStream, USHORT nMinPercent, USHORT nMaxPercent);
+ sal_Bool Read( SvStream & rIStream, sal_uInt16 nMinPercent, sal_uInt16 nMaxPercent);
// Liesst die komplette DXF-Datei ein.
private:
@@ -126,9 +126,9 @@ private:
//-------------------inlines--------------------------------------------------
//----------------------------------------------------------------------------
-inline BYTE DXFPalette::GetRed(BYTE nIndex) const { return pRed[nIndex]; }
-inline BYTE DXFPalette::GetGreen(BYTE nIndex) const { return pGreen[nIndex]; }
-inline BYTE DXFPalette::GetBlue(BYTE nIndex) const { return pBlue[nIndex]; }
+inline sal_uInt8 DXFPalette::GetRed(sal_uInt8 nIndex) const { return pRed[nIndex]; }
+inline sal_uInt8 DXFPalette::GetGreen(sal_uInt8 nIndex) const { return pGreen[nIndex]; }
+inline sal_uInt8 DXFPalette::GetBlue(sal_uInt8 nIndex) const { return pBlue[nIndex]; }
inline rtl_TextEncoding DXFRepresentation::getTextEncoding() const { return mEnc; }
inline void DXFRepresentation::setTextEncoding(rtl_TextEncoding aEnc) { mEnc = aEnc; }
inline double DXFRepresentation::getGlobalLineTypeScale() const { return mfGlobalLineTypeScale; }
diff --git a/filter/source/graphicfilter/idxf/dxfvec.cxx b/filter/source/graphicfilter/idxf/dxfvec.cxx
index efad925a5aa7..6459c8bcd54a 100644
--- a/filter/source/graphicfilter/idxf/dxfvec.cxx
+++ b/filter/source/graphicfilter/idxf/dxfvec.cxx
@@ -175,7 +175,7 @@ void DXFTransform::TransDir(const DXFVector & rSrc, DXFVector & rTgt) const
}
-BOOL DXFTransform::TransCircleToEllipse(double fRadius, double & rEx, double & rEy) const
+sal_Bool DXFTransform::TransCircleToEllipse(double fRadius, double & rEx, double & rEy) const
{
double fMXAbs=aMX.Abs();
double fMYAbs=aMY.Abs();
@@ -186,22 +186,22 @@ BOOL DXFTransform::TransCircleToEllipse(double fRadius, double & rEx, double & r
{
rEx=fabs(aMX.fx*fRadius);
rEy=fabs(aMY.fy*fRadius);
- return TRUE;
+ return sal_True;
}
else if (fabs(aMX.fx)<=fNearNull && fabs(aMX.fz)<=fNearNull &&
fabs(aMY.fy)<=fNearNull && fabs(aMY.fz)<=fNearNull)
{
rEx=fabs(aMY.fx*fRadius);
rEy=fabs(aMX.fy*fRadius);
- return TRUE;
+ return sal_True;
}
else if (fabs(fMXAbs-fMYAbs)<=fNearNull &&
fabs(aMX.fz)<=fNearNull && fabs(aMY.fz)<=fNearNull)
{
rEx=rEy=fabs(((fMXAbs+fMYAbs)/2)*fRadius);
- return TRUE;
+ return sal_True;
}
- else return FALSE;
+ else return sal_False;
}
LineInfo DXFTransform::Transform(const DXFLineInfo& aDXFLineInfo) const
@@ -216,9 +216,9 @@ LineInfo DXFTransform::Transform(const DXFLineInfo& aDXFLineInfo) const
aLineInfo.SetStyle( aDXFLineInfo.eStyle );
aLineInfo.SetWidth( (sal_Int32) (aDXFLineInfo.fWidth * scale + 0.5) );
- aLineInfo.SetDashCount( static_cast< USHORT >( aDXFLineInfo.nDashCount ) );
+ aLineInfo.SetDashCount( static_cast< sal_uInt16 >( aDXFLineInfo.nDashCount ) );
aLineInfo.SetDashLen( (sal_Int32) (aDXFLineInfo.fDashLen * scale + 0.5) );
- aLineInfo.SetDotCount( static_cast< USHORT >( aDXFLineInfo.nDotCount ) );
+ aLineInfo.SetDotCount( static_cast< sal_uInt16 >( aDXFLineInfo.nDotCount ) );
aLineInfo.SetDotLen( (sal_Int32) (aDXFLineInfo.fDotLen * scale + 0.5) );
aLineInfo.SetDistance( (sal_Int32) (aDXFLineInfo.fDistance * scale + 0.5) );
@@ -231,7 +231,7 @@ LineInfo DXFTransform::Transform(const DXFLineInfo& aDXFLineInfo) const
return aLineInfo;
}
-ULONG DXFTransform::TransLineWidth(double fW) const
+sal_uLong DXFTransform::TransLineWidth(double fW) const
{
double fex,fey;
@@ -239,7 +239,7 @@ ULONG DXFTransform::TransLineWidth(double fW) const
fey=sqrt(aMY.fx*aMY.fx + aMY.fy*aMY.fy);
// ###
// printf("fex=%f fey=%f\n", fex, fey);
- return (ULONG)(fabs(fW)*(fex+fey)/2.0+0.5);
+ return (sal_uLong)(fabs(fW)*(fex+fey)/2.0+0.5);
}
@@ -248,9 +248,9 @@ double DXFTransform::CalcRotAngle() const
return atan2(aMX.fy,aMX.fx)/3.14159265359*180.0;
}
-BOOL DXFTransform::Mirror() const
+sal_Bool DXFTransform::Mirror() const
{
- if (aMZ.SProd(aMX*aMY)<0) return TRUE; else return FALSE;
+ if (aMZ.SProd(aMX*aMY)<0) return sal_True; else return sal_False;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/idxf/dxfvec.hxx b/filter/source/graphicfilter/idxf/dxfvec.hxx
index 3edc2d053294..2a186597e7c5 100644
--- a/filter/source/graphicfilter/idxf/dxfvec.hxx
+++ b/filter/source/graphicfilter/idxf/dxfvec.hxx
@@ -100,8 +100,8 @@ public:
DXFVector Unit() const;
// Aequivalenz oder nicht:
- BOOL operator == (const DXFVector & rV) const;
- BOOL operator != (const DXFVector & rV) const;
+ sal_Bool operator == (const DXFVector & rV) const;
+ sal_Bool operator != (const DXFVector & rV) const;
};
//------------------------------------------------------------------------------
@@ -149,20 +149,20 @@ public:
void TransDir(const DXFVector & rSrc, DXFVector & rTgt) const;
// Transformation eines relativen Vektors (also kein Verschiebung)
- BOOL TransCircleToEllipse(double fRadius, double & rEx, double & rEy) const;
+ sal_Bool TransCircleToEllipse(double fRadius, double & rEx, double & rEy) const;
// Versucht, einen Kreis (in der XY-Ebene) zu transformieren, so dass eine
// ausgerichtete Ellipse entsteht. Wenn das nicht geht, weil Ellipse
- // in belibieger Lage entstehen wuerde, wird FALSE geliefert.
+ // in belibieger Lage entstehen wuerde, wird sal_False geliefert.
// (Der Mittelpunkt wird hiermit nicht transformiert, nehme Transform(..))
- ULONG TransLineWidth(double fW) const;
+ sal_uLong TransLineWidth(double fW) const;
// Transformiert die Liniendicke (so gut es geht)
double CalcRotAngle() const;
// Ermittelt den Rotationswinkel um die Z-Achse (in Grad)
- BOOL Mirror() const;
- // Liefert TRUE, wenn die Matrix ein Linkssystem bildet
+ sal_Bool Mirror() const;
+ // Liefert sal_True, wenn die Matrix ein Linkssystem bildet
LineInfo Transform(const DXFLineInfo& aDXFLineInfo) const;
// Transform to LineInfo
@@ -246,17 +246,17 @@ inline DXFVector DXFVector::operator * (double fs) const
}
-inline BOOL DXFVector::operator == (const DXFVector & rV) const
+inline sal_Bool DXFVector::operator == (const DXFVector & rV) const
{
- if (fx==rV.fx && fy==rV.fy && fz==rV.fz) return TRUE;
- else return FALSE;
+ if (fx==rV.fx && fy==rV.fy && fz==rV.fz) return sal_True;
+ else return sal_False;
}
-inline BOOL DXFVector::operator != (const DXFVector & rV) const
+inline sal_Bool DXFVector::operator != (const DXFVector & rV) const
{
- if (fx!=rV.fx || fy!=rV.fy || fz!=rV.fz) return TRUE;
- else return FALSE;
+ if (fx!=rV.fx || fy!=rV.fy || fz!=rV.fz) return sal_True;
+ else return sal_False;
}
#endif
diff --git a/filter/source/graphicfilter/idxf/idxf.cxx b/filter/source/graphicfilter/idxf/idxf.cxx
index de5b2e851af7..3bdb32898d55 100644
--- a/filter/source/graphicfilter/idxf/idxf.cxx
+++ b/filter/source/graphicfilter/idxf/idxf.cxx
@@ -38,45 +38,19 @@
//================== GraphicImport - die exportierte Funktion ================
-extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool )
{
DXFRepresentation aDXF;
DXF2GDIMetaFile aConverter;
GDIMetaFile aMTF;
- if ( aDXF.Read( rStream, 0, 60 ) == FALSE )
- return FALSE;
- if ( aConverter.Convert( aDXF, aMTF, 60, 100 ) == FALSE )
- return FALSE;
+ if ( aDXF.Read( rStream, 0, 60 ) == sal_False )
+ return sal_False;
+ if ( aConverter.Convert( aDXF, aMTF, 60, 100 ) == sal_False )
+ return sal_False;
rGraphic=Graphic(aMTF);
- return TRUE;
+ return sal_True;
}
-//============================= fuer Windows ==================================
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx
index d01392a01f70..d51f4e67e0b1 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -64,11 +64,11 @@
|*
*************************************************************************/
-static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize )
+static sal_uInt8* ImplSearchEntry( sal_uInt8* pSource, sal_uInt8* pDest, sal_uLong nComp, sal_uLong nSize )
{
while ( nComp-- >= nSize )
{
- ULONG i;
+ sal_uLong i;
for ( i = 0; i < nSize; i++ )
{
if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) )
@@ -83,24 +83,24 @@ static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSi
//--------------------------------------------------------------------------
// SecurityCount is the buffersize of the buffer in which we will parse for a number
-static long ImplGetNumber( BYTE **pBuf, int& nSecurityCount )
+static long ImplGetNumber( sal_uInt8 **pBuf, int& nSecurityCount )
{
- BOOL bValid = TRUE;
- BOOL bNegative = FALSE;
+ sal_Bool bValid = sal_True;
+ sal_Bool bNegative = sal_False;
long nRetValue = 0;
while ( ( --nSecurityCount ) && ( ( **pBuf == ' ' ) || ( **pBuf == 0x9 ) ) )
(*pBuf)++;
- BYTE nByte = **pBuf;
+ sal_uInt8 nByte = **pBuf;
while ( nSecurityCount && ( nByte != ' ' ) && ( nByte != 0x9 ) && ( nByte != 0xd ) && ( nByte != 0xa ) )
{
switch ( nByte )
{
case '.' :
// we'll only use the integer format
- bValid = FALSE;
+ bValid = sal_False;
break;
case '-' :
- bNegative = TRUE;
+ bNegative = sal_True;
break;
default :
if ( ( nByte < '0' ) || ( nByte > '9' ) )
@@ -122,12 +122,12 @@ static long ImplGetNumber( BYTE **pBuf, int& nSecurityCount )
//--------------------------------------------------------------------------
-static int ImplGetLen( BYTE* pBuf, int nMax )
+static int ImplGetLen( sal_uInt8* pBuf, int nMax )
{
int nLen = 0;
while( nLen != nMax )
{
- BYTE nDat = *pBuf++;
+ sal_uInt8 nDat = *pBuf++;
if ( nDat == 0x0a || nDat == 0x25 )
break;
nLen++;
@@ -149,7 +149,7 @@ static void MakeAsMeta(Graphic &rGraphic)
aSize = Application::GetDefaultDevice()->LogicToLogic( aSize,
aBmp.GetPrefMapMode(), MAP_100TH_MM );
- aVDev.EnableOutput( FALSE );
+ aVDev.EnableOutput( sal_False );
aMtf.Record( &aVDev );
aVDev.DrawBitmap( Point(), aSize, rGraphic.GetBitmap() );
aMtf.Stop();
@@ -408,7 +408,7 @@ void CreateMtfReplacementAction( GDIMetaFile& rMtf, SvStream& rStrm, sal_uInt32
aReplacement.Write( pBuf, nSizeTIFF );
delete[] pBuf;
}
- rMtf.AddAction( (MetaAction*)( new MetaCommentAction( aComment, 0, (const BYTE*)aReplacement.GetData(), aReplacement.Tell() ) ) );
+ rMtf.AddAction( (MetaAction*)( new MetaCommentAction( aComment, 0, (const sal_uInt8*)aReplacement.GetData(), aReplacement.Tell() ) ) );
}
else
rMtf.AddAction( (MetaAction*)( new MetaCommentAction( aComment, 0, NULL, 0 ) ) );
@@ -422,7 +422,7 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead,
VirtualDevice aVDev;
Font aFont;
- aVDev.EnableOutput( FALSE );
+ aVDev.EnableOutput( sal_False );
aMtf.Record( &aVDev );
aVDev.SetLineColor( Color( COL_RED ) );
aVDev.SetFillColor();
@@ -438,14 +438,14 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead,
String aString;
int nLen;
- BYTE* pDest = ImplSearchEntry( pBuf, (BYTE*)"%%Title:", nBytesRead - 32, 8 );
+ sal_uInt8* pDest = ImplSearchEntry( pBuf, (sal_uInt8*)"%%Title:", nBytesRead - 32, 8 );
if ( pDest )
{
pDest += 8;
if ( *pDest == ' ' )
pDest++;
nLen = ImplGetLen( pDest, 32 );
- BYTE aOldValue(pDest[ nLen ]); pDest[ nLen ] = 0;
+ sal_uInt8 aOldValue(pDest[ nLen ]); pDest[ nLen ] = 0;
if ( strcmp( (const char*)pDest, "none" ) != 0 )
{
aString.AppendAscii( " Title:" );
@@ -454,27 +454,27 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead,
}
pDest[ nLen ] = aOldValue;
}
- pDest = ImplSearchEntry( pBuf, (BYTE*)"%%Creator:", nBytesRead - 32, 10 );
+ pDest = ImplSearchEntry( pBuf, (sal_uInt8*)"%%Creator:", nBytesRead - 32, 10 );
if ( pDest )
{
pDest += 10;
if ( *pDest == ' ' )
pDest++;
nLen = ImplGetLen( pDest, 32 );
- BYTE aOldValue(pDest[ nLen ]); pDest[ nLen ] = 0;
+ sal_uInt8 aOldValue(pDest[ nLen ]); pDest[ nLen ] = 0;
aString.AppendAscii( " Creator:" );
aString.AppendAscii( (char*)pDest );
aString.AppendAscii( "\n" );
pDest[ nLen ] = aOldValue;
}
- pDest = ImplSearchEntry( pBuf, (BYTE*)"%%CreationDate:", nBytesRead - 32, 15 );
+ pDest = ImplSearchEntry( pBuf, (sal_uInt8*)"%%CreationDate:", nBytesRead - 32, 15 );
if ( pDest )
{
pDest += 15;
if ( *pDest == ' ' )
pDest++;
nLen = ImplGetLen( pDest, 32 );
- BYTE aOldValue(pDest[ nLen ]); pDest[ nLen ] = 0;
+ sal_uInt8 aOldValue(pDest[ nLen ]); pDest[ nLen ] = 0;
if ( strcmp( (const char*)pDest, "none" ) != 0 )
{
aString.AppendAscii( " CreationDate:" );
@@ -483,13 +483,13 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead,
}
pDest[ nLen ] = aOldValue;
}
- pDest = ImplSearchEntry( pBuf, (BYTE*)"%%LanguageLevel:", nBytesRead - 4, 16 );
+ pDest = ImplSearchEntry( pBuf, (sal_uInt8*)"%%LanguageLevel:", nBytesRead - 4, 16 );
if ( pDest )
{
pDest += 16;
int nCount = 4;
long nNumber = ImplGetNumber( &pDest, nCount );
- if ( nCount && ( (UINT32)nNumber < 10 ) )
+ if ( nCount && ( (sal_uInt32)nNumber < 10 ) )
{
aString.AppendAscii( " LanguageLevel:" );
aString.Append( UniString::CreateFromInt32( nNumber ) );
@@ -508,13 +508,13 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead,
//================== GraphicImport - die exportierte Funktion ================
#ifdef WNT
-extern "C" BOOL _cdecl GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL)
+extern "C" sal_Bool _cdecl GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool)
#else
-extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL)
+extern "C" sal_Bool GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool)
#endif
{
if ( rStream.GetError() )
- return FALSE;
+ return sal_False;
Graphic aGraphic;
sal_Bool bRetValue = sal_False;
@@ -541,7 +541,7 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf
{
rStream.Seek( nOrigPos + nPosWMF );
if ( GraphicConverter::Import( rStream, aGraphic, CVT_WMF ) == ERRCODE_NONE )
- bHasPreview = bRetValue = TRUE;
+ bHasPreview = bRetValue = sal_True;
}
}
else
@@ -557,7 +557,7 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf
{
MakeAsMeta(aGraphic);
rStream.Seek( nOrigPos + nPosTIFF );
- bHasPreview = bRetValue = TRUE;
+ bHasPreview = bRetValue = sal_True;
}
}
}
@@ -570,8 +570,8 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf
sal_uInt8* pHeader = new sal_uInt8[ 22 ];
rStream.Seek( nPSStreamPos );
rStream.Read( pHeader, 22 ); // check PostScript header
- if ( ImplSearchEntry( pHeader, (BYTE*)"%!PS-Adobe", 10, 10 ) &&
- ImplSearchEntry( &pHeader[ 15 ], (BYTE*)"EPS", 3, 3 ) )
+ if ( ImplSearchEntry( pHeader, (sal_uInt8*)"%!PS-Adobe", 10, 10 ) &&
+ ImplSearchEntry( &pHeader[ 15 ], (sal_uInt8*)"EPS", 3, 3 ) )
{
rStream.Seek( nPSStreamPos );
sal_uInt8* pBuf = new sal_uInt8[ nPSSize ];
@@ -584,7 +584,7 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf
int nSecurityCount = 32;
if ( !bHasPreview ) // if there is no tiff/wmf preview, we will parse for an preview in the eps prolog
{
- BYTE* pDest = ImplSearchEntry( pBuf, (BYTE*)"%%BeginPreview:", nBytesRead - 32, 15 );
+ sal_uInt8* pDest = ImplSearchEntry( pBuf, (sal_uInt8*)"%%BeginPreview:", nBytesRead - 32, 15 );
if ( pDest )
{
pDest += 15;
@@ -592,7 +592,7 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf
long nHeight = ImplGetNumber( &pDest, nSecurityCount );
long nBitDepth = ImplGetNumber( &pDest, nSecurityCount );
long nScanLines = ImplGetNumber( &pDest, nSecurityCount );
- pDest = ImplSearchEntry( pDest, (BYTE*)"%", 16, 1 ); // go to the first Scanline
+ pDest = ImplSearchEntry( pDest, (sal_uInt8*)"%", 16, 1 ); // go to the first Scanline
if ( nSecurityCount && pDest && nWidth && nHeight && ( ( nBitDepth == 1 ) || ( nBitDepth == 8 ) ) && nScanLines )
{
rStream.Seek( nBufStartPos + ( pDest - pBuf ) );
@@ -602,8 +602,8 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf
if ( pAcc )
{
int nBitsLeft;
- BOOL bIsValid = TRUE;
- BYTE nDat = 0;
+ sal_Bool bIsValid = sal_True;
+ sal_uInt8 nDat = 0;
char nByte;
for ( long y = 0; bIsValid && ( y < nHeight ); y++ )
{
@@ -619,7 +619,7 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf
{
case 0x0a :
if ( --nScanLines < 0 )
- bIsValid = FALSE;
+ bIsValid = sal_False;
case 0x09 :
case 0x0d :
case 0x20 :
@@ -634,7 +634,7 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf
nByte &=~0x20; // case none sensitive for hexadezimal values
nByte -= ( 'A' - 10 );
if ( nByte > 15 )
- bIsValid = FALSE;
+ bIsValid = sal_False;
}
else
nByte -= '0';
@@ -643,14 +643,14 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf
nDat |= ( nByte ^ 0xf ); // in epsi a zero bit represents white color
}
else
- bIsValid = FALSE;
+ bIsValid = sal_False;
}
break;
}
}
}
if ( nBitDepth == 1 )
- pAcc->SetPixel( y, x, sal::static_int_cast< BYTE >(( nDat >> nBitsLeft ) & 1) );
+ pAcc->SetPixel( y, x, sal::static_int_cast< sal_uInt8 >(( nDat >> nBitsLeft ) & 1) );
else
{
pAcc->SetPixel( y, x, ( nDat ) ? 1 : 0 ); // nBitDepth == 8
@@ -663,7 +663,7 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf
VirtualDevice aVDev;
GDIMetaFile aMtf;
Size aSize;
- aVDev.EnableOutput( FALSE );
+ aVDev.EnableOutput( sal_False );
aMtf.Record( &aVDev );
aSize = aBitmap.GetPrefSize();
if( !aSize.Width() || !aSize.Height() )
@@ -676,7 +676,7 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf
aMtf.SetPrefMapMode( MAP_100TH_MM );
aMtf.SetPrefSize( aSize );
aGraphic = aMtf;
- bHasPreview = bRetValue = TRUE;
+ bHasPreview = bRetValue = sal_True;
}
aBitmap.ReleaseAccess( pAcc );
}
@@ -684,7 +684,7 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf
}
}
- BYTE* pDest = ImplSearchEntry( pBuf, (BYTE*)"%%BoundingBox:", nBytesRead, 14 );
+ sal_uInt8* pDest = ImplSearchEntry( pBuf, (sal_uInt8*)"%%BoundingBox:", nBytesRead, 14 );
if ( pDest )
{
nSecurityCount = 100;
@@ -698,7 +698,7 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf
if ( nSecurityCount)
{
bGraphicLinkCreated = sal_True;
- GfxLink aGfxLink( pBuf, nPSSize, GFX_LINK_TYPE_EPS_BUFFER, TRUE ) ;
+ GfxLink aGfxLink( pBuf, nPSSize, GFX_LINK_TYPE_EPS_BUFFER, sal_True ) ;
GDIMetaFile aMtf;
long nWidth = nNumb[2] - nNumb[0] + 1;
@@ -740,29 +740,4 @@ extern "C" BOOL GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConf
return ( bRetValue );
}
-//================== ein bischen Muell fuer Windows ==========================
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index cede7d9a9851..1a46511da40d 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -220,19 +220,19 @@ enum PenStyle { PEN_NULL, PEN_SOLID, PEN_DOT, PEN_DASH, PEN_DASHDOT };
struct OSPalette {
OSPalette * pSucc;
sal_uInt32 * p0RGB; // Darf auch NULL sein!
- USHORT nSize;
+ sal_uInt16 nSize;
};
struct OSArea {
OSArea * pSucc;
- BYTE nFlags;
+ sal_uInt8 nFlags;
PolyPolygon aPPoly;
- BOOL bClosed;
+ sal_Bool bClosed;
Color aCol;
Color aBgCol;
RasterOp eMix;
RasterOp eBgMix;
- BOOL bFill;
+ sal_Bool bFill;
OSArea(){} ~OSArea(){}
};
@@ -241,8 +241,8 @@ struct OSPath
OSPath* pSucc;
sal_uInt32 nID;
PolyPolygon aPPoly;
- BOOL bClosed;
- BOOL bStroke;
+ sal_Bool bClosed;
+ sal_Bool bStroke;
OSPath(){}
~OSPath(){}
@@ -250,28 +250,28 @@ struct OSPath
struct OSFont {
OSFont * pSucc;
- ULONG nID;
+ sal_uLong nID;
Font aFont;
OSFont(){} ~OSFont(){}
};
struct OSBitmap {
OSBitmap * pSucc;
- ULONG nID;
+ sal_uLong nID;
Bitmap aBitmap;
// Waehrend des Lesens der Bitmap benoetigt:
SvStream * pBMP; // Zeiger auf temporaere Windows-BMP-Datei oder NULL
sal_uInt32 nWidth, nHeight;
- USHORT nBitsPerPixel;
- ULONG nMapPos;
+ sal_uInt16 nBitsPerPixel;
+ sal_uLong nMapPos;
OSBitmap(){} ~OSBitmap(){}
};
struct OSAttr {
OSAttr * pSucc;
- USHORT nPushOrder;
- BYTE nIvAttrA, nIvAttrP; // Spezialvariablen fuer den Order "GOrdPIvAtr"
+ sal_uInt16 nPushOrder;
+ sal_uInt8 nIvAttrA, nIvAttrP; // Spezialvariablen fuer den Order "GOrdPIvAtr"
Color aLinCol;
Color aLinBgCol;
@@ -297,29 +297,29 @@ struct OSAttr {
short nChrAng;
// long nChrBreakExtra;
Size aChrCellSize;
-// BYTE nChrDir;
+// sal_uInt8 nChrDir;
// long nChrExtra;
-// BYTE nChrPrec;
- ULONG nChrSet;
+// sal_uInt8 nChrPrec;
+ sal_uLong nChrSet;
// Size aChrShear;
Point aCurPos;
// long nFracLinWidth;
-// BYTE nLinEnd;
-// BYTE nLinJoin;
+// sal_uInt8 nLinEnd;
+// sal_uInt8 nLinJoin;
PenStyle eLinStyle;
- USHORT nLinWidth;
+ sal_uInt16 nLinWidth;
Size aMrkCellSize;
- BYTE nMrkPrec;
- BYTE nMrkSet;
- BYTE nMrkSymbol;
+ sal_uInt8 nMrkPrec;
+ sal_uInt8 nMrkSet;
+ sal_uInt8 nMrkSymbol;
// //... aModTransform;
// Point aPatRef;
-// BYTE nPatSet;
- BOOL bFill;
-// ULONG nPickId;
+// sal_uInt8 nPatSet;
+ sal_Bool bFill;
+// sal_uLong nPickId;
// //... aSegBound;
- USHORT nStrLinWidth;
-// BYTE nTxtAlignHor,nTxtAlignVer;
+ sal_uInt16 nStrLinWidth;
+// sal_uInt8 nTxtAlignHor,nTxtAlignVer;
// //... aViewTransform;
// //... aViewWindow;
OSAttr(){} ~OSAttr(){}
@@ -335,12 +335,12 @@ private:
VirtualDevice * pVirDev; // Hier werden die Drawing-Methoden aufgerufen.
// Dabei findet ein Recording in das GDIMetaFile
// statt.
- ULONG nOrigPos; // Anfaengliche Position in pOS2MET
- UINT16 nOrigNumberFormat; // Anfaengliches Nummern-Format von pOS2MET
+ sal_uLong nOrigPos; // Anfaengliche Position in pOS2MET
+ sal_uInt16 nOrigNumberFormat; // Anfaengliches Nummern-Format von pOS2MET
Rectangle aBoundingRect; // Boundingrectangle wie in Datei angegeben
Rectangle aCalcBndRect; // selbst ermitteltes Boundingrectangle
MapMode aGlobMapMode; // Aufloesung des Bildes
- BOOL bCoord32;
+ sal_Bool bCoord32;
OSPalette * pPaletteStack;
@@ -361,53 +361,53 @@ private:
SvStream * pOrdFile;
- BOOL Callback(USHORT nPercent);
+ sal_Bool Callback(sal_uInt16 nPercent);
void AddPointsToPath(const Polygon & rPoly);
void AddPointsToArea(const Polygon & rPoly);
void CloseFigure();
- void PushAttr(USHORT nPushOrder);
+ void PushAttr(sal_uInt16 nPushOrder);
void PopAttr();
- void ChangeBrush( const Color& rPatColor, const Color& rBGColor, BOOL bFill );
- void SetPen( const Color& rColor, USHORT nStrLinWidth = 0, PenStyle ePenStyle = PEN_SOLID );
+ void ChangeBrush( const Color& rPatColor, const Color& rBGColor, sal_Bool bFill );
+ void SetPen( const Color& rColor, sal_uInt16 nStrLinWidth = 0, PenStyle ePenStyle = PEN_SOLID );
void SetRasterOp(RasterOp eROP);
- void SetPalette0RGB(USHORT nIndex, ULONG nCol);
+ void SetPalette0RGB(sal_uInt16 nIndex, sal_uLong nCol);
sal_uInt32 GetPalette0RGB(sal_uInt32 nIndex);
// Holt Farbe aus der Palette, oder, wenn nicht vorhanden,
// interpretiert nIndex als direkten RGB-Wert.
Color GetPaletteColor(sal_uInt32 nIndex);
- BOOL IsLineInfo();
+ sal_Bool IsLineInfo();
void DrawPolyLine( const Polygon& rPolygon );
void DrawPolygon( const Polygon& rPolygon );
void DrawPolyPolygon( const PolyPolygon& rPolygon );
- USHORT ReadBigEndianWord();
- ULONG ReadBigEndian3BytesLong();
- ULONG ReadLittleEndian3BytesLong();
- long ReadCoord(BOOL b32);
- Point ReadPoint( const BOOL bAdjustBoundRect = TRUE );
- RasterOp OS2MixToRasterOp(BYTE nMix);
- void ReadLine(BOOL bGivenPos, USHORT nOrderLen);
- void ReadRelLine(BOOL bGivenPos, USHORT nOrderLen);
- void ReadBox(BOOL bGivenPos);
+ sal_uInt16 ReadBigEndianWord();
+ sal_uLong ReadBigEndian3BytesLong();
+ sal_uLong ReadLittleEndian3BytesLong();
+ long ReadCoord(sal_Bool b32);
+ Point ReadPoint( const sal_Bool bAdjustBoundRect = sal_True );
+ RasterOp OS2MixToRasterOp(sal_uInt8 nMix);
+ void ReadLine(sal_Bool bGivenPos, sal_uInt16 nOrderLen);
+ void ReadRelLine(sal_Bool bGivenPos, sal_uInt16 nOrderLen);
+ void ReadBox(sal_Bool bGivenPos);
void ReadBitBlt();
- void ReadChrStr(BOOL bGivenPos, BOOL bMove, BOOL bExtra, USHORT nOrderLen);
- void ReadArc(BOOL bGivenPos);
- void ReadFullArc(BOOL bGivenPos, USHORT nOrderSize);
- void ReadPartialArc(BOOL bGivenPos, USHORT nOrderSize);
+ void ReadChrStr(sal_Bool bGivenPos, sal_Bool bMove, sal_Bool bExtra, sal_uInt16 nOrderLen);
+ void ReadArc(sal_Bool bGivenPos);
+ void ReadFullArc(sal_Bool bGivenPos, sal_uInt16 nOrderSize);
+ void ReadPartialArc(sal_Bool bGivenPos, sal_uInt16 nOrderSize);
void ReadPolygons();
- void ReadBezier(BOOL bGivenPos, USHORT nOrderLen);
- void ReadFillet(BOOL bGivenPos, USHORT nOrderLen);
- void ReadFilletSharp(BOOL bGivenPos, USHORT nOrderLen);
- void ReadMarker(BOOL bGivenPos, USHORT nOrderLen);
- void ReadOrder(USHORT nOrderID, USHORT nOrderLen);
- void ReadDsc(USHORT nDscID, USHORT nDscLen);
- void ReadImageData(USHORT nDataID, USHORT nDataLen);
- void ReadFont(USHORT nFieldSize);
- void ReadField(USHORT nFieldType, USHORT nFieldSize);
+ void ReadBezier(sal_Bool bGivenPos, sal_uInt16 nOrderLen);
+ void ReadFillet(sal_Bool bGivenPos, sal_uInt16 nOrderLen);
+ void ReadFilletSharp(sal_Bool bGivenPos, sal_uInt16 nOrderLen);
+ void ReadMarker(sal_Bool bGivenPos, sal_uInt16 nOrderLen);
+ void ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen);
+ void ReadDsc(sal_uInt16 nDscID, sal_uInt16 nDscLen);
+ void ReadImageData(sal_uInt16 nDataID, sal_uInt16 nDataLen);
+ void ReadFont(sal_uInt16 nFieldSize);
+ void ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize);
public:
@@ -421,17 +421,17 @@ public:
//=================== Methoden von OS2METReader ==============================
-BOOL OS2METReader::Callback(USHORT /*nPercent*/)
+sal_Bool OS2METReader::Callback(sal_uInt16 /*nPercent*/)
{
/*
if (pCallback!=NULL) {
- if (((*pCallback)(pCallerData,nPercent))==TRUE) {
+ if (((*pCallback)(pCallerData,nPercent))==sal_True) {
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
- return TRUE;
+ return sal_True;
}
}
*/
- return FALSE;
+ return sal_False;
}
OS2METReader::OS2METReader()
@@ -442,7 +442,7 @@ OS2METReader::~OS2METReader()
{
}
-BOOL OS2METReader::IsLineInfo()
+sal_Bool OS2METReader::IsLineInfo()
{
return ( ! ( aLineInfo.IsDefault() || ( aLineInfo.GetStyle() == LINE_NONE ) || ( pVirDev->GetLineColor() == COL_TRANSPARENT ) ) );
}
@@ -477,7 +477,7 @@ void OS2METReader::DrawPolyPolygon( const PolyPolygon& rPolyPolygon )
pVirDev->SetLineColor( COL_TRANSPARENT );
pVirDev->DrawPolyPolygon( rPolyPolygon );
pVirDev->Pop();
- for ( USHORT i = 0; i < rPolyPolygon.Count(); i++ )
+ for ( sal_uInt16 i = 0; i < rPolyPolygon.Count(); i++ )
pVirDev->DrawPolyLine( rPolyPolygon.GetObject( i ), aLineInfo );
}
else
@@ -486,11 +486,11 @@ void OS2METReader::DrawPolyPolygon( const PolyPolygon& rPolyPolygon )
void OS2METReader::AddPointsToArea(const Polygon & rPoly)
{
- USHORT nOldSize, nNewSize,i;
+ sal_uInt16 nOldSize, nNewSize,i;
if (pAreaStack==NULL || rPoly.GetSize()==0) return;
PolyPolygon * pPP=&(pAreaStack->aPPoly);
- if (pPP->Count()==0 || pAreaStack->bClosed==TRUE) pPP->Insert(rPoly);
+ if (pPP->Count()==0 || pAreaStack->bClosed==sal_True) pPP->Insert(rPoly);
else {
Polygon aLastPoly(pPP->GetObject(pPP->Count()-1));
nOldSize=aLastPoly.GetSize();
@@ -502,16 +502,16 @@ void OS2METReader::AddPointsToArea(const Polygon & rPoly)
}
pPP->Replace(aLastPoly,pPP->Count()-1);
}
- pAreaStack->bClosed=FALSE;
+ pAreaStack->bClosed=sal_False;
}
void OS2METReader::AddPointsToPath(const Polygon & rPoly)
{
- USHORT nOldSize, nNewSize,i;
+ sal_uInt16 nOldSize, nNewSize,i;
if (pPathStack==NULL || rPoly.GetSize()==0) return;
PolyPolygon * pPP=&(pPathStack->aPPoly);
- if (pPP->Count()==0 /*|| pPathStack->bClosed==TRUE*/) pPP->Insert(rPoly);
+ if (pPP->Count()==0 /*|| pPathStack->bClosed==sal_True*/) pPP->Insert(rPoly);
else {
Polygon aLastPoly(pPP->GetObject(pPP->Count()-1));
nOldSize=aLastPoly.GetSize();
@@ -526,16 +526,16 @@ void OS2METReader::AddPointsToPath(const Polygon & rPoly)
pPP->Replace(aLastPoly,pPP->Count()-1);
}
}
- pPathStack->bClosed=FALSE;
+ pPathStack->bClosed=sal_False;
}
void OS2METReader::CloseFigure()
{
- if (pAreaStack!=NULL) pAreaStack->bClosed=TRUE;
- else if (pPathStack!=NULL) pPathStack->bClosed=TRUE;
+ if (pAreaStack!=NULL) pAreaStack->bClosed=sal_True;
+ else if (pPathStack!=NULL) pPathStack->bClosed=sal_True;
}
-void OS2METReader::PushAttr(USHORT nPushOrder)
+void OS2METReader::PushAttr(sal_uInt16 nPushOrder)
{
OSAttr * p;
p=new OSAttr;
@@ -652,7 +652,7 @@ void OS2METReader::PopAttr()
delete p;
}
-void OS2METReader::ChangeBrush(const Color& rPatColor, const Color& /*rBGColor*/, BOOL bFill )
+void OS2METReader::ChangeBrush(const Color& rPatColor, const Color& /*rBGColor*/, sal_Bool bFill )
{
Color aColor;
@@ -665,7 +665,7 @@ void OS2METReader::ChangeBrush(const Color& rPatColor, const Color& /*rBGColor*/
pVirDev->SetFillColor( aColor );
}
-void OS2METReader::SetPen( const Color& rColor, USHORT nLineWidth, PenStyle ePenStyle )
+void OS2METReader::SetPen( const Color& rColor, sal_uInt16 nLineWidth, PenStyle ePenStyle )
{
LineStyle eLineStyle( LINE_SOLID );
@@ -673,8 +673,8 @@ void OS2METReader::SetPen( const Color& rColor, USHORT nLineWidth, PenStyle ePen
pVirDev->SetLineColor( rColor );
aLineInfo.SetWidth( nLineWidth );
- USHORT nDotCount = 0;
- USHORT nDashCount = 0;
+ sal_uInt16 nDotCount = 0;
+ sal_uInt16 nDashCount = 0;
switch ( ePenStyle )
{
case PEN_NULL :
@@ -706,7 +706,7 @@ void OS2METReader::SetRasterOp(RasterOp eROP)
}
-void OS2METReader::SetPalette0RGB(USHORT nIndex, ULONG nCol)
+void OS2METReader::SetPalette0RGB(sal_uInt16 nIndex, sal_uLong nCol)
{
if (pPaletteStack==NULL) {
pPaletteStack=new OSPalette;
@@ -716,7 +716,7 @@ void OS2METReader::SetPalette0RGB(USHORT nIndex, ULONG nCol)
}
if (pPaletteStack->p0RGB==NULL || nIndex>=pPaletteStack->nSize) {
sal_uInt32 * pOld0RGB=pPaletteStack->p0RGB;
- USHORT i,nOldSize=pPaletteStack->nSize;
+ sal_uInt16 i,nOldSize=pPaletteStack->nSize;
if (pOld0RGB==NULL) nOldSize=0;
pPaletteStack->nSize=2*(nIndex+1);
if (pPaletteStack->nSize<256) pPaletteStack->nSize=256;
@@ -741,37 +741,37 @@ sal_uInt32 OS2METReader::GetPalette0RGB(sal_uInt32 nIndex)
Color OS2METReader::GetPaletteColor(sal_uInt32 nIndex)
{
nIndex=GetPalette0RGB(nIndex);
- return Color(sal::static_int_cast< UINT8 >((nIndex>>16)&0xff),
- sal::static_int_cast< UINT8 >((nIndex>>8)&0xff),
- sal::static_int_cast< UINT8 >(nIndex&0xff));
+ return Color(sal::static_int_cast< sal_uInt8 >((nIndex>>16)&0xff),
+ sal::static_int_cast< sal_uInt8 >((nIndex>>8)&0xff),
+ sal::static_int_cast< sal_uInt8 >(nIndex&0xff));
}
-USHORT OS2METReader::ReadBigEndianWord()
+sal_uInt16 OS2METReader::ReadBigEndianWord()
{
- BYTE nLo,nHi;
+ sal_uInt8 nLo,nHi;
*pOS2MET >> nHi >> nLo;
- return (((USHORT)nHi)<<8)|(((USHORT)nLo)&0x00ff);
+ return (((sal_uInt16)nHi)<<8)|(((sal_uInt16)nLo)&0x00ff);
}
-ULONG OS2METReader::ReadBigEndian3BytesLong()
+sal_uLong OS2METReader::ReadBigEndian3BytesLong()
{
- USHORT nLo;
- BYTE nHi;
+ sal_uInt16 nLo;
+ sal_uInt8 nHi;
*pOS2MET >> nHi;
nLo=ReadBigEndianWord();
- return ((((ULONG)nHi)<<16)&0x00ff0000)|((ULONG)nLo);
+ return ((((sal_uLong)nHi)<<16)&0x00ff0000)|((sal_uLong)nLo);
}
-ULONG OS2METReader::ReadLittleEndian3BytesLong()
+sal_uLong OS2METReader::ReadLittleEndian3BytesLong()
{
- BYTE nHi,nMed,nLo;
+ sal_uInt8 nHi,nMed,nLo;
*pOS2MET >> nLo >> nMed >> nHi;
- return ((((ULONG)nHi)&0xff)<<16)|((((ULONG)nMed)&0xff)<<8)|(((ULONG)nLo)&0xff);
+ return ((((sal_uLong)nHi)&0xff)<<16)|((((sal_uLong)nMed)&0xff)<<8)|(((sal_uLong)nLo)&0xff);
}
-long OS2METReader::ReadCoord(BOOL b32)
+long OS2METReader::ReadCoord(sal_Bool b32)
{
long l;
short s;
@@ -781,7 +781,7 @@ long OS2METReader::ReadCoord(BOOL b32)
return l;
}
-Point OS2METReader::ReadPoint( const BOOL bAdjustBoundRect )
+Point OS2METReader::ReadPoint( const sal_Bool bAdjustBoundRect )
{
long x,y;
@@ -796,7 +796,7 @@ Point OS2METReader::ReadPoint( const BOOL bAdjustBoundRect )
return Point(x,y);
}
-RasterOp OS2METReader::OS2MixToRasterOp(BYTE nMix)
+RasterOp OS2METReader::OS2MixToRasterOp(sal_uInt8 nMix)
{
switch (nMix) {
case 0x0c: return ROP_INVERT;
@@ -806,9 +806,9 @@ RasterOp OS2METReader::OS2MixToRasterOp(BYTE nMix)
}
}
-void OS2METReader::ReadLine(BOOL bGivenPos, USHORT nOrderLen)
+void OS2METReader::ReadLine(sal_Bool bGivenPos, sal_uInt16 nOrderLen)
{
- USHORT i,nPolySize;
+ sal_uInt16 i,nPolySize;
if (bCoord32) nPolySize=nOrderLen/8; else nPolySize=nOrderLen/4;
if (!bGivenPos) nPolySize++;
@@ -829,9 +829,9 @@ void OS2METReader::ReadLine(BOOL bGivenPos, USHORT nOrderLen)
}
}
-void OS2METReader::ReadRelLine(BOOL bGivenPos, USHORT nOrderLen)
+void OS2METReader::ReadRelLine(sal_Bool bGivenPos, sal_uInt16 nOrderLen)
{
- USHORT i,nPolySize;
+ sal_uInt16 i,nPolySize;
Point aP0;
@@ -845,11 +845,11 @@ void OS2METReader::ReadRelLine(BOOL bGivenPos, USHORT nOrderLen)
Polygon aPolygon(nPolySize);
for (i=0; i<nPolySize; i++) {
#if defined SOLARIS && defined PPC
- UINT8 nunsignedbyte;
- *pOS2MET >> nunsignedbyte; aP0.X()+=(INT8)nunsignedbyte;
- *pOS2MET >> nunsignedbyte; aP0.Y()+=(INT8)nunsignedbyte;
+ sal_uInt8 nunsignedbyte;
+ *pOS2MET >> nunsignedbyte; aP0.X()+=(sal_Int8)nunsignedbyte;
+ *pOS2MET >> nunsignedbyte; aP0.Y()+=(sal_Int8)nunsignedbyte;
#else
- INT8 nsignedbyte;
+ sal_Int8 nsignedbyte;
*pOS2MET >> nsignedbyte; aP0.X()+=(long)nsignedbyte;
*pOS2MET >> nsignedbyte; aP0.Y()-=(long)nsignedbyte;
#endif
@@ -867,9 +867,9 @@ void OS2METReader::ReadRelLine(BOOL bGivenPos, USHORT nOrderLen)
}
}
-void OS2METReader::ReadBox(BOOL bGivenPos)
+void OS2METReader::ReadBox(sal_Bool bGivenPos)
{
- BYTE nFlags;
+ sal_uInt8 nFlags;
Point P0;
long nHRound,nVRound;
@@ -905,7 +905,7 @@ void OS2METReader::ReadBox(BOOL bGivenPos)
}
else
{
- ChangeBrush( Color( COL_TRANSPARENT ), Color( COL_TRANSPARENT ), FALSE );
+ ChangeBrush( Color( COL_TRANSPARENT ), Color( COL_TRANSPARENT ), sal_False );
SetRasterOp(aAttr.eLinMix);
}
@@ -950,10 +950,10 @@ void OS2METReader::ReadBitBlt()
}
}
-void OS2METReader::ReadChrStr(BOOL bGivenPos, BOOL bMove, BOOL bExtra, USHORT nOrderLen)
+void OS2METReader::ReadChrStr(sal_Bool bGivenPos, sal_Bool bMove, sal_Bool bExtra, sal_uInt16 nOrderLen)
{
Point aP0;
- USHORT i, nLen;
+ sal_uInt16 i, nLen;
char * pChr;
OSFont * pF;
Font aFont;
@@ -975,8 +975,8 @@ void OS2METReader::ReadChrStr(BOOL bGivenPos, BOOL bMove, BOOL bExtra, USHORT nO
if (bExtra)
{
pOS2MET->SeekRel(2);
- ReadPoint( FALSE );
- ReadPoint( FALSE );
+ ReadPoint( sal_False );
+ ReadPoint( sal_False );
*pOS2MET >> nLen;
}
else
@@ -1023,7 +1023,7 @@ void OS2METReader::ReadChrStr(BOOL bGivenPos, BOOL bMove, BOOL bExtra, USHORT nO
delete[] pChr;
}
-void OS2METReader::ReadArc(BOOL bGivenPos)
+void OS2METReader::ReadArc(sal_Bool bGivenPos)
{
Point aP1, aP2, aP3;
double x1,y1,x2,y2,x3,y3,p,q,cx,cy,ncx,ncy,r,rx,ry,w1,w3;
@@ -1068,12 +1068,12 @@ void OS2METReader::ReadArc(BOOL bGivenPos)
}
}
-void OS2METReader::ReadFullArc(BOOL bGivenPos, USHORT nOrderSize)
+void OS2METReader::ReadFullArc(sal_Bool bGivenPos, sal_uInt16 nOrderSize)
{
Point aCenter;
long nP,nQ,nR,nS;
Rectangle aRect;
- sal_uInt32 nMul; USHORT nMulS;
+ sal_uInt32 nMul; sal_uInt16 nMulS;
if (bGivenPos) {
aCenter=ReadPoint();
@@ -1087,7 +1087,7 @@ void OS2METReader::ReadFullArc(BOOL bGivenPos, USHORT nOrderSize)
if (nR<0) nR=-nR;
if (nS<0) nS=-nS;
if (nOrderSize>=4) *pOS2MET >> nMul;
- else { *pOS2MET >> nMulS; nMul=((ULONG)nMulS)<<8; }
+ else { *pOS2MET >> nMulS; nMul=((sal_uLong)nMulS)<<8; }
if (nMul!=0x00010000) {
nP=(nP*nMul)>>16;
nQ=(nQ*nMul)>>16;
@@ -1110,18 +1110,18 @@ void OS2METReader::ReadFullArc(BOOL bGivenPos, USHORT nOrderSize)
else
{
SetPen( aAttr.aLinCol, aAttr.nStrLinWidth, aAttr.eLinStyle );
- ChangeBrush(Color( COL_TRANSPARENT ),Color( COL_TRANSPARENT ),FALSE);
+ ChangeBrush(Color( COL_TRANSPARENT ),Color( COL_TRANSPARENT ),sal_False);
SetRasterOp(aAttr.eLinMix);
}
pVirDev->DrawEllipse(aRect);
}
-void OS2METReader::ReadPartialArc(BOOL bGivenPos, USHORT nOrderSize)
+void OS2METReader::ReadPartialArc(sal_Bool bGivenPos, sal_uInt16 nOrderSize)
{
Point aP0, aCenter,aPStart,aPEnd;
long nP,nQ,nR,nS,nStart, nSweep;
Rectangle aRect;
- sal_uInt32 nMul; USHORT nMulS;
+ sal_uInt32 nMul; sal_uInt16 nMulS;
double fStart, fEnd;
if (bGivenPos) {
@@ -1137,7 +1137,7 @@ void OS2METReader::ReadPartialArc(BOOL bGivenPos, USHORT nOrderSize)
if (nR<0) nR=-nR;
if (nS<0) nS=-nS;
if (nOrderSize>=12) *pOS2MET >> nMul;
- else { *pOS2MET >> nMulS; nMul=((ULONG)nMulS)<<8; }
+ else { *pOS2MET >> nMulS; nMul=((sal_uLong)nMulS)<<8; }
if (nMul!=0x00010000) {
nP=(nP*nMul)>>16;
nQ=(nQ*nMul)>>16;
@@ -1171,7 +1171,7 @@ void OS2METReader::ReadPolygons()
PolyPolygon aPolyPoly;
Polygon aPoly;
Point aPoint;
- BYTE nFlags;
+ sal_uInt8 nFlags;
*pOS2MET >> nFlags >> nNumPolys;
for (i=0; i<nNumPolys; i++) {
@@ -1196,9 +1196,9 @@ void OS2METReader::ReadPolygons()
DrawPolyPolygon( aPolyPoly );
}
-void OS2METReader::ReadBezier(BOOL bGivenPos, USHORT nOrderLen)
+void OS2METReader::ReadBezier(sal_Bool bGivenPos, sal_uInt16 nOrderLen)
{
- USHORT i, nNumPoints = nOrderLen / ( bCoord32 ? 8 : 4 );
+ sal_uInt16 i, nNumPoints = nOrderLen / ( bCoord32 ? 8 : 4 );
if( !bGivenPos )
nNumPoints++;
@@ -1219,18 +1219,18 @@ void OS2METReader::ReadBezier(BOOL bGivenPos, USHORT nOrderLen)
if( !( nNumPoints % 4 ) )
{
// create bezier polygon
- const USHORT nSegPoints = 25;
- const USHORT nSegments = aPolygon.GetSize() >> 2;
+ const sal_uInt16 nSegPoints = 25;
+ const sal_uInt16 nSegments = aPolygon.GetSize() >> 2;
Polygon aBezPoly( nSegments * nSegPoints );
- USHORT nSeg, nBezPos, nStartPos;
+ sal_uInt16 nSeg, nBezPos, nStartPos;
for( nSeg = 0, nBezPos = 0, nStartPos = 0; nSeg < nSegments; nSeg++, nStartPos += 4 )
{
const Polygon aSegPoly( aPolygon[ nStartPos ], aPolygon[ nStartPos + 1 ],
aPolygon[ nStartPos + 3 ], aPolygon[ nStartPos + 2 ],
nSegPoints );
- for( USHORT nSegPos = 0; nSegPos < nSegPoints; )
+ for( sal_uInt16 nSegPos = 0; nSegPos < nSegPoints; )
aBezPoly[ nBezPos++ ] = aSegPoly[ nSegPos++ ];
}
@@ -1256,9 +1256,9 @@ void OS2METReader::ReadBezier(BOOL bGivenPos, USHORT nOrderLen)
}
}
-void OS2METReader::ReadFillet(BOOL bGivenPos, USHORT nOrderLen)
+void OS2METReader::ReadFillet(sal_Bool bGivenPos, sal_uInt16 nOrderLen)
{
- USHORT i,nNumPoints;
+ sal_uInt16 i,nNumPoints;
if (bCoord32) nNumPoints=nOrderLen/8; else nNumPoints=nOrderLen/4;
if (!bGivenPos) nNumPoints++;
@@ -1278,9 +1278,9 @@ void OS2METReader::ReadFillet(BOOL bGivenPos, USHORT nOrderLen)
}
}
-void OS2METReader::ReadFilletSharp(BOOL bGivenPos, USHORT nOrderLen)
+void OS2METReader::ReadFilletSharp(sal_Bool bGivenPos, sal_uInt16 nOrderLen)
{
- USHORT i,nNumPoints;
+ sal_uInt16 i,nNumPoints;
if (bGivenPos) {
aAttr.aCurPos=ReadPoint();
@@ -1302,20 +1302,20 @@ void OS2METReader::ReadFilletSharp(BOOL bGivenPos, USHORT nOrderLen)
}
}
-void OS2METReader::ReadMarker(BOOL bGivenPos, USHORT nOrderLen)
+void OS2METReader::ReadMarker(sal_Bool bGivenPos, sal_uInt16 nOrderLen)
{
- USHORT i,nNumPoints;
+ sal_uInt16 i,nNumPoints;
long x,y;
SetPen( aAttr.aMrkCol );
SetRasterOp(aAttr.eMrkMix);
if (aAttr.nMrkSymbol>=5 && aAttr.nMrkSymbol<=9)
{
- ChangeBrush(aAttr.aMrkCol,aAttr.aMrkCol,TRUE);
+ ChangeBrush(aAttr.aMrkCol,aAttr.aMrkCol,sal_True);
}
else
{
- ChangeBrush(Color(COL_TRANSPARENT),Color(COL_TRANSPARENT),FALSE);
+ ChangeBrush(Color(COL_TRANSPARENT),Color(COL_TRANSPARENT),sal_False);
}
if (bCoord32) nNumPoints=nOrderLen/8; else nNumPoints=nOrderLen/4;
if (!bGivenPos) nNumPoints++;
@@ -1402,46 +1402,46 @@ void OS2METReader::ReadMarker(BOOL bGivenPos, USHORT nOrderLen)
}
}
-void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
+void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
{
switch (nOrderID) {
- case GOrdGivArc: ReadArc(TRUE); break;
- case GOrdCurArc: ReadArc(FALSE); break;
+ case GOrdGivArc: ReadArc(sal_True); break;
+ case GOrdCurArc: ReadArc(sal_False); break;
- case GOrdGivBzr: ReadBezier(TRUE,nOrderLen); break;
- case GOrdCurBzr: ReadBezier(FALSE,nOrderLen); break;
+ case GOrdGivBzr: ReadBezier(sal_True,nOrderLen); break;
+ case GOrdCurBzr: ReadBezier(sal_False,nOrderLen); break;
- case GOrdGivBox: ReadBox(TRUE); break;
- case GOrdCurBox: ReadBox(FALSE); break;
+ case GOrdGivBox: ReadBox(sal_True); break;
+ case GOrdCurBox: ReadBox(sal_False); break;
- case GOrdGivFil: ReadFillet(TRUE,nOrderLen); break;
- case GOrdCurFil: ReadFillet(FALSE,nOrderLen); break;
+ case GOrdGivFil: ReadFillet(sal_True,nOrderLen); break;
+ case GOrdCurFil: ReadFillet(sal_False,nOrderLen); break;
- case GOrdGivCrc: ReadFullArc(TRUE,nOrderLen); break;
- case GOrdCurCrc: ReadFullArc(FALSE,nOrderLen); break;
+ case GOrdGivCrc: ReadFullArc(sal_True,nOrderLen); break;
+ case GOrdCurCrc: ReadFullArc(sal_False,nOrderLen); break;
- case GOrdGivLin: ReadLine(TRUE, nOrderLen); break;
- case GOrdCurLin: ReadLine(FALSE, nOrderLen); break;
+ case GOrdGivLin: ReadLine(sal_True, nOrderLen); break;
+ case GOrdCurLin: ReadLine(sal_False, nOrderLen); break;
- case GOrdGivMrk: ReadMarker(TRUE, nOrderLen); break;
- case GOrdCurMrk: ReadMarker(FALSE, nOrderLen); break;
+ case GOrdGivMrk: ReadMarker(sal_True, nOrderLen); break;
+ case GOrdCurMrk: ReadMarker(sal_False, nOrderLen); break;
- case GOrdGivArP: ReadPartialArc(TRUE,nOrderLen); break;
- case GOrdCurArP: ReadPartialArc(FALSE,nOrderLen); break;
+ case GOrdGivArP: ReadPartialArc(sal_True,nOrderLen); break;
+ case GOrdCurArP: ReadPartialArc(sal_False,nOrderLen); break;
- case GOrdGivRLn: ReadRelLine(TRUE,nOrderLen); break;
- case GOrdCurRLn: ReadRelLine(FALSE,nOrderLen); break;
+ case GOrdGivRLn: ReadRelLine(sal_True,nOrderLen); break;
+ case GOrdCurRLn: ReadRelLine(sal_False,nOrderLen); break;
- case GOrdGivSFl: ReadFilletSharp(TRUE,nOrderLen); break;
- case GOrdCurSFl: ReadFilletSharp(FALSE,nOrderLen); break;
+ case GOrdGivSFl: ReadFilletSharp(sal_True,nOrderLen); break;
+ case GOrdCurSFl: ReadFilletSharp(sal_False,nOrderLen); break;
- case GOrdGivStM: ReadChrStr(TRUE , TRUE , FALSE, nOrderLen); break;
- case GOrdCurStM: ReadChrStr(FALSE, TRUE , FALSE, nOrderLen); break;
- case GOrdGivStr: ReadChrStr(TRUE , FALSE, FALSE, nOrderLen); break;
- case GOrdCurStr: ReadChrStr(FALSE, FALSE, FALSE, nOrderLen); break;
- case GOrdGivStx: ReadChrStr(TRUE , FALSE, TRUE , nOrderLen); break;
- case GOrdCurStx: ReadChrStr(FALSE, FALSE, TRUE , nOrderLen); break;
+ case GOrdGivStM: ReadChrStr(sal_True , sal_True , sal_False, nOrderLen); break;
+ case GOrdCurStM: ReadChrStr(sal_False, sal_True , sal_False, nOrderLen); break;
+ case GOrdGivStr: ReadChrStr(sal_True , sal_False, sal_False, nOrderLen); break;
+ case GOrdCurStr: ReadChrStr(sal_False, sal_False, sal_False, nOrderLen); break;
+ case GOrdGivStx: ReadChrStr(sal_True , sal_False, sal_True , nOrderLen); break;
+ case GOrdCurStx: ReadChrStr(sal_False, sal_False, sal_True , nOrderLen); break;
case GOrdGivImg: OOODEBUG("GOrdGivImg",0);
break;
@@ -1454,7 +1454,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdBegAra: {
OSArea * p=new OSArea;
- p->bClosed=FALSE;
+ p->bClosed=sal_False;
p->pSucc=pAreaStack; pAreaStack=p;
*pOS2MET >> (p->nFlags);
p->aCol=aAttr.aPatCol;
@@ -1472,7 +1472,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
pAreaStack = p->pSucc;
if ( pPathStack )
{
- for ( USHORT i=0; i<p->aPPoly.Count(); i++ )
+ for ( sal_uInt16 i=0; i<p->aPPoly.Count(); i++ )
{
AddPointsToPath( p->aPPoly.GetObject( i ) );
CloseFigure();
@@ -1504,8 +1504,8 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
p->pSucc=pPathStack; pPathStack=p;
pOS2MET->SeekRel(2);
*pOS2MET >> p->nID;
- p->bClosed=FALSE;
- p->bStroke=FALSE;
+ p->bClosed=sal_False;
+ p->bStroke=sal_False;
break;
}
case GOrdEndPth: {
@@ -1529,7 +1529,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdFilPth:
{
sal_uInt32 nID;
- UINT16 nDummy;
+ sal_uInt16 nDummy;
OSPath* p = pPathList;
*pOS2MET >> nDummy
@@ -1545,11 +1545,11 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
if( p->bStroke )
{
SetPen( aAttr.aPatCol, aAttr.nStrLinWidth, PEN_SOLID );
- ChangeBrush(Color(COL_TRANSPARENT),Color(COL_TRANSPARENT),FALSE);
+ ChangeBrush(Color(COL_TRANSPARENT),Color(COL_TRANSPARENT),sal_False);
SetRasterOp( aAttr.ePatMix );
if ( IsLineInfo() )
{
- for ( USHORT i = 0; i < p->aPPoly.Count(); i++ )
+ for ( sal_uInt16 i = 0; i < p->aPPoly.Count(); i++ )
pVirDev->DrawPolyLine( p->aPPoly.GetObject( i ), aLineInfo );
}
else
@@ -1575,14 +1575,14 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
p = p->pSucc;
if( p )
- p->bStroke = TRUE;
+ p->bStroke = sal_True;
}
break;
case GOrdOutPth:
{
sal_uInt32 nID;
- USHORT i,nC;
+ sal_uInt16 i,nC;
OSPath* p=pPathList;
pOS2MET->SeekRel(2);
*pOS2MET >> nID;
@@ -1593,11 +1593,11 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
{
SetPen( aAttr.aLinCol, aAttr.nStrLinWidth, aAttr.eLinStyle );
SetRasterOp(aAttr.eLinMix);
- ChangeBrush(Color(COL_TRANSPARENT),Color(COL_TRANSPARENT),FALSE);
+ ChangeBrush(Color(COL_TRANSPARENT),Color(COL_TRANSPARENT),sal_False);
nC=p->aPPoly.Count();
for (i=0; i<nC; i++)
{
- if (i+1<nC || p->bClosed==TRUE)
+ if (i+1<nC || p->bClosed==sal_True)
DrawPolygon( p->aPPoly.GetObject( i ) );
else
DrawPolyLine( p->aPPoly.GetObject( i ) );
@@ -1649,8 +1649,8 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPIvAtr: PushAttr(nOrderID);
case GOrdSIvAtr: {
- BYTE nA, nP, nFlags, nMix;
- ULONG nVal;
+ sal_uInt8 nA, nP, nFlags, nMix;
+ sal_uLong nVal;
Color aCol;
RasterOp eROP;
*pOS2MET >> nA >> nP >> nFlags;
@@ -1738,8 +1738,8 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
}
case GOrdPIxCol: PushAttr(nOrderID);
case GOrdSIxCol: {
- BYTE nFlags;
- ULONG nVal;
+ sal_uInt8 nFlags;
+ sal_uLong nVal;
Color aCol;
*pOS2MET >> nFlags;
if ((nFlags&0x80)!=0) {
@@ -1766,11 +1766,11 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPXtCol: PushAttr(nOrderID);
case GOrdSColor:
case GOrdSXtCol: {
- BYTE nbyte;
- USHORT nVal;
+ sal_uInt8 nbyte;
+ sal_uInt16 nVal;
Color aCol;
if (nOrderID==GOrdPColor || nOrderID==GOrdSColor) {
- *pOS2MET >> nbyte; nVal=((USHORT)nbyte)|0xff00;
+ *pOS2MET >> nbyte; nVal=((sal_uInt16)nbyte)|0xff00;
}
else *pOS2MET >> nVal;
if (nVal==0x0000 || nVal==0xff00) {
@@ -1784,7 +1784,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
if (nVal==0x0007) aCol=Color(COL_WHITE);
else if (nVal==0x0008) aCol=Color(COL_BLACK);
else if (nVal==0xff08) aCol=GetPaletteColor(1);
- else aCol=GetPaletteColor(((ULONG)nVal) & 0x000000ff);
+ else aCol=GetPaletteColor(((sal_uLong)nVal) & 0x000000ff);
aAttr.aLinCol = aAttr.aChrCol = aAttr.aMrkCol = aAttr.aPatCol =
aAttr.aImgCol = aCol;
}
@@ -1793,7 +1793,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPBgCol: PushAttr(nOrderID);
case GOrdSBgCol: {
- USHORT nVal;
+ sal_uInt16 nVal;
Color aCol;
*pOS2MET >> nVal;
if (nVal==0x0000 || nVal==0xff00) {
@@ -1807,7 +1807,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
if (nVal==0x0007) aCol=Color(COL_WHITE);
else if (nVal==0x0008) aCol=Color(COL_BLACK);
else if (nVal==0xff08) aCol=GetPaletteColor(0);
- else aCol=GetPaletteColor(((ULONG)nVal) & 0x000000ff);
+ else aCol=GetPaletteColor(((sal_uLong)nVal) & 0x000000ff);
aAttr.aLinBgCol = aAttr.aChrBgCol = aAttr.aMrkBgCol =
aAttr.aPatBgCol = aAttr.aImgBgCol = aCol;
}
@@ -1815,8 +1815,8 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
}
case GOrdPBxCol: PushAttr(nOrderID);
case GOrdSBxCol: {
- BYTE nFlags;
- ULONG nVal;
+ sal_uInt8 nFlags;
+ sal_uLong nVal;
Color aCol;
*pOS2MET >> nFlags;
if ((nFlags&0x80)!=0) {
@@ -1841,7 +1841,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPMixMd: PushAttr(nOrderID);
case GOrdSMixMd: {
- BYTE nMix;
+ sal_uInt8 nMix;
*pOS2MET >> nMix;
if (nMix==0) {
aAttr.eLinMix=aDefAttr.eLinMix;
@@ -1858,7 +1858,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
}
case GOrdPBgMix: PushAttr(nOrderID);
case GOrdSBgMix: {
- BYTE nMix;
+ sal_uInt8 nMix;
*pOS2MET >> nMix;
if (nMix==0) {
aAttr.eLinBgMix=aDefAttr.eLinBgMix;
@@ -1879,7 +1879,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPPtSym: PushAttr(nOrderID);
case GOrdSPtSym: {
- BYTE nPatt;
+ sal_uInt8 nPatt;
*pOS2MET >> nPatt;
aAttr.bFill = ( nPatt != 0x0f );
break;
@@ -1899,7 +1899,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPLnTyp: PushAttr(nOrderID);
case GOrdSLnTyp: {
- BYTE nType;
+ sal_uInt8 nType;
*pOS2MET >> nType;
switch (nType) {
case 0: aAttr.eLinStyle=aDefAttr.eLinStyle; break;
@@ -1913,10 +1913,10 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
}
case GOrdPLnWdt: PushAttr(nOrderID);
case GOrdSLnWdt: {
- BYTE nbyte;
+ sal_uInt8 nbyte;
*pOS2MET >> nbyte;
if (nbyte==0) aAttr.nLinWidth=aDefAttr.nLinWidth;
- else aAttr.nLinWidth=(USHORT)nbyte-1;
+ else aAttr.nLinWidth=(sal_uInt16)nbyte-1;
break;
}
case GOrdPFrLWd: PushAttr(nOrderID);
@@ -1926,7 +1926,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPStLWd: PushAttr(nOrderID);
case GOrdSStLWd :
{
- BYTE nFlags;
+ sal_uInt8 nFlags;
long nWd;
*pOS2MET >> nFlags;
@@ -1938,7 +1938,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
nWd = ReadCoord( bCoord32 );
if ( nWd < 0 )
nWd = -nWd;
- aAttr.nStrLinWidth = (USHORT)nWd;
+ aAttr.nStrLinWidth = (sal_uInt16)nWd;
}
break;
}
@@ -1952,8 +1952,8 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPChSet: PushAttr(nOrderID);
case GOrdSChSet: {
- BYTE nbyte; *pOS2MET >> nbyte;
- aAttr.nChrSet=((ULONG)nbyte)&0xff;
+ sal_uInt8 nbyte; *pOS2MET >> nbyte;
+ aAttr.nChrSet=((sal_uLong)nbyte)&0xff;
break;
}
case GOrdPChAng: PushAttr(nOrderID);
@@ -1974,8 +1974,8 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPChCel: PushAttr(nOrderID);
case GOrdSChCel: {
- BYTE nbyte;
- USHORT nLen=nOrderLen;
+ sal_uInt8 nbyte;
+ sal_uInt16 nLen=nOrderLen;
aAttr.aChrCellSize.Width()=ReadCoord(bCoord32);
aAttr.aChrCellSize.Height()=ReadCoord(bCoord32);
if (bCoord32) nLen-=8; else nLen-=4;
@@ -2003,7 +2003,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPMkPrc: PushAttr(nOrderID);
case GOrdSMkPrc: {
- BYTE nbyte;
+ sal_uInt8 nbyte;
*pOS2MET >> nbyte;
if (nbyte==0) aAttr.nMrkPrec=aDefAttr.nMrkPrec;
else aAttr.nMrkPrec=nbyte;
@@ -2012,7 +2012,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPMkSet: PushAttr(nOrderID);
case GOrdSMkSet: {
- BYTE nbyte;
+ sal_uInt8 nbyte;
*pOS2MET >> nbyte;
if (nbyte==0) aAttr.nMrkSet=aDefAttr.nMrkSet;
else aAttr.nMrkSet=nbyte;
@@ -2021,7 +2021,7 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPMkSym: PushAttr(nOrderID);
case GOrdSMkSym: {
- BYTE nbyte;
+ sal_uInt8 nbyte;
*pOS2MET >> nbyte;
if (nbyte==0) aAttr.nMrkSymbol=aDefAttr.nMrkSymbol;
else aAttr.nMrkSymbol=nbyte;
@@ -2030,8 +2030,8 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
case GOrdPMkCel: PushAttr(nOrderID);
case GOrdSMkCel: {
- BYTE nbyte;
- USHORT nLen=nOrderLen;
+ sal_uInt8 nbyte;
+ sal_uInt16 nLen=nOrderLen;
aAttr.aMrkCellSize.Width()=ReadCoord(bCoord32);
aAttr.aMrkCellSize.Height()=ReadCoord(bCoord32);
if (bCoord32) nLen-=8; else nLen-=4;
@@ -2074,15 +2074,15 @@ void OS2METReader::ReadOrder(USHORT nOrderID, USHORT nOrderLen)
}
}
-void OS2METReader::ReadDsc(USHORT nDscID, USHORT /*nDscLen*/)
+void OS2METReader::ReadDsc(sal_uInt16 nDscID, sal_uInt16 /*nDscLen*/)
{
switch (nDscID) {
case 0x00f7: { // 'Specify GVM Subset'
- BYTE nbyte;
+ sal_uInt8 nbyte;
pOS2MET->SeekRel(6);
*pOS2MET >> nbyte;
- if (nbyte==0x05) bCoord32=TRUE;
- else if (nbyte==0x04) bCoord32=FALSE;
+ if (nbyte==0x05) bCoord32=sal_True;
+ else if (nbyte==0x04) bCoord32=sal_False;
else {
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=1;
@@ -2092,20 +2092,20 @@ void OS2METReader::ReadDsc(USHORT nDscID, USHORT /*nDscLen*/)
case 0x00f6:
{
// 'Set Picture Descriptor'
- BOOL b32;
- BYTE nbyte,nUnitType;
+ sal_Bool b32;
+ sal_uInt8 nbyte,nUnitType;
long x1,y1,x2,y2,nt,xr,yr;
pOS2MET->SeekRel(2);
*pOS2MET >> nbyte;
if (nbyte==0x05)
- b32=TRUE;
+ b32=sal_True;
else if(nbyte==0x04)
- b32=FALSE;
+ b32=sal_False;
else
{
- b32 = FALSE; // -Wall added the case.
+ b32 = sal_False; // -Wall added the case.
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=2;
}
@@ -2158,7 +2158,7 @@ void OS2METReader::ReadDsc(USHORT nDscID, USHORT /*nDscLen*/)
}
}
-void OS2METReader::ReadImageData(USHORT nDataID, USHORT nDataLen)
+void OS2METReader::ReadImageData(sal_uInt16 nDataID, sal_uInt16 nDataLen)
{
OSBitmap * p=pBitmapList; if (p==NULL) return; // Nanu ?
@@ -2180,7 +2180,7 @@ void OS2METReader::ReadImageData(USHORT nDataID, USHORT nDataLen)
break;
case 0x0096: { // Image IDE-Size
- BYTE nbyte;
+ sal_uInt8 nbyte;
*pOS2MET >> nbyte; p->nBitsPerPixel=nbyte;
break;
}
@@ -2204,22 +2204,22 @@ void OS2METReader::ReadImageData(USHORT nDataID, USHORT nDataLen)
}
// Schreibe (Windows-)BITMAPINFOHEADER:
*(p->pBMP) << ((sal_uInt32)40) << p->nWidth << p->nHeight;
- *(p->pBMP) << ((USHORT)1) << p->nBitsPerPixel;
+ *(p->pBMP) << ((sal_uInt16)1) << p->nBitsPerPixel;
*(p->pBMP) << ((sal_uInt32)0) << ((sal_uInt32)0) << ((sal_uInt32)0) << ((sal_uInt32)0);
*(p->pBMP) << ((sal_uInt32)0) << ((sal_uInt32)0);
// Schreibe Farbtabelle:
if (p->nBitsPerPixel<=8) {
- USHORT i, nColTabSize=1<<(p->nBitsPerPixel);
+ sal_uInt16 i, nColTabSize=1<<(p->nBitsPerPixel);
for (i=0; i<nColTabSize; i++) *(p->pBMP) << GetPalette0RGB(i);
}
}
// OK, nun werden die Map-Daten ruebergeschoben. Leider haben OS2 und
// BMP eine unterschiedliche Reihenfolge von RGB bei 24-Bit.
- BYTE * pBuf=new BYTE[nDataLen];
+ sal_uInt8 * pBuf=new sal_uInt8[nDataLen];
pOS2MET->Read(pBuf,nDataLen);
if (p->nBitsPerPixel==24) {
- ULONG i, j, nAlign, nBytesPerLine;
- BYTE nTemp;
+ sal_uLong i, j, nAlign, nBytesPerLine;
+ sal_uInt8 nTemp;
nBytesPerLine=(p->nWidth*3+3)&0xfffffffc;
nAlign=p->nMapPos-(p->nMapPos % nBytesPerLine);
i=0;
@@ -2247,22 +2247,22 @@ void OS2METReader::ReadImageData(USHORT nDataID, USHORT nDataLen)
}
}
-void OS2METReader::ReadFont(USHORT nFieldSize)
+void OS2METReader::ReadFont(sal_uInt16 nFieldSize)
{
- ULONG nPos, nMaxPos;
- USHORT nLen;
- BYTE nByte, nTripType, nTripType2;
+ sal_uLong nPos, nMaxPos;
+ sal_uInt16 nLen;
+ sal_uInt8 nByte, nTripType, nTripType2;
OSFont * pF=new OSFont;
pF->pSucc=pFontList; pFontList=pF;
pF->nID=0;
- pF->aFont.SetTransparent(TRUE);
+ pF->aFont.SetTransparent(sal_True);
pF->aFont.SetAlign(ALIGN_BASELINE);
nPos=pOS2MET->Tell();
- nMaxPos=nPos+(ULONG)nFieldSize;
+ nMaxPos=nPos+(sal_uLong)nFieldSize;
pOS2MET->SeekRel(2); nPos+=2;
while (nPos<nMaxPos && pOS2MET->GetError()==0) {
- *pOS2MET >> nByte; nLen =((USHORT)nByte) & 0x00ff;
+ *pOS2MET >> nByte; nLen =((sal_uInt16)nByte) & 0x00ff;
*pOS2MET >> nTripType;
switch (nTripType) {
case 0x02:
@@ -2288,7 +2288,7 @@ void OS2METReader::ReadFont(USHORT nFieldSize)
switch (nTripType2) {
case 0x05: //Icid
*pOS2MET >> nByte;
- pF->nID=((ULONG)nByte)&0xff;
+ pF->nID=((sal_uLong)nByte)&0xff;
break;
}
break;
@@ -2296,7 +2296,7 @@ void OS2METReader::ReadFont(USHORT nFieldSize)
break;
case 0x1f: { // Font Attributes
FontWeight eWeight;
- BYTE nbyte;
+ sal_uInt8 nbyte;
*pOS2MET >> nbyte;
switch (nbyte) {
case 1: eWeight=WEIGHT_THIN; break;
@@ -2318,7 +2318,7 @@ void OS2METReader::ReadFont(USHORT nFieldSize)
}
}
-void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
+void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize)
{
switch (nFieldType) {
case BegDocumnMagic:
@@ -2334,21 +2334,21 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
case EndColAtrMagic:
break;
case BlkColAtrMagic: {
- ULONG nPos, nMaxPos;
- BYTE nbyte;
- ULONG nCol;
- USHORT nStartIndex, nEndIndex, i, nElemLen, nBytesPerCol;
+ sal_uLong nPos, nMaxPos;
+ sal_uInt8 nbyte;
+ sal_uLong nCol;
+ sal_uInt16 nStartIndex, nEndIndex, i, nElemLen, nBytesPerCol;
nPos=pOS2MET->Tell();
- nMaxPos=nPos+(ULONG)nFieldSize;
+ nMaxPos=nPos+(sal_uLong)nFieldSize;
pOS2MET->SeekRel(3); nPos+=3;
while (nPos<nMaxPos && pOS2MET->GetError()==0) {
- *pOS2MET >> nbyte; nElemLen=((USHORT)nbyte) & 0x00ff;
+ *pOS2MET >> nbyte; nElemLen=((sal_uInt16)nbyte) & 0x00ff;
if (nElemLen>11) {
pOS2MET->SeekRel(4);
nStartIndex=ReadBigEndianWord();
pOS2MET->SeekRel(3);
- *pOS2MET >> nbyte; nBytesPerCol=((USHORT)nbyte) & 0x00ff;
+ *pOS2MET >> nbyte; nBytesPerCol=((sal_uInt16)nbyte) & 0x00ff;
nEndIndex=nStartIndex+(nElemLen-11)/nBytesPerCol;
for (i=nStartIndex; i<nEndIndex; i++) {
if (nBytesPerCol > 3) pOS2MET->SeekRel(nBytesPerCol-3);
@@ -2360,7 +2360,7 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=4;
}
- nPos+=(ULONG)nElemLen;
+ nPos+=(sal_uLong)nElemLen;
pOS2MET->Seek(nPos);
}
break;
@@ -2374,12 +2374,12 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
pB->pBMP=NULL; pB->nWidth=0; pB->nHeight=0; pB->nBitsPerPixel=0;
pB->nMapPos=0;
// ID der Bitmap ermitteln:
- BYTE i,nbyte,nbyte2;
+ sal_uInt8 i,nbyte,nbyte2;
pB->nID=0;
for (i=0; i<4; i++) {
*pOS2MET >> nbyte >> nbyte2;
nbyte=((nbyte-0x30)<<4)|(nbyte2-0x30);
- pB->nID=(pB->nID>>8)|(((ULONG)nbyte)<<24);
+ pB->nID=(pB->nID>>8)|(((sal_uLong)nbyte)<<24);
}
// neue Palette auf den Paletten-Stack bringen: (wird spaeter gefuellt)
OSPalette * pP=new OSPalette;
@@ -2397,7 +2397,7 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
}
pBitmapList->pBMP->Seek(0);
- pBitmapList->aBitmap.Read( *( pBitmapList->pBMP ), FALSE );
+ pBitmapList->aBitmap.Read( *( pBitmapList->pBMP ), sal_False );
if (pBitmapList->pBMP->GetError()!=0) {
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
@@ -2416,26 +2416,26 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
case DscImgObjMagic:
break;
case DatImgObjMagic: {
- USHORT nDataID, nDataLen;
- BYTE nbyte;
- ULONG nPos, nMaxPos;
+ sal_uInt16 nDataID, nDataLen;
+ sal_uInt8 nbyte;
+ sal_uLong nPos, nMaxPos;
nPos=pOS2MET->Tell();
- nMaxPos=nPos+(ULONG)nFieldSize;
+ nMaxPos=nPos+(sal_uLong)nFieldSize;
while (nPos<nMaxPos && pOS2MET->GetError()==0) {
- *pOS2MET >> nbyte; nDataID=((USHORT)nbyte)&0x00ff;
+ *pOS2MET >> nbyte; nDataID=((sal_uInt16)nbyte)&0x00ff;
if (nDataID==0x00fe) {
*pOS2MET >> nbyte;
- nDataID=(nDataID<<8)|(((USHORT)nbyte)&0x00ff);
+ nDataID=(nDataID<<8)|(((sal_uInt16)nbyte)&0x00ff);
nDataLen=ReadBigEndianWord();
nPos+=4;
}
else {
- *pOS2MET >> nbyte; nDataLen=((USHORT)nbyte)&0x00ff;
+ *pOS2MET >> nbyte; nDataLen=((sal_uInt16)nbyte)&0x00ff;
nPos+=2;
}
ReadImageData(nDataID, nDataLen);
- nPos+=(ULONG)nDataLen;
+ nPos+=(sal_uLong)nDataLen;
pOS2MET->Seek(nPos);
}
break;
@@ -2449,9 +2449,9 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
break;
case EndGrfObjMagic: {
SvStream * pSave;
- ULONG nPos, nMaxPos;
- USHORT nOrderID, nOrderLen;
- BYTE nbyte;
+ sal_uLong nPos, nMaxPos;
+ sal_uInt16 nOrderID, nOrderLen;
+ sal_uInt8 nbyte;
if (pOrdFile==NULL) break;
@@ -2474,10 +2474,10 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
// Schleife ueber Order:
while (pOS2MET->Tell()<nMaxPos && pOS2MET->GetError()==0) {
- *pOS2MET >> nbyte; nOrderID=((USHORT)nbyte) & 0x00ff;
+ *pOS2MET >> nbyte; nOrderID=((sal_uInt16)nbyte) & 0x00ff;
if (nOrderID==0x00fe) {
*pOS2MET >> nbyte;
- nOrderID=(nOrderID << 8) | (((USHORT)nbyte) & 0x00ff);
+ nOrderID=(nOrderID << 8) | (((sal_uInt16)nbyte) & 0x00ff);
}
if (nOrderID>0x00ff || nOrderID==GOrdPolygn) {
// ooo: Laut OS2-Doku sollte die Orderlaenge nun als Big-Endian-Word
@@ -2485,13 +2485,13 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
// Tatsaechlich gibt es aber Dateien, die die Laenge als
// Little-Endian-Word angeben (zu mindestens fuer nOrderID==GOrdPolygn).
// Also werfen wir eine Muenze oder was ?
- *pOS2MET >> nbyte; nOrderLen=(USHORT)nbyte&0x00ff;
- *pOS2MET >> nbyte; if (nbyte!=0) nOrderLen=nOrderLen<<8|(((USHORT)nbyte)&0x00ff);
+ *pOS2MET >> nbyte; nOrderLen=(sal_uInt16)nbyte&0x00ff;
+ *pOS2MET >> nbyte; if (nbyte!=0) nOrderLen=nOrderLen<<8|(((sal_uInt16)nbyte)&0x00ff);
}
else if (nOrderID==GOrdSTxAlg || nOrderID==GOrdPTxAlg) nOrderLen=2;
else if ((nOrderID&0xff88)==0x0008) nOrderLen=1;
else if (nOrderID==0x0000 || nOrderID==0x00ff) nOrderLen=0;
- else { *pOS2MET >> nbyte; nOrderLen=((USHORT)nbyte) & 0x00ff; }
+ else { *pOS2MET >> nbyte; nOrderLen=((sal_uInt16)nbyte) & 0x00ff; }
nPos=pOS2MET->Tell();
ReadOrder(nOrderID, nOrderLen);
if (nPos+nOrderLen < pOS2MET->Tell()) {
@@ -2513,14 +2513,14 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
break;
}
case DscGrfObjMagic: {
- ULONG nPos, nMaxPos;
- USHORT nDscID, nDscLen;
- BYTE nbyte;
+ sal_uLong nPos, nMaxPos;
+ sal_uInt16 nDscID, nDscLen;
+ sal_uInt8 nbyte;
- nMaxPos=pOS2MET->Tell()+(ULONG)nFieldSize;
+ nMaxPos=pOS2MET->Tell()+(sal_uLong)nFieldSize;
while (pOS2MET->Tell()<nMaxPos && pOS2MET->GetError()==0) {
- *pOS2MET >> nbyte; nDscID =((USHORT)nbyte) & 0x00ff;
- *pOS2MET >> nbyte; nDscLen=((USHORT)nbyte) & 0x00ff;
+ *pOS2MET >> nbyte; nDscID =((sal_uInt16)nbyte) & 0x00ff;
+ *pOS2MET >> nbyte; nDscLen=((sal_uInt16)nbyte) & 0x00ff;
nPos=pOS2MET->Tell();
ReadDsc(nDscID, nDscLen);
pOS2MET->Seek(nPos+nDscLen);
@@ -2532,7 +2532,7 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
pOrdFile = new SvMemoryStream;
pOrdFile->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
}
- BYTE * pBuf; pBuf = new BYTE[nFieldSize];
+ sal_uInt8 * pBuf; pBuf = new sal_uInt8[nFieldSize];
pOS2MET->Read(pBuf,nFieldSize);
pOrdFile->Write(pBuf,nFieldSize);
delete[] pBuf;
@@ -2549,10 +2549,10 @@ void OS2METReader::ReadField(USHORT nFieldType, USHORT nFieldSize)
void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaFile )
{
- USHORT nFieldSize;
- USHORT nFieldType;
- ULONG nPos, nStartPos, nEndPos, nPercent, nLastPercent;
- BYTE nMagicByte;
+ sal_uInt16 nFieldSize;
+ sal_uInt16 nFieldType;
+ sal_uLong nPos, nStartPos, nEndPos, nPercent, nLastPercent;
+ sal_uInt8 nMagicByte;
ErrorCode=0;
@@ -2560,7 +2560,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
nOrigPos = pOS2MET->Tell();
nOrigNumberFormat = pOS2MET->GetNumberFormatInt();
- bCoord32 = TRUE;
+ bCoord32 = sal_True;
pPaletteStack=NULL;
pAreaStack=NULL;
pPathStack=NULL;
@@ -2603,7 +2603,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
aDefAttr.nMrkPrec =0x01;
aDefAttr.nMrkSet =0xff;
aDefAttr.nMrkSymbol =0x01;
- aDefAttr.bFill =TRUE;
+ aDefAttr.bFill =sal_True;
aDefAttr.nStrLinWidth=0;
aAttr=aDefAttr;
@@ -2611,7 +2611,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
pOrdFile=NULL;
pVirDev = new VirtualDevice();
- pVirDev->EnableOutput(FALSE);
+ pVirDev->EnableOutput(sal_False);
rGDIMetaFile.Record(pVirDev);
pOS2MET->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
@@ -2631,7 +2631,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
nPercent=(nPos-nStartPos)*100/(nEndPos-nStartPos);
if (nLastPercent+4<=nPercent) {
- if (Callback((USHORT)nPercent)==TRUE) break;
+ if (Callback((sal_uInt16)nPercent)==sal_True) break;
nLastPercent=nPercent;
}
@@ -2659,7 +2659,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
ReadField(nFieldType, nFieldSize);
- nPos+=(ULONG)nFieldSize;
+ nPos+=(sal_uLong)nFieldSize;
if (pOS2MET->Tell()>nPos) {
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=9;
@@ -2739,46 +2739,21 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
//================== GraphicImport - die exportierte Funktion ================
-extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool )
{
OS2METReader aOS2METReader;
GDIMetaFile aMTF;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
aOS2METReader.ReadOS2MET( rStream, aMTF );
if ( !rStream.GetError() )
{
rGraphic=Graphic( aMTF );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
-//================== ein bischen Muell fuer Windows ==========================
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/ipbm/ipbm.cxx b/filter/source/graphicfilter/ipbm/ipbm.cxx
index 160a63aa27fb..6f6fd876d583 100644
--- a/filter/source/graphicfilter/ipbm/ipbm.cxx
+++ b/filter/source/graphicfilter/ipbm/ipbm.cxx
@@ -41,32 +41,32 @@ private:
SvStream& mrPBM; // Die einzulesende PBM-Datei
- BOOL mbStatus;
- BOOL mbRemark; // FALSE wenn sich stream in einem Kommentar befindet
- BOOL mbRaw; // RAW/ASCII MODE
- ULONG mnMode; // 0->PBM, 1->PGM, 2->PPM
+ sal_Bool mbStatus;
+ sal_Bool mbRemark; // sal_False wenn sich stream in einem Kommentar befindet
+ sal_Bool mbRaw; // RAW/ASCII MODE
+ sal_uLong mnMode; // 0->PBM, 1->PGM, 2->PPM
Bitmap maBmp;
BitmapWriteAccess* mpAcc;
- ULONG mnWidth, mnHeight; // Bildausmass in Pixeln
- ULONG mnCol;
- ULONG mnMaxVal; // maximaler wert in den
- BOOL ImplCallback( USHORT nPercent );
- BOOL ImplReadBody();
- BOOL ImplReadHeader();
+ sal_uLong mnWidth, mnHeight; // Bildausmass in Pixeln
+ sal_uLong mnCol;
+ sal_uLong mnMaxVal; // maximaler wert in den
+ sal_Bool ImplCallback( sal_uInt16 nPercent );
+ sal_Bool ImplReadBody();
+ sal_Bool ImplReadHeader();
public:
PBMReader(SvStream & rPBM);
~PBMReader();
- BOOL ReadPBM(Graphic & rGraphic );
+ sal_Bool ReadPBM(Graphic & rGraphic );
};
//=================== Methoden von PBMReader ==============================
PBMReader::PBMReader(SvStream & rPBM)
: mrPBM( rPBM )
- , mbStatus( TRUE )
- , mbRemark( FALSE )
- , mbRaw( TRUE )
+ , mbStatus( sal_True )
+ , mbRemark( sal_False )
+ , mbRaw( sal_True )
, mpAcc( NULL )
{
}
@@ -75,45 +75,45 @@ PBMReader::~PBMReader()
{
}
-BOOL PBMReader::ImplCallback( USHORT /*nPercent*/ )
+sal_Bool PBMReader::ImplCallback( sal_uInt16 /*nPercent*/ )
{
/*
if ( pCallback != NULL )
{
- if ( ( (*pCallback)( pCallerData, nPercent ) ) == TRUE )
+ if ( ( (*pCallback)( pCallerData, nPercent ) ) == sal_True )
{
mrPBM.SetError( SVSTREAM_FILEFORMAT_ERROR );
- return TRUE;
+ return sal_True;
}
}
*/
- return FALSE;
+ return sal_False;
}
-BOOL PBMReader::ReadPBM(Graphic & rGraphic )
+sal_Bool PBMReader::ReadPBM(Graphic & rGraphic )
{
- USHORT i;
+ sal_uInt16 i;
if ( mrPBM.GetError() )
- return FALSE;
+ return sal_False;
mrPBM.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
// Kopf einlesen:
- if ( ( mbStatus = ImplReadHeader() ) == FALSE )
- return FALSE;
+ if ( ( mbStatus = ImplReadHeader() ) == sal_False )
+ return sal_False;
if ( ( mnMaxVal == 0 ) || ( mnWidth == 0 ) || ( mnHeight == 0 ) )
- return FALSE;
+ return sal_False;
// 0->PBM, 1->PGM, 2->PPM
switch ( mnMode )
{
case 0 :
maBmp = Bitmap( Size( mnWidth, mnHeight ), 1 );
- if ( ( mpAcc = maBmp.AcquireWriteAccess() ) == FALSE )
- return FALSE;
+ if ( ( mpAcc = maBmp.AcquireWriteAccess() ) == sal_False )
+ return sal_False;
mpAcc->SetPaletteEntryCount( 2 );
mpAcc->SetPaletteColor( 0, BitmapColor( 0xff, 0xff, 0xff ) );
mpAcc->SetPaletteColor( 1, BitmapColor( 0x00, 0x00, 0x00 ) );
@@ -127,23 +127,23 @@ BOOL PBMReader::ReadPBM(Graphic & rGraphic )
else
maBmp = Bitmap( Size( mnWidth, mnHeight ), 8);
- if ( ( mpAcc = maBmp.AcquireWriteAccess() ) == FALSE )
- return FALSE;
- mnCol = (USHORT)mnMaxVal + 1;
+ if ( ( mpAcc = maBmp.AcquireWriteAccess() ) == sal_False )
+ return sal_False;
+ mnCol = (sal_uInt16)mnMaxVal + 1;
if ( mnCol > 256 )
mnCol = 256;
mpAcc->SetPaletteEntryCount( 256 );
for ( i = 0; i < mnCol; i++ )
{
- ULONG nCount = 255 * i / mnCol;
- mpAcc->SetPaletteColor( i, BitmapColor( (BYTE)nCount, (BYTE)nCount, (BYTE)nCount ) );
+ sal_uLong nCount = 255 * i / mnCol;
+ mpAcc->SetPaletteColor( i, BitmapColor( (sal_uInt8)nCount, (sal_uInt8)nCount, (sal_uInt8)nCount ) );
}
break;
case 2 :
maBmp = Bitmap( Size( mnWidth, mnHeight ), 24 );
- if ( ( mpAcc = maBmp.AcquireWriteAccess() ) == FALSE )
- return FALSE;
+ if ( ( mpAcc = maBmp.AcquireWriteAccess() ) == sal_False )
+ return sal_False;
break;
}
@@ -160,56 +160,56 @@ BOOL PBMReader::ReadPBM(Graphic & rGraphic )
return mbStatus;
}
-BOOL PBMReader::ImplReadHeader()
+sal_Bool PBMReader::ImplReadHeader()
{
- BYTE nID[ 2 ];
- BYTE nDat;
- BYTE nMax, nCount = 0;
- BOOL bFinished = FALSE;
+ sal_uInt8 nID[ 2 ];
+ sal_uInt8 nDat;
+ sal_uInt8 nMax, nCount = 0;
+ sal_Bool bFinished = sal_False;
mrPBM >> nID[ 0 ] >> nID[ 1 ];
if ( nID[ 0 ] != 'P' )
- return FALSE;
+ return sal_False;
mnMaxVal = mnWidth = mnHeight = 0;
switch ( nID[ 1 ] )
{
case '1' :
- mbRaw = FALSE;
+ mbRaw = sal_False;
case '4' :
mnMode = 0;
nMax = 2; // number of parameters in Header
mnMaxVal = 1;
break;
case '2' :
- mbRaw = FALSE;
+ mbRaw = sal_False;
case '5' :
mnMode = 1;
nMax = 3;
break;
case '3' :
- mbRaw = FALSE;
+ mbRaw = sal_False;
case '6' :
mnMode = 2;
nMax = 3;
break;
default:
- return FALSE;
+ return sal_False;
}
- while ( bFinished == FALSE )
+ while ( bFinished == sal_False )
{
if ( mrPBM.GetError() )
- return FALSE;
+ return sal_False;
mrPBM >> nDat;
if ( nDat == '#' )
{
- mbRemark = TRUE;
+ mbRemark = sal_True;
continue;
}
else if ( ( nDat == 0x0d ) || ( nDat == 0x0a ) )
{
- mbRemark = FALSE;
+ mbRemark = sal_False;
nDat = 0x20;
}
if ( mbRemark )
@@ -222,11 +222,11 @@ BOOL PBMReader::ImplReadHeader()
else if ( ( nCount == 1 ) && mnHeight )
{
if ( ++nCount == nMax )
- bFinished = TRUE;
+ bFinished = sal_True;
}
else if ( ( nCount == 2 ) && mnMaxVal )
{
- bFinished = TRUE;
+ bFinished = sal_True;
}
continue;
}
@@ -250,18 +250,18 @@ BOOL PBMReader::ImplReadHeader()
}
}
else
- return FALSE;
+ return sal_False;
}
return mbStatus;
}
-BOOL PBMReader::ImplReadBody()
+sal_Bool PBMReader::ImplReadBody()
{
- BOOL bPara, bFinished = FALSE;
- BYTE nDat = 0, nCount;
- ULONG nGrey, nRGB[3];
- ULONG nWidth = 0;
- ULONG nHeight = 0;
+ sal_Bool bPara, bFinished = sal_False;
+ sal_uInt8 nDat = 0, nCount;
+ sal_uLong nGrey, nRGB[3];
+ sal_uLong nWidth = 0;
+ sal_uLong nHeight = 0;
if ( mbRaw )
{
@@ -274,7 +274,7 @@ BOOL PBMReader::ImplReadBody()
while ( nHeight != mnHeight )
{
if ( mrPBM.IsEof() || mrPBM.GetError() )
- return FALSE;
+ return sal_False;
if ( --nShift < 0 )
{
@@ -287,7 +287,7 @@ BOOL PBMReader::ImplReadBody()
nShift = 0;
nWidth = 0;
nHeight++;
- ImplCallback( (USHORT)( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
+ ImplCallback( (sal_uInt16)( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
}
}
break;
@@ -297,7 +297,7 @@ BOOL PBMReader::ImplReadBody()
while ( nHeight != mnHeight )
{
if ( mrPBM.IsEof() || mrPBM.GetError() )
- return FALSE;
+ return sal_False;
mrPBM >> nDat;
mpAcc->SetPixel( nHeight, nWidth++, nDat);
@@ -306,7 +306,7 @@ BOOL PBMReader::ImplReadBody()
{
nWidth = 0;
nHeight++;
- ImplCallback( (USHORT)( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
+ ImplCallback( (sal_uInt16)( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
}
}
break;
@@ -316,20 +316,20 @@ BOOL PBMReader::ImplReadBody()
while ( nHeight != mnHeight )
{
if ( mrPBM.IsEof() || mrPBM.GetError() )
- return FALSE;
+ return sal_False;
- BYTE nR, nG, nB;
- ULONG nRed, nGreen, nBlue;
+ sal_uInt8 nR, nG, nB;
+ sal_uLong nRed, nGreen, nBlue;
mrPBM >> nR >> nG >> nB;
nRed = 255 * nR / mnMaxVal;
nGreen = 255 * nG / mnMaxVal;
nBlue = 255 * nB / mnMaxVal;
- mpAcc->SetPixel( nHeight, nWidth++, BitmapColor( (BYTE)nRed, (BYTE)nGreen, (BYTE)nBlue ) );
+ mpAcc->SetPixel( nHeight, nWidth++, BitmapColor( (sal_uInt8)nRed, (sal_uInt8)nGreen, (sal_uInt8)nBlue ) );
if ( nWidth == mnWidth )
{
nWidth = 0;
nHeight++;
- ImplCallback( (USHORT) ( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
+ ImplCallback( (sal_uInt16) ( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
}
}
break;
@@ -339,21 +339,21 @@ BOOL PBMReader::ImplReadBody()
{
// PBM
case 0 :
- while ( bFinished == FALSE )
+ while ( bFinished == sal_False )
{
if ( mrPBM.IsEof() || mrPBM.GetError() )
- return FALSE;
+ return sal_False;
mrPBM >> nDat;
if ( nDat == '#' )
{
- mbRemark = TRUE;
+ mbRemark = sal_True;
continue;
}
else if ( ( nDat == 0x0d ) || ( nDat == 0x0a ) )
{
- mbRemark = FALSE;
+ mbRemark = sal_False;
continue;
}
if ( mbRemark || nDat == 0x20 || nDat == 0x09 )
@@ -361,68 +361,68 @@ BOOL PBMReader::ImplReadBody()
if ( nDat == '0' || nDat == '1' )
{
- mpAcc->SetPixel( nHeight, nWidth, (BYTE)nDat-'0' );
+ mpAcc->SetPixel( nHeight, nWidth, (sal_uInt8)nDat-'0' );
nWidth++;
if ( nWidth == mnWidth )
{
nWidth = 0;
if ( ++nHeight == mnHeight )
- bFinished = TRUE;
- ImplCallback( (USHORT) ( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
+ bFinished = sal_True;
+ ImplCallback( (sal_uInt16) ( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
}
}
else
- return FALSE;
+ return sal_False;
}
break;
// PGM
case 1 :
- bPara = FALSE;
+ bPara = sal_False;
nCount = 0;
nGrey = 0;
- while ( bFinished == FALSE )
+ while ( bFinished == sal_False )
{
if ( nCount )
{
nCount--;
if ( nGrey <= mnMaxVal )
nGrey = 255 * nGrey / mnMaxVal;
- mpAcc->SetPixel( nHeight, nWidth++, (BYTE)nGrey );
+ mpAcc->SetPixel( nHeight, nWidth++, (sal_uInt8)nGrey );
nGrey = 0;
if ( nWidth == mnWidth )
{
nWidth = 0;
if ( ++nHeight == mnHeight )
- bFinished = TRUE;
- ImplCallback( (USHORT) ( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
+ bFinished = sal_True;
+ ImplCallback( (sal_uInt16) ( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
}
continue;
}
if ( mrPBM.IsEof() || mrPBM.GetError() )
- return FALSE;
+ return sal_False;
mrPBM >> nDat;
if ( nDat == '#' )
{
- mbRemark = TRUE;
+ mbRemark = sal_True;
if ( bPara )
{
- bPara = FALSE;
+ bPara = sal_False;
nCount++;
}
continue;
}
else if ( ( nDat == 0x0d ) || ( nDat == 0x0a ) )
{
- mbRemark = FALSE;
+ mbRemark = sal_False;
if ( bPara )
{
- bPara = FALSE;
+ bPara = sal_False;
nCount++;
}
continue;
@@ -432,20 +432,20 @@ BOOL PBMReader::ImplReadBody()
{
if ( bPara )
{
- bPara = FALSE;
+ bPara = sal_False;
nCount++;
}
continue;
}
if ( nDat >= '0' && nDat <= '9' )
{
- bPara = TRUE;
+ bPara = sal_True;
nGrey *= 10;
nGrey += nDat-'0';
continue;
}
else
- return FALSE;
+ return sal_False;
}
break;
@@ -454,51 +454,51 @@ BOOL PBMReader::ImplReadBody()
// PPM
case 2 :
- bPara = FALSE;
+ bPara = sal_False;
nCount = 0;
nRGB[ 0 ] = nRGB[ 1 ] = nRGB[ 2 ] = 0;
- while ( bFinished == FALSE )
+ while ( bFinished == sal_False )
{
if ( nCount == 3 )
{
nCount = 0;
- mpAcc->SetPixel( nHeight, nWidth++, BitmapColor( static_cast< BYTE >( ( nRGB[ 0 ] * 255 ) / mnMaxVal ),
- static_cast< BYTE >( ( nRGB[ 1 ] * 255 ) / mnMaxVal ),
- static_cast< BYTE >( ( nRGB[ 2 ] * 255 ) / mnMaxVal ) ) );
+ mpAcc->SetPixel( nHeight, nWidth++, BitmapColor( static_cast< sal_uInt8 >( ( nRGB[ 0 ] * 255 ) / mnMaxVal ),
+ static_cast< sal_uInt8 >( ( nRGB[ 1 ] * 255 ) / mnMaxVal ),
+ static_cast< sal_uInt8 >( ( nRGB[ 2 ] * 255 ) / mnMaxVal ) ) );
nCount = 0;
nRGB[ 0 ] = nRGB[ 1 ] = nRGB[ 2 ] = 0;
if ( nWidth == mnWidth )
{
nWidth = 0;
if ( ++nHeight == mnHeight )
- bFinished = TRUE;
- ImplCallback( (USHORT) ( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
+ bFinished = sal_True;
+ ImplCallback( (sal_uInt16) ( ( 100 * nHeight ) / mnHeight ) ); // processing output in percent
}
continue;
}
if ( mrPBM.IsEof() || mrPBM.GetError() )
- return FALSE;
+ return sal_False;
mrPBM >> nDat;
if ( nDat == '#' )
{
- mbRemark = TRUE;
+ mbRemark = sal_True;
if ( bPara )
{
- bPara = FALSE;
+ bPara = sal_False;
nCount++;
}
continue;
}
else if ( ( nDat == 0x0d ) || ( nDat == 0x0a ) )
{
- mbRemark = FALSE;
+ mbRemark = sal_False;
if ( bPara )
{
- bPara = FALSE;
+ bPara = sal_False;
nCount++;
}
continue;
@@ -508,20 +508,20 @@ BOOL PBMReader::ImplReadBody()
{
if ( bPara )
{
- bPara = FALSE;
+ bPara = sal_False;
nCount++;
}
continue;
}
if ( nDat >= '0' && nDat <= '9' )
{
- bPara = TRUE;
+ bPara = sal_True;
nRGB[ nCount ] *= 10;
nRGB[ nCount ] += nDat-'0';
continue;
}
else
- return FALSE;
+ return sal_False;
}
break;
}
@@ -530,36 +530,11 @@ BOOL PBMReader::ImplReadBody()
//================== GraphicImport - die exportierte Funktion ================
-extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool )
{
PBMReader aPBMReader(rStream);
return aPBMReader.ReadPBM(rGraphic );
}
-//================== ein bischen Muell fuer Windows ==========================
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/ipcd/ipcd.cxx b/filter/source/graphicfilter/ipcd/ipcd.cxx
index cfa5e9fed111..8eae5065b250 100644
--- a/filter/source/graphicfilter/ipcd/ipcd.cxx
+++ b/filter/source/graphicfilter/ipcd/ipcd.cxx
@@ -54,14 +54,14 @@ class PCDReader {
private:
- BOOL bStatus;
+ sal_Bool bStatus;
- ULONG nLastPercent;
+ sal_uLong nLastPercent;
SvStream &m_rPCD;
BitmapWriteAccess* mpAcc;
- BYTE nOrientation; // Ausrichtung des Bildes in der PCD-Datei:
+ sal_uInt8 nOrientation; // Ausrichtung des Bildes in der PCD-Datei:
// 0 - Turmspitze zeigt nach oben
// 1 - Turmspitze zeigt nach rechts
// 2 - Turmspitze zeigt nach unten
@@ -69,15 +69,15 @@ private:
PCDResolution eResolution; // Welche Aufloesung wir haben wollen
- ULONG nWidth; // Breite des PCD-Bildes
- ULONG nHeight; // Hoehe des PCD-Bildes
- ULONG nImagePos; // Position des Bildes in der PCD-Datei
+ sal_uLong nWidth; // Breite des PCD-Bildes
+ sal_uLong nHeight; // Hoehe des PCD-Bildes
+ sal_uLong nImagePos; // Position des Bildes in der PCD-Datei
// Temporare BLue-Green-Red-Bitmap
- ULONG nBMPWidth;
- ULONG nBMPHeight;
+ sal_uLong nBMPWidth;
+ sal_uLong nBMPHeight;
- void MayCallback(ULONG nPercent);
+ void MayCallback(sal_uLong nPercent);
void CheckPCDImagePacFile();
// Prueft, ob es eine Photo-CD-Datei mit 'Image Pac' ist.
@@ -85,7 +85,7 @@ private:
void ReadOrientation();
// Liest die Ausrichtung und setzt nOrientation
- void ReadImage(ULONG nMinPercent, ULONG nMaxPercent);
+ void ReadImage(sal_uLong nMinPercent, sal_uLong nMaxPercent);
public:
@@ -95,21 +95,21 @@ public:
}
~PCDReader() {}
- BOOL ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem );
+ sal_Bool ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem );
};
//=================== Methoden von PCDReader ==============================
-BOOL PCDReader::ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem )
+sal_Bool PCDReader::ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem )
{
Bitmap aBmp;
- bStatus = TRUE;
+ bStatus = sal_True;
nLastPercent = 0;
MayCallback( 0 );
- // Ist es eine PCD-Datei mit Bild ? ( setzt bStatus == FALSE, wenn nicht ):
+ // Ist es eine PCD-Datei mit Bild ? ( setzt bStatus == sal_False, wenn nicht ):
CheckPCDImagePacFile();
// Orientierung des Bildes einlesen:
@@ -147,7 +147,7 @@ BOOL PCDReader::ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem )
break;
default:
- bStatus = FALSE;
+ bStatus = sal_False;
}
if ( bStatus )
{
@@ -162,8 +162,8 @@ BOOL PCDReader::ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem )
nBMPHeight = nWidth;
}
aBmp = Bitmap( Size( nBMPWidth, nBMPHeight ), 24 );
- if ( ( mpAcc = aBmp.AcquireWriteAccess() ) == FALSE )
- return FALSE;
+ if ( ( mpAcc = aBmp.AcquireWriteAccess() ) == sal_False )
+ return sal_False;
ReadImage( 5 ,65 );
@@ -175,16 +175,16 @@ BOOL PCDReader::ReadPCD( Graphic & rGraphic, FilterConfigItem* pConfigItem )
// -------------------------------------------------------------------------------------------
-void PCDReader::MayCallback(ULONG /*nPercent*/)
+void PCDReader::MayCallback(sal_uLong /*nPercent*/)
{
/*
if ( nPercent >= nLastPercent + 3 )
{
nLastPercent=nPercent;
- if ( pCallback != NULL && nPercent <= 100 && bStatus == TRUE )
+ if ( pCallback != NULL && nPercent <= 100 && bStatus == sal_True )
{
- if ( ( (*pCallback)( pCallerData, (USHORT)nPercent ) ) == TRUE )
- bStatus = FALSE;
+ if ( ( (*pCallback)( pCallerData, (sal_uInt16)nPercent ) ) == sal_True )
+ bStatus = sal_False;
}
}
*/
@@ -200,14 +200,14 @@ void PCDReader::CheckPCDImagePacFile()
m_rPCD.Read( Buf, 7 );
Buf[ 7 ] = 0;
if ( ByteString( Buf ).CompareTo( "PCD_IPI" ) != COMPARE_EQUAL )
- bStatus = FALSE;
+ bStatus = sal_False;
}
// -------------------------------------------------------------------------------------------
void PCDReader::ReadOrientation()
{
- if ( bStatus == FALSE )
+ if ( bStatus == sal_False )
return;
m_rPCD.Seek( 194635 );
m_rPCD >> nOrientation;
@@ -216,31 +216,31 @@ void PCDReader::ReadOrientation()
// -------------------------------------------------------------------------------------------
-void PCDReader::ReadImage(ULONG nMinPercent, ULONG nMaxPercent)
+void PCDReader::ReadImage(sal_uLong nMinPercent, sal_uLong nMaxPercent)
{
- ULONG nx,ny,nW2,nH2,nYPair,ndy,nXPair;
+ sal_uLong nx,ny,nW2,nH2,nYPair,ndy,nXPair;
long nL,nCb,nCr,nRed,nGreen,nBlue;
- BYTE * pt;
- BYTE * pL0; // Luminanz fuer jeden Pixel der 1. Zeile des aktuellen Zeilen-Paars
- BYTE * pL1; // Luminanz fuer jeden Pixel der 2. Zeile des aktuellen Zeilen-Paars
- BYTE * pCb; // Blau-Chrominanz fuer je 2x2 Pixel des aktuellen Zeilen-Paars
- BYTE * pCr; // Rot-Chrominanz fuer je 2x2 Pixel des aktuellen Zeilen-Paars
- BYTE * pL0N, * pL1N, * pCbN, * pCrN; // wie oben, nur fuer das naechste Zeilen-Paar
-
- if ( bStatus == FALSE )
+ sal_uInt8 * pt;
+ sal_uInt8 * pL0; // Luminanz fuer jeden Pixel der 1. Zeile des aktuellen Zeilen-Paars
+ sal_uInt8 * pL1; // Luminanz fuer jeden Pixel der 2. Zeile des aktuellen Zeilen-Paars
+ sal_uInt8 * pCb; // Blau-Chrominanz fuer je 2x2 Pixel des aktuellen Zeilen-Paars
+ sal_uInt8 * pCr; // Rot-Chrominanz fuer je 2x2 Pixel des aktuellen Zeilen-Paars
+ sal_uInt8 * pL0N, * pL1N, * pCbN, * pCrN; // wie oben, nur fuer das naechste Zeilen-Paar
+
+ if ( bStatus == sal_False )
return;
nW2=nWidth>>1;
nH2=nHeight>>1;
- pL0 =(BYTE*)rtl_allocateMemory( nWidth );
- pL1 =(BYTE*)rtl_allocateMemory( nWidth );
- pCb =(BYTE*)rtl_allocateMemory( nW2+1 );
- pCr =(BYTE*)rtl_allocateMemory( nW2+1 );
- pL0N=(BYTE*)rtl_allocateMemory( nWidth );
- pL1N=(BYTE*)rtl_allocateMemory( nWidth );
- pCbN=(BYTE*)rtl_allocateMemory( nW2+1 );
- pCrN=(BYTE*)rtl_allocateMemory( nW2+1 );
+ pL0 =(sal_uInt8*)rtl_allocateMemory( nWidth );
+ pL1 =(sal_uInt8*)rtl_allocateMemory( nWidth );
+ pCb =(sal_uInt8*)rtl_allocateMemory( nW2+1 );
+ pCr =(sal_uInt8*)rtl_allocateMemory( nW2+1 );
+ pL0N=(sal_uInt8*)rtl_allocateMemory( nWidth );
+ pL1N=(sal_uInt8*)rtl_allocateMemory( nWidth );
+ pCbN=(sal_uInt8*)rtl_allocateMemory( nW2+1 );
+ pCrN=(sal_uInt8*)rtl_allocateMemory( nW2+1 );
if ( pL0 == NULL || pL1 == NULL || pCb == NULL || pCr == NULL ||
pL0N == NULL || pL1N == NULL || pCbN == NULL || pCrN == NULL)
@@ -253,7 +253,7 @@ void PCDReader::ReadImage(ULONG nMinPercent, ULONG nMaxPercent)
rtl_freeMemory((void*)pL1N);
rtl_freeMemory((void*)pCbN);
rtl_freeMemory((void*)pCrN);
- bStatus = FALSE;
+ bStatus = sal_False;
return;
}
@@ -357,24 +357,24 @@ void PCDReader::ReadImage(ULONG nMinPercent, ULONG nMaxPercent)
if ( nOrientation < 2 )
{
if ( nOrientation == 0 )
- mpAcc->SetPixel( ny, nx, BitmapColor( (BYTE)nRed, (BYTE)nGreen, (BYTE)nBlue ) );
+ mpAcc->SetPixel( ny, nx, BitmapColor( (sal_uInt8)nRed, (sal_uInt8)nGreen, (sal_uInt8)nBlue ) );
else
- mpAcc->SetPixel( nWidth - 1 - nx, ny, BitmapColor( (BYTE)nRed, (BYTE)nGreen, (BYTE)nBlue ) );
+ mpAcc->SetPixel( nWidth - 1 - nx, ny, BitmapColor( (sal_uInt8)nRed, (sal_uInt8)nGreen, (sal_uInt8)nBlue ) );
}
else
{
if ( nOrientation == 2 )
- mpAcc->SetPixel( nHeight - 1 - ny, ( nWidth - 1 - nx ), BitmapColor( (BYTE)nRed, (BYTE)nGreen, (BYTE)nBlue ) );
+ mpAcc->SetPixel( nHeight - 1 - ny, ( nWidth - 1 - nx ), BitmapColor( (sal_uInt8)nRed, (sal_uInt8)nGreen, (sal_uInt8)nBlue ) );
else
- mpAcc->SetPixel( nx, ( nHeight - 1 - ny ), BitmapColor( (BYTE)nRed, (BYTE)nGreen, (BYTE)nBlue ) );
+ mpAcc->SetPixel( nx, ( nHeight - 1 - ny ), BitmapColor( (sal_uInt8)nRed, (sal_uInt8)nGreen, (sal_uInt8)nBlue ) );
}
}
}
if ( m_rPCD.GetError() )
- bStatus = FALSE;
+ bStatus = sal_False;
MayCallback( nMinPercent + ( nMaxPercent - nMinPercent ) * nYPair / nH2 );
- if ( bStatus == FALSE )
+ if ( bStatus == sal_False )
break;
}
rtl_freeMemory((void*)pL0 );
@@ -389,36 +389,10 @@ void PCDReader::ReadImage(ULONG nMinPercent, ULONG nMaxPercent)
//================== GraphicImport - die exportierte Funktion ================
-extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pConfigItem, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pConfigItem, sal_Bool )
{
PCDReader aPCDReader(rStream);
return aPCDReader.ReadPCD(rGraphic, pConfigItem);
}
-//============================= fuer Windows ==================================
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx
index 1c09f0018118..e321bb2c48da 100644
--- a/filter/source/graphicfilter/ipcx/ipcx.cxx
+++ b/filter/source/graphicfilter/ipcx/ipcx.cxx
@@ -43,29 +43,29 @@ private:
Bitmap aBmp;
BitmapWriteAccess* pAcc;
- BYTE nVersion; // PCX-Version
- BYTE nEncoding; // Art der Komprimierung
- ULONG nBitsPerPlanePix; // Bits Pro Ebene pro Pixel
- ULONG nPlanes; // Anzahl Ebenen
- ULONG nBytesPerPlaneLin; // Bytes in einer Ebenen pro Zeile
- USHORT nPaletteInfo;
+ sal_uInt8 nVersion; // PCX-Version
+ sal_uInt8 nEncoding; // Art der Komprimierung
+ sal_uLong nBitsPerPlanePix; // Bits Pro Ebene pro Pixel
+ sal_uLong nPlanes; // Anzahl Ebenen
+ sal_uLong nBytesPerPlaneLin; // Bytes in einer Ebenen pro Zeile
+ sal_uInt16 nPaletteInfo;
- ULONG nWidth, nHeight; // Bildausmass in Pixeln
- USHORT nResX, nResY; // Aufloesung in Pixel pro Inch oder 0,0
- USHORT nDestBitsPerPixel; // Bits pro Pixel der Zielbitmap 1,4,8 oder 24
- BYTE* pPalette; //
- BOOL nStatus; // status nun nicht mehr am stream abfragen ( SJ )
+ sal_uLong nWidth, nHeight; // Bildausmass in Pixeln
+ sal_uInt16 nResX, nResY; // Aufloesung in Pixel pro Inch oder 0,0
+ sal_uInt16 nDestBitsPerPixel; // Bits pro Pixel der Zielbitmap 1,4,8 oder 24
+ sal_uInt8* pPalette; //
+ sal_Bool nStatus; // status nun nicht mehr am stream abfragen ( SJ )
- BOOL Callback( USHORT nPercent );
+ sal_Bool Callback( sal_uInt16 nPercent );
void ImplReadBody();
- void ImplReadPalette( ULONG nCol );
+ void ImplReadPalette( sal_uLong nCol );
void ImplReadHeader();
public:
PCXReader(SvStream &rStream);
~PCXReader();
- BOOL ReadPCX(Graphic & rGraphic );
+ sal_Bool ReadPCX(Graphic & rGraphic );
// Liesst aus dem Stream eine PCX-Datei und fuellt das GDIMetaFile
};
@@ -75,7 +75,7 @@ PCXReader::PCXReader(SvStream &rStream)
: m_rPCX(rStream)
, pAcc(NULL)
{
- pPalette = new BYTE[ 768 ];
+ pPalette = new sal_uInt8[ 768 ];
}
PCXReader::~PCXReader()
@@ -83,25 +83,25 @@ PCXReader::~PCXReader()
delete[] pPalette;
}
-BOOL PCXReader::Callback( USHORT /*nPercent*/ )
+sal_Bool PCXReader::Callback( sal_uInt16 /*nPercent*/ )
{
/*
if (pCallback!=NULL) {
- if (((*pCallback)(pCallerData,nPercent))==TRUE) {
- nStatus = FALSE;
- return TRUE;
+ if (((*pCallback)(pCallerData,nPercent))==sal_True) {
+ nStatus = sal_False;
+ return sal_True;
}
}
*/
- return FALSE;
+ return sal_False;
}
-BOOL PCXReader::ReadPCX(Graphic & rGraphic)
+sal_Bool PCXReader::ReadPCX(Graphic & rGraphic)
{
if ( m_rPCX.GetError() )
- return FALSE;
+ return sal_False;
- ULONG* pDummy = new ULONG; delete pDummy; // damit unter OS/2
+ sal_uLong* pDummy = new sal_uLong; delete pDummy; // damit unter OS/2
// das richtige (Tools-)new
// verwendet wird, da es sonst
// in dieser DLL nur Vector-news
@@ -111,7 +111,7 @@ BOOL PCXReader::ReadPCX(Graphic & rGraphic)
// Kopf einlesen:
- nStatus = TRUE;
+ nStatus = sal_True;
ImplReadHeader();
@@ -119,15 +119,15 @@ BOOL PCXReader::ReadPCX(Graphic & rGraphic)
if ( nStatus )
{
aBmp = Bitmap( Size( nWidth, nHeight ), nDestBitsPerPixel );
- if ( ( pAcc = aBmp.AcquireWriteAccess() ) == FALSE )
- return FALSE;
+ if ( ( pAcc = aBmp.AcquireWriteAccess() ) == sal_False )
+ return sal_False;
if ( nDestBitsPerPixel <= 8 )
{
- USHORT nColors = 1 << nDestBitsPerPixel;
- BYTE* pPal = pPalette;
+ sal_uInt16 nColors = 1 << nDestBitsPerPixel;
+ sal_uInt8* pPal = pPalette;
pAcc->SetPaletteEntryCount( nColors );
- for ( USHORT i = 0; i < nColors; i++, pPal += 3 )
+ for ( sal_uInt16 i = 0; i < nColors; i++, pPal += 3 )
{
pAcc->SetPaletteColor( i, BitmapColor ( pPal[ 0 ], pPal[ 1 ], pPal[ 2 ] ) );
}
@@ -139,11 +139,11 @@ BOOL PCXReader::ReadPCX(Graphic & rGraphic)
// in Palette schreiben:
if ( nDestBitsPerPixel == 8 && nStatus )
{
- BYTE* pPal = pPalette;
+ sal_uInt8* pPal = pPalette;
m_rPCX.SeekRel(1);
ImplReadPalette(256);
pAcc->SetPaletteEntryCount( 256 );
- for ( USHORT i = 0; i < 256; i++, pPal += 3 )
+ for ( sal_uInt16 i = 0; i < 256; i++, pPal += 3 )
{
pAcc->SetPaletteColor( i, BitmapColor ( pPal[ 0 ], pPal[ 1 ], pPal[ 2 ] ) );
}
@@ -159,31 +159,31 @@ BOOL PCXReader::ReadPCX(Graphic & rGraphic)
{
aBmp.ReleaseAccess( pAcc ), pAcc = NULL;
rGraphic = aBmp;
- return TRUE;
+ return sal_True;
}
}
- return FALSE;
+ return sal_False;
}
void PCXReader::ImplReadHeader()
{
- BYTE nbyte;
- USHORT nushort;
- USHORT nMinX,nMinY,nMaxX,nMaxY;
+ sal_uInt8 nbyte;
+ sal_uInt16 nushort;
+ sal_uInt16 nMinX,nMinY,nMaxX,nMaxY;
m_rPCX >> nbyte >> nVersion >> nEncoding;
if ( nbyte!=0x0a || (nVersion != 0 && nVersion != 2 && nVersion != 3 && nVersion != 5) || nEncoding > 1 )
{
- nStatus = FALSE;
+ nStatus = sal_False;
return;
}
- m_rPCX >> nbyte; nBitsPerPlanePix = (ULONG)nbyte;
+ m_rPCX >> nbyte; nBitsPerPlanePix = (sal_uLong)nbyte;
m_rPCX >> nMinX >> nMinY >> nMaxX >> nMaxY;
if ((nMinX > nMaxX) || (nMinY > nMaxY))
{
- nStatus = FALSE;
+ nStatus = sal_False;
return;
}
@@ -198,19 +198,19 @@ void PCXReader::ImplReadHeader()
ImplReadPalette( 16 );
m_rPCX.SeekRel( 1 );
- m_rPCX >> nbyte; nPlanes = (ULONG)nbyte;
- m_rPCX >> nushort; nBytesPerPlaneLin = (ULONG)nushort;
+ m_rPCX >> nbyte; nPlanes = (sal_uLong)nbyte;
+ m_rPCX >> nushort; nBytesPerPlaneLin = (sal_uLong)nushort;
m_rPCX >> nPaletteInfo;
m_rPCX.SeekRel( 58 );
- nDestBitsPerPixel = (USHORT)( nBitsPerPlanePix * nPlanes );
+ nDestBitsPerPixel = (sal_uInt16)( nBitsPerPlanePix * nPlanes );
if (nDestBitsPerPixel == 2 || nDestBitsPerPixel == 3) nDestBitsPerPixel = 4;
if ( ( nDestBitsPerPixel != 1 && nDestBitsPerPixel != 4 && nDestBitsPerPixel != 8 && nDestBitsPerPixel != 24 )
|| nPlanes > 4 || nBytesPerPlaneLin < ( ( nWidth * nBitsPerPlanePix+7 ) >> 3 ) )
{
- nStatus = FALSE;
+ nStatus = sal_False;
return;
}
@@ -225,27 +225,27 @@ void PCXReader::ImplReadHeader()
void PCXReader::ImplReadBody()
{
- BYTE *pPlane[ 4 ], * pDest, * pSource1, * pSource2, * pSource3, *pSource4;
- ULONG i, nx, ny, np, nCount, nPercent;
- ULONG nLastPercent = 0;
- BYTE nDat = 0, nCol = 0;
+ sal_uInt8 *pPlane[ 4 ], * pDest, * pSource1, * pSource2, * pSource3, *pSource4;
+ sal_uLong i, nx, ny, np, nCount, nPercent;
+ sal_uLong nLastPercent = 0;
+ sal_uInt8 nDat = 0, nCol = 0;
for( np = 0; np < nPlanes; np++ )
- pPlane[ np ] = new BYTE[ nBytesPerPlaneLin ];
+ pPlane[ np ] = new sal_uInt8[ nBytesPerPlaneLin ];
nCount = 0;
for ( ny = 0; ny < nHeight; ny++ )
{
if (m_rPCX.GetError() || m_rPCX.IsEof())
{
- nStatus = FALSE;
+ nStatus = sal_False;
break;
}
nPercent = ny * 60 / nHeight + 10;
if ( ny == 0 || nLastPercent + 4 <= nPercent )
{
nLastPercent = nPercent;
- if ( Callback( (USHORT)nPercent ) == TRUE )
+ if ( Callback( (sal_uInt16)nPercent ) == sal_True )
break;
}
for ( np = 0; np < nPlanes; np++)
@@ -267,7 +267,7 @@ void PCXReader::ImplReadBody()
m_rPCX >> nDat;
if ( ( nDat & 0xc0 ) == 0xc0 )
{
- nCount =( (ULONG)nDat ) & 0x003f;
+ nCount =( (sal_uLong)nDat ) & 0x003f;
m_rPCX >> nDat;
if ( nCount < nx )
{
@@ -308,13 +308,13 @@ void PCXReader::ImplReadBody()
case 0x101 :
for ( i = 0; i < nWidth; i++ )
{
- ULONG nShift = ( i & 7 ) ^ 7;
+ sal_uLong nShift = ( i & 7 ) ^ 7;
if ( nShift == 0 )
pAcc->SetPixel( ny, i, ( *pSource1++ & 1 ) );
else
pAcc->SetPixel(
ny, i,
- sal::static_int_cast< BYTE >(
+ sal::static_int_cast< sal_uInt8 >(
( *pSource1 >> nShift ) & 1) );
}
break;
@@ -351,7 +351,7 @@ void PCXReader::ImplReadBody()
case 0x301 :
for ( i = 0; i < nWidth; i++ )
{
- ULONG nShift = ( i & 7 ) ^ 7;
+ sal_uLong nShift = ( i & 7 ) ^ 7;
if ( nShift == 0 )
{
nCol = ( *pSource1++ & 1) + ( ( *pSource2++ << 1 ) & 2 ) + ( ( *pSource3++ << 2 ) & 4 );
@@ -359,7 +359,7 @@ void PCXReader::ImplReadBody()
}
else
{
- nCol = sal::static_int_cast< BYTE >(
+ nCol = sal::static_int_cast< sal_uInt8 >(
( ( *pSource1 >> nShift ) & 1) + ( ( ( *pSource2 >> nShift ) << 1 ) & 2 ) +
( ( ( *pSource3 >> nShift ) << 2 ) & 4 ));
pAcc->SetPixel( ny, i, nCol );
@@ -370,7 +370,7 @@ void PCXReader::ImplReadBody()
case 0x401 :
for ( i = 0; i < nWidth; i++ )
{
- ULONG nShift = ( i & 7 ) ^ 7;
+ sal_uLong nShift = ( i & 7 ) ^ 7;
if ( nShift == 0 )
{
nCol = ( *pSource1++ & 1) + ( ( *pSource2++ << 1 ) & 2 ) + ( ( *pSource3++ << 2 ) & 4 ) +
@@ -379,7 +379,7 @@ void PCXReader::ImplReadBody()
}
else
{
- nCol = sal::static_int_cast< BYTE >(
+ nCol = sal::static_int_cast< sal_uInt8 >(
( ( *pSource1 >> nShift ) & 1) + ( ( ( *pSource2 >> nShift ) << 1 ) & 2 ) +
( ( ( *pSource3 >> nShift ) << 2 ) & 4 ) + ( ( ( *pSource4 >> nShift ) << 3 ) & 8 ));
pAcc->SetPixel( ny, i, nCol );
@@ -395,7 +395,7 @@ void PCXReader::ImplReadBody()
}
break;
default :
- nStatus = FALSE;
+ nStatus = sal_False;
break;
}
}
@@ -403,11 +403,11 @@ void PCXReader::ImplReadBody()
delete[] pPlane[ np ];
}
-void PCXReader::ImplReadPalette( ULONG nCol )
+void PCXReader::ImplReadPalette( sal_uLong nCol )
{
- BYTE r, g, b;
- BYTE* pPtr = pPalette;
- for ( ULONG i = 0; i < nCol; i++ )
+ sal_uInt8 r, g, b;
+ sal_uInt8* pPtr = pPalette;
+ for ( sal_uLong i = 0; i < nCol; i++ )
{
m_rPCX >> r >> g >> b;
*pPtr++ = r;
@@ -418,38 +418,13 @@ void PCXReader::ImplReadPalette( ULONG nCol )
//================== GraphicImport - die exportierte Funktion ================
-extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool )
{
PCXReader aPCXReader(rStream);
- BOOL nRetValue = aPCXReader.ReadPCX(rGraphic);
- if ( nRetValue == FALSE )
+ sal_Bool nRetValue = aPCXReader.ReadPCX(rGraphic);
+ if ( nRetValue == sal_False )
rStream.SetError( SVSTREAM_FILEFORMAT_ERROR );
return nRetValue;
}
-//================== ein bischen Muell fuer Windows ==========================
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index 39121a1483ba..b5c1e03444ea 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -37,12 +37,109 @@
#include <svtools/fltcall.hxx>
#include <math.h>
-// MT: NOOLDSV, someone should change the code...
-enum PenStyle { PEN_NULL, PEN_SOLID, PEN_DOT, PEN_DASH, PEN_DASHDOT };
-enum BrushStyle { BRUSH_NULL, BRUSH_SOLID, BRUSH_HORZ, BRUSH_VERT,
- BRUSH_CROSS, BRUSH_DIAGCROSS, BRUSH_UPDIAG, BRUSH_DOWNDIAG,
- BRUSH_25, BRUSH_50, BRUSH_75,
- BRUSH_BITMAP };
+#include "shape.hxx"
+
+namespace PictReaderInternal {
+ //! utilitary class to store a pattern, ...
+ class Pattern {
+ public:
+ //! constructor
+ Pattern() {
+ isColor = false; isRead = false;
+ penStyle=PEN_SOLID; brushStyle = BRUSH_SOLID;
+ nBitCount = 64;
+ }
+
+ //! reads black/white pattern from SvStream
+ sal_uLong read(SvStream &stream);
+ //! sets the color
+ void setColor(Color &col) { isColor = true; color = col; }
+ /** returns a color which can be "used" to replace the pattern,
+ * created from ForeColor and BackColor, ...
+ *
+ * note: maybe, we must also use some mode PatCopy, ... to define the color
+ */
+ Color getColor(Color bkColor=COL_WHITE, Color fgColor = COL_BLACK) const {
+ if (isColor) return color;
+ // we create a gray pattern from nBitCount
+ double alpha = nBitCount / 64.0;
+ return Color(sal_uInt8(alpha*fgColor.GetRed()+(1.0-alpha)*bkColor.GetRed()),
+ sal_uInt8(alpha*fgColor.GetGreen()+(1.0-alpha)*bkColor.GetGreen()),
+ sal_uInt8(alpha*fgColor.GetBlue()+(1.0-alpha)*bkColor.GetBlue()));
+ }
+
+ //! returns true if this is the default pattern
+ bool isDefault() const { return isRead == false; }
+
+ // MT: NOOLDSV, someone should change the code...
+ enum PenStyle { PEN_NULL, PEN_SOLID, PEN_DOT, PEN_DASH, PEN_DASHDOT };
+ enum BrushStyle { BRUSH_NULL, BRUSH_SOLID, BRUSH_HORZ, BRUSH_VERT,
+ BRUSH_CROSS, BRUSH_DIAGCROSS, BRUSH_UPDIAG, BRUSH_DOWNDIAG,
+ BRUSH_25, BRUSH_50, BRUSH_75,
+ BRUSH_BITMAP };
+ // Data
+ enum PenStyle penStyle;
+ enum BrushStyle brushStyle;
+ short nBitCount;
+
+ bool isColor; // true if it is a color pattern
+ Color color;
+
+ protected:
+ // flag to know if the pattern came from reading the picture, or if it is the default pattern
+ bool isRead;
+ };
+
+ sal_uLong Pattern::read(SvStream &stream) {
+ short nx,ny;
+ unsigned char nbyte[8];
+ sal_uLong nHiBytes, nLoBytes;
+ isColor = false;
+
+ // Anzahl der Bits im Pattern zaehlen, die auf 1 gesetzt sind:
+ nBitCount=0;
+ for (ny=0; ny<8; ny++) {
+ stream >> ((char&)nbyte[ny]);
+ for (nx=0; nx<8; nx++) {
+ if ( (nbyte[ny] & (1<<nx)) != 0 ) nBitCount++;
+ }
+ }
+
+ // Pattern in 2 Langworten unterbringen:
+ nHiBytes=(((((((sal_uLong)nbyte[0])<<8)|
+ (sal_uLong)nbyte[1])<<8)|
+ (sal_uLong)nbyte[2])<<8)|
+ (sal_uLong)nbyte[3];
+ nLoBytes=(((((((sal_uLong)nbyte[4])<<8)|
+ (sal_uLong)nbyte[5])<<8)|
+ (sal_uLong)nbyte[6])<<8)|
+ (sal_uLong)nbyte[7];
+
+ // Einen PenStyle machen:
+ if (nBitCount<=0) penStyle=PEN_NULL;
+ else if (nBitCount<=16) penStyle=PEN_DOT;
+ else if (nBitCount<=32) penStyle=PEN_DASHDOT;
+ else if (nBitCount<=48) penStyle=PEN_DASH;
+ else penStyle=PEN_SOLID;
+
+ // Einen BrushStyle machen:
+ if (nHiBytes==0xffffffff && nLoBytes==0xffffffff) brushStyle=BRUSH_SOLID;
+ else if (nHiBytes==0xff000000 && nLoBytes==0x00000000) brushStyle=BRUSH_HORZ;
+ else if (nHiBytes==0x80808080 && nLoBytes==0x80808080) brushStyle=BRUSH_VERT;
+ else if (nHiBytes==0xff808080 && nLoBytes==0x80808080) brushStyle=BRUSH_CROSS;
+ else if (nHiBytes==0x01824428 && nLoBytes==0x10284482) brushStyle=BRUSH_DIAGCROSS;
+ else if (nHiBytes==0x80402010 && nLoBytes==0x08040201) brushStyle=BRUSH_UPDIAG;
+ else if (nHiBytes==0x01020408 && nLoBytes==0x10204080) brushStyle=BRUSH_DOWNDIAG;
+ else if (nBitCount<=24) brushStyle=BRUSH_25;
+ else if (nBitCount<=40) brushStyle=BRUSH_50;
+ else if (nBitCount<=56) brushStyle=BRUSH_75;
+ else brushStyle=BRUSH_SOLID;
+
+ isRead = true;
+
+ return 8;
+ }
+}
//============================ PictReader ==================================
@@ -52,27 +149,27 @@ enum PictDrawingMethod {
};
class PictReader {
-
+ typedef class PictReaderInternal::Pattern Pattern;
private:
SvStream * pPict; // Die einzulesende Pict-Datei
VirtualDevice * pVirDev; // Hier werden die Drawing-Methoden aufgerufen.
// Dabei findet ein Recording in das GDIMetaFile
// statt.
- ULONG nOrigPos; // Anfaengliche Position in pPict
- UINT16 nOrigNumberFormat; // Anfaengliches Nummern-Format von pPict
- BOOL IsVersion2; // Ob es ein Version 2 Pictfile ist.
+ sal_uLong nOrigPos; // Anfaengliche Position in pPict
+ sal_uInt16 nOrigNumberFormat; // Anfaengliches Nummern-Format von pPict
+ sal_Bool IsVersion2; // Ob es ein Version 2 Pictfile ist.
Rectangle aBoundingRect; // Min/Max-Rechteck fuer die ganze Zeichnung
Point aPenPosition;
Point aTextPosition;
Color aActForeColor;
Color aActBackColor;
- PenStyle eActPenPenStyle;
- BrushStyle eActPenBrushStyle;
- BrushStyle eActFillStyle;
- BrushStyle eActBackStyle;
- USHORT nActPenSize;
+ Pattern eActPenPattern;
+ Pattern eActFillPattern;
+ Pattern eActBackPattern;
+ Size nActPenSize;
+ // Note: Postscript mode is stored by setting eActRop to ROP_1
RasterOp eActROP;
PictDrawingMethod eActMethod;
Size aActOvalSize;
@@ -81,7 +178,7 @@ private:
Fraction aHRes;
Fraction aVRes;
- BOOL Callback(USHORT nPercent);
+ sal_Bool Callback(sal_uInt16 nPercent);
Point ReadPoint();
@@ -99,47 +196,51 @@ private:
void ReadRectangle(Rectangle & rRect);
- ULONG ReadPolygon(Polygon & rPoly);
+ sal_uLong ReadPolygon(Polygon & rPoly);
- ULONG ReadPattern(PenStyle * pPenStyle, BrushStyle * pBrushStyle);
-
- ULONG ReadPixPattern(PenStyle * pPenStyle, BrushStyle * pBrushStyle);
+ sal_uLong ReadPixPattern(Pattern &pattern);
Rectangle aLastRect;
- ULONG ReadAndDrawRect(PictDrawingMethod eMethod);
- ULONG ReadAndDrawSameRect(PictDrawingMethod eMethod);
+ sal_uLong ReadAndDrawRect(PictDrawingMethod eMethod);
+ sal_uLong ReadAndDrawSameRect(PictDrawingMethod eMethod);
Rectangle aLastRoundRect;
- ULONG ReadAndDrawRoundRect(PictDrawingMethod eMethod);
- ULONG ReadAndDrawSameRoundRect(PictDrawingMethod eMethod);
+ sal_uLong ReadAndDrawRoundRect(PictDrawingMethod eMethod);
+ sal_uLong ReadAndDrawSameRoundRect(PictDrawingMethod eMethod);
Rectangle aLastOval;
- ULONG ReadAndDrawOval(PictDrawingMethod eMethod);
- ULONG ReadAndDrawSameOval(PictDrawingMethod eMethod);
+ sal_uLong ReadAndDrawOval(PictDrawingMethod eMethod);
+ sal_uLong ReadAndDrawSameOval(PictDrawingMethod eMethod);
Polygon aLastPolygon;
- ULONG ReadAndDrawPolygon(PictDrawingMethod eMethod);
- ULONG ReadAndDrawSamePolygon(PictDrawingMethod eMethod);
+ sal_uLong ReadAndDrawPolygon(PictDrawingMethod eMethod);
+ sal_uLong ReadAndDrawSamePolygon(PictDrawingMethod eMethod);
Rectangle aLastArcRect;
- ULONG ReadAndDrawArc(PictDrawingMethod eMethod);
- ULONG ReadAndDrawSameArc(PictDrawingMethod eMethod);
+ sal_uLong ReadAndDrawArc(PictDrawingMethod eMethod);
+ sal_uLong ReadAndDrawSameArc(PictDrawingMethod eMethod);
- ULONG ReadAndDrawRgn(PictDrawingMethod eMethod);
- ULONG ReadAndDrawSameRgn(PictDrawingMethod eMethod);
+ sal_uLong ReadAndDrawRgn(PictDrawingMethod eMethod);
+ sal_uLong ReadAndDrawSameRgn(PictDrawingMethod eMethod);
+ // returns true, if we do not need to print the shape/text/frame
+ bool IsInvisible(PictDrawingMethod eMethod) const {
+ if (eActROP == ROP_1) return true;
+ if (eMethod==PDM_FRAME && (nActPenSize.Width() == 0 || nActPenSize.Height() == 0)) return true;
+ return false;
+ }
void DrawingMethod(PictDrawingMethod eMethod);
- ULONG ReadAndDrawText();
+ sal_uLong ReadAndDrawText();
- ULONG ReadPixMapEtc(Bitmap & rBitmap, BOOL bBaseAddr, BOOL bColorTable,
+ sal_uLong ReadPixMapEtc(Bitmap & rBitmap, sal_Bool bBaseAddr, sal_Bool bColorTable,
Rectangle * pSrcRect, Rectangle * pDestRect,
- BOOL bMode, BOOL bMaskRgn);
+ sal_Bool bMode, sal_Bool bMaskRgn);
void ReadHeader();
// Liesst den Kopf der Pict-Datei, setzt IsVersion2 und aBoundingRect
- ULONG ReadData(USHORT nOpcode);
+ sal_uLong ReadData(sal_uInt16 nOpcode);
// Liesst die Daten eines Opcodes ein und fuehrt die Operation aus.
// Auf jeden Fall wird die Anzahl der Datenbytes zu dem Opcode
// zurueckgeliefert.
@@ -147,9 +248,11 @@ private:
void SetLineColor( const Color& rColor );
void SetFillColor( const Color& rColor );
+ // OSNOLA: returns the text encoding which must be used for system id
+ static rtl_TextEncoding GetTextEncoding (sal_uInt16 fId = 0xFFFF);
public:
- PictReader() {}
+ PictReader() { aActFont.SetCharSet(GetTextEncoding()); }
void ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile );
// Liesst aus dem Stream eine Pict-Datei und fuellt das GDIMetaFile
@@ -209,6 +312,42 @@ public:
}
//=================== Methoden von PictReader ==============================
+rtl_TextEncoding PictReader::GetTextEncoding (sal_uInt16 fId) {
+ static bool first = true;
+ static rtl_TextEncoding enc = RTL_TEXTENCODING_APPLE_ROMAN;
+ if (first) {
+ rtl_TextEncoding def = gsl_getSystemTextEncoding();
+ // we keep gsl_getSystemTextEncoding only if it is a mac encoding
+ switch(def) {
+ case RTL_TEXTENCODING_APPLE_ROMAN:
+ case RTL_TEXTENCODING_APPLE_ARABIC:
+ case RTL_TEXTENCODING_APPLE_CENTEURO:
+ case RTL_TEXTENCODING_APPLE_CROATIAN:
+ case RTL_TEXTENCODING_APPLE_CYRILLIC:
+ case RTL_TEXTENCODING_APPLE_DEVANAGARI:
+ case RTL_TEXTENCODING_APPLE_FARSI:
+ case RTL_TEXTENCODING_APPLE_GREEK:
+ case RTL_TEXTENCODING_APPLE_GUJARATI:
+ case RTL_TEXTENCODING_APPLE_GURMUKHI:
+ case RTL_TEXTENCODING_APPLE_HEBREW:
+ case RTL_TEXTENCODING_APPLE_ICELAND:
+ case RTL_TEXTENCODING_APPLE_ROMANIAN:
+ case RTL_TEXTENCODING_APPLE_THAI:
+ case RTL_TEXTENCODING_APPLE_TURKISH:
+ case RTL_TEXTENCODING_APPLE_UKRAINIAN:
+ case RTL_TEXTENCODING_APPLE_CHINSIMP:
+ case RTL_TEXTENCODING_APPLE_CHINTRAD:
+ case RTL_TEXTENCODING_APPLE_JAPANESE:
+ case RTL_TEXTENCODING_APPLE_KOREAN:
+ enc = def; break;
+ default: break;
+ }
+ first = false;
+ }
+ if (fId == 13) return RTL_TEXTENCODING_ADOBE_DINGBATS; // CHECKME
+ if (fId == 23) return RTL_TEXTENCODING_ADOBE_SYMBOL;
+ return enc;
+}
void PictReader::SetLineColor( const Color& rColor )
{
@@ -220,17 +359,17 @@ void PictReader::SetFillColor( const Color& rColor )
pVirDev->SetFillColor( rColor );
}
-BOOL PictReader::Callback(USHORT /*nPercent*/)
+sal_Bool PictReader::Callback(sal_uInt16 /*nPercent*/)
{
/*
if (pCallback!=NULL) {
- if (((*pCallback)(pCallerData,nPercent))==TRUE) {
+ if (((*pCallback)(pCallerData,nPercent))==sal_True) {
pPict->SetError(SVSTREAM_FILEFORMAT_ERROR);
- return TRUE;
+ return sal_True;
}
}
*/
- return FALSE;
+ return sal_False;
}
Point PictReader::ReadPoint()
@@ -312,10 +451,10 @@ Color PictReader::ReadColor()
Color PictReader::ReadRGBColor()
{
- USHORT nR, nG, nB;
+ sal_uInt16 nR, nG, nB;
*pPict >> nR >> nG >> nB;
- return Color( (BYTE) ( nR >> 8 ), (BYTE) ( nG >> 8 ), (BYTE) ( nB >> 8 ) );
+ return Color( (sal_uInt8) ( nR >> 8 ), (sal_uInt8) ( nG >> 8 ), (sal_uInt8) ( nB >> 8 ) );
}
@@ -325,100 +464,49 @@ void PictReader::ReadRectangle(Rectangle & rRect)
aTopLeft=ReadPoint();
aBottomRight=ReadPoint();
- aBottomRight.X() -= 1;
- aBottomRight.Y() -= 1;
rRect=Rectangle(aTopLeft,aBottomRight);
}
-ULONG PictReader::ReadPolygon(Polygon & rPoly)
+sal_uLong PictReader::ReadPolygon(Polygon & rPoly)
{
- USHORT nSize,i;
- ULONG nDataSize;
+ sal_uInt16 nSize,i;
+ sal_uLong nDataSize;
*pPict >> nSize;
pPict->SeekRel(8);
- nDataSize=(ULONG)nSize;
+ nDataSize=(sal_uLong)nSize;
nSize=(nSize-10)/4;
rPoly.SetSize(nSize);
for (i=0; i<nSize; i++) rPoly.SetPoint(ReadPoint(),i);
return nDataSize;
}
-ULONG PictReader::ReadPattern(PenStyle * pPenStyle, BrushStyle * pBrushStyle)
-{
- short nx,ny,nBitCount;
- unsigned char nbyte[8];
- BrushStyle eBrStyle;
- PenStyle ePnStyle;
- ULONG nHiBytes, nLoBytes;
-
- // Anzahl der Bits im Pattern zaehlen, die auf 1 gesetzt sind:
- nBitCount=0;
- for (ny=0; ny<8; ny++) {
- *pPict >> ((char&)nbyte[ny]);
- for (nx=0; nx<8; nx++) {
- if ( (nbyte[ny] & (1<<nx)) != 0 ) nBitCount++;
- }
- }
-
- // Pattern in 2 Langworten unterbringen:
- nHiBytes=(((((((ULONG)nbyte[0])<<8)|
- (ULONG)nbyte[1])<<8)|
- (ULONG)nbyte[2])<<8)|
- (ULONG)nbyte[3];
- nLoBytes=(((((((ULONG)nbyte[4])<<8)|
- (ULONG)nbyte[5])<<8)|
- (ULONG)nbyte[6])<<8)|
- (ULONG)nbyte[7];
-
- // Einen PenStyle machen:
- if (nBitCount<=0) ePnStyle=PEN_NULL;
- else if (nBitCount<=16) ePnStyle=PEN_DOT;
- else if (nBitCount<=32) ePnStyle=PEN_DASHDOT;
- else if (nBitCount<=48) ePnStyle=PEN_DASH;
- else ePnStyle=PEN_SOLID;
-
- // Einen BrushStyle machen:
- if (nHiBytes==0xffffffff && nLoBytes==0xffffffff) eBrStyle=BRUSH_SOLID;
- else if (nHiBytes==0xff000000 && nLoBytes==0x00000000) eBrStyle=BRUSH_HORZ;
- else if (nHiBytes==0x80808080 && nLoBytes==0x80808080) eBrStyle=BRUSH_VERT;
- else if (nHiBytes==0xff808080 && nLoBytes==0x80808080) eBrStyle=BRUSH_CROSS;
- else if (nHiBytes==0x01824428 && nLoBytes==0x10284482) eBrStyle=BRUSH_DIAGCROSS;
- else if (nHiBytes==0x80402010 && nLoBytes==0x08040201) eBrStyle=BRUSH_UPDIAG;
- else if (nHiBytes==0x01020408 && nLoBytes==0x10204080) eBrStyle=BRUSH_DOWNDIAG;
- else if (nBitCount<=24) eBrStyle=BRUSH_25;
- else if (nBitCount<=40) eBrStyle=BRUSH_50;
- else if (nBitCount<=56) eBrStyle=BRUSH_75;
- else eBrStyle=BRUSH_SOLID;
-
- if (pPenStyle!=0) *pPenStyle=ePnStyle;
-
- if (pBrushStyle!=0) *pBrushStyle=eBrStyle;
-
- return 8;
-}
-
-ULONG PictReader::ReadPixPattern(PenStyle * pPenStyle, BrushStyle * pBrushStyle)
+sal_uLong PictReader::ReadPixPattern(PictReader::Pattern &pattern)
{
// Keine Ahnung, ob dies richtig ist, weil kein Bild gefunden, das
// PixPatterns enthaelt. Auch hier nur der Versuch, die Groesse der Daten zu
// ermitteln, und einfache StarView-Styles daraus zu machen. Gluecklicherweise
// enthaelt ein PixPattern immer auch ein normales Pattern.
- ULONG nDataSize;
- USHORT nPatType;
+ sal_uLong nDataSize;
+ sal_uInt16 nPatType;
Bitmap aBMP;
*pPict >> nPatType;
if (nPatType==1) {
- ReadPattern(pPenStyle,pBrushStyle);
- nDataSize=ReadPixMapEtc(aBMP,FALSE,TRUE,NULL,NULL,FALSE,FALSE);
+ pattern.read(*pPict);
+ nDataSize=ReadPixMapEtc(aBMP,sal_False,sal_True,NULL,NULL,sal_False,sal_False);
+ // CHANGEME: use average pixmap colors to update the pattern, ...
if (nDataSize!=0xffffffff) nDataSize+=10;
}
else if (nPatType==2) {
- ReadPattern(pPenStyle,pBrushStyle);
- pPict->SeekRel(6); // RGBColor
+ pattern.read(*pPict);
+ // RGBColor
+ sal_uInt16 nR, nG, nB;
+ *pPict >> nR >> nG >> nB;
+ Color col((sal_uInt8) ( nR >> 8 ), (sal_uInt8) ( nG >> 8 ), (sal_uInt8) ( nB >> 8 ) );
+ pattern.setColor(col);
nDataSize=16;
}
else nDataSize=0xffffffff;
@@ -426,136 +514,122 @@ ULONG PictReader::ReadPixPattern(PenStyle * pPenStyle, BrushStyle * pBrushStyle)
return nDataSize;
}
-ULONG PictReader::ReadAndDrawRect(PictDrawingMethod eMethod)
+sal_uLong PictReader::ReadAndDrawRect(PictDrawingMethod eMethod)
{
ReadRectangle(aLastRect);
- DrawingMethod(eMethod);
- pVirDev->DrawRect(aLastRect);
+ ReadAndDrawSameRect(eMethod);
return 8;
}
-ULONG PictReader::ReadAndDrawSameRect(PictDrawingMethod eMethod)
+sal_uLong PictReader::ReadAndDrawSameRect(PictDrawingMethod eMethod)
{
+ if (IsInvisible(eMethod)) return 0;
DrawingMethod(eMethod);
- pVirDev->DrawRect(aLastRect);
+ PictReaderShape::drawRectangle(pVirDev, eMethod==PDM_FRAME, aLastRect, nActPenSize);
return 0;
}
-ULONG PictReader::ReadAndDrawRoundRect(PictDrawingMethod eMethod)
+sal_uLong PictReader::ReadAndDrawRoundRect(PictDrawingMethod eMethod)
{
ReadRectangle(aLastRoundRect);
- DrawingMethod(eMethod);
- pVirDev->DrawRect(aLastRoundRect,aActOvalSize.Width(),aActOvalSize.Height());
+ ReadAndDrawSameRoundRect(eMethod);
return 8;
}
-ULONG PictReader::ReadAndDrawSameRoundRect(PictDrawingMethod eMethod)
+sal_uLong PictReader::ReadAndDrawSameRoundRect(PictDrawingMethod eMethod)
{
+ if (IsInvisible(eMethod)) return 0;
DrawingMethod(eMethod);
- pVirDev->DrawRect(aLastRoundRect,aActOvalSize.Width(),aActOvalSize.Height());
+ PictReaderShape::drawRoundRectangle(pVirDev, eMethod==PDM_FRAME, aLastRoundRect, aActOvalSize, nActPenSize);
return 0;
}
-ULONG PictReader::ReadAndDrawOval(PictDrawingMethod eMethod)
+sal_uLong PictReader::ReadAndDrawOval(PictDrawingMethod eMethod)
{
ReadRectangle(aLastOval);
- DrawingMethod(eMethod);
- pVirDev->DrawEllipse(aLastOval);
+ ReadAndDrawSameOval(eMethod);
return 8;
}
-ULONG PictReader::ReadAndDrawSameOval(PictDrawingMethod eMethod)
+sal_uLong PictReader::ReadAndDrawSameOval(PictDrawingMethod eMethod)
{
+ if (IsInvisible(eMethod)) return 0;
DrawingMethod(eMethod);
- pVirDev->DrawEllipse(aLastOval);
+ PictReaderShape::drawEllipse(pVirDev, eMethod==PDM_FRAME, aLastOval, nActPenSize);
return 0;
}
-ULONG PictReader::ReadAndDrawPolygon(PictDrawingMethod eMethod)
+sal_uLong PictReader::ReadAndDrawPolygon(PictDrawingMethod eMethod)
{
- ULONG nDataSize;
-
+ sal_uLong nDataSize;
nDataSize=ReadPolygon(aLastPolygon);
- DrawingMethod(eMethod);
- if (eMethod==PDM_FRAME) pVirDev->DrawPolyLine(aLastPolygon);
- else pVirDev->DrawPolygon(aLastPolygon);
+ ReadAndDrawSamePolygon(eMethod);
return nDataSize;
}
-ULONG PictReader::ReadAndDrawSamePolygon(PictDrawingMethod eMethod)
+sal_uLong PictReader::ReadAndDrawSamePolygon(PictDrawingMethod eMethod)
{
+ if (IsInvisible(eMethod)) return 0;
DrawingMethod(eMethod);
- if (eMethod==PDM_FRAME) pVirDev->DrawPolyLine(aLastPolygon);
- else pVirDev->DrawPolygon(aLastPolygon);
+ PictReaderShape::drawPolygon(pVirDev, eMethod==PDM_FRAME, aLastPolygon, nActPenSize);
return 0;
}
-ULONG PictReader::ReadAndDrawArc(PictDrawingMethod eMethod)
+sal_uLong PictReader::ReadAndDrawArc(PictDrawingMethod eMethod)
{
- short nstartAngle, narcAngle;
- double fAng1, fAng2;
- Point aStartPt, aEndPt, aCenter;
-
ReadRectangle(aLastArcRect);
- *pPict >> nstartAngle >> narcAngle;
- if (narcAngle<0) {
- nstartAngle = nstartAngle + narcAngle;
- narcAngle=-narcAngle;
- }
- fAng1=((double)nstartAngle)/180.0*3.14159265359;
- fAng2=((double)(nstartAngle+narcAngle))/180.0*3.14159265359;
- aCenter=Point((aLastArcRect.Left()+aLastArcRect.Right())/2,
- (aLastArcRect.Top()+aLastArcRect.Bottom())/2);
- aStartPt=Point(aCenter.X()+(long)( sin(fAng2)*256.0),
- aCenter.Y()+(long)(-cos(fAng2)*256.0));
- aEndPt= Point(aCenter.X()+(long)( sin(fAng1)*256.0),
- aCenter.Y()+(long)(-cos(fAng1)*256.0));
- DrawingMethod(eMethod);
- if (eMethod==PDM_FRAME) pVirDev->DrawArc(aLastArcRect,aStartPt,aEndPt);
- else pVirDev->DrawPie(aLastArcRect,aStartPt,aEndPt);
+ ReadAndDrawSameArc(eMethod);
return 12;
}
-ULONG PictReader::ReadAndDrawSameArc(PictDrawingMethod eMethod)
+sal_uLong PictReader::ReadAndDrawSameArc(PictDrawingMethod eMethod)
{
short nstartAngle, narcAngle;
double fAng1, fAng2;
- Point aStartPt, aEndPt, aCenter;
*pPict >> nstartAngle >> narcAngle;
+ if (IsInvisible(eMethod)) return 4;
+ DrawingMethod(eMethod);
+
if (narcAngle<0) {
nstartAngle = nstartAngle + narcAngle;
narcAngle=-narcAngle;
}
fAng1=((double)nstartAngle)/180.0*3.14159265359;
fAng2=((double)(nstartAngle+narcAngle))/180.0*3.14159265359;
- aCenter=Point((aLastArcRect.Left()+aLastArcRect.Right())/2,
- (aLastArcRect.Top()+aLastArcRect.Bottom())/2);
- aStartPt=Point(aCenter.X()+(long)( sin(fAng2)*256.0),
- aCenter.Y()+(long)(-cos(fAng2)*256.0));
- aEndPt= Point(aCenter.X()+(long)( sin(fAng1)*256.0),
- aCenter.Y()+(long)(-cos(fAng1)*256.0));
- DrawingMethod(eMethod);
- if (eMethod==PDM_FRAME) pVirDev->DrawArc(aLastArcRect,aStartPt,aEndPt);
- else pVirDev->DrawPie(aLastArcRect,aStartPt,aEndPt);
+ PictReaderShape::drawArc(pVirDev, eMethod==PDM_FRAME, aLastArcRect,fAng1,fAng2, nActPenSize);
return 4;
}
-ULONG PictReader::ReadAndDrawRgn(PictDrawingMethod eMethod)
+sal_uLong PictReader::ReadAndDrawRgn(PictDrawingMethod eMethod)
{
- USHORT nSize;
+ sal_uInt16 nSize;
- DrawingMethod(eMethod);
*pPict >> nSize;
- // ...???...
- return (ULONG)nSize;
+ // read the DATA
+ //
+ // a region data is a mask and is probably coded as
+ // - the first 8 bytes: bdbox ( which can be read by ReadRectangle )
+ // - then a list of line modifiers: y_i, a_0, b_0, a_1, b_1, ..., a_{n_i}, b_{n_i}, 0x7fff
+ // - 0x7fff
+ // where y_i is the increasing sequences of line coordinates
+ // and on each line: a0 < b0 < a1 < b1 < ... < a_{n_i} < b_{n_i}
+
+ // it can be probably decoded as :
+ // M=an empty mask: ie. (0, 0, ... ) with (left_box-right_box+1) zeroes
+ // then for each line (y_i):
+ // - takes M and inverts all values in [a_0,b_0-1], in [a_1,b_1-1] ...
+ // - sets M = new y_i line mask
+ ReadAndDrawSameRgn(eMethod);
+ return (sal_uLong)nSize;
}
-ULONG PictReader::ReadAndDrawSameRgn(PictDrawingMethod eMethod)
+sal_uLong PictReader::ReadAndDrawSameRgn(PictDrawingMethod eMethod)
{
- DrawingMethod(eMethod);
- // ...???...
+ if (IsInvisible(eMethod)) return 0;
+ DrawingMethod(eMethod);
+ // DISPLAY: ...???...
return 0;
}
@@ -564,34 +638,46 @@ void PictReader::DrawingMethod(PictDrawingMethod eMethod)
if( eActMethod==eMethod ) return;
switch (eMethod) {
case PDM_FRAME:
- SetLineColor( aActForeColor );
+ if (eActPenPattern.isDefault())
+ SetLineColor( aActForeColor );
+ else
+ SetLineColor(eActPenPattern.getColor(aActBackColor, aActForeColor));
SetFillColor( Color(COL_TRANSPARENT) );
pVirDev->SetRasterOp(eActROP);
break;
case PDM_PAINT:
SetLineColor( Color(COL_TRANSPARENT) );
- SetFillColor( aActForeColor );
+ if (eActPenPattern.isDefault())
+ SetFillColor( aActForeColor );
+ else
+ SetFillColor(eActPenPattern.getColor(aActBackColor, aActForeColor));
pVirDev->SetRasterOp(eActROP);
break;
case PDM_ERASE:
SetLineColor( Color(COL_TRANSPARENT) );
- SetFillColor( aActForeColor );
+ if (eActBackPattern.isDefault())
+ SetFillColor( aActBackColor );// Osnola: previously aActForeColor
+ else // checkMe
+ SetFillColor(eActBackPattern.getColor(COL_BLACK, aActBackColor));
pVirDev->SetRasterOp(ROP_OVERPAINT);
break;
- case PDM_INVERT:
+ case PDM_INVERT: // checkme
SetLineColor( Color(COL_TRANSPARENT));
SetFillColor( Color( COL_BLACK ) );
pVirDev->SetRasterOp(ROP_INVERT);
break;
case PDM_FILL:
SetLineColor( Color(COL_TRANSPARENT) );
- SetFillColor( aActForeColor );
+ if (eActFillPattern.isDefault())
+ SetFillColor( aActForeColor );
+ else
+ SetFillColor(eActFillPattern.getColor(aActBackColor, aActForeColor));
pVirDev->SetRasterOp(ROP_OVERPAINT);
break;
case PDM_TEXT:
aActFont.SetColor(aActForeColor);
aActFont.SetFillColor(aActBackColor);
- aActFont.SetTransparent(TRUE);
+ aActFont.SetTransparent(sal_True);
pVirDev->SetFont(aActFont);
pVirDev->SetRasterOp(ROP_OVERPAINT);
break;
@@ -601,38 +687,40 @@ void PictReader::DrawingMethod(PictDrawingMethod eMethod)
eActMethod=eMethod;
}
-ULONG PictReader::ReadAndDrawText()
+sal_uLong PictReader::ReadAndDrawText()
{
char nByteLen;
sal_uInt32 nLen, nDataLen;
sal_Char sText[256];
- DrawingMethod(PDM_TEXT);
- *pPict >> nByteLen; nLen=((ULONG)nByteLen)&0x000000ff;
+ *pPict >> nByteLen; nLen=((sal_uLong)nByteLen)&0x000000ff;
nDataLen = nLen + 1;
pPict->Read( &sText, nLen );
+ if (IsInvisible(PDM_TEXT)) return nDataLen;
+ DrawingMethod(PDM_TEXT);
+
// Stoerende Steuerzeuichen wegnehmen:
while ( nLen > 0 && ( (unsigned char)sText[ nLen - 1 ] ) < 32 )
nLen--;
sText[ nLen ] = 0;
- String aString( (const sal_Char*)&sText, gsl_getSystemTextEncoding() );
+ String aString( (const sal_Char*)&sText, aActFont.GetCharSet());
pVirDev->DrawText( Point( aTextPosition.X(), aTextPosition.Y() ), aString );
return nDataLen;
}
-ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTable, Rectangle* pSrcRect,
- Rectangle* pDestRect, BOOL bMode, BOOL bMaskRgn )
+sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bool bColorTable, Rectangle* pSrcRect,
+ Rectangle* pDestRect, sal_Bool bMode, sal_Bool bMaskRgn )
{
Bitmap aBitmap;
BitmapWriteAccess* pAcc = NULL;
BitmapReadAccess* pReadAcc = NULL;
- USHORT ny, nx, nColTabSize;
- USHORT nRowBytes, nBndX, nBndY, nWidth, nHeight, nVersion, nPackType, nPixelType,
+ sal_uInt16 ny, nx, nColTabSize;
+ sal_uInt16 nRowBytes, nBndX, nBndY, nWidth, nHeight, nVersion, nPackType, nPixelType,
nPixelSize, nCmpCount, nCmpSize;
sal_uInt32 nPackSize, nPlaneBytes, nHRes, nVRes;
- BYTE nDat, nRed, nGreen, nBlue, nDummy;
- ULONG i, nDataSize = 0;
+ sal_uInt8 nDat, nRed, nGreen, nBlue, nDummy;
+ sal_uLong i, nDataSize = 0;
// In nDataSize wird mitgerechnet, wie gross die gesammten Daten sind.
nDataSize = 0;
@@ -682,7 +770,7 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
{
pPict->SeekRel(2);
*pPict >> nRed >> nDummy >> nGreen >> nDummy >> nBlue >> nDummy;
- pAcc->SetPaletteColor( (USHORT) i, BitmapColor( nRed, nGreen, nBlue ) );
+ pAcc->SetPaletteColor( (sal_uInt16) i, BitmapColor( nRed, nGreen, nBlue ) );
}
nDataSize += 8 + nColTabSize * 8;
}
@@ -707,9 +795,9 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
// ggf. Quell-Rechteck einlesen:
if ( pSrcRect != 0)
{
- USHORT nTop, nLeft, nBottom, nRight;
+ sal_uInt16 nTop, nLeft, nBottom, nRight;
*pPict >> nTop >> nLeft >> nBottom >> nRight;
- *pSrcRect = Rectangle( (ULONG)nLeft, (ULONG)nTop, (ULONG)nRight, (ULONG)nBottom );
+ *pSrcRect = Rectangle( (sal_uLong)nLeft, (sal_uLong)nTop, (sal_uLong)nRight, (sal_uLong)nBottom );
nDataSize += 8;
}
@@ -733,19 +821,19 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
// ggf. Region einlesen (bzw. ueberspringen):
if ( bMaskRgn )
{
- USHORT nSize;
+ sal_uInt16 nSize;
*pPict >> nSize;
pPict->SeekRel( nSize - 2 );
- nDataSize += (ULONG)nSize;
+ nDataSize += (sal_uLong)nSize;
}
-// aSMem << (nHRes/1665L) << (nVRes/1665L) << ((ULONG)0) << ((ULONG)0);
+// aSMem << (nHRes/1665L) << (nVRes/1665L) << ((sal_uLong)0) << ((sal_uLong)0);
// Lese und Schreibe Bitmap-Bits:
if ( nPixelSize == 1 || nPixelSize == 2 || nPixelSize == 4 || nPixelSize == 8 )
{
- BYTE nByteCountAsByte, nFlagCounterByte;
- USHORT nByteCount, nCount, nSrcBPL, nDestBPL;
+ sal_uInt8 nByteCountAsByte, nFlagCounterByte;
+ sal_uInt16 nByteCount, nCount, nSrcBPL, nDestBPL;
if ( nPixelSize == 1 ) nSrcBPL = ( nWidth + 7 ) >> 3;
else if ( nPixelSize == 2 ) nSrcBPL = ( nWidth + 3 ) >> 2;
@@ -773,13 +861,13 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
if ( nRowBytes > 250 )
{
*pPict >> nByteCount;
- nDataSize += 2 + (ULONG)nByteCount;
+ nDataSize += 2 + (sal_uLong)nByteCount;
}
else
{
*pPict >> nByteCountAsByte;
- nByteCount = ( (USHORT)nByteCountAsByte ) & 0x00ff;
- nDataSize += 1 + (ULONG)nByteCount;
+ nByteCount = ( (sal_uInt16)nByteCountAsByte ) & 0x00ff;
+ nDataSize += 1 + (sal_uLong)nByteCount;
}
while ( nByteCount )
@@ -787,7 +875,7 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
*pPict >> nFlagCounterByte;
if ( ( nFlagCounterByte & 0x80 ) == 0 )
{
- nCount = ( (USHORT)nFlagCounterByte ) + 1;
+ nCount = ( (sal_uInt16)nFlagCounterByte ) + 1;
for ( i = 0; i < nCount; i++ )
{
*pPict >> nDat;
@@ -798,7 +886,7 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
}
else
{
- nCount = ( 1 - ( ( (USHORT)nFlagCounterByte ) | 0xff00 ) );
+ nCount = ( 1 - ( ( (sal_uInt16)nFlagCounterByte ) | 0xff00 ) );
*pPict >> nDat;
for ( i = 0; i < nCount; i++ )
{
@@ -813,9 +901,9 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
}
else if ( nPixelSize == 16 )
{
- BYTE nByteCountAsByte, nFlagCounterByte;
- USHORT nByteCount, nCount, nD;
- ULONG nSrcBitsPos;
+ sal_uInt8 nByteCountAsByte, nFlagCounterByte;
+ sal_uInt16 nByteCount, nCount, nD;
+ sal_uLong nSrcBitsPos;
if ( nRowBytes < 2 * nWidth )
BITMAPERROR;
@@ -828,12 +916,12 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
for ( i = 0; i < nWidth; i++ )
{
*pPict >> nD;
- nRed = (BYTE)( nD >> 7 );
- nGreen = (BYTE)( nD >> 2 );
- nBlue = (BYTE)( nD << 3 );
+ nRed = (sal_uInt8)( nD >> 7 );
+ nGreen = (sal_uInt8)( nD >> 2 );
+ nBlue = (sal_uInt8)( nD << 3 );
pAcc->SetPixel( ny, nx++, BitmapColor( nRed, nGreen, nBlue ) );
}
- nDataSize += ( (ULONG)nWidth ) * 2;
+ nDataSize += ( (sal_uLong)nWidth ) * 2;
}
else
{
@@ -846,7 +934,7 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
else
{
*pPict >> nByteCountAsByte;
- nByteCount = ( (USHORT)nByteCountAsByte ) & 0x00ff;
+ nByteCount = ( (sal_uInt16)nByteCountAsByte ) & 0x00ff;
nByteCount++;
}
while ( nx != nWidth )
@@ -854,43 +942,43 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
*pPict >> nFlagCounterByte;
if ( (nFlagCounterByte & 0x80) == 0)
{
- nCount=((USHORT)nFlagCounterByte)+1;
+ nCount=((sal_uInt16)nFlagCounterByte)+1;
if ( nCount + nx > nWidth) // SJ: the RLE decoding seems not to be correct here,
nCount = nWidth - nx; // I don't want to change this until I have a bugdoc for
for (i=0; i<nCount; i++) // this case. Have a look at 32bit, there I changed the
{ // encoding, so that it is used a straight forward array
*pPict >> nD;
- nRed = (BYTE)( nD >> 7 );
- nGreen = (BYTE)( nD >> 2 );
- nBlue = (BYTE)( nD << 3 );
+ nRed = (sal_uInt8)( nD >> 7 );
+ nGreen = (sal_uInt8)( nD >> 2 );
+ nBlue = (sal_uInt8)( nD << 3 );
pAcc->SetPixel( ny, nx++, BitmapColor( nRed, nGreen, nBlue ) );
}
}
else
{
- nCount=(1-(((USHORT)nFlagCounterByte)|0xff00));
+ nCount=(1-(((sal_uInt16)nFlagCounterByte)|0xff00));
if ( nCount + nx > nWidth )
nCount = nWidth - nx;
*pPict >> nD;
- nRed = (BYTE)( nD >> 7 );
- nGreen = (BYTE)( nD >> 2 );
- nBlue = (BYTE)( nD << 3 );
+ nRed = (sal_uInt8)( nD >> 7 );
+ nGreen = (sal_uInt8)( nD >> 2 );
+ nBlue = (sal_uInt8)( nD << 3 );
for (i=0; i<nCount; i++)
{
pAcc->SetPixel( ny, nx++, BitmapColor( nRed, nGreen, nBlue ) );
}
}
}
- nDataSize+=(ULONG)nByteCount;
- pPict->Seek(nSrcBitsPos+(ULONG)nByteCount);
+ nDataSize+=(sal_uLong)nByteCount;
+ pPict->Seek(nSrcBitsPos+(sal_uLong)nByteCount);
}
}
}
else if (nPixelSize==32)
{
- BYTE nByteCountAsByte, nFlagCounterByte;
- USHORT nByteCount, nCount;
- ULONG nSrcBitsPos;
+ sal_uInt8 nByteCountAsByte, nFlagCounterByte;
+ sal_uInt16 nByteCount, nCount;
+ sal_uLong nSrcBitsPos;
BitmapColor aBitmapColor;
if ( ( pReadAcc = aBitmap.AcquireReadAccess() ) == NULL )
BITMAPERROR;
@@ -908,7 +996,7 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
*pPict >> nDummy >> nRed >> nGreen >> nBlue;
pAcc->SetPixel( ny, nx, BitmapColor( nRed, nGreen, nBlue) );
}
- nDataSize += ( (ULONG)nWidth ) * 4;
+ nDataSize += ( (sal_uLong)nWidth ) * 4;
}
}
}
@@ -921,7 +1009,7 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
*pPict >> nRed >> nGreen >> nBlue;
pAcc->SetPixel( ny, nx, BitmapColor( nRed, nGreen, nBlue ) );
}
- nDataSize += ( (ULONG)nWidth ) * 3;
+ nDataSize += ( (sal_uLong)nWidth ) * 3;
}
}
else
@@ -940,7 +1028,7 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
else
{
*pPict >> nByteCountAsByte;
- nByteCount = (BYTE)nByteCountAsByte;
+ nByteCount = (sal_uInt8)nByteCountAsByte;
nByteCount++;
}
i = 0;
@@ -949,7 +1037,7 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
*pPict >> nFlagCounterByte;
if ( ( nFlagCounterByte & 0x80 ) == 0)
{
- nCount = ( (USHORT)nFlagCounterByte ) + 1;
+ nCount = ( (sal_uInt16)nFlagCounterByte ) + 1;
if ( ( i + nCount ) > (sal_uInt32)( nWidth * nCmpCount ) )
nCount = (sal_uInt16)( nWidth * nCmpCount - i );
while( nCount-- )
@@ -960,7 +1048,7 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
}
else
{
- nCount = ( 1 - ( ( (USHORT)nFlagCounterByte ) | 0xff00 ) );
+ nCount = ( 1 - ( ( (sal_uInt16)nFlagCounterByte ) | 0xff00 ) );
if ( ( i + nCount ) > (sal_uInt32)( nWidth * nCmpCount ) )
nCount = (sal_uInt16)( nWidth * nCmpCount - i );
*pPict >> nDat;
@@ -973,8 +1061,8 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
pTmp += nWidth;
for ( nx = 0; nx < nWidth; pTmp++ )
pAcc->SetPixel( ny, nx++, BitmapColor( *pTmp, pTmp[ nWidth ], pTmp[ 2 * nWidth ] ) );
- nDataSize += (ULONG)nByteCount;
- pPict->Seek( nSrcBitsPos + (ULONG)nByteCount );
+ nDataSize += (sal_uLong)nByteCount;
+ pPict->Seek( nSrcBitsPos + (sal_uLong)nByteCount );
}
delete[] pScanline;
}
@@ -991,114 +1079,148 @@ ULONG PictReader::ReadPixMapEtc( Bitmap &rBitmap, BOOL bBaseAddr, BOOL bColorTab
void PictReader::ReadHeader()
{
- char nC;
short y1,x1,y2,x2;
- sal_Char sBuf[ 3 ];
- pPict->SeekRel( 10 );
- pPict->Read( sBuf, 3 );
- if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && ( sBuf[ 2 ] == 0x01 || sBuf[ 2 ] == 0x02 ) )
- pPict->SeekRel( -13 ); // this maybe a pict from a ms document
- else
- pPict->SeekRel( 512 - 13 ); // 512 Bytes Muell am Anfang
-
- pPict->SeekRel(2); // Lo-16-bits von "picture size"
- *pPict >> y1 >> x1 >> y2 >> x2; // Rahmen-Rechteck des Bildes
- aBoundingRect=Rectangle( x1,y1, --x2, --y2 );
-
- // Jetzt kommen x-beliebig viele Nullen
- // (in manchen Dateien tatsaechlich mehr als eine):
- do { *pPict >> nC; } while (nC==0 && pPict->IsEof()==FALSE);
-
- // dann sollte der Versions-Opcode 0x11 folgen, dann die Versionsnummer:
- if (nC==0x11)
- {
- *pPict >> nC;
- if ( nC == 0x01 )
- IsVersion2 = FALSE; // Version 1
- else // Version 2 oder hoeher
- {
- short nExtVer;
- // 3 Bytes ueberspringen, um auf
- // ExtVersion2 oder Version2 zu kommen
- pPict->SeekRel( 3 );
- *pPict >> nExtVer;
-
- // nachsehen, ob wir einen Extended-Version2-Header (==-2) haben
- // oder einen einfachen Version2-Header (==-1);
- // dementsprechend Aufloesung einlesen oder nicht
- if ( nExtVer == -2 )
- {
- sal_Int16 nReserved;
- sal_Int32 nHResFixed, nVResFixed;
- *pPict >> nReserved >> nHResFixed >> nVResFixed;
- double fHRes = nHResFixed;
- fHRes /= 65536;
- double fVRes = nVResFixed;
- fVRes /= 65536;
- aHRes /= fHRes;
- aVRes /= fVRes;
- *pPict >> y1 >> x1 >> y2 >> x2; // reading the optimal bounding rect
- aBoundingRect=Rectangle( x1,y1, --x2, --y2 );
- pPict->SeekRel( -22 );
- }
- else
- {
- pPict->SeekRel( -4 );
- }
- IsVersion2=TRUE;
+ sal_Char sBuf[ 2 ];
+ // previous code considers pPict->Tell() as the normal starting position,
+ // can we have nStartPos != 0 ?
+ sal_uLong nStartPos = pPict->Tell();
+ // Standard:
+ // a picture file begins by 512 bytes (reserved to the application) followed by the picture data
+ // while clipboard, pictures stored in a document often contain only the picture data.
+
+ // Special cases:
+ // - some Pict v.1 use 0x00 0x11 0x01 ( instead of 0x11 0x01) to store the version op
+ // (we consider here this as another standard for Pict. v.1 )
+ // - some files seem to contain extra garbage data at the beginning
+ // - some picture data seem to contain extra NOP opcode(0x00) between the bounding box and the version opcode
+
+ // This code looks hard to find a picture header, ie. it looks at positions
+ // - nStartPos+0, nStartPos+512 with potential extra NOP codes between bdbox and version (at most 9 extra NOP)
+ // - 512..1024 with more strict bdbox checking and no extra NOP codes
+
+ // Notes:
+ // - if the header can begin at nStartPos+0 and at nStartPos+512, we try to choose the more
+ // <<probable>> ( using the variable confidence)
+ // - svtools/source/filter.vcl/filter/{filter.cxx,filter2.cxx} only check for standard Pict,
+ // this may cause future problems
+ int st;
+ sal_uInt32 nOffset;
+ int confidence[2] = { 0, 0};
+ for ( st = 0; st < 3 + 513; st++ )
+ {
+ int actualConfid = 20; // the actual confidence
+ pPict->ResetError();
+ if (st < 2) nOffset = nStartPos+st*512;
+ else if (st == 2) {
+ // choose nStartPos+0 or nStartPos+512 even if there are a little dubious
+ int actPos = -1, actConf=0;
+ if (confidence[0] > 0) { actPos = 0; actConf = confidence[0]; }
+ if (confidence[1] > 0 && confidence[1] >= actConf) actPos = 1;
+ if (actPos < 0) continue;
+ nOffset = nStartPos+actPos*512;
}
- }
- else {
- // Eigentlich ist dies wohl kein Pict-File, aber es gibt tatsaechlich
- // Dateien, bei denen mehr als 512 Bytes "Muell" am Anfang stehen.
- // Somit koennte es theoretisch folgende Art von Header geben:
- // <beliebig viele Bytes Muell> <Picture-Size (Lo-Bytes)> <BoundingRect>
- // <beliebig viele Nullen> <0x11> ..
- // Da aber in so einem Fall die Position von <BoundingRect> kaum auszumachen ist,
- // gehen wir nun davon aus, dass in einer Datei immer entweder genau 512 Bytes Muell
- // am Anfang sind (wie oben versucht), oder (wie normalerweise ueblich) genau eine 0 zwischen
- // Bounding-Rectangle und 0x11. Des weiteren mag es hoechstens 1024 Bytes Muell geben,
- // und das Ganze nur fuer Version 1 oder 2.
- // Somit suchen wir nun nach der Folge 0x00,0x11,0x01 oder 0x00,0x11,0x02 innerhalb der
- // "zweiten" 512 Bytes, und nehmen an, dass davor das Bounding-Rect steht, und hoffen
- // dass das alles so seine Richtigkeit hat.
- BYTE n1,n2,n3;
- USHORT i,Found;
- pPict->Seek(522);
- Found=0;
- *pPict >> n1 >> n2 >> n3;
- for (i=0; i<512; i++) {
- if (n1==0x00 && n2==0x11 && (n3==0x01 || n3==0x02)) { Found=1; break; }
- n1=n2; n2=n3; *pPict >> n3;
+ else {
+ nOffset = 509+st; // illogical : more logical will be nStartPos+509+st or to consider that nStartPos=0
+ // a small test to check if versionOp code exists after the bdbox ( with no extra NOP codes)
+ pPict->Seek(nOffset+10);
+ pPict->Read( sBuf, 2 );
+ if (pPict->IsEof() || pPict->GetError()) break;
+ if (sBuf[0] == 0x11 || (sBuf[0] == 0x00 && sBuf[1] == 0x11)) ; // maybe ok
+ else continue;
}
- if (Found!=0) {
- pPict->SeekRel(-11);
- *pPict >> y1 >> x1 >> y2 >> x2;
- // Lieber nochmal nachsehen, ob das Bounding-Rectangle gut zu sein scheint:
- if (x1+10<x2 && y1+10<y2 && y1>=-2048 && x1>=-2048 && x2<=2048 && y2<=2048) {
- aBoundingRect=Rectangle( x1, y1, --x2, --y2 );
- if (n3==0x01) {
- pPict->SeekRel(3);
- IsVersion2=FALSE;
- }
- else {
- pPict->SeekRel(4);
- IsVersion2=TRUE;
- }
- }
- else pPict->SetError(SVSTREAM_FILEFORMAT_ERROR);
+ pPict->Seek(nOffset);
+
+ // 2 bytes to store size ( version 1 ) ignored
+ pPict->SeekRel( 2 );
+ *pPict >> y1 >> x1 >> y2 >> x2; // Rahmen-Rechteck des Bildes
+ if (x1 > x2 || y1 > y2) continue; // bad bdbox
+ if (x1 < -2048 || x2 > 2048 || y1 < -2048 || y2 > 2048 || // origin|dest is very small|large
+ (x1 == x2 && y1 == y2) ) // 1 pixel pict is dubious
+ actualConfid-=3;
+ else if (x2 < x1+8 || y2 < y1+8) // a little dubious
+ actualConfid-=1;
+ if (st >= 3 && actualConfid != 20) continue;
+ aBoundingRect=Rectangle( x1,y1, x2, y2 );
+
+ if (pPict->IsEof() || pPict->GetError()) continue;
+ // read version
+ pPict->Read( sBuf, 2 );
+ // version 1 file
+ if ( sBuf[ 0 ] == 0x11 && sBuf[ 1 ] == 0x01 ) {
+ // pict v1 must be rare and we do only few tests
+ if (st < 2) { confidence[st] = --actualConfid; continue; }
+ IsVersion2 = sal_False; return;
}
- else pPict->SetError(SVSTREAM_FILEFORMAT_ERROR);
- }
+ if (sBuf[0] != 0x00) continue; // unrecovable error
+ int numZero = 0;
+ do
+ {
+ numZero++;
+ pPict->SeekRel(-1);
+ pPict->Read( sBuf, 2 );
+ }
+ while ( sBuf[0] == 0x00 && numZero < 10);
+ actualConfid -= (numZero-1); // extra nop are dubious
+ if (pPict->IsEof() || pPict->GetError()) continue;
+ if (sBuf[0] != 0x11) continue; // not a version opcode
+ // abnormal version 1 file
+ if (sBuf[1] == 0x01 ) {
+ // pict v1 must be rare and we do only few tests
+ if (st < 2) { confidence[st] = --actualConfid; continue; }
+ IsVersion2 = sal_False; return;
+ }
+ if (sBuf[1] != 0x02 ) continue; // not a version 2 file
+
+ IsVersion2=sal_True;
+ short nExtVer, nReserved;
+ // 3 Bytes ignored : end of version arg 0x02FF (ie: 0xFF), HeaderOp : 0x0C00
+ pPict->SeekRel( 3 );
+ *pPict >> nExtVer >> nReserved;
+ if (pPict->IsEof() || pPict->GetError()) continue;
+
+ if ( nExtVer == -2 ) // extended version 2 picture
+ {
+ sal_Int32 nHResFixed, nVResFixed;
+ *pPict >> nHResFixed >> nVResFixed;
+ *pPict >> y1 >> x1 >> y2 >> x2; // reading the optimal bounding rect
+ if (x1 > x2 || y1 > y2) continue; // bad bdbox
+ if (st < 2 && actualConfid != 20) { confidence[st] = actualConfid; continue; }
+
+ double fHRes = nHResFixed;
+ fHRes /= 65536;
+ double fVRes = nVResFixed;
+ fVRes /= 65536;
+ aHRes /= fHRes;
+ aVRes /= fVRes;
+ aBoundingRect=Rectangle( x1,y1, x2, y2 );
+ pPict->SeekRel( 4 ); // 4 bytes reserved
+ return;
+ }
+ else if (nExtVer == -1 ) { // basic version 2 picture
+ if (st < 2 && actualConfid != 20) { confidence[st] = actualConfid; continue; }
+ pPict->SeekRel( 16); // bdbox(4 fixed number)
+ pPict->SeekRel(4); // 4 bytes reserved
+ return;
+ }
+ }
+ pPict->SetError(SVSTREAM_FILEFORMAT_ERROR);
}
-
-ULONG PictReader::ReadData(USHORT nOpcode)
+sal_uLong PictReader::ReadData(sal_uInt16 nOpcode)
{
- USHORT nUSHORT;
+ sal_uInt16 nUSHORT;
Point aPoint;
- ULONG nDataSize=0;
+ sal_uLong nDataSize=0;
+ PictDrawingMethod shapeDMethod = PDM_UNDEFINED;
+ switch (nOpcode & 7) {
+ case 0: shapeDMethod = PDM_FRAME; break;
+ case 1: shapeDMethod = PDM_PAINT; break;
+ case 2: shapeDMethod = PDM_ERASE; break;
+ case 3: shapeDMethod = PDM_INVERT; break;
+ case 4: shapeDMethod = PDM_FILL; break;
+ default: break;
+ }
switch(nOpcode) {
@@ -1111,13 +1233,20 @@ ULONG PictReader::ReadData(USHORT nOpcode)
*pPict >> nUSHORT;
nDataSize=nUSHORT;
ReadRectangle(aRect);
+ // checkme: do we really want to extend the rectangle here ?
+ // I do that because the clipping is often used to clean a region,
+ // before drawing some text and also to draw this text.
+ // So using a too small region can lead to clip the end of the text ;
+ // but this can be discutable...
+ aRect.setWidth(aRect.getWidth()+1);
+ aRect.setHeight(aRect.getHeight()+1);
pVirDev->SetClipRegion( Region( aRect ) );
break;
}
case 0x0002: // BkPat
- nDataSize=ReadPattern(NULL,&eActBackStyle);
- eActMethod=PDM_UNDEFINED;
- break;
+ nDataSize=eActBackPattern.read(*pPict);
+ eActMethod=PDM_UNDEFINED;
+ break;
case 0x0003: // TxFont
*pPict >> nUSHORT;
@@ -1128,8 +1257,7 @@ ULONG PictReader::ReadData(USHORT nOpcode)
else if (nUSHORT == 22) aActFont.SetFamily(FAMILY_MODERN);
else if (nUSHORT <= 1023) aActFont.SetFamily(FAMILY_SWISS);
else aActFont.SetFamily(FAMILY_ROMAN);
- if ( nUSHORT == 23 ) aActFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );
- else aActFont.SetCharSet( gsl_getSystemTextEncoding() );
+ aActFont.SetCharSet(GetTextEncoding(nUSHORT));
eActMethod=PDM_UNDEFINED;
nDataSize=2;
break;
@@ -1143,10 +1271,10 @@ ULONG PictReader::ReadData(USHORT nOpcode)
else aActFont.SetItalic(ITALIC_NONE);
if ( (nFace & 0x04)!=0 ) aActFont.SetUnderline(UNDERLINE_SINGLE);
else aActFont.SetUnderline(UNDERLINE_NONE);
- if ( (nFace & 0x08)!=0 ) aActFont.SetOutline(TRUE);
- else aActFont.SetOutline(FALSE);
- if ( (nFace & 0x10)!=0 ) aActFont.SetShadow(TRUE);
- else aActFont.SetShadow(FALSE);
+ if ( (nFace & 0x08)!=0 ) aActFont.SetOutline(sal_True);
+ else aActFont.SetOutline(sal_False);
+ if ( (nFace & 0x10)!=0 ) aActFont.SetShadow(sal_True);
+ else aActFont.SetShadow(sal_False);
eActMethod=PDM_UNDEFINED;
nDataSize=1;
break;
@@ -1160,16 +1288,17 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0007: { // PnSize
- Size aSize;
- aSize=ReadSize();
- nActPenSize=(USHORT)((aSize.Width()+aSize.Height())/2);
+ nActPenSize=ReadSize();
eActMethod=PDM_UNDEFINED;
nDataSize=4;
break;
}
case 0x0008: // PnMode
*pPict >> nUSHORT;
- switch (nUSHORT & 0x0007) {
+ // internal code for postscript command (Quickdraw Reference Drawing B-30,B-34)
+ if (nUSHORT==23) eActROP = ROP_1;
+ else {
+ switch (nUSHORT & 0x0007) {
case 0: eActROP=ROP_OVERPAINT; break; // Copy
case 1: eActROP=ROP_OVERPAINT; break; // Or
case 2: eActROP=ROP_XOR; break; // Xor
@@ -1178,18 +1307,19 @@ ULONG PictReader::ReadData(USHORT nOpcode)
case 5: eActROP=ROP_OVERPAINT; break; // notOr
case 6: eActROP=ROP_XOR; break; // notXor
case 7: eActROP=ROP_OVERPAINT; break; // notBic
+ }
}
eActMethod=PDM_UNDEFINED;
nDataSize=2;
break;
case 0x0009: // PnPat
- nDataSize=ReadPattern(&eActPenPenStyle,&eActPenBrushStyle);
+ nDataSize=eActPenPattern.read(*pPict);
eActMethod=PDM_UNDEFINED;
break;
case 0x000a: // FillPat
- nDataSize=ReadPattern(NULL,&eActFillStyle);
+ nDataSize=eActFillPattern.read(*pPict);
eActMethod=PDM_UNDEFINED;
break;
@@ -1231,17 +1361,17 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0012: // BkPixPat
- nDataSize=ReadPixPattern(NULL,&eActBackStyle);
+ nDataSize=ReadPixPattern(eActBackPattern);
eActMethod=PDM_UNDEFINED;
break;
case 0x0013: // PnPixPat
- nDataSize=ReadPixPattern(&eActPenPenStyle,&eActPenBrushStyle);
+ nDataSize=ReadPixPattern(eActPenPattern);
eActMethod=PDM_UNDEFINED;
break;
case 0x0014: // FillPixPat
- nDataSize=ReadPixPattern(NULL,&eActFillStyle);
+ nDataSize=ReadPixPattern(eActFillPattern);
eActMethod=PDM_UNDEFINED;
break;
@@ -1289,34 +1419,42 @@ ULONG PictReader::ReadData(USHORT nOpcode)
case 0x0020: // Line
aPoint=ReadPoint(); aPenPosition=ReadPoint();
- DrawingMethod(PDM_FRAME);
- pVirDev->DrawLine(aPoint,aPenPosition);
nDataSize=8;
+
+ if (IsInvisible(PDM_FRAME)) break;
+ DrawingMethod(PDM_FRAME);
+ PictReaderShape::drawLine(pVirDev, aPoint,aPenPosition, nActPenSize);
break;
case 0x0021: // LineFrom
aPoint=aPenPosition; aPenPosition=ReadPoint();
- DrawingMethod(PDM_FRAME);
- pVirDev->DrawLine(aPoint,aPenPosition);
nDataSize=4;
+
+ if (IsInvisible(PDM_FRAME)) break;
+ DrawingMethod(PDM_FRAME);
+ PictReaderShape::drawLine(pVirDev, aPoint,aPenPosition, nActPenSize);
break;
case 0x0022: // ShortLine
aPoint=ReadPoint();
aPenPosition=ReadDeltaH(aPoint);
aPenPosition=ReadDeltaV(aPenPosition);
- DrawingMethod(PDM_FRAME);
- pVirDev->DrawLine(aPoint,aPenPosition);
nDataSize=6;
+
+ if (IsInvisible(PDM_FRAME)) break;
+ DrawingMethod(PDM_FRAME);
+ PictReaderShape::drawLine(pVirDev, aPoint,aPenPosition, nActPenSize);
break;
case 0x0023: // ShortLineFrom
aPoint=aPenPosition;
aPenPosition=ReadDeltaH(aPoint);
aPenPosition=ReadDeltaV(aPenPosition);
- DrawingMethod(PDM_FRAME);
- pVirDev->DrawLine(aPoint,aPenPosition);
nDataSize=2;
+
+ if (IsInvisible(PDM_FRAME)) break;
+ DrawingMethod(PDM_FRAME);
+ PictReaderShape::drawLine(pVirDev, aPoint,aPenPosition, nActPenSize);
break;
case 0x0024: // Reserved (n Bytes)
@@ -1360,9 +1498,8 @@ ULONG PictReader::ReadData(USHORT nOpcode)
else if (nUSHORT == 22) aActFont.SetFamily(FAMILY_MODERN);
else if (nUSHORT <= 1023) aActFont.SetFamily(FAMILY_SWISS);
else aActFont.SetFamily(FAMILY_ROMAN);
- if (nUSHORT==23) aActFont.SetCharSet( RTL_TEXTENCODING_SYMBOL);
- else aActFont.SetCharSet( gsl_getSystemTextEncoding() );
- *pPict >> nByteLen; nLen=((USHORT)nByteLen)&0x00ff;
+ aActFont.SetCharSet(GetTextEncoding(nUSHORT));
+ *pPict >> nByteLen; nLen=((sal_uInt16)nByteLen)&0x00ff;
pPict->Read( &sFName, nLen );
sFName[ nLen ] = 0;
String aString( (const sal_Char*)&sFName, gsl_getSystemTextEncoding() );
@@ -1385,23 +1522,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0030: // frameRect
- nDataSize=ReadAndDrawRect(PDM_FRAME);
- break;
-
case 0x0031: // paintRect
- nDataSize=ReadAndDrawRect(PDM_PAINT);
- break;
-
case 0x0032: // eraseRect
- nDataSize=ReadAndDrawRect(PDM_ERASE);
- break;
-
case 0x0033: // invertRect
- nDataSize=ReadAndDrawRect(PDM_INVERT);
- break;
-
case 0x0034: // fillRect
- nDataSize=ReadAndDrawRect(PDM_FILL);
+ nDataSize=ReadAndDrawRect(shapeDMethod);
break;
case 0x0035: // Reserved (8 Bytes)
@@ -1411,23 +1536,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0038: // frameSameRect
- nDataSize=ReadAndDrawSameRect(PDM_FRAME);
- break;
-
case 0x0039: // paintSameRect
- nDataSize=ReadAndDrawSameRect(PDM_PAINT);
- break;
-
case 0x003a: // eraseSameRect
- nDataSize=ReadAndDrawSameRect(PDM_ERASE);
- break;
-
case 0x003b: // invertSameRect
- nDataSize=ReadAndDrawSameRect(PDM_INVERT);
- break;
-
case 0x003c: // fillSameRect
- nDataSize=ReadAndDrawSameRect(PDM_FILL);
+ nDataSize=ReadAndDrawSameRect(shapeDMethod);
break;
case 0x003d: // Reserved (0 Bytes)
@@ -1437,23 +1550,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0040: // frameRRect
- nDataSize=ReadAndDrawRoundRect(PDM_FRAME);
- break;
-
case 0x0041: // paintRRect
- nDataSize=ReadAndDrawRoundRect(PDM_PAINT);
- break;
-
case 0x0042: // eraseRRect
- nDataSize=ReadAndDrawRoundRect(PDM_ERASE);
- break;
-
case 0x0043: // invertRRect
- nDataSize=ReadAndDrawRoundRect(PDM_INVERT);
- break;
-
case 0x0044: // fillRRect
- nDataSize=ReadAndDrawRoundRect(PDM_FILL);
+ nDataSize=ReadAndDrawRoundRect(shapeDMethod);
break;
case 0x0045: // Reserved (8 Bytes)
@@ -1463,23 +1564,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0048: // frameSameRRect
- nDataSize=ReadAndDrawSameRoundRect(PDM_FRAME);
- break;
-
case 0x0049: // paintSameRRect
- nDataSize=ReadAndDrawSameRoundRect(PDM_PAINT);
- break;
-
case 0x004a: // eraseSameRRect
- nDataSize=ReadAndDrawSameRoundRect(PDM_ERASE);
- break;
-
case 0x004b: // invertSameRRect
- nDataSize=ReadAndDrawSameRoundRect(PDM_INVERT);
- break;
-
case 0x004c: // fillSameRRect
- nDataSize=ReadAndDrawSameRoundRect(PDM_FILL);
+ nDataSize=ReadAndDrawSameRoundRect(shapeDMethod);
break;
case 0x004d: // Reserved (0 Bytes)
@@ -1489,23 +1578,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0050: // frameOval
- nDataSize=ReadAndDrawOval(PDM_FRAME);
- break;
-
case 0x0051: // paintOval
- nDataSize=ReadAndDrawOval(PDM_PAINT);
- break;
-
case 0x0052: // eraseOval
- nDataSize=ReadAndDrawOval(PDM_ERASE);
- break;
-
case 0x0053: // invertOval
- nDataSize=ReadAndDrawOval(PDM_INVERT);
- break;
-
case 0x0054: // fillOval
- nDataSize=ReadAndDrawOval(PDM_FILL);
+ nDataSize=ReadAndDrawOval(shapeDMethod);
break;
case 0x0055: // Reserved (8 Bytes)
@@ -1515,23 +1592,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0058: // frameSameOval
- nDataSize=ReadAndDrawSameOval(PDM_FRAME);
- break;
-
case 0x0059: // paintSameOval
- nDataSize=ReadAndDrawSameOval(PDM_PAINT);
- break;
-
case 0x005a: // eraseSameOval
- nDataSize=ReadAndDrawSameOval(PDM_ERASE);
- break;
-
case 0x005b: // invertSameOval
- nDataSize=ReadAndDrawSameOval(PDM_INVERT);
- break;
-
case 0x005c: // fillSameOval
- nDataSize=ReadAndDrawSameOval(PDM_FILL);
+ nDataSize=ReadAndDrawSameOval(shapeDMethod);
break;
case 0x005d: // Reserved (0 Bytes)
@@ -1541,23 +1606,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0060: // frameArc
- nDataSize=ReadAndDrawArc(PDM_FRAME);
- break;
-
case 0x0061: // paintArc
- nDataSize=ReadAndDrawArc(PDM_PAINT);
- break;
-
case 0x0062: // eraseArc
- nDataSize=ReadAndDrawArc(PDM_ERASE);
- break;
-
case 0x0063: // invertArc
- nDataSize=ReadAndDrawArc(PDM_INVERT);
- break;
-
case 0x0064: // fillArc
- nDataSize=ReadAndDrawArc(PDM_FILL);
+ nDataSize=ReadAndDrawArc(shapeDMethod);
break;
case 0x0065: // Reserved (12 Bytes)
@@ -1567,23 +1620,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0068: // frameSameArc
- nDataSize=ReadAndDrawSameArc(PDM_FRAME);
- break;
-
case 0x0069: // paintSameArc
- nDataSize=ReadAndDrawSameArc(PDM_PAINT);
- break;
-
case 0x006a: // eraseSameArc
- nDataSize=ReadAndDrawSameArc(PDM_ERASE);
- break;
-
case 0x006b: // invertSameArc
- nDataSize=ReadAndDrawSameArc(PDM_INVERT);
- break;
-
case 0x006c: // fillSameArc
- nDataSize=ReadAndDrawSameArc(PDM_FILL);
+ nDataSize=ReadAndDrawSameArc(shapeDMethod);
break;
case 0x006d: // Reserved (4 Bytes)
@@ -1593,23 +1634,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0070: // framePoly
- nDataSize=ReadAndDrawPolygon(PDM_FRAME);
- break;
-
case 0x0071: // paintPoly
- nDataSize=ReadAndDrawPolygon(PDM_PAINT);
- break;
-
case 0x0072: // erasePoly
- nDataSize=ReadAndDrawPolygon(PDM_ERASE);
- break;
-
case 0x0073: // invertPoly
- nDataSize=ReadAndDrawPolygon(PDM_INVERT);
- break;
-
case 0x0074: // fillPoly
- nDataSize=ReadAndDrawPolygon(PDM_FILL);
+ nDataSize=ReadAndDrawPolygon(shapeDMethod);
break;
case 0x0075: // Reserved (Polygon-Size)
@@ -1619,23 +1648,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0078: // frameSamePoly
- nDataSize=ReadAndDrawSamePolygon(PDM_FRAME);
- break;
-
case 0x0079: // paintSamePoly
- nDataSize=ReadAndDrawSamePolygon(PDM_PAINT);
- break;
-
case 0x007a: // eraseSamePoly
- nDataSize=ReadAndDrawSamePolygon(PDM_ERASE);
- break;
-
case 0x007b: // invertSamePoly
- nDataSize=ReadAndDrawSamePolygon(PDM_INVERT);
- break;
-
case 0x007c: // fillSamePoly
- nDataSize=ReadAndDrawSamePolygon(PDM_FILL);
+ nDataSize=ReadAndDrawSamePolygon(shapeDMethod);
break;
case 0x007d: // Reserved (0 Bytes)
@@ -1645,23 +1662,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0080: // frameRgn
- nDataSize=ReadAndDrawRgn(PDM_FILL);
- break;
-
case 0x0081: // paintRgn
- nDataSize=ReadAndDrawRgn(PDM_PAINT);
- break;
-
case 0x0082: // eraseRgn
- nDataSize=ReadAndDrawRgn(PDM_ERASE);
- break;
-
case 0x0083: // invertRgn
- nDataSize=ReadAndDrawRgn(PDM_INVERT);
- break;
-
case 0x0084: // fillRgn
- nDataSize=ReadAndDrawRgn(PDM_FILL);
+ nDataSize=ReadAndDrawRgn(shapeDMethod);
break;
case 0x0085: // Reserved (Region-Size)
@@ -1671,23 +1676,11 @@ ULONG PictReader::ReadData(USHORT nOpcode)
break;
case 0x0088: // frameSameRgn
- nDataSize=ReadAndDrawSameRgn(PDM_FRAME);
- break;
-
case 0x0089: // paintSameRgn
- nDataSize=ReadAndDrawSameRgn(PDM_PAINT);
- break;
-
case 0x008a: // eraseSameRgn
- nDataSize=ReadAndDrawSameRgn(PDM_ERASE);
- break;
-
case 0x008b: // invertSameRgn
- nDataSize=ReadAndDrawSameRgn(PDM_INVERT);
- break;
-
case 0x008c: // fillSameRgn
- nDataSize=ReadAndDrawSameRgn(PDM_FILL);
+ nDataSize=ReadAndDrawSameRgn(shapeDMethod);
break;
case 0x008d: // Reserved (0 Bytes)
@@ -1699,7 +1692,7 @@ ULONG PictReader::ReadData(USHORT nOpcode)
case 0x0090: { // BitsRect
Bitmap aBmp;
Rectangle aSrcRect, aDestRect;
- nDataSize=ReadPixMapEtc(aBmp, FALSE, TRUE, &aSrcRect, &aDestRect, TRUE, FALSE);
+ nDataSize=ReadPixMapEtc(aBmp, sal_False, sal_True, &aSrcRect, &aDestRect, sal_True, sal_False);
DrawingMethod(PDM_PAINT);
pVirDev->DrawBitmap(aDestRect.TopLeft(),aDestRect.GetSize(),aBmp);
break;
@@ -1707,7 +1700,7 @@ ULONG PictReader::ReadData(USHORT nOpcode)
case 0x0091: { // BitsRgn
Bitmap aBmp;
Rectangle aSrcRect, aDestRect;
- nDataSize=ReadPixMapEtc(aBmp, FALSE, TRUE, &aSrcRect, &aDestRect, TRUE, TRUE);
+ nDataSize=ReadPixMapEtc(aBmp, sal_False, sal_True, &aSrcRect, &aDestRect, sal_True, sal_True);
DrawingMethod(PDM_PAINT);
pVirDev->DrawBitmap(aDestRect.TopLeft(),aDestRect.GetSize(),aBmp);
break;
@@ -1724,7 +1717,7 @@ ULONG PictReader::ReadData(USHORT nOpcode)
case 0x0098: { // PackBitsRect
Bitmap aBmp;
Rectangle aSrcRect, aDestRect;
- nDataSize=ReadPixMapEtc(aBmp, FALSE, TRUE, &aSrcRect, &aDestRect, TRUE, FALSE);
+ nDataSize=ReadPixMapEtc(aBmp, sal_False, sal_True, &aSrcRect, &aDestRect, sal_True, sal_False);
DrawingMethod(PDM_PAINT);
pVirDev->DrawBitmap(aDestRect.TopLeft(),aDestRect.GetSize(),aBmp);
break;
@@ -1732,7 +1725,7 @@ ULONG PictReader::ReadData(USHORT nOpcode)
case 0x0099: { // PackBitsRgn
Bitmap aBmp;
Rectangle aSrcRect, aDestRect;
- nDataSize=ReadPixMapEtc(aBmp, FALSE, TRUE, &aSrcRect, &aDestRect, TRUE, TRUE);
+ nDataSize=ReadPixMapEtc(aBmp, sal_False, sal_True, &aSrcRect, &aDestRect, sal_True, sal_True);
DrawingMethod(PDM_PAINT);
pVirDev->DrawBitmap(aDestRect.TopLeft(),aDestRect.GetSize(),aBmp);
break;
@@ -1740,7 +1733,7 @@ ULONG PictReader::ReadData(USHORT nOpcode)
case 0x009a: { // DirectBitsRect
Bitmap aBmp;
Rectangle aSrcRect, aDestRect;
- nDataSize=ReadPixMapEtc(aBmp, TRUE, FALSE, &aSrcRect, &aDestRect, TRUE, FALSE);
+ nDataSize=ReadPixMapEtc(aBmp, sal_True, sal_False, &aSrcRect, &aDestRect, sal_True, sal_False);
DrawingMethod(PDM_PAINT);
pVirDev->DrawBitmap(aDestRect.TopLeft(),aDestRect.GetSize(),aBmp);
break;
@@ -1748,7 +1741,7 @@ ULONG PictReader::ReadData(USHORT nOpcode)
case 0x009b: { // DirectBitsRgn
Bitmap aBmp;
Rectangle aSrcRect, aDestRect;
- nDataSize=ReadPixMapEtc(aBmp, TRUE, FALSE, &aSrcRect, &aDestRect, TRUE, TRUE);
+ nDataSize=ReadPixMapEtc(aBmp, sal_True, sal_False, &aSrcRect, &aDestRect, sal_True, sal_True);
DrawingMethod(PDM_PAINT);
pVirDev->DrawBitmap(aDestRect.TopLeft(),aDestRect.GetSize(),aBmp);
break;
@@ -1772,7 +1765,9 @@ ULONG PictReader::ReadData(USHORT nOpcode)
if (nOpcode<=0x00af) { *pPict >> nUSHORT; nDataSize=2+nUSHORT; }
else if (nOpcode<=0x00cf) { nDataSize=0; }
else if (nOpcode<=0x00fe) { sal_uInt32 nTemp; *pPict >> nTemp ; nDataSize = nTemp; nDataSize+=4; }
- else if (nOpcode==0x00ff) { nDataSize=2; } // OpEndPic
+ // Osnola: checkme: in the Quickdraw Ref examples ( for pict v2)
+ // 0x00ff(EndOfPict) is also not followed by any data...
+ else if (nOpcode==0x00ff) { nDataSize=IsVersion2 ? 2 : 0; } // OpEndPic
else if (nOpcode<=0x01ff) { nDataSize=2; }
else if (nOpcode<=0x0bfe) { nDataSize=4; }
else if (nOpcode<=0x0bff) { nDataSize=22; }
@@ -1792,9 +1787,9 @@ ULONG PictReader::ReadData(USHORT nOpcode)
void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
{
- USHORT nOpcode;
- BYTE nOneByteOpcode;
- ULONG nSize, nPos, nStartPos, nEndPos, nPercent, nLastPercent;
+ sal_uInt16 nOpcode;
+ sal_uInt8 nOneByteOpcode;
+ sal_uLong nSize, nPos, nStartPos, nEndPos, nPercent, nLastPercent;
pPict = &rStreamPict;
nOrigPos = pPict->Tell();
@@ -1802,16 +1797,12 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
aActForeColor = Color(COL_BLACK);
aActBackColor = Color(COL_WHITE);
- eActPenPenStyle = PEN_SOLID;
- eActPenBrushStyle = BRUSH_SOLID;
- eActFillStyle = BRUSH_SOLID;
- eActBackStyle = BRUSH_SOLID;
- nActPenSize = 1;
+ nActPenSize = Size(1,1);
eActROP = ROP_OVERPAINT;
eActMethod = PDM_UNDEFINED;
aActOvalSize = Size(1,1);
- aActFont.SetCharSet( gsl_getSystemTextEncoding() );
+ aActFont.SetCharSet( GetTextEncoding());
aActFont.SetFamily(FAMILY_SWISS);
aActFont.SetSize(Size(0,12));
aActFont.SetAlign(ALIGN_BASELINE);
@@ -1819,7 +1810,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
aHRes = aVRes = Fraction( 1, 1 );
pVirDev = new VirtualDevice();
- pVirDev->EnableOutput(FALSE);
+ pVirDev->EnableOutput(sal_False);
rGDIMetaFile.Record(pVirDev);
pPict->SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN);
@@ -1839,7 +1830,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
nPercent=(nPos-nStartPos)*100/(nEndPos-nStartPos);
if (nLastPercent+4<=nPercent) {
- if (Callback((USHORT)nPercent)==TRUE) break;
+ if (Callback((sal_uInt16)nPercent)==sal_True) break;
nLastPercent=nPercent;
}
@@ -1848,7 +1839,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
else
{
*pPict >> nOneByteOpcode;
- nOpcode=(USHORT)nOneByteOpcode;
+ nOpcode=(sal_uInt16)nOneByteOpcode;
}
if (pPict->GetError())
@@ -1891,46 +1882,22 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
//================== GraphicImport - die exportierte Funktion ================
-extern "C" BOOL __LOADONCALLAPI GraphicImport( SvStream& rIStm, Graphic & rGraphic, FilterConfigItem*, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicImport( SvStream& rIStm, Graphic & rGraphic, FilterConfigItem*, sal_Bool )
{
GDIMetaFile aMTF;
PictReader aPictReader;
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
aPictReader.ReadPict( rIStm, aMTF );
if ( !rIStm.GetError() )
{
rGraphic = Graphic( aMTF );
- bRet = TRUE;
+ bRet = sal_True;
}
return bRet;
}
-//================== ein bischen Muell fuer Windows ==========================
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/ipict/makefile.mk b/filter/source/graphicfilter/ipict/makefile.mk
index 1f746992927b..dd8dfbc400c2 100644
--- a/filter/source/graphicfilter/ipict/makefile.mk
+++ b/filter/source/graphicfilter/ipict/makefile.mk
@@ -41,19 +41,18 @@ DEPTARGET=vipict
CDEFS+= -DEDITDEBUG
.ENDIF
.IF "$(L10N_framework)"==""
-SLOFILES = $(EXCEPTIONSFILES)
-EXCEPTIONSFILES = $(SLO)$/ipict.obj
+SLOFILES = $(SLO)$/ipict.obj $(SLO)$/shape.obj
# ==========================================================================
SHL1TARGET= ipt$(DLLPOSTFIX)
SHL1IMPLIB= ipict
-SHL1STDLIBS= $(VCLLIB) $(TOOLSLIB) $(SALLIB)
+SHL1STDLIBS= $(VCLLIB) $(TOOLSLIB) $(SALLIB) $(BASEGFXLIB)
SHL1LIBS= $(SLB)$/ipict.lib
.IF "$(GUI)" != "UNX"
.IF "$(COM)" != "GCC"
-SHL1OBJS= $(SLO)$/ipict.obj
+SHL1OBJS= $(SLOFILES)
.ENDIF
.ENDIF
diff --git a/filter/source/graphicfilter/ipict/shape.cxx b/filter/source/graphicfilter/ipict/shape.cxx
new file mode 100755
index 000000000000..c261b021472a
--- /dev/null
+++ b/filter/source/graphicfilter/ipict/shape.cxx
@@ -0,0 +1,266 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+/** Osnola:
+IMPORTANT NOTE: some Quickdraw lines/frames can not be "quickly" drawn exactly:
+for instance, when PenSize=(1,1), the line from (0,0) to (8,0)
+corresponds to the rectangle (0,0)(0,1)(9,1)(9,0), which can only be drawn
+ by drawing a rectangle. Drawing a non horizontal/vertical will imply to draw
+a polygon, ...
+Similarly, drawing the frame of a rectangle (0,0)(0,1)(9,1)(9,0) when PenSize=(1,1),
+will imply to draw a rectangle (0.5,0.5)(0.5,8.5)(8.5,8.5)(8.5,0.5) with linewidth=1...
+
+Here, we choose:
+- for horizontal/vertical lines and line with length less than five to draw the real line,
+- in the other case, we keep the same shape (even if this means some "bad" coordinates)
+*/
+#include "precompiled_filter.hxx"
+
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include "shape.hxx"
+
+namespace PictReaderShapePrivate {
+ /** returns an inside rectangle knowing the penSize in order to obtain the ``correct'' position
+ when we draw a frame in wide length*/
+ Rectangle contractRectangle(bool drawFrame, Rectangle const &rect, Size const &pSize) {
+ if (!drawFrame) return rect;
+ int penSize=(pSize.Width()+pSize.Height())/2;
+ if (2*penSize > rect.Right()-rect.Left()) penSize = (rect.Right()-rect.Left()+1)/2;
+ if (2*penSize > rect.Bottom()-rect.Top()) penSize = (rect.Bottom()-rect.Top()+1)/2;
+ int const X[2] = { rect.Left()+penSize/2, rect.Right()-(penSize+1)/2 };
+ int const Y[2] = { rect.Top()+penSize/2, rect.Bottom()-(penSize+1)/2 };
+ return Rectangle(Point(X[0],Y[0]), Point(X[1], Y[1]));
+ }
+}
+
+namespace PictReaderShape {
+ //--------- draws a horizontal/vertical/small line (by creating a "rectangle/polygon") ---------
+ bool drawLineHQ(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize) {
+ int dir[2] = { dest.X()-orig.X(), dest.Y()-orig.Y() };
+ bool vertic = dir[0] == 0;
+ bool horiz = dir[1] == 0;
+ if (!horiz && !vertic && dir[0]*dir[0]+dir[1]*dir[1] > 25) return false;
+
+ int X[2]={ orig.X(), dest.X() }, Y[2] = { orig.Y(), dest.Y() };
+ using namespace basegfx;
+ B2DPolygon poly;
+ if (horiz || vertic) {
+ if (horiz) {
+ if (X[0] < X[1]) X[1]+=pSize.Width();
+ else X[0]+=pSize.Width();
+ Y[1] += pSize.Height();
+ }
+ else {
+ if (Y[0] < Y[1]) Y[1]+=pSize.Height();
+ else Y[0]+=pSize.Height();
+ X[1] += pSize.Width();
+ }
+ poly.append(B2DPoint(X[0], Y[0])); poly.append(B2DPoint(X[1], Y[0]));
+ poly.append(B2DPoint(X[1], Y[1])); poly.append(B2DPoint(X[0], Y[1]));
+ poly.append(B2DPoint(X[0], Y[0]));
+ }
+ else {
+ int origPt[4][2] = { { orig.X(), orig.Y() }, { orig.X()+pSize.Width(), orig.Y() },
+ { orig.X()+pSize.Width(), orig.Y()+pSize.Height() },
+ { orig.X(), orig.Y()+pSize.Height() }};
+ int origAvoid = dir[0] > 0 ? (dir[1] > 0 ? 2 : 1) : (dir[1] > 0 ? 3 : 0);
+ int destPt[4][2] = { { dest.X(), dest.Y() }, { dest.X()+pSize.Width(), dest.Y() },
+ { dest.X()+pSize.Width(), dest.Y()+pSize.Height() },
+ { dest.X(), dest.Y()+pSize.Height() }};
+ for (int w = origAvoid+1; w < origAvoid+4; w++) {
+ int wh = (w%4);
+ poly.append(B2DPoint(origPt[wh][0], origPt[wh][1]));
+ }
+ for (int w = origAvoid+3; w < origAvoid+6; w++) {
+ int wh = (w%4);
+ poly.append(B2DPoint(destPt[wh][0], destPt[wh][1]));
+ }
+ int wh = (origAvoid+1)%4;
+ poly.append(B2DPoint(origPt[wh][0], origPt[wh][1]));
+ }
+
+ // HACK: here we use the line coloring when drawing the shape
+ // must be changed if other parameter are changed to draw
+ // a line/fill shape
+ Color oldFColor = dev->GetFillColor(), oldLColor = dev->GetLineColor();
+ dev->SetFillColor(oldLColor); dev->SetLineColor(Color(COL_TRANSPARENT));
+ dev->DrawPolygon(poly);
+ dev->SetLineColor(oldLColor); dev->SetFillColor(oldFColor);
+ return true;
+ }
+
+ //
+ //-------------------- draws a line --------------------
+ //
+ void drawLine(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize) {
+ if (drawLineHQ(dev,orig,dest,pSize)) return;
+
+ int penSize=(pSize.Width()+pSize.Height())/2;
+ int decal[2] = { pSize.Width()/2, pSize.Height()/2};
+
+ using namespace basegfx;
+ B2DPolygon poly;
+ poly.append(B2DPoint(double(orig.X()+decal[0]), double(orig.Y()+decal[1])));
+ poly.append(B2DPoint(double(dest.X()+decal[0]), double(dest.Y()+decal[1])));
+ dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE);
+ }
+
+ //-------------------- draws a rectangle --------------------
+ /* Note(checkme): contradically with the QuickDraw's reference 3-23, it seems better to consider
+ that the frame/content of a rectangle appears inside the given rectangle. Does a conversion
+ appear between the pascal functions and the data stored in the file ? */
+ void drawRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &pSize) {
+ int penSize=(pSize.Width()+pSize.Height())/2;
+ Rectangle rect = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize);
+ double const X[2] = { rect.Left(), rect.Right() };
+ double const Y[2] = { rect.Top(), rect.Bottom() };
+
+ using namespace basegfx;
+ B2DPolygon poly;
+ poly.append(B2DPoint(X[0], Y[0])); poly.append(B2DPoint(X[1], Y[0]));
+ poly.append(B2DPoint(X[1], Y[1])); poly.append(B2DPoint(X[0], Y[1]));
+ poly.append(B2DPoint(X[0], Y[0]));
+
+ if (drawFrame)
+ dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE);
+ else
+ dev->DrawPolygon(poly);
+ }
+
+ //-------------------- draws an ellipse --------------------
+ void drawEllipse(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &pSize) {
+ int penSize=(pSize.Width()+pSize.Height())/2;
+ Rectangle oval = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize);
+ using namespace basegfx;
+ double const X[2] = { oval.Left(), oval.Right() };
+ double const Y[2] = { oval.Top(), oval.Bottom() };
+ B2DPoint center(0.5*(X[1]+X[0]), 0.5*(Y[1]+Y[0]));
+ B2DPolygon poly = tools::createPolygonFromEllipse(center, 0.5*(X[1]-X[0]), 0.5*(Y[1]-Y[0]));
+ if (drawFrame)
+ dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE);
+ else
+ dev->DrawPolygon(poly);
+ }
+
+ //-------------------- draws an arc/pie --------------------
+ void drawArc(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, const double& angle1, const double& angle2, Size const &pSize) {
+ int penSize=(pSize.Width()+pSize.Height())/2;
+ Rectangle arc = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize);
+ using namespace basegfx;
+
+ double const PI2 = M_PI/2.0;
+ // pict angle are CW with 0 at twelve oclock ( with Y-axis inverted)...
+ double angl1 = angle1-PI2;
+ double angl2 = angle2-PI2;
+ double const X[2] = { arc.Left(), arc.Right() };
+ double const Y[2] = { arc.Top(), arc.Bottom() };
+ B2DPoint center(0.5*(X[1]+X[0]), 0.5*(Y[1]+Y[0]));
+
+ // We must have angl1 between 0 and F_2PI
+ while (angl1 < 0.0) { angl1 += F_2PI; angl2 += F_2PI; }
+ while (angl1 >= F_2PI) { angl1 -= F_2PI; angl2 -= F_2PI; }
+
+ // if this happen, we want a complete circle
+ // so we set angl2 slightly less than angl1
+ if (angl2 >= angl1+F_2PI) angl2 = angl1-0.001;
+
+ // We must have angl2 between 0 and F_2PI
+ while (angl2 < 0.0) angl2 += F_2PI;
+ while (angl2 >= F_2PI) angl2 -= F_2PI;
+
+ B2DPolygon poly = tools::createPolygonFromEllipseSegment(center, 0.5*(X[1]-X[0]), 0.5*(Y[1]-Y[0]), angl1, angl2);
+ if (drawFrame)
+ dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE);
+ else {
+ // adds circle's center
+ poly.append(center);
+ dev->DrawPolygon(poly);
+ }
+ }
+ //-------------------- draws a rectangle with round corner --------------------
+ void drawRoundRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &ovalSize, Size const &pSize) {
+ int penSize=(pSize.Width()+pSize.Height())/2;
+ Rectangle oval = PictReaderShapePrivate::contractRectangle(drawFrame, orig, pSize);
+ int ovalW=ovalSize.Width(), ovalH=ovalSize.Height();
+ using namespace basegfx;
+ double const X[2] = { oval.Left(), oval.Right() };
+ double const Y[2] = { oval.Top(), oval.Bottom() };
+ double width = X[1] - X[0];
+ double height = Y[1] - Y[0];
+ if (ovalW > width) ovalW = static_cast< int >( width );
+ if (ovalH > height) ovalH = static_cast< int >( height );
+
+ B2DRectangle rect(B2DPoint(X[0],Y[0]), B2DPoint(X[1],Y[1]));
+ B2DPolygon poly = tools::createPolygonFromRect(rect, (width != 0.0) ? ovalW/width : 0.0, (height != 0.0) ? ovalH/height : 0.0);
+
+ if (drawFrame)
+ dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE);
+ else
+ dev->DrawPolygon(poly);
+ }
+
+ //-------------------- draws a polygon --------------------
+ void drawPolygon(VirtualDevice *dev, bool drawFrame, Polygon const &orig, Size const &pSize) {
+ int penSize=(pSize.Width()+pSize.Height())/2;
+ int decalTL[2] = {0, 0}, decalBR[2] = { pSize.Width(), pSize.Height()};
+ if (drawFrame) {
+ decalTL[0] += penSize/2; decalTL[1] += penSize/2;
+ decalBR[0] -= (penSize+1)/2; decalBR[1] -= (penSize+1)/2;
+ }
+ // Quickdraw Drawing Reference 3-82: the pen size is only used for frame
+ else decalBR[0] = decalBR[1] = 0;
+
+
+ int numPt = orig.GetSize();
+ if (numPt <= 1) return;
+
+ // we compute a barycenter of the point to define the extended direction of each point
+ double bary[2] = { 0.0, 0.0 };
+ for (int i = 0; i < numPt; i++) {
+ Point const &pt = orig.GetPoint(i);
+ bary[0] += double(pt.X()); bary[1] += double(pt.Y());
+ }
+ bary[0]/=double(numPt); bary[1]/=double(numPt);
+
+ using namespace basegfx;
+ B2DPolygon poly;
+ // Note: a polygon can be open, so we must not close it when we draw the frame
+ for (int i = 0; i < numPt; i++) {
+ Point const &pt = orig.GetPoint(i);
+ double x = (double(pt.X()) < bary[0]) ? pt.X()+decalTL[0] : pt.X()+decalBR[0];
+ double y = (double(pt.Y()) < bary[1]) ? pt.Y()+decalTL[1] : pt.Y()+decalBR[1];
+ poly.append(B2DPoint(x, y));
+ }
+ if (drawFrame)
+ dev->DrawPolyLine(poly, double(penSize), basegfx::B2DLINEJOIN_NONE);
+ else
+ dev->DrawPolygon(poly);
+ }
+
+
+}
diff --git a/filter/source/graphicfilter/ipict/shape.hxx b/filter/source/graphicfilter/ipict/shape.hxx
new file mode 100755
index 000000000000..635a7cf06c1e
--- /dev/null
+++ b/filter/source/graphicfilter/ipict/shape.hxx
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include <vcl/virdev.hxx>
+
+namespace PictReaderShape {
+ /** draws a line from orig to dest knowing penSize
+
+ Attention: in order to draw horizontal/vertical/small lines, this function can instead draw a rectangle or
+ a polygon. In this case, we retrieve the line informations from VirtualDev ( GetLineColor )
+ and we use them as fill informations ( SetFillColor ). We restore after the VirtualDev state.
+
+ This implies also that this function must be modified if we use real pattern to draw these primitives.
+ */
+ void drawLine(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize);
+
+ /** draws a rectangle knowing penSize */
+ void drawRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &rect, Size const &pSize);
+
+ /** draws a polygon knowing penSize */
+ void drawPolygon(VirtualDevice *dev, bool drawFrame, Polygon const &rect, Size const &pSize);
+
+ /** draws an ellipse knowing penSize */
+ void drawEllipse(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &pSize);
+
+ /** draws a rounded rectangle knowing penSize
+ \note ovalSize is two time the size of the corner
+ */
+ void drawRoundRectangle(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, Size const &ovalS, Size const &pSize);
+
+ /** draws an arc in a b2dpolygon knowing penSize
+ \note - it supposes that angl1 < angl2
+ */
+ void drawArc(VirtualDevice *dev, bool drawFrame, Rectangle const &orig, const double& angle1, const double& angle2, Size const &pSize);
+}
diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx
index c2c01d1de811..773fa79b3281 100644
--- a/filter/source/graphicfilter/ipsd/ipsd.cxx
+++ b/filter/source/graphicfilter/ipsd/ipsd.cxx
@@ -46,15 +46,15 @@
typedef struct
{
- UINT32 nSignature;
- UINT16 nVersion;
- UINT32 nPad1;
- UINT16 nPad2;
- UINT16 nChannels;
- UINT32 nRows;
- UINT32 nColumns;
- UINT16 nDepth;
- UINT16 nMode;
+ sal_uInt32 nSignature;
+ sal_uInt16 nVersion;
+ sal_uInt32 nPad1;
+ sal_uInt16 nPad2;
+ sal_uInt16 nChannels;
+ sal_uInt32 nRows;
+ sal_uInt32 nColumns;
+ sal_uInt16 nDepth;
+ sal_uInt16 nMode;
} PSDFileHeader;
@@ -76,17 +76,17 @@ private:
BitmapReadAccess* mpReadAcc;
BitmapWriteAccess* mpWriteAcc;
BitmapWriteAccess* mpMaskWriteAcc;
- USHORT mnDestBitDepth;
- BOOL mbCompression; // RLE decoding
- BYTE* mpPalette;
+ sal_uInt16 mnDestBitDepth;
+ sal_Bool mbCompression; // RLE decoding
+ sal_uInt8* mpPalette;
- BOOL ImplReadBody();
- BOOL ImplReadHeader();
+ sal_Bool ImplReadBody();
+ sal_Bool ImplReadHeader();
public:
PSDReader(SvStream &rStream);
~PSDReader();
- BOOL ReadPSD(Graphic & rGraphic);
+ sal_Bool ReadPSD(Graphic & rGraphic);
};
//=================== Methoden von PSDReader ==============================
@@ -96,8 +96,8 @@ PSDReader::PSDReader(SvStream &rStream)
, mpFileHeader(NULL)
, mnXResFixed(0)
, mnYResFixed(0)
- , mbStatus(TRUE)
- , mbTransparent(FALSE)
+ , mbStatus(sal_True)
+ , mbTransparent(sal_False)
, mpReadAcc(NULL)
, mpWriteAcc(NULL)
, mpMaskWriteAcc(NULL)
@@ -113,34 +113,34 @@ PSDReader::~PSDReader()
// ------------------------------------------------------------------------
-BOOL PSDReader::ReadPSD(Graphic & rGraphic )
+sal_Bool PSDReader::ReadPSD(Graphic & rGraphic )
{
if (m_rPSD.GetError())
- return FALSE;
+ return sal_False;
m_rPSD.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
// Kopf einlesen:
- if ( ImplReadHeader() == FALSE )
- return FALSE;
+ if ( ImplReadHeader() == sal_False )
+ return sal_False;
Size aBitmapSize( mpFileHeader->nColumns, mpFileHeader->nRows );
maBmp = Bitmap( aBitmapSize, mnDestBitDepth );
if ( ( mpWriteAcc = maBmp.AcquireWriteAccess() ) == NULL )
- mbStatus = FALSE;
+ mbStatus = sal_False;
if ( ( mpReadAcc = maBmp.AcquireReadAccess() ) == NULL )
- mbStatus = FALSE;
+ mbStatus = sal_False;
if ( mbTransparent && mbStatus )
{
maMaskBmp = Bitmap( aBitmapSize, 1 );
if ( ( mpMaskWriteAcc = maMaskBmp.AcquireWriteAccess() ) == NULL )
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
if ( mpPalette && mbStatus )
{
mpWriteAcc->SetPaletteEntryCount( 256 );
- for ( USHORT i = 0; i < 256; i++ )
+ for ( sal_uInt16 i = 0; i < 256; i++ )
{
mpWriteAcc->SetPaletteColor( i, Color( mpPalette[ i ], mpPalette[ i + 256 ], mpPalette[ i + 512 ] ) );
}
@@ -165,7 +165,7 @@ BOOL PSDReader::ReadPSD(Graphic & rGraphic )
}
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
if ( mpWriteAcc )
maBmp.ReleaseAccess( mpWriteAcc );
if ( mpReadAcc )
@@ -177,32 +177,32 @@ BOOL PSDReader::ReadPSD(Graphic & rGraphic )
// ------------------------------------------------------------------------
-BOOL PSDReader::ImplReadHeader()
+sal_Bool PSDReader::ImplReadHeader()
{
- UINT16 nCompression;
- UINT32 nColorLength, nResourceLength, nLayerMaskLength;
+ sal_uInt16 nCompression;
+ sal_uInt32 nColorLength, nResourceLength, nLayerMaskLength;
mpFileHeader = new PSDFileHeader;
if ( !mpFileHeader )
- return FALSE;
+ return sal_False;
m_rPSD >> mpFileHeader->nSignature >> mpFileHeader->nVersion >> mpFileHeader->nPad1 >>
mpFileHeader->nPad2 >> mpFileHeader->nChannels >> mpFileHeader->nRows >>
mpFileHeader->nColumns >> mpFileHeader->nDepth >> mpFileHeader->nMode;
if ( ( mpFileHeader->nSignature != 0x38425053 ) || ( mpFileHeader->nVersion != 1 ) )
- return FALSE;
+ return sal_False;
if ( mpFileHeader->nRows == 0 || mpFileHeader->nColumns == 0 )
- return FALSE;
+ return sal_False;
if ( ( mpFileHeader->nRows > 30000 ) || ( mpFileHeader->nColumns > 30000 ) )
- return FALSE;
+ return sal_False;
- UINT16 nDepth = mpFileHeader->nDepth;
+ sal_uInt16 nDepth = mpFileHeader->nDepth;
if (!( ( nDepth == 1 ) || ( nDepth == 8 ) || ( nDepth == 16 ) ) )
- return FALSE;
+ return sal_False;
mnDestBitDepth = ( nDepth == 16 ) ? 8 : nDepth;
@@ -212,27 +212,27 @@ BOOL PSDReader::ImplReadHeader()
switch ( mpFileHeader->nChannels )
{
case 5 :
- mbTransparent = TRUE;
+ mbTransparent = sal_True;
case 4 :
mnDestBitDepth = 24;
break;
default :
- return FALSE;
+ return sal_False;
}
}
else switch ( mpFileHeader->nChannels )
{
case 2 :
- mbTransparent = TRUE;
+ mbTransparent = sal_True;
case 1 :
break;
case 4 :
- mbTransparent = TRUE;
+ mbTransparent = sal_True;
case 3 :
mnDestBitDepth = 24;
break;
default:
- return FALSE;
+ return sal_False;
}
switch ( mpFileHeader->nMode )
@@ -240,17 +240,17 @@ BOOL PSDReader::ImplReadHeader()
case PSD_BITMAP :
{
if ( nColorLength || ( nDepth != 1 ) )
- return FALSE;
+ return sal_False;
}
break;
case PSD_INDEXED :
{
if ( nColorLength != 768 ) // we need the color map
- return FALSE;
- mpPalette = new BYTE[ 768 ];
+ return sal_False;
+ mpPalette = new sal_uInt8[ 768 ];
if ( mpPalette == NULL )
- return FALSE;
+ return sal_False;
m_rPSD.Read( mpPalette, 768 );
}
break;
@@ -261,13 +261,13 @@ BOOL PSDReader::ImplReadHeader()
case PSD_GRAYSCALE :
{
if ( nColorLength )
- return FALSE;
- mpPalette = new BYTE[ 768 ];
+ return sal_False;
+ mpPalette = new sal_uInt8[ 768 ];
if ( mpPalette == NULL )
- return FALSE;
- for ( USHORT i = 0; i < 256; i++ )
+ return sal_False;
+ for ( sal_uInt16 i = 0; i < 256; i++ )
{
- mpPalette[ i ] = mpPalette[ i + 256 ] = mpPalette[ i + 512 ] = (BYTE)i;
+ mpPalette[ i ] = mpPalette[ i + 256 ] = mpPalette[ i + 512 ] = (sal_uInt8)i;
}
}
break;
@@ -278,12 +278,12 @@ BOOL PSDReader::ImplReadHeader()
case PSD_LAB :
{
if ( nColorLength ) // color table is not supported by the other graphic modes
- return FALSE;
+ return sal_False;
}
break;
default:
- return FALSE;
+ return sal_False;
}
m_rPSD >> nResourceLength;
sal_uInt32 nLayerPos = m_rPSD.Tell() + nResourceLength;
@@ -328,27 +328,27 @@ BOOL PSDReader::ImplReadHeader()
m_rPSD >> nCompression;
if ( nCompression == 0 )
{
- mbCompression = FALSE;
+ mbCompression = sal_False;
}
else if ( nCompression == 1 )
{
m_rPSD.SeekRel( ( mpFileHeader->nRows * mpFileHeader->nChannels ) << 1 );
- mbCompression = TRUE;
+ mbCompression = sal_True;
}
else
- return FALSE;
+ return sal_False;
- return TRUE;
+ return sal_True;
}
// ------------------------------------------------------------------------
-BOOL PSDReader::ImplReadBody()
+sal_Bool PSDReader::ImplReadBody()
{
- ULONG nX, nY;
+ sal_uLong nX, nY;
char nRunCount = 0;
signed char nBitCount = -1;
- BYTE nDat = 0, nDummy, nRed, nGreen, nBlue;
+ sal_uInt8 nDat = 0, nDummy, nRed, nGreen, nBlue;
BitmapColor aBitmapColor;
nX = nY = 0;
@@ -371,9 +371,9 @@ BOOL PSDReader::ImplReadBody()
nDat ^= 0xff;
nBitCount = 7;
}
- for ( USHORT i = 0; i < ( -nRunCount + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ )
{
- mpWriteAcc->SetPixel( nY, nX, (BYTE)nDat >> nBitCount-- );
+ mpWriteAcc->SetPixel( nY, nX, (sal_uInt8)nDat >> nBitCount-- );
if ( ++nX == mpFileHeader->nColumns )
{
nX = 0;
@@ -386,7 +386,7 @@ BOOL PSDReader::ImplReadBody()
}
else // a raw packet
{
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
if ( nBitCount == -1 ) // bits left in nDat ?
{
@@ -394,7 +394,7 @@ BOOL PSDReader::ImplReadBody()
nDat ^= 0xff;
nBitCount = 7;
}
- mpWriteAcc->SetPixel( nY, nX, (BYTE)nDat >> nBitCount-- );
+ mpWriteAcc->SetPixel( nY, nX, (sal_uInt8)nDat >> nBitCount-- );
if ( ++nX == mpFileHeader->nColumns )
{
nX = 0;
@@ -421,9 +421,9 @@ BOOL PSDReader::ImplReadBody()
m_rPSD >> nDat;
if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped
m_rPSD >> nDummy;
- for ( USHORT i = 0; i < ( -nRunCount + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ )
{
- mpWriteAcc->SetPixel( nY, nX, (BYTE)nDat );
+ mpWriteAcc->SetPixel( nY, nX, (sal_uInt8)nDat );
if ( ++nX == mpFileHeader->nColumns )
{
nX = 0;
@@ -435,12 +435,12 @@ BOOL PSDReader::ImplReadBody()
}
else // a raw packet
{
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
m_rPSD >> nDat;
if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped
m_rPSD >> nDummy;
- mpWriteAcc->SetPixel( nY, nX, (BYTE)nDat );
+ mpWriteAcc->SetPixel( nY, nX, (sal_uInt8)nDat );
if ( ++nX == mpFileHeader->nColumns )
{
nX = 0;
@@ -470,9 +470,9 @@ BOOL PSDReader::ImplReadBody()
m_rPSD >> nRed;
if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped
m_rPSD >> nDummy;
- for ( USHORT i = 0; i < ( -nRunCount + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ )
{
- mpWriteAcc->SetPixel( nY, nX, BitmapColor( nRed, (BYTE)0, (BYTE)0 ) );
+ mpWriteAcc->SetPixel( nY, nX, BitmapColor( nRed, (sal_uInt8)0, (sal_uInt8)0 ) );
if ( ++nX == mpFileHeader->nColumns )
{
nX = 0;
@@ -484,12 +484,12 @@ BOOL PSDReader::ImplReadBody()
}
else // a raw packet
{
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
m_rPSD >> nRed;
if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped
m_rPSD >> nDummy;
- mpWriteAcc->SetPixel( nY, nX, BitmapColor( nRed, (BYTE)0, (BYTE)0 ) );
+ mpWriteAcc->SetPixel( nY, nX, BitmapColor( nRed, (sal_uInt8)0, (sal_uInt8)0 ) );
if ( ++nX == mpFileHeader->nColumns )
{
nX = 0;
@@ -510,7 +510,7 @@ BOOL PSDReader::ImplReadBody()
m_rPSD >> nGreen;
if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped
m_rPSD >> nDummy;
- for ( USHORT i = 0; i < ( -nRunCount + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ )
{
aBitmapColor = mpReadAcc->GetPixel( nY, nX );
mpWriteAcc->SetPixel( nY, nX, BitmapColor( aBitmapColor.GetRed(), nGreen, aBitmapColor.GetBlue() ) );
@@ -525,7 +525,7 @@ BOOL PSDReader::ImplReadBody()
}
else // a raw packet
{
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
m_rPSD >> nGreen;
if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped
@@ -552,7 +552,7 @@ BOOL PSDReader::ImplReadBody()
m_rPSD >> nBlue;
if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped
m_rPSD >> nDummy;
- for ( USHORT i = 0; i < ( -nRunCount + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ )
{
aBitmapColor = mpReadAcc->GetPixel( nY, nX );
mpWriteAcc->SetPixel( nY, nX, BitmapColor( aBitmapColor.GetRed(), aBitmapColor.GetGreen(), nBlue ) );
@@ -567,7 +567,7 @@ BOOL PSDReader::ImplReadBody()
}
else // a raw packet
{
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
m_rPSD >> nBlue;
if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped
@@ -586,8 +586,8 @@ BOOL PSDReader::ImplReadBody()
}
if ( mpFileHeader->nMode == PSD_CMYK )
{
- UINT32 nBlack, nBlackMax = 0;
- BYTE* pBlack = new BYTE[ mpFileHeader->nRows * mpFileHeader->nColumns ];
+ sal_uInt32 nBlack, nBlackMax = 0;
+ sal_uInt8* pBlack = new sal_uInt8[ mpFileHeader->nRows * mpFileHeader->nColumns ];
nY = 0;
while ( nY < mpFileHeader->nRows )
{
@@ -601,15 +601,15 @@ BOOL PSDReader::ImplReadBody()
if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped
m_rPSD >> nDummy;
- for ( USHORT i = 0; i < ( -nRunCount + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ )
{
- nBlack = (BYTE)mpReadAcc->GetPixel( nY, nX ).GetRed() + nDat;
+ nBlack = (sal_uInt8)mpReadAcc->GetPixel( nY, nX ).GetRed() + nDat;
if ( nBlack > nBlackMax )
nBlackMax = nBlack;
- nBlack = (BYTE)mpReadAcc->GetPixel( nY, nX ).GetGreen() + nDat;
+ nBlack = (sal_uInt8)mpReadAcc->GetPixel( nY, nX ).GetGreen() + nDat;
if ( nBlack > nBlackMax )
nBlackMax = nBlack;
- nBlack = (BYTE)mpReadAcc->GetPixel( nY, nX ).GetBlue() + nDat;
+ nBlack = (sal_uInt8)mpReadAcc->GetPixel( nY, nX ).GetBlue() + nDat;
if ( nBlack > nBlackMax )
nBlackMax = nBlack;
pBlack[ nX + nY * mpFileHeader->nColumns ] = nDat ^ 0xff;
@@ -624,19 +624,19 @@ BOOL PSDReader::ImplReadBody()
}
else // a raw packet
{
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
m_rPSD >> nDat;
if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped
m_rPSD >> nDummy;
- nBlack = (BYTE)mpReadAcc->GetPixel( nY, nX ).GetRed() + nDat;
+ nBlack = (sal_uInt8)mpReadAcc->GetPixel( nY, nX ).GetRed() + nDat;
if ( nBlack > nBlackMax )
nBlackMax = nBlack;
- nBlack = (BYTE)mpReadAcc->GetPixel( nY, nX ).GetGreen() + nDat;
+ nBlack = (sal_uInt8)mpReadAcc->GetPixel( nY, nX ).GetGreen() + nDat;
if ( nBlack > nBlackMax )
nBlackMax = nBlack;
- nBlack = (BYTE)mpReadAcc->GetPixel( nY, nX ).GetBlue() + nDat;
+ nBlack = (sal_uInt8)mpReadAcc->GetPixel( nY, nX ).GetBlue() + nDat;
if ( nBlack > nBlackMax )
nBlackMax = nBlack;
pBlack[ nX + nY * mpFileHeader->nColumns ] = nDat ^ 0xff;
@@ -655,12 +655,12 @@ BOOL PSDReader::ImplReadBody()
{
for ( nX = 0; nX < mpFileHeader->nColumns; nX++ )
{
- INT32 nDAT = pBlack[ nX + nY * mpFileHeader->nColumns ] * ( nBlackMax - 256 ) / 0x1ff;
+ sal_Int32 nDAT = pBlack[ nX + nY * mpFileHeader->nColumns ] * ( nBlackMax - 256 ) / 0x1ff;
aBitmapColor = mpReadAcc->GetPixel( nY, nX );
- BYTE cR = (BYTE) MinMax( aBitmapColor.GetRed() - nDAT, 0L, 255L );
- BYTE cG = (BYTE) MinMax( aBitmapColor.GetGreen() - nDAT, 0L, 255L );
- BYTE cB = (BYTE) MinMax( aBitmapColor.GetBlue() - nDAT, 0L, 255L );
+ sal_uInt8 cR = (sal_uInt8) MinMax( aBitmapColor.GetRed() - nDAT, 0L, 255L );
+ sal_uInt8 cG = (sal_uInt8) MinMax( aBitmapColor.GetGreen() - nDAT, 0L, 255L );
+ sal_uInt8 cB = (sal_uInt8) MinMax( aBitmapColor.GetBlue() - nDAT, 0L, 255L );
mpWriteAcc->SetPixel( nY, nX, BitmapColor( cR, cG, cB ) );
}
}
@@ -689,9 +689,9 @@ BOOL PSDReader::ImplReadBody()
nDat = 1;
if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped
m_rPSD >> nDummy;
- for ( USHORT i = 0; i < ( -nRunCount + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ )
{
- mpMaskWriteAcc->SetPixel( nY, nX, (BYTE)nDat );
+ mpMaskWriteAcc->SetPixel( nY, nX, (sal_uInt8)nDat );
if ( ++nX == mpFileHeader->nColumns )
{
nX = 0;
@@ -703,7 +703,7 @@ BOOL PSDReader::ImplReadBody()
}
else // a raw packet
{
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
m_rPSD >> nDat;
if ( nDat )
@@ -712,7 +712,7 @@ BOOL PSDReader::ImplReadBody()
nDat = 1;
if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped
m_rPSD >> nDummy;
- mpMaskWriteAcc->SetPixel( nY, nX, (BYTE)nDat );
+ mpMaskWriteAcc->SetPixel( nY, nX, (sal_uInt8)nDat );
if ( ++nX == mpFileHeader->nColumns )
{
nX = 0;
@@ -724,41 +724,17 @@ BOOL PSDReader::ImplReadBody()
}
}
}
- return TRUE;
+ return sal_True;
}
//================== GraphicImport - die exportierte Funktion ================
-extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool )
{
PSDReader aPSDReader(rStream);
return aPSDReader.ReadPSD(rGraphic);
}
-//================== ein bischen Muell fuer Windows ==========================
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/iras/iras.cxx b/filter/source/graphicfilter/iras/iras.cxx
index f5a469a8f7e0..e65d6ddbcfd4 100644
--- a/filter/source/graphicfilter/iras/iras.cxx
+++ b/filter/source/graphicfilter/iras/iras.cxx
@@ -52,32 +52,32 @@ private:
SvStream& m_rRAS; // Die einzulesende RAS-Datei
- BOOL mbStatus;
+ sal_Bool mbStatus;
Bitmap maBmp;
BitmapWriteAccess* mpAcc;
sal_uInt32 mnWidth, mnHeight; // Bildausmass in Pixeln
- USHORT mnDstBitsPerPix;
- USHORT mnDstColors;
+ sal_uInt16 mnDstBitsPerPix;
+ sal_uInt16 mnDstColors;
sal_uInt32 mnDepth, mnImageDatSize, mnType;
sal_uInt32 mnColorMapType, mnColorMapSize;
- BYTE mnRepCount, mnRepVal; // RLE Decoding
- BOOL mbPalette;
+ sal_uInt8 mnRepCount, mnRepVal; // RLE Decoding
+ sal_Bool mbPalette;
- BOOL ImplReadBody();
- BOOL ImplReadHeader();
- BYTE ImplGetByte();
+ sal_Bool ImplReadBody();
+ sal_Bool ImplReadHeader();
+ sal_uInt8 ImplGetByte();
public:
RASReader(SvStream &rRAS);
~RASReader();
- BOOL ReadRAS(Graphic & rGraphic);
+ sal_Bool ReadRAS(Graphic & rGraphic);
};
//=================== Methoden von RASReader ==============================
RASReader::RASReader(SvStream &rRAS)
: m_rRAS(rRAS)
- , mbStatus(TRUE)
+ , mbStatus(sal_True)
, mpAcc(NULL)
, mnRepCount(0)
, mbPalette(FALSE)
@@ -90,46 +90,46 @@ RASReader::~RASReader()
//----------------------------------------------------------------------------
-BOOL RASReader::ReadRAS(Graphic & rGraphic)
+sal_Bool RASReader::ReadRAS(Graphic & rGraphic)
{
- UINT32 nMagicNumber;
+ sal_uInt32 nMagicNumber;
if ( m_rRAS.GetError() )
- return FALSE;
+ return sal_False;
m_rRAS.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
m_rRAS >> nMagicNumber;
if ( nMagicNumber != SUNRASTER_MAGICNUMBER )
- return FALSE;
+ return sal_False;
// Kopf einlesen:
- if ( ( mbStatus = ImplReadHeader() ) == FALSE )
- return FALSE;
+ if ( ( mbStatus = ImplReadHeader() ) == sal_False )
+ return sal_False;
maBmp = Bitmap( Size( mnWidth, mnHeight ), mnDstBitsPerPix );
- if ( ( mpAcc = maBmp.AcquireWriteAccess() ) == FALSE )
- return FALSE;
+ if ( ( mpAcc = maBmp.AcquireWriteAccess() ) == sal_False )
+ return sal_False;
if ( mnDstBitsPerPix <= 8 ) // paletten bildchen
{
if ( mnColorMapType == RAS_COLOR_RAW_MAP ) // RAW Colormap wird geskipped
{
- ULONG nCurPos = m_rRAS.Tell();
+ sal_uLong nCurPos = m_rRAS.Tell();
m_rRAS.Seek( nCurPos + mnColorMapSize );
}
else if ( mnColorMapType == RAS_COLOR_RGB_MAP ) // RGB koennen wir auslesen
{
- mnDstColors = (USHORT)( mnColorMapSize / 3 );
+ mnDstColors = (sal_uInt16)( mnColorMapSize / 3 );
if ( ( 1 << mnDstBitsPerPix ) < mnDstColors )
- return FALSE;
+ return sal_False;
if ( ( mnDstColors >= 2 ) && ( ( mnColorMapSize % 3 ) == 0 ) )
{
mpAcc->SetPaletteEntryCount( mnDstColors );
- USHORT i;
- BYTE nRed[256], nGreen[256], nBlue[256];
+ sal_uInt16 i;
+ sal_uInt8 nRed[256], nGreen[256], nBlue[256];
for ( i = 0; i < mnDstColors; i++ ) m_rRAS >> nRed[ i ];
for ( i = 0; i < mnDstColors; i++ ) m_rRAS >> nGreen[ i ];
for ( i = 0; i < mnDstColors; i++ ) m_rRAS >> nBlue[ i ];
@@ -137,23 +137,23 @@ BOOL RASReader::ReadRAS(Graphic & rGraphic)
{
mpAcc->SetPaletteColor( i, BitmapColor( nRed[ i ], nGreen[ i ], nBlue[ i ] ) );
}
- mbPalette = TRUE;
+ mbPalette = sal_True;
}
else
- return FALSE;
+ return sal_False;
}
else if ( mnColorMapType != RAS_COLOR_NO_MAP ) // alles andere ist kein standard
- return FALSE;
+ return sal_False;
if ( !mbPalette )
{
mnDstColors = 1 << mnDstBitsPerPix;
mpAcc->SetPaletteEntryCount( mnDstColors );
- for ( USHORT i = 0; i < mnDstColors; i++ )
+ for ( sal_uInt16 i = 0; i < mnDstColors; i++ )
{
- ULONG nCount = 255 - ( 255 * i / ( mnDstColors - 1 ) );
- mpAcc->SetPaletteColor( i, BitmapColor( (BYTE)nCount, (BYTE)nCount, (BYTE)nCount ) );
+ sal_uLong nCount = 255 - ( 255 * i / ( mnDstColors - 1 ) );
+ mpAcc->SetPaletteColor( i, BitmapColor( (sal_uInt8)nCount, (sal_uInt8)nCount, (sal_uInt8)nCount ) );
}
}
}
@@ -161,7 +161,7 @@ BOOL RASReader::ReadRAS(Graphic & rGraphic)
{
if ( mnColorMapType != RAS_COLOR_NO_MAP ) // when graphic has more then 256 colors and a color map we skip
{ // the colormap
- ULONG nCurPos = m_rRAS.Tell();
+ sal_uLong nCurPos = m_rRAS.Tell();
m_rRAS.Seek( nCurPos + mnColorMapSize );
}
}
@@ -181,27 +181,27 @@ BOOL RASReader::ReadRAS(Graphic & rGraphic)
//----------------------------------------------------------------------------
-BOOL RASReader::ImplReadHeader()
+sal_Bool RASReader::ImplReadHeader()
{
m_rRAS >> mnWidth >> mnHeight >> mnDepth >> mnImageDatSize >>
mnType >> mnColorMapType >> mnColorMapSize;
if ( mnWidth == 0 || mnHeight == 0 )
- mbStatus = FALSE;
+ mbStatus = sal_False;
switch ( mnDepth )
{
case 24 :
case 8 :
case 1 :
- mnDstBitsPerPix = (USHORT)mnDepth;
+ mnDstBitsPerPix = (sal_uInt16)mnDepth;
break;
case 32 :
mnDstBitsPerPix = 24;
break;
default :
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
switch ( mnType )
@@ -213,18 +213,18 @@ BOOL RASReader::ImplReadHeader()
break;
default:
- mbStatus = FALSE;
+ mbStatus = sal_False;
}
return mbStatus;
}
//----------------------------------------------------------------------------
-BOOL RASReader::ImplReadBody()
+sal_Bool RASReader::ImplReadBody()
{
- ULONG x, y;
- BYTE nDat = 0;
- BYTE nRed, nGreen, nBlue;
+ sal_uLong x, y;
+ sal_uInt8 nDat = 0;
+ sal_uInt8 nRed, nGreen, nBlue;
switch ( mnDstBitsPerPix )
{
case 1 :
@@ -236,7 +236,7 @@ BOOL RASReader::ImplReadBody()
nDat = ImplGetByte();
mpAcc->SetPixel (
y, x,
- sal::static_int_cast< BYTE >(
+ sal::static_int_cast< sal_uInt8 >(
nDat >> ( ( x & 7 ) ^ 7 )) );
}
if (!( ( x - 1 ) & 0x8 ) ) ImplGetByte(); // WORD ALIGNMENT ???
@@ -308,7 +308,7 @@ BOOL RASReader::ImplReadBody()
break;
default:
- mbStatus = FALSE;
+ mbStatus = sal_False;
break;
}
return mbStatus;
@@ -316,9 +316,9 @@ BOOL RASReader::ImplReadBody()
//----------------------------------------------------------------------------
-BYTE RASReader::ImplGetByte()
+sal_uInt8 RASReader::ImplGetByte()
{
- BYTE nRetVal;
+ sal_uInt8 nRetVal;
if ( mnType != RAS_TYPE_BYTE_ENCODED )
{
m_rRAS >> nRetVal;
@@ -348,36 +348,11 @@ BYTE RASReader::ImplGetByte()
//================== GraphicImport - die exportierte Funktion ================
-extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool )
{
RASReader aRASReader(rStream);
return aRASReader.ReadRAS(rGraphic );
}
-//================== ein bischen Muell fuer Windows ==========================
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/itga/itga.cxx b/filter/source/graphicfilter/itga/itga.cxx
index f7cd1b1e3734..590afe0efc55 100644
--- a/filter/source/graphicfilter/itga/itga.cxx
+++ b/filter/source/graphicfilter/itga/itga.cxx
@@ -37,53 +37,53 @@
struct TGAFileHeader
{
- BYTE nImageIDLength;
- BYTE nColorMapType;
- BYTE nImageType;
- UINT16 nColorMapFirstEntryIndex;
- UINT16 nColorMapLength;
- BYTE nColorMapEntrySize;
- UINT16 nColorMapXOrigin;
- UINT16 nColorMapYOrigin;
- UINT16 nImageWidth;
- UINT16 nImageHeight;
- BYTE nPixelDepth;
- BYTE nImageDescriptor;
+ sal_uInt8 nImageIDLength;
+ sal_uInt8 nColorMapType;
+ sal_uInt8 nImageType;
+ sal_uInt16 nColorMapFirstEntryIndex;
+ sal_uInt16 nColorMapLength;
+ sal_uInt8 nColorMapEntrySize;
+ sal_uInt16 nColorMapXOrigin;
+ sal_uInt16 nColorMapYOrigin;
+ sal_uInt16 nImageWidth;
+ sal_uInt16 nImageHeight;
+ sal_uInt8 nPixelDepth;
+ sal_uInt8 nImageDescriptor;
};
#define SizeOfTGAFileFooter 26
struct TGAFileFooter
{
- UINT32 nExtensionFileOffset;
- UINT32 nDeveloperDirectoryOffset;
- UINT32 nSignature[4];
- BYTE nPadByte;
- BYTE nStringTerminator;
+ sal_uInt32 nExtensionFileOffset;
+ sal_uInt32 nDeveloperDirectoryOffset;
+ sal_uInt32 nSignature[4];
+ sal_uInt8 nPadByte;
+ sal_uInt8 nStringTerminator;
};
#define SizeOfTGAExtension 495
struct TGAExtension
{
- UINT16 nExtensionSize;
+ sal_uInt16 nExtensionSize;
char sAuthorName[41];
char sAuthorComment[324];
char sDateTimeStamp[12];
char sJobNameID[41];
- UINT16 nJobTime[3];
+ sal_uInt16 nJobTime[3];
char sSoftwareID[41];
- UINT16 nSoftwareVersionNumber;
- BYTE nSoftwareVersionLetter;
- UINT32 nKeyColor;
- UINT16 nPixelAspectRatioNumerator;
- UINT16 nPixelAspectRatioDeNumerator;
- UINT16 nGammaValueNumerator;
- UINT16 nGammaValueDeNumerator;
- UINT32 nColorCorrectionOffset;
- UINT32 nPostageStampOffset;
- UINT32 nScanLineOffset;
- BYTE nAttributesType;
+ sal_uInt16 nSoftwareVersionNumber;
+ sal_uInt8 nSoftwareVersionLetter;
+ sal_uInt32 nKeyColor;
+ sal_uInt16 nPixelAspectRatioNumerator;
+ sal_uInt16 nPixelAspectRatioDeNumerator;
+ sal_uInt16 nGammaValueNumerator;
+ sal_uInt16 nGammaValueDeNumerator;
+ sal_uInt32 nColorCorrectionOffset;
+ sal_uInt32 nPostageStampOffset;
+ sal_uInt32 nScanLineOffset;
+ sal_uInt8 nAttributesType;
};
class TGAReader {
@@ -96,23 +96,23 @@ private:
TGAFileHeader* mpFileHeader;
TGAFileFooter* mpFileFooter;
TGAExtension* mpExtension;
- UINT32* mpColorMap;
+ sal_uInt32* mpColorMap;
- BOOL mbStatus;
+ sal_Bool mbStatus;
- ULONG mnTGAVersion; // Enhanced TGA is defined as Version 2.0
- UINT16 mnDestBitDepth;
- BOOL mbIndexing; // TRUE if source contains indexing color values
- BOOL mbEncoding; // TRUE if source is compressed
+ sal_uLong mnTGAVersion; // Enhanced TGA is defined as Version 2.0
+ sal_uInt16 mnDestBitDepth;
+ sal_Bool mbIndexing; // sal_True if source contains indexing color values
+ sal_Bool mbEncoding; // sal_True if source is compressed
- BOOL ImplReadHeader();
- BOOL ImplReadPalette();
- BOOL ImplReadBody();
+ sal_Bool ImplReadHeader();
+ sal_Bool ImplReadPalette();
+ sal_Bool ImplReadBody();
public:
TGAReader(SvStream &rTGA);
~TGAReader();
- BOOL ReadTGA(Graphic &rGraphic);
+ sal_Bool ReadTGA(Graphic &rGraphic);
};
//=================== Methoden von TGAReader ==============================
@@ -124,10 +124,10 @@ TGAReader::TGAReader(SvStream &rTGA)
, mpFileFooter(NULL)
, mpExtension(NULL)
, mpColorMap(NULL)
- , mbStatus(TRUE)
+ , mbStatus(sal_True)
, mnTGAVersion(1)
- , mbIndexing(FALSE)
- , mbEncoding(FALSE)
+ , mbIndexing(sal_False)
+ , mbEncoding(sal_False)
{
}
@@ -141,10 +141,10 @@ TGAReader::~TGAReader()
// -------------------------------------------------------------------------------------------
-BOOL TGAReader::ReadTGA(Graphic & rGraphic)
+sal_Bool TGAReader::ReadTGA(Graphic & rGraphic)
{
if ( m_rTGA.GetError() )
- return FALSE;
+ return sal_False;
m_rTGA.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -167,7 +167,7 @@ BOOL TGAReader::ReadTGA(Graphic & rGraphic)
mbStatus = ImplReadBody();
}
else
- mbStatus = FALSE;
+ mbStatus = sal_False;
if ( mpAcc )
aBitmap.ReleaseAccess ( mpAcc), mpAcc = NULL;
@@ -181,11 +181,11 @@ BOOL TGAReader::ReadTGA(Graphic & rGraphic)
// -------------------------------------------------------------------------------------------
-BOOL TGAReader::ImplReadHeader()
+sal_Bool TGAReader::ImplReadHeader()
{
mpFileHeader = new TGAFileHeader;
if ( mpFileHeader == NULL )
- return FALSE;
+ return sal_False;
m_rTGA >> mpFileHeader->nImageIDLength >> mpFileHeader->nColorMapType >> mpFileHeader->nImageType >>
mpFileHeader->nColorMapFirstEntryIndex >> mpFileHeader->nColorMapLength >> mpFileHeader->nColorMapEntrySize >>
@@ -193,24 +193,24 @@ BOOL TGAReader::ImplReadHeader()
mpFileHeader->nImageHeight >> mpFileHeader->nPixelDepth >> mpFileHeader->nImageDescriptor;
if ( mpFileHeader->nColorMapType > 1 )
- return FALSE;
+ return sal_False;
if ( mpFileHeader->nColorMapType == 1 )
- mbIndexing = TRUE;
+ mbIndexing = sal_True;
// first we want to get the version
mpFileFooter = new TGAFileFooter; // read the TGA-File-Footer to determine whether
if ( mpFileFooter ) // we got an old TGA format or the new one
{
- ULONG nCurStreamPos = m_rTGA.Tell();
+ sal_uLong nCurStreamPos = m_rTGA.Tell();
m_rTGA.Seek( STREAM_SEEK_TO_END );
- ULONG nTemp = m_rTGA.Tell();
+ sal_uLong nTemp = m_rTGA.Tell();
m_rTGA.Seek( nTemp - SizeOfTGAFileFooter );
m_rTGA >> mpFileFooter->nExtensionFileOffset >> mpFileFooter->nDeveloperDirectoryOffset >>
mpFileFooter->nSignature[0] >> mpFileFooter->nSignature[1] >> mpFileFooter->nSignature[2] >>
mpFileFooter->nSignature[3] >> mpFileFooter->nPadByte >> mpFileFooter->nStringTerminator;
- // check for TRUE, VISI, ON-X, FILE in the signatures
+ // check for sal_True, VISI, ON-X, FILE in the signatures
if ( mpFileFooter->nSignature[ 0 ] == (('T'<<24)|('R'<<16)|('U'<<8)|'E') &&
mpFileFooter->nSignature[ 1 ] == (('V'<<24)|('I'<<16)|('S'<<8)|'I') &&
mpFileFooter->nSignature[ 2 ] == (('O'<<24)|('N'<<16)|('-'<<8)|'X') &&
@@ -250,10 +250,10 @@ BOOL TGAReader::ImplReadHeader()
mnDestBitDepth = mpFileHeader->nPixelDepth;
if ( mnDestBitDepth == 8 ) // this is a patch for grayscale pictures not including a palette
- mbIndexing = TRUE;
+ mbIndexing = sal_True;
if ( mnDestBitDepth > 32 ) // maybe the pixeldepth is invalid
- return FALSE;
+ return sal_False;
else if ( mnDestBitDepth > 8 )
mnDestBitDepth = 24;
else if ( mnDestBitDepth > 4 )
@@ -262,14 +262,14 @@ BOOL TGAReader::ImplReadHeader()
mnDestBitDepth = 4;
if ( !mbIndexing && ( mnDestBitDepth < 15 ) )
- return FALSE;
+ return sal_False;
switch ( mpFileHeader->nImageType )
{
case 9 : // encoding for colortype 9, 10, 11
case 10 :
case 11 :
- mbEncoding = TRUE;
+ mbEncoding = sal_True;
break;
};
@@ -281,11 +281,11 @@ BOOL TGAReader::ImplReadHeader()
// -------------------------------------------------------------------------------------------
-BOOL TGAReader::ImplReadBody()
+sal_Bool TGAReader::ImplReadBody()
{
- USHORT nXCount, nYCount, nRGB16;
- BYTE nRed, nGreen, nBlue, nRunCount, nDummy, nDepth;
+ sal_uInt16 nXCount, nYCount, nRGB16;
+ sal_uInt8 nRed, nGreen, nBlue, nRunCount, nDummy, nDepth;
// this four variables match the image direction
long nY, nYAdd, nX, nXAdd, nXStart;
@@ -324,11 +324,11 @@ BOOL TGAReader::ImplReadBody()
{
m_rTGA >> nRGB16;
if ( nRGB16 >= mpFileHeader->nColorMapLength )
- return FALSE;
- nRed = (BYTE)( mpColorMap[ nRGB16 ] >> 16 );
- nGreen = (BYTE)( mpColorMap[ nRGB16 ] >> 8 );
- nBlue = (BYTE)( mpColorMap[ nRGB16 ] );
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ return sal_False;
+ nRed = (sal_uInt8)( mpColorMap[ nRGB16 ] >> 16 );
+ nGreen = (sal_uInt8)( mpColorMap[ nRGB16 ] >> 8 );
+ nBlue = (sal_uInt8)( mpColorMap[ nRGB16 ] );
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
mpAcc->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) );
nX += nXAdd;
@@ -347,14 +347,14 @@ BOOL TGAReader::ImplReadBody()
}
else // a raw packet
{
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
m_rTGA >> nRGB16;
if ( nRGB16 >= mpFileHeader->nColorMapLength )
- return FALSE;
- nRed = (BYTE)( mpColorMap[ nRGB16 ] >> 16 );
- nGreen = (BYTE)( mpColorMap[ nRGB16 ] >> 8 );
- nBlue = (BYTE)( mpColorMap[ nRGB16 ] );
+ return sal_False;
+ nRed = (sal_uInt8)( mpColorMap[ nRGB16 ] >> 16 );
+ nGreen = (sal_uInt8)( mpColorMap[ nRGB16 ] >> 8 );
+ nBlue = (sal_uInt8)( mpColorMap[ nRGB16 ] );
mpAcc->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) );
nX += nXAdd;
nXCount++;
@@ -382,10 +382,10 @@ BOOL TGAReader::ImplReadBody()
{
m_rTGA >> nDummy;
if ( nDummy >= mpFileHeader->nColorMapLength )
- return FALSE;
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ return sal_False;
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
- mpAcc->SetPixel( nY, nX, (BYTE)nDummy );
+ mpAcc->SetPixel( nY, nX, (sal_uInt8)nDummy );
nX += nXAdd;
nXCount++;
if ( nXCount == mpFileHeader->nImageWidth )
@@ -402,13 +402,13 @@ BOOL TGAReader::ImplReadBody()
}
else // a raw packet
{
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
m_rTGA >> nDummy;
if ( nDummy >= mpFileHeader->nColorMapLength )
- return FALSE;
- mpAcc->SetPixel( nY, nX, (BYTE)nDummy );
+ return sal_False;
+ mpAcc->SetPixel( nY, nX, (sal_uInt8)nDummy );
nX += nXAdd;
nXCount++;
if ( nXCount == mpFileHeader->nImageWidth )
@@ -426,7 +426,7 @@ BOOL TGAReader::ImplReadBody()
}
break;
default:
- return FALSE;
+ return sal_False;
}
}
else
@@ -442,7 +442,7 @@ BOOL TGAReader::ImplReadBody()
if ( nRunCount & 0x80 ) // a run length packet
{
m_rTGA >> nBlue >> nGreen >> nRed >> nDummy;
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
mpAcc->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) );
nX += nXAdd;
@@ -461,7 +461,7 @@ BOOL TGAReader::ImplReadBody()
}
else // a raw packet
{
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
m_rTGA >> nBlue >> nGreen >> nRed >> nDummy;
mpAcc->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) );
@@ -491,7 +491,7 @@ BOOL TGAReader::ImplReadBody()
if ( nRunCount & 0x80 ) // a run length packet
{
m_rTGA >> nBlue >> nGreen >> nRed;
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
mpAcc->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) );
nX += nXAdd;
@@ -510,7 +510,7 @@ BOOL TGAReader::ImplReadBody()
}
else // a raw packet
{
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
m_rTGA >> nBlue >> nGreen >> nRed;
mpAcc->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) );
@@ -539,10 +539,10 @@ BOOL TGAReader::ImplReadBody()
if ( nRunCount & 0x80 ) // a run length packet
{
m_rTGA >> nRGB16;
- nRed = (BYTE)( nRGB16 >> 7 ) & 0xf8;
- nGreen = (BYTE)( nRGB16 >> 2 ) & 0xf8;
- nBlue = (BYTE)( nRGB16 << 3 ) & 0xf8;
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ nRed = (sal_uInt8)( nRGB16 >> 7 ) & 0xf8;
+ nGreen = (sal_uInt8)( nRGB16 >> 2 ) & 0xf8;
+ nBlue = (sal_uInt8)( nRGB16 << 3 ) & 0xf8;
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
mpAcc->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) );
nX += nXAdd;
@@ -561,12 +561,12 @@ BOOL TGAReader::ImplReadBody()
}
else // a raw packet
{
- for ( USHORT i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
+ for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
{
m_rTGA >> nRGB16;
- nRed = (BYTE)( nRGB16 >> 7 ) & 0xf8;
- nGreen = (BYTE)( nRGB16 >> 2 ) & 0xf8;
- nBlue = (BYTE)( nRGB16 << 3 ) & 0xf8;
+ nRed = (sal_uInt8)( nRGB16 >> 7 ) & 0xf8;
+ nGreen = (sal_uInt8)( nRGB16 >> 2 ) & 0xf8;
+ nBlue = (sal_uInt8)( nRGB16 << 3 ) & 0xf8;
mpAcc->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) );
nX += nXAdd;
nXCount++;
@@ -586,7 +586,7 @@ BOOL TGAReader::ImplReadBody()
break;
default:
- return FALSE;
+ return sal_False;
}
}
}
@@ -607,10 +607,10 @@ BOOL TGAReader::ImplReadBody()
{
m_rTGA >> nRGB16;
if ( nRGB16 >= mpFileHeader->nColorMapLength )
- return FALSE;
- nRed = (BYTE)( mpColorMap[ nRGB16 ] >> 16 );
- nGreen = (BYTE)( mpColorMap[ nRGB16 ] >> 8 );
- nBlue = (BYTE)( mpColorMap[ nRGB16 ] );
+ return sal_False;
+ nRed = (sal_uInt8)( mpColorMap[ nRGB16 ] >> 16 );
+ nGreen = (sal_uInt8)( mpColorMap[ nRGB16 ] >> 8 );
+ nBlue = (sal_uInt8)( mpColorMap[ nRGB16 ] );
mpAcc->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) );
}
break;
@@ -621,12 +621,12 @@ BOOL TGAReader::ImplReadBody()
{
m_rTGA >> nDummy;
if ( nDummy >= mpFileHeader->nColorMapLength )
- return FALSE;
- mpAcc->SetPixel( nY, nX, (BYTE)nDummy );
+ return sal_False;
+ mpAcc->SetPixel( nY, nX, (sal_uInt8)nDummy );
}
break;
default:
- return FALSE;
+ return sal_False;
}
}
else
@@ -658,14 +658,14 @@ BOOL TGAReader::ImplReadBody()
for (;nXCount < mpFileHeader->nImageWidth; nXCount++, nX += nXAdd )
{
m_rTGA >> nRGB16;
- nRed = (BYTE)( nRGB16 >> 7 ) & 0xf8;
- nGreen = (BYTE)( nRGB16 >> 2 ) & 0xf8;
- nBlue = (BYTE)( nRGB16 << 3 ) & 0xf8;
+ nRed = (sal_uInt8)( nRGB16 >> 7 ) & 0xf8;
+ nGreen = (sal_uInt8)( nRGB16 >> 2 ) & 0xf8;
+ nBlue = (sal_uInt8)( nRGB16 << 3 ) & 0xf8;
mpAcc->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) );
}
break;
default:
- return FALSE;
+ return sal_False;
}
}
}
@@ -675,29 +675,29 @@ BOOL TGAReader::ImplReadBody()
// -------------------------------------------------------------------------------------------
-BOOL TGAReader::ImplReadPalette()
+sal_Bool TGAReader::ImplReadPalette()
{
if ( mbIndexing ) // read the colormap
{
- USHORT nColors = mpFileHeader->nColorMapLength;
+ sal_uInt16 nColors = mpFileHeader->nColorMapLength;
if ( !nColors ) // colors == 0 ? -> we will build a grayscale palette
{
if ( mpFileHeader->nPixelDepth != 8 )
- return FALSE;
+ return sal_False;
nColors = 256;
mpFileHeader->nColorMapLength = 256;
mpFileHeader->nColorMapEntrySize = 0x3f; // patch for the following switch routine
}
- mpColorMap = new UINT32[ nColors ]; // we will always index dwords
- if ( mpColorMap == FALSE )
- return FALSE; // out of memory %&!$&/!"�$
+ mpColorMap = new sal_uInt32[ nColors ]; // we will always index dwords
+ if ( mpColorMap == sal_False )
+ return sal_False; // out of memory %&!$&/!"�$
switch( mpFileHeader->nColorMapEntrySize )
{
case 0x3f :
{
- for ( ULONG i = 0; i < nColors; i++ )
+ for ( sal_uLong i = 0; i < nColors; i++ )
{
mpColorMap[ i ] = ( i << 16 ) + ( i << 8 ) + i;
}
@@ -710,7 +710,7 @@ BOOL TGAReader::ImplReadPalette()
case 24 :
{
- for ( ULONG i = 0; i < nColors; i++ )
+ for ( sal_uLong i = 0; i < nColors; i++ )
{
m_rTGA.Read( &mpColorMap[ i ], 3 );
}
@@ -720,9 +720,9 @@ BOOL TGAReader::ImplReadPalette()
case 15 :
case 16 :
{
- for ( ULONG i = 0; i < nColors; i++ )
+ for ( sal_uLong i = 0; i < nColors; i++ )
{
- UINT16 nTemp;
+ sal_uInt16 nTemp;
m_rTGA >> nTemp;
mpColorMap[ i ] = ( ( nTemp & 0x7c00 ) << 9 ) + ( ( nTemp & 0x01e0 ) << 6 ) +
( ( nTemp & 0x1f ) << 3 );
@@ -731,19 +731,19 @@ BOOL TGAReader::ImplReadPalette()
break;
default :
- return FALSE;
+ return sal_False;
}
if ( mnDestBitDepth <= 8 )
{
- USHORT nDestColors = ( 1 << mnDestBitDepth );
+ sal_uInt16 nDestColors = ( 1 << mnDestBitDepth );
if ( nColors > nDestColors )
- return FALSE;
+ return sal_False;
mpAcc->SetPaletteEntryCount( nColors );
- for ( USHORT i = 0; i < nColors; i++ )
+ for ( sal_uInt16 i = 0; i < nColors; i++ )
{
- mpAcc->SetPaletteColor( i, Color( (BYTE)( mpColorMap[ i ] >> 16 ),
- (BYTE)( mpColorMap[ i ] >> 8 ), (BYTE)(mpColorMap[ i ] ) ) );
+ mpAcc->SetPaletteColor( i, Color( (sal_uInt8)( mpColorMap[ i ] >> 16 ),
+ (sal_uInt8)( mpColorMap[ i ] >> 8 ), (sal_uInt8)(mpColorMap[ i ] ) ) );
}
}
}
@@ -753,36 +753,11 @@ BOOL TGAReader::ImplReadPalette()
//================== GraphicImport - die exportierte Funktion ================
-extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool )
{
TGAReader aTGAReader(rStream);
return aTGAReader.ReadTGA(rGraphic);
}
-//================== ein bischen Muell fuer Windows ==========================
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
-
- return TRUE;
-}
-
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx b/filter/source/graphicfilter/itiff/ccidecom.cxx
index cb1c2f520746..ca82babda539 100644
--- a/filter/source/graphicfilter/itiff/ccidecom.cxx
+++ b/filter/source/graphicfilter/itiff/ccidecom.cxx
@@ -579,9 +579,9 @@ const CCIHuffmanTableEntry CCIUncompTableSave[CCIUncompTableSize]={
//=========================================================================
-CCIDecompressor::CCIDecompressor( ULONG nOpts, UINT32 nImageWidth ) :
- bTableBad ( FALSE ),
- bStatus ( FALSE ),
+CCIDecompressor::CCIDecompressor( sal_uLong nOpts, sal_uInt32 nImageWidth ) :
+ bTableBad ( sal_False ),
+ bStatus ( sal_False ),
pByteSwap ( NULL ),
nWidth ( nImageWidth ),
nOptions ( nOpts ),
@@ -589,10 +589,10 @@ CCIDecompressor::CCIDecompressor( ULONG nOpts, UINT32 nImageWidth ) :
{
if ( nOpts & CCI_OPTION_INVERSEBITORDER )
{
- pByteSwap = new BYTE[ 256 ];
+ pByteSwap = new sal_uInt8[ 256 ];
for ( int i = 0; i < 256; i++ )
{
- pByteSwap[ i ] = sal::static_int_cast< BYTE >(
+ pByteSwap[ i ] = sal::static_int_cast< sal_uInt8 >(
( i << 7 ) | ( ( i & 2 ) << 5 ) | ( ( i & 4 ) << 3 ) | ( ( i & 8 ) << 1 ) |
( ( i & 16 ) >> 1 ) | ( ( i & 32 ) >> 3 ) | ( ( i & 64 ) >> 5 ) | ( ( i & 128 ) >> 7 ));
}
@@ -625,26 +625,26 @@ void CCIDecompressor::StartDecompression( SvStream & rIStream )
{
pIStream = &rIStream;
nInputBitsBufSize = 0;
- bFirstEOL = TRUE;
- bStatus = TRUE;
+ bFirstEOL = sal_True;
+ bStatus = sal_True;
nEOLCount = 0;
- if ( bTableBad == TRUE )
+ if ( bTableBad == sal_True )
return;
}
-BOOL CCIDecompressor::DecompressScanline( BYTE * pTarget, ULONG nTargetBits )
+sal_Bool CCIDecompressor::DecompressScanline( sal_uInt8 * pTarget, sal_uLong nTargetBits )
{
- USHORT i;
- BYTE * pSrc,* pDst;
- BOOL b2D;
+ sal_uInt16 i;
+ sal_uInt8 * pSrc,* pDst;
+ sal_Bool b2D;
if ( nEOLCount >= 5 ) // RTC( Return To Controller )
- return TRUE;
+ return sal_True;
- if ( bStatus == FALSE )
- return FALSE;
+ if ( bStatus == sal_False )
+ return sal_False;
// Wenn EOL-Codes vorhanden sind, steht der EOL-Code auch vor der ersten Zeile.
// (und ich dachte EOL heisst 'End Of Line'...)
@@ -653,21 +653,21 @@ BOOL CCIDecompressor::DecompressScanline( BYTE * pTarget, ULONG nTargetBits )
{
if ( bFirstEOL )
{
- UINT32 nCurPos = pIStream->Tell();
- UINT16 nOldInputBitsBufSize = nInputBitsBufSize;
- UINT32 nOldInputBitsBuf = nInputBitsBuf;
- if ( ReadEOL( 32 ) == FALSE )
+ sal_uInt32 nCurPos = pIStream->Tell();
+ sal_uInt16 nOldInputBitsBufSize = nInputBitsBufSize;
+ sal_uInt32 nOldInputBitsBuf = nInputBitsBuf;
+ if ( ReadEOL( 32 ) == sal_False )
{
nInputBitsBufSize = nOldInputBitsBufSize;
nInputBitsBuf = nOldInputBitsBuf;
pIStream->Seek( nCurPos );
nOptions &=~ CCI_OPTION_EOL; // CCITT Group 3 - Compression Type 2
}
- bFirstEOL = FALSE;
+ bFirstEOL = sal_False;
}
else
{
- if ( ReadEOL( nTargetBits ) == FALSE )
+ if ( ReadEOL( nTargetBits ) == sal_False )
{
return bStatus;
}
@@ -675,7 +675,7 @@ BOOL CCIDecompressor::DecompressScanline( BYTE * pTarget, ULONG nTargetBits )
}
if ( nEOLCount >= 5 ) // RTC( Return To Controller )
- return TRUE;
+ return sal_True;
// ggf. eine weisse vorherige Zeile herstellen fuer 2D:
if ( nOptions & CCI_OPTION_2D )
@@ -685,7 +685,7 @@ BOOL CCIDecompressor::DecompressScanline( BYTE * pTarget, ULONG nTargetBits )
if ( pLastLine == NULL )
delete[] pLastLine;
nLastLineSize = ( nTargetBits + 7 ) >> 3;
- pLastLine = new BYTE[ nLastLineSize ];
+ pLastLine = new sal_uInt8[ nLastLineSize ];
pDst = pLastLine;
for ( i = 0; i < nLastLineSize; i++ ) *( pDst++ ) = 0x00;
}
@@ -700,19 +700,19 @@ BOOL CCIDecompressor::DecompressScanline( BYTE * pTarget, ULONG nTargetBits )
if ( nOptions & CCI_OPTION_EOL )
b2D = Read2DTag();
else
- b2D = TRUE;
+ b2D = sal_True;
}
else
- b2D = FALSE;
+ b2D = sal_False;
// Zeile einlesen:
if ( b2D )
- Read2DScanlineData( pTarget, (USHORT)nTargetBits );
+ Read2DScanlineData( pTarget, (sal_uInt16)nTargetBits );
else
- Read1DScanlineData( pTarget, (USHORT)nTargetBits );
+ Read1DScanlineData( pTarget, (sal_uInt16)nTargetBits );
// Wenn wir im 2D-Modus sind, muessen wir uns die Zeile merken:
- if ( nOptions & CCI_OPTION_2D && bStatus == TRUE )
+ if ( nOptions & CCI_OPTION_2D && bStatus == sal_True )
{
pSrc = pTarget;
pDst = pLastLine;
@@ -720,7 +720,7 @@ BOOL CCIDecompressor::DecompressScanline( BYTE * pTarget, ULONG nTargetBits )
}
if ( pIStream->GetError() )
- bStatus = FALSE;
+ bStatus = sal_False;
return bStatus;
}
@@ -729,12 +729,12 @@ BOOL CCIDecompressor::DecompressScanline( BYTE * pTarget, ULONG nTargetBits )
void CCIDecompressor::MakeLookUp(const CCIHuffmanTableEntry * pHufTab,
const CCIHuffmanTableEntry * pHufTabSave,
CCILookUpTableEntry * pLookUp,
- USHORT nHuffmanTableSize,
- USHORT nMaxCodeBits)
+ sal_uInt16 nHuffmanTableSize,
+ sal_uInt16 nMaxCodeBits)
{
- USHORT i,j,nMinCode,nMaxCode,nLookUpSize,nMask;
+ sal_uInt16 i,j,nMinCode,nMaxCode,nLookUpSize,nMask;
- if (bTableBad==TRUE) return;
+ if (bTableBad==sal_True) return;
nLookUpSize=1<<nMaxCodeBits;
@@ -748,14 +748,14 @@ void CCIDecompressor::MakeLookUp(const CCIHuffmanTableEntry * pHufTab,
pHufTab[i].nCodeBits==0 ||
pHufTab[i].nCodeBits>nMaxCodeBits )
{
- bTableBad=TRUE;
+ bTableBad=sal_True;
return;
}
nMinCode = nMask & (pHufTab[i].nCode << (nMaxCodeBits-pHufTab[i].nCodeBits));
nMaxCode = nMinCode | (nMask >> pHufTab[i].nCodeBits);
for (j=nMinCode; j<=nMaxCode; j++) {
if (pLookUp[j].nCodeBits!=0) {
- bTableBad=TRUE;
+ bTableBad=sal_True;
return;
}
pLookUp[j].nValue=pHufTab[i].nValue;
@@ -765,10 +765,10 @@ void CCIDecompressor::MakeLookUp(const CCIHuffmanTableEntry * pHufTab,
}
-BOOL CCIDecompressor::ReadEOL( UINT32 /*nMaxFillBits*/ )
+sal_Bool CCIDecompressor::ReadEOL( sal_uInt32 /*nMaxFillBits*/ )
{
- USHORT nCode;
- BYTE nByte;
+ sal_uInt16 nCode;
+ sal_uInt8 nByte;
// if (nOptions&CCI_OPTION_BYTEALIGNEOL) nMaxFillBits=7; else nMaxFillBits=0;
// Buuuh: Entweder wird die Option in itiff.cxx nicht richtig gesetzt (-> Fehler in Doku)
@@ -778,7 +778,7 @@ BOOL CCIDecompressor::ReadEOL( UINT32 /*nMaxFillBits*/ )
// bis zu 32-Bloedsinn-Bits vor dem EOL-Code:
// und ich habe eine Datei gefunden in der bis zu ??? Bloedsinn Bits stehen, zudem ist dort die Bit Reihenfolge verdreht (SJ);
- UINT32 nMaxPos = pIStream->Tell();
+ sal_uInt32 nMaxPos = pIStream->Tell();
nMaxPos += nWidth >> 3;
for ( ;; )
@@ -787,16 +787,16 @@ BOOL CCIDecompressor::ReadEOL( UINT32 /*nMaxFillBits*/ )
{
*pIStream >> nByte;
if ( pIStream->IsEof() )
- return FALSE;
+ return sal_False;
if ( pIStream->Tell() > nMaxPos )
- return FALSE;
+ return sal_False;
if ( nOptions & CCI_OPTION_INVERSEBITORDER )
nByte = pByteSwap[ nByte ];
- nInputBitsBuf=(nInputBitsBuf<<8) | (ULONG)nByte;
+ nInputBitsBuf=(nInputBitsBuf<<8) | (sal_uLong)nByte;
nInputBitsBufSize += 8;
}
- nCode = (USHORT)( ( nInputBitsBuf >> ( nInputBitsBufSize - 12 ) ) & 0x0fff );
+ nCode = (sal_uInt16)( ( nInputBitsBuf >> ( nInputBitsBufSize - 12 ) ) & 0x0fff );
if ( nCode == 0x0001 )
{
nEOLCount++;
@@ -806,38 +806,38 @@ BOOL CCIDecompressor::ReadEOL( UINT32 /*nMaxFillBits*/ )
else
nInputBitsBufSize--;
}
- return TRUE;
+ return sal_True;
}
-BOOL CCIDecompressor::Read2DTag()
+sal_Bool CCIDecompressor::Read2DTag()
{
- BYTE nByte;
+ sal_uInt8 nByte;
- // Ein Bit einlesen und TRUE liefern, wenn es 0 ist, sonst FALSE
+ // Ein Bit einlesen und sal_True liefern, wenn es 0 ist, sonst sal_False
if (nInputBitsBufSize==0) {
*pIStream >> nByte;
if ( nOptions & CCI_OPTION_INVERSEBITORDER )
nByte = pByteSwap[ nByte ];
- nInputBitsBuf=(ULONG)nByte;
+ nInputBitsBuf=(sal_uLong)nByte;
nInputBitsBufSize=8;
}
nInputBitsBufSize--;
- if ( ((nInputBitsBuf>>nInputBitsBufSize)&0x0001) ) return FALSE;
- else return TRUE;
+ if ( ((nInputBitsBuf>>nInputBitsBufSize)&0x0001) ) return sal_False;
+ else return sal_True;
}
-BYTE CCIDecompressor::ReadBlackOrWhite()
+sal_uInt8 CCIDecompressor::ReadBlackOrWhite()
{
- BYTE nByte;
+ sal_uInt8 nByte;
// Ein Bit einlesen und 0x00 liefern, wenn es 0 ist, sonst 0xff
if (nInputBitsBufSize==0) {
*pIStream >> nByte;
if ( nOptions & CCI_OPTION_INVERSEBITORDER )
nByte = pByteSwap[ nByte ];
- nInputBitsBuf=(ULONG)nByte;
+ nInputBitsBuf=(sal_uLong)nByte;
nInputBitsBufSize=8;
}
nInputBitsBufSize--;
@@ -846,32 +846,32 @@ BYTE CCIDecompressor::ReadBlackOrWhite()
}
-USHORT CCIDecompressor::ReadCodeAndDecode(const CCILookUpTableEntry * pLookUp,
- USHORT nMaxCodeBits)
+sal_uInt16 CCIDecompressor::ReadCodeAndDecode(const CCILookUpTableEntry * pLookUp,
+ sal_uInt16 nMaxCodeBits)
{
- USHORT nCode,nCodeBits;
- BYTE nByte;
+ sal_uInt16 nCode,nCodeBits;
+ sal_uInt8 nByte;
// Einen Huffman-Code einlesen und dekodieren:
while (nInputBitsBufSize<nMaxCodeBits) {
*pIStream >> nByte;
if ( nOptions & CCI_OPTION_INVERSEBITORDER )
nByte = pByteSwap[ nByte ];
- nInputBitsBuf=(nInputBitsBuf<<8) | (ULONG)nByte;
+ nInputBitsBuf=(nInputBitsBuf<<8) | (sal_uLong)nByte;
nInputBitsBufSize+=8;
}
- nCode=(USHORT)((nInputBitsBuf>>(nInputBitsBufSize-nMaxCodeBits))
+ nCode=(sal_uInt16)((nInputBitsBuf>>(nInputBitsBufSize-nMaxCodeBits))
&(0xffff>>(16-nMaxCodeBits)));
nCodeBits=pLookUp[nCode].nCodeBits;
- if (nCodeBits==0) bStatus=FALSE;
+ if (nCodeBits==0) bStatus=sal_False;
nInputBitsBufSize = nInputBitsBufSize - nCodeBits;
return pLookUp[nCode].nValue;
}
-void CCIDecompressor::FillBits(BYTE * pTarget, USHORT nTargetBits,
- USHORT nBitPos, USHORT nNumBits,
- BYTE nBlackOrWhite)
+void CCIDecompressor::FillBits(sal_uInt8 * pTarget, sal_uInt16 nTargetBits,
+ sal_uInt16 nBitPos, sal_uInt16 nNumBits,
+ sal_uInt8 nBlackOrWhite)
{
if ( nBitPos >= nTargetBits )
return;
@@ -894,11 +894,11 @@ void CCIDecompressor::FillBits(BYTE * pTarget, USHORT nTargetBits,
}
-USHORT CCIDecompressor::CountBits(const BYTE * pData, USHORT nDataSizeBits,
- USHORT nBitPos, BYTE nBlackOrWhite)
+sal_uInt16 CCIDecompressor::CountBits(const sal_uInt8 * pData, sal_uInt16 nDataSizeBits,
+ sal_uInt16 nBitPos, sal_uInt8 nBlackOrWhite)
{
- USHORT nPos,nLo;
- BYTE nData;
+ sal_uInt16 nPos,nLo;
+ sal_uInt8 nData;
// Hier wird die Anzahl der zusammenhaengenden Bits gezaehlt, die
// ab Position nBitPos in pTarget alle die Farbe nBlackOrWhite
@@ -923,12 +923,12 @@ USHORT CCIDecompressor::CountBits(const BYTE * pData, USHORT nDataSizeBits,
}
-void CCIDecompressor::Read1DScanlineData(BYTE * pTarget, USHORT nTargetBits)
+void CCIDecompressor::Read1DScanlineData(sal_uInt8 * pTarget, sal_uInt16 nTargetBits)
{
- USHORT nCode,nCodeBits,nDataBits,nTgtFreeByteBits;
- BYTE nByte;
- BYTE nBlackOrWhite; // ist 0xff fuer Black oder 0x00 fuer White
- BOOL bTerminatingCode;
+ sal_uInt16 nCode,nCodeBits,nDataBits,nTgtFreeByteBits;
+ sal_uInt8 nByte;
+ sal_uInt8 nBlackOrWhite; // ist 0xff fuer Black oder 0x00 fuer White
+ sal_Bool bTerminatingCode;
// Der erste Code ist immer eine "White-Code":
nBlackOrWhite=0x00;
@@ -945,10 +945,10 @@ void CCIDecompressor::Read1DScanlineData(BYTE * pTarget, USHORT nTargetBits)
*pIStream >> nByte;
if ( nOptions & CCI_OPTION_INVERSEBITORDER )
nByte = pByteSwap[ nByte ];
- nInputBitsBuf=(nInputBitsBuf<<8) | (ULONG)nByte;
+ nInputBitsBuf=(nInputBitsBuf<<8) | (sal_uLong)nByte;
nInputBitsBufSize+=8;
}
- nCode=(USHORT)((nInputBitsBuf>>(nInputBitsBufSize-13))&0x1fff);
+ nCode=(sal_uInt16)((nInputBitsBuf>>(nInputBitsBufSize-13))&0x1fff);
// Anzahl der DatenBits und Anzahl der CodeBits ermitteln:
if (nBlackOrWhite) {
@@ -977,7 +977,7 @@ void CCIDecompressor::Read1DScanlineData(BYTE * pTarget, USHORT nTargetBits)
}
// Ist es ein 'Terminating-Code' ?
- if (nDataBits<64) bTerminatingCode=TRUE; else bTerminatingCode=FALSE;
+ if (nDataBits<64) bTerminatingCode=sal_True; else bTerminatingCode=sal_False;
// Die gelesenen Bits aus dem Eingabe-Buffer entfernen:
nInputBitsBufSize = nInputBitsBufSize - nCodeBits;
@@ -1010,25 +1010,25 @@ void CCIDecompressor::Read1DScanlineData(BYTE * pTarget, USHORT nTargetBits)
}
// ggf. Umschaltung Black <-> White:
- if (bTerminatingCode==TRUE) nBlackOrWhite=~nBlackOrWhite;
+ if (bTerminatingCode==sal_True) nBlackOrWhite=~nBlackOrWhite;
- } while (nTargetBits>0 || bTerminatingCode==FALSE);
+ } while (nTargetBits>0 || bTerminatingCode==sal_False);
}
-void CCIDecompressor::Read2DScanlineData(BYTE * pTarget, USHORT nTargetBits)
+void CCIDecompressor::Read2DScanlineData(sal_uInt8 * pTarget, sal_uInt16 nTargetBits)
{
- USHORT n2DMode,nBitPos,nUncomp,nRun,nRun2,nt;
- BYTE nBlackOrWhite;
+ sal_uInt16 n2DMode,nBitPos,nUncomp,nRun,nRun2,nt;
+ sal_uInt8 nBlackOrWhite;
nBlackOrWhite=0x00;
nBitPos=0;
- while (nBitPos<nTargetBits && bStatus==TRUE) {
+ while (nBitPos<nTargetBits && bStatus==sal_True) {
n2DMode=ReadCodeAndDecode(p2DModeLookUp,10);
- if (bStatus==FALSE) return;
+ if (bStatus==sal_False) return;
if (n2DMode==CCI2DMODE_UNCOMP) {
for (;;) {
diff --git a/filter/source/graphicfilter/itiff/ccidecom.hxx b/filter/source/graphicfilter/itiff/ccidecom.hxx
index d0191a04fb90..d9ff27c1880a 100644
--- a/filter/source/graphicfilter/itiff/ccidecom.hxx
+++ b/filter/source/graphicfilter/itiff/ccidecom.hxx
@@ -41,16 +41,16 @@
// Eintrag in eine Huffman-Tabelle:
struct CCIHuffmanTableEntry {
- USHORT nValue; // Der Daten-Wert.
- USHORT nCode; // Der Code durch den der Daten-Wert repraesentiert wird.
- USHORT nCodeBits; // Laenge des Codes in Bits.
+ sal_uInt16 nValue; // Der Daten-Wert.
+ sal_uInt16 nCode; // Der Code durch den der Daten-Wert repraesentiert wird.
+ sal_uInt16 nCodeBits; // Laenge des Codes in Bits.
};
// Eintrag in eine Hash-Tabelle zur schnellen Dekodierung
struct CCILookUpTableEntry {
- USHORT nValue;
- USHORT nCodeBits;
+ sal_uInt16 nValue;
+ sal_uInt16 nCodeBits;
};
@@ -58,67 +58,67 @@ class CCIDecompressor {
public:
- CCIDecompressor( ULONG nOptions, UINT32 nImageWidth );
+ CCIDecompressor( sal_uLong nOptions, sal_uInt32 nImageWidth );
~CCIDecompressor();
void StartDecompression( SvStream & rIStream );
- BOOL DecompressScanline(BYTE * pTarget, ULONG nTargetBits );
+ sal_Bool DecompressScanline(sal_uInt8 * pTarget, sal_uLong nTargetBits );
private:
void MakeLookUp(const CCIHuffmanTableEntry * pHufTab,
const CCIHuffmanTableEntry * pHufTabSave,
CCILookUpTableEntry * pLookUp,
- USHORT nHuffmanTableSize,
- USHORT nMaxCodeBits);
+ sal_uInt16 nHuffmanTableSize,
+ sal_uInt16 nMaxCodeBits);
- BOOL ReadEOL( UINT32 nMaxFillBits );
+ sal_Bool ReadEOL( sal_uInt32 nMaxFillBits );
- BOOL Read2DTag();
+ sal_Bool Read2DTag();
- BYTE ReadBlackOrWhite();
+ sal_uInt8 ReadBlackOrWhite();
- USHORT ReadCodeAndDecode(const CCILookUpTableEntry * pLookUp,
- USHORT nMaxCodeBits);
+ sal_uInt16 ReadCodeAndDecode(const CCILookUpTableEntry * pLookUp,
+ sal_uInt16 nMaxCodeBits);
- void FillBits(BYTE * pTarget, USHORT nTargetBits,
- USHORT nBitPos, USHORT nNumBits,
- BYTE nBlackOrWhite);
+ void FillBits(sal_uInt8 * pTarget, sal_uInt16 nTargetBits,
+ sal_uInt16 nBitPos, sal_uInt16 nNumBits,
+ sal_uInt8 nBlackOrWhite);
- USHORT CountBits(const BYTE * pData, USHORT nDataSizeBits,
- USHORT nBitPos, BYTE nBlackOrWhite);
+ sal_uInt16 CountBits(const sal_uInt8 * pData, sal_uInt16 nDataSizeBits,
+ sal_uInt16 nBitPos, sal_uInt8 nBlackOrWhite);
- void Read1DScanlineData(BYTE * pTarget, USHORT nTargetBits);
+ void Read1DScanlineData(sal_uInt8 * pTarget, sal_uInt16 nTargetBits);
- void Read2DScanlineData(BYTE * pTarget, USHORT nTargetBits);
+ void Read2DScanlineData(sal_uInt8 * pTarget, sal_uInt16 nTargetBits);
- BOOL bTableBad;
+ sal_Bool bTableBad;
- BOOL bStatus;
+ sal_Bool bStatus;
- BYTE* pByteSwap;
+ sal_uInt8* pByteSwap;
SvStream * pIStream;
- UINT32 nEOLCount;
+ sal_uInt32 nEOLCount;
- UINT32 nWidth;
+ sal_uInt32 nWidth;
- ULONG nOptions;
+ sal_uLong nOptions;
- BOOL bFirstEOL;
+ sal_Bool bFirstEOL;
CCILookUpTableEntry * pWhiteLookUp;
CCILookUpTableEntry * pBlackLookUp;
CCILookUpTableEntry * p2DModeLookUp;
CCILookUpTableEntry * pUncompLookUp;
- ULONG nInputBitsBuf;
- USHORT nInputBitsBufSize;
+ sal_uLong nInputBitsBuf;
+ sal_uInt16 nInputBitsBufSize;
- BYTE * pLastLine;
- ULONG nLastLineSize;
+ sal_uInt8 * pLastLine;
+ sal_uLong nLastLineSize;
};
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index f3c862289676..61cd2eda3581 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -55,81 +55,81 @@ class TIFFReader
private:
- BOOL bStatus; // Ob bisher kein Fehler auftrat
+ sal_Bool bStatus; // Ob bisher kein Fehler auftrat
Animation aAnimation;
- ULONG nLastPercent;
+ sal_uLong nLastPercent;
SvStream* pTIFF; // Die einzulesende TIFF-Datei
Bitmap aBitmap;
BitmapWriteAccess* pAcc;
+ sal_uInt16 nDstBitsPerPixel;
AlphaMask* pAlphaMask;
BitmapWriteAccess* pMaskAcc;
- USHORT nDstBitsPerPixel;
- ULONG nOrigPos; // Anfaengliche Position in pTIFF
- UINT16 nOrigNumberFormat; // Anfaengliches Nummern-Format von pTIFF
+ sal_uLong nOrigPos; // Anfaengliche Position in pTIFF
+ sal_uInt16 nOrigNumberFormat; // Anfaengliches Nummern-Format von pTIFF
- UINT16 nDataType;
+ sal_uInt16 nDataType;
// Daten, die aus dem TIFF-Tags entnommen werden:
- BOOL bByteSwap; // TRUE wenn bits 0..7 -> 7..0 invertiert werden sollen ( FILLORDER = 2 );
- BYTE nByte1; // 'I', wenn Format LittleEndian
-
- ULONG nNewSubFile; //
- ULONG nSubFile; //
- ULONG nImageWidth; // Bildbreite in Pixel
- ULONG nImageLength; // Bildhoehe in Pixel
- ULONG nBitsPerSample; // Bits pro Pixel pro Ebene
- ULONG nCompression; // Art der Kompriemierung
- ULONG nPhotometricInterpretation; //
- ULONG nThresholding; //
- ULONG nCellWidth; //
- ULONG nCellLength; //
- ULONG nFillOrder; //
- ULONG* pStripOffsets; // Feld von Offsets zu den Bitmap-Daten-"Strips"
- ULONG nNumStripOffsets; // Groesse obigen Feldes
- ULONG nOrientation; //
- ULONG nSamplesPerPixel; // Anzahl der Ebenen
- ULONG nRowsPerStrip; // Wenn nicht komprimiert: Zahl der Zeilen pro Strip
- ULONG* pStripByteCounts; // Wenn komprimiert (bestimmte Art): Groesse der Strips
- ULONG nNumStripByteCounts; // Anzahl der Eintraege in obiges Feld
- ULONG nMinSampleValue; //
- ULONG nMaxSampleValue; //
+ sal_Bool bByteSwap; // sal_True wenn bits 0..7 -> 7..0 invertiert werden sollen ( FILLORDER = 2 );
+ sal_uInt8 nByte1; // 'I', wenn Format LittleEndian
+
+ sal_uLong nNewSubFile; //
+ sal_uLong nSubFile; //
+ sal_uLong nImageWidth; // Bildbreite in Pixel
+ sal_uLong nImageLength; // Bildhoehe in Pixel
+ sal_uLong nBitsPerSample; // Bits pro Pixel pro Ebene
+ sal_uLong nCompression; // Art der Kompriemierung
+ sal_uLong nPhotometricInterpretation; //
+ sal_uLong nThresholding; //
+ sal_uLong nCellWidth; //
+ sal_uLong nCellLength; //
+ sal_uLong nFillOrder; //
+ sal_uLong* pStripOffsets; // Feld von Offsets zu den Bitmap-Daten-"Strips"
+ sal_uLong nNumStripOffsets; // Groesse obigen Feldes
+ sal_uLong nOrientation; //
+ sal_uLong nSamplesPerPixel; // Anzahl der Ebenen
+ sal_uLong nRowsPerStrip; // Wenn nicht komprimiert: Zahl der Zeilen pro Strip
+ sal_uLong* pStripByteCounts; // Wenn komprimiert (bestimmte Art): Groesse der Strips
+ sal_uLong nNumStripByteCounts; // Anzahl der Eintraege in obiges Feld
+ sal_uLong nMinSampleValue; //
+ sal_uLong nMaxSampleValue; //
double fXResolution; // X-Aufloesung oder 0.0
double fYResolution; // Y-Aufloesung oder 0.0
- ULONG nPlanarConfiguration; //
- ULONG nGroup3Options; //
- ULONG nGroup4Options; //
- ULONG nResolutionUnit; // Einheit von fX/YResolution: 1=unbekannt, 2(default)=Zoll, 3=cm
- ULONG nPredictor; //
- ULONG* pColorMap; // Farb-Palette
- ULONG nNumColors; // Anzahl Farben in der Farbpalette
+ sal_uLong nPlanarConfiguration; //
+ sal_uLong nGroup3Options; //
+ sal_uLong nGroup4Options; //
+ sal_uLong nResolutionUnit; // Einheit von fX/YResolution: 1=unbekannt, 2(default)=Zoll, 3=cm
+ sal_uLong nPredictor; //
+ sal_uLong* pColorMap; // Farb-Palette
+ sal_uLong nNumColors; // Anzahl Farben in der Farbpalette
- ULONG nPlanes; // Anzahl der Ebenen in der Tiff-Datei
- ULONG nStripsPerPlane; // Anzahl der Strips pro Ebene
- ULONG nBytesPerRow; // Bytes pro Zeile pro Ebene in der Tiff-Datei ( unkomprimiert )
- BYTE* pMap[ 4 ]; // Temporaere Scanline
+ sal_uLong nPlanes; // Anzahl der Ebenen in der Tiff-Datei
+ sal_uLong nStripsPerPlane; // Anzahl der Strips pro Ebene
+ sal_uLong nBytesPerRow; // Bytes pro Zeile pro Ebene in der Tiff-Datei ( unkomprimiert )
+ sal_uInt8* pMap[ 4 ]; // Temporaere Scanline
- void MayCallback( ULONG nPercent );
+ void MayCallback( sal_uLong nPercent );
- ULONG DataTypeSize();
- ULONG ReadIntData();
+ sal_uLong DataTypeSize();
+ sal_uLong ReadIntData();
double ReadDoubleData();
void ReadHeader();
- void ReadTagData( USHORT nTagType, sal_uInt32 nDataLen );
+ void ReadTagData( sal_uInt16 nTagType, sal_uInt32 nDataLen );
- BOOL ReadMap( ULONG nMinPercent, ULONG nMaxPercent );
+ sal_Bool ReadMap( sal_uLong nMinPercent, sal_uLong nMaxPercent );
// Liesst/dekomprimert die Bitmap-Daten, und fuellt pMap
- ULONG GetBits( const BYTE * pSrc, ULONG nBitsPos, ULONG nBitsCount );
+ sal_uLong GetBits( const sal_uInt8 * pSrc, sal_uLong nBitsPos, sal_uLong nBitsCount );
// Holt nBitsCount Bits aus pSrc[..] an der Bit-Position nBitsPos
void MakePalCol( void );
// Erzeugt die Bitmap aus der temporaeren Bitmap pMap
// und loescht dabei pMap teilweise
- BOOL ConvertScanline( ULONG nY );
+ sal_Bool ConvertScanline( sal_uLong nY );
// Konvertiert eine Scanline in das Windows-BMP-Format
bool HasAlphaChannel() const;
@@ -141,21 +141,21 @@ public:
delete pAlphaMask;
}
- BOOL ReadTIFF( SvStream & rTIFF, Graphic & rGraphic );
+ sal_Bool ReadTIFF( SvStream & rTIFF, Graphic & rGraphic );
};
//=================== Methoden von TIFFReader ==============================
-void TIFFReader::MayCallback( ULONG /*nPercent*/ )
+void TIFFReader::MayCallback( sal_uLong /*nPercent*/ )
{
/*
if ( nPercent >= nLastPercent + 3 )
{
nLastPercent=nPercent;
- if ( pCallback != NULL && nPercent <= 100 && bStatus == TRUE )
+ if ( pCallback != NULL && nPercent <= 100 && bStatus == sal_True )
{
- if (((*pCallback)(pCallerData,(USHORT)nPercent)) == TRUE )
- bStatus = FALSE;
+ if (((*pCallback)(pCallerData,(sal_uInt16)nPercent)) == sal_True )
+ bStatus = sal_False;
}
}
*/
@@ -163,9 +163,9 @@ void TIFFReader::MayCallback( ULONG /*nPercent*/ )
// ---------------------------------------------------------------------------------
-ULONG TIFFReader::DataTypeSize()
+sal_uLong TIFFReader::DataTypeSize()
{
- ULONG nSize;
+ sal_uLong nSize;
switch ( nDataType )
{
case 1 : // BYTE
@@ -197,15 +197,15 @@ ULONG TIFFReader::DataTypeSize()
// ---------------------------------------------------------------------------------
-ULONG TIFFReader::ReadIntData()
+sal_uLong TIFFReader::ReadIntData()
{
double nDOUBLE;
float nFLOAT;
- UINT32 nUINT32a, nUINT32b;
- INT32 nINT32;
- UINT16 nUINT16;
- INT16 nINT16;
- BYTE nBYTE;
+ sal_uInt32 nUINT32a, nUINT32b;
+ sal_Int32 nINT32;
+ sal_uInt16 nUINT16;
+ sal_Int16 nINT16;
+ sal_uInt8 nBYTE;
char nCHAR;
switch( nDataType )
@@ -215,11 +215,11 @@ ULONG TIFFReader::ReadIntData()
case 2 :
case 7 :
*pTIFF >> nBYTE;
- nUINT32a = (ULONG)nBYTE;
+ nUINT32a = (sal_uLong)nBYTE;
break;
case 3 :
*pTIFF >> nUINT16;
- nUINT32a = (ULONG)nUINT16;
+ nUINT32a = (sal_uLong)nUINT16;
break;
case 9 :
case 4 :
@@ -232,11 +232,11 @@ ULONG TIFFReader::ReadIntData()
break;
case 6 :
*pTIFF >> nCHAR;
- nUINT32a = (INT32)nCHAR;
+ nUINT32a = (sal_Int32)nCHAR;
break;
case 8 :
*pTIFF >> nINT16;
- nUINT32a = (INT32)nINT16;
+ nUINT32a = (sal_Int32)nINT16;
break;
case 10 :
*pTIFF >> nUINT32a >> nINT32;
@@ -245,11 +245,11 @@ ULONG TIFFReader::ReadIntData()
break;
case 11 :
*pTIFF >> nFLOAT;
- nUINT32a = (INT32)nFLOAT;
+ nUINT32a = (sal_Int32)nFLOAT;
break;
case 12 :
*pTIFF >> nDOUBLE;
- nUINT32a = (INT32)nDOUBLE;
+ nUINT32a = (sal_Int32)nDOUBLE;
break;
default:
*pTIFF >> nUINT32a;
@@ -280,9 +280,9 @@ double TIFFReader::ReadDoubleData()
// ---------------------------------------------------------------------------------
-void TIFFReader::ReadTagData( USHORT nTagType, sal_uInt32 nDataLen)
+void TIFFReader::ReadTagData( sal_uInt16 nTagType, sal_uInt32 nDataLen)
{
- if ( bStatus == FALSE )
+ if ( bStatus == sal_False )
return;
switch ( nTagType )
@@ -343,7 +343,7 @@ void TIFFReader::ReadTagData( USHORT nTagType, sal_uInt32 nDataLen)
break;
case 0x0111: { // Strip Offset(s)
- ULONG nOldNumSO, i, * pOldSO;
+ sal_uLong nOldNumSO, i, * pOldSO;
pOldSO = pStripOffsets;
if ( pOldSO == NULL )
nNumStripOffsets = 0;
@@ -354,7 +354,7 @@ void TIFFReader::ReadTagData( USHORT nTagType, sal_uInt32 nDataLen)
nNumStripOffsets = nDataLen;
try
{
- pStripOffsets = new ULONG[ nNumStripOffsets ];
+ pStripOffsets = new sal_uLong[ nNumStripOffsets ];
}
catch (std::bad_alloc)
{
@@ -389,7 +389,7 @@ void TIFFReader::ReadTagData( USHORT nTagType, sal_uInt32 nDataLen)
break;
case 0x0117: { // Strip Byte Counts
- ULONG nOldNumSBC, i, * pOldSBC;
+ sal_uLong nOldNumSBC, i, * pOldSBC;
pOldSBC = pStripByteCounts;
if ( pOldSBC == NULL )
nNumStripByteCounts = 0; // Sicherheitshalber
@@ -400,7 +400,7 @@ void TIFFReader::ReadTagData( USHORT nTagType, sal_uInt32 nDataLen)
nNumStripByteCounts = nDataLen;
try
{
- pStripByteCounts = new ULONG[ nNumStripByteCounts ];
+ pStripByteCounts = new sal_uLong[ nNumStripByteCounts ];
}
catch (std::bad_alloc)
{
@@ -462,32 +462,32 @@ void TIFFReader::ReadTagData( USHORT nTagType, sal_uInt32 nDataLen)
break;
case 0x0140: { // Color Map
- USHORT nVal;
- ULONG i;
+ sal_uInt16 nVal;
+ sal_uLong i;
nNumColors= ( 1UL << nBitsPerSample );
if ( nDataType == 3 && nNumColors <= 256)
{
- pColorMap = new ULONG[ 256 ];
+ pColorMap = new sal_uLong[ 256 ];
for ( i = 0; i < nNumColors; i++ )
pColorMap[ i ] = 0;
for ( i = 0; i < nNumColors; i++ )
{
*pTIFF >> nVal;
- pColorMap[ i ] |= ( ( (ULONG)nVal ) << 8 ) & 0x00ff0000;
+ pColorMap[ i ] |= ( ( (sal_uLong)nVal ) << 8 ) & 0x00ff0000;
}
for ( i = 0; i < nNumColors; i++ )
{
*pTIFF >> nVal;
- pColorMap[ i ] |= ( (ULONG)nVal ) & 0x0000ff00;
+ pColorMap[ i ] |= ( (sal_uLong)nVal ) & 0x0000ff00;
}
for ( i = 0; i < nNumColors; i++ )
{
*pTIFF >> nVal;
- pColorMap[ i ] |= ( ( (ULONG)nVal ) >> 8 ) & 0x000000ff;
+ pColorMap[ i ] |= ( ( (sal_uLong)nVal ) >> 8 ) & 0x000000ff;
}
}
else
- bStatus = FALSE;
+ bStatus = sal_False;
OOODEBUG("ColorMap (Anzahl Farben:)", nNumColors);
break;
}
@@ -501,16 +501,16 @@ void TIFFReader::ReadTagData( USHORT nTagType, sal_uInt32 nDataLen)
}
if ( pTIFF->GetError() )
- bStatus = FALSE;
+ bStatus = sal_False;
}
// ---------------------------------------------------------------------------------
-BOOL TIFFReader::ReadMap( ULONG nMinPercent, ULONG nMaxPercent )
+sal_Bool TIFFReader::ReadMap( sal_uLong nMinPercent, sal_uLong nMaxPercent )
{
if ( nCompression == 1 || nCompression == 32771 )
{
- ULONG ny, np, nStrip, nStripBytesPerRow;
+ sal_uLong ny, np, nStrip, nStripBytesPerRow;
if ( nCompression == 1 )
nStripBytesPerRow = nBytesPerRow;
@@ -522,20 +522,20 @@ BOOL TIFFReader::ReadMap( ULONG nMinPercent, ULONG nMaxPercent )
{
nStrip = ny / nRowsPerStrip + np * nStripsPerPlane;
if ( nStrip >= nNumStripOffsets )
- return FALSE;
+ return sal_False;
pTIFF->Seek( pStripOffsets[ nStrip ] + ( ny % nRowsPerStrip ) * nStripBytesPerRow );
pTIFF->Read( pMap[ np ], nBytesPerRow );
if ( pTIFF->GetError() )
- return FALSE;
+ return sal_False;
MayCallback( nMinPercent + ( nMaxPercent - nMinPercent ) * ( np * nImageLength + ny) / ( nImageLength * nPlanes ) );
}
if ( !ConvertScanline( ny ) )
- return FALSE;
+ return sal_False;
}
}
else if ( nCompression == 2 || nCompression == 3 || nCompression == 4 )
{
- ULONG ny, np, nStrip, nOptions;
+ sal_uLong ny, np, nStrip, nOptions;
if ( nCompression == 2 )
{
nOptions = CCI_OPTION_BYTEALIGNROW;
@@ -548,22 +548,22 @@ BOOL TIFFReader::ReadMap( ULONG nMinPercent, ULONG nMaxPercent )
if ( nGroup3Options & 0x00000004 )
nOptions |= CCI_OPTION_BYTEALIGNEOL;
if ( nGroup3Options & 0xfffffffa )
- return FALSE;
+ return sal_False;
}
else
{ // nCompression==4
nOptions = CCI_OPTION_2D;
if ( nGroup4Options & 0xffffffff )
- return FALSE;
+ return sal_False;
}
if ( nFillOrder == 2 )
{
nOptions |= CCI_OPTION_INVERSEBITORDER;
- bByteSwap = FALSE;
+ bByteSwap = sal_False;
}
nStrip = 0;
if ( nStrip >= nNumStripOffsets )
- return FALSE;
+ return sal_False;
pTIFF->Seek(pStripOffsets[nStrip]);
CCIDecompressor aCCIDecom( nOptions, nImageWidth );
@@ -578,27 +578,27 @@ BOOL TIFFReader::ReadMap( ULONG nMinPercent, ULONG nMaxPercent )
{
nStrip=ny/nRowsPerStrip+np*nStripsPerPlane;
if ( nStrip >= nNumStripOffsets )
- return FALSE;
+ return sal_False;
pTIFF->Seek( pStripOffsets[ nStrip ] );
aCCIDecom.StartDecompression( *pTIFF );
}
- if ( aCCIDecom.DecompressScanline( pMap[ np ], nImageWidth * nBitsPerSample * nSamplesPerPixel / nPlanes ) == FALSE )
- return FALSE;
+ if ( aCCIDecom.DecompressScanline( pMap[ np ], nImageWidth * nBitsPerSample * nSamplesPerPixel / nPlanes ) == sal_False )
+ return sal_False;
if ( pTIFF->GetError() )
- return FALSE;
+ return sal_False;
MayCallback(nMinPercent+(nMaxPercent-nMinPercent)*(np*nImageLength+ny)/(nImageLength*nPlanes));
}
if ( !ConvertScanline( ny ) )
- return FALSE;
+ return sal_False;
}
}
else if ( nCompression == 5 )
{
LZWDecompressor aLZWDecom;
- ULONG ny, np, nStrip;
+ sal_uLong ny, np, nStrip;
nStrip=0;
if ( nStrip >= nNumStripOffsets )
- return FALSE;
+ return sal_False;
pTIFF->Seek(pStripOffsets[nStrip]);
aLZWDecom.StartDecompression(*pTIFF);
for ( ny = 0; ny < nImageLength; ny++ )
@@ -609,25 +609,25 @@ BOOL TIFFReader::ReadMap( ULONG nMinPercent, ULONG nMaxPercent )
{
nStrip = ny / nRowsPerStrip + np * nStripsPerPlane;
if ( nStrip >= nNumStripOffsets )
- return FALSE;
+ return sal_False;
pTIFF->Seek(pStripOffsets[nStrip]);
aLZWDecom.StartDecompression(*pTIFF);
}
if ( ( aLZWDecom.Decompress( pMap[ np ], nBytesPerRow ) != nBytesPerRow ) || pTIFF->GetError() )
- return FALSE;
+ return sal_False;
MayCallback(nMinPercent+(nMaxPercent-nMinPercent)*(np*nImageLength+ny)/(nImageLength*nPlanes));
}
if ( !ConvertScanline( ny ) )
- return FALSE;
+ return sal_False;
}
}
else if ( nCompression == 32773 )
{
- ULONG nStrip,nRecCount,nRowBytesLeft,ny,np,i;
- BYTE * pdst, nRecHeader, nRecData;
+ sal_uLong nStrip,nRecCount,nRowBytesLeft,ny,np,i;
+ sal_uInt8 * pdst, nRecHeader, nRecData;
nStrip = 0;
if ( nStrip >= nNumStripOffsets )
- return FALSE;
+ return sal_False;
pTIFF->Seek(pStripOffsets[nStrip]);
for ( ny = 0; ny < nImageLength; ny++ )
{
@@ -637,7 +637,7 @@ BOOL TIFFReader::ReadMap( ULONG nMinPercent, ULONG nMaxPercent )
{
nStrip=ny/nRowsPerStrip+np*nStripsPerPlane;
if ( nStrip >= nNumStripOffsets )
- return FALSE;
+ return sal_False;
pTIFF->Seek(pStripOffsets[nStrip]);
}
nRowBytesLeft = nBytesPerRow;
@@ -647,21 +647,21 @@ BOOL TIFFReader::ReadMap( ULONG nMinPercent, ULONG nMaxPercent )
*pTIFF >> nRecHeader;
if ((nRecHeader&0x80)==0)
{
- nRecCount=0x00000001+((ULONG)nRecHeader);
+ nRecCount=0x00000001+((sal_uLong)nRecHeader);
if ( nRecCount > nRowBytesLeft )
- return FALSE;
+ return sal_False;
pTIFF->Read(pdst,nRecCount);
pdst+=nRecCount;
nRowBytesLeft-=nRecCount;
}
else if ( nRecHeader != 0x80 )
{
- nRecCount = 0x000000101 - ( (ULONG)nRecHeader );
+ nRecCount = 0x000000101 - ( (sal_uLong)nRecHeader );
if ( nRecCount > nRowBytesLeft )
{
nRecCount = nRowBytesLeft;
-// bStatus = FALSE;
+// bStatus = sal_False;
// return;
}
@@ -672,27 +672,27 @@ BOOL TIFFReader::ReadMap( ULONG nMinPercent, ULONG nMaxPercent )
}
} while ( nRowBytesLeft != 0 );
if ( pTIFF->GetError() )
- return FALSE;
+ return sal_False;
MayCallback(nMinPercent+(nMaxPercent-nMinPercent)*(np*nImageLength+ny)/(nImageLength*nPlanes));
}
if ( !ConvertScanline( ny ) )
- return FALSE;
+ return sal_False;
}
}
else
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
-ULONG TIFFReader::GetBits( const BYTE * pSrc, ULONG nBitsPos, ULONG nBitsCount )
+sal_uLong TIFFReader::GetBits( const sal_uInt8 * pSrc, sal_uLong nBitsPos, sal_uLong nBitsCount )
{
- ULONG nRes;
+ sal_uLong nRes;
if ( bByteSwap )
{
pSrc += ( nBitsPos >> 3 );
nBitsPos &= 7;
- BYTE nDat = *pSrc;
- nRes = (ULONG)( BYTESWAP( nDat ) & ( 0xff >> nBitsPos ) );
+ sal_uInt8 nDat = *pSrc;
+ nRes = (sal_uLong)( BYTESWAP( nDat ) & ( 0xff >> nBitsPos ) );
if ( nBitsCount <= 8 - nBitsPos )
{
@@ -705,13 +705,13 @@ ULONG TIFFReader::GetBits( const BYTE * pSrc, ULONG nBitsPos, ULONG nBitsCount )
while ( nBitsCount >= 8 )
{
nDat = *(pSrc++);
- nRes = ( nRes << 8 ) | ((ULONG)BYTESWAP( nDat ) );
+ nRes = ( nRes << 8 ) | ((sal_uLong)BYTESWAP( nDat ) );
nBitsCount -= 8;
}
if ( nBitsCount > 0 )
{
nDat = *pSrc;
- nRes = ( nRes << nBitsCount ) | (((ULONG)BYTESWAP(nDat))>>(8-nBitsCount));
+ nRes = ( nRes << nBitsCount ) | (((sal_uLong)BYTESWAP(nDat))>>(8-nBitsCount));
}
}
}
@@ -719,7 +719,7 @@ ULONG TIFFReader::GetBits( const BYTE * pSrc, ULONG nBitsPos, ULONG nBitsCount )
{
pSrc += ( nBitsPos >> 3 );
nBitsPos &= 7;
- nRes = (ULONG)((*pSrc)&(0xff>>nBitsPos));
+ nRes = (sal_uLong)((*pSrc)&(0xff>>nBitsPos));
if ( nBitsCount <= 8 - nBitsPos )
{
nRes >>= ( 8 - nBitsPos - nBitsCount );
@@ -730,11 +730,11 @@ ULONG TIFFReader::GetBits( const BYTE * pSrc, ULONG nBitsPos, ULONG nBitsCount )
nBitsCount -= 8 - nBitsPos;
while ( nBitsCount >= 8 )
{
- nRes = ( nRes << 8 ) | ((ULONG)*(pSrc++));
+ nRes = ( nRes << 8 ) | ((sal_uLong)*(pSrc++));
nBitsCount -= 8;
}
if ( nBitsCount > 0 )
- nRes = ( nRes << nBitsCount ) | (((ULONG)*pSrc)>>(8-nBitsCount));
+ nRes = ( nRes << nBitsCount ) | (((sal_uLong)*pSrc)>>(8-nBitsCount));
}
}
return nRes;
@@ -742,24 +742,24 @@ ULONG TIFFReader::GetBits( const BYTE * pSrc, ULONG nBitsPos, ULONG nBitsCount )
// ---------------------------------------------------------------------------------
-BOOL TIFFReader::ConvertScanline( ULONG nY )
+sal_Bool TIFFReader::ConvertScanline( sal_uLong nY )
{
- UINT32 nRed, nGreen, nBlue, ns, nx, nVal, nByteCount;
- BYTE nByteVal;
+ sal_uInt32 nRed, nGreen, nBlue, ns, nx, nVal, nByteCount;
+ sal_uInt8 nByteVal;
if ( nDstBitsPerPixel == 24 )
{
if ( nBitsPerSample == 8 && nSamplesPerPixel >= 3 &&
nPlanes == 1 && nPhotometricInterpretation == 2 )
{
- BYTE* pt = pMap[ 0 ];
+ sal_uInt8* pt = pMap[ 0 ];
// sind die Werte als Differenz abgelegt?
if ( 2 == nPredictor )
{
- BYTE nLRed = 0;
- BYTE nLGreen = 0;
- BYTE nLBlue = 0;
+ sal_uInt8 nLRed = 0;
+ sal_uInt8 nLGreen = 0;
+ sal_uInt8 nLBlue = 0;
BYTE nLAlpha = 0;
for ( nx = 0; nx < nImageWidth; nx++, pt += nSamplesPerPixel )
{
@@ -789,250 +789,264 @@ BOOL TIFFReader::ConvertScanline( ULONG nY )
}
else if ( nPhotometricInterpretation == 2 && nSamplesPerPixel >= 3 )
{
- ULONG nMinMax = nMinSampleValue * 255 / ( nMaxSampleValue - nMinSampleValue );
- for ( nx = 0; nx < nImageWidth; nx++ )
+ if ( nMaxSampleValue > nMinSampleValue )
{
- if ( nPlanes < 3 )
- {
- nRed = GetBits( pMap[ 0 ], ( nx * nSamplesPerPixel + 0 ) * nBitsPerSample, nBitsPerSample );
- nGreen = GetBits( pMap[ 1 ], ( nx * nSamplesPerPixel + 1 ) * nBitsPerSample, nBitsPerSample );
- nBlue = GetBits( pMap[ 2 ], ( nx * nSamplesPerPixel + 2 ) * nBitsPerSample, nBitsPerSample );
- }
- else
+ sal_uLong nMinMax = nMinSampleValue * 255 / ( nMaxSampleValue - nMinSampleValue );
+ for ( nx = 0; nx < nImageWidth; nx++ )
{
- nRed = GetBits( pMap[ 0 ], nx * nBitsPerSample, nBitsPerSample );
- nGreen = GetBits( pMap[ 1 ], nx * nBitsPerSample, nBitsPerSample );
- nBlue = GetBits( pMap[ 2 ], nx * nBitsPerSample, nBitsPerSample );
+ if ( nPlanes < 3 )
+ {
+ nRed = GetBits( pMap[ 0 ], ( nx * nSamplesPerPixel + 0 ) * nBitsPerSample, nBitsPerSample );
+ nGreen = GetBits( pMap[ 1 ], ( nx * nSamplesPerPixel + 1 ) * nBitsPerSample, nBitsPerSample );
+ nBlue = GetBits( pMap[ 2 ], ( nx * nSamplesPerPixel + 2 ) * nBitsPerSample, nBitsPerSample );
+ }
+ else
+ {
+ nRed = GetBits( pMap[ 0 ], nx * nBitsPerSample, nBitsPerSample );
+ nGreen = GetBits( pMap[ 1 ], nx * nBitsPerSample, nBitsPerSample );
+ nBlue = GetBits( pMap[ 2 ], nx * nBitsPerSample, nBitsPerSample );
+ }
+ pAcc->SetPixel( nY, nx, Color( (sal_uInt8)( nRed - nMinMax ), (sal_uInt8)( nGreen - nMinMax ), (sal_uInt8)(nBlue - nMinMax) ) );
}
- pAcc->SetPixel( nY, nx, Color( (BYTE)( nRed - nMinMax ), (BYTE)( nGreen - nMinMax ), (BYTE)(nBlue - nMinMax) ) );
}
}
else if ( nPhotometricInterpretation == 5 && nSamplesPerPixel == 3 )
{
- ULONG nMinMax = nMinSampleValue * 255 / ( nMaxSampleValue - nMinSampleValue );
- for ( nx = 0; nx < nImageWidth; nx++ )
+ if ( nMaxSampleValue > nMinSampleValue )
{
- if ( nPlanes < 3 )
- {
- nRed = GetBits( pMap[ 0 ],( nx * nSamplesPerPixel + 0 ) * nBitsPerSample, nBitsPerSample );
- nGreen = GetBits( pMap[ 0 ],( nx * nSamplesPerPixel + 1 ) * nBitsPerSample, nBitsPerSample );
- nBlue = GetBits( pMap[ 0 ],( nx * nSamplesPerPixel + 2 ) * nBitsPerSample, nBitsPerSample );
- }
- else
+ sal_uLong nMinMax = nMinSampleValue * 255 / ( nMaxSampleValue - nMinSampleValue );
+ for ( nx = 0; nx < nImageWidth; nx++ )
{
- nRed = GetBits( pMap[ 0 ], nx * nBitsPerSample, nBitsPerSample );
- nGreen = GetBits( pMap[ 1 ], nx * nBitsPerSample, nBitsPerSample );
- nBlue = GetBits( pMap[ 2 ], nx * nBitsPerSample, nBitsPerSample );
+ if ( nPlanes < 3 )
+ {
+ nRed = GetBits( pMap[ 0 ],( nx * nSamplesPerPixel + 0 ) * nBitsPerSample, nBitsPerSample );
+ nGreen = GetBits( pMap[ 0 ],( nx * nSamplesPerPixel + 1 ) * nBitsPerSample, nBitsPerSample );
+ nBlue = GetBits( pMap[ 0 ],( nx * nSamplesPerPixel + 2 ) * nBitsPerSample, nBitsPerSample );
+ }
+ else
+ {
+ nRed = GetBits( pMap[ 0 ], nx * nBitsPerSample, nBitsPerSample );
+ nGreen = GetBits( pMap[ 1 ], nx * nBitsPerSample, nBitsPerSample );
+ nBlue = GetBits( pMap[ 2 ], nx * nBitsPerSample, nBitsPerSample );
+ }
+ nRed = 255 - (sal_uInt8)( nRed - nMinMax );
+ nGreen = 255 - (sal_uInt8)( nGreen - nMinMax );
+ nBlue = 255 - (sal_uInt8)( nBlue - nMinMax );
+ pAcc->SetPixel( nY, nx, Color( (sal_uInt8) nRed, (sal_uInt8) nGreen, (sal_uInt8) nBlue ) );
}
- nRed = 255 - (BYTE)( nRed - nMinMax );
- nGreen = 255 - (BYTE)( nGreen - nMinMax );
- nBlue = 255 - (BYTE)( nBlue - nMinMax );
- pAcc->SetPixel( nY, nx, Color( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue ) );
}
}
else if( nPhotometricInterpretation == 5 && nSamplesPerPixel == 4 )
{
- BYTE nSamp[ 4 ];
- BYTE nSampLast[ 4 ] = { 0, 0, 0, 0 };
- long nBlack;
-
- for( nx = 0; nx < nImageWidth; nx++ )
+ if ( nMaxSampleValue > nMinSampleValue )
{
- // sind die Werte als Differenz abgelegt?
- if( 2 == nPredictor )
+ sal_uInt8 nSamp[ 4 ];
+ sal_uInt8 nSampLast[ 4 ] = { 0, 0, 0, 0 };
+ long nBlack;
+
+ for( nx = 0; nx < nImageWidth; nx++ )
{
- for( ns = 0; ns < 4; ns++ )
+ // sind die Werte als Differenz abgelegt?
+ if( 2 == nPredictor )
{
- if( nPlanes < 3 )
- nSampLast[ ns ] = nSampLast[ ns ] + (BYTE) GetBits( pMap[ 0 ], ( nx * nSamplesPerPixel + ns ) * nBitsPerSample, nBitsPerSample );
- else
- nSampLast[ ns ] = nSampLast[ ns ] + (BYTE) GetBits( pMap[ ns ], nx * nBitsPerSample, nBitsPerSample );
- nSamp[ ns ] = nSampLast[ ns ];
+ for( ns = 0; ns < 4; ns++ )
+ {
+ if( nPlanes < 3 )
+ nSampLast[ ns ] = nSampLast[ ns ] + (sal_uInt8) GetBits( pMap[ 0 ], ( nx * nSamplesPerPixel + ns ) * nBitsPerSample, nBitsPerSample );
+ else
+ nSampLast[ ns ] = nSampLast[ ns ] + (sal_uInt8) GetBits( pMap[ ns ], nx * nBitsPerSample, nBitsPerSample );
+ nSamp[ ns ] = nSampLast[ ns ];
+ }
}
- }
- else
- {
- for( ns = 0; ns < 4; ns++ )
+ else
{
- if( nPlanes < 3 )
- nSamp[ ns ] = (BYTE) GetBits( pMap[ 0 ], ( nx * nSamplesPerPixel + ns ) * nBitsPerSample, nBitsPerSample );
- else
- nSamp[ ns ]= (BYTE) GetBits( pMap[ ns ], nx * nBitsPerSample, nBitsPerSample );
+ for( ns = 0; ns < 4; ns++ )
+ {
+ if( nPlanes < 3 )
+ nSamp[ ns ] = (sal_uInt8) GetBits( pMap[ 0 ], ( nx * nSamplesPerPixel + ns ) * nBitsPerSample, nBitsPerSample );
+ else
+ nSamp[ ns ]= (sal_uInt8) GetBits( pMap[ ns ], nx * nBitsPerSample, nBitsPerSample );
+ }
}
+ nBlack = nSamp[ 3 ];
+ nRed = (sal_uInt8) Max( 0L, 255L - ( ( (long) nSamp[ 0 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) *
+ 255L/(long)(nMaxSampleValue-nMinSampleValue) ) );
+ nGreen = (sal_uInt8) Max( 0L, 255L - ( ( (long) nSamp[ 1 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) *
+ 255L/(long)(nMaxSampleValue-nMinSampleValue) ) );
+ nBlue = (sal_uInt8) Max( 0L, 255L - ( ( (long) nSamp[ 2 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) *
+ 255L/(long)(nMaxSampleValue-nMinSampleValue) ) );
+ pAcc->SetPixel( nY, nx, Color ( (sal_uInt8)nRed, (sal_uInt8)nGreen, (sal_uInt8)nBlue ) );
}
- nBlack = nSamp[ 3 ];
- nRed = (BYTE) Max( 0L, 255L - ( ( (long) nSamp[ 0 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) *
- 255L/(long)(nMaxSampleValue-nMinSampleValue) ) );
- nGreen = (BYTE) Max( 0L, 255L - ( ( (long) nSamp[ 1 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) *
- 255L/(long)(nMaxSampleValue-nMinSampleValue) ) );
- nBlue = (BYTE) Max( 0L, 255L - ( ( (long) nSamp[ 2 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) *
- 255L/(long)(nMaxSampleValue-nMinSampleValue) ) );
- pAcc->SetPixel( nY, nx, Color ( (BYTE)nRed, (BYTE)nGreen, (BYTE)nBlue ) );
-
}
}
}
else if ( nSamplesPerPixel == 1 && ( nPhotometricInterpretation <= 1 || nPhotometricInterpretation == 3 ) )
{
- ULONG nMinMax = ( ( 1 << nDstBitsPerPixel ) - 1 ) / ( nMaxSampleValue - nMinSampleValue );
- BYTE* pt = pMap[ 0 ];
- BYTE nShift;
-
- switch ( nDstBitsPerPixel )
+ if ( nMaxSampleValue > nMinSampleValue )
{
- case 8 :
+ sal_uLong nMinMax = ( ( 1 << nDstBitsPerPixel ) - 1 ) / ( nMaxSampleValue - nMinSampleValue );
+ sal_uInt8* pt = pMap[ 0 ];
+ sal_uInt8 nShift;
+
+ switch ( nDstBitsPerPixel )
{
- BYTE nLast;
- if ( bByteSwap )
+ case 8 :
{
- if ( nPredictor == 2 )
+ sal_uInt8 nLast;
+ if ( bByteSwap )
{
- nLast = BYTESWAP( (BYTE)*pt++ );
- for ( nx = 0; nx < nImageWidth; nx++ )
+ if ( nPredictor == 2 )
{
- pAcc->SetPixel( nY, nx, nLast );
- nLast = nLast + *pt++;
+ nLast = BYTESWAP( (sal_uInt8)*pt++ );
+ for ( nx = 0; nx < nImageWidth; nx++ )
+ {
+ pAcc->SetPixel( nY, nx, nLast );
+ nLast = nLast + *pt++;
+ }
}
- }
- else
- {
- for ( nx = 0; nx < nImageWidth; nx++ )
+ else
{
- nLast = *pt++;
- pAcc->SetPixel( nY, nx, (BYTE)( ( (BYTESWAP((ULONG)nLast ) - nMinSampleValue ) * nMinMax ) ) );
+ for ( nx = 0; nx < nImageWidth; nx++ )
+ {
+ nLast = *pt++;
+ pAcc->SetPixel( nY, nx, (sal_uInt8)( ( (BYTESWAP((sal_uLong)nLast ) - nMinSampleValue ) * nMinMax ) ) );
+ }
}
}
- }
- else
- {
- if ( nPredictor == 2 )
+ else
{
- nLast = *pt++;
- for ( nx = 0; nx < nImageWidth; nx++ )
+ if ( nPredictor == 2 )
{
- pAcc->SetPixel( nY, nx, nLast );
- nLast = nLast + *pt++;
+ nLast = *pt++;
+ for ( nx = 0; nx < nImageWidth; nx++ )
+ {
+ pAcc->SetPixel( nY, nx, nLast );
+ nLast = nLast + *pt++;
+ }
}
- }
- else
- {
- for ( nx = 0; nx < nImageWidth; nx++ )
+ else
{
- pAcc->SetPixel( nY, nx, (BYTE)( ( (ULONG)*pt++ - nMinSampleValue ) * nMinMax ) );
+ for ( nx = 0; nx < nImageWidth; nx++ )
+ {
+ pAcc->SetPixel( nY, nx, (sal_uInt8)( ( (sal_uLong)*pt++ - nMinSampleValue ) * nMinMax ) );
+ }
}
}
}
- }
- break;
+ break;
- case 7 :
- case 6 :
- case 5 :
- case 4 :
- case 3 :
- case 2 :
- {
- for ( nx = 0; nx < nImageWidth; nx++ )
+ case 7 :
+ case 6 :
+ case 5 :
+ case 4 :
+ case 3 :
+ case 2 :
{
- nVal = ( GetBits( pt, nx * nBitsPerSample, nBitsPerSample ) - nMinSampleValue ) * nMinMax;
- pAcc->SetPixel( nY, nx, (BYTE)nVal );
+ for ( nx = 0; nx < nImageWidth; nx++ )
+ {
+ nVal = ( GetBits( pt, nx * nBitsPerSample, nBitsPerSample ) - nMinSampleValue ) * nMinMax;
+ pAcc->SetPixel( nY, nx, (sal_uInt8)nVal );
+ }
}
- }
- break;
+ break;
- case 1 :
- {
- if ( bByteSwap )
+ case 1 :
{
- nx = 0;
- nByteCount = ( nImageWidth >> 3 ) + 1;
- while ( --nByteCount )
- {
- nByteVal = *pt++;
- pAcc->SetPixel( nY, nx++, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, nx++, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, nx++, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, nx++, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, nx++, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, nx++, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, nx++, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, nx++, nByteVal );
- }
- if ( nImageWidth & 7 )
+ if ( bByteSwap )
{
- nByteVal = *pt++;
- while ( nx < nImageWidth )
+ nx = 0;
+ nByteCount = ( nImageWidth >> 3 ) + 1;
+ while ( --nByteCount )
{
+ nByteVal = *pt++;
+ pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+ nByteVal >>= 1;
pAcc->SetPixel( nY, nx++, nByteVal & 1 );
nByteVal >>= 1;
+ pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, nx++, nByteVal );
+ }
+ if ( nImageWidth & 7 )
+ {
+ nByteVal = *pt++;
+ while ( nx < nImageWidth )
+ {
+ pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+ nByteVal >>= 1;
+ }
}
}
- }
- else
- {
- nx = 7;
- nByteCount = ( nImageWidth >> 3 ) + 1;
- while ( --nByteCount )
- {
- nByteVal = *pt++;
- pAcc->SetPixel( nY, nx, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, --nx, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, --nx, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, --nx, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, --nx, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, --nx, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, --nx, nByteVal & 1 );
- nByteVal >>= 1;
- pAcc->SetPixel( nY, --nx, nByteVal );
- nx += 15;
- }
- if ( nImageWidth & 7 )
+ else
{
- nx -= 7;
- nByteVal = *pt++;
- nShift = 7;
- while ( nx < nImageWidth )
+ nx = 7;
+ nByteCount = ( nImageWidth >> 3 ) + 1;
+ while ( --nByteCount )
+ {
+ nByteVal = *pt++;
+ pAcc->SetPixel( nY, nx, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+ nByteVal >>= 1;
+ pAcc->SetPixel( nY, --nx, nByteVal );
+ nx += 15;
+ }
+ if ( nImageWidth & 7 )
{
- pAcc->SetPixel( nY, nx++, ( nByteVal >> nShift ) & 1);
+ nx -= 7;
+ nByteVal = *pt++;
+ nShift = 7;
+ while ( nx < nImageWidth )
+ {
+ pAcc->SetPixel( nY, nx++, ( nByteVal >> nShift ) & 1);
+ }
}
}
}
- }
- break;
+ break;
- default :
- return FALSE;
+ default :
+ return sal_False;
+ }
}
}
else if ( ( nSamplesPerPixel == 2 ) && ( nBitsPerSample == 8 ) &&
( nPlanarConfiguration == 1 ) && ( pColorMap == 0 ) ) // grayscale
{
- ULONG nMinMax = ( ( 1 << 8 /*nDstBitsPerPixel*/ ) - 1 ) / ( nMaxSampleValue - nMinSampleValue );
- BYTE* pt = pMap[ 0 ];
- if ( nByte1 == 'I' )
- pt++;
- for ( nx = 0; nx < nImageWidth; nx++, pt += 2 )
+ if ( nMaxSampleValue > nMinSampleValue )
{
- pAcc->SetPixel( nY, nx, (BYTE)( ( (ULONG)*pt - nMinSampleValue ) * nMinMax ) );
+ sal_uLong nMinMax = ( ( 1 << 8 /*nDstBitsPerPixel*/ ) - 1 ) / ( nMaxSampleValue - nMinSampleValue );
+ sal_uInt8* pt = pMap[ 0 ];
+ if ( nByte1 == 'I' )
+ pt++;
+ for ( nx = 0; nx < nImageWidth; nx++, pt += 2 )
+ {
+ pAcc->SetPixel( nY, nx, (sal_uInt8)( ( (sal_uLong)*pt - nMinSampleValue ) * nMinMax ) );
+ }
}
}
else
- return FALSE;
- return TRUE;
+ return sal_False;
+ return sal_True;
}
// ---------------------------------------------------------------------------------
@@ -1041,15 +1055,15 @@ void TIFFReader::MakePalCol( void )
{
if ( nDstBitsPerPixel <= 8 )
{
- ULONG i, nVal, n0RGB;
+ sal_uLong i, nVal, n0RGB;
if ( pColorMap == NULL )
- pColorMap = new ULONG[ 256 ];
+ pColorMap = new sal_uLong[ 256 ];
if ( nPhotometricInterpretation <= 1 )
{
nNumColors = 1UL << nBitsPerSample;
if ( nNumColors > 256 )
nNumColors = 256;
- pAcc->SetPaletteEntryCount( (USHORT)nNumColors );
+ pAcc->SetPaletteEntryCount( (sal_uInt16)nNumColors );
for ( i = 0; i < nNumColors; i++ )
{
nVal = ( i * 255 / ( nNumColors - 1 ) ) & 0xff;
@@ -1062,23 +1076,23 @@ void TIFFReader::MakePalCol( void )
}
for ( i = 0; i < nNumColors; i++ )
{
- pAcc->SetPaletteColor( (USHORT)i, BitmapColor( (BYTE)( pColorMap[ i ] >> 16 ),
- (BYTE)( pColorMap[ i ] >> 8 ), (BYTE)pColorMap[ i ] ) );
+ pAcc->SetPaletteColor( (sal_uInt16)i, BitmapColor( (sal_uInt8)( pColorMap[ i ] >> 16 ),
+ (sal_uInt8)( pColorMap[ i ] >> 8 ), (sal_uInt8)pColorMap[ i ] ) );
}
}
if ( fXResolution > 1.0 && fYResolution > 1.0 && ( nResolutionUnit == 2 || nResolutionUnit == 3 ) )
{
- ULONG nRX,nRY;
+ sal_uLong nRX,nRY;
if (nResolutionUnit==2)
{
- nRX=(ULONG)(fXResolution+0.5);
- nRY=(ULONG)(fYResolution+0.5);
+ nRX=(sal_uLong)(fXResolution+0.5);
+ nRY=(sal_uLong)(fYResolution+0.5);
}
else
{
- nRX=(ULONG)(fXResolution*2.54+0.5);
- nRY=(ULONG)(fYResolution*2.54+0.5);
+ nRX=(sal_uLong)(fXResolution*2.54+0.5);
+ nRY=(sal_uLong)(fYResolution*2.54+0.5);
}
MapMode aMapMode(MAP_INCH,Point(0,0),Fraction(1,nRX),Fraction(1,nRY));
aBitmap.SetPrefMapMode(aMapMode);
@@ -1090,8 +1104,8 @@ void TIFFReader::MakePalCol( void )
void TIFFReader::ReadHeader()
{
- BYTE nbyte1, nbyte2;
- USHORT nushort;
+ sal_uInt8 nbyte1, nbyte2;
+ sal_uInt16 nushort;
*pTIFF >> nbyte1;
if ( nbyte1 == 'I' )
@@ -1101,7 +1115,7 @@ void TIFFReader::ReadHeader()
*pTIFF >> nbyte2 >> nushort;
if ( nbyte1 != nbyte2 || ( nbyte1 != 'I' && nbyte1 != 'M' ) || nushort != 0x002a )
- bStatus = FALSE;
+ bStatus = sal_False;
}
bool TIFFReader::HasAlphaChannel() const
@@ -1118,14 +1132,14 @@ bool TIFFReader::HasAlphaChannel() const
// ---------------------------------------------------------------------------------
-BOOL TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
+sal_Bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
{
- USHORT i, nNumTags, nTagType;
- ULONG nMaxPos;
- ULONG nPos;
+ sal_uInt16 i, nNumTags, nTagType;
+ sal_uLong nMaxPos;
+ sal_uLong nPos;
sal_uInt32 nFirstIfd, nDataLen;
- bStatus = TRUE;
+ bStatus = sal_True;
nLastPercent = 0;
pTIFF = &rTIFF;
@@ -1141,7 +1155,7 @@ BOOL TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
*pTIFF >> nFirstIfd;
if( !nFirstIfd || pTIFF->GetError() )
- bStatus = FALSE;
+ bStatus = sal_False;
if ( bStatus )
{
@@ -1179,11 +1193,11 @@ BOOL TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
}
while( nOffset );
- for ( UINT32 nNextIfd = nFirstIfd; nNextIfd && bStatus; )
+ for ( sal_uInt32 nNextIfd = nFirstIfd; nNextIfd && bStatus; )
{
pTIFF->Seek( nOrigPos + nNextIfd );
{
- bByteSwap = FALSE;
+ bByteSwap = sal_False;
nNewSubFile = 0;
nSubFile = 0;
@@ -1235,23 +1249,26 @@ BOOL TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
nPos += 12; pTIFF->Seek( nPos );
if ( pTIFF->GetError() )
- bStatus = FALSE;
+ bStatus = sal_False;
- if ( bStatus == FALSE )
+ if ( bStatus == sal_False )
break;
}
*pTIFF >> nNextIfd;
if ( pTIFF->IsEof() )
nNextIfd = 0;
}
+ if ( !nBitsPerSample || ( nBitsPerSample > 32 ) )
+ bStatus = sal_False;
if ( bStatus )
{
if ( nMaxSampleValue == 0 )
- nMaxSampleValue = ( 1UL << nBitsPerSample ) - 1;
-
- if ( nMaxSampleValue <= nMinSampleValue )
- bStatus = FALSE;
-
+ {
+ if ( nBitsPerSample == 32 ) // sj: i93300, compiler bug, 1 << 32 gives 1 one 32bit windows platforms,
+ nMaxSampleValue = 0xffffffff; // (up from 80286 only the lower 5 bits are used when shifting a 32bit register)
+ else
+ nMaxSampleValue = ( 1 << nBitsPerSample ) - 1;
+ }
if ( nPhotometricInterpretation == 2 || nPhotometricInterpretation == 5 || nPhotometricInterpretation == 6 )
nDstBitsPerPixel = 24;
else if ( nBitsPerSample*nSamplesPerPixel <= 1 )
@@ -1272,21 +1289,21 @@ BOOL TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
nPlanes = nSamplesPerPixel;
if ( ( nFillOrder == 2 ) && ( nCompression != 5 ) ) // im LZW Mode werden die bits schon invertiert
- bByteSwap = TRUE;
+ bByteSwap = sal_True;
nStripsPerPlane = ( nImageLength - 1 ) / nRowsPerStrip + 1;
nBytesPerRow = ( nImageWidth * nSamplesPerPixel / nPlanes * nBitsPerSample + 7 ) >> 3;
- for ( ULONG j = 0; j < 4; j++ )
+ for ( sal_uLong j = 0; j < 4; j++ )
{
try
{
- pMap[ j ] = new BYTE[ nBytesPerRow ];
+ pMap[ j ] = new sal_uInt8[ nBytesPerRow ];
}
catch (std::bad_alloc)
{
pMap[ j ] = NULL;
- bStatus = FALSE;
+ bStatus = sal_False;
break;
}
}
@@ -1304,7 +1321,7 @@ BOOL TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
nMaxPos = Max( pTIFF->Tell(), nMaxPos );
}
else
- bStatus = FALSE;
+ bStatus = sal_False;
if( pAcc )
{
@@ -1355,49 +1372,23 @@ BOOL TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
else
rGraphic = aAnimation; //aBitmap;
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
//================== GraphicImport - die exportierte Funktion ================
-extern "C" BOOL __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, BOOL )
+extern "C" sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool )
{
TIFFReader aTIFFReader;
- if ( aTIFFReader.ReadTIFF( rStream, rGraphic ) == FALSE )
- return FALSE;
-
- return TRUE;
-}
-
-//============================= fuer Windows ==================================
-
-#ifdef WIN
-
-static HINSTANCE hDLLInst = 0; // HANDLE der DLL
-
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
- if ( nHeap )
- UnlockData( 0 );
-#endif
-
- hDLLInst = hDLL;
+ if ( aTIFFReader.ReadTIFF( rStream, rGraphic ) == sal_False )
+ return sal_False;
- return TRUE;
+ return sal_True;
}
-extern "C" int CALLBACK WEP( int )
-{
- return 1;
-}
-
-#endif
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/itiff/lzwdecom.cxx b/filter/source/graphicfilter/itiff/lzwdecom.cxx
index 1f9ec70fa943..4f5cad84cad7 100644
--- a/filter/source/graphicfilter/itiff/lzwdecom.cxx
+++ b/filter/source/graphicfilter/itiff/lzwdecom.cxx
@@ -34,18 +34,18 @@
LZWDecompressor::LZWDecompressor()
: pOutBufData(NULL)
{
- USHORT i;
+ sal_uInt16 i;
pTable=new LZWTableEntry[4096];
- pOutBuf=new BYTE[4096];
+ pOutBuf=new sal_uInt8[4096];
for (i=0; i<4096; i++)
{
pTable[i].nPrevCode=0;
pTable[i].nDataCount=1;
- pTable[i].nData=(BYTE)i;
+ pTable[i].nData=(sal_uInt8)i;
}
pIStream=NULL;
- bFirst = TRUE;
+ bFirst = sal_True;
nOldCode = 0;
}
@@ -63,7 +63,7 @@ void LZWDecompressor::StartDecompression(SvStream & rIStream)
nTableSize=258;
- bEOIFound=FALSE;
+ bEOIFound=sal_False;
nOutBufDataLen=0;
@@ -74,7 +74,7 @@ void LZWDecompressor::StartDecompression(SvStream & rIStream)
if ( bFirst )
{
bInvert = nInputBitsBuf == 1;
- bFirst = FALSE;
+ bFirst = sal_False;
}
if ( bInvert )
@@ -82,9 +82,9 @@ void LZWDecompressor::StartDecompression(SvStream & rIStream)
}
-ULONG LZWDecompressor::Decompress(BYTE * pTarget, ULONG nMaxCount)
+sal_uLong LZWDecompressor::Decompress(sal_uInt8 * pTarget, sal_uLong nMaxCount)
{
- ULONG nCount;
+ sal_uLong nCount;
if (pIStream==NULL) return 0;
@@ -93,8 +93,8 @@ ULONG LZWDecompressor::Decompress(BYTE * pTarget, ULONG nMaxCount)
if (pIStream->GetError()) break;
- if (((ULONG)nOutBufDataLen)>=nMaxCount) {
- nOutBufDataLen = nOutBufDataLen - (USHORT)nMaxCount;
+ if (((sal_uLong)nOutBufDataLen)>=nMaxCount) {
+ nOutBufDataLen = nOutBufDataLen - (sal_uInt16)nMaxCount;
nCount+=nMaxCount;
while (nMaxCount>0) {
*(pTarget++)=*(pOutBufData++);
@@ -103,14 +103,14 @@ ULONG LZWDecompressor::Decompress(BYTE * pTarget, ULONG nMaxCount)
break;
}
- nMaxCount-=(ULONG)nOutBufDataLen;
+ nMaxCount-=(sal_uLong)nOutBufDataLen;
nCount+=nOutBufDataLen;
while (nOutBufDataLen>0) {
*(pTarget++)=*(pOutBufData++);
nOutBufDataLen--;
}
- if (bEOIFound==TRUE) break;
+ if (bEOIFound==sal_True) break;
DecompressSome();
@@ -120,9 +120,9 @@ ULONG LZWDecompressor::Decompress(BYTE * pTarget, ULONG nMaxCount)
}
-USHORT LZWDecompressor::GetNextCode()
+sal_uInt16 LZWDecompressor::GetNextCode()
{
- USHORT nBits,nCode;
+ sal_uInt16 nBits,nCode;
if (nTableSize<511) nBits=9;
else if (nTableSize<1023) nBits=10;
@@ -153,7 +153,7 @@ USHORT LZWDecompressor::GetNextCode()
}
-void LZWDecompressor::AddToTable(USHORT nPrevCode, USHORT nCodeFirstData)
+void LZWDecompressor::AddToTable(sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData)
{
while (pTable[nCodeFirstData].nDataCount>1)
nCodeFirstData=pTable[nCodeFirstData].nPrevCode;
@@ -168,17 +168,17 @@ void LZWDecompressor::AddToTable(USHORT nPrevCode, USHORT nCodeFirstData)
void LZWDecompressor::DecompressSome()
{
- USHORT i,nCode;
+ sal_uInt16 i,nCode;
nCode=GetNextCode();
if (nCode==256) {
nTableSize=258;
nCode=GetNextCode();
- if (nCode==257) { bEOIFound=TRUE; return; }
+ if (nCode==257) { bEOIFound=sal_True; return; }
}
else if (nCode<nTableSize) AddToTable(nOldCode,nCode);
else if (nCode==nTableSize) AddToTable(nOldCode,nOldCode);
- else { bEOIFound=TRUE; return; }
+ else { bEOIFound=sal_True; return; }
nOldCode=nCode;
diff --git a/filter/source/graphicfilter/itiff/lzwdecom.hxx b/filter/source/graphicfilter/itiff/lzwdecom.hxx
index ec9b7f5e4fc4..6409b3d308ec 100644
--- a/filter/source/graphicfilter/itiff/lzwdecom.hxx
+++ b/filter/source/graphicfilter/itiff/lzwdecom.hxx
@@ -32,9 +32,9 @@
#include <tools/stream.hxx>
struct LZWTableEntry {
- USHORT nPrevCode;
- USHORT nDataCount;
- BYTE nData;
+ sal_uInt16 nPrevCode;
+ sal_uInt16 nDataCount;
+ sal_uInt8 nData;
};
class LZWDecompressor {
@@ -46,32 +46,32 @@ public:
void StartDecompression(SvStream & rIStream);
- ULONG Decompress(BYTE * pTarget, ULONG nMaxCount);
+ sal_uLong Decompress(sal_uInt8 * pTarget, sal_uLong nMaxCount);
// Liefert die Anzahl der geschriebenen Bytes, wenn < nMaxCount,
// sind keine weiteren Daten zu entpacken, oder es ist ein
// Fehler aufgetreten.
private:
- USHORT GetNextCode();
- void AddToTable(USHORT nPrevCode, USHORT nCodeFirstData);
+ sal_uInt16 GetNextCode();
+ void AddToTable(sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData);
void DecompressSome();
SvStream * pIStream;
LZWTableEntry * pTable;
- USHORT nTableSize;
+ sal_uInt16 nTableSize;
- BOOL bEOIFound, bInvert, bFirst;
+ sal_Bool bEOIFound, bInvert, bFirst;
- USHORT nOldCode;
+ sal_uInt16 nOldCode;
- BYTE * pOutBuf;
- BYTE * pOutBufData;
- USHORT nOutBufDataLen;
+ sal_uInt8 * pOutBuf;
+ sal_uInt8 * pOutBufData;
+ sal_uInt16 nOutBufDataLen;
- BYTE nInputBitsBuf;
- USHORT nInputBitsBufSize;
+ sal_uInt8 nInputBitsBuf;
+ sal_uInt16 nInputBitsBufSize;
};
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index b99a682539aa..7dc457222ab2 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -208,7 +208,7 @@ void EscherPropertyContainer::AddOpt( sal_uInt16 nPropID, sal_Bool bBlib, sal_uI
if ( bBlib ) // bBlib is only valid when fComplex = 0
nPropID |= 0x4000;
if ( pProp )
- nPropID |= 0x8000; // fComplex = TRUE;
+ nPropID |= 0x8000; // fComplex = sal_True;
sal_uInt32 i;
for( i = 0; i < nSortCount; i++ )
@@ -291,8 +291,8 @@ EscherProperties EscherPropertyContainer::GetOpts() const
extern "C" int __LOADONCALLAPI EscherPropSortFunc( const void* p1, const void* p2 )
{
- INT16 nID1 = ((EscherPropSortStruct*)p1)->nPropId &~0xc000;
- INT16 nID2 = ((EscherPropSortStruct*)p2)->nPropId &~0xc000;
+ sal_Int16 nID1 = ((EscherPropSortStruct*)p1)->nPropId &~0xc000;
+ sal_Int16 nID2 = ((EscherPropSortStruct*)p2)->nPropId &~0xc000;
if( nID1 < nID2 )
return -1;
@@ -1176,7 +1176,7 @@ sal_Bool EscherPropertyContainer::ImplCreateEmbeddedBmp( const ByteString& rUniq
{
// grab BLIP from stream and insert directly as complex property
// ownership of stream memory goes to complex property
- aMemStrm.ObjectOwnsMemory( FALSE );
+ aMemStrm.ObjectOwnsMemory( sal_False );
sal_uInt8* pBuf = (sal_uInt8*) aMemStrm.GetData();
sal_uInt32 nSize = aMemStrm.Seek( STREAM_SEEK_TO_END );
AddOpt( ESCHER_Prop_fillBlip, sal_True, nSize, pBuf, nSize );
@@ -1381,7 +1381,7 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
INetURLObject aTmp( aGraphicUrl );
GraphicDescriptor aDescriptor(aTmp);
aDescriptor.Detect();
- const USHORT nFormat = aDescriptor.GetFileFormat();
+ const sal_uInt16 nFormat = aDescriptor.GetFileFormat();
// can MSO handle it?
if ( bMirrored || nAngle ||
@@ -1472,7 +1472,7 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
{
// grab BLIP from stream and insert directly as complex property
// ownership of stream memory goes to complex property
- aMemStrm.ObjectOwnsMemory( FALSE );
+ aMemStrm.ObjectOwnsMemory( sal_False );
sal_uInt8* pBuf = (sal_uInt8*) aMemStrm.GetData();
sal_uInt32 nSize = aMemStrm.Seek( STREAM_SEEK_TO_END );
AddOpt( ESCHER_Prop_fillBlip, sal_True, nSize, pBuf, nSize );
@@ -1788,8 +1788,8 @@ sal_Bool EscherPropertyContainer::CreatePolygonProperties(
AddOpt( ESCHER_Prop_geoBottom, rGeoRect.Height );
AddOpt( ESCHER_Prop_shapePath, ESCHER_ShapeComplex );
- AddOpt( ESCHER_Prop_pVertices, TRUE, nVerticesBufSize - 6, (sal_uInt8*)pVerticesBuf, nVerticesBufSize );
- AddOpt( ESCHER_Prop_pSegmentInfo, TRUE, nSegmentBufSize, (sal_uInt8*)pSegmentBuf, nSegmentBufSize );
+ AddOpt( ESCHER_Prop_pVertices, sal_True, nVerticesBufSize - 6, (sal_uInt8*)pVerticesBuf, nVerticesBufSize );
+ AddOpt( ESCHER_Prop_pSegmentInfo, sal_True, nSegmentBufSize, (sal_uInt8*)pSegmentBuf, nSegmentBufSize );
}
}
return bRetValue;
@@ -2122,7 +2122,7 @@ void EscherPropertyContainer::LookForPolarHandles( const MSO_SPT eShapeType, sal
sal_Bool EscherPropertyContainer::GetAdjustmentValue( const com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue & rkProp, sal_Int32 nIndex, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, sal_Int32& nValue )
{
if ( rkProp.State != beans::PropertyState_DIRECT_VALUE )
- return FALSE;
+ return sal_False;
sal_Bool bUseFixedFloat = ( nAdjustmentsWhichNeedsToBeConverted & ( 1 << nIndex ) ) != 0;
if ( rkProp.Value.getValueTypeClass() == uno::TypeClass_DOUBLE )
@@ -2140,7 +2140,7 @@ sal_Bool EscherPropertyContainer::GetAdjustmentValue( const com::sun::star::draw
nValue <<= 16;
}
- return TRUE;
+ return sal_True;
}
void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeType, const uno::Reference< drawing::XShape > & rXShape )
@@ -3287,22 +3287,22 @@ EscherPersistTable::~EscherPersistTable()
delete (EscherPersistEntry*)pPtr;
}
-BOOL EscherPersistTable::PtIsID( UINT32 nID )
+sal_Bool EscherPersistTable::PtIsID( sal_uInt32 nID )
{
for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
{
if ( ((EscherPersistEntry*)pPtr)->mnID == nID )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-void EscherPersistTable::PtInsert( UINT32 nID, UINT32 nOfs )
+void EscherPersistTable::PtInsert( sal_uInt32 nID, sal_uInt32 nOfs )
{
maPersistTable.Insert( new EscherPersistEntry( nID, nOfs ) );
}
-UINT32 EscherPersistTable::PtDelete( UINT32 nID )
+sal_uInt32 EscherPersistTable::PtDelete( sal_uInt32 nID )
{
for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
{
@@ -3314,7 +3314,7 @@ UINT32 EscherPersistTable::PtDelete( UINT32 nID )
return 0;
}
-UINT32 EscherPersistTable::PtGetOffsetByID( UINT32 nID )
+sal_uInt32 EscherPersistTable::PtGetOffsetByID( sal_uInt32 nID )
{
for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
{
@@ -3324,13 +3324,13 @@ UINT32 EscherPersistTable::PtGetOffsetByID( UINT32 nID )
return 0;
};
-UINT32 EscherPersistTable::PtReplace( UINT32 nID, UINT32 nOfs )
+sal_uInt32 EscherPersistTable::PtReplace( sal_uInt32 nID, sal_uInt32 nOfs )
{
for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
{
if ( ((EscherPersistEntry*)pPtr)->mnID == nID )
{
- UINT32 nRetValue = ((EscherPersistEntry*)pPtr)->mnOffset;
+ sal_uInt32 nRetValue = ((EscherPersistEntry*)pPtr)->mnOffset;
((EscherPersistEntry*)pPtr)->mnOffset = nOfs;
return nRetValue;
}
@@ -3338,13 +3338,13 @@ UINT32 EscherPersistTable::PtReplace( UINT32 nID, UINT32 nOfs )
return 0;
}
-UINT32 EscherPersistTable::PtReplaceOrInsert( UINT32 nID, UINT32 nOfs )
+sal_uInt32 EscherPersistTable::PtReplaceOrInsert( sal_uInt32 nID, sal_uInt32 nOfs )
{
for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
{
if ( ((EscherPersistEntry*)pPtr)->mnID == nID )
{
- UINT32 nRetValue = ((EscherPersistEntry*)pPtr)->mnOffset;
+ sal_uInt32 nRetValue = ((EscherPersistEntry*)pPtr)->mnOffset;
((EscherPersistEntry*)pPtr)->mnOffset = nOfs;
return nRetValue;
}
@@ -3416,7 +3416,7 @@ EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject
mnSizeExtra ( 0 ),
maPrefSize ( rObject.GetPrefSize() ),
maPrefMapMode ( rObject.GetPrefMapMode() ),
- mbIsEmpty ( TRUE )
+ mbIsEmpty ( sal_True )
{
mbIsNativeGraphicPossible = ( pGraphicAttr == NULL );
meBlibType = UNKNOWN;
@@ -3453,12 +3453,12 @@ EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject
<< pGraphicAttr->GetChannelG()
<< pGraphicAttr->GetChannelB()
<< pGraphicAttr->GetGamma()
- << (BOOL)( pGraphicAttr->IsInvert() == TRUE )
+ << (sal_Bool)( pGraphicAttr->IsInvert() == sal_True )
<< pGraphicAttr->GetTransparency();
mnIdentifier[ 1 ] = rtl_crc32( 0, aSt.GetData(), aSt.Tell() );
}
else
- mbIsNativeGraphicPossible = TRUE;
+ mbIsNativeGraphicPossible = sal_True;
}
sal_uInt32 i, nTmp, n1, n2;
n1 = n2 = 0;
@@ -3473,7 +3473,7 @@ EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject
}
mnIdentifier[ 2 ] = n1;
mnIdentifier[ 3 ] = n2;
- mbIsEmpty = FALSE;
+ mbIsEmpty = sal_False;
}
};
@@ -3507,14 +3507,14 @@ EscherBlibEntry::~EscherBlibEntry()
{
};
-BOOL EscherBlibEntry::operator==( const EscherBlibEntry& rEscherBlibEntry ) const
+sal_Bool EscherBlibEntry::operator==( const EscherBlibEntry& rEscherBlibEntry ) const
{
for ( int i = 0; i < 3; i++ )
{
if ( mnIdentifier[ i ] != rEscherBlibEntry.mnIdentifier[ i ] )
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
EscherGraphicProvider::EscherGraphicProvider( sal_uInt32 nFlags ) :
@@ -3527,7 +3527,7 @@ EscherGraphicProvider::EscherGraphicProvider( sal_uInt32 nFlags ) :
EscherGraphicProvider::~EscherGraphicProvider()
{
- for ( UINT32 i = 0; i < mnBlibEntrys; delete mpBlibEntrys[ i++ ] ) ;
+ for ( sal_uInt32 i = 0; i < mnBlibEntrys; delete mpBlibEntrys[ i++ ] ) ;
delete[] mpBlibEntrys;
}
@@ -3540,13 +3540,13 @@ void EscherGraphicProvider::SetNewBlipStreamOffset( sal_Int32 nOffset )
}
}
-UINT32 EscherGraphicProvider::ImplInsertBlib( EscherBlibEntry* p_EscherBlibEntry )
+sal_uInt32 EscherGraphicProvider::ImplInsertBlib( EscherBlibEntry* p_EscherBlibEntry )
{
if ( mnBlibBufSize == mnBlibEntrys )
{
mnBlibBufSize += 64;
EscherBlibEntry** pTemp = new EscherBlibEntry*[ mnBlibBufSize ];
- for ( UINT32 i = 0; i < mnBlibEntrys; i++ )
+ for ( sal_uInt32 i = 0; i < mnBlibEntrys; i++ )
{
pTemp[ i ] = mpBlibEntrys[ i ];
}
@@ -3601,15 +3601,15 @@ void EscherGraphicProvider::WriteBlibStoreContainer( SvStream& rSt, SvStream* pM
// BLIP
pMergePicStreamBSE->Seek( pBlibEntry->mnPictureOffset );
- UINT16 n16;
+ sal_uInt16 n16;
// record version and instance
*pMergePicStreamBSE >> n16;
rSt << n16;
// record type
*pMergePicStreamBSE >> n16;
- rSt << UINT16( ESCHER_BlipFirst + nBlibType );
+ rSt << sal_uInt16( ESCHER_BlipFirst + nBlibType );
DBG_ASSERT( n16 == ESCHER_BlipFirst + nBlibType , "EscherGraphicProvider::WriteBlibStoreContainer: BLIP record types differ" );
- UINT32 n32;
+ sal_uInt32 n32;
// record size
*pMergePicStreamBSE >> n32;
nBlipSize -= 8;
@@ -3618,7 +3618,7 @@ void EscherGraphicProvider::WriteBlibStoreContainer( SvStream& rSt, SvStream* pM
// record
while ( nBlipSize )
{
- UINT32 nBytes = ( nBlipSize > nBuf ? nBuf : nBlipSize );
+ sal_uInt32 nBytes = ( nBlipSize > nBuf ? nBuf : nBlipSize );
pMergePicStreamBSE->Read( pBuf, nBytes );
rSt.Write( pBuf, nBytes );
nBlipSize -= nBytes;
@@ -3656,7 +3656,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const ByteSt
EscherBlibEntry* p_EscherBlibEntry = new EscherBlibEntry( rPicOutStrm.Tell(), aGraphicObject, rId, pGraphicAttr );
if ( !p_EscherBlibEntry->IsEmpty() )
{
- for ( UINT32 i = 0; i < mnBlibEntrys; i++ )
+ for ( sal_uInt32 i = 0; i < mnBlibEntrys; i++ )
{
if ( *( mpBlibEntrys[ i ] ) == *p_EscherBlibEntry )
{
@@ -3666,7 +3666,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const ByteSt
}
}
- sal_Bool bUseNativeGraphic( FALSE );
+ sal_Bool bUseNativeGraphic( sal_False );
Graphic aGraphic( aGraphicObject.GetTransformedGraphic( pGraphicAttr ) );
GfxLink aGraphicLink;
@@ -3712,7 +3712,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const ByteSt
default: break;
}
if ( p_EscherBlibEntry->meBlibType != UNKNOWN )
- bUseNativeGraphic = TRUE;
+ bUseNativeGraphic = sal_True;
}
}
if ( !bUseNativeGraphic )
@@ -3772,8 +3772,8 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const ByteSt
if ( mnFlags & _E_GRAPH_PROV_USE_INSTANCES )
{
- rPicOutStrm << (UINT32)( 0x7f90000 | (UINT16)( mnBlibEntrys << 4 ) )
- << (UINT32)0;
+ rPicOutStrm << (sal_uInt32)( 0x7f90000 | (sal_uInt16)( mnBlibEntrys << 4 ) )
+ << (sal_uInt32)0;
nAtomSize = rPicOutStrm.Tell();
if ( eBlibType == PNG )
rPicOutStrm << (sal_uInt16)0x0606;
@@ -3825,9 +3825,9 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const ByteSt
around, and the original size and scaling factor in word
will be a very strange figure
*/
- UINT32 nPrefWidth = p_EscherBlibEntry->maPrefSize.Width();
- UINT32 nPrefHeight = p_EscherBlibEntry->maPrefSize.Height();
- UINT32 nWidth, nHeight;
+ sal_uInt32 nPrefWidth = p_EscherBlibEntry->maPrefSize.Width();
+ sal_uInt32 nPrefHeight = p_EscherBlibEntry->maPrefSize.Height();
+ sal_uInt32 nWidth, nHeight;
if ( pVisArea )
{
nWidth = pVisArea->Width * 360;
@@ -4060,7 +4060,7 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( sal_Bool bFirst )
if ( pList )
{
Polygon aPoly;
- USHORT nNum, nAnz = pList->GetCount();
+ sal_uInt16 nNum, nAnz = pList->GetCount();
if ( nAnz )
{
for ( nNum = 0; nNum < nAnz; nNum++ )
@@ -4076,7 +4076,7 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( sal_Bool bFirst )
}
else if ( nGluePointType == com::sun::star::drawing::EnhancedCustomShapeGluePointType::SEGMENTS )
{
- SdrObject* pPoly = pCustoShape->DoConvertToPolyObj( TRUE );
+ SdrObject* pPoly = pCustoShape->DoConvertToPolyObj( sal_True );
if ( pPoly && pPoly->ISA( SdrPathObj ) )
{
sal_Int16 a, b, nIndex = 0;
@@ -4355,8 +4355,8 @@ EscherEx::EscherEx( const EscherExGlobalRef& rxGlobal, SvStream& rOutStrm ) :
mnGroupLevel ( 0 ),
mnHellLayerId ( USHRT_MAX ),
- mbEscherSpgr ( FALSE ),
- mbEscherDg ( FALSE )
+ mbEscherSpgr ( sal_False ),
+ mbEscherDg ( sal_False )
{
mnStrmStartOfs = mpOutStrm->Tell();
mpImplEscherExSdr.reset( new ImplEscherExSdr( *this ) );
@@ -4401,15 +4401,15 @@ void EscherEx::Flush( SvStream* pPicStreamMergeBSE /* = NULL */ )
}
}
-void EscherEx::InsertAtCurrentPos( UINT32 nBytes, bool bExpandEndOfAtom )
+void EscherEx::InsertAtCurrentPos( sal_uInt32 nBytes, bool bExpandEndOfAtom )
{
- UINT32 nSize, nType, nSource, nBufSize, nToCopy, nCurPos = mpOutStrm->Tell();
- BYTE* pBuf;
+ sal_uInt32 nSize, nType, nSource, nBufSize, nToCopy, nCurPos = mpOutStrm->Tell();
+ sal_uInt8* pBuf;
// Persist table anpassen
for ( void* pPtr = maPersistTable.First(); pPtr; pPtr = maPersistTable.Next() )
{
- UINT32 nOfs = ((EscherPersistEntry*)pPtr)->mnOffset;
+ sal_uInt32 nOfs = ((EscherPersistEntry*)pPtr)->mnOffset;
if ( nOfs >= nCurPos )
((EscherPersistEntry*)pPtr)->mnOffset += nBytes;
}
@@ -4427,7 +4427,7 @@ void EscherEx::InsertAtCurrentPos( UINT32 nBytes, bool bExpandEndOfAtom )
if ( (nCurPos < nEndOfRecord) || ((nCurPos == nEndOfRecord) && (bContainer || bExpandEndOfAtom)) )
{
mpOutStrm->SeekRel( -4 );
- *mpOutStrm << (UINT32)( nSize + nBytes );
+ *mpOutStrm << (sal_uInt32)( nSize + nBytes );
if ( !bContainer )
mpOutStrm->SeekRel( nSize );
}
@@ -4445,7 +4445,7 @@ void EscherEx::InsertAtCurrentPos( UINT32 nBytes, bool bExpandEndOfAtom )
mpOutStrm->Seek( STREAM_SEEK_TO_END );
nSource = mpOutStrm->Tell();
nToCopy = nSource - nCurPos; // Stream um nBytes vergroessern
- pBuf = new BYTE[ 0x40000 ]; // 256KB Buffer
+ pBuf = new sal_uInt8[ 0x40000 ]; // 256KB Buffer
while ( nToCopy )
{
nBufSize = ( nToCopy >= 0x40000 ) ? 0x40000 : nToCopy;
@@ -4460,9 +4460,9 @@ void EscherEx::InsertAtCurrentPos( UINT32 nBytes, bool bExpandEndOfAtom )
mpOutStrm->Seek( nCurPos );
}
-BOOL EscherEx::SeekBehindRecHeader( UINT16 nRecType )
+sal_Bool EscherEx::SeekBehindRecHeader( sal_uInt16 nRecType )
{
- UINT32 nOldPos, nStreamEnd, nType, nSize;
+ sal_uInt32 nOldPos, nStreamEnd, nType, nSize;
nOldPos = mpOutStrm->Tell();
nStreamEnd = mpOutStrm->Seek( STREAM_SEEK_TO_END );
@@ -4471,52 +4471,52 @@ BOOL EscherEx::SeekBehindRecHeader( UINT16 nRecType )
{
*mpOutStrm >> nType >> nSize;
if ( ( nType >> 16 ) == nRecType )
- return TRUE;
+ return sal_True;
if ( ( nType & 0xf ) != 0xf )
mpOutStrm->SeekRel( nSize );
}
mpOutStrm->Seek( nOldPos );
- return FALSE;
+ return sal_False;
}
-void EscherEx::InsertPersistOffset( UINT32 nKey, UINT32 nOffset )
+void EscherEx::InsertPersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset )
{
PtInsert( ESCHER_Persist_PrivateEntry | nKey, nOffset );
}
-void EscherEx::ReplacePersistOffset( UINT32 nKey, UINT32 nOffset )
+void EscherEx::ReplacePersistOffset( sal_uInt32 nKey, sal_uInt32 nOffset )
{
PtReplace( ESCHER_Persist_PrivateEntry | nKey, nOffset );
}
-UINT32 EscherEx::GetPersistOffset( UINT32 nKey )
+sal_uInt32 EscherEx::GetPersistOffset( sal_uInt32 nKey )
{
return PtGetOffsetByID( ESCHER_Persist_PrivateEntry | nKey );
}
-BOOL EscherEx::DoSeek( UINT32 nKey )
+sal_Bool EscherEx::DoSeek( sal_uInt32 nKey )
{
- UINT32 nPos = PtGetOffsetByID( nKey );
+ sal_uInt32 nPos = PtGetOffsetByID( nKey );
if ( nPos )
mpOutStrm->Seek( nPos );
else
{
if (! PtIsID( nKey ) )
- return FALSE;
+ return sal_False;
mpOutStrm->Seek( 0 );
}
- return TRUE;
+ return sal_True;
}
-BOOL EscherEx::SeekToPersistOffset( UINT32 nKey )
+sal_Bool EscherEx::SeekToPersistOffset( sal_uInt32 nKey )
{
return DoSeek( ESCHER_Persist_PrivateEntry | nKey );
}
-BOOL EscherEx::InsertAtPersistOffset( UINT32 nKey, UINT32 nValue )
+sal_Bool EscherEx::InsertAtPersistOffset( sal_uInt32 nKey, sal_uInt32 nValue )
{
- UINT32 nOldPos = mpOutStrm->Tell();
- BOOL bRetValue = SeekToPersistOffset( nKey );
+ sal_uInt32 nOldPos = mpOutStrm->Tell();
+ sal_Bool bRetValue = SeekToPersistOffset( nKey );
if ( bRetValue )
{
*mpOutStrm << nValue;
@@ -4525,9 +4525,9 @@ BOOL EscherEx::InsertAtPersistOffset( UINT32 nKey, UINT32 nValue )
return bRetValue;
}
-void EscherEx::OpenContainer( UINT16 nEscherContainer, int nRecInstance )
+void EscherEx::OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance )
{
- *mpOutStrm << (UINT16)( ( nRecInstance << 4 ) | 0xf ) << nEscherContainer << (UINT32)0;
+ *mpOutStrm << (sal_uInt16)( ( nRecInstance << 4 ) | 0xf ) << nEscherContainer << (sal_uInt32)0;
mOffsets.push_back( mpOutStrm->Tell() - 4 );
mRecTypes.push_back( nEscherContainer );
switch( nEscherContainer )
@@ -4551,12 +4551,12 @@ void EscherEx::OpenContainer( UINT16 nEscherContainer, int nRecInstance )
{
if ( !mbEscherDg )
{
- mbEscherDg = TRUE;
+ mbEscherDg = sal_True;
mnCurrentDg = mxGlobal->GenerateDrawingId();
AddAtom( 8, ESCHER_Dg, 0, mnCurrentDg );
PtReplaceOrInsert( ESCHER_Persist_Dg | mnCurrentDg, mpOutStrm->Tell() );
- *mpOutStrm << (UINT32)0 // The number of shapes in this drawing
- << (UINT32)0; // The last MSOSPID given to an SP in this DG
+ *mpOutStrm << (sal_uInt32)0 // The number of shapes in this drawing
+ << (sal_uInt32)0; // The last MSOSPID given to an SP in this DG
}
}
}
@@ -4566,7 +4566,7 @@ void EscherEx::OpenContainer( UINT16 nEscherContainer, int nRecInstance )
{
if ( mbEscherDg )
{
- mbEscherSpgr = TRUE;
+ mbEscherSpgr = sal_True;
}
}
break;
@@ -4594,7 +4594,7 @@ void EscherEx::CloseContainer()
{
if ( mbEscherDg )
{
- mbEscherDg = FALSE;
+ mbEscherDg = sal_False;
if ( DoSeek( ESCHER_Persist_Dg | mnCurrentDg ) )
*mpOutStrm << mxGlobal->GetDrawingShapeCount( mnCurrentDg ) << mxGlobal->GetLastShapeId( mnCurrentDg );
}
@@ -4605,7 +4605,7 @@ void EscherEx::CloseContainer()
{
if ( mbEscherSpgr )
{
- mbEscherSpgr = FALSE;
+ mbEscherSpgr = sal_False;
}
}
@@ -4622,21 +4622,21 @@ void EscherEx::CloseContainer()
void EscherEx::BeginAtom()
{
mnCountOfs = mpOutStrm->Tell();
- *mpOutStrm << (UINT32)0 << (UINT32)0; // record header wird spaeter geschrieben
+ *mpOutStrm << (sal_uInt32)0 << (sal_uInt32)0; // record header wird spaeter geschrieben
}
-void EscherEx::EndAtom( UINT16 nRecType, int nRecVersion, int nRecInstance )
+void EscherEx::EndAtom( sal_uInt16 nRecType, int nRecVersion, int nRecInstance )
{
- UINT32 nOldPos = mpOutStrm->Tell();
+ sal_uInt32 nOldPos = mpOutStrm->Tell();
mpOutStrm->Seek( mnCountOfs );
sal_uInt32 nSize = nOldPos - mnCountOfs;
- *mpOutStrm << (UINT16)( ( nRecInstance << 4 ) | ( nRecVersion & 0xf ) ) << nRecType << (UINT32)( nSize - 8 );
+ *mpOutStrm << (sal_uInt16)( ( nRecInstance << 4 ) | ( nRecVersion & 0xf ) ) << nRecType << (sal_uInt32)( nSize - 8 );
mpOutStrm->Seek( nOldPos );
}
-void EscherEx::AddAtom( UINT32 nAtomSize, UINT16 nRecType, int nRecVersion, int nRecInstance )
+void EscherEx::AddAtom( sal_uInt32 nAtomSize, sal_uInt16 nRecType, int nRecVersion, int nRecInstance )
{
- *mpOutStrm << (UINT16)( ( nRecInstance << 4 ) | ( nRecVersion & 0xf ) ) << nRecType << nAtomSize;
+ *mpOutStrm << (sal_uInt16)( ( nRecInstance << 4 ) | ( nRecVersion & 0xf ) ) << nRecType << nAtomSize;
}
void EscherEx::AddChildAnchor( const Rectangle& rRect )
@@ -4662,7 +4662,7 @@ EscherExHostAppData* EscherEx::EnterAdditionalTextGroup()
return NULL;
}
-UINT32 EscherEx::EnterGroup( const String& rShapeName, const Rectangle* pBoundRect )
+sal_uInt32 EscherEx::EnterGroup( const String& rShapeName, const Rectangle* pBoundRect )
{
Rectangle aRect;
if( pBoundRect )
@@ -4673,10 +4673,10 @@ UINT32 EscherEx::EnterGroup( const String& rShapeName, const Rectangle* pBoundRe
AddAtom( 16, ESCHER_Spgr, 1 );
PtReplaceOrInsert( ESCHER_Persist_Grouping_Snap | mnGroupLevel,
mpOutStrm->Tell() );
- *mpOutStrm << (INT32)aRect.Left() // Bounding box fuer die Gruppierten shapes an die sie attached werden
- << (INT32)aRect.Top()
- << (INT32)aRect.Right()
- << (INT32)aRect.Bottom();
+ *mpOutStrm << (sal_Int32)aRect.Left() // Bounding box fuer die Gruppierten shapes an die sie attached werden
+ << (sal_Int32)aRect.Top()
+ << (sal_Int32)aRect.Right()
+ << (sal_Int32)aRect.Bottom();
sal_uInt32 nShapeId = GenerateShapeId();
if ( !mnGroupLevel )
@@ -4710,38 +4710,38 @@ UINT32 EscherEx::EnterGroup( const String& rShapeName, const Rectangle* pBoundRe
return nShapeId;
}
-UINT32 EscherEx::EnterGroup( const Rectangle* pBoundRect )
+sal_uInt32 EscherEx::EnterGroup( const Rectangle* pBoundRect )
{
return EnterGroup( String::EmptyString(), pBoundRect );
}
-BOOL EscherEx::SetGroupSnapRect( UINT32 nGroupLevel, const Rectangle& rRect )
+sal_Bool EscherEx::SetGroupSnapRect( sal_uInt32 nGroupLevel, const Rectangle& rRect )
{
- BOOL bRetValue = FALSE;
+ sal_Bool bRetValue = sal_False;
if ( nGroupLevel )
{
- UINT32 nCurrentPos = mpOutStrm->Tell();
+ sal_uInt32 nCurrentPos = mpOutStrm->Tell();
if ( DoSeek( ESCHER_Persist_Grouping_Snap | ( nGroupLevel - 1 ) ) )
{
- *mpOutStrm << (INT32)rRect.Left() // Bounding box fuer die Gruppierten shapes an die sie attached werden
- << (INT32)rRect.Top()
- << (INT32)rRect.Right()
- << (INT32)rRect.Bottom();
+ *mpOutStrm << (sal_Int32)rRect.Left() // Bounding box fuer die Gruppierten shapes an die sie attached werden
+ << (sal_Int32)rRect.Top()
+ << (sal_Int32)rRect.Right()
+ << (sal_Int32)rRect.Bottom();
mpOutStrm->Seek( nCurrentPos );
}
}
return bRetValue;
}
-BOOL EscherEx::SetGroupLogicRect( UINT32 nGroupLevel, const Rectangle& rRect )
+sal_Bool EscherEx::SetGroupLogicRect( sal_uInt32 nGroupLevel, const Rectangle& rRect )
{
- BOOL bRetValue = FALSE;
+ sal_Bool bRetValue = sal_False;
if ( nGroupLevel )
{
- UINT32 nCurrentPos = mpOutStrm->Tell();
+ sal_uInt32 nCurrentPos = mpOutStrm->Tell();
if ( DoSeek( ESCHER_Persist_Grouping_Logic | ( nGroupLevel - 1 ) ) )
{
- *mpOutStrm << (INT16)rRect.Top() << (INT16)rRect.Left() << (INT16)rRect.Right() << (INT16)rRect.Bottom();
+ *mpOutStrm << (sal_Int16)rRect.Top() << (sal_Int16)rRect.Left() << (sal_Int16)rRect.Right() << (sal_Int16)rRect.Bottom();
mpOutStrm->Seek( nCurrentPos );
}
}
@@ -4756,7 +4756,7 @@ void EscherEx::LeaveGroup()
CloseContainer();
}
-void EscherEx::AddShape( UINT32 nShpInstance, UINT32 nFlags, UINT32 nShapeID )
+void EscherEx::AddShape( sal_uInt32 nShpInstance, sal_uInt32 nFlags, sal_uInt32 nShapeID )
{
AddAtom( 8, ESCHER_Sp, 2, nShpInstance );
@@ -4776,27 +4776,27 @@ void EscherEx::Commit( EscherPropertyContainer& rProps, const Rectangle& )
rProps.Commit( GetStream() );
}
-UINT32 EscherEx::GetColor( const UINT32 nSOColor, BOOL bSwap )
+sal_uInt32 EscherEx::GetColor( const sal_uInt32 nSOColor, sal_Bool bSwap )
{
if ( bSwap )
{
- UINT32 nColor = nSOColor & 0xff00; // GRUEN
- nColor |= (BYTE)( nSOColor ) << 16; // ROT
- nColor |= (BYTE)( nSOColor >> 16 ); // BLAU
+ sal_uInt32 nColor = nSOColor & 0xff00; // GRUEN
+ nColor |= (sal_uInt8)( nSOColor ) << 16; // ROT
+ nColor |= (sal_uInt8)( nSOColor >> 16 ); // BLAU
return nColor;
}
else
return nSOColor & 0xffffff;
}
-UINT32 EscherEx::GetColor( const Color& rSOColor, BOOL bSwap )
+sal_uInt32 EscherEx::GetColor( const Color& rSOColor, sal_Bool bSwap )
{
- UINT32 nColor = ( rSOColor.GetRed() << 16 );
+ sal_uInt32 nColor = ( rSOColor.GetRed() << 16 );
nColor |= ( rSOColor.GetGreen() << 8 );
nColor |= rSOColor.GetBlue();
if ( !bSwap )
- nColor = GetColor( nColor, TRUE );
+ nColor = GetColor( nColor, sal_True );
return nColor;
}
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index b77da0bb504e..fd908a117ce1 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -79,8 +79,8 @@ ImplEESdrWriter::ImplEESdrWriter( EscherEx& rEx )
mnPagesWritten ( 0 ),
mnShapeMasterTitle ( 0 ),
mnShapeMasterBody ( 0 ),
- mbStatusIndicator ( FALSE ),
- mbStatus ( FALSE )
+ mbStatusIndicator ( sal_False ),
+ mbStatus ( sal_False )
{
}
@@ -103,7 +103,7 @@ Size ImplEESdrWriter::ImplMapSize( const Size& rSize )
void ImplEESdrWriter::ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherPropertyContainer& rPropOpt )
{
- INT32 nAngle = rObj.GetAngle();
+ sal_Int32 nAngle = rObj.GetAngle();
Rectangle aRect( rObj.GetRect() );
if ( nAngle < 0 )
@@ -139,7 +139,7 @@ void ImplEESdrWriter::ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherProperty
nShapeType = nType; \
nShapeID = mpEscherEx->GenerateShapeId(); \
rObj.SetShapeId( nShapeID ); \
- mpEscherEx->AddShape( (UINT32)nType, (UINT32)nFlags, nShapeID ); \
+ mpEscherEx->AddShape( (sal_uInt32)nType, (sal_uInt32)nFlags, nShapeID ); \
rSolverContainer.AddShape( rObj.GetShapeRef(), nShapeID ); \
}
@@ -162,15 +162,15 @@ void ImplEESdrWriter::MapRect(ImplEESdrObject& /* rObj */ )
{
}
-UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
+sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
EscherSolverContainer& rSolverContainer,
ImplEESdrPageType ePageType )
{
- UINT32 nShapeID = 0;
- UINT16 nShapeType = 0;
- BOOL bDontWriteText = FALSE; // if a metafile is written as shape replacement, then the text is already part of the metafile
- BOOL bAdditionalText = FALSE;
- UINT32 nGrpShapeID = 0;
+ sal_uInt32 nShapeID = 0;
+ sal_uInt16 nShapeType = 0;
+ sal_Bool bDontWriteText = sal_False; // if a metafile is written as shape replacement, then the text is already part of the metafile
+ sal_Bool bAdditionalText = sal_False;
+ sal_uInt32 nGrpShapeID = 0;
do {
mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef(), (mpEscherEx->GetGroupLevel() > 1) ? &rObj.GetRect() : 0 );
@@ -194,7 +194,7 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
nShapeID = mpEscherEx->EnterGroup( aShapeName, &rObj.GetRect() );
nShapeType = ESCHER_ShpInst_Min;
- for( UINT32 n = 0, nCnt = xXIndexAccess->getCount();
+ for( sal_uInt32 n = 0, nCnt = xXIndexAccess->getCount();
n < nCnt; ++n )
{
ImplEESdrObject aObj( *this, *(Reference< XShape >*)
@@ -271,7 +271,7 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
else
{
ADD_SHAPE(
- sal::static_int_cast< UINT16 >(eShapeType),
+ sal::static_int_cast< sal_uInt16 >(eShapeType),
nMirrorFlags | 0xa00 );
aPropOpt.CreateCustomShapeProperties( eShapeType, rObj.GetShapeRef() );
aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );
@@ -292,7 +292,7 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
{
nRadius = ImplMapSize( Size( nRadius, 0 )).Width();
ADD_SHAPE( ESCHER_ShpInst_RoundRectangle, 0xa00 ); // Flags: Connector | HasSpt
- INT32 nLenght = rObj.GetRect().GetWidth();
+ sal_Int32 nLenght = rObj.GetRect().GetWidth();
if ( nLenght > rObj.GetRect().GetHeight() )
nLenght = rObj.GetRect().GetHeight();
nLenght >>= 1;
@@ -350,22 +350,22 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
}
else
{
- INT32 nStartAngle, nEndAngle;
+ sal_Int32 nStartAngle, nEndAngle;
if ( !rObj.ImplGetPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CircleStartAngle" )) ) )
break;
- nStartAngle = *( (INT32*)rObj.GetUsrAny().getValue() );
+ nStartAngle = *( (sal_Int32*)rObj.GetUsrAny().getValue() );
if( !rObj.ImplGetPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CircleEndAngle" )) ) )
break;
- nEndAngle = *( (INT32*)rObj.GetUsrAny().getValue() );
+ nEndAngle = *( (sal_Int32*)rObj.GetUsrAny().getValue() );
Point aStart, aEnd, aCenter;
- aStart.X() = (INT32)( ( cos( (double)( nStartAngle *
+ aStart.X() = (sal_Int32)( ( cos( (double)( nStartAngle *
F_PI18000 ) ) * 100.0 ) );
- aStart.Y() = - (INT32)( ( sin( (double)( nStartAngle *
+ aStart.Y() = - (sal_Int32)( ( sin( (double)( nStartAngle *
F_PI18000 ) ) * 100.0 ) );
- aEnd.X() = (INT32)( ( cos( (double)( nEndAngle *
+ aEnd.X() = (sal_Int32)( ( cos( (double)( nEndAngle *
F_PI18000 ) ) * 100.0 ) );
- aEnd.Y() = - (INT32)( ( sin( (double)( nEndAngle *
+ aEnd.Y() = - (sal_Int32)( ( sin( (double)( nEndAngle *
F_PI18000 ) ) * 100.0 ) );
const Rectangle& rRect = aRect100thmm;
aCenter.X() = rRect.Left() + ( rRect.GetWidth() / 2 );
@@ -438,7 +438,7 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
//i27942: Poly/Lines/Bezier do not support text.
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- UINT32 nFlags = 0xa00; // Flags: Connector | HasSpt
+ sal_uInt32 nFlags = 0xa00; // Flags: Connector | HasSpt
if( aNewRect.Height < 0 )
nFlags |= 0x80; // Flags: VertMirror
if( aNewRect.Width < 0 )
@@ -454,7 +454,7 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
if( rObj.ImplHasText() )
{
nGrpShapeID = ImplEnterAdditionalTextGroup( rObj.GetShapeRef(), &rObj.GetRect() );
- bAdditionalText = TRUE;
+ bAdditionalText = sal_True;
}
mpEscherEx->OpenContainer( ESCHER_SpContainer );
ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
@@ -493,7 +493,7 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
if ( rObj.ImplHasText() )
{
nGrpShapeID = ImplEnterAdditionalTextGroup( rObj.GetShapeRef(), &rObj.GetRect() );
- bAdditionalText = TRUE;
+ bAdditionalText = sal_True;
}
mpEscherEx->OpenContainer( ESCHER_SpContainer );
ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
@@ -511,7 +511,7 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
if( rObj.IsEmptyPresObj() && ( ePageType == NORMAL ) )
{
ADD_SHAPE( ESCHER_ShpInst_Rectangle, 0x220 ); // Flags: HaveAnchor | HaveMaster
- UINT32 nTxtBxId = mpEscherEx->QueryTextID( rObj.GetShapeRef(),
+ sal_uInt32 nTxtBxId = mpEscherEx->QueryTextID( rObj.GetShapeRef(),
rObj.GetShapeId() );
aPropOpt.AddOpt( ESCHER_Prop_lTxid, nTxtBxId );
aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x10001 );
@@ -549,7 +549,7 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
}
else if ( rObj.GetType().EqualsAscii( "drawing.Text" ))
{
- SHAPE_TEXT( TRUE );
+ SHAPE_TEXT( sal_True );
}
else if ( rObj.GetType().EqualsAscii( "drawing.Page" ))
{
@@ -571,7 +571,7 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
if( rObj.IsEmptyPresObj() && ( ePageType == NORMAL ) )
{
ADD_SHAPE( ESCHER_ShpInst_Rectangle, 0x220 ); // Flags: HaveAnchor | HaveMaster
- UINT32 nTxtBxId = mpEscherEx->QueryTextID( rObj.GetShapeRef(),
+ sal_uInt32 nTxtBxId = mpEscherEx->QueryTextID( rObj.GetShapeRef(),
rObj.GetShapeId() );
aPropOpt.AddOpt( ESCHER_Prop_lTxid, nTxtBxId );
aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x10001 );
@@ -581,7 +581,7 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
else
{
//2do: could be made an option in HostAppData whether OLE object should be written or not
- BOOL bAppOLE = TRUE;
+ sal_Bool bAppOLE = sal_True;
ADD_SHAPE( ESCHER_ShpInst_PictureFrame,
0xa00 | (bAppOLE ? SHAPEFLAG_OLESHAPE : 0) );
if ( aPropOpt.CreateOLEGraphicProperties( rObj.GetShapeRef() ) )
@@ -630,7 +630,7 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
if( USHRT_MAX != mpEscherEx->GetHellLayerId() &&
rObj.ImplGetPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayerID" )) ) &&
- (*((UINT16*)rObj.GetUsrAny().getValue()) ) == mpEscherEx->GetHellLayerId() )
+ (*((sal_uInt16*)rObj.GetUsrAny().getValue()) ) == mpEscherEx->GetHellLayerId() )
{
aPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x200020 );
}
@@ -676,8 +676,8 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
const Point& rTextRefPoint )
{
- UINT32 nShapeID = 0;
- UINT16 nShapeType = 0;
+ sal_uInt32 nShapeID = 0;
+ sal_uInt16 nShapeType = 0;
do
{
mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef(), (mpEscherEx->GetGroupLevel() > 1) ? &rObj.GetRect() : 0 );
@@ -691,7 +691,7 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
mpPicStrm = mpEscherEx->QueryPictureStream();
EscherPropertyContainer aPropOpt( mpEscherEx->GetGraphicProvider(), mpPicStrm, aRect100thmm );
rObj.SetAngle( rObj.ImplGetInt32PropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RotateAngle" ))));
- INT32 nAngle = rObj.GetAngle();
+ sal_Int32 nAngle = rObj.GetAngle();
if( rObj.GetType().EqualsAscii( "drawing.Line" ))
{
//2do: this does not work right
@@ -754,7 +754,7 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
// ClientTextbox
mpEscherEx->OpenContainer( ESCHER_ClientTextbox );
mpEscherEx->AddAtom( 4, EPP_TextHeaderAtom );
- *mpStrm << (UINT32)EPP_TEXTTYPE_Other; // Text in a Shape
+ *mpStrm << (sal_uInt32)EPP_TEXTTYPE_Other; // Text in a Shape
ImplWriteTextStyleAtom();
mpEscherEx->CloseContainer(); // ESCHER_ClientTextBox
#else // !EES_WRITE_EPP
@@ -772,40 +772,40 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
}
-UINT32 ImplEESdrWriter::ImplEnterAdditionalTextGroup( const Reference< XShape >& rShape,
+sal_uInt32 ImplEESdrWriter::ImplEnterAdditionalTextGroup( const Reference< XShape >& rShape,
const Rectangle* pBoundRect )
{
mpHostAppData = mpEscherEx->EnterAdditionalTextGroup();
- UINT32 nGrpId = mpEscherEx->EnterGroup( pBoundRect );
+ sal_uInt32 nGrpId = mpEscherEx->EnterGroup( pBoundRect );
mpHostAppData = mpEscherEx->StartShape( rShape, pBoundRect );
return nGrpId;
}
-BOOL ImplEESdrWriter::ImplInitPageValues()
+sal_Bool ImplEESdrWriter::ImplInitPageValues()
{
mnIndices = 0;
mnOutlinerCount = 0; // die gliederungsobjekte muessen dem layout entsprechen,
mnEffectCount = 0;
- mbIsTitlePossible = TRUE; // bei mehr als einem title geht powerpoint in die knie
+ mbIsTitlePossible = sal_True; // bei mehr als einem title geht powerpoint in die knie
- return TRUE;
+ return sal_True;
}
void ImplEESdrWriter::ImplWritePage(
EscherSolverContainer& rSolverContainer,
- ImplEESdrPageType ePageType, BOOL /* bBackGround */ )
+ ImplEESdrPageType ePageType, sal_Bool /* bBackGround */ )
{
ImplInitPageValues();
- UINT32 nLastPer = 0, nShapes = mXShapes->getCount();
- for( UINT32 n = 0; n < nShapes; ++n )
+ sal_uInt32 nLastPer = 0, nShapes = mXShapes->getCount();
+ for( sal_uInt32 n = 0; n < nShapes; ++n )
{
- UINT32 nPer = ( 5 * n ) / nShapes;
+ sal_uInt32 nPer = ( 5 * n ) / nShapes;
if( nPer != nLastPer )
{
nLastPer = nPer;
- UINT32 nValue = mnPagesWritten * 5 + nPer;
+ sal_uInt32 nValue = mnPagesWritten * 5 + nPer;
if( nValue > mnStatMaxValue )
nValue = mnStatMaxValue;
if( mbStatusIndicator )
@@ -917,7 +917,7 @@ void ImplEscherExSdr::ImplWriteCurrentPage()
}
-UINT32 ImplEscherExSdr::ImplWriteTheShape( ImplEESdrObject& rObj )
+sal_uInt32 ImplEscherExSdr::ImplWriteTheShape( ImplEESdrObject& rObj )
{
DBG_ASSERT( mpSolverContainer, "ImplEscherExSdr::ImplWriteShape: no SolverContainer" );
return ImplWriteShape( rObj, *mpSolverContainer, NORMAL );
@@ -936,7 +936,7 @@ void EscherEx::AddUnoShapes( const Reference< XShapes >& rxShapes )
mpImplEscherExSdr->ImplWriteCurrentPage();
}
-UINT32 EscherEx::AddSdrObject( const SdrObject& rObj )
+sal_uInt32 EscherEx::AddSdrObject( const SdrObject& rObj )
{
ImplEESdrObject aObj( *mpImplEscherExSdr, rObj );
if( aObj.IsValid() )
@@ -955,20 +955,20 @@ EscherExHostAppData* EscherEx::StartShape( const Reference< XShape >& /* rShape
return NULL;
}
-void EscherEx::EndShape( UINT16 /* nShapeType */, UINT32 /* nShapeID */ )
+void EscherEx::EndShape( sal_uInt16 /* nShapeType */, sal_uInt32 /* nShapeID */ )
{
}
-UINT32 EscherEx::QueryTextID( const Reference< XShape >&, UINT32 )
+sal_uInt32 EscherEx::QueryTextID( const Reference< XShape >&, sal_uInt32 )
{
return 0;
}
// add an dummy rectangle shape into the escher stream
-UINT32 EscherEx::AddDummyShape()
+sal_uInt32 EscherEx::AddDummyShape()
{
OpenContainer( ESCHER_SpContainer );
- UINT32 nShapeID = GenerateShapeId();
+ sal_uInt32 nShapeID = GenerateShapeId();
AddShape( ESCHER_ShpInst_Rectangle, 0xa00, nShapeID );
CloseContainer();
@@ -995,9 +995,9 @@ ImplEESdrObject::ImplEESdrObject( ImplEscherExSdr& rEx,
mnShapeId( 0 ),
mnTextSize( 0 ),
mnAngle( 0 ),
- mbValid( FALSE ),
- mbPresObj( FALSE ),
- mbEmptyPresObj( FALSE )
+ mbValid( sal_False ),
+ mbPresObj( sal_False ),
+ mbEmptyPresObj( sal_False )
{
SdrPage* pPage = rObj.GetPage();
DBG_ASSERT( pPage, "ImplEESdrObject::ImplEESdrObject: no SdrPage" );
@@ -1016,9 +1016,9 @@ ImplEESdrObject::ImplEESdrObject( ImplEESdrWriter& rEx,
mnShapeId( 0 ),
mnTextSize( 0 ),
mnAngle( 0 ),
- mbValid( FALSE ),
- mbPresObj( FALSE ),
- mbEmptyPresObj( FALSE )
+ mbValid( sal_False ),
+ mbPresObj( sal_False ),
+ mbEmptyPresObj( sal_False )
{
Init( rEx );
}
@@ -1051,45 +1051,45 @@ void ImplEESdrObject::Init( ImplEESdrWriter& rEx )
if( mbPresObj && ImplGetPropertyValue( sEmptyPresStr ) )
mbEmptyPresObj = ::cppu::any2bool( mAny );
- mbValid = TRUE;
+ mbValid = sal_True;
}
}
-BOOL ImplEESdrObject::ImplGetPropertyValue( const sal_Unicode* rString )
+sal_Bool ImplEESdrObject::ImplGetPropertyValue( const sal_Unicode* rString )
{
- BOOL bRetValue = FALSE;
+ sal_Bool bRetValue = sal_False;
if( mbValid )
{
try
{
mAny = mXPropSet->getPropertyValue( rString );
if( mAny.hasValue() )
- bRetValue = TRUE;
+ bRetValue = sal_True;
}
catch( ::com::sun::star::uno::Exception& )
{
- bRetValue = FALSE;
+ bRetValue = sal_False;
}
}
return bRetValue;
}
#ifdef USED
-BOOL ImplEESdrObject::ImplGetPropertyValue( const Reference< XPropertySet >& rXPropSet,
+sal_Bool ImplEESdrObject::ImplGetPropertyValue( const Reference< XPropertySet >& rXPropSet,
const OUString& rString )
{
- BOOL bRetValue = FALSE;
+ sal_Bool bRetValue = sal_False;
if( mbValid )
{
try
{
mAny = rXPropSet->getPropertyValue( rString );
if( 0 != mAny.get() )
- bRetValue = TRUE;
+ bRetValue = sal_True;
}
catch( ::com::sun::star::uno::Exception& )
{
- bRetValue = FALSE;
+ bRetValue = sal_False;
}
}
return bRetValue;
@@ -1107,7 +1107,7 @@ const SdrObject* ImplEESdrObject::GetSdrObject() const
}
// laedt und konvertiert text aus shape, ergebnis ist mnTextSize gespeichert
-UINT32 ImplEESdrObject::ImplGetText()
+sal_uInt32 ImplEESdrObject::ImplGetText()
{
Reference< XText > xXText( mXShape, UNO_QUERY );
mnTextSize = 0;
@@ -1116,7 +1116,7 @@ UINT32 ImplEESdrObject::ImplGetText()
return mnTextSize;
}
-BOOL ImplEESdrObject::ImplHasText() const
+sal_Bool ImplEESdrObject::ImplHasText() const
{
Reference< XText > xXText( mXShape, UNO_QUERY );
return xXText.is() && xXText->getString().getLength();
diff --git a/filter/source/msfilter/eschesdo.hxx b/filter/source/msfilter/eschesdo.hxx
index c7612b1b2aa3..7bac341dad91 100644
--- a/filter/source/msfilter/eschesdo.hxx
+++ b/filter/source/msfilter/eschesdo.hxx
@@ -46,12 +46,12 @@ class ImplEESdrObject
::com::sun::star::uno::Any mAny;
Rectangle maRect;
String mType;
- UINT32 mnShapeId;
- UINT32 mnTextSize;
- INT32 mnAngle;
- BOOL mbValid : 1;
- BOOL mbPresObj : 1;
- BOOL mbEmptyPresObj : 1;
+ sal_uInt32 mnShapeId;
+ sal_uInt32 mnTextSize;
+ sal_Int32 mnAngle;
+ sal_Bool mbValid : 1;
+ sal_Bool mbPresObj : 1;
+ sal_Bool mbEmptyPresObj : 1;
void Init( ImplEESdrWriter& rEx );
public:
@@ -61,11 +61,11 @@ public:
ImplEESdrObject( ImplEESdrWriter& rEx, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape );
~ImplEESdrObject();
- BOOL ImplGetPropertyValue( const sal_Unicode* pString );
+ sal_Bool ImplGetPropertyValue( const sal_Unicode* pString );
BOOL ImplGetPropertyValue( const rtl::OUString& rString ) { return ImplGetPropertyValue(rString.getStr()); }
- INT32 ImplGetInt32PropertyValue( const sal_Unicode* pStr, UINT32 nDef = 0 )
- { return ImplGetPropertyValue( pStr ) ? *(INT32*)mAny.getValue() : nDef; }
+ sal_Int32 ImplGetInt32PropertyValue( const sal_Unicode* pStr, sal_uInt32 nDef = 0 )
+ { return ImplGetPropertyValue( pStr ) ? *(sal_Int32*)mAny.getValue() : nDef; }
INT32 ImplGetInt32PropertyValue( const rtl::OUString& rStr, UINT32 nDef = 0 )
{ return ImplGetInt32PropertyValue(rStr.getStr(), nDef); }
@@ -79,21 +79,21 @@ public:
void SetRect( const Rectangle& rRect )
{ maRect = rRect; }
- INT32 GetAngle() const { return mnAngle; }
- void SetAngle( INT32 nVal ) { mnAngle = nVal; }
+ sal_Int32 GetAngle() const { return mnAngle; }
+ void SetAngle( sal_Int32 nVal ) { mnAngle = nVal; }
- UINT32 GetTextSize() const { return mnTextSize; }
+ sal_uInt32 GetTextSize() const { return mnTextSize; }
- BOOL IsValid() const { return mbValid; }
- BOOL IsPresObj() const { return mbPresObj; }
- BOOL IsEmptyPresObj() const { return mbEmptyPresObj; }
- UINT32 GetShapeId() const { return mnShapeId; }
- void SetShapeId( UINT32 nVal ) { mnShapeId = nVal; }
+ sal_Bool IsValid() const { return mbValid; }
+ sal_Bool IsPresObj() const { return mbPresObj; }
+ sal_Bool IsEmptyPresObj() const { return mbEmptyPresObj; }
+ sal_uInt32 GetShapeId() const { return mnShapeId; }
+ void SetShapeId( sal_uInt32 nVal ) { mnShapeId = nVal; }
const SdrObject* GetSdrObject() const;
- UINT32 ImplGetText();
- BOOL ImplHasText() const;
+ sal_uInt32 ImplGetText();
+ sal_Bool ImplHasText() const;
};
@@ -131,43 +131,43 @@ protected:
EscherExHostAppData* mpHostAppData;
- UINT32 mnPagesWritten;
+ sal_uInt32 mnPagesWritten;
- UINT32 mnShapeMasterTitle;
- UINT32 mnShapeMasterBody;
+ sal_uInt32 mnShapeMasterTitle;
+ sal_uInt32 mnShapeMasterBody;
// per page values
- UINT32 mnIndices;
- UINT32 mnOutlinerCount;
- UINT32 mnPrevTextStyle;
- UINT32 mnStatMaxValue;
+ sal_uInt32 mnIndices;
+ sal_uInt32 mnOutlinerCount;
+ sal_uInt32 mnPrevTextStyle;
+ sal_uInt32 mnStatMaxValue;
- UINT16 mnEffectCount;
+ sal_uInt16 mnEffectCount;
- BOOL mbIsTitlePossible;
- BOOL mbStatusIndicator;
- BOOL mbStatus;
+ sal_Bool mbIsTitlePossible;
+ sal_Bool mbStatusIndicator;
+ sal_Bool mbStatus;
ImplEESdrWriter( EscherEx& rEx );
- BOOL ImplInitPageValues();
+ sal_Bool ImplInitPageValues();
void ImplWritePage(
EscherSolverContainer& rSolver,
ImplEESdrPageType ePageType,
- BOOL bBackGround = FALSE );
+ sal_Bool bBackGround = sal_False );
- UINT32 ImplWriteShape( ImplEESdrObject& rObj,
+ sal_uInt32 ImplWriteShape( ImplEESdrObject& rObj,
EscherSolverContainer& rSolver,
ImplEESdrPageType ePageType ); // returns ShapeID
void ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherPropertyContainer& rPropOpt );
- BOOL ImplGetText( ImplEESdrObject& rObj );
+ sal_Bool ImplGetText( ImplEESdrObject& rObj );
void ImplWriteAdditionalText(
ImplEESdrObject& rObj,
const Point& rTextRefPoint );
- UINT32 ImplEnterAdditionalTextGroup(
+ sal_uInt32 ImplEnterAdditionalTextGroup(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape,
const Rectangle* pBoundRect = NULL );
@@ -199,7 +199,7 @@ public:
bool ImplInitUnoShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
void ImplWriteCurrentPage();
- UINT32 ImplWriteTheShape( ImplEESdrObject& rObj );
+ sal_uInt32 ImplWriteTheShape( ImplEESdrObject& rObj );
void ImplExitPage();
void ImplFlushSolverContainer();
diff --git a/filter/source/msfilter/makefile.mk b/filter/source/msfilter/makefile.mk
index c59a1262b8e2..53b85e048e82 100644
--- a/filter/source/msfilter/makefile.mk
+++ b/filter/source/msfilter/makefile.mk
@@ -25,11 +25,12 @@
#
#*************************************************************************
-PRJ=../..
+PRJ=..$/..
PRJNAME=filter
TARGET=msfilter
-ENABLE_EXCEPTIONS=true
+
+ENABLE_EXCEPTIONS=TRUE
LIBTARGET=NO
# --- Settings -----------------------------------------------------
@@ -43,16 +44,17 @@ SLOFILES= \
$(SLO)$/countryid.obj \
$(SLO)$/escherex.obj \
$(SLO)$/eschesdo.obj \
+ $(SLO)$/mscodec.obj \
$(SLO)$/msdffimp.obj \
+ $(SLO)$/msfiltertracer.obj \
+ $(SLO)$/msocximex.obj \
$(SLO)$/msoleexp.obj \
+ $(SLO)$/msvbahelper.obj \
$(SLO)$/msvbasic.obj \
- $(SLO)$/svxmsbas.obj \
- $(SLO)$/msocximex.obj \
- $(SLO)$/mscodec.obj \
- $(SLO)$/msfiltertracer.obj \
+ $(SLO)$/services.obj \
$(SLO)$/svdfppt.obj \
- $(SLO)$/svxmsbas2.obj \
- $(SLO)$/msvbahelper.obj \
+ $(SLO)$/svxmsbas.obj \
+ $(SLO)$/svxmsbas2.obj
$(SLO)$/mstoolbar.obj\
SHL1TARGET= msfilter$(DLLPOSTFIX)
@@ -85,4 +87,10 @@ DEF1NAME= $(SHL1TARGET)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/msfilter.component
+$(MISC)/msfilter.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ msfilter.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt msfilter.component
diff --git a/filter/source/msfilter/mscodec.cxx b/filter/source/msfilter/mscodec.cxx
index e5e083cfef2d..ce8bd54fd041 100644
--- a/filter/source/msfilter/mscodec.cxx
+++ b/filter/source/msfilter/mscodec.cxx
@@ -35,12 +35,16 @@
#include <string.h>
#include <tools/solar.h>
+#include <comphelper/sequenceashashmap.hxx>
+#include <comphelper/docpasswordhelper.hxx>
+
#define DEBUG_MSO_ENCRYPTION_STD97 0
#if DEBUG_MSO_ENCRYPTION_STD97
#include <stdio.h>
#endif
+using namespace ::com::sun::star;
namespace msfilter {
@@ -170,6 +174,37 @@ void MSCodec_Xor95::InitKey( const sal_uInt8 pnPassData[ 16 ] )
}
}
+sal_Bool MSCodec_Xor95::InitCodec( const uno::Sequence< beans::NamedValue >& aData )
+{
+ sal_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;
+
+ mnKey = (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 > MSCodec_Xor95::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)mnKey;
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XOR95PasswordHash" ) ) ] <<= (sal_Int16)mnHash;
+
+ return aHashData.getAsConstNamedValueList();
+}
+
bool MSCodec_Xor95::VerifyKey( sal_uInt16 nKey, sal_uInt16 nHash ) const
{
return (nKey == mnKey) && (nHash == mnHash);
@@ -219,11 +254,6 @@ void MSCodec_Xor95::Skip( sal_Size nBytes )
mnOffset = (mnOffset + nBytes) & 0x0F;
}
-sal_uInt16 MSCodec_Xor95::GetHash( const sal_uInt8* pnPassData, sal_Size nSize )
-{
- return lclGetHash( pnPassData, nSize );
-}
-
// ============================================================================
MSCodec_Std97::MSCodec_Std97 ()
@@ -237,15 +267,18 @@ MSCodec_Std97::MSCodec_Std97 ()
OSL_ASSERT(m_hDigest != 0);
(void)memset (m_pDigestValue, 0, sizeof(m_pDigestValue));
+ (void)memset (m_pDocId, 0, sizeof(m_pDocId));
}
MSCodec_Std97::~MSCodec_Std97 ()
{
(void)memset (m_pDigestValue, 0, sizeof(m_pDigestValue));
+ (void)memset (m_pDocId, 0, sizeof(m_pDocId));
rtl_digest_destroy (m_hDigest);
rtl_cipher_destroy (m_hCipher);
}
+#if 0
#if DEBUG_MSO_ENCRYPTION_STD97
static void lcl_PrintKeyData(const sal_uInt8* pKeyData, const char* msg)
{
@@ -262,6 +295,7 @@ static void lcl_PrintKeyData(const sal_uInt8* /*pKeyData*/, const char* /*msg*/)
{
}
#endif
+#endif
#if DEBUG_MSO_ENCRYPTION_STD97
static void lcl_PrintDigest(const sal_uInt8* pDigest, const char* msg)
@@ -277,65 +311,65 @@ static void lcl_PrintDigest(const sal_uInt8* /*pDigest*/, const char* /*msg*/)
}
#endif
-void MSCodec_Std97::InitKey (
- const sal_uInt16 pPassData[16],
- const sal_uInt8 pUnique[16])
+sal_Bool MSCodec_Std97::InitCodec( const uno::Sequence< beans::NamedValue >& aData )
{
#if DEBUG_MSO_ENCRYPTION_STD97
- fprintf(stdout, "MSCodec_Std97::InitKey: --begin\n");fflush(stdout);
+ fprintf(stdout, "MSCodec_Std97::InitCodec: --begin\n");fflush(stdout);
#endif
- sal_uInt8 pKeyData[64];
- int i, n;
+ sal_Bool bResult = sal_False;
- // Fill PassData into KeyData.
- (void)memset (pKeyData, 0, sizeof(pKeyData));
- lcl_PrintKeyData(pKeyData, "initial");
- for (i = 0, n = 16; (i < n) && pPassData[i]; i++)
- {
- pKeyData[2*i ] = sal::static_int_cast< sal_uInt8 >(
- (pPassData[i] >> 0) & 0xff);
- pKeyData[2*i + 1] = sal::static_int_cast< sal_uInt8 >(
- (pPassData[i] >> 8) & 0xff);
- }
- pKeyData[2*i] = 0x80;
- pKeyData[ 56] = sal::static_int_cast< sal_uInt8 >(i << 4);
+ ::comphelper::SequenceAsHashMap aHashData( aData );
+ uno::Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97EncryptionKey" ) ), uno::Sequence< sal_Int8 >() );
- lcl_PrintKeyData(pKeyData, "password data");
-
- // Fill raw digest of KeyData into KeyData.
- (void)rtl_digest_updateMD5 (
- m_hDigest, pKeyData, sizeof(pKeyData));
- (void)rtl_digest_rawMD5 (
- m_hDigest, pKeyData, RTL_DIGEST_LENGTH_MD5);
-
- lcl_PrintKeyData(pKeyData, "raw digest of key data");
-
- // Update digest with KeyData and Unique.
- for (i = 0; i < 16; i++)
+ if ( aKey.getLength() == RTL_DIGEST_LENGTH_MD5 )
{
- rtl_digest_updateMD5 (m_hDigest, pKeyData, 5);
- rtl_digest_updateMD5 (m_hDigest, pUnique, 16);
+ (void)memcpy( m_pDigestValue, 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( m_pDocId, aUniqueID.getConstArray(), 16 );
+ bResult = sal_True;
+ lcl_PrintDigest(m_pDigestValue, "digest value");
+ lcl_PrintDigest(m_pDocId, "DocId value");
+ }
+ else
+ OSL_ENSURE( sal_False, "Unexpected document ID!\n" );
}
+ else
+ OSL_ENSURE( sal_False, "Unexpected key size!\n" );
- // Update digest with padding.
- pKeyData[16] = 0x80;
- (void)memset (pKeyData + 17, 0, sizeof(pKeyData) - 17);
- pKeyData[56] = 0x80;
- pKeyData[57] = 0x0a;
+ return bResult;
+}
- lcl_PrintKeyData(pKeyData, "update digest with padding");
+uno::Sequence< beans::NamedValue > MSCodec_Std97::GetEncryptionData()
+{
+ ::comphelper::SequenceAsHashMap aHashData;
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97EncryptionKey" ) ) ] <<= uno::Sequence< sal_Int8 >( (sal_Int8*)m_pDigestValue, RTL_DIGEST_LENGTH_MD5 );
+ aHashData[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "STD97UniqueID" ) ) ] <<= uno::Sequence< sal_Int8 >( (sal_Int8*)m_pDocId, 16 );
- rtl_digest_updateMD5 (
- m_hDigest, &(pKeyData[16]), sizeof(pKeyData) - 16);
+ return aHashData.getAsConstNamedValueList();
+}
+void MSCodec_Std97::InitKey (
+ const sal_uInt16 pPassData[16],
+ const sal_uInt8 pDocId[16])
+{
+#if DEBUG_MSO_ENCRYPTION_STD97
+ fprintf(stdout, "MSCodec_Std97::InitKey: --begin\n");fflush(stdout);
+#endif
+ uno::Sequence< sal_Int8 > aKey = ::comphelper::DocPasswordHelper::GenerateStd97Key( pPassData, uno::Sequence< sal_Int8 >( (sal_Int8*)pDocId, 16 ) );
// Fill raw digest of above updates into DigestValue.
- rtl_digest_rawMD5 (
- m_hDigest, m_pDigestValue, sizeof(m_pDigestValue));
+
+ if ( aKey.getLength() == sizeof(m_pDigestValue) )
+ (void)memcpy ( m_pDigestValue, aKey.getConstArray(), sizeof(m_pDigestValue) );
+ else
+ memset( m_pDigestValue, 0, sizeof(m_pDigestValue) );
lcl_PrintDigest(m_pDigestValue, "digest value");
- // Erase KeyData array and leave.
- (void)memset (pKeyData, 0, sizeof(pKeyData));
+ (void)memcpy (m_pDocId, pDocId, 16);
+
+ lcl_PrintDigest(m_pDocId, "DocId value");
}
bool MSCodec_Std97::VerifyKey (
@@ -412,7 +446,7 @@ bool MSCodec_Std97::InitCipher (sal_uInt32 nCounter)
bool MSCodec_Std97::CreateSaltDigest( const sal_uInt8 nSaltData[16], sal_uInt8 nSaltDigest[16] )
{
#if DEBUG_MSO_ENCRYPTION_STD97
- lcl_PrintDigest(pSaltData, "salt data");
+ lcl_PrintDigest(nSaltData, "salt data");
#endif
bool result = false;
@@ -529,6 +563,12 @@ void MSCodec_Std97::GetEncryptKey (
}
}
+void MSCodec_Std97::GetDocId( sal_uInt8 pDocId[16] )
+{
+ if ( sizeof( m_pDocId ) == 16 )
+ (void)memcpy( pDocId, m_pDocId, 16 );
+}
+
// ============================================================================
} // namespace svx
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 51eda7ceb6c0..710dad4a6784 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -158,10 +158,10 @@ static sal_uInt32 nMSOleObjCntr = 0;
/*************************************************************************/
-BOOL Impl_OlePres::Read( SvStream & rStm )
+sal_Bool Impl_OlePres::Read( SvStream & rStm )
{
- ULONG nBeginPos = rStm.Tell();
- INT32 n;
+ sal_uLong nBeginPos = rStm.Tell();
+ sal_Int32 n;
rStm >> n;
if( n != -1 )
{
@@ -182,7 +182,7 @@ BOOL Impl_OlePres::Read( SvStream & rStm )
aMMSrc = pBmp->GetPrefMapMode();
MapMode aMMDst( MAP_100TH_MM );
aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
- return TRUE;
+ return sal_True;
}
else
{
@@ -199,7 +199,7 @@ BOOL Impl_OlePres::Read( SvStream & rStm )
MapMode aMMSrc = pMtf->GetPrefMapMode();
MapMode aMMDst( MAP_100TH_MM );
aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
- return TRUE;
+ return sal_True;
}
else
{
@@ -222,25 +222,25 @@ BOOL Impl_OlePres::Read( SvStream & rStm )
nJobLen -= 4;
if( nJobLen )
{
- pJob = new BYTE[ nJobLen ];
+ pJob = new sal_uInt8[ nJobLen ];
rStm.Read( pJob, nJobLen );
}
}
else
{
rStm.SetError( SVSTREAM_GENERALERROR );
- return FALSE;
+ return sal_False;
}
- UINT32 nAsp;
+ sal_uInt32 nAsp;
rStm >> nAsp;
- USHORT nSvAsp = USHORT( nAsp );
+ sal_uInt16 nSvAsp = sal_uInt16( nAsp );
SetAspect( nSvAsp );
rStm.SeekRel( 4 ); //L-Index ueberlesen
rStm >> nAdvFlags;
rStm.SeekRel( 4 ); //Compression
- UINT32 nWidth = 0;
- UINT32 nHeight = 0;
- UINT32 nSize = 0;
+ sal_uInt32 nWidth = 0;
+ sal_uInt32 nHeight = 0;
+ sal_uInt32 nSize = 0;
rStm >> nWidth >> nHeight >> nSize;
aSize.Width() = nWidth;
aSize.Height() = nHeight;
@@ -257,29 +257,29 @@ BOOL Impl_OlePres::Read( SvStream & rStm )
}
else
{
- BYTE * p = new BYTE[ nSize ];
+ sal_uInt8 * p = new sal_uInt8[ nSize ];
rStm.Read( p, nSize );
delete [] p;
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
/************************************************************************/
void Impl_OlePres::Write( SvStream & rStm )
{
WriteClipboardFormat( rStm, FORMAT_GDIMETAFILE );
- rStm << (INT32)(nJobLen +4); // immer leeres TargetDevice
+ rStm << (sal_Int32)(nJobLen +4); // immer leeres TargetDevice
if( nJobLen )
rStm.Write( pJob, nJobLen );
- rStm << (UINT32)nAspect;
- rStm << (INT32)-1; //L-Index immer -1
- rStm << (INT32)nAdvFlags;
- rStm << (INT32)0; //Compression
- rStm << (INT32)aSize.Width();
- rStm << (INT32)aSize.Height();
- ULONG nPos = rStm.Tell();
- rStm << (INT32)0;
+ rStm << (sal_uInt32)nAspect;
+ rStm << (sal_Int32)-1; //L-Index immer -1
+ rStm << (sal_Int32)nAdvFlags;
+ rStm << (sal_Int32)0; //Compression
+ rStm << (sal_Int32)aSize.Width();
+ rStm << (sal_Int32)aSize.Height();
+ sal_uLong nPos = rStm.Tell();
+ rStm << (sal_Int32)0;
if( GetFormat() == FORMAT_GDIMETAFILE && pMtf )
{
@@ -309,9 +309,9 @@ void Impl_OlePres::Write( SvStream & rStm )
{
OSL_FAIL( "unknown format" );
}
- ULONG nEndPos = rStm.Tell();
+ sal_uLong nEndPos = rStm.Tell();
rStm.Seek( nPos );
- rStm << (UINT32)(nEndPos - nPos - 4);
+ rStm << (sal_uInt32)(nEndPos - nPos - 4);
rStm.Seek( nEndPos );
}
@@ -335,7 +335,7 @@ Impl_OlePres * CreateCache_Impl( SotStorage * pStor )
return NULL;
- for( USHORT i = 1; i < 10; i++ )
+ for( sal_uInt16 i = 1; i < 10; i++ )
{
SotStorageStreamRef xStm = xOleObjStor->OpenSotStream( aStreamName,
STREAM_READ | STREAM_NOCREATE );
@@ -365,10 +365,10 @@ Impl_OlePres * CreateCache_Impl( SotStorage * pStor )
SvStream& operator>>( SvStream& rIn, DffRecordHeader& rRec )
{
rRec.nFilePos = rIn.Tell();
- UINT16 nTmp(0);
+ sal_uInt16 nTmp(0);
rIn >> nTmp;
rRec.nImpVerInst = nTmp;
- rRec.nRecVer = sal::static_int_cast< BYTE >(nTmp & 0x000F);
+ rRec.nRecVer = sal::static_int_cast< sal_uInt8 >(nTmp & 0x000F);
rRec.nRecInstance = nTmp >> 4;
rIn >> rRec.nRecType;
rIn >> rRec.nRecLen;
@@ -389,12 +389,12 @@ SvStream& operator>>( SvStream& rIn, DffPropSet& rRec )
DffRecordHeader aHd;
rIn >> aHd;
- UINT32 nPropCount = aHd.nRecInstance;
+ sal_uInt32 nPropCount = aHd.nRecInstance;
// FilePos der ComplexData merken
- UINT32 nComplexDataFilePos = rIn.Tell() + ( nPropCount * 6 );
+ sal_uInt32 nComplexDataFilePos = rIn.Tell() + ( nPropCount * 6 );
- for( UINT32 nPropNum = 0; nPropNum < nPropCount; nPropNum++ )
+ for( sal_uInt32 nPropNum = 0; nPropNum < nPropCount; nPropNum++ )
{
sal_uInt16 nTmp;
sal_uInt32 nRecType, nContent, nContentEx = 0xffff0000;
@@ -577,17 +577,17 @@ void DffPropSet::Merge( DffPropSet& rMaster ) const
{
for ( void* pDummy = rMaster.First(); pDummy; pDummy = rMaster.Next() )
{
- UINT32 nRecType = rMaster.GetCurKey();
+ sal_uInt32 nRecType = rMaster.GetCurKey();
if ( ( nRecType & 0x3f ) == 0x3f ) // this is something called FLAGS
{
- UINT32 nCurrentFlags = mpContents[ nRecType ];
- UINT32 nMergeFlags = rMaster.mpContents[ nRecType ];
+ sal_uInt32 nCurrentFlags = mpContents[ nRecType ];
+ sal_uInt32 nMergeFlags = rMaster.mpContents[ nRecType ];
nMergeFlags &= ( nMergeFlags >> 16 ) | 0xffff0000; // clearing low word
nMergeFlags &= ( ( nCurrentFlags & 0xffff0000 ) // remove allready hard set
| ( nCurrentFlags >> 16 ) ) ^ 0xffffffff; // attributes from mergeflags
nCurrentFlags &= ( ( nMergeFlags & 0xffff0000 ) // apply zero master bits
| ( nMergeFlags >> 16 ) ) ^ 0xffffffff;
- nCurrentFlags |= (UINT16)nMergeFlags; // apply filled master bits
+ nCurrentFlags |= (sal_uInt16)nMergeFlags; // apply filled master bits
( (DffPropSet*) this )->mpContents[ nRecType ] = nCurrentFlags;
@@ -602,7 +602,7 @@ void DffPropSet::Merge( DffPropSet& rMaster ) const
{
( (DffPropSet*) this )->mpContents[ nRecType ] = rMaster.mpContents[ nRecType ];
DffPropFlags nFlags( rMaster.mpFlags[ nRecType ] );
- nFlags.bSoftAttr = TRUE;
+ nFlags.bSoftAttr = sal_True;
( (DffPropSet*) this )->mpFlags[ nRecType ] = nFlags;
( (DffPropSet*) this )->Insert( nRecType, pDummy );
}
@@ -610,9 +610,9 @@ void DffPropSet::Merge( DffPropSet& rMaster ) const
}
}
-BOOL DffPropSet::IsHardAttribute( UINT32 nId ) const
+sal_Bool DffPropSet::IsHardAttribute( sal_uInt32 nId ) const
{
- BOOL bRetValue = TRUE;
+ sal_Bool bRetValue = sal_True;
nId &= 0x3ff;
if ( ( nId & 0x3f ) >= 48 ) // is this a flag id
{
@@ -627,22 +627,22 @@ BOOL DffPropSet::IsHardAttribute( UINT32 nId ) const
return bRetValue;
};
-UINT32 DffPropSet::GetPropertyValue( UINT32 nId, UINT32 nDefault ) const
+sal_uInt32 DffPropSet::GetPropertyValue( sal_uInt32 nId, sal_uInt32 nDefault ) const
{
nId &= 0x3ff;
return ( mpFlags[ nId ].bSet ) ? mpContents[ nId ] : nDefault;
};
-bool DffPropSet::GetPropertyBool( UINT32 nId, bool bDefault ) const
+bool DffPropSet::GetPropertyBool( sal_uInt32 nId, bool bDefault ) const
{
- UINT32 nBaseId = nId | 31; // base ID to get the UINT32 property value
- UINT32 nMask = 1 << (nBaseId - nId); // bit mask of the boolean property
+ sal_uInt32 nBaseId = nId | 31; // base ID to get the sal_uInt32 property value
+ sal_uInt32 nMask = 1 << (nBaseId - nId); // bit mask of the boolean property
- UINT32 nPropValue = GetPropertyValue( nBaseId, bDefault ? nMask : 0 );
+ sal_uInt32 nPropValue = GetPropertyValue( nBaseId, bDefault ? nMask : 0 );
return (nPropValue & nMask) != 0;
}
-::rtl::OUString DffPropSet::GetPropertyString( UINT32 nId, SvStream& rStrm ) const
+::rtl::OUString DffPropSet::GetPropertyString( sal_uInt32 nId, SvStream& rStrm ) const
{
sal_Size nOldPos = rStrm.Tell();
::rtl::OUStringBuffer aBuffer;
@@ -665,17 +665,17 @@ bool DffPropSet::GetPropertyBool( UINT32 nId, bool bDefault ) const
return aBuffer.makeStringAndClear();
}
-void DffPropSet::SetPropertyValue( UINT32 nId, UINT32 nValue ) const
+void DffPropSet::SetPropertyValue( sal_uInt32 nId, sal_uInt32 nValue ) const
{
if ( !mpFlags[ nId ].bSet )
{
( (DffPropSet*) this )->Insert( nId, (void*)(sal_uIntPtr)nValue );
- ( (DffPropSet*) this )->mpFlags[ nId ].bSet = TRUE;
+ ( (DffPropSet*) this )->mpFlags[ nId ].bSet = sal_True;
}
( (DffPropSet*) this )->mpContents[ nId ] = nValue;
};
-BOOL DffPropSet::SeekToContent( UINT32 nRecType, SvStream& rStrm ) const
+sal_Bool DffPropSet::SeekToContent( sal_uInt32 nRecType, SvStream& rStrm ) const
{
nRecType &= 0x3ff;
if ( mpFlags[ nRecType ].bSet )
@@ -688,12 +688,12 @@ BOOL DffPropSet::SeekToContent( UINT32 nRecType, SvStream& rStrm ) const
if ( nOffset && ( ( nOffset & 0xffff0000 ) != 0xffff0000 ) )
{
rStrm.Seek( nOffset );
- return TRUE;
+ return sal_True;
}
}
}
}
- return FALSE;
+ return sal_False;
}
DffPropertyReader::DffPropertyReader( const SvxMSDffManager& rMan ) :
@@ -703,10 +703,10 @@ DffPropertyReader::DffPropertyReader( const SvxMSDffManager& rMan ) :
InitializePropSet();
}
-void DffPropertyReader::SetDefaultPropSet( SvStream& rStCtrl, UINT32 nOffsDgg ) const
+void DffPropertyReader::SetDefaultPropSet( SvStream& rStCtrl, sal_uInt32 nOffsDgg ) const
{
delete pDefaultPropSet;
- UINT32 nMerk = rStCtrl.Tell();
+ sal_uInt32 nMerk = rStCtrl.Tell();
rStCtrl.Seek( nOffsDgg );
DffRecordHeader aRecHd;
rStCtrl >> aRecHd;
@@ -722,12 +722,12 @@ void DffPropertyReader::SetDefaultPropSet( SvStream& rStCtrl, UINT32 nOffsDgg )
}
#ifdef DBG_CUSTOMSHAPE
-void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData, UINT32 nShapeId ) const
+void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData, sal_uInt32 nShapeId ) const
#else
void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const
#endif
{
- ULONG nFilePos = rIn.Tell();
+ sal_uLong nFilePos = rIn.Tell();
rIn >> (DffPropertyReader&)*this;
if ( IsProperty( DFF_Prop_hspMaster ) )
@@ -786,7 +786,7 @@ void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const
{
if ( SeekToContent( i, rIn ) )
{
- INT32 nLen = (INT32)GetPropertyValue( i );
+ sal_Int32 nLen = (sal_Int32)GetPropertyValue( i );
if ( nLen )
{
pOut->WriteLine( "" );
@@ -795,7 +795,7 @@ void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const
aDesc.Append( ByteString( " Size:" ) );
aDesc.Append( ByteString::CreateFromInt32( nLen ) );
pOut->WriteLine( aDesc );
- INT16 nNumElem, nNumElemMem, nNumSize;
+ sal_Int16 nNumElem, nNumElemMem, nNumSize;
rIn >> nNumElem >> nNumElemMem >> nNumSize;
aDesc = ByteString( "Entries: " );
aDesc.Append( ByteString::CreateFromInt32( nNumElem ) );
@@ -810,23 +810,23 @@ void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const
while ( nLen > 0 )
{
ByteString aString;
- for ( UINT32 j = 0; nLen && ( j < ( nNumSize >> 1 ) ); j++ )
+ for ( sal_uInt32 j = 0; nLen && ( j < ( nNumSize >> 1 ) ); j++ )
{
- for ( UINT32 k = 0; k < 2; k++ )
+ for ( sal_uInt32 k = 0; k < 2; k++ )
{
if ( nLen )
{
- BYTE nVal;
+ sal_uInt8 nVal;
rIn >> nVal;
if ( ( nVal >> 4 ) > 9 )
- *pOut << (BYTE)( ( nVal >> 4 ) + 'A' - 10 );
+ *pOut << (sal_uInt8)( ( nVal >> 4 ) + 'A' - 10 );
else
- *pOut << (BYTE)( ( nVal >> 4 ) + '0' );
+ *pOut << (sal_uInt8)( ( nVal >> 4 ) + '0' );
if ( ( nVal & 0xf ) > 9 )
- *pOut << (BYTE)( ( nVal & 0xf ) + 'A' - 10 );
+ *pOut << (sal_uInt8)( ( nVal & 0xf ) + 'A' - 10 );
else
- *pOut << (BYTE)( ( nVal & 0xf ) + '0' );
+ *pOut << (sal_uInt8)( ( nVal & 0xf ) + '0' );
nLen--;
}
@@ -858,12 +858,12 @@ void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const
}
-INT32 DffPropertyReader::Fix16ToAngle( INT32 nContent ) const
+sal_Int32 DffPropertyReader::Fix16ToAngle( sal_Int32 nContent ) const
{
- INT32 nAngle = 0;
+ sal_Int32 nAngle = 0;
if ( nContent )
{
- nAngle = ( (INT16)( nContent >> 16) * 100L ) + ( ( ( nContent & 0x0000ffff) * 100L ) >> 16 );
+ nAngle = ( (sal_Int16)( nContent >> 16) * 100L ) + ( ( ( nContent & 0x0000ffff) * 100L ) >> 16 );
nAngle = NormAngle360( -nAngle );
}
return nAngle;
@@ -1388,7 +1388,7 @@ static basegfx::B2DPolygon GetLineArrow( const sal_Int32 nLineWidth, const MSO_L
void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eShapeType ) const // #i28269#
{
- UINT32 nLineFlags(GetPropertyValue( DFF_Prop_fNoLineDrawDash ));
+ sal_uInt32 nLineFlags(GetPropertyValue( DFF_Prop_fNoLineDrawDash ));
if(!IsHardAttribute( DFF_Prop_fLine ) && !IsCustomShapeStrokedByDefault( eShapeType ))
{
@@ -1398,7 +1398,7 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
if ( nLineFlags & 8 )
{
// Linienattribute
- sal_Int32 nLineWidth = (INT32)GetPropertyValue( DFF_Prop_lineWidth, 9525 );
+ sal_Int32 nLineWidth = (sal_Int32)GetPropertyValue( DFF_Prop_lineWidth, 9525 );
MSO_LineDashing eLineDashing = (MSO_LineDashing)GetPropertyValue( DFF_Prop_lineDashing, mso_lineSolid );
if ( eLineDashing == mso_lineSolid )
@@ -1533,7 +1533,7 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
{
MSO_LineCap eLineCap = (MSO_LineCap)GetPropertyValue( DFF_Prop_lineEndCapStyle );
const SfxPoolItem* pPoolItem = NULL;
- if ( rSet.GetItemState( XATTR_LINEDASH, FALSE, &pPoolItem ) == SFX_ITEM_SET )
+ if ( rSet.GetItemState( XATTR_LINEDASH, sal_False, &pPoolItem ) == SFX_ITEM_SET )
{
XDashStyle eNewStyle = XDASH_RECT;
if ( eLineCap == mso_lineEndCapRound )
@@ -1712,7 +1712,7 @@ void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream
if ( nFix16Angle )
{
- sal_Bool bRotateWithShape = sal_True; // TRUE seems to be default
+ sal_Bool bRotateWithShape = sal_True; // sal_True seems to be default
sal_uInt32 nPos = rIn.Tell();
if ( const_cast< SvxMSDffManager& >( rManager ).maShapeRecords.SeekToContent( rIn, DFF_msofbtUDefProp, SEEK_FROM_CURRENT_AND_RESTART ) )
{
@@ -1727,7 +1727,7 @@ void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream
{
aBitmap.Rotate( nFix16Angle / 10, rShadeColors[ 0 ].aColor );
- ULONG nMirrorFlags = BMP_MIRROR_NONE;
+ sal_uLong nMirrorFlags = BMP_MIRROR_NONE;
if ( rObjData.nSpFlags & SP_FFLIPV )
nMirrorFlags |= BMP_MIRROR_VERT;
if ( rObjData.nSpFlags & SP_FFLIPH )
@@ -1746,7 +1746,7 @@ void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream
void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, const DffObjData& rObjData ) const
{
- UINT32 nFillFlags(GetPropertyValue( DFF_Prop_fNoFillHitTest ));
+ sal_uInt32 nFillFlags(GetPropertyValue( DFF_Prop_fNoFillHitTest ));
std::vector< ShadeColor > aShadeColors;
GetShadeColors( rManager, *this, rIn, aShadeColors );
@@ -1825,8 +1825,8 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co
eGrad = XGRAD_AXIAL; // Besser gehts leider nicht
}
- USHORT nFocusX = (USHORT)nFocus;
- USHORT nFocusY = (USHORT)nFocus;
+ sal_uInt16 nFocusX = (sal_uInt16)nFocus;
+ sal_uInt16 nFocusY = (sal_uInt16)nFocus;
switch( eMSO_FillType )
{
@@ -1867,7 +1867,7 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co
{
Graphic aGraf;
// first try to get BLIP from cache
- BOOL bOK = rManager.GetBLIP( GetPropertyValue( DFF_Prop_fillBlip ), aGraf, NULL );
+ sal_Bool bOK = rManager.GetBLIP( GetPropertyValue( DFF_Prop_fillBlip ), aGraf, NULL );
// then try directly from stream (i.e. Excel chart hatches/bitmaps)
if ( !bOK )
bOK = SeekToContent( DFF_Prop_fillBlip, rIn ) && rManager.GetBLIPDirect( rIn, aGraf, NULL );
@@ -2333,7 +2333,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
{
const rtl::OUString sExtrusionSkew( RTL_CONSTASCII_USTRINGPARAM ( "Skew" ) );
double fSkewAmount = (sal_Int32)GetPropertyValue( DFF_Prop_c3DSkewAmount, 50 );
- double fSkewAngle = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DSkewAngle, sal::static_int_cast< UINT32 >(-135 * 65536) )) / 65536.0;
+ double fSkewAngle = (double)((sal_Int32)GetPropertyValue( DFF_Prop_c3DSkewAngle, sal::static_int_cast< sal_uInt32 >(-135 * 65536) )) / 65536.0;
EnhancedCustomShapeParameterPair aSkewPair;
aSkewPair.First.Value <<= fSkewAmount;
@@ -3075,8 +3075,8 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const
for ( void* pDummy = ((DffPropertyReader*)this)->First(); pDummy; pDummy = ((DffPropertyReader*)this)->Next() )
{
- UINT32 nRecType = GetCurKey();
- UINT32 nContent = mpContents[ nRecType ];
+ sal_uInt32 nRecType = GetCurKey();
+ sal_uInt32 nContent = mpContents[ nRecType ];
switch ( nRecType )
{
case DFF_Prop_gtextSize :
@@ -3126,7 +3126,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const
break;
case DFF_Prop_shadowOffsetX :
{
- INT32 nVal = (INT32)nContent;
+ sal_Int32 nVal = (sal_Int32)nContent;
rManager.ScaleEmu( nVal );
if ( nVal )
rSet.Put( SdrShadowXDistItem( nVal ) );
@@ -3134,7 +3134,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const
break;
case DFF_Prop_shadowOffsetY :
{
- INT32 nVal = (INT32)nContent;
+ sal_Int32 nVal = (sal_Int32)nContent;
rManager.ScaleEmu( nVal );
if ( nVal )
rSet.Put( SdrShadowYDistItem( nVal ) );
@@ -3160,10 +3160,10 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, const
// #160376# sj: activating shadow only if fill and or linestyle is used
// this is required because of the latest drawing layer core changes.
// Issue i104085 is related to this.
- UINT32 nLineFlags(GetPropertyValue( DFF_Prop_fNoLineDrawDash ));
+ sal_uInt32 nLineFlags(GetPropertyValue( DFF_Prop_fNoLineDrawDash ));
if(!IsHardAttribute( DFF_Prop_fLine ) && !IsCustomShapeStrokedByDefault( rObjData.eShapeType ))
nLineFlags &= ~0x08;
- UINT32 nFillFlags(GetPropertyValue( DFF_Prop_fNoFillHitTest ));
+ sal_uInt32 nFillFlags(GetPropertyValue( DFF_Prop_fNoFillHitTest ));
if(!IsHardAttribute( DFF_Prop_fFilled ) && !IsCustomShapeFilledByDefault( rObjData.eShapeType ))
nFillFlags &= ~0x10;
if ( nFillFlags & 0x10 )
@@ -3238,11 +3238,11 @@ DffRecordManager::~DffRecordManager()
};
-void DffRecordManager::Consume( SvStream& rIn, BOOL bAppend, UINT32 nStOfs )
+void DffRecordManager::Consume( SvStream& rIn, sal_Bool bAppend, sal_uInt32 nStOfs )
{
if ( !bAppend )
Clear();
- UINT32 nOldPos = rIn.Tell();
+ sal_uInt32 nOldPos = rIn.Tell();
if ( !nStOfs )
{
DffRecordHeader aHd;
@@ -3297,7 +3297,7 @@ DffRecordHeader* DffRecordManager::First()
DffRecordHeader* DffRecordManager::Next()
{
DffRecordHeader* pRet = NULL;
- UINT32 nC = pCList->nCurrent + 1;
+ sal_uInt32 nC = pCList->nCurrent + 1;
if ( nC < pCList->nCount )
{
pCList->nCurrent++;
@@ -3315,7 +3315,7 @@ DffRecordHeader* DffRecordManager::Next()
DffRecordHeader* DffRecordManager::Prev()
{
DffRecordHeader* pRet = NULL;
- UINT32 nCur = pCList->nCurrent;
+ sal_uInt32 nCur = pCList->nCurrent;
if ( !nCur && pCList->pPrev )
{
pCList = pCList->pPrev;
@@ -3334,7 +3334,7 @@ DffRecordHeader* DffRecordManager::Last()
DffRecordHeader* pRet = NULL;
while ( pCList->pNext )
pCList = pCList->pNext;
- UINT32 nCnt = pCList->nCount;
+ sal_uInt32 nCnt = pCList->nCount;
if ( nCnt-- )
{
pCList->nCurrent = nCnt;
@@ -3343,21 +3343,21 @@ DffRecordHeader* DffRecordManager::Last()
return pRet;
}
-BOOL DffRecordManager::SeekToContent( SvStream& rIn, UINT16 nRecId, DffSeekToContentMode eMode )
+sal_Bool DffRecordManager::SeekToContent( SvStream& rIn, sal_uInt16 nRecId, DffSeekToContentMode eMode )
{
DffRecordHeader* pHd = GetRecordHeader( nRecId, eMode );
if ( pHd )
{
pHd->SeekToContent( rIn );
- return TRUE;
+ return sal_True;
}
else
- return FALSE;
+ return sal_False;
}
-DffRecordHeader* DffRecordManager::GetRecordHeader( UINT16 nRecId, DffSeekToContentMode eMode )
+DffRecordHeader* DffRecordManager::GetRecordHeader( sal_uInt16 nRecId, DffSeekToContentMode eMode )
{
- UINT32 nOldCurrent = pCList->nCurrent;
+ sal_uInt32 nOldCurrent = pCList->nCurrent;
DffRecordList* pOldList = pCList;
DffRecordHeader* pHd;
@@ -3452,8 +3452,8 @@ void SvxMSDffManager::Scale( Polygon& rPoly ) const
{
if ( !bNeedMap )
return;
- USHORT nPointAnz = rPoly.GetSize();
- for ( USHORT nPointNum = 0; nPointNum < nPointAnz; nPointNum++ )
+ sal_uInt16 nPointAnz = rPoly.GetSize();
+ for ( sal_uInt16 nPointNum = 0; nPointNum < nPointAnz; nPointNum++ )
Scale( rPoly[ nPointNum ] );
}
@@ -3461,8 +3461,8 @@ void SvxMSDffManager::Scale( PolyPolygon& rPoly ) const
{
if ( !bNeedMap )
return;
- USHORT nPolyAnz = rPoly.Count();
- for ( USHORT nPolyNum = 0; nPolyNum < nPolyAnz; nPolyNum++ )
+ sal_uInt16 nPolyAnz = rPoly.Count();
+ for ( sal_uInt16 nPolyNum = 0; nPolyNum < nPolyAnz; nPolyNum++ )
Scale( rPoly[ nPolyNum ] );
}
@@ -3471,7 +3471,7 @@ void SvxMSDffManager::ScaleEmu( sal_Int32& rVal ) const
rVal = BigMulDiv( rVal, nEmuMul, nEmuDiv );
}
-UINT32 SvxMSDffManager::ScalePt( UINT32 nVal ) const
+sal_uInt32 SvxMSDffManager::ScalePt( sal_uInt32 nVal ) const
{
MapUnit eMap = pSdrModel->GetScaleUnit();
Fraction aFact( GetMapFactor( MAP_POINT, eMap ).X() );
@@ -3481,7 +3481,7 @@ UINT32 SvxMSDffManager::ScalePt( UINT32 nVal ) const
return BigMulDiv( nVal, aFact.GetNumerator(), aFact.GetDenominator() );
}
-INT32 SvxMSDffManager::ScalePoint( INT32 nVal ) const
+sal_Int32 SvxMSDffManager::ScalePoint( sal_Int32 nVal ) const
{
return BigMulDiv( nVal, nPntMul, nPntDiv );
};
@@ -3524,17 +3524,17 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
{
pModel = 0;
nMapMul = nMapDiv = nMapXOfs = nMapYOfs = nEmuMul = nEmuDiv = nPntMul = nPntDiv = 0;
- bNeedMap = FALSE;
+ bNeedMap = sal_False;
}
}
-BOOL SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, UINT32 nId ) const
+sal_Bool SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, sal_uInt32 nId ) const
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
if ( mpFidcls )
{
- UINT32 nMerk = rSt.Tell();
- UINT32 nShapeId, nSec = ( nId >> 10 ) - 1;
+ sal_uInt32 nMerk = rSt.Tell();
+ sal_uInt32 nShapeId, nSec = ( nId >> 10 ) - 1;
if ( nSec < mnIdClusters )
{
sal_IntPtr nOfs = (sal_IntPtr)maDgOffsetTable.Get( mpFidcls[ nSec ].dgid );
@@ -3543,7 +3543,7 @@ BOOL SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, UINT3
rSt.Seek( nOfs );
DffRecordHeader aEscherF002Hd;
rSt >> aEscherF002Hd;
- ULONG nEscherF002End = aEscherF002Hd.GetRecEndFilePos();
+ sal_uLong nEscherF002End = aEscherF002Hd.GetRecEndFilePos();
DffRecordHeader aEscherObjListHd;
while ( rSt.Tell() < nEscherF002End )
{
@@ -3559,7 +3559,7 @@ BOOL SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, UINT3
if ( nId == nShapeId )
{
aEscherObjListHd.SeekToBegOfRecord( rSt );
- bRet = TRUE;
+ bRet = sal_True;
break;
}
}
@@ -3574,10 +3574,10 @@ BOOL SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, UINT3
return bRet;
}
-bool SvxMSDffManager::SeekToRec( SvStream& rSt, USHORT nRecId, ULONG nMaxFilePos, DffRecordHeader* pRecHd, ULONG nSkipCount ) const
+bool SvxMSDffManager::SeekToRec( SvStream& rSt, sal_uInt16 nRecId, sal_uLong nMaxFilePos, DffRecordHeader* pRecHd, sal_uLong nSkipCount ) const
{
bool bRet = FALSE;
- ULONG nFPosMerk = rSt.Tell(); // FilePos merken fuer ggf. spaetere Restauration
+ sal_uLong nFPosMerk = rSt.Tell(); // FilePos merken fuer ggf. spaetere Restauration
DffRecordHeader aHd;
do
{
@@ -3588,7 +3588,7 @@ bool SvxMSDffManager::SeekToRec( SvStream& rSt, USHORT nRecId, ULONG nMaxFilePos
nSkipCount--;
else
{
- bRet = TRUE;
+ bRet = sal_True;
if ( pRecHd != NULL )
*pRecHd = aHd;
else
@@ -3604,10 +3604,10 @@ bool SvxMSDffManager::SeekToRec( SvStream& rSt, USHORT nRecId, ULONG nMaxFilePos
return bRet;
}
-bool SvxMSDffManager::SeekToRec2( USHORT nRecId1, USHORT nRecId2, ULONG nMaxFilePos, DffRecordHeader* pRecHd, ULONG nSkipCount ) const
+bool SvxMSDffManager::SeekToRec2( sal_uInt16 nRecId1, sal_uInt16 nRecId2, sal_uLong nMaxFilePos, DffRecordHeader* pRecHd, sal_uLong nSkipCount ) const
{
bool bRet = FALSE;
- ULONG nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer ggf. spaetere Restauration
+ sal_uLong nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer ggf. spaetere Restauration
DffRecordHeader aHd;
do
{
@@ -3618,7 +3618,7 @@ bool SvxMSDffManager::SeekToRec2( USHORT nRecId1, USHORT nRecId2, ULONG nMaxFile
nSkipCount--;
else
{
- bRet = TRUE;
+ bRet = sal_True;
if ( pRecHd )
*pRecHd = aHd;
else
@@ -3635,12 +3635,12 @@ bool SvxMSDffManager::SeekToRec2( USHORT nRecId1, USHORT nRecId2, ULONG nMaxFile
}
-bool SvxMSDffManager::GetColorFromPalette( USHORT /* nNum */, Color& rColor ) const
+bool SvxMSDffManager::GetColorFromPalette( sal_uInt16 /* nNum */, Color& rColor ) const
{
// diese Methode ist in der zum Excel-Import
// abgeleiteten Klasse zu ueberschreiben...
rColor.SetColor( COL_WHITE );
- return TRUE;
+ return sal_True;
}
// sj: the documentation is not complete, especially in ppt the normal rgb for text
@@ -3707,11 +3707,11 @@ Color SvxMSDffManager::MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nConte
{
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- UINT16 nParameter = sal_uInt16(( nColorCode >> 16 ) & 0x00ff); // the HiByte of nParameter is not zero, an exclusive AND is helping :o
- UINT16 nFunctionBits = (UINT16)( ( nColorCode & 0x00000f00 ) >> 8 );
- UINT16 nAdditionalFlags = (UINT16)( ( nColorCode & 0x0000f000) >> 8 );
- UINT16 nColorIndex = sal_uInt16(nColorCode & 0x00ff);
- UINT32 nPropColor = 0;
+ sal_uInt16 nParameter = sal_uInt16(( nColorCode >> 16 ) & 0x00ff); // the HiByte of nParameter is not zero, an exclusive AND is helping :o
+ sal_uInt16 nFunctionBits = (sal_uInt16)( ( nColorCode & 0x00000f00 ) >> 8 );
+ sal_uInt16 nAdditionalFlags = (sal_uInt16)( ( nColorCode & 0x0000f000) >> 8 );
+ sal_uInt16 nColorIndex = sal_uInt16(nColorCode & 0x00ff);
+ sal_uInt32 nPropColor = 0;
sal_uInt16 nCProp = 0;
@@ -3806,66 +3806,66 @@ Color SvxMSDffManager::MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nConte
if( nAdditionalFlags & 0x80 ) // make color gray
{
- UINT8 nZwi = aColor.GetLuminance();
+ sal_uInt8 nZwi = aColor.GetLuminance();
aColor = Color( nZwi, nZwi, nZwi );
}
switch( nFunctionBits )
{
case 0x01 : // darken color by parameter
{
- aColor.SetRed( sal::static_int_cast< UINT8 >( ( nParameter * aColor.GetRed() ) >> 8 ) );
- aColor.SetGreen( sal::static_int_cast< UINT8 >( ( nParameter * aColor.GetGreen() ) >> 8 ) );
- aColor.SetBlue( sal::static_int_cast< UINT8 >( ( nParameter * aColor.GetBlue() ) >> 8 ) );
+ aColor.SetRed( sal::static_int_cast< sal_uInt8 >( ( nParameter * aColor.GetRed() ) >> 8 ) );
+ aColor.SetGreen( sal::static_int_cast< sal_uInt8 >( ( nParameter * aColor.GetGreen() ) >> 8 ) );
+ aColor.SetBlue( sal::static_int_cast< sal_uInt8 >( ( nParameter * aColor.GetBlue() ) >> 8 ) );
}
break;
case 0x02 : // lighten color by parameter
{
- UINT16 nInvParameter = ( 0x00ff - nParameter ) * 0xff;
- aColor.SetRed( sal::static_int_cast< UINT8 >( ( nInvParameter + ( nParameter * aColor.GetRed() ) ) >> 8 ) );
- aColor.SetGreen( sal::static_int_cast< UINT8 >( ( nInvParameter + ( nParameter * aColor.GetGreen() ) ) >> 8 ) );
- aColor.SetBlue( sal::static_int_cast< UINT8 >( ( nInvParameter + ( nParameter * aColor.GetBlue() ) ) >> 8 ) );
+ sal_uInt16 nInvParameter = ( 0x00ff - nParameter ) * 0xff;
+ aColor.SetRed( sal::static_int_cast< sal_uInt8 >( ( nInvParameter + ( nParameter * aColor.GetRed() ) ) >> 8 ) );
+ aColor.SetGreen( sal::static_int_cast< sal_uInt8 >( ( nInvParameter + ( nParameter * aColor.GetGreen() ) ) >> 8 ) );
+ aColor.SetBlue( sal::static_int_cast< sal_uInt8 >( ( nInvParameter + ( nParameter * aColor.GetBlue() ) ) >> 8 ) );
}
break;
case 0x03 : // add grey level RGB(p,p,p)
{
- INT16 nR = (INT16)aColor.GetRed() + (INT16)nParameter;
- INT16 nG = (INT16)aColor.GetGreen() + (INT16)nParameter;
- INT16 nB = (INT16)aColor.GetBlue() + (INT16)nParameter;
+ sal_Int16 nR = (sal_Int16)aColor.GetRed() + (sal_Int16)nParameter;
+ sal_Int16 nG = (sal_Int16)aColor.GetGreen() + (sal_Int16)nParameter;
+ sal_Int16 nB = (sal_Int16)aColor.GetBlue() + (sal_Int16)nParameter;
if ( nR > 0x00ff )
nR = 0x00ff;
if ( nG > 0x00ff )
nG = 0x00ff;
if ( nB > 0x00ff )
nB = 0x00ff;
- aColor = Color( (UINT8)nR, (UINT8)nG, (UINT8)nB );
+ aColor = Color( (sal_uInt8)nR, (sal_uInt8)nG, (sal_uInt8)nB );
}
break;
case 0x04 : // substract grey level RGB(p,p,p)
{
- INT16 nR = (INT16)aColor.GetRed() - (INT16)nParameter;
- INT16 nG = (INT16)aColor.GetGreen() - (INT16)nParameter;
- INT16 nB = (INT16)aColor.GetBlue() - (INT16)nParameter;
+ sal_Int16 nR = (sal_Int16)aColor.GetRed() - (sal_Int16)nParameter;
+ sal_Int16 nG = (sal_Int16)aColor.GetGreen() - (sal_Int16)nParameter;
+ sal_Int16 nB = (sal_Int16)aColor.GetBlue() - (sal_Int16)nParameter;
if ( nR < 0 )
nR = 0;
if ( nG < 0 )
nG = 0;
if ( nB < 0 )
nB = 0;
- aColor = Color( (UINT8)nR, (UINT8)nG, (UINT8)nB );
+ aColor = Color( (sal_uInt8)nR, (sal_uInt8)nG, (sal_uInt8)nB );
}
break;
case 0x05 : // substract from grey level RGB(p,p,p)
{
- INT16 nR = (INT16)nParameter - (INT16)aColor.GetRed();
- INT16 nG = (INT16)nParameter - (INT16)aColor.GetGreen();
- INT16 nB = (INT16)nParameter - (INT16)aColor.GetBlue();
+ sal_Int16 nR = (sal_Int16)nParameter - (sal_Int16)aColor.GetRed();
+ sal_Int16 nG = (sal_Int16)nParameter - (sal_Int16)aColor.GetGreen();
+ sal_Int16 nB = (sal_Int16)nParameter - (sal_Int16)aColor.GetBlue();
if ( nR < 0 )
nR = 0;
if ( nG < 0 )
nG = 0;
if ( nB < 0 )
nB = 0;
- aColor = Color( (UINT8)nR, (UINT8)nG, (UINT8)nB );
+ aColor = Color( (sal_uInt8)nR, (sal_uInt8)nG, (sal_uInt8)nB );
}
break;
case 0x06 : // per component: black if < p, white if >= p
@@ -3888,7 +3888,7 @@ Color SvxMSDffManager::MSO_CLR_ToColor( sal_uInt32 nColorCode, sal_uInt16 nConte
GetColorFromPalette( nUpper, aColor );
}
else // hart attributiert, eventuell mit Hinweis auf SYSTEMRGB
- aColor = Color( (BYTE)nColorCode, (BYTE)( nColorCode >> 8 ), (BYTE)( nColorCode >> 16 ) );
+ aColor = Color( (sal_uInt8)nColorCode, (sal_uInt8)( nColorCode >> 8 ), (sal_uInt8)( nColorCode >> 16 ) );
return aColor;
}
@@ -3901,8 +3901,8 @@ bool SvxMSDffManager::ReadDffString(SvStream& rSt, String& rTxt) const
else if ( aStrHd.nRecType == DFF_PST_TextBytesAtom || aStrHd.nRecType == DFF_PST_TextCharsAtom )
{
bool bUniCode=aStrHd.nRecType==DFF_PST_TextCharsAtom;
- bRet=TRUE;
- ULONG nBytes = aStrHd.nRecLen;
+ bRet=sal_True;
+ sal_uLong nBytes = aStrHd.nRecLen;
MSDFFReadZString( rSt, rTxt, nBytes, bUniCode );
if( !bUniCode )
{
@@ -3931,8 +3931,8 @@ void SvxMSDffManager::ReadObjText( const String& rText, SdrObject* pObj ) const
SdrOutliner& rOutliner = pText->ImpGetDrawOutliner();
rOutliner.Init( OUTLINERMODE_TEXTOBJECT );
- BOOL bOldUpdateMode = rOutliner.GetUpdateMode();
- rOutliner.SetUpdateMode( FALSE );
+ sal_Bool bOldUpdateMode = rOutliner.GetUpdateMode();
+ rOutliner.SetUpdateMode( sal_False );
rOutliner.SetVertical( pText->IsVerticalWriting() );
sal_uInt16 nParaIndex = 0;
@@ -3971,7 +3971,7 @@ void SvxMSDffManager::ReadObjText( const String& rText, SdrObject* pObj ) const
SfxItemSet aParagraphAttribs( rOutliner.GetEmptyItemSet() );
if ( !aSelection.nStartPos )
- aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, FALSE ) );
+ aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, sal_False ) );
aSelection.nStartPos = 0;
rOutliner.QuickSetAttribs( aParagraphAttribs, aSelection );
nParaIndex++;
@@ -3994,24 +3994,24 @@ bool SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
rSt.Seek( aTextHd.nFilePos );
else if ( aTextHd.nRecType==DFF_msofbtClientTextbox )
{
- bRet=TRUE;
- ULONG nRecEnd=aTextHd.GetRecEndFilePos();
+ bRet=sal_True;
+ sal_uLong nRecEnd=aTextHd.GetRecEndFilePos();
DffRecordHeader aHd;
String aText;
SdrOutliner& rOutliner=pText->ImpGetDrawOutliner();
- USHORT nOutlMode = rOutliner.GetMode();
+ sal_uInt16 nOutlMode = rOutliner.GetMode();
{ // Wohl 'nen kleiner Bug der EditEngine, das die
// Absastzattribute bei Clear() nicht entfernt werden.
- bool bClearParaAttribs = TRUE;
+ bool bClearParaAttribs = true;
rOutliner.SetStyleSheet( 0, NULL );
SfxItemSet aSet(rOutliner.GetEmptyItemSet());
aSet.Put(SvxColorItem( COL_BLACK ));
rOutliner.SetParaAttribs(0,aSet);
pText->SetMergedItemSet(aSet);
- bClearParaAttribs = FALSE;
+ bClearParaAttribs = sal_False;
if( bClearParaAttribs )
{
// Wohl 'nen kleiner Bug der EditEngine, dass die
@@ -4043,12 +4043,12 @@ bool SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
break;
case DFF_PST_TextRulerAtom :
{
- UINT16 nLen = (UINT16)aHd.nRecLen;
+ sal_uInt16 nLen = (sal_uInt16)aHd.nRecLen;
if(nLen)
{
- UINT16 nVal1, nVal2, nVal3;
- UINT16 nDefaultTab = 2540; // PPT def: 1 Inch //rOutliner.GetDefTab();
- UINT16 nMostrightTab = 0;
+ sal_uInt16 nVal1, nVal2, nVal3;
+ sal_uInt16 nDefaultTab = 2540; // PPT def: 1 Inch //rOutliner.GetDefTab();
+ sal_uInt16 nMostrightTab = 0;
SfxItemSet aSet(rOutliner.GetEmptyItemSet());
SvxTabStopItem aTabItem(0, 0, SVX_TAB_ADJUST_DEFAULT, EE_PARA_TABS);
@@ -4061,7 +4061,7 @@ bool SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
{
rSt >> nVal3;
nLen -= 2;
- nDefaultTab = (UINT16)(((UINT32)nVal3 * 1000) / 240);
+ nDefaultTab = (sal_uInt16)(((sal_uInt32)nVal3 * 1000) / 240);
}
// Weitere, frei gesetzte TABs
@@ -4077,7 +4077,7 @@ bool SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
rSt >> nVal3;
nLen -= 4;
- UINT16 nNewTabPos = (UINT16)(((UINT32)nVal2 * 1000) / 240);
+ sal_uInt16 nNewTabPos = (sal_uInt16)(((sal_uInt32)nVal2 * 1000) / 240);
if(nNewTabPos > nMostrightTab)
nMostrightTab = nNewTabPos;
@@ -4087,8 +4087,8 @@ bool SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
}
// evtl. noch default-TABs ergaenzen (immer)
- UINT16 nObjWidth = sal_uInt16(pObj->GetSnapRect().GetWidth() + 1);
- UINT16 nDefaultTabPos = nDefaultTab;
+ sal_uInt16 nObjWidth = sal_uInt16(pObj->GetSnapRect().GetWidth() + 1);
+ sal_uInt16 nDefaultTabPos = nDefaultTab;
while(nDefaultTabPos <= nObjWidth && nDefaultTabPos <= nMostrightTab)
nDefaultTabPos =
@@ -4129,12 +4129,12 @@ bool SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
// SHIFT-Ret ersetzen im Outliner
if(aText.GetTokenCount(0x0B) > 1)
{
- UINT32 nParaCount = rOutliner.GetParagraphCount();
- for(UINT16 a=0;a<nParaCount;a++)
+ sal_uInt32 nParaCount = rOutliner.GetParagraphCount();
+ for(sal_uInt16 a=0;a<nParaCount;a++)
{
Paragraph* pActPara = rOutliner.GetParagraph(a);
String aParaText = rOutliner.GetText(pActPara);
- for(UINT16 b=0;b<aParaText.Len();b++)
+ for(sal_uInt16 b=0;b<aParaText.Len();b++)
{
if( aParaText.GetChar( b ) == 0x0B)
{
@@ -4158,7 +4158,7 @@ bool SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
//static
void SvxMSDffManager::MSDFFReadZString( SvStream& rIn, String& rStr,
- ULONG nRecLen, bool bUniCode )
+ sal_uLong nRecLen, bool bUniCode )
{
sal_uInt16 nLen = (sal_uInt16)nRecLen;
if( nLen )
@@ -4199,18 +4199,18 @@ SdrObject* SvxMSDffManager::ImportFontWork( SvStream& rStCt, SfxItemSet& rSet, R
SdrObject* pRet = NULL;
String aObjectText;
String aFontName;
- BOOL bTextRotate = FALSE;
+ sal_Bool bTextRotate = sal_False;
((SvxMSDffManager*)this)->mnFix16Angle = 0; // we don't want to use this property in future
if ( SeekToContent( DFF_Prop_gtextUNICODE, rStCt ) )
- MSDFFReadZString( rStCt, aObjectText, GetPropertyValue( DFF_Prop_gtextUNICODE ), TRUE );
+ MSDFFReadZString( rStCt, aObjectText, GetPropertyValue( DFF_Prop_gtextUNICODE ), sal_True );
if ( SeekToContent( DFF_Prop_gtextFont, rStCt ) )
- MSDFFReadZString( rStCt, aFontName, GetPropertyValue( DFF_Prop_gtextFont ), TRUE );
+ MSDFFReadZString( rStCt, aFontName, GetPropertyValue( DFF_Prop_gtextFont ), sal_True );
if ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x2000 )
{
// Text ist senkrecht formatiert, Box Kippen
- INT32 nHalfWidth = ( rBoundRect.GetWidth() + 1) >> 1;
- INT32 nHalfHeight = ( rBoundRect.GetHeight() + 1) >> 1;
+ sal_Int32 nHalfWidth = ( rBoundRect.GetWidth() + 1) >> 1;
+ sal_Int32 nHalfHeight = ( rBoundRect.GetHeight() + 1) >> 1;
Point aTopLeft( rBoundRect.Left() + nHalfWidth - nHalfHeight,
rBoundRect.Top() + nHalfHeight - nHalfWidth);
Size aNewSize( rBoundRect.GetHeight(), rBoundRect.GetWidth() );
@@ -4219,13 +4219,13 @@ SdrObject* SvxMSDffManager::ImportFontWork( SvStream& rStCt, SfxItemSet& rSet, R
String aSrcText( aObjectText );
aObjectText.Erase();
- for( UINT16 a = 0; a < aSrcText.Len(); a++ )
+ for( sal_uInt16 a = 0; a < aSrcText.Len(); a++ )
{
aObjectText += aSrcText.GetChar( a );
aObjectText += '\n';
}
rSet.Put( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_CENTER ) );
- bTextRotate = TRUE;
+ bTextRotate = sal_True;
}
if ( aObjectText.Len() )
{ // FontWork-Objekt Mit dem Text in aObjectText erzeugen
@@ -4236,14 +4236,14 @@ SdrObject* SvxMSDffManager::ImportFontWork( SvStream& rStCt, SfxItemSet& rSet, R
((SdrRectObj*)pNewObj)->SetText( aObjectText );
SdrFitToSizeType eFTS = SDRTEXTFIT_PROPORTIONAL;
rSet.Put( SdrTextFitToSizeTypeItem( eFTS ) );
- rSet.Put( SdrTextAutoGrowHeightItem( FALSE ) );
- rSet.Put( SdrTextAutoGrowWidthItem( FALSE ) );
+ rSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
+ rSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
rSet.Put( SvxFontItem( FAMILY_DONTKNOW, aFontName, String(),
PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO ));
pNewObj->SetMergedItemSet(rSet);
- pRet = pNewObj->ConvertToPolyObj( FALSE, FALSE );
+ pRet = pNewObj->ConvertToPolyObj( sal_False, sal_False );
if( !pRet )
pRet = pNewObj;
else
@@ -4350,7 +4350,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
{
Graphic aGraf; // be sure this graphic is deleted before swapping out
if( SeekToContent( DFF_Prop_pibName, rSt ) )
- MSDFFReadZString( rSt, aFilename, GetPropertyValue( DFF_Prop_pibName ), TRUE );
+ MSDFFReadZString( rSt, aFilename, GetPropertyValue( DFF_Prop_pibName ), sal_True );
// UND, ODER folgendes:
if( !( eFlags & mso_blipflagDoNotSave ) ) // Grafik embedded
@@ -4367,10 +4367,10 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
rSt >> aHd;
if( DFF_msofbtBSE == aHd.nRecType )
{
- const ULONG nSkipBLIPLen = 20;
- const ULONG nSkipShapePos = 4;
- const ULONG nSkipBLIP = 4;
- const ULONG nSkip =
+ const sal_uLong nSkipBLIPLen = 20;
+ const sal_uLong nSkipShapePos = 4;
+ const sal_uLong nSkipBLIP = 4;
+ const sal_uLong nSkip =
nSkipBLIPLen + 4 + nSkipShapePos + 4 + nSkipBLIP;
if (nSkip <= aHd.nRecLen)
@@ -4390,7 +4390,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
if ( IsProperty( DFF_Prop_pictureTransparent ) )
{
- UINT32 nTransColor = GetPropertyValue( DFF_Prop_pictureTransparent, 0 );
+ sal_uInt32 nTransColor = GetPropertyValue( DFF_Prop_pictureTransparent, 0 );
if ( aGraf.GetType() == GRAPHIC_BITMAP )
{
@@ -4481,7 +4481,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
{
BitmapEx aBitmapEx( aGraf.GetBitmapEx() );
if ( nBrightness || nContrast || ( nGamma != 0x10000 ) )
- aBitmapEx.Adjust( nBrightness, (sal_Int16)nContrast, 0, 0, 0, (double)nGamma / 0x10000, FALSE );
+ aBitmapEx.Adjust( nBrightness, (sal_Int16)nContrast, 0, 0, 0, (double)nGamma / 0x10000, sal_False );
if ( eDrawMode == GRAPHICDRAWMODE_GREYS )
aBitmapEx.Convert( BMP_CONVERSION_8BIT_GREYS );
else if ( eDrawMode == GRAPHICDRAWMODE_MONO )
@@ -4495,7 +4495,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
{
GDIMetaFile aGdiMetaFile( aGraf.GetGDIMetaFile() );
if ( nBrightness || nContrast || ( nGamma != 0x10000 ) )
- aGdiMetaFile.Adjust( nBrightness, (sal_Int16)nContrast, 0, 0, 0, (double)nGamma / 0x10000, FALSE );
+ aGdiMetaFile.Adjust( nBrightness, (sal_Int16)nContrast, 0, 0, 0, (double)nGamma / 0x10000, sal_False );
if ( eDrawMode == GRAPHICDRAWMODE_GREYS )
aGdiMetaFile.Convert( MTF_CONVERSION_8BIT_GREYS );
else if ( eDrawMode == GRAPHICDRAWMODE_MONO )
@@ -4622,8 +4622,8 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
rSt >> aRecHd;
if ( aRecHd.nRecType == DFF_msofbtSpContainer )
{
- INT32 nGroupRotateAngle = 0;
- INT32 nSpFlags = 0;
+ sal_Int32 nGroupRotateAngle = 0;
+ sal_Int32 nSpFlags = 0;
mnFix16Angle = 0;
aRecHd.SeekToBegOfRecord( rSt );
pRet = ImportObj( rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup + 1, pShapeId );
@@ -4720,7 +4720,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
rHd.SeekToBegOfRecord( rSt );
DffObjData aObjData( rHd, rClientRect, nCalledByGroup );
- maShapeRecords.Consume( rSt, FALSE );
+ maShapeRecords.Consume( rSt, sal_False );
aObjData.bShapeType = maShapeRecords.SeekToContent( rSt, DFF_msofbtSp, SEEK_FROM_BEGINNING );
if ( aObjData.bShapeType )
{
@@ -4748,7 +4748,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
{
maShapeRecords.Current()->SeekToBegOfRecord( rSt );
#ifdef DBG_AUTOSHAPE
- ReadPropSet( rSt, pClientData, (UINT32)aObjData.eShapeType );
+ ReadPropSet( rSt, pClientData, (sal_uInt32)aObjData.eShapeType );
#else
ReadPropSet( rSt, pClientData );
#endif
@@ -4762,7 +4762,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
aObjData.bChildAnchor = maShapeRecords.SeekToContent( rSt, DFF_msofbtChildAnchor, SEEK_FROM_CURRENT_AND_RESTART );
if ( aObjData.bChildAnchor )
{
- INT32 l, o, r, u;
+ sal_Int32 l, o, r, u;
rSt >> l >> o >> r >> u;
Scale( l );
Scale( o );
@@ -4803,8 +4803,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
long nAngle = mnFix16Angle;
if ( ( nAngle > 4500 && nAngle <= 13500 ) || ( nAngle > 22500 && nAngle <= 31500 ) )
{
- INT32 nHalfWidth = ( aObjData.aBoundRect.GetWidth() + 1 ) >> 1;
- INT32 nHalfHeight = ( aObjData.aBoundRect.GetHeight() + 1 ) >> 1;
+ sal_Int32 nHalfWidth = ( aObjData.aBoundRect.GetWidth() + 1 ) >> 1;
+ sal_Int32 nHalfHeight = ( aObjData.aBoundRect.GetHeight() + 1 ) >> 1;
Point aTopLeft( aObjData.aBoundRect.Left() + nHalfWidth - nHalfHeight,
aObjData.aBoundRect.Top() + nHalfHeight - nHalfWidth );
Size aNewSize( aObjData.aBoundRect.GetHeight(), aObjData.aBoundRect.GetWidth() );
@@ -4876,7 +4876,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
SvxFontItem aLatin(EE_CHAR_FONTINFO), aAsian(EE_CHAR_FONTINFO_CJK), aComplex(EE_CHAR_FONTINFO_CTL);
GetDefaultFonts( aLatin, aAsian, aComplex );
- MSDFFReadZString( rSt, aFontName, GetPropertyValue( DFF_Prop_gtextFont ), TRUE );
+ MSDFFReadZString( rSt, aFontName, GetPropertyValue( DFF_Prop_gtextFont ), sal_True );
aSet.Put( SvxFontItem( aLatin.GetFamily(), aFontName, aLatin.GetStyleName(),
PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO ));
aSet.Put( SvxFontItem( aLatin.GetFamily(), aFontName, aLatin.GetStyleName(),
@@ -4893,13 +4893,13 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
aSet.Put( SvxWeightItem( ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x0020 ) != 0 ? WEIGHT_BOLD : WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
// SJ TODO: Vertical Writing is not correct, instead this should be
- // replaced through "CharacterRotation" by 90°, therefore a new Item has to be
+ // replaced through "CharacterRotation" by 90�, therefore a new Item has to be
// supported by svx core, api and xml file format
((SdrObjCustomShape*)pRet)->SetVerticalWriting( ( GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 ) & 0x2000 ) != 0 );
if ( SeekToContent( DFF_Prop_gtextUNICODE, rSt ) )
{
- MSDFFReadZString( rSt, aObjectText, GetPropertyValue( DFF_Prop_gtextUNICODE ), TRUE );
+ MSDFFReadZString( rSt, aObjectText, GetPropertyValue( DFF_Prop_gtextUNICODE ), sal_True );
ReadObjText( aObjectText, pRet );
}
@@ -4944,11 +4944,11 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
if ( pParaObj )
{
SdrOutliner& rOutliner = ((SdrObjCustomShape*)pRet)->ImpGetDrawOutliner();
- BOOL bOldUpdateMode = rOutliner.GetUpdateMode();
+ sal_Bool bOldUpdateMode = rOutliner.GetUpdateMode();
SdrModel* pModel = pRet->GetModel();
if ( pModel )
rOutliner.SetStyleSheetPool( (SfxStyleSheetPool*)pModel->GetStyleSheetPool() );
- rOutliner.SetUpdateMode( FALSE );
+ rOutliner.SetUpdateMode( sal_False );
rOutliner.SetText( *pParaObj );
VirtualDevice aVirDev( 1 );
aVirDev.SetMapMode( MAP_100TH_MM );
@@ -4958,12 +4958,12 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
sal_Bool bCreateNewParaObject = sal_False;
for ( i = 0; i < nParagraphs; i++ )
{
- BOOL bIsRTL = aVirDev.GetTextIsRTL( rOutliner.GetText( rOutliner.GetParagraph( i ) ), 0, STRING_LEN );
+ sal_Bool bIsRTL = aVirDev.GetTextIsRTL( rOutliner.GetText( rOutliner.GetParagraph( i ) ), 0, STRING_LEN );
if ( bIsRTL )
{
- SfxItemSet aSet2( rOutliner.GetParaAttribs( (USHORT)i ) );
+ SfxItemSet aSet2( rOutliner.GetParaAttribs( (sal_uInt16)i ) );
aSet2.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
- rOutliner.SetParaAttribs( (USHORT)i, aSet2 );
+ rOutliner.SetParaAttribs( (sal_uInt16)i, aSet2 );
bCreateNewParaObject = sal_True;
}
}
@@ -5062,7 +5062,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
if ( nStartAngle != nEndAngle )
{
XPolygon aXPoly( aPolyBoundRect.Center(), aPolyBoundRect.GetWidth() / 2, aPolyBoundRect.GetHeight() / 2,
- (USHORT)nStartAngle / 10, (USHORT)nEndAngle / 10, TRUE );
+ (sal_uInt16)nStartAngle / 10, (sal_uInt16)nEndAngle / 10, sal_True );
Rectangle aPolyPieRect( aXPoly.GetBoundRect() );
double fYScale, fXScale;
@@ -5191,8 +5191,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
// Konnektoren
MSO_ConnectorStyle eConnectorStyle = (MSO_ConnectorStyle)GetPropertyValue( DFF_Prop_cxstyle, mso_cxstyleStraight );
- ((SdrEdgeObj*)pRet)->ConnectToNode(TRUE, NULL);
- ((SdrEdgeObj*)pRet)->ConnectToNode(FALSE, NULL);
+ ((SdrEdgeObj*)pRet)->ConnectToNode(sal_True, NULL);
+ ((SdrEdgeObj*)pRet)->ConnectToNode(sal_False, NULL);
Point aPoint1( aObjData.aBoundRect.TopLeft() );
Point aPoint2( aObjData.aBoundRect.BottomRight() );
@@ -5212,13 +5212,13 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
// Linie innerhalb des Bereiches zurechtdrehen/spiegeln
if ( nSpFlags & SP_FFLIPH )
{
- INT32 n = aPoint1.X();
+ sal_Int32 n = aPoint1.X();
aPoint1.X() = aPoint2.X();
aPoint2.X() = n;
}
if ( nSpFlags & SP_FFLIPV )
{
- INT32 n = aPoint1.Y();
+ sal_Int32 n = aPoint1.Y();
aPoint1.Y() = aPoint2.Y();
aPoint2.Y() = n;
}
@@ -5337,7 +5337,7 @@ Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvS
}
else
{
- INT16 ls, ts, rs, bs;
+ sal_Int16 ls, ts, rs, bs;
rSt >> ts >> ls >> rs >> bs; // etwas seltsame Koordinatenreihenfolge ...
l = ls, t = ts, r = rs, b = bs;
}
@@ -5471,9 +5471,9 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
SEEK_FROM_CURRENT_AND_RESTART )
&& maShapeRecords.Current()->nRecLen )
{
- UINT32 nBytesLeft = maShapeRecords.Current()->nRecLen;
- UINT32 nUDData;
- UINT16 nPID;
+ sal_uInt32 nBytesLeft = maShapeRecords.Current()->nRecLen;
+ sal_uInt32 nUDData;
+ sal_uInt16 nPID;
while( 5 < nBytesLeft )
{
rSt >> nPID;
@@ -5500,7 +5500,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
}
if ( rSt.GetError() != 0 )
break;
- pImpRec->bHasUDefProp = TRUE;
+ pImpRec->bHasUDefProp = sal_True;
nBytesLeft -= 6;
}
}
@@ -5508,7 +5508,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
// Textrahmen, auch Title oder Outline
SdrObject* pOrgObj = pObj;
SdrRectObj* pTextObj = 0;
- UINT32 nTextId = GetPropertyValue( DFF_Prop_lTxid, 0 );
+ sal_uInt32 nTextId = GetPropertyValue( DFF_Prop_lTxid, 0 );
if( nTextId )
{
SfxItemSet aSet( pSdrModel->GetItemPool() );
@@ -5541,17 +5541,17 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
}
// Distance of Textbox to it's surrounding Customshape
- INT32 nTextLeft = GetPropertyValue( DFF_Prop_dxTextLeft, 91440L);
- INT32 nTextRight = GetPropertyValue( DFF_Prop_dxTextRight, 91440L );
- INT32 nTextTop = GetPropertyValue( DFF_Prop_dyTextTop, 45720L );
- INT32 nTextBottom = GetPropertyValue( DFF_Prop_dyTextBottom, 45720L );
+ sal_Int32 nTextLeft = GetPropertyValue( DFF_Prop_dxTextLeft, 91440L);
+ sal_Int32 nTextRight = GetPropertyValue( DFF_Prop_dxTextRight, 91440L );
+ sal_Int32 nTextTop = GetPropertyValue( DFF_Prop_dyTextTop, 45720L );
+ sal_Int32 nTextBottom = GetPropertyValue( DFF_Prop_dyTextBottom, 45720L );
ScaleEmu( nTextLeft );
ScaleEmu( nTextRight );
ScaleEmu( nTextTop );
ScaleEmu( nTextBottom );
- INT32 nTextRotationAngle=0;
+ sal_Int32 nTextRotationAngle=0;
bool bVerticalText = false;
if ( IsProperty( DFF_Prop_txflTextFlow ) )
{
@@ -5590,10 +5590,10 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
rTextRect.Right() = rTextRect.Left() + rTextRect.GetHeight();
rTextRect.Bottom() = rTextRect.Top() + nWidth;
- INT32 nOldTextLeft = nTextLeft;
- INT32 nOldTextRight = nTextRight;
- INT32 nOldTextTop = nTextTop;
- INT32 nOldTextBottom = nTextBottom;
+ sal_Int32 nOldTextLeft = nTextLeft;
+ sal_Int32 nOldTextRight = nTextRight;
+ sal_Int32 nOldTextTop = nTextTop;
+ sal_Int32 nOldTextBottom = nTextBottom;
nTextLeft = nOldTextBottom;
nTextRight = nOldTextTop;
@@ -5607,10 +5607,10 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
rTextRect.Right() = rTextRect.Left() + rTextRect.GetHeight();
rTextRect.Bottom() = rTextRect.Top() + nWidth;
- INT32 nOldTextLeft = nTextLeft;
- INT32 nOldTextRight = nTextRight;
- INT32 nOldTextTop = nTextTop;
- INT32 nOldTextBottom = nTextBottom;
+ sal_Int32 nOldTextLeft = nTextLeft;
+ sal_Int32 nOldTextRight = nTextRight;
+ sal_Int32 nOldTextTop = nTextTop;
+ sal_Int32 nOldTextBottom = nTextBottom;
nTextLeft = nOldTextTop;
nTextRight = nOldTextBottom;
@@ -5637,9 +5637,9 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
if( bTextFrame )
{
SvxMSDffShapeInfo aTmpRec( 0, pImpRec->nShapeId );
- aTmpRec.bSortByShapeId = TRUE;
+ aTmpRec.bSortByShapeId = sal_True;
- USHORT nFound;
+ sal_uInt16 nFound;
if( pShapeInfos->Seek_Entry( &aTmpRec, &nFound ) )
{
SvxMSDffShapeInfo& rInfo = *pShapeInfos->GetObject(nFound);
@@ -5654,7 +5654,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
bool bFitText = false;
if (GetPropertyValue(DFF_Prop_FitTextToShape) & 2)
{
- aSet.Put( SdrTextAutoGrowHeightItem( TRUE ) );
+ aSet.Put( SdrTextAutoGrowHeightItem( sal_True ) );
aSet.Put( SdrTextMinFrameHeightItem(
aNewRect.Bottom() - aNewRect.Top() ) );
aSet.Put( SdrTextMinFrameWidthItem(
@@ -5663,15 +5663,15 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
}
else
{
- aSet.Put( SdrTextAutoGrowHeightItem( FALSE ) );
- aSet.Put( SdrTextAutoGrowWidthItem( FALSE ) );
+ aSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
+ aSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
}
switch ( (MSO_WrapMode)
GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) )
{
case mso_wrapNone :
- aSet.Put( SdrTextAutoGrowWidthItem( TRUE ) );
+ aSet.Put( SdrTextAutoGrowWidthItem( sal_True ) );
if (bFitText)
{
//can't do autowidth in flys #i107184#
@@ -5679,7 +5679,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
}
break;
case mso_wrapByPoints :
- aSet.Put( SdrTextContourFrameItem( TRUE ) );
+ aSet.Put( SdrTextContourFrameItem( sal_True ) );
break;
default: break;
}
@@ -5701,46 +5701,46 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
(MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText );
SdrTextVertAdjust eTVA = SDRTEXTVERTADJUST_CENTER;
- BOOL bTVASet(FALSE);
+ sal_Bool bTVASet(sal_False);
SdrTextHorzAdjust eTHA = SDRTEXTHORZADJUST_CENTER;
- BOOL bTHASet(FALSE);
+ sal_Bool bTHASet(sal_False);
switch( eTextAnchor )
{
case mso_anchorTop:
{
eTVA = SDRTEXTVERTADJUST_TOP;
- bTVASet = TRUE;
+ bTVASet = sal_True;
}
break;
case mso_anchorTopCentered:
{
eTVA = SDRTEXTVERTADJUST_TOP;
- bTVASet = TRUE;
- bTHASet = TRUE;
+ bTVASet = sal_True;
+ bTHASet = sal_True;
}
break;
case mso_anchorMiddle:
- bTVASet = TRUE;
+ bTVASet = sal_True;
break;
case mso_anchorMiddleCentered:
{
- bTVASet = TRUE;
- bTHASet = TRUE;
+ bTVASet = sal_True;
+ bTHASet = sal_True;
}
break;
case mso_anchorBottom:
{
eTVA = SDRTEXTVERTADJUST_BOTTOM;
- bTVASet = TRUE;
+ bTVASet = sal_True;
}
break;
case mso_anchorBottomCentered:
{
eTVA = SDRTEXTVERTADJUST_BOTTOM;
- bTVASet = TRUE;
- bTHASet = TRUE;
+ bTVASet = sal_True;
+ bTHASet = sal_True;
}
break;
default : break;
@@ -5810,7 +5810,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
const SfxPoolItem* pPoolItem=NULL;
SfxItemState eState = aSet.GetItemState( XATTR_FILLCOLOR,
- FALSE, &pPoolItem );
+ sal_False, &pPoolItem );
if( SFX_ITEM_DEFAULT == eState )
aSet.Put( XFillColorItem( String(),
Color( mnDefaultColor ) ) );
@@ -5819,11 +5819,11 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
//Means that fBehindDocument is set
if (GetPropertyValue(DFF_Prop_fPrint) & 0x20)
- pImpRec->bDrawHell = TRUE;
+ pImpRec->bDrawHell = sal_True;
else
- pImpRec->bDrawHell = FALSE;
+ pImpRec->bDrawHell = sal_False;
if (GetPropertyValue(DFF_Prop_fPrint) & 0x02)
- pImpRec->bHidden = TRUE;
+ pImpRec->bHidden = sal_True;
pTextImpRec->bDrawHell = pImpRec->bDrawHell;
pTextImpRec->bHidden = pImpRec->bHidden;
pImpRec->nNextShapeId = GetPropertyValue( DFF_Prop_hspNext, 0 );
@@ -5831,8 +5831,8 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
if ( nTextId )
{
- pTextImpRec->aTextId.nTxBxS = (UINT16)( nTextId >> 16 );
- pTextImpRec->aTextId.nSequence = (UINT16)nTextId;
+ pTextImpRec->aTextId.nTxBxS = (sal_uInt16)( nTextId >> 16 );
+ pTextImpRec->aTextId.nSequence = (sal_uInt16)nTextId;
}
pTextImpRec->nDxWrapDistLeft = GetPropertyValue(
@@ -5883,7 +5883,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
pImpRec->bVFlip = (rObjData.nSpFlags & SP_FFLIPV) ? true : false;
pImpRec->bHFlip = (rObjData.nSpFlags & SP_FFLIPH) ? true : false;
- UINT32 nLineFlags = GetPropertyValue( DFF_Prop_fNoLineDrawDash );
+ sal_uInt32 nLineFlags = GetPropertyValue( DFF_Prop_fNoLineDrawDash );
pImpRec->eLineStyle = (nLineFlags & 8)
? (MSO_LineStyle)GetPropertyValue(
DFF_Prop_lineStyle,
@@ -5920,7 +5920,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
&& (rObjData.nCalledByGroup < 2) )
)
StoreShapeOrder( pImpRec->nShapeId,
- ( ( (ULONG)pImpRec->aTextId.nTxBxS ) << 16 )
+ ( ( (sal_uLong)pImpRec->aTextId.nTxBxS ) << 16 )
+ pImpRec->aTextId.nSequence, pObj );
}
else
@@ -5930,14 +5930,14 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
return pObj;
};
-void SvxMSDffManager::StoreShapeOrder(ULONG nId,
- ULONG nTxBx,
+void SvxMSDffManager::StoreShapeOrder(sal_uLong nId,
+ sal_uLong nTxBx,
SdrObject* pObject,
SwFlyFrmFmt* pFly,
short nHdFtSection) const
{
- USHORT nShpCnt = pShapeOrders->Count();
- for (USHORT nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
+ sal_uInt16 nShpCnt = pShapeOrders->Count();
+ for (sal_uInt16 nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
{
SvxMSDffShapeOrder& rOrder
= *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum ));
@@ -5954,12 +5954,12 @@ void SvxMSDffManager::StoreShapeOrder(ULONG nId,
void SvxMSDffManager::ExchangeInShapeOrder( SdrObject* pOldObject,
- ULONG nTxBx,
+ sal_uLong nTxBx,
SwFlyFrmFmt* pFly,
SdrObject* pObject) const
{
- USHORT nShpCnt = pShapeOrders->Count();
- for (USHORT nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
+ sal_uInt16 nShpCnt = pShapeOrders->Count();
+ for (sal_uInt16 nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
{
SvxMSDffShapeOrder& rOrder
= *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum ));
@@ -5976,8 +5976,8 @@ void SvxMSDffManager::ExchangeInShapeOrder( SdrObject* pOldObject,
void SvxMSDffManager::RemoveFromShapeOrder( SdrObject* pObject ) const
{
- USHORT nShpCnt = pShapeOrders->Count();
- for (USHORT nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
+ sal_uInt16 nShpCnt = pShapeOrders->Count();
+ for (sal_uInt16 nShapeNum=0; nShapeNum < nShpCnt; nShapeNum++)
{
SvxMSDffShapeOrder& rOrder
= *(SvxMSDffShapeOrder*)(pShapeOrders->GetObject( nShapeNum ));
@@ -6021,7 +6021,7 @@ SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_,
SdrModel* pSdrModel_,// s. unten: SetModel()
long nApplicationScale,
ColorData mnDefaultColor_,
- ULONG nDefaultFontHeight_,
+ sal_uLong nDefaultFontHeight_,
SvStream* pStData2_,
MSFilterTracer* pTracer )
:DffPropertyReader( *this ),
@@ -6053,8 +6053,8 @@ SvxMSDffManager::SvxMSDffManager(SvStream& rStCtrl_,
SetModel( pSdrModel_, nApplicationScale );
// FilePos des/der Stream(s) merken
- ULONG nOldPosCtrl = rStCtrl.Tell();
- ULONG nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
+ sal_uLong nOldPosCtrl = rStCtrl.Tell();
+ sal_uLong nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
// Falls kein Datenstream angegeben, gehen wir davon aus,
// dass die BLIPs im Steuerstream stehen.
@@ -6128,7 +6128,7 @@ void SvxMSDffManager::InitSvxMSDffManager( long nOffsDgg_, SvStream* pStData_, s
nSvxMSDffOLEConvFlags = nOleConvFlags;
// FilePos des/der Stream(s) merken
- ULONG nOldPosCtrl = rStCtrl.Tell();
+ sal_uLong nOldPosCtrl = rStCtrl.Tell();
SetDefaultPropSet( rStCtrl, nOffsDgg );
@@ -6147,7 +6147,7 @@ void SvxMSDffManager::InitSvxMSDffManager( long nOffsDgg_, SvStream* pStData_, s
void SvxMSDffManager::SetDgContainer( SvStream& rSt )
{
- UINT32 nFilePos = rSt.Tell();
+ sal_uInt32 nFilePos = rSt.Tell();
DffRecordHeader aDgContHd;
rSt >> aDgContHd;
// insert this container only if there is also a DgAtom
@@ -6155,7 +6155,7 @@ void SvxMSDffManager::SetDgContainer( SvStream& rSt )
{
DffRecordHeader aRecHd;
rSt >> aRecHd;
- UINT32 nDrawingId = aRecHd.nRecInstance;
+ sal_uInt32 nDrawingId = aRecHd.nRecInstance;
maDgOffsetTable.Insert( nDrawingId, (void*)(sal_uIntPtr)nFilePos );
rSt.Seek( nFilePos );
}
@@ -6165,7 +6165,7 @@ void SvxMSDffManager::GetFidclData( long nOffsDggL )
{
if ( nOffsDggL )
{
- UINT32 nDummy, nMerk = rStCtrl.Tell();
+ sal_uInt32 nDummy, nMerk = rStCtrl.Tell();
rStCtrl.Seek( nOffsDggL );
DffRecordHeader aRecHd;
@@ -6185,7 +6185,7 @@ void SvxMSDffManager::GetFidclData( long nOffsDggL )
if ( aDggAtomHd.nRecLen == ( mnIdClusters * sizeof( FIDCL ) + 16 ) )
{
mpFidcls = new FIDCL[ mnIdClusters ];
- for ( UINT32 i = 0; i < mnIdClusters; i++ )
+ for ( sal_uInt32 i = 0; i < mnIdClusters; i++ )
{
rStCtrl >> mpFidcls[ i ].dgid
>> mpFidcls[ i ].cspidCur;
@@ -6200,22 +6200,22 @@ void SvxMSDffManager::GetFidclData( long nOffsDggL )
void SvxMSDffManager::CheckTxBxStoryChain()
{
SvxMSDffShapeInfos* pOld = pShapeInfos;
- USHORT nCnt = pOld->Count();
+ sal_uInt16 nCnt = pOld->Count();
pShapeInfos = new SvxMSDffShapeInfos( (nCnt < 255)
? nCnt
: 255 );
// altes Info-Array ueberarbeiten
// (ist sortiert nach nTxBxComp)
- ULONG nChain = ULONG_MAX;
- USHORT nObjMark = 0;
- BOOL bSetReplaceFALSE = FALSE;
- USHORT nObj;
+ sal_uLong nChain = ULONG_MAX;
+ sal_uInt16 nObjMark = 0;
+ sal_Bool bSetReplaceFALSE = sal_False;
+ sal_uInt16 nObj;
for( nObj = 0; nObj < nCnt; ++nObj )
{
SvxMSDffShapeInfo* pObj = pOld->GetObject( nObj );
if( pObj->nTxBxComp )
{
- pObj->bLastBoxInChain = FALSE;
+ pObj->bLastBoxInChain = sal_False;
// Gruppenwechsel ?
// #156763#
// the text id also contains an internal drawing container id
@@ -6225,7 +6225,7 @@ void SvxMSDffManager::CheckTxBxStoryChain()
{
// voriger war letzter seiner Gruppe
if( nObj )
- pOld->GetObject( nObj-1 )->bLastBoxInChain = TRUE;
+ pOld->GetObject( nObj-1 )->bLastBoxInChain = sal_True;
// Merker und Hilfs-Flag zuruecksetzen
nObjMark = nObj;
nChain = pObj->nTxBxComp;
@@ -6236,28 +6236,28 @@ void SvxMSDffManager::CheckTxBxStoryChain()
{
// Objekt, das NICHT durch Rahmen ersetzt werden darf ?
// Hilfs-Flag setzen
- bSetReplaceFALSE = TRUE;
+ bSetReplaceFALSE = sal_True;
// ggfs Flag in Anfang der Gruppe austragen
- for( USHORT nObj2 = nObjMark; nObj2 < nObj; ++nObj2 )
- pOld->GetObject( nObj2 )->bReplaceByFly = FALSE;
+ for( sal_uInt16 nObj2 = nObjMark; nObj2 < nObj; ++nObj2 )
+ pOld->GetObject( nObj2 )->bReplaceByFly = sal_False;
}
if( bSetReplaceFALSE )
{
- pObj->bReplaceByFly = FALSE;
+ pObj->bReplaceByFly = sal_False;
}
}
// alle Shape-Info-Objekte in pShapeInfos umkopieren
// (aber nach nShapeId sortieren)
- pObj->bSortByShapeId = TRUE;
+ pObj->bSortByShapeId = sal_True;
pObj->nTxBxComp = pObj->nTxBxComp & 0xFFFF0000;
pShapeInfos->Insert( pObj );
}
// voriger war letzter seiner Gruppe
if( nObj )
- pOld->GetObject( nObj-1 )->bLastBoxInChain = TRUE;
+ pOld->GetObject( nObj-1 )->bLastBoxInChain = sal_True;
// urspruengliches Array freigeben, ohne Objekte zu zerstoeren
- pOld->Remove((USHORT)0, nCnt);
+ pOld->Remove((sal_uInt16)0, nCnt);
delete pOld;
}
@@ -6279,14 +6279,14 @@ void SvxMSDffManager::GetCtrlData( long nOffsDgg_ )
// Kontroll Stream positionieren
rStCtrl.Seek( nOffsDggL );
- BYTE nVer;
- USHORT nInst;
- USHORT nFbt;
- UINT32 nLength;
+ sal_uInt8 nVer;
+ sal_uInt16 nInst;
+ sal_uInt16 nFbt;
+ sal_uInt32 nLength;
if( !this->ReadCommonRecordHeader( rStCtrl, nVer, nInst, nFbt, nLength ) ) return;
- BOOL bOk;
- ULONG nPos = nOffsDggL + DFF_COMMON_RECORD_HEADER_SIZE;
+ sal_Bool bOk;
+ sal_uLong nPos = nOffsDggL + DFF_COMMON_RECORD_HEADER_SIZE;
// Fall A: erst Drawing Group Container, dann n Mal Drawing Container
if( DFF_msofbtDggContainer == nFbt )
@@ -6294,7 +6294,7 @@ void SvxMSDffManager::GetCtrlData( long nOffsDgg_ )
GetDrawingGroupContainerData( rStCtrl, nLength );
rStCtrl.Seek( STREAM_SEEK_TO_END );
- UINT32 nMaxStrPos = rStCtrl.Tell();
+ sal_uInt32 nMaxStrPos = rStCtrl.Tell();
nPos += nLength;
unsigned long nDrawingContainerId = 1;
@@ -6326,14 +6326,14 @@ void SvxMSDffManager::GetCtrlData( long nOffsDgg_ )
// ab hier: Drawing Group Container d.h. Dokument - weit gueltige Daten
// ======================= ========
//
-void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, ULONG nLenDgg )
+void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, sal_uLong nLenDgg )
{
- BYTE nVer;
- USHORT nInst;
- USHORT nFbt;
- UINT32 nLength;
+ sal_uInt8 nVer;
+ sal_uInt16 nInst;
+ sal_uInt16 nFbt;
+ sal_uInt32 nLength;
- ULONG nLenBStoreCont = 0, nLenFBSE = 0, nRead = 0;
+ sal_uLong nLenBStoreCont = 0, nLenFBSE = 0, nRead = 0;
// Nach einem BStore Container suchen
do
@@ -6354,8 +6354,8 @@ void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, ULONG nLenDgg
// relevanten Daten aller enthaltenen FBSEs in unserem Pointer Array ablegen.
// Dabei zaehlen wir die gefundenen FBSEs im Member nBLIPCount mit.
- const ULONG nSkipBLIPLen = 20; // bis zu nBLIPLen zu ueberspringende Bytes
- const ULONG nSkipBLIPPos = 4; // dahinter bis zu nBLIPPos zu skippen
+ const sal_uLong nSkipBLIPLen = 20; // bis zu nBLIPLen zu ueberspringende Bytes
+ const sal_uLong nSkipBLIPPos = 4; // dahinter bis zu nBLIPPos zu skippen
sal_uInt32 nBLIPLen = 0, nBLIPPos = 0;
@@ -6368,7 +6368,7 @@ void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, ULONG nLenDgg
{
nLenFBSE = nLength;
// ist FBSE gross genug fuer unsere Daten
- BOOL bOk = ( nSkipBLIPLen + 4 + nSkipBLIPPos + 4 <= nLenFBSE );
+ sal_Bool bOk = ( nSkipBLIPLen + 4 + nSkipBLIPPos + 4 <= nLenFBSE );
if( bOk )
{
@@ -6412,12 +6412,12 @@ void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, ULONG nLenDgg
// ab hier: Drawing Container d.h. Seiten (Blatt, Dia) - weit gueltige Daten
// ================= ======
//
-void SvxMSDffManager::GetDrawingContainerData( SvStream& rSt, ULONG nLenDg,
+void SvxMSDffManager::GetDrawingContainerData( SvStream& rSt, sal_uLong nLenDg,
const unsigned long nDrawingContainerId )
{
- BYTE nVer;USHORT nInst;USHORT nFbt;UINT32 nLength;
+ sal_uInt8 nVer;sal_uInt16 nInst;sal_uInt16 nFbt;sal_uInt32 nLength;
- ULONG nReadDg = 0;
+ sal_uLong nReadDg = 0;
// Wir stehen in einem Drawing Container (je einer pro Seite)
// und muessen nun
@@ -6429,7 +6429,7 @@ void SvxMSDffManager::GetDrawingContainerData( SvStream& rSt, ULONG nLenDg,
// Patriarch gefunden (der oberste Shape Group Container) ?
if( DFF_msofbtSpgrContainer == nFbt )
{
- if(!this->GetShapeGroupContainerData( rSt, nLength, TRUE, nDrawingContainerId )) return;
+ if(!this->GetShapeGroupContainerData( rSt, nLength, sal_True, nDrawingContainerId )) return;
}
else
// blanker Shape Container ? (ausserhalb vom Shape Group Container)
@@ -6444,37 +6444,37 @@ void SvxMSDffManager::GetDrawingContainerData( SvStream& rSt, ULONG nLenDg,
while( nReadDg < nLenDg );
}
-BOOL SvxMSDffManager::GetShapeGroupContainerData( SvStream& rSt,
- ULONG nLenShapeGroupCont,
- BOOL bPatriarch,
+sal_Bool SvxMSDffManager::GetShapeGroupContainerData( SvStream& rSt,
+ sal_uLong nLenShapeGroupCont,
+ sal_Bool bPatriarch,
const unsigned long nDrawingContainerId )
{
- BYTE nVer;USHORT nInst;USHORT nFbt;UINT32 nLength;
+ sal_uInt8 nVer;sal_uInt16 nInst;sal_uInt16 nFbt;sal_uInt32 nLength;
long nStartShapeGroupCont = rSt.Tell();
// Wir stehen in einem Shape Group Container (ggfs. mehrere pro Seite)
// und muessen nun
// alle enthaltenen Shape Container abklappern
- BOOL bFirst = !bPatriarch;
- ULONG nReadSpGrCont = 0;
+ sal_Bool bFirst = !bPatriarch;
+ sal_uLong nReadSpGrCont = 0;
do
{
if( !this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength ) )
- return FALSE;
+ return sal_False;
nReadSpGrCont += DFF_COMMON_RECORD_HEADER_SIZE;
// Shape Container ?
if( DFF_msofbtSpContainer == nFbt )
{
- ULONG nGroupOffs = bFirst ? nStartShapeGroupCont - DFF_COMMON_RECORD_HEADER_SIZE : ULONG_MAX;
+ sal_uLong nGroupOffs = bFirst ? nStartShapeGroupCont - DFF_COMMON_RECORD_HEADER_SIZE : ULONG_MAX;
if ( !this->GetShapeContainerData( rSt, nLength, nGroupOffs, nDrawingContainerId ) )
- return FALSE;
- bFirst = FALSE;
+ return sal_False;
+ bFirst = sal_False;
}
else
// eingeschachtelter Shape Group Container ?
if( DFF_msofbtSpgrContainer == nFbt )
{
- if ( !this->GetShapeGroupContainerData( rSt, nLength, FALSE, nDrawingContainerId ) )
- return FALSE;
+ if ( !this->GetShapeGroupContainerData( rSt, nLength, sal_False, nDrawingContainerId ) )
+ return sal_False;
}
else
rSt.SeekRel( nLength );
@@ -6483,33 +6483,33 @@ BOOL SvxMSDffManager::GetShapeGroupContainerData( SvStream& rSt,
while( nReadSpGrCont < nLenShapeGroupCont );
// den Stream wieder korrekt positionieren
rSt.Seek( nStartShapeGroupCont + nLenShapeGroupCont );
- return TRUE;
+ return sal_True;
}
-BOOL SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
- ULONG nLenShapeCont,
- ULONG nPosGroup,
+sal_Bool SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
+ sal_uLong nLenShapeCont,
+ sal_uLong nPosGroup,
const unsigned long nDrawingContainerId )
{
- BYTE nVer;USHORT nInst;USHORT nFbt;UINT32 nLength;
+ sal_uInt8 nVer;sal_uInt16 nInst;sal_uInt16 nFbt;sal_uInt32 nLength;
long nStartShapeCont = rSt.Tell();
// Wir stehen in einem Shape Container (ggfs. mehrere pro Sh. Group)
// und muessen nun
// die Shape Id und File-Pos (fuer spaetere, erneute Zugriffe)
// und den ersten BStore Verweis (falls vorhanden) entnehmen
- ULONG nLenShapePropTbl = 0;
- ULONG nReadSpCont = 0;
+ sal_uLong nLenShapePropTbl = 0;
+ sal_uLong nReadSpCont = 0;
// File Offset des Shape-Containers bzw. der Gruppe(!) vermerken
//
- ULONG nStartOffs = (ULONG_MAX > nPosGroup) ?
+ sal_uLong nStartOffs = (ULONG_MAX > nPosGroup) ?
nPosGroup : nStartShapeCont - DFF_COMMON_RECORD_HEADER_SIZE;
SvxMSDffShapeInfo aInfo( nStartOffs );
// duerfte das Shape durch einen Rahmen ersetzt werden ?
// (vorausgesetzt, es zeigt sich, dass es eine TextBox ist,
// und der Text nicht gedreht ist)
- BOOL bCanBeReplaced = (ULONG_MAX > nPosGroup) ? FALSE : TRUE;
+ sal_Bool bCanBeReplaced = (ULONG_MAX > nPosGroup) ? sal_False : sal_True;
// wir wissen noch nicht, ob es eine TextBox ist
MSO_SPT eShapeType = mso_sptNil;
@@ -6518,7 +6518,7 @@ BOOL SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
//
do
{
- if(!this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength)) return FALSE;
+ if(!this->ReadCommonRecordHeader( rSt, nVer, nInst, nFbt, nLength)) return sal_False;
nReadSpCont += DFF_COMMON_RECORD_HEADER_SIZE;
// FSP ?
if( ( DFF_msofbtSp == nFbt ) && ( 4 <= nLength ) )
@@ -6533,8 +6533,8 @@ BOOL SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
{
// Wir haben die Property Table gefunden:
// nach der Blip Property suchen!
- ULONG nPropRead = 0;
- USHORT nPropId;
+ sal_uLong nPropRead = 0;
+ sal_uInt16 nPropId;
sal_uInt32 nPropVal;
nLenShapePropTbl = nLength;
long nStartShapePropTbl = rSt.Tell();
@@ -6576,22 +6576,22 @@ BOOL SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
SVXMSDFF_SETTINGS_IMPORT_EXCEL))
{
if( 0 != nPropVal )
- bCanBeReplaced = FALSE;
+ bCanBeReplaced = sal_False;
}
break;
case DFF_Prop_Rotation :
if( 0 != nPropVal )
- bCanBeReplaced = FALSE;
+ bCanBeReplaced = sal_False;
break;
case DFF_Prop_gtextFStrikethrough :
if( ( 0x20002000 & nPropVal ) == 0x20002000 )
- bCanBeReplaced = FALSE;
+ bCanBeReplaced = sal_False;
break;
case DFF_Prop_fc3DLightFace :
if( ( 0x00080008 & nPropVal ) == 0x00080008 )
- bCanBeReplaced = FALSE;
+ bCanBeReplaced = sal_False;
break;
case DFF_Prop_WrapText :
@@ -6657,7 +6657,7 @@ BOOL SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
)
) ) )
{
- aInfo.bReplaceByFly = TRUE;
+ aInfo.bReplaceByFly = sal_True;
}
pShapeInfos->Insert( new SvxMSDffShapeInfo( aInfo ) );
pShapeOrders->Insert( new SvxMSDffShapeOrder( aInfo.nShapeId ),
@@ -6666,7 +6666,7 @@ BOOL SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
// und den Stream wieder korrekt positionieren
rSt.Seek( nStartShapeCont + nLenShapeCont );
- return TRUE;
+ return sal_True;
}
@@ -6676,13 +6676,13 @@ BOOL SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
Zugriff auf ein Shape zur Laufzeit (ueber die Shape-Id)
----------------------------------
******************************************************************************/
-BOOL SvxMSDffManager::GetShape(ULONG nId, SdrObject*& rpShape,
+sal_Bool SvxMSDffManager::GetShape(sal_uLong nId, SdrObject*& rpShape,
SvxMSDffImportData& rData)
{
SvxMSDffShapeInfo aTmpRec(0, nId);
- aTmpRec.bSortByShapeId = TRUE;
+ aTmpRec.bSortByShapeId = sal_True;
- USHORT nFound;
+ sal_uInt16 nFound;
if( pShapeInfos->Seek_Entry(&aTmpRec, &nFound) )
{
SvxMSDffShapeInfo& rInfo = *pShapeInfos->GetObject( nFound );
@@ -6691,8 +6691,8 @@ BOOL SvxMSDffManager::GetShape(ULONG nId, SdrObject*& rpShape,
if( rStCtrl.GetError() )
rStCtrl.ResetError();
// FilePos des/der Stream(s) merken
- ULONG nOldPosCtrl = rStCtrl.Tell();
- ULONG nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
+ sal_uLong nOldPosCtrl = rStCtrl.Tell();
+ sal_uLong nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
// das Shape im Steuer Stream anspringen
rStCtrl.Seek( rInfo.nFilePos );
@@ -6708,7 +6708,7 @@ BOOL SvxMSDffManager::GetShape(ULONG nId, SdrObject*& rpShape,
pStData->Seek( nOldPosData );
return ( 0 != rpShape );
}
- return FALSE;
+ return sal_False;
}
@@ -6716,9 +6716,9 @@ BOOL SvxMSDffManager::GetShape(ULONG nId, SdrObject*& rpShape,
/* Zugriff auf ein BLIP zur Laufzeit (bei bereits bekannter Blip-Nr)
---------------------------------
******************************************************************************/
-BOOL SvxMSDffManager::GetBLIP( ULONG nIdx_, Graphic& rData, Rectangle* pVisArea ) const
+sal_Bool SvxMSDffManager::GetBLIP( sal_uLong nIdx_, Graphic& rData, Rectangle* pVisArea ) const
{
- BOOL bOk = FALSE; // Ergebnisvariable initialisieren
+ sal_Bool bOk = sal_False; // Ergebnisvariable initialisieren
if ( pStData )
{
// check if a graphic for this blipId is already imported
@@ -6743,8 +6743,8 @@ BOOL SvxMSDffManager::GetBLIP( ULONG nIdx_, Graphic& rData, Rectangle* pVisArea
}
if ( !bOk )
{
- USHORT nIdx = USHORT( nIdx_ );
- if( !nIdx || (pBLIPInfos->Count() < nIdx) ) return FALSE;
+ sal_uInt16 nIdx = sal_uInt16( nIdx_ );
+ if( !nIdx || (pBLIPInfos->Count() < nIdx) ) return sal_False;
// eventuell alte(s) Errorflag(s) loeschen
if( rStCtrl.GetError() )
@@ -6754,8 +6754,8 @@ BOOL SvxMSDffManager::GetBLIP( ULONG nIdx_, Graphic& rData, Rectangle* pVisArea
pStData->ResetError();
// FilePos des/der Stream(s) merken
- ULONG nOldPosCtrl = rStCtrl.Tell();
- ULONG nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
+ sal_uLong nOldPosCtrl = rStCtrl.Tell();
+ sal_uLong nOldPosData = pStData ? pStData->Tell() : nOldPosCtrl;
// passende Info-Struct aus unserem Pointer Array nehmen
SvxMSDffBLIPInfo& rInfo = *(*pBLIPInfos)[ nIdx-1 ];
@@ -6773,7 +6773,7 @@ BOOL SvxMSDffManager::GetBLIP( ULONG nIdx_, Graphic& rData, Rectangle* pVisArea
// Datenstream, in dem die Grafik liegen koennte!
if( pStData2->GetError() )
pStData2->ResetError();
- ULONG nOldPosData2 = pStData2->Tell();
+ sal_uLong nOldPosData2 = pStData2->Tell();
// das BLIP Atom im zweiten Daten Stream anspringen
pStData2->Seek( rInfo.nFilePos );
// ggfs. Fehlerstatus zuruecksetzen
@@ -6806,23 +6806,23 @@ BOOL SvxMSDffManager::GetBLIP( ULONG nIdx_, Graphic& rData, Rectangle* pVisArea
/* Zugriff auf ein BLIP zur Laufzeit (mit korrekt positioniertem Stream)
---------------------------------
******************************************************************************/
-BOOL SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rectangle* pVisArea ) const
+sal_Bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rectangle* pVisArea ) const
{
- ULONG nOldPos = rBLIPStream.Tell();
+ sal_uLong nOldPos = rBLIPStream.Tell();
int nRes = GRFILTER_OPENERROR; // Fehlervariable initialisieren
// nachschauen, ob es sich auch wirklich um ein BLIP handelt
- UINT32 nLength;
- USHORT nInst, nFbt( 0 );
- BYTE nVer;
+ sal_uInt32 nLength;
+ sal_uInt16 nInst, nFbt( 0 );
+ sal_uInt8 nVer;
if( ReadCommonRecordHeader( rBLIPStream, nVer, nInst, nFbt, nLength) && ( 0xF018 <= nFbt ) && ( 0xF117 >= nFbt ) )
{
Size aMtfSize100;
- BOOL bMtfBLIP = FALSE;
- BOOL bZCodecCompression = FALSE;
+ sal_Bool bMtfBLIP = sal_False;
+ sal_Bool bZCodecCompression = sal_False;
// Nun exakt auf den Beginn der eingebetteten Grafik positionieren
- ULONG nSkip = ( nInst & 0x0001 ) ? 32 : 16;
+ sal_uLong nSkip = ( nInst & 0x0001 ) ? 32 : 16;
switch( nInst & 0xFFFE )
{
@@ -6843,7 +6843,7 @@ BOOL SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rect
// skip rest of header
nSkip = 6;
- bMtfBLIP = bZCodecCompression = TRUE;
+ bMtfBLIP = bZCodecCompression = sal_True;
}
break;
case 0x46A : // One byte tag then JPEG (= JFIF) data
@@ -6926,7 +6926,7 @@ BOOL SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rect
if( ( nInst & 0xFFFE ) == 0x7A8 )
{ // DIBs direkt holen
Bitmap aNew;
- if( aNew.Read( *pGrStream, FALSE ) )
+ if( aNew.Read( *pGrStream, sal_False ) )
{
rData = Graphic( aNew );
nRes = GRFILTER_OK;
@@ -6974,7 +6974,7 @@ BOOL SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rect
}
/* static */
-BOOL SvxMSDffManager::ReadCommonRecordHeader(DffRecordHeader& rRec, SvStream& rIn)
+sal_Bool SvxMSDffManager::ReadCommonRecordHeader(DffRecordHeader& rRec, SvStream& rIn)
{
rRec.nFilePos = rIn.Tell();
return SvxMSDffManager::ReadCommonRecordHeader( rIn,rRec.nRecVer,
@@ -6985,15 +6985,15 @@ BOOL SvxMSDffManager::ReadCommonRecordHeader(DffRecordHeader& rRec, SvStream& rI
/* auch static */
-BOOL SvxMSDffManager::ReadCommonRecordHeader( SvStream& rSt,
- BYTE& rVer,
- USHORT& rInst,
- USHORT& rFbt,
- UINT32& rLength )
+sal_Bool SvxMSDffManager::ReadCommonRecordHeader( SvStream& rSt,
+ sal_uInt8& rVer,
+ sal_uInt16& rInst,
+ sal_uInt16& rFbt,
+ sal_uInt32& rLength )
{
sal_uInt16 nTmp;
rSt >> nTmp >> rFbt >> rLength;
- rVer = sal::static_int_cast< BYTE >(nTmp & 15);
+ rVer = sal::static_int_cast< sal_uInt8 >(nTmp & 15);
rInst = nTmp >> 4;
return rSt.GetError() == 0;
}
@@ -7001,8 +7001,8 @@ BOOL SvxMSDffManager::ReadCommonRecordHeader( SvStream& rSt,
-BOOL SvxMSDffManager::ProcessClientAnchor(SvStream& rStData, ULONG nDatLen,
- char*& rpBuff, UINT32& rBuffLen ) const
+sal_Bool SvxMSDffManager::ProcessClientAnchor(SvStream& rStData, sal_uLong nDatLen,
+ char*& rpBuff, sal_uInt32& rBuffLen ) const
{
if( nDatLen )
{
@@ -7010,11 +7010,11 @@ BOOL SvxMSDffManager::ProcessClientAnchor(SvStream& rStData, ULONG nDatLen,
rBuffLen = nDatLen;
rStData.Read( rpBuff, nDatLen );
}
- return TRUE;
+ return sal_True;
}
-BOOL SvxMSDffManager::ProcessClientData(SvStream& rStData, ULONG nDatLen,
- char*& rpBuff, UINT32& rBuffLen ) const
+sal_Bool SvxMSDffManager::ProcessClientData(SvStream& rStData, sal_uLong nDatLen,
+ char*& rpBuff, sal_uInt32& rBuffLen ) const
{
if( nDatLen )
{
@@ -7022,7 +7022,7 @@ BOOL SvxMSDffManager::ProcessClientData(SvStream& rStData, ULONG nDatLen,
rBuffLen = nDatLen;
rStData.Read( rpBuff, nDatLen );
}
- return TRUE;
+ return sal_True;
}
@@ -7031,19 +7031,19 @@ void SvxMSDffManager::ProcessClientAnchor2( SvStream& /* rSt */, DffRecordHeader
return; // wird von SJ im Draw ueberladen
}
-ULONG SvxMSDffManager::Calc_nBLIPPos( ULONG nOrgVal, ULONG /* nStreamPos */ ) const
+sal_uLong SvxMSDffManager::Calc_nBLIPPos( sal_uLong nOrgVal, sal_uLong /* nStreamPos */ ) const
{
return nOrgVal;
}
-BOOL SvxMSDffManager::GetOLEStorageName( long /* nOLEId */, String&, SvStorageRef&, uno::Reference < embed::XStorage >& ) const
+sal_Bool SvxMSDffManager::GetOLEStorageName( long /* nOLEId */, String&, SvStorageRef&, uno::Reference < embed::XStorage >& ) const
{
- return FALSE;
+ return sal_False;
}
-BOOL SvxMSDffManager::ShapeHasText( ULONG /* nShapeId */, ULONG /* nFilePos */ ) const
+sal_Bool SvxMSDffManager::ShapeHasText( sal_uLong /* nShapeId */, sal_uLong /* nFilePos */ ) const
{
- return TRUE;
+ return sal_True;
}
// #i32596# - add new parameter <_nCalledByGroup>
@@ -7076,7 +7076,7 @@ const GDIMetaFile* SvxMSDffManager::lcl_GetMetaFileFromGrf_Impl( const Graphic&
const Size aSz(lcl_GetPrefSize(rGrf, MAP_100TH_MM));
VirtualDevice aVirtDev;
- aVirtDev.EnableOutput( FALSE );
+ aVirtDev.EnableOutput( sal_False );
MapMode aMM(MAP_100TH_MM);
aVirtDev.SetMapMode( aMM );
@@ -7093,15 +7093,15 @@ const GDIMetaFile* SvxMSDffManager::lcl_GetMetaFileFromGrf_Impl( const Graphic&
return pMtf;
}
-BOOL SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile & rMtf )
+sal_Bool SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile & rMtf )
{
String aPersistStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( SVEXT_PERSIST_STREAM ) ) );
SotStorageStreamRef xStm = pStor->OpenSotStream( aPersistStream );
xStm->SetVersion( pStor->GetVersion() );
xStm->SetBufferSize( 8192 );
- USHORT nAspect = ASPECT_CONTENT;
- ULONG nAdviseModes = 2;
+ sal_uInt16 nAspect = ASPECT_CONTENT;
+ sal_uLong nAdviseModes = 2;
Impl_OlePres aEle( FORMAT_GDIMETAFILE );
// Die Groesse in 1/100 mm umrechnen
@@ -7122,7 +7122,7 @@ BOOL SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile &
}
struct ClsIDs {
- UINT32 nId;
+ sal_uInt32 nId;
const sal_Char* pSvrName;
const sal_Char* pDspName;
};
@@ -7233,24 +7233,24 @@ static ClsIDs aClsIDs[] = {
{ 0, "", "" } };
-BOOL SvxMSDffManager::ConvertToOle2( SvStream& rStm, UINT32 nReadLen,
+sal_Bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen,
const GDIMetaFile * pMtf, const SotStorageRef& rDest )
{
- BOOL bMtfRead = FALSE;
+ sal_Bool bMtfRead = sal_False;
SotStorageStreamRef xOle10Stm = rDest->OpenSotStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole10Native" ) ),
STREAM_WRITE| STREAM_SHARE_DENYALL );
if( xOle10Stm->GetError() )
- return FALSE;
+ return sal_False;
- UINT32 nType;
- UINT32 nRecType;
- UINT32 nStrLen;
+ sal_uInt32 nType;
+ sal_uInt32 nRecType;
+ sal_uInt32 nStrLen;
String aSvrName;
- UINT32 nDummy0;
- UINT32 nDummy1;
- UINT32 nDataLen;
- BYTE * pData;
- UINT32 nBytesRead = 0;
+ sal_uInt32 nDummy0;
+ sal_uInt32 nDummy1;
+ sal_uInt32 nDataLen;
+ sal_uInt8 * pData;
+ sal_uInt32 nBytesRead = 0;
do
{
rStm >> nType;
@@ -7262,7 +7262,7 @@ BOOL SvxMSDffManager::ConvertToOle2( SvStream& rStm, UINT32 nReadLen,
{
sal_Char * pBuf = new sal_Char[ nStrLen ];
rStm.Read( pBuf, nStrLen );
- aSvrName.Assign( String( pBuf, (USHORT) nStrLen-1, gsl_getSystemTextEncoding() ) );
+ aSvrName.Assign( String( pBuf, (sal_uInt16) nStrLen-1, gsl_getSystemTextEncoding() ) );
delete[] pBuf;
}
else
@@ -7272,15 +7272,15 @@ BOOL SvxMSDffManager::ConvertToOle2( SvStream& rStm, UINT32 nReadLen,
rStm >> nDummy1;
rStm >> nDataLen;
- nBytesRead += 6 * sizeof( UINT32 ) + nStrLen + nDataLen;
+ nBytesRead += 6 * sizeof( sal_uInt32 ) + nStrLen + nDataLen;
if( !rStm.IsEof() && nReadLen > nBytesRead && nDataLen )
{
if( xOle10Stm.Is() )
{
- pData = new BYTE[ nDataLen ];
+ pData = new sal_uInt8[ nDataLen ];
if( !pData )
- return FALSE;
+ return sal_False;
rStm.Read( pData, nDataLen );
@@ -7301,13 +7301,13 @@ BOOL SvxMSDffManager::ConvertToOle2( SvStream& rStm, UINT32 nReadLen,
if( pIds->nId )
{
// gefunden!
- ULONG nCbFmt = SotExchange::RegisterFormatName( aSvrName );
+ sal_uLong nCbFmt = SotExchange::RegisterFormatName( aSvrName );
rDest->SetClass( SvGlobalName( pIds->nId, 0, 0, 0xc0,0,0,0,0,0,0,0x46 ), nCbFmt,
String( pIds->pDspName, RTL_TEXTENCODING_ASCII_US ) );
}
else
{
- ULONG nCbFmt = SotExchange::RegisterFormatName( aSvrName );
+ sal_uLong nCbFmt = SotExchange::RegisterFormatName( aSvrName );
rDest->SetClass( SvGlobalName(), nCbFmt, aSvrName );
}
@@ -7315,15 +7315,15 @@ BOOL SvxMSDffManager::ConvertToOle2( SvStream& rStm, UINT32 nReadLen,
}
else if( nRecType == 5 && !pMtf )
{
- ULONG nPos = rStm.Tell();
- UINT16 sz[4];
+ sal_uLong nPos = rStm.Tell();
+ sal_uInt16 sz[4];
rStm.Read( sz, 8 );
Graphic aGraphic;
if( ERRCODE_NONE == GraphicConverter::Import( rStm, aGraphic ) && aGraphic.GetType() )
{
const GDIMetaFile& rMtf = aGraphic.GetGDIMetaFile();
MakeContentStream( rDest, rMtf );
- bMtfRead = TRUE;
+ bMtfRead = sal_True;
}
// set behind the data
rStm.Seek( nPos + nDataLen );
@@ -7336,10 +7336,10 @@ BOOL SvxMSDffManager::ConvertToOle2( SvStream& rStm, UINT32 nReadLen,
if( !bMtfRead && pMtf )
{
MakeContentStream( rDest, *pMtf );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
const char* GetInternalServerName_Impl( const SvGlobalName& aGlobName )
@@ -7406,7 +7406,7 @@ const char* GetInternalServerName_Impl( const SvGlobalName& aGlobName )
return ::rtl::OUString();
}
-com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > SvxMSDffManager::CheckForConvertToSOObj( UINT32 nConvertFlags,
+com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > SvxMSDffManager::CheckForConvertToSOObj( sal_uInt32 nConvertFlags,
SotStorage& rSrcStg, const uno::Reference < embed::XStorage >& rDestStorage,
const Graphic& rGrf,
const Rectangle& rVisArea )
@@ -7421,12 +7421,12 @@ com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > SvxMS
{
static struct _ObjImpType
{
- UINT32 nFlag;
+ sal_uInt32 nFlag;
const char* pFactoryNm;
// GlobalNameId
- UINT32 n1;
- USHORT n2, n3;
- BYTE b8, b9, b10, b11, b12, b13, b14, b15;
+ sal_uInt32 n1;
+ sal_uInt16 n2, n3;
+ sal_uInt8 b8, b9, b10, b11, b12, b13, b14, b15;
} aArr[] = {
{ OLE_MATHTYPE_2_STARMATH, "smath",
0x0002ce02L, 0x0000, 0x0000,
@@ -7489,7 +7489,7 @@ com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > SvxMS
else
{
SfxFilterMatcher aMatch( sStarName );
- SotStorageRef xStorage = new SotStorage( FALSE, *pStream );
+ SotStorageRef xStorage = new SotStorage( sal_False, *pStream );
rSrcStg.CopyTo( xStorage );
xStorage->Commit();
xStorage.Clear();
@@ -7566,12 +7566,12 @@ com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > SvxMS
// don't modify the object
//TODO/LATER: remove those hacks, that needs to be done differently!
- //xIPObj->EnableSetModified( FALSE );
+ //xIPObj->EnableSetModified( sal_False );
awt::Size aSize;
aSize.Width = aSz.Width();
aSize.Height = aSz.Height();
xObj->setVisualAreaSize( nViewAspect, aSize );
- //xIPObj->EnableSetModified( TRUE );
+ //xIPObj->EnableSetModified( sal_True );
}
else if ( sStarName.EqualsAscii( "smath" ) )
{ // SJ: force the object to recalc its visarea
@@ -7594,7 +7594,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
const Rectangle& rVisArea,
SvStream* pDataStrm,
ErrCode& rError,
- UINT32 nConvertFlags,
+ sal_uInt32 nConvertFlags,
sal_Int64 nReccomendedAspect )
{
sal_Int64 nAspect = nReccomendedAspect;
@@ -7605,7 +7605,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
// Ist der 01Ole-Stream ueberhaupt vorhanden ?
// ( ist er z.B. bei FontWork nicht )
// Wenn nicht -> Einbindung als Grafik
- BOOL bValidStorage = FALSE;
+ sal_Bool bValidStorage = sal_False;
String aDstStgName( String::CreateFromAscii(
RTL_CONSTASCII_STRINGPARAM(MSO_OLE_Obj)));
@@ -7617,7 +7617,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
if( xObjStg.Is() )
{
{
- BYTE aTestA[10]; // exist the \1CompObj-Stream ?
+ sal_uInt8 aTestA[10]; // exist the \1CompObj-Stream ?
SvStorageStreamRef xSrcTst = xObjStg->OpenSotStream(
String(RTL_CONSTASCII_STRINGPARAM("\1CompObj"),
RTL_TEXTENCODING_MS_1252 ));
@@ -7648,7 +7648,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
STREAM_STD_READ | STREAM_NOCREATE );
if ( xObjInfoSrc.Is() && !xObjInfoSrc->GetError() )
{
- BYTE nByte = 0;
+ sal_uInt8 nByte = 0;
*xObjInfoSrc >> nByte;
if ( ( nByte >> 4 ) & embed::Aspects::MSOLE_ICON )
nAspect = embed::Aspects::MSOLE_ICON;
@@ -7689,21 +7689,21 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
if( xObjStor->GetError() )
{
rError = xObjStor->GetError();
- bValidStorage = FALSE;
+ bValidStorage = sal_False;
}
else if( !xObjStor.Is() )
- bValidStorage = FALSE;
+ bValidStorage = sal_False;
}
}
else if( pDataStrm )
{
- UINT32 nLen, nDummy;
+ sal_uInt32 nLen, nDummy;
*pDataStrm >> nLen >> nDummy;
if( SVSTREAM_OK != pDataStrm->GetError() ||
// Id in BugDoc - exist there other Ids?
// The ConvertToOle2 - does not check for consistent
0x30008 != nDummy )
- bValidStorage = FALSE;
+ bValidStorage = sal_False;
else
{
// or is it an OLE-1 Stream in the DataStream?
@@ -7742,9 +7742,9 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
aAwtSz.Width = rVisArea.GetWidth();
aAwtSz.Height = rVisArea.GetHeight();
}
- //xInplaceObj->EnableSetModified( FALSE );
+ //xInplaceObj->EnableSetModified( sal_False );
xObj->setVisualAreaSize( nAspect, aAwtSz );
- //xInplaceObj->EnableSetModified( TRUE );*/
+ //xInplaceObj->EnableSetModified( sal_True );*/
}
catch( uno::Exception& )
{
@@ -7769,7 +7769,7 @@ SdrObject* SvxMSDffManager::GetAutoForm( MSO_SPT eTyp ) const
{
SdrObject* pRet = NULL;
- if(120 >= UINT16(eTyp))
+ if(120 >= sal_uInt16(eTyp))
{
pRet = new SdrRectObj();
}
@@ -7845,14 +7845,15 @@ SvxMSDffImportRec::SvxMSDffImportRec()
{
eLineStyle = mso_lineSimple; // GPF-Bug #66227#
eLineDashing = mso_lineSolid;
- bDrawHell = FALSE;
- bHidden = FALSE;
- bReplaceByFly = FALSE;
- bLastBoxInChain = TRUE;
- bHasUDefProp = FALSE; // was the DFF_msofbtUDefProp record set?
- bVFlip = FALSE;
- bHFlip = FALSE;
- bAutoWidth = FALSE;
+ bDrawHell = sal_False;
+ bHidden = sal_False;
+
+ bReplaceByFly = sal_False;
+ bLastBoxInChain = sal_True;
+ bHasUDefProp = sal_False; // was the DFF_msofbtUDefProp record set?
+ bVFlip = sal_False;
+ bHFlip = sal_False;
+ bAutoWidth = sal_False;
}
SvxMSDffImportRec::SvxMSDffImportRec(const SvxMSDffImportRec& rCopy)
diff --git a/filter/source/msfilter/msfilter.component b/filter/source/msfilter/msfilter.component
new file mode 100755
index 000000000000..64128aa1385b
--- /dev/null
+++ b/filter/source/msfilter/msfilter.component
@@ -0,0 +1,34 @@
+<?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.vba.VBAMacroResolver">
+ <service name="com.sun.star.script.vba.VBAMacroResolver"/>
+ </implementation>
+</component>
diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx
index 9b4b3acbec98..66e861d88396 100644
--- a/filter/source/msfilter/msocximex.cxx
+++ b/filter/source/msfilter/msocximex.cxx
@@ -2002,7 +2002,7 @@ sal_Bool OCX_OptionButton::Import(com::sun::star::uno::Reference<
if (pValue)
{
- INT16 nTmp = pValue[0]-0x30;
+ sal_Int16 nTmp = pValue[0]-0x30;
aTmp <<= nTmp;
if (!bSetInDialog)
rPropSet->setPropertyValue( WW8_ASCII2STR("DefaultState"), aTmp);
@@ -2693,7 +2693,7 @@ sal_Bool OCX_ToggleButton::Import(com::sun::star::uno::Reference<
if (pValue)
{
- INT16 nTmp=pValue[0]-0x30;
+ sal_Int16 nTmp=pValue[0]-0x30;
//aTmp <<= nTmp == 1;
aTmp <<= nTmp;
rPropSet->setPropertyValue( WW8_ASCII2STR("State"), aTmp);
@@ -3808,7 +3808,7 @@ OCX_MultiPage::OCX_MultiPage( SotStorageRef& parent,
mnForeColor = 0x80000012L,
mnBackColor = 0x8000000FL;
bSetInDialog = true;// UserForm control only
- aFontData.SetHasAlign(TRUE);
+ aFontData.SetHasAlign(sal_True);
nActiveTab = 0;
// open up the 'x' stream
mXStream = mContainerStorage->OpenSotStream(
@@ -3939,7 +3939,7 @@ OCX_Page::OCX_Page( SotStorageRef& parent,
mnForeColor = 0x80000012,
mnBackColor = 0x8000000F,
bSetInDialog = true;// UserForm control only
- aFontData.SetHasAlign(TRUE);
+ aFontData.SetHasAlign(sal_True);
}
@@ -3977,7 +3977,7 @@ OCX_Frame::OCX_Frame( SotStorageRef& parent,
mnForeColor = 0x80000012;
mnBackColor = 0x8000000F;
bSetInDialog = true;// UserForm control only
- aFontData.SetHasAlign(TRUE);
+ aFontData.SetHasAlign(sal_True);
}
@@ -4370,7 +4370,7 @@ OCX_Control * SvxMSConvertOCXControls::OCX_Factory(
sal_Bool SvxMSConvertOCXControls::ReadOCXStream( SvStorageRef& rSrc1,
- uno::Reference < drawing::XShape > *pShapeRef,BOOL bFloatingCtrl)
+ uno::Reference < drawing::XShape > *pShapeRef,sal_Bool bFloatingCtrl)
{
SvStorageStreamRef xCrash = rSrc1->OpenSotStream( WW8_ASCII2STR("contents") );
@@ -4422,7 +4422,7 @@ sal_Bool SvxMSConvertOCXControls::ReadOCXStream( SvStorageRef& rSrc1,
sal_Bool SvxMSConvertOCXControls::ReadOCXExcelKludgeStream(
SvStorageStreamRef& rSrc1, uno::Reference < drawing::XShape > *
- pShapeRef,BOOL bFloatingCtrl)
+ pShapeRef,sal_Bool bFloatingCtrl)
{
sal_Bool bRet=sal_False;
/*Get Class Id of this object, see if it is one of the types
@@ -4586,7 +4586,7 @@ sal_Bool OCX_CheckBox::Import(com::sun::star::uno::Reference<
if (pValue)
{
- INT16 nTmp=pValue[0]-0x30;
+ sal_Int16 nTmp=pValue[0]-0x30;
aTmp <<= nTmp;
if ( !bSetInDialog )
rPropSet->setPropertyValue( WW8_ASCII2STR("DefaultState"), aTmp);
@@ -4829,7 +4829,7 @@ sal_Bool OCX_FontData::Read(SvStorageStream *pS)
lclReadCharArray( *pS, pFontName, nFontNameLen, pS->Tell() - nStart);
ReadAlign(pS, pS->Tell() - nStart, 4);
- return(TRUE);
+ return(sal_True);
}
void OCX_FontData::Import(uno::Reference< beans::XPropertySet > &rPropSet)
@@ -5290,7 +5290,7 @@ sal_Bool OCX_TabStrip::ReadFontData(SotStorageStream* /* pS */)
sal_Bool OCX_Image::Read(SotStorageStream *pS)
{
- ULONG nStart = pS->Tell();
+ sal_uLong nStart = pS->Tell();
*pS >> nIdentifier;
DBG_ASSERT(nStandardId==nIdentifier,
"A control that has a different identifier");
@@ -5804,7 +5804,7 @@ void OCX_SpinButton::GetBoolProperty(
sal_Bool OCX_SpinButton::WriteData( SvStream& rStrm ) const
{
sal_Bool bRet = sal_True;
- ULONG nStartPos = rStrm.Tell();
+ sal_uLong nStartPos = rStrm.Tell();
rStrm << sal_Int32( 0 ) << mnBlockFlags;
diff --git a/filter/source/msfilter/msoleexp.cxx b/filter/source/msfilter/msoleexp.cxx
index b0ec82904cb3..ca691767477b 100644
--- a/filter/source/msfilter/msoleexp.cxx
+++ b/filter/source/msfilter/msoleexp.cxx
@@ -147,13 +147,13 @@ void SvxMSExportOLEObjects::ExportOLEObject( svt::EmbeddedObjectRef& rObj, SvSto
const SfxFilter* pExpFilter = NULL;
{
static struct _ObjExpType {
- UINT32 nFlag;
+ sal_uInt32 nFlag;
const char* pFilterNm;
// GlobalNameId
struct _GlobalNameIds {
- UINT32 n1;
- USHORT n2, n3;
- BYTE b8, b9, b10, b11, b12, b13, b14, b15;
+ sal_uInt32 n1;
+ sal_uInt16 n2, n3;
+ sal_uInt8 b8, b9, b10, b11, b12, b13, b14, b15;
}
aGlNmIds[4];
} aArr[] = {
@@ -226,7 +226,7 @@ void SvxMSExportOLEObjects::ExportOLEObject( svt::EmbeddedObjectRef& rObj, SvSto
}
catch( uno::Exception& ) {} // #TODO really handle exceptions - interactionalhandler etc. ?
- SotStorageRef xOLEStor = new SotStorage( pStream, TRUE );
+ SotStorageRef xOLEStor = new SotStorage( pStream, sal_True );
xOLEStor->CopyTo( &rDestStg );
rDestStg.Commit();
}
diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx
index b0b9b42d861f..91fb81c96153 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -38,13 +38,15 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
#include <com/sun/star/script/vba/XVBACompatibility.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <tools/urlobj.hxx>
#include <osl/file.hxx>
#include <unotools/pathoptions.hxx>
using namespace ::com::sun::star;
-namespace ooo { namespace vba {
+namespace ooo {
+namespace vba {
const static rtl::OUString sUrlPart0( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.script:" ));
const static rtl::OUString sUrlPart1( RTL_CONSTASCII_USTRINGPARAM( "?language=Basic&location=document" ));
@@ -65,6 +67,16 @@ String makeMacroURL( const String& sMacroName )
return ::rtl::OUString();
}
+::rtl::OUString trimMacroName( const ::rtl::OUString& rMacroName )
+{
+ // the name may contain whitespaces and may be enclosed in apostrophs
+ ::rtl::OUString aMacroName = rMacroName.trim();
+ sal_Int32 nMacroLen = aMacroName.getLength();
+ if( (nMacroLen >= 2) && (aMacroName[ 0 ] == '\'') && (aMacroName[ nMacroLen - 1 ] == '\'') )
+ aMacroName = aMacroName.copy( 1, nMacroLen - 2 ).trim();
+ return aMacroName;
+}
+
SfxObjectShell* findShellForUrl( const rtl::OUString& sMacroURLOrPath )
{
SfxObjectShell* pFoundShell=NULL;
@@ -94,6 +106,24 @@ SfxObjectShell* findShellForUrl( const rtl::OUString& sMacroURLOrPath )
, rtl::OUStringToOString( xModel->getURL(), RTL_TEXTENCODING_UTF8 ).getStr()
, rtl::OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ).getStr()
);
+ ::rtl::OUString aName = xModel->getURL() ;
+ if (0 == aName.getLength())
+ {
+
+ const static rtl::OUString sTitle( RTL_CONSTASCII_USTRINGPARAM("Title" ) );
+ uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW );
+ xProps->getPropertyValue(sTitle) >>= aName;
+ sal_Int32 pos = 0;
+ aName = aName.getToken(0,'-',pos);
+ aName = aName.trim();
+ if( sMacroURLOrPath.lastIndexOf( aName ) >= 0 )
+ {
+ pFoundShell = pShell;
+ break;
+ }
+ }
+
if ( sMacroURLOrPath.endsWithIgnoreAsciiCaseAsciiL( ".dot", 4 ) )
{
uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( xModel, uno::UNO_QUERY );
@@ -157,7 +187,7 @@ bool hasMacro( SfxObjectShell* pShell, const String& sLibrary, String& sMod, con
StarBASIC* pBasic = pBasicMgr->GetLib( sLibrary );
if ( !pBasic )
{
- USHORT nId = pBasicMgr->GetLibId( sLibrary );
+ sal_uInt16 nId = pBasicMgr->GetLibId( sLibrary );
pBasicMgr->LoadLib( nId );
pBasic = pBasicMgr->GetLib( sLibrary );
}
@@ -211,26 +241,16 @@ void parseMacro( const rtl::OUString& sMacro, String& sContainer, String& sModul
sProcedure = sMacro;
}
-VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& MacroName, bool bSearchGlobalTemplates )
+MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUString& MacroName, bool bSearchGlobalTemplates )
{
- VBAMacroResolvedInfo aRes;
- if ( !pShell )
- return aRes;
- aRes.SetMacroDocContext( pShell );
+ if( !pShell )
+ return MacroResolvedInfo();
// the name may be enclosed in apostrophs
- ::rtl::OUString sMacroUrl = MacroName;
- sal_Int32 nMacroLen = MacroName.getLength();
- if( (nMacroLen >= 2) && (MacroName[0] == '\'') && (MacroName[nMacroLen-1] == '\'') )
- sMacroUrl = MacroName.copy( 1, nMacroLen - 2 );
+ ::rtl::OUString aMacroName = trimMacroName( MacroName );
// parse the macro name
- sal_Int32 nDocSepIndex = sMacroUrl.indexOf( '!' );
-
- String sContainer;
- String sModule;
- String sProcedure;
-
+ sal_Int32 nDocSepIndex = aMacroName.indexOf( '!' );
if( nDocSepIndex > 0 )
{
// macro specified by document name
@@ -238,10 +258,10 @@ VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUStrin
// recursively
// assume for now that the document name is *this* document
- String sDocUrlOrPath = sMacroUrl.copy( 0, nDocSepIndex );
- sMacroUrl = sMacroUrl.copy( nDocSepIndex + 1 );
+ String sDocUrlOrPath = aMacroName.copy( 0, nDocSepIndex );
+ aMacroName = aMacroName.copy( nDocSepIndex + 1 );
OSL_TRACE("doc search, current shell is 0x%x", pShell );
- SfxObjectShell* pFoundShell = NULL;
+ SfxObjectShell* pFoundShell = 0;
if( bSearchGlobalTemplates )
{
SvtPathOptions aPathOpt;
@@ -249,45 +269,49 @@ VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUStrin
if( rtl::OUString( sDocUrlOrPath ).indexOf( aAddinPath ) == 0 )
pFoundShell = pShell;
}
- if( pFoundShell == NULL )
+ if( !pFoundShell )
pFoundShell = findShellForUrl( sDocUrlOrPath );
OSL_TRACE("doc search, after find, found shell is 0x%x", pFoundShell );
- aRes = resolveVBAMacro( pFoundShell, sMacroUrl, bSearchGlobalTemplates );
- return aRes;
+ return resolveVBAMacro( pFoundShell, aMacroName );
}
- else
- {
- // macro is contained in 'this' document ( or code imported from a template
- // where that template is a global template or perhaps the template this
- // document is created from )
- // macro format = Container.Module.Procedure
- parseMacro( sMacroUrl, sContainer, sModule, sProcedure );
- uno::Reference< lang::XMultiServiceFactory> xSF( pShell->GetModel(), uno::UNO_QUERY);
- uno::Reference< container::XNameContainer > xPrjNameCache;
- if ( xSF.is() )
- xPrjNameCache.set( xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAProjectNameProvider" ) ) ), uno::UNO_QUERY );
+ // macro is contained in 'this' document ( or code imported from a template
+ // where that template is a global template or perhaps the template this
+ // document is created from )
+
+ MacroResolvedInfo aRes( pShell );
+
+ // macro format = Container.Module.Procedure
+ String sContainer, sModule, sProcedure;
+ parseMacro( aMacroName, sContainer, sModule, sProcedure );
+ uno::Reference< container::XNameContainer > xPrjNameCache;
- std::vector< rtl::OUString > sSearchList;
+ // As long as service VBAProjectNameProvider isn't supported in the model, disable the createInstance call
+ // (the ServiceNotRegisteredException is wrongly caught in ScModelObj::createInstance)
+ //uno::Reference< lang::XMultiServiceFactory> xSF( pShell->GetModel(), uno::UNO_QUERY);
+ //if ( xSF.is() )
+ // xPrjNameCache.set( xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAProjectNameProvider" ) ) ), uno::UNO_QUERY );
- if ( sContainer.Len() > 0 )
+ std::vector< rtl::OUString > sSearchList;
+
+ if ( sContainer.Len() > 0 )
+ {
+ // get the Project associated with the Container
+ if ( xPrjNameCache.is() )
{
- // get the Project associated with the Container
- if ( xPrjNameCache.is() )
+ if ( xPrjNameCache->hasByName( sContainer ) )
{
- if ( xPrjNameCache->hasByName( sContainer ) )
- {
- rtl::OUString sProject;
- xPrjNameCache->getByName( sContainer ) >>= sProject;
- sContainer = sProject;
- }
+ rtl::OUString sProject;
+ xPrjNameCache->getByName( sContainer ) >>= sProject;
+ sContainer = sProject;
}
- sSearchList.push_back( sContainer ); // First Lib to search
}
- else
- {
- // Ok, if we have no Container specified then we need to search them in order, this document, template this document created from, global templates,
- // get the name of Project/Library for 'this' document
+ sSearchList.push_back( sContainer ); // First Lib to search
+ }
+ else
+ {
+ // Ok, if we have no Container specified then we need to search them in order, this document, template this document created from, global templates,
+ // get the name of Project/Library for 'this' document
rtl::OUString sThisProject = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") );
try
{
@@ -297,78 +321,72 @@ VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUStrin
}
catch( uno::Exception& /*e*/) {}
- sSearchList.push_back( sThisProject ); // First Lib to search
- if ( xPrjNameCache.is() )
- {
- // is this document created from a template?
- uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( pShell->GetModel(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
+ sSearchList.push_back( sThisProject ); // First Lib to search
+ if ( xPrjNameCache.is() )
+ {
+ // is this document created from a template?
+ uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( pShell->GetModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
- rtl::OUString sCreatedFrom = xDocProps->getTemplateURL();
- if ( sCreatedFrom.getLength() )
+ rtl::OUString sCreatedFrom = xDocProps->getTemplateURL();
+ if ( sCreatedFrom.getLength() )
+ {
+ INetURLObject aObj;
+ aObj.SetURL( sCreatedFrom );
+ bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
+ rtl::OUString aURL;
+ if ( bIsURL )
+ aURL = sCreatedFrom;
+ else
{
- INetURLObject aObj;
- aObj.SetURL( sCreatedFrom );
- bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
- rtl::OUString aURL;
- if ( bIsURL )
- aURL = sCreatedFrom;
- else
- {
- osl::FileBase::getFileURLFromSystemPath( sCreatedFrom, aURL );
- aObj.SetURL( aURL );
- }
- sCreatedFrom = aObj.GetLastName();
+ osl::FileBase::getFileURLFromSystemPath( sCreatedFrom, aURL );
+ aObj.SetURL( aURL );
}
+ sCreatedFrom = aObj.GetLastName();
+ }
- sal_Int32 nIndex = sCreatedFrom.lastIndexOf( '.' );
- if ( nIndex != -1 )
- sCreatedFrom = sCreatedFrom.copy( 0, nIndex );
+ sal_Int32 nIndex = sCreatedFrom.lastIndexOf( '.' );
+ if ( nIndex != -1 )
+ sCreatedFrom = sCreatedFrom.copy( 0, nIndex );
- rtl::OUString sPrj;
- if ( sCreatedFrom.getLength() && xPrjNameCache->hasByName( sCreatedFrom ) )
- {
- xPrjNameCache->getByName( sCreatedFrom ) >>= sPrj;
- // Make sure we don't double up with this project
- if ( !sPrj.equals( sThisProject ) )
- sSearchList.push_back( sPrj );
- }
+ rtl::OUString sPrj;
+ if ( sCreatedFrom.getLength() && xPrjNameCache->hasByName( sCreatedFrom ) )
+ {
+ xPrjNameCache->getByName( sCreatedFrom ) >>= sPrj;
+ // Make sure we don't double up with this project
+ if ( !sPrj.equals( sThisProject ) )
+ sSearchList.push_back( sPrj );
+ }
- // get list of global template Names
- uno::Sequence< rtl::OUString > sTemplateNames = xPrjNameCache->getElementNames();
- sal_Int32 nLen = sTemplateNames.getLength();
- for ( sal_Int32 index = 0; ( bSearchGlobalTemplates && index < nLen ); ++index )
- {
+ // get list of global template Names
+ uno::Sequence< rtl::OUString > sTemplateNames = xPrjNameCache->getElementNames();
+ sal_Int32 nLen = sTemplateNames.getLength();
+ for ( sal_Int32 index = 0; ( bSearchGlobalTemplates && index < nLen ); ++index )
+ {
- if ( !sCreatedFrom.equals( sTemplateNames[ index ] ) )
+ if ( !sCreatedFrom.equals( sTemplateNames[ index ] ) )
+ {
+ if ( xPrjNameCache->hasByName( sTemplateNames[ index ] ) )
{
- if ( xPrjNameCache->hasByName( sTemplateNames[ index ] ) )
- {
- xPrjNameCache->getByName( sTemplateNames[ index ] ) >>= sPrj;
- // Make sure we don't double up with this project
- if ( !sPrj.equals( sThisProject ) )
- sSearchList.push_back( sPrj );
- }
+ xPrjNameCache->getByName( sTemplateNames[ index ] ) >>= sPrj;
+ // Make sure we don't double up with this project
+ if ( !sPrj.equals( sThisProject ) )
+ sSearchList.push_back( sPrj );
}
-
}
+
}
}
- std::vector< rtl::OUString >::iterator it_end = sSearchList.end();
- for ( std::vector< rtl::OUString >::iterator it = sSearchList.begin(); it != it_end; ++it )
- {
- bool bRes = hasMacro( pShell, *it, sModule, sProcedure );
- if ( bRes )
- {
- aRes.SetResolved( true );
- aRes.SetMacroDocContext( pShell );
- sContainer = *it;
- break;
- }
- }
- aRes.SetResolvedMacro( sProcedure.Insert( '.', 0 ).Insert( sModule, 0).Insert( '.', 0 ).Insert( sContainer, 0 ) );
}
+ std::vector< rtl::OUString >::iterator it_end = sSearchList.end();
+ for ( std::vector< rtl::OUString >::iterator it = sSearchList.begin(); !aRes.mbFound && (it != it_end); ++it )
+ {
+ aRes.mbFound = hasMacro( pShell, *it, sModule, sProcedure );
+ if ( aRes.mbFound )
+ sContainer = *it;
+ }
+ aRes.msResolvedMacro = sProcedure.Insert( '.', 0 ).Insert( sModule, 0).Insert( '.', 0 ).Insert( sContainer, 0 );
return aRes;
}
@@ -409,6 +427,119 @@ sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, uno::Se
}
return bRes;
}
-} } // vba // ooo
+// ============================================================================
+
+uno::Sequence< ::rtl::OUString > VBAMacroResolver_getSupportedServiceNames()
+{
+ uno::Sequence< ::rtl::OUString > aServiceNames( 1 );
+ aServiceNames[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.vba.VBAMacroResolver" ) );
+ return aServiceNames;
+}
+
+::rtl::OUString VBAMacroResolver_getImplementationName()
+{
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.vba.VBAMacroResolver" ) );
+}
+
+uno::Reference< uno::XInterface > SAL_CALL VBAMacroResolver_createInstance( const uno::Reference< uno::XComponentContext >& ) throw (uno::Exception)
+{
+ return static_cast< ::cppu::OWeakObject* >( new VBAMacroResolver );
+}
+
+// ============================================================================
+
+VBAMacroResolver::VBAMacroResolver() :
+ mpObjShell( 0 )
+{
+}
+
+VBAMacroResolver::~VBAMacroResolver()
+{
+}
+
+// com.sun.star.lang.XServiceInfo interface -----------------------------------
+
+::rtl::OUString SAL_CALL VBAMacroResolver::getImplementationName() throw (uno::RuntimeException)
+{
+ return VBAMacroResolver_getImplementationName();
+}
+
+sal_Bool SAL_CALL VBAMacroResolver::supportsService( const ::rtl::OUString& rService ) throw (uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aServices = VBAMacroResolver_getSupportedServiceNames();
+ const ::rtl::OUString* pArray = aServices.getConstArray();
+ const ::rtl::OUString* pArrayEnd = pArray + aServices.getLength();
+ return ::std::find( pArray, pArrayEnd, rService ) != pArrayEnd;
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL VBAMacroResolver::getSupportedServiceNames() throw (uno::RuntimeException)
+{
+ return VBAMacroResolver_getSupportedServiceNames();
+}
+
+// com.sun.star.lang.XInitialization interface --------------------------------
+
+void SAL_CALL VBAMacroResolver::initialize( const uno::Sequence< uno::Any >& rArgs ) throw (uno::Exception, uno::RuntimeException)
+{
+ OSL_ENSURE( rArgs.getLength() < 2, "VBAMacroResolver::initialize - missing arguments" );
+ if( rArgs.getLength() < 2 )
+ throw uno::RuntimeException();
+
+ // first argument: document model
+ mxModel.set( rArgs[ 0 ], uno::UNO_QUERY_THROW );
+ uno::Reference< lang::XUnoTunnel > xUnoTunnel( mxModel, uno::UNO_QUERY_THROW );
+ mpObjShell = reinterpret_cast< SfxObjectShell* >( xUnoTunnel->getSomething( SfxObjectShell::getUnoTunnelId() ) );
+ if( !mpObjShell )
+ throw uno::RuntimeException();
+
+ // second argument: VBA project name
+ if( !(rArgs[ 1 ] >>= maProjectName) || (maProjectName.getLength() == 0) )
+ throw uno::RuntimeException();
+}
+
+// com.sun.star.script.vba.XVBAMacroResolver interface ------------------------
+
+::rtl::OUString SAL_CALL VBAMacroResolver::resolveVBAMacroToScriptURL( const ::rtl::OUString& rVBAMacroName ) throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ if( !mpObjShell )
+ throw uno::RuntimeException();
+
+ // the name may be enclosed in apostrophs
+ ::rtl::OUString aMacroName = trimMacroName( rVBAMacroName );
+ if( aMacroName.getLength() == 0 )
+ throw lang::IllegalArgumentException();
+
+ // external references not supported here (syntax is "url!macroname" or "[url]!macroname" or "[url]macroname")
+ if( (aMacroName[ 0 ] == '[') || (aMacroName.indexOf( '!' ) >= 0) )
+ throw lang::IllegalArgumentException();
+
+ // check if macro name starts with project name, replace with "Standard"
+ // TODO: adjust this when custom VBA project name is supported
+ sal_Int32 nDotPos = aMacroName.indexOf( '.' );
+ if( (nDotPos == 0) || (nDotPos + 1 == aMacroName.getLength()) )
+ throw lang::IllegalArgumentException();
+ if( (nDotPos > 0) && aMacroName.matchIgnoreAsciiCase( maProjectName ) )
+ aMacroName = aMacroName.copy( nDotPos + 1 );
+
+ // try to find the macro
+ MacroResolvedInfo aInfo = resolveVBAMacro( mpObjShell, aMacroName, false );
+ if( !aInfo.mbFound )
+ throw lang::IllegalArgumentException();
+
+ // build and return the script URL
+ return makeMacroURL( aInfo.msResolvedMacro );
+}
+
+::rtl::OUString SAL_CALL VBAMacroResolver::resolveScriptURLtoVBAMacro( const ::rtl::OUString& /*rScriptURL*/ ) throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ OSL_ENSURE( false, "VBAMacroResolver::resolveScriptURLtoVBAMacro - not implemented" );
+ throw uno::RuntimeException();
+}
+
+// ============================================================================
+
+} // namespace vba
+} // namespace ooo
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+
diff --git a/filter/source/msfilter/msvbasic.cxx b/filter/source/msfilter/msvbasic.cxx
index c51edf7981a7..15fa6b4b9054 100644
--- a/filter/source/msfilter/msvbasic.cxx
+++ b/filter/source/msfilter/msvbasic.cxx
@@ -880,7 +880,7 @@ VBA_Impl::VBA_Impl(SvStorage &rIn, bool bCmmntd)
VBA_Impl::~VBA_Impl()
{
delete [] pOffsets;
- for (ULONG i=0;i<aVBAStrings.GetSize();++i)
+ for (sal_uLong i=0;i<aVBAStrings.GetSize();++i)
delete aVBAStrings.Get(i);
}
@@ -1350,7 +1350,7 @@ const StringArray &VBA_Impl::Decompress(sal_uInt16 nIndex, int *pOverflow)
sTempStringa = String( RTL_CONSTASCII_USTRINGPARAM( "\x0D\x0A" ) );
String sTempStringb(sTempStringa);
sTempStringb+=sComment;
- for(ULONG i=0;i<aVBAStrings.GetSize();i++)
+ for(sal_uLong i=0;i<aVBAStrings.GetSize();i++)
{
aVBAStrings.Get(i)->SearchAndReplaceAll(
sTempStringa,sTempStringb);
diff --git a/filter/source/msfilter/powerpoint/pptimporteruno.cxx b/filter/source/msfilter/powerpoint/pptimporteruno.cxx
index feeef52173d6..3725382026f7 100644
--- a/filter/source/msfilter/powerpoint/pptimporteruno.cxx
+++ b/filter/source/msfilter/powerpoint/pptimporteruno.cxx
@@ -44,33 +44,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-extern "C" sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey )
-{
- sal_Bool bRet = sal_False;
-
- if( pRegistryKey )
- {
- try
- {
- NMSP_UNO::Reference< NMSP_REGISTRY::XRegistryKey > xNewKey(
- reinterpret_cast< NMSP_REGISTRY::XRegistryKey * >( pRegistryKey )->createKey(
- PptImporter_getImplementationName() ) );
- xNewKey = xNewKey->createKey( B2UCONST( "/UNO/SERVICES" ) );
- const SEQ( NMSP_RTL::OUString )& rSNL = PptImporter_getSupportedServiceNames();
- const NMSP_RTL::OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
- bRet = sal_True;
- }
- catch( NMSP_REGISTRY::InvalidRegistryException& )
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
-
- return bRet;
-}
-
extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ )
{
REF( NMSP_LANG::XSingleServiceFactory ) xFactory;
diff --git a/filter/source/msfilter/services.cxx b/filter/source/msfilter/services.cxx
new file mode 100755
index 000000000000..09a303f72141
--- /dev/null
+++ b/filter/source/msfilter/services.cxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * 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 ooo { namespace vba { DECLARE_FUNCTIONS( VBAMacroResolver ); } }
+
+#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( ::ooo::vba::VBAMacroResolver ),
+ { 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/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 344caa55bee5..c761d7c700fe 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -214,9 +214,9 @@ SvStream& operator>>( SvStream& rIn, PptSlidePersistAtom& rAtom )
SV_IMPL_PTRARR(_PptSlidePersistList,PptSlidePersistEntry*);
-USHORT PptSlidePersistList::FindPage(UINT32 nId) const
+sal_uInt16 PptSlidePersistList::FindPage(sal_uInt32 nId) const
{
- for ( USHORT i=0; i < Count(); i++ )
+ for ( sal_uInt16 i=0; i < Count(); i++ )
{
if (operator[](i)->GetSlideId()==nId) return i;
}
@@ -270,9 +270,9 @@ SvStream& operator>>(SvStream& rIn, PptDocumentAtom& rAtom)
// 39 bShowComments 1
DffRecordHeader aHd;
- INT32 nSlideX,nSlideY, nNoticeX, nNoticeY, nDummy;
- UINT16 nSlidePageFormat;
- INT8 nEmbeddedTrueType, nTitlePlaceHoldersOmitted, nRightToLeft, nShowComments;
+ sal_Int32 nSlideX,nSlideY, nNoticeX, nNoticeY, nDummy;
+ sal_uInt16 nSlidePageFormat;
+ sal_Int8 nEmbeddedTrueType, nTitlePlaceHoldersOmitted, nRightToLeft, nShowComments;
rIn >> aHd
>> nSlideX >> nSlideY
@@ -302,7 +302,7 @@ SvStream& operator>>(SvStream& rIn, PptDocumentAtom& rAtom)
void PptSlideLayoutAtom::Clear()
{
eLayout = 0;
- for ( USHORT i = 0; i < 8; i++ )
+ for ( sal_uInt16 i = 0; i < 8; i++ )
{
aPlaceholderId[ i ] = 0;
aPlacementId[ i ] = 0;
@@ -355,7 +355,7 @@ void PptColorSchemeAtom::Clear()
memset(&aData[0], 0, 32);
}
-Color PptColorSchemeAtom::GetColor( USHORT nNum ) const
+Color PptColorSchemeAtom::GetColor( sal_uInt16 nNum ) const
{
Color aRetval;
if ( nNum < 8 )
@@ -505,9 +505,9 @@ PptSlidePersistEntry::PptSlidePersistEntry() :
pBObj ( NULL ),
bBObjIsTemporary ( sal_True ),
ePageKind ( PPT_MASTERPAGE ),
- bNotesMaster ( FALSE ),
- bHandoutMaster ( FALSE ),
- bStarDrawFiller ( FALSE )
+ bNotesMaster ( sal_False ),
+ bHandoutMaster ( sal_False ),
+ bStarDrawFiller ( sal_False )
{
HeaderFooterOfs[ 0 ] = HeaderFooterOfs[ 1 ] = HeaderFooterOfs[ 2 ] = HeaderFooterOfs[ 3 ] = 0;
}
@@ -526,12 +526,12 @@ SdrEscherImport::SdrEscherImport( PowerPointImportParam& rParam, const String& r
nStreamLen ( 0 ),
nTextStylesIndex ( 0xffff ),
eCharSetSystem ( gsl_getSystemTextEncoding() ),
- bWingdingsChecked ( FALSE ),
- bWingdingsAvailable ( FALSE ),
- bMonotypeSortsChecked ( FALSE ),
- bMonotypeSortsAvailable ( FALSE ),
- bTimesNewRomanChecked ( FALSE ),
- bTimesNewRomanAvailable ( FALSE ),
+ bWingdingsChecked ( sal_False ),
+ bWingdingsAvailable ( sal_False ),
+ bMonotypeSortsChecked ( sal_False ),
+ bMonotypeSortsAvailable ( sal_False ),
+ bTimesNewRomanChecked ( sal_False ),
+ bTimesNewRomanAvailable ( sal_False ),
rImportParam ( rParam )
{
}
@@ -551,7 +551,7 @@ const PptSlideLayoutAtom* SdrEscherImport::GetSlideLayoutAtom() const
sal_Bool SdrEscherImport::ReadString( String& rStr ) const
{
- sal_Bool bRet = FALSE;
+ sal_Bool bRet = sal_False;
DffRecordHeader aStrHd;
rStCtrl >> aStrHd;
if (aStrHd.nRecType == PPT_PST_TextBytesAtom
@@ -561,8 +561,8 @@ sal_Bool SdrEscherImport::ReadString( String& rStr ) const
sal_Bool bUniCode =
(aStrHd.nRecType == PPT_PST_TextCharsAtom
|| aStrHd.nRecType == PPT_PST_CString);
- bRet=TRUE;
- ULONG nBytes = aStrHd.nRecLen;
+ bRet=sal_True;
+ sal_uLong nBytes = aStrHd.nRecLen;
MSDFFReadZString( rStCtrl, rStr, nBytes, bUniCode );
aStrHd.SeekToEndOfRecord( rStCtrl );
}
@@ -571,37 +571,37 @@ sal_Bool SdrEscherImport::ReadString( String& rStr ) const
return bRet;
}
-bool SdrEscherImport::GetColorFromPalette(USHORT /*nNum*/, Color& /*rColor*/) const
+bool SdrEscherImport::GetColorFromPalette(sal_uInt16 /*nNum*/, Color& /*rColor*/) const
{
- return FALSE;
+ return sal_False;
}
-BOOL SdrEscherImport::SeekToShape( SvStream& /*rSt*/, void* /*pClientData*/, UINT32 /*nId*/) const
+sal_Bool SdrEscherImport::SeekToShape( SvStream& /*rSt*/, void* /*pClientData*/, sal_uInt32 /*nId*/) const
{
- return FALSE;
+ return sal_False;
}
-PptFontEntityAtom* SdrEscherImport::GetFontEnityAtom( UINT32 nNum ) const
+PptFontEntityAtom* SdrEscherImport::GetFontEnityAtom( sal_uInt32 nNum ) const
{
PptFontEntityAtom* pRetValue = NULL;
if ( pFonts && ( nNum < pFonts->Count() ) )
- pRetValue = (*pFonts)[ (USHORT)nNum ];
+ pRetValue = (*pFonts)[ (sal_uInt16)nNum ];
return pRetValue;
}
-CharSet SdrEscherImport::GetCharSet( UINT32 nNum ) const
+CharSet SdrEscherImport::GetCharSet( sal_uInt32 nNum ) const
{
CharSet eRetValue( eCharSetSystem );
if ( pFonts && ( nNum < pFonts->Count() ) )
- eRetValue = (*pFonts)[ (USHORT)nNum ]->eCharSet;
+ eRetValue = (*pFonts)[ (sal_uInt16)nNum ]->eCharSet;
return eRetValue;
}
-BOOL SdrEscherImport::IsFontAvailable( UINT32 nNum ) const
+sal_Bool SdrEscherImport::IsFontAvailable( sal_uInt32 nNum ) const
{
- BOOL bRetValue = FALSE;
+ sal_Bool bRetValue = sal_False;
if ( pFonts && ( nNum < pFonts->Count() ) )
- bRetValue = (*pFonts)[ (USHORT)nNum ]->bAvailable;
+ bRetValue = (*pFonts)[ (sal_uInt16)nNum ]->bAvailable;
return bRetValue;
}
@@ -619,7 +619,7 @@ void SdrEscherImport::ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd,
}
else
{
- INT16 ls, ts, rs, bs;
+ sal_Int16 ls, ts, rs, bs;
rSt >> ts >> ls >> rs >> bs; // etwas seltsame Koordinatenreihenfolge ...
l = ls, t = ts, r = rs, b = bs;
}
@@ -628,7 +628,7 @@ void SdrEscherImport::ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd,
Scale( r );
Scale( b );
rObj.aChildAnchor = Rectangle( l, t, r, b );
- rObj.bChildAnchor = TRUE;
+ rObj.bChildAnchor = sal_True;
return;
};
@@ -717,13 +717,13 @@ void SdrEscherImport::RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic
sal_uInt32 nSearch = OriginalGlobalColors[ j ];
sal_uInt32 nReplace = NewGlobalColors[ j ];
- pSearchColors[ j ].SetRed( (BYTE)nSearch );
- pSearchColors[ j ].SetGreen( (BYTE)( nSearch >> 8 ) );
- pSearchColors[ j ].SetBlue( (BYTE)( nSearch >> 16 ) );
+ pSearchColors[ j ].SetRed( (sal_uInt8)nSearch );
+ pSearchColors[ j ].SetGreen( (sal_uInt8)( nSearch >> 8 ) );
+ pSearchColors[ j ].SetBlue( (sal_uInt8)( nSearch >> 16 ) );
- pReplaceColors[ j ].SetRed( (BYTE)nReplace );
- pReplaceColors[ j ].SetGreen( (BYTE)( nReplace >> 8 ) );
- pReplaceColors[ j ].SetBlue( (BYTE)( nReplace >> 16 ) );
+ pReplaceColors[ j ].SetRed( (sal_uInt8)nReplace );
+ pReplaceColors[ j ].SetGreen( (sal_uInt8)( nReplace >> 8 ) );
+ pReplaceColors[ j ].SetBlue( (sal_uInt8)( nReplace >> 16 ) );
}
GDIMetaFile aGdiMetaFile( rGraphic.GetGDIMetaFile() );
aGdiMetaFile.ReplaceColors( pSearchColors, pReplaceColors,
@@ -747,7 +747,7 @@ void SdrEscherImport::RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic
SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, void* pData, Rectangle& rTextRect, SdrObject* pOriginalObj )
{
if ( pOriginalObj && pOriginalObj->ISA( SdrObjCustomShape ) )
- pOriginalObj->SetMergedItem( SdrTextFixedCellHeightItem( TRUE ) );
+ pOriginalObj->SetMergedItem( SdrTextFixedCellHeightItem( sal_True ) );
// we are initializing our return value with the object that was imported by our escher import
SdrObject* pRet = pOriginalObj;
@@ -758,7 +758,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
if ( ! ( rObjData.nSpFlags & SP_FGROUP ) ) // sj: #114758# ...
{
PptOEPlaceholderAtom aPlaceholderAtom;
- INT16 nHeaderFooterInstance = -1;
+ sal_Int16 nHeaderFooterInstance = -1;
if ( maShapeRecords.SeekToContent( rSt, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
{
@@ -801,9 +801,9 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
aClientDataHd.SeekToEndOfRecord( rSt );
}
}
- if ( ( aPlaceholderAtom.nPlaceholderId == PPT_PLACEHOLDER_NOTESSLIDEIMAGE ) && ( rPersistEntry.bNotesMaster == FALSE ) )
+ if ( ( aPlaceholderAtom.nPlaceholderId == PPT_PLACEHOLDER_NOTESSLIDEIMAGE ) && ( rPersistEntry.bNotesMaster == sal_False ) )
{
- USHORT nPageNum = pSdrModel->GetPageCount();
+ sal_uInt16 nPageNum = pSdrModel->GetPageCount();
if ( nPageNum > 0 )
nPageNum--;
@@ -820,7 +820,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
sal_Bool bVerticalText = sal_False;
// and if the text object is not empty, it must be applied to pRet, the object we
// initially got from our escher import
- INT32 nTextRotationAngle = 0;
+ sal_Int32 nTextRotationAngle = 0;
if ( IsProperty( DFF_Prop_txflTextFlow ) )
{
MSO_TextFlow eTextFlow = (MSO_TextFlow)( GetPropertyValue( DFF_Prop_txflTextFlow ) & 0xFFFF );
@@ -848,10 +848,10 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
aTextObj.SetVertical( bVerticalText );
if ( pRet )
{
- BOOL bDeleteSource = aTextObj.GetOEPlaceHolderAtom() != 0;
- if ( bDeleteSource && ( pRet->ISA( SdrGrafObj ) == FALSE ) // we are not allowed to get
- && ( pRet->ISA( SdrObjGroup ) == FALSE ) // grouped placeholder objects
- && ( pRet->ISA( SdrOle2Obj ) == FALSE ) )
+ sal_Bool bDeleteSource = aTextObj.GetOEPlaceHolderAtom() != 0;
+ if ( bDeleteSource && ( pRet->ISA( SdrGrafObj ) == sal_False ) // we are not allowed to get
+ && ( pRet->ISA( SdrObjGroup ) == sal_False ) // grouped placeholder objects
+ && ( pRet->ISA( SdrOle2Obj ) == sal_False ) )
SdrObject::Free( pRet );
}
sal_uInt32 nTextFlags = aTextObj.GetTextFlags();
@@ -1000,7 +1000,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
{
if ( !rPersistEntry.pPresentationObjects )
{
- rPersistEntry.pPresentationObjects = new UINT32[ PPT_STYLESHEETENTRYS ];
+ rPersistEntry.pPresentationObjects = new sal_uInt32[ PPT_STYLESHEETENTRYS ];
memset( rPersistEntry.pPresentationObjects, 0, PPT_STYLESHEETENTRYS * 4 );
}
if ( !rPersistEntry.pPresentationObjects[ nDestinationInstance ] )
@@ -1126,7 +1126,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
pTObj->SetMergedItem( SdrTextRightDistItem( nTextRight ) );
pTObj->SetMergedItem( SdrTextUpperDistItem( nTextTop ) );
pTObj->SetMergedItem( SdrTextLowerDistItem( nTextBottom ) );
- pTObj->SetMergedItem( SdrTextFixedCellHeightItem( TRUE ) );
+ pTObj->SetMergedItem( SdrTextFixedCellHeightItem( sal_True ) );
if ( !pTObj->ISA( SdrObjCustomShape ) )
pTObj->SetSnapRect( rTextRect );
@@ -1275,7 +1275,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
// spMaster property, so we are patching the table
if ( rPersistEntry.nDrawingDgId != 0xffffffff )
{
- UINT32 nSec = ( rObjData.nShapeId >> 10 ) - 1;
+ sal_uInt32 nSec = ( rObjData.nShapeId >> 10 ) - 1;
if ( mpFidcls && ( nSec < mnIdClusters ) )
mpFidcls[ nSec ].dgid = rPersistEntry.nDrawingDgId; // insert the correct drawing id;
}
@@ -1297,21 +1297,21 @@ void SdrEscherImport::CheckWingdings() const
{
OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
((SdrEscherImport*)this)->bWingdingsAvailable = pDev->IsFontAvailable( String( RTL_CONSTASCII_USTRINGPARAM( "WINGDINGS" ) ) );
- ((SdrEscherImport*)this)->bWingdingsChecked = TRUE;
+ ((SdrEscherImport*)this)->bWingdingsChecked = sal_True;
}
void SdrEscherImport::CheckMonotypeSorts() const
{
OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
((SdrEscherImport*)this)->bMonotypeSortsAvailable = pDev->IsFontAvailable( String( RTL_CONSTASCII_USTRINGPARAM( "MONOTYPE SORTS" ) ) );
- ((SdrEscherImport*)this)->bMonotypeSortsChecked = TRUE;
+ ((SdrEscherImport*)this)->bMonotypeSortsChecked = sal_True;
}
void SdrEscherImport::CheckTimesNewRoman() const
{
OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
((SdrEscherImport*)this)->bTimesNewRomanAvailable = pDev->IsFontAvailable( String( RTL_CONSTASCII_USTRINGPARAM( "TIMES NEW ROMAN" ) ) );
- ((SdrEscherImport*)this)->bTimesNewRomanChecked = TRUE;
+ ((SdrEscherImport*)this)->bTimesNewRomanChecked = sal_True;
}
SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const String& rBaseURL ) :
@@ -1347,7 +1347,7 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
rStCtrl.Seek( 0 );
DffRecordManager aPptRecManager; // contains all first level container and atoms
- aPptRecManager.Consume( rStCtrl, FALSE, nStreamLen );
+ aPptRecManager.Consume( rStCtrl, sal_False, nStreamLen );
for ( pHd = aPptRecManager.Last(); pHd; pHd = aPptRecManager.Prev() )
{
if ( pHd->nRecType == PPT_PST_UserEditAtom )
@@ -1358,23 +1358,23 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
}
}
if ( !pHd )
- bOk = FALSE;
+ bOk = sal_False;
}
}
if ( rStCtrl.GetError() != 0 )
- bOk = FALSE;
+ bOk = sal_False;
if ( bOk )
{
nPersistPtrAnz = aUserEditAtom.nMaxPersistWritten + 1;
if ( ( nPersistPtrAnz >> 2 ) > nStreamLen ) // sj: at least nPersistPtrAnz is not allowed to be greater than filesize
- bOk = FALSE; // (it should not be greater than the PPT_PST_PersistPtrIncrementalBlock, but
+ bOk = sal_False; // (it should not be greater than the PPT_PST_PersistPtrIncrementalBlock, but
// we are reading this block later, so we do not have access yet)
- if ( bOk && ( nPersistPtrAnz < ( SAL_MAX_UINT32 / sizeof( UINT32 ) ) ) )
- pPersistPtr = new (std::nothrow) UINT32[ nPersistPtrAnz ];
+ if ( bOk && ( nPersistPtrAnz < ( SAL_MAX_UINT32 / sizeof( sal_uInt32 ) ) ) )
+ pPersistPtr = new (std::nothrow) sal_uInt32[ nPersistPtrAnz ];
if ( !pPersistPtr )
- bOk = FALSE;
+ bOk = sal_False;
if ( bOk )
{
memset( pPersistPtr, 0x00, nPersistPtrAnz * 4 );
@@ -1392,7 +1392,7 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
rStCtrl >> aPersistHd;
if ( aPersistHd.nRecType == PPT_PST_PersistPtrIncrementalBlock )
{
- ULONG nPibLen = aPersistHd.GetRecEndFilePos();
+ sal_uLong nPibLen = aPersistHd.GetRecEndFilePos();
while ( bOk && ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < nPibLen ) )
{
sal_uInt32 nOfs, nAnz;
@@ -1409,7 +1409,7 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
pPersistPtr[ nOfs ] = nPt;
if ( pPersistPtr[ nOfs ] > nStreamLen )
{
- bOk = FALSE;
+ bOk = sal_False;
OSL_FAIL("SdrPowerPointImport::Ctor(): Ungueltiger Eintrag im Persist-Directory!");
}
}
@@ -1419,7 +1419,7 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
if ( bOk && nAnz > 0 )
{
OSL_FAIL("SdrPowerPointImport::Ctor(): Nicht alle Persist-Directory Entraege gelesen!");
- bOk = FALSE;
+ bOk = sal_False;
}
}
}
@@ -1434,14 +1434,14 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
}
}
if ( rStCtrl.GetError() != 0 )
- bOk = FALSE;
+ bOk = sal_False;
if ( bOk )
{ // Document PersistEntry checken
nDocStreamPos = aUserEditAtom.nDocumentRef;
if ( nDocStreamPos > nPersistPtrAnz )
{
OSL_FAIL("SdrPowerPointImport::Ctor(): aUserEditAtom.nDocumentRef ungueltig!");
- bOk = FALSE;
+ bOk = sal_False;
}
}
if ( bOk )
@@ -1450,7 +1450,7 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
if ( nDocStreamPos >= nStreamLen )
{
OSL_FAIL("SdrPowerPointImport::Ctor(): nDocStreamPos >= nStreamLen!");
- bOk = FALSE;
+ bOk = sal_False;
}
}
if ( bOk )
@@ -1469,7 +1469,7 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
rStCtrl >> aDocAtom;
}
else
- bOk = FALSE;
+ bOk = sal_False;
if ( bOk )
{
@@ -1521,7 +1521,7 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
pE->bStarDrawFiller = sal_True; // this is a dummy master page
pMasterPages->C40_INSERT( PptSlidePersistEntry, pE, 0 );
- USHORT nPageListNum = 0;
+ sal_uInt16 nPageListNum = 0;
DffRecordHeader* pSlideListWithTextHd = aDocRecManager.GetRecordHeader( PPT_PST_SlideListWithText );
PptSlidePersistEntry* pPreviousPersist = NULL;
while ( pSlideListWithTextHd && ( nPageListNum < 3 ) )
@@ -1575,13 +1575,13 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
for ( nPageListNum = 0; nPageListNum < 3; nPageListNum++ )
{
PptSlidePersistList* pPageList = GetPageList( PptPageKind( nPageListNum ) );
- for ( USHORT nPageNum = 0; nPageNum < pPageList->Count(); nPageNum++ )
+ for ( sal_uInt16 nPageNum = 0; nPageNum < pPageList->Count(); nPageNum++ )
{
PptSlidePersistEntry* pE2 = (*pPageList)[ nPageNum ];
- ULONG nPersist = pE2->aPersistAtom.nPsrReference;
+ sal_uLong nPersist = pE2->aPersistAtom.nPsrReference;
if ( ( nPersist > 0 ) && ( nPersist < nPersistPtrAnz ) )
{
- ULONG nFPos = pPersistPtr[ nPersist ];
+ sal_uLong nFPos = pPersistPtr[ nPersist ];
if ( nFPos < nStreamLen )
{
rStCtrl.Seek( nFPos );
@@ -1650,7 +1650,7 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
else if ( pHeadersFootersHd->nRecInstance == 4 ) // notes master
ImportHeaderFooterContainer( *pHeadersFootersHd, aNotesMaster );
}
- for ( USHORT i = 0; i < pMasterPages->Count(); i++ )
+ for ( sal_uInt16 i = 0; i < pMasterPages->Count(); i++ )
{
if ( (*pMasterPages)[ i ]->bNotesMaster )
(*pMasterPages)[ i ]->pHeaderFooterEntry = new HeaderFooterEntry( aNotesMaster );
@@ -1661,7 +1661,7 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
}
}
if ( ( rStCtrl.GetError() != 0 ) || ( pDefaultSheet == NULL ) )
- bOk = FALSE;
+ bOk = sal_False;
pPPTStyleSheet = pDefaultSheet;
rStCtrl.Seek( 0 );
}
@@ -1682,9 +1682,9 @@ sal_Bool PPTConvertOCXControls::InsertControl(
const com::sun::star::awt::Size& rSize,
com::sun::star::uno::Reference<
com::sun::star::drawing::XShape > *pShape,
- BOOL /*bFloatingCtrl*/)
+ sal_Bool /*bFloatingCtrl*/)
{
- sal_Bool bRetValue = FALSE;
+ sal_Bool bRetValue = sal_False;
try
{
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape;
@@ -1719,7 +1719,7 @@ sal_Bool PPTConvertOCXControls::InsertControl(
xControlShape->setControl( xControlModel );
if (pShape)
*pShape = xShape;
- bRetValue = TRUE;
+ bRetValue = sal_True;
}
}
}
@@ -1727,7 +1727,7 @@ sal_Bool PPTConvertOCXControls::InsertControl(
}
catch( ... )
{
- bRetValue = FALSE;
+ bRetValue = sal_False;
}
return bRetValue;
};
@@ -1794,7 +1794,7 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
{
SdrObject* pRet = NULL;
- UINT32 nOldPos = rStCtrl.Tell();
+ sal_uInt32 nOldPos = rStCtrl.Tell();
Graphic aGraphic( rGraf );
@@ -1828,7 +1828,7 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
rStCtrl >> aHd;
sal_uInt32 nLen = aHd.nRecLen - 4;
- if ( (INT32)nLen > 0 )
+ if ( (sal_Int32)nLen > 0 )
{
sal_Bool bSuccess = sal_False;
@@ -1847,7 +1847,7 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
if ( bSuccess )
{
SvStream* pDest = ::utl::UcbStreamHelper::CreateStream( aTmpFile.GetURL(), STREAM_READ );
- Storage* pObjStor = pDest ? new Storage( *pDest, TRUE ) : NULL;
+ Storage* pObjStor = pDest ? new Storage( *pDest, sal_True ) : NULL;
if ( pObjStor )
{
SotStorageRef xObjStor( new SotStorage( pObjStor ) );
@@ -1862,8 +1862,8 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
SotStorageStreamRef xSrcTst = xObjStor->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "\1Ole" ) ) );
if ( xSrcTst.Is() )
{
- BYTE aTestA[ 10 ];
- BOOL bGetItAsOle = ( sizeof( aTestA ) == xSrcTst->Read( aTestA, sizeof( aTestA ) ) );
+ sal_uInt8 aTestA[ 10 ];
+ sal_Bool bGetItAsOle = ( sizeof( aTestA ) == xSrcTst->Read( aTestA, sizeof( aTestA ) ) );
if ( !bGetItAsOle )
{ // maybe there is a contentsstream in here
xSrcTst = xObjStor->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "Contents" ) ), STREAM_READWRITE | STREAM_NOCREATE );
@@ -1885,14 +1885,14 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
// TODO/LATER: need MediaType for Graphic
aObj.SetGraphic( rGraf, ::rtl::OUString() );
- pRet = new SdrOle2Obj( aObj, aNm, rBoundRect, FALSE );
+ pRet = new SdrOle2Obj( aObj, aNm, rBoundRect, sal_False );
}
}
if ( !pRet && ( pOe->nType == PPT_PST_ExControl ) )
{
PPTConvertOCXControls aPPTConvertOCXControls( pOe->pShell, eAktPageKind );
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape;
- if ( aPPTConvertOCXControls.ReadOCXStream( xObjStor, &xShape, FALSE ) )
+ if ( aPPTConvertOCXControls.ReadOCXStream( xObjStor, &xShape, sal_False ) )
pRet = GetSdrObjectFromXShape( xShape );
}
if ( !pRet )
@@ -1917,7 +1917,7 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
{
//TODO/LATER: keep on hacking?!
// modifiziert wollen wir nicht werden
- //xInplaceObj->EnableSetModified( FALSE );
+ //xInplaceObj->EnableSetModified( sal_False );
if ( rVisArea.IsEmpty() )
{
MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( pOe->nAspect ) );
@@ -1934,7 +1934,7 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
awt::Size aSize( rVisArea.GetSize().Width(), rVisArea.GetSize().Height() );
xObj->setVisualAreaSize( pOe->nAspect, aSize );
}
- //xInplaceObj->EnableSetModified( TRUE );
+ //xInplaceObj->EnableSetModified( sal_True );
}
svt::EmbeddedObjectRef aObj( xObj, pOe->nAspect );
@@ -1942,7 +1942,7 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
// TODO/LATER: need MediaType for Graphic
aObj.SetGraphic( aGraphic, ::rtl::OUString() );
- pRet = new SdrOle2Obj( aObj, aNm, rBoundRect, FALSE );
+ pRet = new SdrOle2Obj( aObj, aNm, rBoundRect, sal_False );
}
}
}
@@ -1958,20 +1958,20 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
return pRet;
}
-SvMemoryStream* SdrPowerPointImport::ImportExOleObjStg( UINT32 nPersistPtr, UINT32& nOleId ) const
+SvMemoryStream* SdrPowerPointImport::ImportExOleObjStg( sal_uInt32 nPersistPtr, sal_uInt32& nOleId ) const
{
SvMemoryStream* pRet = NULL;
if ( nPersistPtr && ( nPersistPtr < nPersistPtrAnz ) )
{
- UINT32 nOldPos, nOfs = pPersistPtr[ nPersistPtr ];
+ sal_uInt32 nOldPos, nOfs = pPersistPtr[ nPersistPtr ];
nOldPos = rStCtrl.Tell();
rStCtrl.Seek( nOfs );
DffRecordHeader aHd;
rStCtrl >> aHd;
if ( aHd.nRecType == DFF_PST_ExOleObjStg )
{
- UINT32 nLen = aHd.nRecLen - 4;
- if ( (INT32)nLen > 0 )
+ sal_uInt32 nLen = aHd.nRecLen - 4;
+ if ( (sal_Int32)nLen > 0 )
{
rStCtrl >> nOleId;
pRet = new SvMemoryStream;
@@ -1993,7 +1993,7 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt
{
DffRecordHeader* pHd;
- UINT32 nOldPos = rStCtrl.Tell();
+ sal_uInt32 nOldPos = rStCtrl.Tell();
if ( nFilterOptions & 1 )
{
pHd = aDocRecManager.GetRecordHeader( PPT_PST_List, SEEK_FROM_BEGINNING );
@@ -2005,17 +2005,17 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt
{
if ( SeekToRec( rStCtrl, PPT_PST_VBAInfoAtom, pHd->GetRecEndFilePos(), pHd ) )
{
- UINT32 nPersistPtr, nIDoNotKnow1, nIDoNotKnow2;
+ sal_uInt32 nPersistPtr, nIDoNotKnow1, nIDoNotKnow2;
rStCtrl >> nPersistPtr
>> nIDoNotKnow1
>> nIDoNotKnow2;
- UINT32 nOleId;
+ sal_uInt32 nOleId;
SvMemoryStream* pBas = ImportExOleObjStg( nPersistPtr, nOleId );
if ( pBas )
{
- SotStorageRef xSource( new SotStorage( pBas, TRUE ) );
- SotStorageRef xDest( new SotStorage( new SvMemoryStream(), TRUE ) );
+ SotStorageRef xSource( new SotStorage( pBas, sal_True ) );
+ SotStorageRef xDest( new SotStorage( new SvMemoryStream(), sal_True ) );
if ( xSource.Is() && xDest.Is() )
{
// is this a visual basic storage ?
@@ -2028,18 +2028,18 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt
{
SvStorageInfoList aList;
xSource->FillInfoList( &aList );
- UINT32 i;
+ sal_uInt32 i;
- BOOL bCopied = TRUE;
+ sal_Bool bCopied = sal_True;
for ( i = 0; i < aList.Count(); i++ ) // copy all entrys
{
const SvStorageInfo& rInfo = aList[ i ];
if ( !xSource->CopyTo( rInfo.GetName(), xMacros, rInfo.GetName() ) )
- bCopied = FALSE;
+ bCopied = sal_False;
}
if ( i && bCopied )
{
- SvxImportMSVBasic aMSVBas( *pShell, *xDest, TRUE, FALSE );
+ SvxImportMSVBasic aMSVBas( *pShell, *xDest, sal_True, sal_False );
uno::Reference < embed::XStorage > xDoc( pShell->GetStorage() );
if ( xDoc.is() )
@@ -2061,9 +2061,9 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt
*xOriginal << nIDoNotKnow1
<< nIDoNotKnow2;
- UINT32 nToCopy, nBufSize;
+ sal_uInt32 nToCopy, nBufSize;
nToCopy = pHd->nRecLen;
- BYTE* pBuf = new BYTE[ 0x40000 ]; // 256KB Buffer
+ sal_uInt8* pBuf = new sal_uInt8[ 0x40000 ]; // 256KB Buffer
if ( pBuf )
{
while ( nToCopy )
@@ -2119,7 +2119,7 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt
if ( aAt.nPersistPtr && ( aAt.nPersistPtr < nPersistPtrAnz ) )
{
- UINT32 nId;
+ sal_uInt32 nId;
rStCtrl.Seek( pPersistPtr[ aAt.nPersistPtr ] );
DffRecordHeader aHd;
rStCtrl >> aHd;
@@ -2141,11 +2141,11 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt
sal_Bool SdrPowerPointImport::ReadFontCollection()
{
- sal_Bool bRet = FALSE;
+ sal_Bool bRet = sal_False;
DffRecordHeader* pEnvHd = aDocRecManager.GetRecordHeader( PPT_PST_Environment );
if ( pEnvHd )
{
- ULONG nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer spaetere Restauration
+ sal_uLong nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer spaetere Restauration
pEnvHd->SeekToContent( rStCtrl );
DffRecordHeader aListHd;
if ( SeekToRec( rStCtrl, PPT_PST_FontCollection, pEnvHd->GetRecEndFilePos(), &aListHd ) )
@@ -2154,7 +2154,7 @@ sal_Bool SdrPowerPointImport::ReadFontCollection()
VirtualDevice* pVDev = NULL;
while ( SeekToRec( rStCtrl, PPT_PST_FontEntityAtom, aListHd.GetRecEndFilePos() ) )
{
- bRet = TRUE;
+ bRet = sal_True;
if ( !pFonts )
pFonts = new PptFontCollection;
PptFontEntityAtom* pFont = new PptFontEntityAtom;
@@ -2231,13 +2231,13 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
SdrTextObj* pText = pSdrText;
if ( pTextObj->Count() )
{
- UINT32 nDestinationInstance = pTextObj->GetDestinationInstance() ;
+ sal_uInt32 nDestinationInstance = pTextObj->GetDestinationInstance() ;
SdrOutliner& rOutliner = pText->ImpGetDrawOutliner();
if ( ( pText->GetObjInventor() == SdrInventor ) && ( pText->GetObjIdentifier() == OBJ_TITLETEXT ) ) // Outliner-Style fuer Titel-Textobjekt?!? (->von DL)
rOutliner.Init( OUTLINERMODE_TITLEOBJECT ); // Outliner reset
- BOOL bOldUpdateMode = rOutliner.GetUpdateMode();
- rOutliner.SetUpdateMode( FALSE );
+ sal_Bool bOldUpdateMode = rOutliner.GetUpdateMode();
+ rOutliner.SetUpdateMode( sal_False );
if ( pSheet )
{
if ( rOutliner.GetStyleSheet( 0 ) != pSheet )
@@ -2248,12 +2248,12 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
const PPTParagraphObj* pPreviousParagraph = NULL;
for ( PPTParagraphObj* pPara = pTextObj->First(); pPara; pPara = pTextObj->Next() )
{
- UINT32 nTextSize = pPara->GetTextSize();
+ sal_uInt32 nTextSize = pPara->GetTextSize();
if ( ! ( nTextSize & 0xffff0000 ) )
{
PPTPortionObj* pPortion;
sal_Unicode* pParaText = new sal_Unicode[ nTextSize ];
- UINT32 nCurrentIndex = 0;
+ sal_uInt32 nCurrentIndex = 0;
for ( pPortion = pPara->First(); pPortion; pPortion = pPara->Next() )
{
if ( pPortion->mpFieldItem )
@@ -2284,12 +2284,12 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
nCurrentIndex += nCharacters;
}
}
- sal_uInt16 nParaIndex = (UINT16)pTextObj->GetCurrentIndex();
+ sal_uInt16 nParaIndex = (sal_uInt16)pTextObj->GetCurrentIndex();
SfxStyleSheet* pS = ( ppStyleSheetAry ) ? ppStyleSheetAry[ pPara->pParaSet->mnDepth ] : pSheet;
ESelection aSelection( nParaIndex, 0, nParaIndex, 0 );
rOutliner.Insert( String(), nParaIndex, pPara->pParaSet->mnDepth );
- rOutliner.QuickInsertText( String( pParaText, (UINT16)nCurrentIndex ), aSelection );
+ rOutliner.QuickInsertText( String( pParaText, (sal_uInt16)nCurrentIndex ), aSelection );
rOutliner.SetParaAttribs( nParaIndex, rOutliner.GetEmptyItemSet() );
if ( pS )
rOutliner.SetStyleSheet( nParaIndex, pS );
@@ -2316,7 +2316,7 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
nLen = pPtr - pF;
if ( nLen )
aSelection.nEndPos =
- sal::static_int_cast< USHORT >(
+ sal::static_int_cast< sal_uInt16 >(
aSelection.nEndPos + nLen );
pF = pPtr + 1;
rOutliner.QuickInsertLineBreak( ESelection( nParaIndex, aSelection.nEndPos, nParaIndex, aSelection.nEndPos + 1 ) );
@@ -2325,7 +2325,7 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
}
nLen = pPtr - pF;
if ( nLen )
- aSelection.nEndPos = sal::static_int_cast< USHORT >(
+ aSelection.nEndPos = sal::static_int_cast< sal_uInt16 >(
aSelection.nEndPos + nLen );
}
pPortion->ApplyTo( aPortionAttribs, (SdrPowerPointImport&)*this, nDestinationInstance, pTextObj );
@@ -2336,10 +2336,10 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
SfxItemSet aParagraphAttribs( rOutliner.GetEmptyItemSet() );
pPara->ApplyTo( aParagraphAttribs, oStartNumbering, (SdrPowerPointImport&)*this, nDestinationInstance, pPreviousParagraph );
- UINT32 nIsBullet2 = 0; //, nInstance = nDestinationInstance != 0xffffffff ? nDestinationInstance : pTextObj->GetInstance();
+ sal_uInt32 nIsBullet2 = 0; //, nInstance = nDestinationInstance != 0xffffffff ? nDestinationInstance : pTextObj->GetInstance();
pPara->GetAttrib( PPT_ParaAttr_BulletOn, nIsBullet2, nDestinationInstance );
if ( !nIsBullet2 )
- aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, FALSE ) );
+ aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, sal_False ) );
if ( oStartNumbering )
{
@@ -2358,7 +2358,7 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
pPreviousParagraph = pPara;
if ( !aSelection.nStartPos ) // in PPT empty paragraphs never gets a bullet
{
- aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, FALSE ) );
+ aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, sal_False ) );
}
aSelection.nStartPos = 0;
rOutliner.QuickSetAttribs( aParagraphAttribs, aSelection );
@@ -2376,7 +2376,7 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
sal_Bool SdrPowerPointImport::SeekToDocument( DffRecordHeader* pRecHd ) const
{
sal_Bool bRet;
- ULONG nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer ggf. spaetere Restauration
+ sal_uLong nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer ggf. spaetere Restauration
rStCtrl.Seek( nDocStreamPos );
DffRecordHeader aDocHd;
rStCtrl >> aDocHd;
@@ -2444,38 +2444,38 @@ sal_Bool SdrPowerPointImport::SeekToContentOfProgTag( sal_Int32 nVersion, SvStre
return bRetValue;
}
-UINT32 SdrPowerPointImport::GetAktPageId()
+sal_uInt32 SdrPowerPointImport::GetAktPageId()
{
PptSlidePersistList* pList = GetPageList( eAktPageKind );
if ( pList && nAktPageNum < pList->Count() )
- return (*pList)[ (USHORT)nAktPageNum ]->aPersistAtom.nSlideId;
+ return (*pList)[ (sal_uInt16)nAktPageNum ]->aPersistAtom.nSlideId;
return 0;
}
sal_Bool SdrPowerPointImport::SeekToAktPage( DffRecordHeader* pRecHd ) const
{
- sal_Bool bRet = FALSE;
+ sal_Bool bRet = sal_False;
PptSlidePersistList* pList = GetPageList( eAktPageKind );
if ( pList && ( nAktPageNum < pList->Count() ) )
{
- ULONG nPersist = (*pList)[ (USHORT)nAktPageNum ]->aPersistAtom.nPsrReference;
+ sal_uLong nPersist = (*pList)[ (sal_uInt16)nAktPageNum ]->aPersistAtom.nPsrReference;
if ( nPersist > 0 && nPersist < nPersistPtrAnz )
{
- ULONG nFPos = 0;
+ sal_uLong nFPos = 0;
nFPos = pPersistPtr[ nPersist ];
if ( nFPos < nStreamLen )
{
rStCtrl.Seek( nFPos );
if ( pRecHd )
rStCtrl >> *pRecHd;
- bRet = TRUE;
+ bRet = sal_True;
}
}
}
return bRet;
}
-USHORT SdrPowerPointImport::GetPageCount( PptPageKind ePageKind ) const
+sal_uInt16 SdrPowerPointImport::GetPageCount( PptPageKind ePageKind ) const
{
PptSlidePersistList* pList = GetPageList( ePageKind );
if ( pList )
@@ -2551,11 +2551,11 @@ Size SdrPowerPointImport::GetPageSize() const
return aRet;
}
-bool SdrPowerPointImport::GetColorFromPalette( USHORT nNum, Color& rColor ) const
+bool SdrPowerPointImport::GetColorFromPalette( sal_uInt16 nNum, Color& rColor ) const
{
if ( nPageColorsNum != nAktPageNum || ePageColorsKind != eAktPageKind )
{
- UINT16 nSlideFlags = 0;
+ sal_uInt16 nSlideFlags = 0;
PptSlidePersistList* pPageList = GetPageList( eAktPageKind );
if ( pPageList && ( nAktPageNum < pPageList->Count() ) )
{
@@ -2602,12 +2602,12 @@ bool SdrPowerPointImport::GetColorFromPalette( USHORT nNum, Color& rColor ) cons
((SdrPowerPointImport*)this)->ePageColorsKind = eAktPageKind;
}
rColor = aPageColors.GetColor( nNum );
- return TRUE;
+ return sal_True;
}
-BOOL SdrPowerPointImport::SeekToShape( SvStream& rSt, void* pClientData, UINT32 nId ) const
+sal_Bool SdrPowerPointImport::SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const
{
- BOOL bRet = SvxMSDffManager::SeekToShape( rSt, pClientData, nId );
+ sal_Bool bRet = SvxMSDffManager::SeekToShape( rSt, pClientData, nId );
if ( !bRet )
{
ProcessData& rData = *( (ProcessData*)pClientData );
@@ -2616,24 +2616,24 @@ BOOL SdrPowerPointImport::SeekToShape( SvStream& rSt, void* pClientData, UINT32
{
if ( HasMasterPage( nAktPageNum, eAktPageKind ) )
{
- USHORT nMasterNum = GetMasterPageIndex( nAktPageNum, eAktPageKind );
+ sal_uInt16 nMasterNum = GetMasterPageIndex( nAktPageNum, eAktPageKind );
PptSlidePersistList* pPageList = GetPageList( PPT_MASTERPAGE );
if ( pPageList && ( nMasterNum < pPageList->Count() ) )
{
PptSlidePersistEntry* pPersist = (*pPageList)[ nMasterNum ]; // get the masterpage's persistentry
if ( pPersist && pPersist->pPresentationObjects )
{
- UINT32 nCurrent(0L);
+ sal_uInt32 nCurrent(0L);
DffRecordList* pCList = maShapeRecords.pCList; // we got a backup of the current position
if ( pCList )
nCurrent = pCList->nCurrent;
if ( ((SdrEscherImport*)this )->maShapeRecords.SeekToContent( rSt, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
{
- UINT32 nStreamPos = rSt.Tell();
+ sal_uInt32 nStreamPos = rSt.Tell();
PPTTextObj aTextObj( rSt, (SdrPowerPointImport&)*this, rPersistEntry, NULL );
if ( aTextObj.Count() || aTextObj.GetOEPlaceHolderAtom() )
{
- UINT32 nShapePos = 0;
+ sal_uInt32 nShapePos = 0;
switch ( aTextObj.GetInstance() )
{
case TSS_TYPE_TITLE :
@@ -2652,7 +2652,7 @@ BOOL SdrPowerPointImport::SeekToShape( SvStream& rSt, void* pClientData, UINT32
if ( nShapePos )
{
rSt.Seek( nShapePos );
- bRet = TRUE;
+ bRet = sal_True;
}
}
if ( !bRet )
@@ -2697,7 +2697,7 @@ void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage,
case PPT_PST_CString :
{
String aString;
- SvxMSDffManager::MSDFFReadZString( rStCtrl, aString, aCommentHd.nRecLen, TRUE );
+ SvxMSDffManager::MSDFFReadZString( rStCtrl, aString, aCommentHd.nRecLen, sal_True );
switch ( aCommentHd.nRecInstance )
{
case 0 : sAuthor = aString; break;
@@ -2750,7 +2750,7 @@ void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage,
// be sure not to import masterpages with this method
void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* pMasterPersist )
{
- UINT32 nMerk = rStCtrl.Tell();
+ sal_uInt32 nMerk = rStCtrl.Tell();
PptSlidePersistList* pList = GetPageList( eAktPageKind );
if ( ( !pList ) || ( pList->Count() <= nAktPageNum ) )
return;
@@ -2846,7 +2846,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
rStCtrl >> aShapeHd;
if ( aShapeHd.nRecType == DFF_msofbtSp )
{
- UINT32 nSpFlags;
+ sal_uInt32 nSpFlags;
rStCtrl >> nSpFlags >> nSpFlags;
if ( nSpFlags & SP_FBACKGROUND )
{
@@ -2923,7 +2923,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
const SfxPoolItem* pPoolItem = NULL;
const SfxItemSet& rObjectItemSet = rSlidePersist.pBObj->GetMergedItemSet();
- //SfxItemState eState = rObjectItemSet.GetItemState( XATTR_FILLCOLOR, FALSE, &pPoolItem );
+ //SfxItemState eState = rObjectItemSet.GetItemState( XATTR_FILLCOLOR, sal_False, &pPoolItem );
if ( pPoolItem )
{
SfxItemSet aNewSet(*rObjectItemSet.GetPool());
@@ -2975,7 +2975,7 @@ const PptSlideLayoutAtom* SdrPowerPointImport::GetSlideLayoutAtom() const
return NULL;
}
-sal_Bool SdrPowerPointImport::IsNoteOrHandout( USHORT nPageNum, PptPageKind /*ePageKind*/) const
+sal_Bool SdrPowerPointImport::IsNoteOrHandout( sal_uInt16 nPageNum, PptPageKind /*ePageKind*/) const
{
sal_Bool bNote = eAktPageKind == PPT_NOTEPAGE;
if ( eAktPageKind == PPT_MASTERPAGE )
@@ -2983,7 +2983,7 @@ sal_Bool SdrPowerPointImport::IsNoteOrHandout( USHORT nPageNum, PptPageKind /*eP
return bNote;
}
-UINT32 SdrPowerPointImport::GetMasterPageId( USHORT nPageNum, PptPageKind ePageKind ) const
+sal_uInt32 SdrPowerPointImport::GetMasterPageId( sal_uInt16 nPageNum, PptPageKind ePageKind ) const
{
PptSlidePersistList* pPageList = GetPageList( ePageKind );
if ( pPageList && nPageNum < pPageList->Count() )
@@ -2991,7 +2991,7 @@ UINT32 SdrPowerPointImport::GetMasterPageId( USHORT nPageNum, PptPageKind ePageK
return 0;
}
-UINT32 SdrPowerPointImport::GetNotesPageId( USHORT nPageNum ) const
+sal_uInt32 SdrPowerPointImport::GetNotesPageId( sal_uInt16 nPageNum ) const
{
PptSlidePersistList* pPageList=GetPageList( PPT_SLIDEPAGE );
if ( pPageList && nPageNum < pPageList->Count() )
@@ -2999,21 +2999,21 @@ UINT32 SdrPowerPointImport::GetNotesPageId( USHORT nPageNum ) const
return 0;
}
-sal_Bool SdrPowerPointImport::HasMasterPage( USHORT nPageNum, PptPageKind ePageKind ) const
+sal_Bool SdrPowerPointImport::HasMasterPage( sal_uInt16 nPageNum, PptPageKind ePageKind ) const
{
if ( ePageKind == PPT_NOTEPAGE )
return aDocAtom.nNotesMasterPersist != 0;
if ( ePageKind == PPT_MASTERPAGE )
- return FALSE;
+ return sal_False;
return GetMasterPageId( nPageNum, ePageKind ) != 0;
}
-USHORT SdrPowerPointImport::GetMasterPageIndex( USHORT nPageNum, PptPageKind ePageKind ) const
+sal_uInt16 SdrPowerPointImport::GetMasterPageIndex( sal_uInt16 nPageNum, PptPageKind ePageKind ) const
{
- USHORT nIdx = 0;
+ sal_uInt16 nIdx = 0;
if ( ePageKind == PPT_NOTEPAGE )
return 2;
- UINT32 nId = GetMasterPageId( nPageNum, ePageKind );
+ sal_uInt32 nId = GetMasterPageId( nPageNum, ePageKind );
if ( nId && pMasterPages )
{
nIdx = pMasterPages->FindPage( nId );
@@ -3028,30 +3028,30 @@ SdrObject* SdrPowerPointImport::ImportPageBackgroundObject( const SdrPage& rPage
SdrObject* pRet = NULL;
sal_Bool bCreateObj = bForce;
SfxItemSet* pSet = NULL;
- ULONG nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer spaetere Restauration
+ sal_uLong nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer spaetere Restauration
DffRecordHeader aPageHd;
if ( SeekToAktPage( &aPageHd ) )
{ // und nun die Hintergrundattribute der Page suchen
- ULONG nPageRecEnd = aPageHd.GetRecEndFilePos();
+ sal_uLong nPageRecEnd = aPageHd.GetRecEndFilePos();
DffRecordHeader aPPDrawHd;
if ( SeekToRec( rStCtrl, PPT_PST_PPDrawing, nPageRecEnd, &aPPDrawHd ) )
{
- ULONG nPPDrawEnd = aPPDrawHd.GetRecEndFilePos();
+ sal_uLong nPPDrawEnd = aPPDrawHd.GetRecEndFilePos();
DffRecordHeader aEscherF002Hd;
if ( SeekToRec( rStCtrl, DFF_msofbtDgContainer, nPPDrawEnd, &aEscherF002Hd ) )
{
- ULONG nEscherF002End = aEscherF002Hd.GetRecEndFilePos();
+ sal_uLong nEscherF002End = aEscherF002Hd.GetRecEndFilePos();
DffRecordHeader aEscherObjectHd;
if ( SeekToRec( rStCtrl, DFF_msofbtSpContainer, nEscherF002End, &aEscherObjectHd ) )
{
nBgFileOffset = aEscherObjectHd.GetRecBegFilePos();
- //ULONG nEscherObjectEnd = aEscherObjectHd.GetRecEndFilePos();
+ //sal_uLong nEscherObjectEnd = aEscherObjectHd.GetRecEndFilePos();
//DffRecordHeader aEscherPropertiesHd;
if ( SeekToRec( rStCtrl, DFF_msofbtOPT,nEscherF002End ) )
{
rStCtrl >> (DffPropertyReader&)*this;
mnFix16Angle = Fix16ToAngle( GetPropertyValue( DFF_Prop_Rotation, 0 ) );
- UINT32 nColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff );
+ sal_uInt32 nColor = GetPropertyValue( DFF_Prop_fillColor, 0xffffff );
pSet = new SfxItemSet( pSdrModel->GetItemPool() );
DffObjData aObjData( aEscherObjectHd, Rectangle( 0, 0, 28000, 21000 ), 0 );
ApplyAttributes( rStCtrl, *pSet, aObjData );
@@ -3077,9 +3077,9 @@ SdrObject* SdrPowerPointImport::ImportPageBackgroundObject( const SdrPage& rPage
pRet->SetMergedItemSet(*pSet);
- pRet->SetMarkProtect( TRUE );
- pRet->SetMoveProtect( TRUE );
- pRet->SetResizeProtect( TRUE );
+ pRet->SetMarkProtect( sal_True );
+ pRet->SetMoveProtect( sal_True );
+ pRet->SetResizeProtect( sal_True );
}
delete pSet;
return pRet;
@@ -3107,9 +3107,9 @@ HeaderFooterEntry::~HeaderFooterEntry()
{
}
-UINT32 HeaderFooterEntry::GetMaskForInstance( UINT32 nInstance )
+sal_uInt32 HeaderFooterEntry::GetMaskForInstance( sal_uInt32 nInstance )
{
- UINT32 nRet = 0;
+ sal_uInt32 nRet = 0;
switch ( nInstance )
{
case 0 : nRet = 0x07ffff; break;
@@ -3120,9 +3120,9 @@ UINT32 HeaderFooterEntry::GetMaskForInstance( UINT32 nInstance )
return nRet;
}
-UINT32 HeaderFooterEntry::IsToDisplay( UINT32 nInstance )
+sal_uInt32 HeaderFooterEntry::IsToDisplay( sal_uInt32 nInstance )
{
- UINT32 nMask = 0;
+ sal_uInt32 nMask = 0;
switch ( nInstance )
{
case 0 : nMask = 0x010000; break;
@@ -3169,7 +3169,7 @@ void SdrEscherImport::ImportHeaderFooterContainer( DffRecordHeader& rHd, HeaderF
case PPT_PST_CString :
{
if ( aHd.nRecInstance < 4 )
- MSDFFReadZString( rStCtrl, rE.pPlaceholder[ aHd.nRecInstance ], aHd.nRecLen, TRUE );
+ MSDFFReadZString( rStCtrl, rE.pPlaceholder[ aHd.nRecInstance ], aHd.nRecLen, sal_True );
}
break;
}
@@ -3178,13 +3178,13 @@ void SdrEscherImport::ImportHeaderFooterContainer( DffRecordHeader& rHd, HeaderF
}
// no longer needed
-sal_Unicode SdrPowerPointImport::PPTSubstitute( UINT16 /*nFont*/, sal_Unicode /*nChar*/,
- UINT32& /*nMappedFontId*/, Font& /*rFont*/, char /*nDefault*/) const
+sal_Unicode SdrPowerPointImport::PPTSubstitute( sal_uInt16 /*nFont*/, sal_Unicode /*nChar*/,
+ sal_uInt32& /*nMappedFontId*/, Font& /*rFont*/, char /*nDefault*/) const
{
return 0;
}
-PPTBuGraEntry::PPTBuGraEntry( Graphic& rGraphic, UINT32 nInst ) :
+PPTBuGraEntry::PPTBuGraEntry( Graphic& rGraphic, sal_uInt32 nInst ) :
nInstance ( nInst ),
aBuGra ( rGraphic ) {}
@@ -3201,7 +3201,7 @@ PPTExtParaLevel::PPTExtParaLevel()
SvStream& operator>>( SvStream& rIn, PPTExtParaLevel& rLevel )
{
- rLevel.mbSet = TRUE;
+ rLevel.mbSet = sal_True;
rIn >> rLevel.mnExtParagraphMask;
if ( rLevel.mnExtParagraphMask & 0x00800000 )
rIn >> rLevel.mnBuBlip;
@@ -3217,15 +3217,15 @@ SvStream& operator>>( SvStream& rIn, PPTExtParaLevel& rLevel )
return rIn;
}
-BOOL PPTExtParaProv::GetGraphic( UINT32 nInstance, Graphic& rGraph ) const
+sal_Bool PPTExtParaProv::GetGraphic( sal_uInt32 nInstance, Graphic& rGraph ) const
{
- BOOL bRetValue = FALSE;
+ sal_Bool bRetValue = sal_False;
PPTBuGraEntry* pPtr = NULL;
if ( nInstance < aBuGraList.Count() )
{
pPtr = (PPTBuGraEntry*)aBuGraList.GetObject( nInstance );
if ( pPtr->nInstance == nInstance )
- bRetValue = TRUE;
+ bRetValue = sal_True;
}
if ( !bRetValue )
{
@@ -3235,7 +3235,7 @@ BOOL PPTExtParaProv::GetGraphic( UINT32 nInstance, Graphic& rGraph ) const
pPtr = (PPTBuGraEntry*)aBuGraList.GetObject( i );
if ( pPtr->nInstance == nInstance )
{
- bRetValue = TRUE;
+ bRetValue = sal_True;
break;
}
}
@@ -3246,10 +3246,10 @@ BOOL PPTExtParaProv::GetGraphic( UINT32 nInstance, Graphic& rGraph ) const
}
PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const DffRecordHeader* pHd ) :
- bStyles ( FALSE ),
- bGraphics ( FALSE )
+ bStyles ( sal_False ),
+ bGraphics ( sal_False )
{
- UINT32 nOldPos = rSt.Tell();
+ sal_uInt32 nOldPos = rSt.Tell();
// here we have to get the graphical bullets...
@@ -3271,7 +3271,7 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
{
while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < aHd.GetRecEndFilePos() ) )
{
- UINT16 nType;
+ sal_uInt16 nType;
DffRecordHeader aBuGraAtomHd;
rSt >> aBuGraAtomHd;
if ( aBuGraAtomHd.nRecType == PPT_PST_ExtendedBuGraAtom )
@@ -3280,10 +3280,10 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
Graphic aGraphic;
if ( rMan.GetBLIPDirect( rSt, aGraphic, NULL ) )
{
- UINT32 nInstance = aBuGraAtomHd.nRecInstance;
+ sal_uInt32 nInstance = aBuGraAtomHd.nRecInstance;
PPTBuGraEntry* pBuGra = new PPTBuGraEntry( aGraphic, nInstance );
- UINT32 n = 0;
- UINT32 nBuGraCount = aBuGraList.Count();
+ sal_uInt32 n = 0;
+ sal_uInt32 nBuGraCount = aBuGraList.Count();
if ( nBuGraCount )
{
if ( ( (PPTBuGraEntry*)aBuGraList.GetObject( nBuGraCount - 1 ) )->nInstance < nInstance )
@@ -3297,7 +3297,7 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
}
}
}
- aBuGraList.Insert( pBuGra, (UINT32)n );
+ aBuGraList.Insert( pBuGra, (sal_uInt32)n );
}
#ifdef DBG_UTIL
else OSL_FAIL( "PPTExParaProv::PPTExParaProv - bullet graphic is not valid (SJ)" );
@@ -3309,12 +3309,12 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
aBuGraAtomHd.SeekToEndOfRecord( rSt );
}
if ( aBuGraList.Count() )
- bGraphics = TRUE;
+ bGraphics = sal_True;
}
break;
case PPT_PST_ExtendedPresRuleContainer :
- aExtendedPresRules.Consume( rSt, FALSE, aHd.GetRecEndFilePos() );
+ aExtendedPresRules.Consume( rSt, sal_False, aHd.GetRecEndFilePos() );
break;
#ifdef DBG_UTIL
default :
@@ -3348,14 +3348,14 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
{
if ( aHd.nRecInstance < PPT_STYLESHEETENTRYS )
{
- UINT16 nDepth, i = 0;
+ sal_uInt16 nDepth, i = 0;
rSt >> nDepth;
if ( i <= 5 )
{
while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < aHd.GetRecEndFilePos() ) && ( i < nDepth ) )
{
- bStyles = TRUE;
+ bStyles = sal_True;
rSt >> aExtParaSheet[ aHd.nRecInstance ].aExtParaLevel[ i++ ];
}
#ifdef DBG_UTIL
@@ -3405,16 +3405,16 @@ PPTNumberFormatCreator::~PPTNumberFormatCreator()
delete pExtParaProv;
}
-BOOL PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rManager,
- SvxNumberFormat& rNumberFormat, UINT32 nLevel, UINT32 nInstance, UINT32 nDestinationInstance,
- boost::optional< sal_Int16 >& rStartNumbering, UINT32 nFontHeight, PPTParagraphObj* pPara )
+sal_Bool PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rManager,
+ SvxNumberFormat& rNumberFormat, sal_uInt32 nLevel, sal_uInt32 nInstance, sal_uInt32 nDestinationInstance,
+ boost::optional< sal_Int16 >& rStartNumbering, sal_uInt32 nFontHeight, PPTParagraphObj* pPara )
{
- BOOL bHardAttribute = ( nDestinationInstance == 0xffffffff );
+ sal_Bool bHardAttribute = ( nDestinationInstance == 0xffffffff );
- UINT32 nBuFlags = 0;
- UINT16 nHasAnm = 0;
- UINT32 nAnmScheme = 0xFFFF0003;
- UINT16 nBuBlip = 0xffff;
+ sal_uInt32 nBuFlags = 0;
+ sal_uInt16 nHasAnm = 0;
+ sal_uInt32 nAnmScheme = 0xFFFF0003;
+ sal_uInt16 nBuBlip = 0xffff;
const PPTExtParaProv* pParaProv = pExtParaProv;
if ( !pExtParaProv )
@@ -3431,7 +3431,7 @@ BOOL PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rManag
nAnmScheme = pPara->pParaSet->mnAnmScheme;
if ( nBuFlags & 0x02000000 )
nHasAnm = pPara->pParaSet->mnHasAnm;
- bHardAttribute = TRUE;
+ bHardAttribute = sal_True;
}
}
@@ -3444,7 +3444,7 @@ BOOL PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rManag
const PPTExtParaLevel& rLev = pParaProv->aExtParaSheet[ nInstance ].aExtParaLevel[ nLevel ];
if ( rLev.mbSet )
{
- UINT32 nMaBuFlags = rLev.mnExtParagraphMask;
+ sal_uInt32 nMaBuFlags = rLev.mnExtParagraphMask;
if ( (!( nBuFlags & 0x00800000)) && ( nMaBuFlags & 0x00800000 ) )
{
@@ -3469,7 +3469,7 @@ BOOL PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rManag
rNumberFormat.SetGraphicBrush( &aBrush );
sal_uInt32 nHeight = (sal_uInt32)( (double)nFontHeight * 0.2540 * nBulletHeight + 0.5 );
Size aPrefSize( aGraphic.GetPrefSize() );
- UINT32 nWidth = ( nHeight * aPrefSize.Width() ) / aPrefSize.Height();
+ sal_uInt32 nWidth = ( nHeight * aPrefSize.Width() ) / aPrefSize.Height();
rNumberFormat.SetGraphicSize( Size( nWidth, nHeight ) );
rNumberFormat.SetNumberingType ( SVX_NUM_BITMAP );
}
@@ -3585,7 +3585,7 @@ BOOL PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rManag
return bHardAttribute;
}
-void PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, SvxNumberFormat& rNumberFormat, UINT32 nLevel, const PPTParaLevel& rParaLevel, const PPTCharLevel& rCharLevel, UINT32 nInstance )
+void PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, SvxNumberFormat& rNumberFormat, sal_uInt32 nLevel, const PPTParaLevel& rParaLevel, const PPTCharLevel& rCharLevel, sal_uInt32 nInstance )
{
nIsBullet = ( rParaLevel.mnBuFlags & ( 1 << PPT_ParaAttr_BulletOn ) ) != 0 ? 1 : 0;
nBulletChar = rParaLevel.mnBulletChar;
@@ -3632,10 +3632,10 @@ void PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, Svx
}
}
-BOOL PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, SvxNumberFormat& rNumberFormat, PPTParagraphObj* pParaObj,
- UINT32 nDestinationInstance, boost::optional< sal_Int16 >& rStartNumbering )
+sal_Bool PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, SvxNumberFormat& rNumberFormat, PPTParagraphObj* pParaObj,
+ sal_uInt32 nDestinationInstance, boost::optional< sal_Int16 >& rStartNumbering )
{
- UINT32 nHardCount = 0;
+ sal_uInt32 nHardCount = 0;
nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_BulletOn, nIsBullet, nDestinationInstance );
nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_BulletChar, nBulletChar, nDestinationInstance );
nHardCount += pParaObj->GetAttrib( PPT_ParaAttr_BulletFont, nBulletFont, nDestinationInstance );
@@ -3647,7 +3647,7 @@ BOOL PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, Svx
if ( nIsBullet )
rNumberFormat.SetNumberingType( SVX_NUM_CHAR_SPECIAL );
- UINT32 nFontHeight = 24;
+ sal_uInt32 nFontHeight = 24;
PPTPortionObj* pPtr = pParaObj->First();
if ( pPtr )
pPtr->GetAttrib( PPT_CharAttr_FontHeight, nFontHeight, nDestinationInstance );
@@ -3691,10 +3691,10 @@ BOOL PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, Svx
break;
}
}
- return ( nHardCount ) ? TRUE : FALSE;
+ return ( nHardCount ) ? sal_True : sal_False;
}
-void PPTNumberFormatCreator::ImplGetNumberFormat( SdrPowerPointImport& rManager, SvxNumberFormat& rNumberFormat, UINT32 /*nLevel*/)
+void PPTNumberFormatCreator::ImplGetNumberFormat( SdrPowerPointImport& rManager, SvxNumberFormat& rNumberFormat, sal_uInt32 /*nLevel*/)
{
Font aFont;
PptFontEntityAtom* pAtom = rManager.GetFontEnityAtom( nBulletFont );
@@ -3717,18 +3717,18 @@ void PPTNumberFormatCreator::ImplGetNumberFormat( SdrPowerPointImport& rManager,
}
rNumberFormat.SetBulletFont( &aFont );
rNumberFormat.SetBulletChar( nBuChar );
- rNumberFormat.SetBulletRelSize( (UINT16)nBulletHeight );
+ rNumberFormat.SetBulletRelSize( (sal_uInt16)nBulletHeight );
rNumberFormat.SetBulletColor( aCol );
- UINT16 nAbsLSpace = (UINT16)( ( (UINT32)nTextOfs * 2540 ) / 576 );
- UINT16 nFirstLineOffset = nAbsLSpace - (UINT16)( ( (UINT32)nBulletOfs * 2540 ) / 576 );
+ sal_uInt16 nAbsLSpace = (sal_uInt16)( ( (sal_uInt32)nTextOfs * 2540 ) / 576 );
+ sal_uInt16 nFirstLineOffset = nAbsLSpace - (sal_uInt16)( ( (sal_uInt32)nBulletOfs * 2540 ) / 576 );
rNumberFormat.SetAbsLSpace( nAbsLSpace );
rNumberFormat.SetFirstLineOffset( -nFirstLineOffset );
}
-PPTCharSheet::PPTCharSheet( UINT32 nInstance )
+PPTCharSheet::PPTCharSheet( sal_uInt32 nInstance )
{
- UINT32 nColor = PPT_COLSCHEME_TEXT_UND_ZEILEN;
- UINT16 nFontHeight(0);
+ sal_uInt32 nColor = PPT_COLSCHEME_TEXT_UND_ZEILEN;
+ sal_uInt16 nFontHeight(0);
switch ( nInstance )
{
case TSS_TYPE_PAGETITLE :
@@ -3752,14 +3752,14 @@ PPTCharSheet::PPTCharSheet( UINT32 nInstance )
nFontHeight = 24;
break;
}
- for ( UINT32 nDepth = 0; nDepth < 5; nDepth++ )
+ for ( sal_uInt32 nDepth = 0; nDepth < 5; nDepth++ )
{
maCharLevel[ nDepth ].mnFlags = 0;
maCharLevel[ nDepth ].mnFont = 0;
maCharLevel[ nDepth ].mnAsianOrComplexFont = 0xffff;
maCharLevel[ nDepth ].mnFontHeight = nFontHeight;
maCharLevel[ nDepth ].mnFontColor = nColor;
- maCharLevel[ nDepth ].mnFontColorInStyleSheet = Color( (BYTE)nColor, (BYTE)( nColor >> 8 ), (BYTE)( nColor >> 16 ) );
+ maCharLevel[ nDepth ].mnFontColorInStyleSheet = Color( (sal_uInt8)nColor, (sal_uInt8)( nColor >> 8 ), (sal_uInt8)( nColor >> 16 ) );
maCharLevel[ nDepth ].mnEscapement = 0;
}
}
@@ -3816,7 +3816,7 @@ void PPTCharSheet::Read( SvStream& rIn, sal_Bool /*bMasterStyle*/, sal_uInt32 nL
}
}
-PPTParaSheet::PPTParaSheet( UINT32 nInstance )
+PPTParaSheet::PPTParaSheet( sal_uInt32 nInstance )
{
sal_uInt16 nBuFlags = 0;
sal_uInt32 nBulletColor = 0x8000000;
@@ -3841,7 +3841,7 @@ PPTParaSheet::PPTParaSheet( UINT32 nInstance )
nUpperDist = 0x1e;
break;
}
- for ( UINT32 i = 0; i < 5; i++ )
+ for ( sal_uInt32 i = 0; i < 5; i++ )
{
maParaLevel[ i ].mnBuFlags = nBuFlags;
maParaLevel[ i ].mnBulletChar = 0x2022;
@@ -4001,8 +4001,8 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
PPTNumberFormatCreator ( new PPTExtParaProv( rManager, rIn, &rSlideHd ) ),
maTxSI ( rTextSpecInfo )
{
- UINT32 i;
- UINT32 nOldFilePos = rIn.Tell();
+ sal_uInt32 i;
+ sal_uInt32 nOldFilePos = rIn.Tell();
// default stylesheets
mpCharSheet[ TSS_TYPE_PAGETITLE ] = new PPTCharSheet( TSS_TYPE_PAGETITLE );
@@ -4264,7 +4264,7 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
// will will create the default numbulletitem for each instance
for ( i = 0; i < PPT_STYLESHEETENTRYS; i++ )
{
- UINT16 nLevels, nDepth = 0;
+ sal_uInt16 nLevels, nDepth = 0;
SvxNumRuleType eNumRuleType;
switch ( i )
@@ -4294,8 +4294,8 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
}
SvxNumRule aRule( NUM_BULLET_REL_SIZE | NUM_BULLET_COLOR |
NUM_CHAR_TEXT_DISTANCE | NUM_SYMBOL_ALIGNMENT,
- nLevels, FALSE, eNumRuleType );
- for ( UINT16 nCount = 0; nDepth < nLevels; nCount++ )
+ nLevels, sal_False, eNumRuleType );
+ for ( sal_uInt16 nCount = 0; nDepth < nLevels; nCount++ )
{
const PPTParaLevel& rParaLevel = mpParaSheet[ i ]->maParaLevel[ nCount ];
const PPTCharLevel& rCharLevel = mpCharSheet[ i ]->maCharLevel[ nCount ];
@@ -4317,7 +4317,7 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
PPTStyleSheet::~PPTStyleSheet()
{
- for ( UINT32 i = 0; i < PPT_STYLESHEETENTRYS; i++ )
+ for ( sal_uInt32 i = 0; i < PPT_STYLESHEETENTRYS; i++ )
{
delete mpCharSheet[ i ];
delete mpParaSheet[ i ];
@@ -4428,10 +4428,10 @@ void PPTCharPropSet::ImplMakeUnique()
}
}
-void PPTCharPropSet::SetFont( UINT16 nFont )
+void PPTCharPropSet::SetFont( sal_uInt16 nFont )
{
- UINT32 nMask = 1 << PPT_CharAttr_Font;
- UINT32 bDoNotMake = pCharSet->mnAttrSet & nMask;
+ sal_uInt32 nMask = 1 << PPT_CharAttr_Font;
+ sal_uInt32 bDoNotMake = pCharSet->mnAttrSet & nMask;
if ( bDoNotMake )
bDoNotMake = nFont == pCharSet->mnFont;
@@ -4476,12 +4476,12 @@ PPTTextRulerInterpreter::PPTTextRulerInterpreter( PPTTextRulerInterpreter& rRule
mpImplRuler->nRefCount++;
}
-PPTTextRulerInterpreter::PPTTextRulerInterpreter( UINT32 nFileOfs, SdrPowerPointImport& rMan, DffRecordHeader& rHeader, SvStream& rIn ) :
+PPTTextRulerInterpreter::PPTTextRulerInterpreter( sal_uInt32 nFileOfs, SdrPowerPointImport& rMan, DffRecordHeader& rHeader, SvStream& rIn ) :
mpImplRuler ( new PPTRuler() )
{
if ( nFileOfs != 0xffffffff )
{
- UINT32 nOldPos = rIn.Tell();
+ sal_uInt32 nOldPos = rIn.Tell();
DffRecordHeader rHd;
if ( nFileOfs )
{
@@ -4506,7 +4506,7 @@ PPTTextRulerInterpreter::PPTTextRulerInterpreter( UINT32 nFileOfs, SdrPowerPoint
rIn >> nTCount;
if ( nTCount )
{
- mpImplRuler->nTabCount = (UINT16)nTCount;
+ mpImplRuler->nTabCount = (sal_uInt16)nTCount;
mpImplRuler->pTab = new PPTTabEntry[ mpImplRuler->nTabCount ];
for ( i = 0; i < nTCount; i++ )
{
@@ -4527,28 +4527,28 @@ PPTTextRulerInterpreter::PPTTextRulerInterpreter( UINT32 nFileOfs, SdrPowerPoint
}
}
-BOOL PPTTextRulerInterpreter::GetDefaultTab( UINT32 /*nLevel*/, UINT16& nValue ) const
+sal_Bool PPTTextRulerInterpreter::GetDefaultTab( sal_uInt32 /*nLevel*/, sal_uInt16& nValue ) const
{
if ( ! ( mpImplRuler->nFlags & 1 ) )
- return FALSE;
+ return sal_False;
nValue = mpImplRuler->nDefaultTab;
- return TRUE;
+ return sal_True;
}
-BOOL PPTTextRulerInterpreter::GetTextOfs( UINT32 nLevel, UINT16& nValue ) const
+sal_Bool PPTTextRulerInterpreter::GetTextOfs( sal_uInt32 nLevel, sal_uInt16& nValue ) const
{
if ( ! ( ( nLevel < 5 ) && ( mpImplRuler->nFlags & ( 8 << nLevel ) ) ) )
- return FALSE;
+ return sal_False;
nValue = mpImplRuler->nTextOfs[ nLevel ];
- return TRUE;
+ return sal_True;
}
-BOOL PPTTextRulerInterpreter::GetBulletOfs( UINT32 nLevel, UINT16& nValue ) const
+sal_Bool PPTTextRulerInterpreter::GetBulletOfs( sal_uInt32 nLevel, sal_uInt16& nValue ) const
{
if ( ! ( ( nLevel < 5 ) && ( mpImplRuler->nFlags & ( 256 << nLevel ) ) ) )
- return FALSE;
+ return sal_False;
nValue = mpImplRuler->nBulletOfs[ nLevel ];
- return TRUE;
+ return sal_True;
}
PPTTextRulerInterpreter& PPTTextRulerInterpreter::operator=( PPTTextRulerInterpreter& rRuler )
@@ -5244,12 +5244,12 @@ PPTStyleTextPropReader::~PPTStyleTextPropReader()
struct FieldEntry
{
- UINT32 nFieldType;
- UINT32 nFieldStartPos;
- UINT32 nFieldEndPos;
+ sal_uInt32 nFieldType;
+ sal_uInt32 nFieldStartPos;
+ sal_uInt32 nFieldEndPos;
String aFieldUrl;
- FieldEntry( UINT32 nType, UINT32 nStart, UINT32 nEnd )
+ FieldEntry( sal_uInt32 nType, sal_uInt32 nStart, sal_uInt32 nEnd )
{
nFieldType = nType;
nFieldStartPos = nStart;
@@ -5265,7 +5265,7 @@ struct FieldEntry
};
-PPTPortionObj::PPTPortionObj( const PPTStyleSheet& rStyleSheet, UINT32 nInstance, UINT32 nDepth ) :
+PPTPortionObj::PPTPortionObj( const PPTStyleSheet& rStyleSheet, sal_uInt32 nInstance, sal_uInt32 nDepth ) :
PPTCharPropSet ( 0 ),
mrStyleSheet ( rStyleSheet ),
mnInstance ( nInstance ),
@@ -5273,7 +5273,7 @@ PPTPortionObj::PPTPortionObj( const PPTStyleSheet& rStyleSheet, UINT32 nInstance
{
}
-PPTPortionObj::PPTPortionObj( PPTCharPropSet& rCharPropSet, const PPTStyleSheet& rStyleSheet, UINT32 nInstance, UINT32 nDepth ) :
+PPTPortionObj::PPTPortionObj( PPTCharPropSet& rCharPropSet, const PPTStyleSheet& rStyleSheet, sal_uInt32 nInstance, sal_uInt32 nDepth ) :
PPTCharPropSet ( rCharPropSet ),
mrStyleSheet ( rStyleSheet ),
mnInstance ( nInstance ),
@@ -5293,16 +5293,16 @@ PPTPortionObj::~PPTPortionObj()
{
}
-BOOL PPTPortionObj::HasTabulator()
+sal_Bool PPTPortionObj::HasTabulator()
{
- BOOL bRetValue = FALSE;
+ sal_Bool bRetValue = sal_False;
sal_Int32 nCount;
const sal_Unicode* pPtr = maString.GetBuffer();
for ( nCount = 0; nCount < maString.Len(); nCount++ )
{
if ( pPtr[ nCount ] == 0x9 )
{
- bRetValue = TRUE;
+ bRetValue = sal_True;
break;
}
@@ -5310,12 +5310,12 @@ BOOL PPTPortionObj::HasTabulator()
return bRetValue;
}
-BOOL PPTPortionObj::GetAttrib( UINT32 nAttr, UINT32& nRetValue, UINT32 nDestinationInstance )
+sal_Bool PPTPortionObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sal_uInt32 nDestinationInstance )
{
- UINT32 nMask = 1 << nAttr;
+ sal_uInt32 nMask = 1 << nAttr;
nRetValue = 0;
- UINT32 bIsHardAttribute = ( ( pCharSet->mnAttrSet & nMask ) != 0 ) ? 1 : 0;
+ sal_uInt32 bIsHardAttribute = ( ( pCharSet->mnAttrSet & nMask ) != 0 ) ? 1 : 0;
if ( bIsHardAttribute )
{
@@ -5369,7 +5369,7 @@ BOOL PPTPortionObj::GetAttrib( UINT32 nAttr, UINT32& nRetValue, UINT32 nDestinat
nRetValue = ( rCharLevel.mnFlags & nMask ) ? 1 : 0;
if ( pCharLevel )
{
- UINT32 nTmp = ( pCharLevel->mnFlags & nMask ) ? 1 : 0;
+ sal_uInt32 nTmp = ( pCharLevel->mnFlags & nMask ) ? 1 : 0;
if ( nRetValue != nTmp )
bIsHardAttribute = 1;
}
@@ -5414,17 +5414,17 @@ BOOL PPTPortionObj::GetAttrib( UINT32 nAttr, UINT32& nRetValue, UINT32 nDestinat
OSL_FAIL( "SJ:PPTPortionObj::GetAttrib ( attribute does not exist )" );
}
}
- return (BOOL)bIsHardAttribute;
+ return (sal_Bool)bIsHardAttribute;
}
-void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, UINT32 nDestinationInstance )
+void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, sal_uInt32 nDestinationInstance )
{
ApplyTo( rSet, rManager, nDestinationInstance, NULL );
}
-void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, UINT32 nDestinationInstance, const PPTTextObj* pTextObj )
+void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, sal_uInt32 nDestinationInstance, const PPTTextObj* pTextObj )
{
- UINT32 nVal;
+ sal_uInt32 nVal;
if ( GetAttrib( PPT_CharAttr_Bold, nVal, nDestinationInstance ) )
{
rSet.Put( SvxWeightItem( nVal != 0 ? WEIGHT_BOLD : WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
@@ -5513,7 +5513,7 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, U
if ( aSize.Height() > 64 )
aSize.Height() = 64;
- ULONG nRt = 0, nGn = 0, nBl = 0;
+ sal_uLong nRt = 0, nGn = 0, nBl = 0;
BitmapReadAccess* pAcc = aBmp.AcquireReadAccess();
if( pAcc )
{
@@ -5526,7 +5526,7 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, U
{
for( long nX = 0L; nX < nWidth; nX++ )
{
- const BitmapColor& rCol = pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) );
+ const BitmapColor& rCol = pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( nY, nX ) );
nRt+=rCol.GetRed(); nGn+=rCol.GetGreen(); nBl+=rCol.GetBlue();
}
}
@@ -5561,7 +5561,7 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, U
if ( pItemSet )
{
const SfxPoolItem* pFillStyleItem = NULL;
- pItemSet->GetItemState( XATTR_FILLSTYLE, FALSE, &pFillStyleItem );
+ pItemSet->GetItemState( XATTR_FILLSTYLE, sal_False, &pFillStyleItem );
if ( pFillStyleItem )
{
XFillStyle eFillStyle = ((XFillStyleItem*)pFillStyleItem)->GetValue();
@@ -5570,7 +5570,7 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, U
case XFILL_SOLID :
{
const SfxPoolItem* pFillColorItem = NULL;
- pItemSet->GetItemState( XATTR_FILLCOLOR, FALSE, &pFillColorItem );
+ pItemSet->GetItemState( XATTR_FILLCOLOR, sal_False, &pFillColorItem );
if ( pFillColorItem )
aDefColor = ((XColorItem*)pFillColorItem)->GetColorValue();
}
@@ -5578,7 +5578,7 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, U
case XFILL_GRADIENT :
{
const SfxPoolItem* pGradientItem = NULL;
- pItemSet->GetItemState( XATTR_FILLGRADIENT, FALSE, &pGradientItem );
+ pItemSet->GetItemState( XATTR_FILLGRADIENT, sal_False, &pGradientItem );
if ( pGradientItem )
aDefColor = ((XFillGradientItem*)pGradientItem)->GetGradientValue().GetStartColor();
}
@@ -5644,11 +5644,11 @@ SvxFieldItem* PPTPortionObj::GetTextField()
return NULL;
}
-PPTParagraphObj::PPTParagraphObj( const PPTStyleSheet& rStyleSheet, UINT32 nInstance, UINT16 nDepth ) :
+PPTParagraphObj::PPTParagraphObj( const PPTStyleSheet& rStyleSheet, sal_uInt32 nInstance, sal_uInt16 nDepth ) :
PPTNumberFormatCreator ( NULL ),
mrStyleSheet ( rStyleSheet ),
mnInstance ( nInstance ),
- mbTab ( TRUE ), // style sheets always have to get the right tabulator setting
+ mbTab ( sal_True ), // style sheets always have to get the right tabulator setting
mnPortionCount ( 0 ),
mpPortionList ( NULL )
{
@@ -5658,13 +5658,13 @@ PPTParagraphObj::PPTParagraphObj( const PPTStyleSheet& rStyleSheet, UINT32 nInst
}
PPTParagraphObj::PPTParagraphObj( PPTStyleTextPropReader& rPropReader, const PPTStyleSheet& rStyleSheet,
- UINT32 nInstance, PPTTextRulerInterpreter& rRuler ) :
+ sal_uInt32 nInstance, PPTTextRulerInterpreter& rRuler ) :
PPTParaPropSet ( *( (PPTParaPropSet*)rPropReader.aParaPropList.GetCurObject() ) ),
PPTNumberFormatCreator ( NULL ),
PPTTextRulerInterpreter ( rRuler ),
mrStyleSheet ( rStyleSheet ),
mnInstance ( nInstance ),
- mbTab ( FALSE ),
+ mbTab ( sal_False ),
mnCurrentObject ( 0 ),
mnPortionCount ( 0 ),
mpPortionList ( NULL )
@@ -5679,7 +5679,7 @@ PPTParagraphObj::PPTParagraphObj( PPTStyleTextPropReader& rPropReader, const PPT
pCharPropSet = (PPTCharPropSet*)rPropReader.aCharPropList.Seek( nCurPos );
mpPortionList = new PPTPortionObj*[ mnPortionCount ];
- for ( UINT32 i = 0; i < mnPortionCount; i++ )
+ for ( sal_uInt32 i = 0; i < mnPortionCount; i++ )
{
if ( pCharPropSet )
{
@@ -5705,7 +5705,7 @@ PPTParagraphObj::~PPTParagraphObj()
void PPTParagraphObj::AppendPortion( PPTPortionObj& rPPTPortion )
{
- UINT32 i;
+ sal_uInt32 i;
PPTPortionObj** mpOldPortionList = mpPortionList;
mpPortionList = new PPTPortionObj*[ ++mnPortionCount ];
for ( i = 0; i < mnPortionCount - 1; i++ )
@@ -5734,18 +5734,18 @@ void PPTParagraphObj::UpdateBulletRelSize( sal_uInt32& nBulletRelSize ) const
}
}
-BOOL PPTParagraphObj::GetAttrib( UINT32 nAttr, UINT32& nRetValue, UINT32 nDestinationInstance )
+sal_Bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& nRetValue, sal_uInt32 nDestinationInstance )
{
- UINT32 nMask = 1 << nAttr;
+ sal_uInt32 nMask = 1 << nAttr;
nRetValue = 0;
if ( nAttr > 21 )
{
OSL_FAIL( "SJ:PPTParagraphObj::GetAttrib - attribute does not exist" );
- return FALSE;
+ return sal_False;
}
- UINT32 bIsHardAttribute = ( ( pParaSet->mnAttrSet & nMask ) != 0 ) ? 1 : 0;
+ sal_uInt32 bIsHardAttribute = ( ( pParaSet->mnAttrSet & nMask ) != 0 ) ? 1 : 0;
if ( bIsHardAttribute )
{
@@ -5983,14 +5983,14 @@ BOOL PPTParagraphObj::GetAttrib( UINT32 nAttr, UINT32& nRetValue, UINT32 nDestin
break;
}
}
- return (BOOL)bIsHardAttribute;
+ return (sal_Bool)bIsHardAttribute;
}
void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& rStartNumbering, SdrPowerPointImport& rManager, sal_uInt32 nDestinationInstance, const PPTParagraphObj* /*pPrev*/)
{
- INT16 nVal2;
- UINT32 nVal, nUpperDist, nLowerDist;
- UINT32 nInstance = nDestinationInstance != 0xffffffff ? nDestinationInstance : mnInstance;
+ sal_Int16 nVal2;
+ sal_uInt32 nVal, nUpperDist, nLowerDist;
+ sal_uInt32 nInstance = nDestinationInstance != 0xffffffff ? nDestinationInstance : mnInstance;
if ( ( nDestinationInstance != 0xffffffff ) || ( pParaSet->mnDepth <= 1 ) )
{
@@ -6039,15 +6039,15 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
}
}
- UINT32 nIsBullet2, _nTextOfs, _nBulletOfs, nHardAttribute = 0;
+ sal_uInt32 nIsBullet2, _nTextOfs, _nBulletOfs, nHardAttribute = 0;
GetAttrib( PPT_ParaAttr_BulletOn, nIsBullet2, nDestinationInstance );
nHardAttribute += GetAttrib( PPT_ParaAttr_TextOfs, _nTextOfs, nDestinationInstance );
nHardAttribute += GetAttrib( PPT_ParaAttr_BulletOfs, _nBulletOfs, nDestinationInstance );
if ( !nIsBullet2 )
{
SvxLRSpaceItem aLRSpaceItem( EE_PARA_LRSPACE );
- UINT16 nAbsLSpace = (UINT16)( ( (UINT32)_nTextOfs * 2540 ) / 576 );
- UINT16 nFirstLineOffset = nAbsLSpace - (UINT16)( ( (UINT32)_nBulletOfs * 2540 ) / 576 );
+ sal_uInt16 nAbsLSpace = (sal_uInt16)( ( (sal_uInt32)_nTextOfs * 2540 ) / 576 );
+ sal_uInt16 nFirstLineOffset = nAbsLSpace - (sal_uInt16)( ( (sal_uInt32)_nBulletOfs * 2540 ) / 576 );
aLRSpaceItem.SetLeft( nAbsLSpace );
aLRSpaceItem.SetTxtFirstLineOfstValue( -nFirstLineOffset );
rSet.Put( aLRSpaceItem );
@@ -6078,27 +6078,27 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
// LineSpacing
PPTPortionObj* pPortion = First();
- BOOL bIsHardAttribute = GetAttrib( PPT_ParaAttr_LineFeed, nVal, nDestinationInstance );
- nVal2 = (INT16)nVal;
+ sal_Bool bIsHardAttribute = GetAttrib( PPT_ParaAttr_LineFeed, nVal, nDestinationInstance );
+ nVal2 = (sal_Int16)nVal;
sal_uInt32 nFont = sal_uInt32();
if ( pPortion && pPortion->GetAttrib( PPT_CharAttr_Font, nFont, nDestinationInstance ) )
- bIsHardAttribute = TRUE;
+ bIsHardAttribute = sal_True;
if ( bIsHardAttribute )
{
if ( pPortion && ( nVal2 > 200 ) )
{
- UINT32 nFontHeight;
+ sal_uInt32 nFontHeight;
pPortion->GetAttrib( PPT_CharAttr_FontHeight, nFontHeight, nDestinationInstance );
nVal2 = -(sal_Int16)( ( nFontHeight * nVal * 8 ) / 100 );
}
- rSet.Put( SdrTextFixedCellHeightItem( TRUE ), SDRATTR_TEXT_USEFIXEDCELLHEIGHT );
+ rSet.Put( SdrTextFixedCellHeightItem( sal_True ), SDRATTR_TEXT_USEFIXEDCELLHEIGHT );
SvxLineSpacingItem aItem( 200, EE_PARA_SBL );
if ( nVal2 <= 0 )
- aItem.SetLineHeight( (UINT16)( rManager.ScalePoint( -nVal2 ) / 8 ) );
+ aItem.SetLineHeight( (sal_uInt16)( rManager.ScalePoint( -nVal2 ) / 8 ) );
else
{
- sal_uInt8 nPropLineSpace = (BYTE)nVal2;
+ sal_uInt8 nPropLineSpace = (sal_uInt8)nVal2;
aItem.SetPropLineSpace( nPropLineSpace );
aItem.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO;
}
@@ -6106,47 +6106,47 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
}
// Paragraph Spacing
- UINT32 nFontHeight = 0;
- bIsHardAttribute = ( (UINT32)GetAttrib( PPT_ParaAttr_UpperDist, nUpperDist, nDestinationInstance ) +
- (UINT32)GetAttrib( PPT_ParaAttr_LowerDist, nLowerDist, nDestinationInstance ) ) != 0;
+ sal_uInt32 nFontHeight = 0;
+ bIsHardAttribute = ( (sal_uInt32)GetAttrib( PPT_ParaAttr_UpperDist, nUpperDist, nDestinationInstance ) +
+ (sal_uInt32)GetAttrib( PPT_ParaAttr_LowerDist, nLowerDist, nDestinationInstance ) ) != 0;
if ( ( nUpperDist > 0 ) || ( nLowerDist > 0 ) )
{
if ( mnPortionCount )
{
mpPortionList[ mnPortionCount - 1 ]->GetAttrib( PPT_CharAttr_FontHeight, nFontHeight, nDestinationInstance );
- if ( ((INT16)nUpperDist) > 0 )
+ if ( ((sal_Int16)nUpperDist) > 0 )
nUpperDist = - (sal_Int16)( ( nFontHeight * nUpperDist * 100 ) / 1000 );
- if ( ((INT16)nLowerDist) > 0 )
+ if ( ((sal_Int16)nLowerDist) > 0 )
nLowerDist = - (sal_Int16)( ( nFontHeight * nLowerDist * 100 ) / 1000 );
}
- bIsHardAttribute = TRUE;
+ bIsHardAttribute = sal_True;
}
if ( bIsHardAttribute )
{
SvxULSpaceItem aULSpaceItem( EE_PARA_ULSPACE );
- nVal2 = (INT16)nUpperDist;
+ nVal2 = (sal_Int16)nUpperDist;
if ( nVal2 <= 0 )
- aULSpaceItem.SetUpper( (UINT16)(((UINT32) - nVal2 * 2540 ) / ( 72 * 8 ) ) );
+ aULSpaceItem.SetUpper( (sal_uInt16)(((sal_uInt32) - nVal2 * 2540 ) / ( 72 * 8 ) ) );
else
{
aULSpaceItem.SetUpperValue( 0 );
- aULSpaceItem.SetPropUpper( (UINT16)nUpperDist == 100 ? 101 : (UINT16)nUpperDist );
+ aULSpaceItem.SetPropUpper( (sal_uInt16)nUpperDist == 100 ? 101 : (sal_uInt16)nUpperDist );
}
- nVal2 = (INT16)nLowerDist;
+ nVal2 = (sal_Int16)nLowerDist;
if ( nVal2 <= 0 )
- aULSpaceItem.SetLower( (UINT16)(((UINT32) - nVal2 * 2540 ) / ( 72 * 8 ) ) );
+ aULSpaceItem.SetLower( (sal_uInt16)(((sal_uInt32) - nVal2 * 2540 ) / ( 72 * 8 ) ) );
else
{
aULSpaceItem.SetLowerValue( 0 );
- aULSpaceItem.SetPropLower( (UINT16)nLowerDist == 100 ? 101 : (UINT16)nLowerDist );
+ aULSpaceItem.SetPropLower( (sal_uInt16)nLowerDist == 100 ? 101 : (sal_uInt16)nLowerDist );
}
rSet.Put( aULSpaceItem );
}
if ( mbTab ) // makes it sense to apply tabsettings
{
- UINT32 i, nDefaultTab, nTab, nTextOfs2 = 0;
- UINT32 nLatestManTab = 0;
+ sal_uInt32 i, nDefaultTab, nTab, nTextOfs2 = 0;
+ sal_uInt32 nLatestManTab = 0;
GetAttrib( PPT_ParaAttr_TextOfs, nTextOfs2, nDestinationInstance );
GetAttrib( PPT_ParaAttr_BulletOfs, nTab, nDestinationInstance );
GetAttrib( PPT_ParaAttr_BulletOn, i, nDestinationInstance );
@@ -6166,7 +6166,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
default : eTabAdjust = SVX_TAB_ADJUST_LEFT;
}
if ( nTab > nTextOfs2 )
- aTabItem.Insert( SvxTabStop( (UINT16)( ( ( nTab - nTextOfs2 ) * 2540 ) / 576 ), eTabAdjust ) );
+ aTabItem.Insert( SvxTabStop( (sal_uInt16)( ( ( nTab - nTextOfs2 ) * 2540 ) / 576 ), eTabAdjust ) );
}
nLatestManTab = nTab;
}
@@ -6179,7 +6179,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
nTab = nDefaultTab * ( 1 + nTab );
for ( i = 0; ( i < 20 ) && ( nTab < 0x1b00 ); i++ )
{
- aTabItem.Insert( SvxTabStop( (UINT16)( ( ( nTab - nTextOfs2 ) * 2540 ) / 576 ) ) );
+ aTabItem.Insert( SvxTabStop( (sal_uInt16)( ( ( nTab - nTextOfs2 ) * 2540 ) / 576 ) ) );
nTab += nDefaultTab;
}
}
@@ -6187,10 +6187,10 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
}
}
-UINT32 PPTParagraphObj::GetTextSize()
+sal_uInt32 PPTParagraphObj::GetTextSize()
{
- UINT32 nCount, nRetValue = 0;
- for ( UINT32 i = 0; i < mnPortionCount; i++ )
+ sal_uInt32 nCount, nRetValue = 0;
+ for ( sal_uInt32 i = 0; i < mnPortionCount; i++ )
{
PPTPortionObj* pPortionObj = mpPortionList[ i ];
nCount = pPortionObj->Count();
@@ -6211,7 +6211,7 @@ PPTPortionObj* PPTParagraphObj::First()
PPTPortionObj* PPTParagraphObj::Next()
{
- UINT32 i = mnCurrentObject + 1;
+ sal_uInt32 i = mnCurrentObject + 1;
if ( i >= mnPortionCount )
return NULL;
mnCurrentObject++;
@@ -6273,7 +6273,7 @@ void PPTFieldEntry::GetDateTime( const sal_uInt32 nVal, SvxDateFormat& eDateForm
}
}
-void PPTFieldEntry::SetDateTime( UINT32 nVal )
+void PPTFieldEntry::SetDateTime( sal_uInt32 nVal )
{
SvxDateFormat eDateFormat;
SvxTimeFormat eTimeFormat;
@@ -6307,7 +6307,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
DffRecordHeader aExtParaHd;
aExtParaHd.nRecType = 0; // set empty
- UINT32 bStatus = TRUE;
+ sal_uInt32 bStatus = sal_True;
DffRecordHeader aShapeContainerHd;
rIn >> aShapeContainerHd;
@@ -6324,7 +6324,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
// ClientData
if ( rSdrPowerPointImport.maShapeRecords.SeekToContent( rIn, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
{
- UINT32 nOldPos = rIn.Tell();
+ sal_uInt32 nOldPos = rIn.Tell();
DffRecordHeader& aClientDataContainerHd = *rSdrPowerPointImport.maShapeRecords.Current();
DffRecordHeader aPlaceHolderAtomHd;
if ( rSdrPowerPointImport.SeekToRec( rIn, PPT_PST_OEPlaceholderAtom, aClientDataContainerHd.GetRecEndFilePos(), &aPlaceHolderAtomHd ) )
@@ -6344,7 +6344,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
if ( rSdrPowerPointImport.maShapeRecords.SeekToContent( rIn, DFF_msofbtClientTextbox, SEEK_FROM_CURRENT_AND_RESTART ) )
{
DffRecordHeader aClientTextBoxHd( *rSdrPowerPointImport.maShapeRecords.Current() );
- UINT32 nTextRulerAtomOfs = 0; // case of zero -> this atom may be found in aClientDataContainerHd;
+ sal_uInt32 nTextRulerAtomOfs = 0; // case of zero -> this atom may be found in aClientDataContainerHd;
// case of -1 -> ther is no atom of this kind
// else -> this is the fileofs where we can get it
@@ -6355,7 +6355,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
DffRecordHeader aTextHd;
if ( rSdrPowerPointImport.SeekToRec( rIn, PPT_PST_OutlineTextRefAtom, aClientTextBoxHd.GetRecEndFilePos(), &aTextHd ) )
{
- UINT32 nRefNum;
+ sal_uInt32 nRefNum;
rIn >> nRefNum;
if ( rSdrPowerPointImport.SeekToRec( rIn, PPT_PST_TextRulerAtom, aClientTextBoxHd.GetRecEndFilePos() ) )
@@ -6363,7 +6363,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
else
nTextRulerAtomOfs = 0xffffffff;
- UINT32 nInstance = 0;
+ sal_uInt32 nInstance = 0;
switch( rSdrPowerPointImport.eAktPageKind )
{
case PPT_NOTEPAGE :
@@ -6373,18 +6373,18 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
case PPT_SLIDEPAGE :
break;
default :
- bStatus = FALSE;
+ bStatus = sal_False;
}
if ( bStatus )
{
sal_uInt32 nSlideId = rSdrPowerPointImport.GetAktPageId();
if ( !nSlideId )
- bStatus = FALSE;
+ bStatus = sal_False;
else
{
if ( !aExtParaHd.nRecType )
{
- UINT32 nOldPos = rIn.Tell();
+ sal_uInt32 nOldPos = rIn.Tell();
// try to locate the referenced ExtendedParaHd
DffRecordHeader* pHd = pExtParaProv->
aExtendedPresRules.GetRecordHeader( PPT_PST_ExtendedParagraphHeaderAtom,
@@ -6392,7 +6392,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
DffRecordHeader aPresRuleHd;
DffRecordHeader* pFirst = pHd;
- UINT32 nTmpSlideId, nTmpRef;
+ sal_uInt32 nTmpSlideId, nTmpRef;
while ( pHd )
{
pHd->SeekToContent( rIn );
@@ -6443,7 +6443,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
aClientTextBoxHd.SeekToEndOfRecord( rIn );
}
if ( rIn.Tell() > pE->nSlidePersistEndOffset )
- bStatus = FALSE;
+ bStatus = sal_False;
else
{ // patching the RecordHeader
aClientTextBoxHd.nFilePos -= DFF_COMMON_RECORD_HEADER_SIZE;
@@ -6473,14 +6473,14 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
if ( rSdrPowerPointImport.SeekToRec( rIn, PPT_PST_TextHeaderAtom, aClientTextBoxHd.GetRecEndFilePos(), &aTextHd ) )
{
// TextHeaderAtom is always the first Atom
- UINT16 nInstance;
+ sal_uInt16 nInstance;
rIn >> nInstance; // this number tells us the TxMasterStyleAtom Instance
if ( nInstance > 8 )
nInstance = 4;
aTextHd.SeekToEndOfRecord( rIn );
mpImplTextObj->mnInstance = nInstance;
- UINT32 nFilePos = rIn.Tell();
+ sal_uInt32 nFilePos = rIn.Tell();
if ( rSdrPowerPointImport.SeekToRec2( PPT_PST_TextBytesAtom,
PPT_PST_TextCharsAtom,
aClientTextBoxHd.GetRecEndFilePos() )
@@ -6562,7 +6562,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
while ( rIn.Tell() < aClientTextBoxHd.GetRecEndFilePos() )
{
rIn >> aTextHd;
- UINT16 nVal = 0;
+ sal_uInt16 nVal = 0;
PPTFieldEntry* pEntry = NULL;
switch ( aTextHd.nRecType )
{
@@ -6644,7 +6644,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
sal_Unicode n;
xub_StrLen nLen;
String aStr;
- bool inquote = FALSE;
+ bool inquote = sal_False;
for (nLen = 0, n = 0; nLen < 64; nLen++)
{
rIn >> n;
@@ -6732,13 +6732,13 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
{
if ( !pFieldList )
pFieldList = new List;
- UINT32 n;
+ sal_uInt32 n;
for ( n = 0; n < pFieldList->Count(); n++ )
{ // sorting fields ( hi >> lo )
if ( ( (PPTFieldEntry*)pFieldList->GetObject( n ) )->nPos < pEntry->nPos )
break;
}
- pFieldList->Insert( pEntry, (UINT32)n );
+ pFieldList->Insert( pEntry, (sal_uInt32)n );
}
}
if ( pFieldList )
@@ -6755,8 +6755,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
{
PPTCharPropSet* pSet = (PPTCharPropSet*)aCharPropList.GetObject( n );
String aString( pSet->maString );
- UINT32 nCount = aString.Len();
- UINT32 nPos = pSet->mnOriginalTextPos + nCount;
+ sal_uInt32 nCount = aString.Len();
+ sal_uInt32 nPos = pSet->mnOriginalTextPos + nCount;
while ( pFE && nCount-- )
{
nPos--;
@@ -6769,12 +6769,12 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
{
if ( aString.GetChar( (sal_uInt16)nCount ) == 0x2a )
{
- UINT32 nBehind = aString.Len() - ( nCount + 1 );
+ sal_uInt32 nBehind = aString.Len() - ( nCount + 1 );
pSet->maString = String();
if ( nBehind )
{
PPTCharPropSet* pNewCPS = new PPTCharPropSet( *pSet );
- pNewCPS->maString = String( aString, (UINT16)nCount + 1, (UINT16)nBehind );
+ pNewCPS->maString = String( aString, (sal_uInt16)nCount + 1, (sal_uInt16)nBehind );
aCharPropList.Insert( pNewCPS, n + 1 );
}
if ( pFE->pField2 )
@@ -6790,7 +6790,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
if ( nCount )
{
PPTCharPropSet* pNewCPS = new PPTCharPropSet( *pSet );
- pNewCPS->maString = String( aString, (UINT16)0, (UINT16)nCount );
+ pNewCPS->maString = String( aString, (sal_uInt16)0, (sal_uInt16)nCount );
aCharPropList.Insert( pNewCPS, n++ );
}
if ( pFE->pField1 )
@@ -6811,7 +6811,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
if ( nCount )
{
pBefCPS = new PPTCharPropSet( *pSet );
- pSet->maString = String( pSet->maString, (UINT16)nCount, (UINT16)( pSet->maString.Len() - nCount ) );
+ pSet->maString = String( pSet->maString, (sal_uInt16)nCount, (sal_uInt16)( pSet->maString.Len() - nCount ) );
}
sal_uInt32 nIdx = n;
sal_Int32 nHyperLenLeft = nHyperLen;
@@ -6859,9 +6859,9 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
else
{
PPTCharPropSet* pNewCPS = new PPTCharPropSet( *pCurrent );
- pNewCPS->maString = String( pCurrent->maString, (UINT16)nHyperLenLeft, (UINT16)( nNextStringLen - nHyperLenLeft ) );
+ pNewCPS->maString = String( pCurrent->maString, (sal_uInt16)nHyperLenLeft, (sal_uInt16)( nNextStringLen - nHyperLenLeft ) );
aCharPropList.Insert( pNewCPS, nIdx + 1 );
- String aRepresentation( pCurrent->maString, 0, (UINT16)nHyperLenLeft );
+ String aRepresentation( pCurrent->maString, 0, (sal_uInt16)nHyperLenLeft );
pCurrent->mpFieldItem = new SvxFieldItem( SvxURLField( pField->GetURL(), aRepresentation, SVXURLFORMAT_REPR ), EE_FEATURE_FIELD );
nHyperLenLeft = 0;
}
@@ -6874,7 +6874,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
if ( pBefCPS )
{
- pBefCPS->maString = String( aString, (UINT16)0, (UINT16)nCount );
+ pBefCPS->maString = String( aString, (sal_uInt16)0, (sal_uInt16)nCount );
aCharPropList.Insert( pBefCPS, n++ );
}
@@ -6892,7 +6892,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
}
mpImplTextObj->mpParagraphList = new PPTParagraphObj*[ nParagraphs ];
aStyleTextPropReader.aCharPropList.First();
- UINT32 nCount = 0;
+ sal_uInt32 nCount = 0;
for ( void* pPtr = aStyleTextPropReader.aParaPropList.First();
pPtr;
pPtr = aStyleTextPropReader.aParaPropList.Next() )
@@ -6941,7 +6941,7 @@ PPTParagraphObj* PPTTextObj::First()
PPTParagraphObj* PPTTextObj::Next()
{
- UINT32 i = mpImplTextObj->mnCurrentObject + 1;
+ sal_uInt32 i = mpImplTextObj->mnCurrentObject + 1;
if ( i >= mpImplTextObj->mnParagraphCount )
return NULL;
mpImplTextObj->mnCurrentObject++;
@@ -7252,8 +7252,8 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell )
com::sun::star::awt::Gradient aGradient;
aGradient.Style = (awt::GradientStyle) aXGradient.GetGradientStyle();
- aGradient.StartColor = (INT32)aXGradient.GetStartColor().GetColor();
- aGradient.EndColor = (INT32)aXGradient.GetEndColor().GetColor();
+ aGradient.StartColor = (sal_Int32)aXGradient.GetStartColor().GetColor();
+ aGradient.EndColor = (sal_Int32)aXGradient.GetEndColor().GetColor();
aGradient.Angle = (short)aXGradient.GetAngle();
aGradient.Border = aXGradient.GetBorder();
aGradient.XOffset = aXGradient.GetXOffset();
@@ -7382,7 +7382,7 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
std::set< sal_Int32 > aRows;
std::set< sal_Int32 > aColumns;
- SdrObjListIter aGroupIter( *pSubList, IM_DEEPNOGROUPS, FALSE );
+ SdrObjListIter aGroupIter( *pSubList, IM_DEEPNOGROUPS, sal_False );
while( aGroupIter.IsMore() )
{
const SdrObject* pObj( aGroupIter.Next() );
diff --git a/filter/source/msfilter/svxmsbas.cxx b/filter/source/msfilter/svxmsbas.cxx
index f4bf514e3ca4..d684835b5429 100644
--- a/filter/source/msfilter/svxmsbas.cxx
+++ b/filter/source/msfilter/svxmsbas.cxx
@@ -87,8 +87,8 @@ void SvxImportMSVBasic::extractAttribute( const String& rAttribute, const String
}
int SvxImportMSVBasic::Import( const String& rStorageName,
- const String &rSubStorageName,
- BOOL bAsComment, BOOL bStripped )
+ const String &rSubStorageName,
+ sal_Bool bAsComment, sal_Bool bStripped )
{
std::vector< String > codeNames;
return Import( rStorageName, rSubStorageName, codeNames, bAsComment, bStripped );
@@ -96,7 +96,7 @@ int SvxImportMSVBasic::Import( const String& rStorageName,
int SvxImportMSVBasic::Import( const String& rStorageName,
const String &rSubStorageName,
const std::vector< String >& codeNames,
- BOOL bAsComment, BOOL bStripped )
+ sal_Bool bAsComment, sal_Bool bStripped )
{
msProjectName = rtl::OUString();
int nRet = 0;
@@ -159,7 +159,7 @@ bool SvxImportMSVBasic::ImportForms_Impl( VBA_Impl& rVBA, const String& rStorage
std::vector<String> aUserForms;
SvStorageInfoList aContents;
xVBAStg->FillInfoList(&aContents);
- for (USHORT nI = 0; nI < aContents.Count(); ++nI)
+ for (sal_uInt16 nI = 0; nI < aContents.Count(); ++nI)
{
SvStorageInfo& rInfo = aContents.GetObject(nI);
if (!rInfo.IsStream() && rInfo.GetName() != rSubStorageName)
@@ -170,7 +170,6 @@ bool SvxImportMSVBasic::ImportForms_Impl( VBA_Impl& rVBA, const String& rStorage
return false;
bool bRet = true;
- SFX_APP()->EnterBasicCall();
try
{
Reference<XMultiServiceFactory> xSF(comphelper::getProcessServiceFactory());
@@ -251,15 +250,14 @@ bool SvxImportMSVBasic::ImportForms_Impl( VBA_Impl& rVBA, const String& rStorage
DBG_ERRORFILE( "SvxImportMSVBasic::ImportForms_Impl - any exception caught" );
//bRet = false;
}
- SFX_APP()->LeaveBasicCall();
return bRet;
}
-BOOL SvxImportMSVBasic::CopyStorage_Impl( const String& rStorageName,
+sal_Bool SvxImportMSVBasic::CopyStorage_Impl( const String& rStorageName,
const String& rSubStorageName)
{
- BOOL bValidStg = FALSE;
+ sal_Bool bValidStg = sal_False;
{
SvStorageRef xVBAStg( xRoot->OpenSotStorage( rStorageName,
STREAM_READWRITE | STREAM_NOCREATE |
@@ -272,7 +270,7 @@ BOOL SvxImportMSVBasic::CopyStorage_Impl( const String& rStorageName,
if( xVBASubStg.Is() && !xVBASubStg->GetError() )
{
// then we will copy these storages into the (temporary) storage of the document
- bValidStg = TRUE;
+ bValidStg = sal_True;
}
}
}
@@ -292,18 +290,18 @@ BOOL SvxImportMSVBasic::CopyStorage_Impl( const String& rStorageName,
if ( nError != ERRCODE_NONE )
xRoot->SetError( nError );
else
- bValidStg = TRUE;
+ bValidStg = sal_True;
}
return bValidStg;
}
-BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
+sal_Bool SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
const String &rSubStorageName,
const std::vector< String >& codeNames,
- BOOL bAsComment, BOOL bStripped )
+ sal_Bool bAsComment, sal_Bool bStripped )
{
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
VBA_Impl aVBA( *xRoot, bAsComment );
if( aVBA.Open(rStorageName,rSubStorageName) )
@@ -333,24 +331,21 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
BOOL SvxImportMSVBasic::ImportCode_Impl( VBA_Impl& aVBA, const std::vector< String >& codeNames, BOOL bAsComment, BOOL bStripped )
{
BOOL bRet = FALSE;
- SFX_APP()->EnterBasicCall();
Reference<XLibraryContainer> xLibContainer = rDocSh.GetBasicContainer();
DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" );
+ /* Set library container to VBA compatibility mode. This will create
+ the VBA Globals object and store it in the Basic manager of the
+ document. */
if( !bAsComment ) try
{
- Reference< vba::XVBACompatibility > xVBACompat( xLibContainer, UNO_QUERY_THROW );
- xVBACompat->setVBACompatibilityMode( sal_True );
- /* Force creation of the VBAGlobals object, each application will
- create the right one and store it at the Basic manager. */
- Reference< XMultiServiceFactory > xFactory( rDocSh.GetModel(), UNO_QUERY_THROW );
- xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAGlobals" ) ) );
+ Reference< vba::XVBACompatibility >( xLibContainer, UNO_QUERY_THROW )->setVBACompatibilityMode( sal_True );
}
catch( Exception& )
{
}
- UINT16 nStreamCount = aVBA.GetNoStreams();
+ sal_uInt16 nStreamCount = aVBA.GetNoStreams();
Reference<XNameContainer> xLib;
String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
if ( aVBA.ProjectName().getLength() )
@@ -387,7 +382,7 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( VBA_Impl& aVBA, const std::vector< Stri
NameModuleDataHash moduleData;
NameModuleInfoHash moduleInfos;
- for( UINT16 i=0; i<nStreamCount;i++)
+ for( sal_uInt16 i=0; i<nStreamCount;i++)
{
StringArray aDecompressed = aVBA.Decompress(i);
#if 0
@@ -475,7 +470,7 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( VBA_Impl& aVBA, const std::vector< Stri
};
::rtl::OUString aSource(sTemp);
- for(ULONG j=0;j<aDecompressed.GetSize();j++)
+ for(sal_uLong j=0;j<aDecompressed.GetSize();j++)
{
if (bStripped)
{
@@ -585,7 +580,6 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( VBA_Impl& aVBA, const std::vector< Stri
}
bRet = true;
}
- SFX_APP()->LeaveBasicCall();
return bRet;
}
diff --git a/filter/source/msfilter/svxmsbas2.cxx b/filter/source/msfilter/svxmsbas2.cxx
index fb962f1a0b5c..895df5cc2a5d 100644
--- a/filter/source/msfilter/svxmsbas2.cxx
+++ b/filter/source/msfilter/svxmsbas2.cxx
@@ -36,10 +36,10 @@
using namespace com::sun::star;
-ULONG SvxImportMSVBasic::SaveOrDelMSVBAStorage( BOOL bSaveInto,
+sal_uLong SvxImportMSVBasic::SaveOrDelMSVBAStorage( sal_Bool bSaveInto,
const String& rStorageName )
{
- ULONG nRet = ERRCODE_NONE;
+ sal_uLong nRet = ERRCODE_NONE;
uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() );
String aDstStgName( GetMSBasicStorageName() );
SotStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, aDstStgName,
@@ -70,7 +70,7 @@ ULONG SvxImportMSVBasic::SaveOrDelMSVBAStorage( BOOL bSaveInto,
// check if the MS-VBA-Storage exists in the RootStorage of the DocShell.
// If it exists, then return the WarningId for losing the information.
-ULONG SvxImportMSVBasic::GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocSh)
+sal_uLong SvxImportMSVBasic::GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocSh)
{
uno::Reference < embed::XStorage > xSrcRoot( rDocSh.GetStorage() );
SvStorageRef xVBAStg( SotStorage::OpenOLEStorage( xSrcRoot, GetMSBasicStorageName(),
diff --git a/filter/source/msfilter/viscache.hxx b/filter/source/msfilter/viscache.hxx
index 6a341979688d..2ee560e097f3 100644
--- a/filter/source/msfilter/viscache.hxx
+++ b/filter/source/msfilter/viscache.hxx
@@ -32,17 +32,17 @@
class Impl_OlePres
{
- ULONG nFormat;
- USHORT nAspect;
+ sal_uLong nFormat;
+ sal_uInt16 nAspect;
Bitmap * pBmp;
GDIMetaFile * pMtf;
- UINT32 nAdvFlags;
- INT32 nJobLen;
- BYTE* pJob;
+ sal_uInt32 nAdvFlags;
+ sal_Int32 nJobLen;
+ sal_uInt8* pJob;
Size aSize; // Groesse in 100TH_MM
public:
- Impl_OlePres( ULONG nF )
+ Impl_OlePres( sal_uLong nF )
: nFormat( nF )
, pBmp( NULL )
, pMtf( NULL )
@@ -64,13 +64,13 @@ public:
}
Bitmap *GetBitmap() const { return pBmp; }
GDIMetaFile *GetMetaFile() const { return pMtf; }
- ULONG GetFormat() const { return nFormat; }
- void SetAspect( USHORT nAsp ) { nAspect = nAsp; }
- ULONG GetAdviseFlags() const { return nAdvFlags; }
- void SetAdviseFlags( ULONG nAdv ) { nAdvFlags = nAdv; }
+ sal_uLong GetFormat() const { return nFormat; }
+ void SetAspect( sal_uInt16 nAsp ) { nAspect = nAsp; }
+ sal_uLong GetAdviseFlags() const { return nAdvFlags; }
+ void SetAdviseFlags( sal_uLong nAdv ) { nAdvFlags = nAdv; }
void SetSize( const Size & rSize ) { aSize = rSize; }
- /// return FALSE => unknown format
- BOOL Read( SvStream & rStm );
+ /// return sal_False => unknown format
+ sal_Bool Read( SvStream & rStm );
void Write( SvStream & rStm );
};
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 6d48cbe6f19d..adcb7135fd45 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -34,7 +34,9 @@
#include "vcl/svapp.hxx"
#include "vcl/msgbox.hxx"
#include "sfx2/passwd.hxx"
-#include "com/sun/star/uno/Sequence.hxx"
+
+#include "comphelper/storagehelper.hxx"
+
#include "com/sun/star/text/XTextRange.hpp"
#include "com/sun/star/drawing/XShapes.hpp"
#include "com/sun/star/container/XIndexAccess.hpp"
@@ -69,7 +71,7 @@ ImpPDFTabDialog::ImpPDFTabDialog( Window* pParent,
const Reference< XComponent >& rxDoc,
const Reference< lang::XMultiServiceFactory >& xFact
) :
- SfxTabDialog( pParent, PDFFilterResId( RID_PDF_EXPORT_DLG ), 0, FALSE, 0 ),
+ SfxTabDialog( pParent, PDFFilterResId( RID_PDF_EXPORT_DLG ), 0, sal_False, 0 ),
mxMSF( xFact ),
maConfigItem( String( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/PDF/Export/" ) ), &rFilterData ),
maConfigI18N( String( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/I18N/CTL/" ) ) ),
@@ -179,7 +181,7 @@ ImpPDFTabDialog::ImpPDFTabDialog( Window* pParent,
{
}
-//get the CTL (Complex Text Layout) from general options, returns TRUE if we have a CTL font on our hands.
+//get the CTL (Complex Text Layout) from general options, returns sal_True if we have a CTL font on our hands.
mbUseCTLFont = maConfigI18N.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "CTLFont" ) ), sal_False );
mbUseLosslessCompression = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), sal_False );
@@ -273,7 +275,7 @@ ImpPDFTabDialog::~ImpPDFTabDialog()
}
// -----------------------------------------------------------------------------
-void ImpPDFTabDialog::PageCreated( USHORT _nId,
+void ImpPDFTabDialog::PageCreated( sal_uInt16 _nId,
SfxTabPage& _rPage )
{
switch( _nId )
@@ -383,8 +385,8 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
nElementAdded--;
// add the open password
- aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "DocumentOpenPassword" ) );
- aRet[ aRet.getLength() - nElementAdded ].Value <<= OUString( msUserPassword );
+ aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PreparedPasswords" ) );
+ aRet[ aRet.getLength() - nElementAdded ].Value <<= mxPreparedPasswords;
nElementAdded--;
//the restrict permission flag (needed to have the scripting consistent with the dialog)
@@ -393,8 +395,8 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
nElementAdded--;
//add the permission password
- aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PermissionPassword" ) );
- aRet[ aRet.getLength() - nElementAdded ].Value <<= OUString( msOwnerPassword );
+ aRet[ aRet.getLength() - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PreparedPermissionPassword" ) );
+ aRet[ aRet.getLength() - nElementAdded ].Value <<= maPreparedOwnerPassword;
nElementAdded--;
// this should be the last added...
@@ -472,6 +474,10 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage( Window* pParent,
aNewPos.Y() -= nDelta;
maCbEmbedStandardFonts.SetPosPixel( aNewPos );
}
+
+ maEdPages.SetAccessibleName(maRbRange.GetText());
+ maEdPages.SetAccessibleRelationLabeledBy(&maRbRange);
+
maCbExportEmptyPages.SetStyle( maCbExportEmptyPages.GetStyle() | WB_VCENTER );
}
@@ -523,7 +529,7 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent
switch( paParent->mnPDFTypeSelection )
{
default:
- case 0: maCbPDFA1b.Check( FALSE ); // PDF 1.4
+ case 0: maCbPDFA1b.Check( sal_False ); // PDF 1.4
break;
case 1: maCbPDFA1b.Check(); // PDF/A-1a
break;
@@ -555,7 +561,7 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent
if ( mbIsPresentation )
{
- maCbExportNotesPages.Show( TRUE );
+ maCbExportNotesPages.Show( sal_True );
maCbExportNotesPages.Check( paParent->mbExportNotesPages );
}
else
@@ -569,8 +575,8 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent
maCbAddStream.SetPosPixel( Point( aPos.X(), aPos.Y() - nCheckBoxHeight ) );
aPos = maCbEmbedStandardFonts.GetPosPixel();
maCbEmbedStandardFonts.SetPosPixel( Point( aPos.X(), aPos.Y() - nCheckBoxHeight ) );
- maCbExportNotesPages.Show( FALSE );
- maCbExportNotesPages.Check( FALSE );
+ maCbExportNotesPages.Show( sal_False );
+ maCbExportNotesPages.Check( sal_False );
}
maCbExportEmptyPages.Check( !paParent->mbIsSkipEmptyPages );
@@ -583,13 +589,13 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent
}
if( xIfc.is() )
{
- maCbAddStream.Show( TRUE );
+ maCbAddStream.Show( sal_True );
maCbAddStream.Check( paParent->mbAddStream );
}
else
{
- maCbAddStream.Show( FALSE );
- maCbAddStream.Check( FALSE );
+ maCbAddStream.Show( sal_False );
+ maCbAddStream.Check( sal_False );
}
maCbAddStream.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleAddStreamHdl ) );
// init addstream dependencies
@@ -657,7 +663,8 @@ SfxTabPage* ImpPDFTabGeneralPage::Create( Window* pParent,
IMPL_LINK( ImpPDFTabGeneralPage, TogglePagesHdl, void*, EMPTYARG )
{
maEdPages.Enable( maRbRange.IsChecked() );
- maEdPages.SetReadOnly( !maRbRange.IsChecked() );
+ //Sym2_5805, When the control is disabled, it is also readonly. So here, it is not necessary to set it as readonly.
+ //maEdPages.SetReadOnly( !maRbRange.IsChecked() );
return 0;
}
@@ -691,17 +698,18 @@ IMPL_LINK( ImpPDFTabGeneralPage, ToggleAddStreamHdl, void*, EMPTYARG )
if( maCbAddStream.IsChecked() )
{
maRbAll.Check();
- maRbRange.Enable( FALSE );
- maRbSelection.Enable( FALSE );
- maEdPages.Enable( FALSE );
- maEdPages.SetReadOnly( TRUE );
- maRbAll.Enable( FALSE );
+ maRbRange.Enable( sal_False );
+ maRbSelection.Enable( sal_False );
+ maEdPages.Enable( sal_False );
+ //Sym2_5805, When the control is disabled, it is also readonly. So here, it is not necessary to set it as readonly.
+ //maEdPages.SetReadOnly( sal_True );
+ maRbAll.Enable( sal_False );
}
else
{
- maRbAll.Enable( TRUE );
- maRbRange.Enable( TRUE );
- maRbSelection.Enable( TRUE );
+ maRbAll.Enable( sal_True );
+ maRbRange.Enable( sal_True );
+ maRbSelection.Enable( sal_True );
}
}
return 0;
@@ -710,9 +718,13 @@ IMPL_LINK( ImpPDFTabGeneralPage, ToggleAddStreamHdl, void*, EMPTYARG )
// -----------------------------------------------------------------------------
IMPL_LINK( ImpPDFTabGeneralPage, ToggleExportPDFAHdl, void*, EMPTYARG )
{
+ ImpPDFTabSecurityPage* pSecPage = NULL;
//set the security page status (and its controls as well)
if( mpaParent && mpaParent->GetTabPage( RID_PDF_TAB_SECURITY ) )
- ( ( ImpPDFTabSecurityPage* )mpaParent->GetTabPage( RID_PDF_TAB_SECURITY ) )->ImplPDFASecurityControl( !maCbPDFA1b.IsChecked() );
+ {
+ pSecPage = static_cast<ImpPDFTabSecurityPage*>(mpaParent->GetTabPage( RID_PDF_TAB_SECURITY ));
+ pSecPage->ImplPDFASecurityControl( !maCbPDFA1b.IsChecked() );
+ }
//PDF/A-1 needs tagged PDF, so force disable the control, will be forced in pdfexport.
sal_Bool bPDFA1Sel = maCbPDFA1b.IsChecked();
@@ -747,6 +759,13 @@ IMPL_LINK( ImpPDFTabGeneralPage, ToggleExportPDFAHdl, void*, EMPTYARG )
if( mpaParent && mpaParent->GetTabPage( RID_PDF_TAB_LINKS ) )
( ( ImpPDFTabLinksPage* )mpaParent->GetTabPage( RID_PDF_TAB_LINKS ) )->ImplPDFALinkControl( !maCbPDFA1b.IsChecked() );
+ // if a password was set, inform the user that this will not be used in PDF/A case
+ if( maCbPDFA1b.IsChecked() && pSecPage && pSecPage->hasPassword() )
+ {
+ WarningBox aBox( this, PDFFilterResId( RID_PDF_WARNPDFAPASSWORD ) );
+ aBox.Execute();
+ }
+
return 0;
}
@@ -787,6 +806,8 @@ ImpPDFTabOpnFtrPage::ImpPDFTabOpnFtrPage( Window* pParent,
maRbMagnFitWidth.SetToggleHdl( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
maRbMagnFitVisible.SetToggleHdl( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
maRbMagnZoom.SetToggleHdl( LINK( this, ImpPDFTabOpnFtrPage, ToggleRbMagnHdl ) );
+ maNumZoom.SetAccessibleName(maRbMagnZoom.GetText());
+ maNumZoom.SetAccessibleRelationLabeledBy(&maRbMagnZoom);
}
// -----------------------------------------------------------------------------
@@ -876,23 +897,23 @@ void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent
default:
case 0:
maRbMagnDefault.Check();
- maNumZoom.Enable( FALSE );
+ maNumZoom.Enable( sal_False );
break;
case 1:
maRbMagnFitWin.Check();
- maNumZoom.Enable( FALSE );
+ maNumZoom.Enable( sal_False );
break;
case 2:
maRbMagnFitWidth.Check();
- maNumZoom.Enable( FALSE );
+ maNumZoom.Enable( sal_False );
break;
case 3:
maRbMagnFitVisible.Check();
- maNumZoom.Enable( FALSE );
+ maNumZoom.Enable( sal_False );
break;
case 4:
maRbMagnZoom.Check();
- maNumZoom.Enable( TRUE );
+ maNumZoom.Enable( sal_True );
break;
};
@@ -909,9 +930,8 @@ void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent
}
}
-IMPL_LINK( ImpPDFTabOpnFtrPage, ToggleRbPgLyContinueFacingHdl, void*, p )
+IMPL_LINK( ImpPDFTabOpnFtrPage, ToggleRbPgLyContinueFacingHdl, void*, EMPTYARG )
{
- p = p; //for compiler warning
maCbPgLyFirstOnLeft.Enable( maRbPgLyContinueFacing.IsChecked() );
return 0;
}
@@ -950,6 +970,8 @@ ImpPDFTabViewerPage::ImpPDFTabViewerPage( Window* pParent,
FreeResource();
maRbAllBookmarkLevels.SetToggleHdl( LINK( this, ImpPDFTabViewerPage, ToggleRbBookmarksHdl ) );
maRbVisibleBookmarkLevels.SetToggleHdl( LINK( this, ImpPDFTabViewerPage, ToggleRbBookmarksHdl ) );
+ maNumBookmarkLevels.SetAccessibleName(maRbVisibleBookmarkLevels.GetText());
+ maNumBookmarkLevels.SetAccessibleRelationLabeledBy(&maRbVisibleBookmarkLevels);
}
// -----------------------------------------------------------------------------
@@ -1001,13 +1023,13 @@ void ImpPDFTabViewerPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent
maCbTransitionEffects.Enable( mbIsPresentation );
if( paParent->mnOpenBookmarkLevels < 0 )
{
- maRbAllBookmarkLevels.Check( TRUE );
- maNumBookmarkLevels.Enable( FALSE );
+ maRbAllBookmarkLevels.Check( sal_True );
+ maNumBookmarkLevels.Enable( sal_False );
}
else
{
- maRbVisibleBookmarkLevels.Check( TRUE );
- maNumBookmarkLevels.Enable( TRUE );
+ maRbVisibleBookmarkLevels.Check( sal_True );
+ maNumBookmarkLevels.Enable( sal_True );
maNumBookmarkLevels.SetValue( paParent->mnOpenBookmarkLevels );
}
}
@@ -1018,15 +1040,18 @@ void ImpPDFTabViewerPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent
ImpPDFTabSecurityPage::ImpPDFTabSecurityPage( Window* i_pParent,
const SfxItemSet& i_rCoreSet ) :
SfxTabPage( i_pParent, PDFFilterResId( RID_PDF_TAB_SECURITY ), i_rCoreSet ),
- maPbUserPwd( this, PDFFilterResId( BTN_USER_PWD ) ),
+ maFlGroup( this, PDFFilterResId( FL_PWD_GROUP ) ),
+ maPbSetPwd( this, PDFFilterResId( BTN_SET_PWD ) ),
maFtUserPwd( this, PDFFilterResId( FT_USER_PWD ) ),
maUserPwdSet( PDFFilterResId( STR_USER_PWD_SET ) ),
maUserPwdUnset( PDFFilterResId( STR_USER_PWD_UNSET ) ),
+ maUserPwdPdfa( PDFFilterResId( STR_USER_PWD_PDFA ) ),
- maPbOwnerPwd( this, PDFFilterResId( BTN_OWNER_PWD ) ),
+ maStrSetPwd( PDFFilterResId( STR_SET_PWD ) ),
maFtOwnerPwd( this, PDFFilterResId( FT_OWNER_PWD ) ),
maOwnerPwdSet( PDFFilterResId( STR_OWNER_PWD_SET ) ),
maOwnerPwdUnset( PDFFilterResId( STR_OWNER_PWD_UNSET ) ),
+ maOwnerPwdPdfa( PDFFilterResId( STR_OWNER_PWD_PDFA ) ),
maFlPrintPermissions( this, PDFFilterResId( FL_PRINT_PERMISSIONS ) ),
maRbPrintNone( this, PDFFilterResId( RB_PRINT_NONE ) ),
@@ -1044,6 +1069,8 @@ ImpPDFTabSecurityPage::ImpPDFTabSecurityPage( Window* i_pParent,
maCbEnableAccessibility( this, PDFFilterResId( CB_ENAB_ACCESS ) ),
msUserPwdTitle( PDFFilterResId( STR_PDF_EXPORT_UDPWD ) ),
+ mbHaveOwnerPassword( false ),
+ mbHaveUserPassword( false ),
msOwnerPwdTitle( PDFFilterResId( STR_PDF_EXPORT_ODPWD ) )
{
@@ -1082,6 +1109,8 @@ ImpPDFTabSecurityPage::ImpPDFTabSecurityPage( Window* i_pParent,
(*pCurrent++)->SetPosPixel( aNewPos );
}
}
+
+ maPbSetPwd.SetClickHdl( LINK( this, ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl ) );
}
// -----------------------------------------------------------------------------
@@ -1101,13 +1130,11 @@ void ImpPDFTabSecurityPage::GetFilterConfigItem( ImpPDFTabDialog* paParent )
{
// please note that in PDF/A-1a mode even if this are copied back,
// the security settings are forced disabled in PDFExport::Export
- paParent->mbEncrypt = (msUserPassword.Len() > 0);
- if( paParent->mbEncrypt )
- paParent->msUserPassword = msUserPassword;
+ paParent->mbEncrypt = mbHaveUserPassword;
+ paParent->mxPreparedPasswords = mxPreparedPasswords;
- paParent->mbRestrictPermissions = (msOwnerPassword.Len() > 0);
- if( msOwnerPassword.Len() > 0 )
- paParent->msOwnerPassword = msOwnerPassword;
+ paParent->mbRestrictPermissions = mbHaveOwnerPassword;
+ paParent->maPreparedOwnerPassword = maPreparedOwnerPassword;
//verify print status
paParent->mnPrint = 0;
@@ -1136,10 +1163,6 @@ void ImpPDFTabSecurityPage::GetFilterConfigItem( ImpPDFTabDialog* paParent )
// -----------------------------------------------------------------------------
void ImpPDFTabSecurityPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent )
{
- maPbUserPwd.SetClickHdl( LINK( this, ImpPDFTabSecurityPage, ClickmaPbUserPwdHdl ) );
-
- maPbOwnerPwd.SetClickHdl( LINK( this, ImpPDFTabSecurityPage, ClickmaPbOwnerPwdHdl ) );
-
switch( paParent->mnPrint )
{
default:
@@ -1185,40 +1208,56 @@ void ImpPDFTabSecurityPage::SetFilterConfigItem( const ImpPDFTabDialog* paParen
!( ( ImpPDFTabGeneralPage* )paParent->GetTabPage( RID_PDF_TAB_GENER ) )->IsPdfaSelected() );
}
-//method common to both the password entry procedures
-void ImpPDFTabSecurityPage::ImplPwdPushButton( const String & i_rDlgTitle, String & io_rDestPassword )
+IMPL_LINK( ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl, void*, EMPTYARG )
{
-// string needed: dialog title, message box text, depending on the button clicked
- SfxPasswordDialog aPwdDialog( this );
+ SfxPasswordDialog aPwdDialog( this, &msUserPwdTitle );
aPwdDialog.SetMinLen( 0 );
- aPwdDialog.ShowExtras( SHOWEXTRAS_CONFIRM );
- aPwdDialog.SetText( i_rDlgTitle );
+ aPwdDialog.ShowExtras( SHOWEXTRAS_CONFIRM | SHOWEXTRAS_PASSWORD2 | SHOWEXTRAS_CONFIRM2 );
+ aPwdDialog.SetText( maStrSetPwd );
+ aPwdDialog.SetGroup2Text( msOwnerPwdTitle );
aPwdDialog.AllowAsciiOnly();
if( aPwdDialog.Execute() == RET_OK ) //OK issued get password and set it
- io_rDestPassword = aPwdDialog.GetPassword();
- enablePermissionControls();
-}
+ {
+ rtl::OUString aUserPW( aPwdDialog.GetPassword() );
+ rtl::OUString aOwnerPW( aPwdDialog.GetPassword2() );
-IMPL_LINK( ImpPDFTabSecurityPage, ClickmaPbUserPwdHdl, void*, EMPTYARG )
-{
- ImplPwdPushButton(msUserPwdTitle, msUserPassword );
- return 0;
-}
+ mbHaveUserPassword = (aUserPW.getLength() != 0);
+ mbHaveOwnerPassword = (aOwnerPW.getLength() != 0);
-IMPL_LINK( ImpPDFTabSecurityPage, ClickmaPbOwnerPwdHdl, void*, EMPTYARG )
-{
- ImplPwdPushButton( msOwnerPwdTitle, msOwnerPassword );
+ mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, aUserPW, true );
+
+ if( mbHaveOwnerPassword )
+ {
+ maPreparedOwnerPassword = comphelper::OStorageHelper::CreatePackageEncryptionData( aOwnerPW );
+ }
+ else
+ maPreparedOwnerPassword = Sequence< NamedValue >();
+ // trash clear text passwords string memory
+ rtl_zeroMemory( (void*)aUserPW.getStr(), aUserPW.getLength() );
+ rtl_zeroMemory( (void*)aOwnerPW.getStr(), aOwnerPW.getLength() );
+ }
+ enablePermissionControls();
return 0;
}
void ImpPDFTabSecurityPage::enablePermissionControls()
{
- maFtUserPwd.SetText( (msUserPassword.Len() > 0 && IsEnabled()) ? maUserPwdSet : maUserPwdUnset );
-
- sal_Bool bLocalEnable = (msOwnerPassword.Len() > 0) && IsEnabled();
+ sal_Bool bIsPDFASel = sal_False;
+ ImpPDFTabDialog* pParent = static_cast<ImpPDFTabDialog*>(GetTabDialog());
+ if( pParent && pParent->GetTabPage( RID_PDF_TAB_GENER ) )
+ bIsPDFASel = ( ( ImpPDFTabGeneralPage* )pParent->
+ GetTabPage( RID_PDF_TAB_GENER ) )->IsPdfaSelected();
+ if( bIsPDFASel )
+ maFtUserPwd.SetText( maUserPwdPdfa );
+ else
+ maFtUserPwd.SetText( (mbHaveUserPassword && IsEnabled()) ? maUserPwdSet : maUserPwdUnset );
- maFtOwnerPwd.SetText( bLocalEnable ? maOwnerPwdSet : maOwnerPwdUnset );
+ sal_Bool bLocalEnable = mbHaveOwnerPassword && IsEnabled();
+ if( bIsPDFASel )
+ maFtOwnerPwd.SetText( maOwnerPwdPdfa );
+ else
+ maFtOwnerPwd.SetText( bLocalEnable ? maOwnerPwdSet : maOwnerPwdUnset );
maFlPrintPermissions.Enable( bLocalEnable );
maRbPrintNone.Enable( bLocalEnable );
@@ -1470,28 +1509,28 @@ ImplErrorDialog::ImplErrorDialog( const std::set< vcl::PDFWriter::ErrorCode >& r
{
case vcl::PDFWriter::Warning_Transparency_Omitted_PDFA:
{
- USHORT nPos = maErrors.InsertEntry( String( PDFFilterResId( STR_WARN_TRANSP_PDFA_SHORT ) ),
+ sal_uInt16 nPos = maErrors.InsertEntry( String( PDFFilterResId( STR_WARN_TRANSP_PDFA_SHORT ) ),
aWarnImg );
maErrors.SetEntryData( nPos, new String( PDFFilterResId( STR_WARN_TRANSP_PDFA ) ) );
}
break;
case vcl::PDFWriter::Warning_Transparency_Omitted_PDF13:
{
- USHORT nPos = maErrors.InsertEntry( String( PDFFilterResId( STR_WARN_TRANSP_VERSION_SHORT ) ),
+ sal_uInt16 nPos = maErrors.InsertEntry( String( PDFFilterResId( STR_WARN_TRANSP_VERSION_SHORT ) ),
aWarnImg );
maErrors.SetEntryData( nPos, new String( PDFFilterResId( STR_WARN_TRANSP_VERSION ) ) );
}
break;
case vcl::PDFWriter::Warning_FormAction_Omitted_PDFA:
{
- USHORT nPos = maErrors.InsertEntry( String( PDFFilterResId( STR_WARN_FORMACTION_PDFA_SHORT ) ),
+ sal_uInt16 nPos = maErrors.InsertEntry( String( PDFFilterResId( STR_WARN_FORMACTION_PDFA_SHORT ) ),
aWarnImg );
maErrors.SetEntryData( nPos, new String( PDFFilterResId( STR_WARN_FORMACTION_PDFA ) ) );
}
break;
case vcl::PDFWriter::Warning_Transparency_Converted:
{
- USHORT nPos = maErrors.InsertEntry( String( PDFFilterResId( STR_WARN_TRANSP_CONVERTED_SHORT ) ),
+ sal_uInt16 nPos = maErrors.InsertEntry( String( PDFFilterResId( STR_WARN_TRANSP_CONVERTED_SHORT ) ),
aWarnImg );
maErrors.SetEntryData( nPos, new String( PDFFilterResId( STR_WARN_TRANSP_CONVERTED ) ) );
}
@@ -1542,7 +1581,7 @@ ImplErrorDialog::ImplErrorDialog( const std::set< vcl::PDFWriter::ErrorCode >& r
ImplErrorDialog::~ImplErrorDialog()
{
// free strings again
- for( USHORT n = 0; n < maErrors.GetEntryCount(); n++ )
+ for( sal_uInt16 n = 0; n < maErrors.GetEntryCount(); n++ )
delete (String*)maErrors.GetEntryData( n );
}
diff --git a/filter/source/pdf/impdialog.hrc b/filter/source/pdf/impdialog.hrc
index cc438255650f..0946fe3197f8 100644
--- a/filter/source/pdf/impdialog.hrc
+++ b/filter/source/pdf/impdialog.hrc
@@ -33,6 +33,8 @@
#define RID_PDF_TAB_OPNFTR (RID_PDF_DIALOG_START + 3)
#define RID_PDF_TAB_SECURITY (RID_PDF_DIALOG_START + 4)
#define RID_PDF_TAB_LINKS (RID_PDF_DIALOG_START + 12)
+#define RID_PDF_WARNPDFAPASSWORD (RID_PDF_DIALOG_START + 6)
+
//strings
#define STR_PDF_EXPORT (RID_PDF_DIALOG_START + 5)
@@ -144,19 +146,22 @@
#define NUM_BOOKMARKLEVELS 114
//controls for security preferences tab page
-#define BTN_USER_PWD 120
+#define FL_PWD_GROUP 119
+#define BTN_SET_PWD 120
#define FT_USER_PWD 121
#define STR_USER_PWD_SET 122
#define STR_USER_PWD_ENC 123
#define STR_USER_PWD_UNSET 124
#define STR_USER_PWD_UNENC 125
+#define STR_SET_PWD 126
+#define STR_USER_PWD_PDFA 127
-#define BTN_OWNER_PWD 127
#define FT_OWNER_PWD 128
#define STR_OWNER_PWD_SET 129
#define STR_OWNER_PWD_REST 130
#define STR_OWNER_PWD_UNSET 131
#define STR_OWNER_PWD_UNREST 132
+#define STR_OWNER_PWD_PDFA 133
#define FL_PRINT_PERMISSIONS 133
#define RB_PRINT_NONE 134
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index d86994e5c935..be565eef93e6 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -45,6 +45,8 @@
#include "sfx2/tabdlg.hxx"
+#include "com/sun/star/beans/NamedValue.hpp"
+
// ----------------
// - ImpPDFDialog -
// ----------------
@@ -127,14 +129,14 @@ protected:
sal_Bool mbFirstPageLeft;
sal_Bool mbEncrypt;
- String msUserPassword;
sal_Bool mbRestrictPermissions;
- String msOwnerPassword;
+ com::sun::star::uno::Sequence< com::sun::star::beans::NamedValue > maPreparedOwnerPassword;
sal_Int32 mnPrint;
sal_Int32 mnChangesAllowed;
sal_Bool mbCanCopyOrExtract;
sal_Bool mbCanExtractForAccessibility;
+ com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder > mxPreparedPasswords;
sal_Bool mbIsRangeChecked;
String msPageRange;
@@ -164,7 +166,7 @@ public:
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& getServiceFactory() const { return mxMSF; }
protected:
- virtual void PageCreated( USHORT _nId,
+ virtual void PageCreated( sal_uInt16 _nId,
SfxTabPage& _rPage );
virtual short Ok();
};
@@ -315,15 +317,18 @@ public:
//class security tab page
class ImpPDFTabSecurityPage : public SfxTabPage
{
- PushButton maPbUserPwd;
+ FixedLine maFlGroup;
+ PushButton maPbSetPwd;
FixedText maFtUserPwd;
String maUserPwdSet;
String maUserPwdUnset;
+ String maUserPwdPdfa;
+ String maStrSetPwd;
- PushButton maPbOwnerPwd;
FixedText maFtOwnerPwd;
String maOwnerPwdSet;
String maOwnerPwdUnset;
+ String maOwnerPwdPdfa;
FixedLine maFlPrintPermissions;
RadioButton maRbPrintNone;
@@ -340,16 +345,18 @@ class ImpPDFTabSecurityPage : public SfxTabPage
CheckBox maCbEnableCopy;
CheckBox maCbEnableAccessibility;
- String msUserPassword;
String msUserPwdTitle;
- String msOwnerPassword;
+ bool mbHaveOwnerPassword;
+ bool mbHaveUserPassword;
+ com::sun::star::uno::Sequence< com::sun::star::beans::NamedValue > maPreparedOwnerPassword;
String msOwnerPwdTitle;
+ com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder > mxPreparedPasswords;
+
long nWidth;
- DECL_LINK( ClickmaPbUserPwdHdl, void* );
- DECL_LINK( ClickmaPbOwnerPwdHdl, void* );
+ DECL_LINK( ClickmaPbSetPwdHdl, void* );
void enablePermissionControls();
@@ -366,6 +373,7 @@ public:
void GetFilterConfigItem( ImpPDFTabDialog* paParent);
void SetFilterConfigItem( const ImpPDFTabDialog* paParent );
void ImplPDFASecurityControl( sal_Bool bEnableSecurity );
+ bool hasPassword() const { return mbHaveOwnerPassword || mbHaveUserPassword; }
};
//class to implement the relative link stuff
diff --git a/filter/source/pdf/impdialog.src b/filter/source/pdf/impdialog.src
index 76e64e87c173..35cfa93dd854 100644
--- a/filter/source/pdf/impdialog.src
+++ b/filter/source/pdf/impdialog.src
@@ -39,13 +39,13 @@ String STR_PDF_EXPORT
//password dialog title
String STR_PDF_EXPORT_UDPWD
{
- Text[ en-US ] = "Set Open Password";
+ Text[ en-US ] = "Set open password";
};
//password dialog title
String STR_PDF_EXPORT_ODPWD
{
- Text[ en-US ] = "Set Permission Password";
+ Text[ en-US ] = "Set permission password";
};
//////////////////////////////////////////////////////////////
@@ -65,24 +65,28 @@ TabPage RID_PDF_TAB_GENER
};
RadioButton RB_ALL
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_GENER:RB_ALL";
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "~All";
};
RadioButton RB_RANGE
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_GENER:RB_RANGE";
Pos = MAP_APPFONT ( 12 , 27 ) ;
Size = MAP_APPFONT ( 101 , 10 ) ;
Text[ en-US ] = "~Pages";
};
Edit ED_PAGES
{
+ HelpID = "filter:Edit:RID_PDF_TAB_GENER:ED_PAGES";
Border = TRUE ;
Pos = MAP_APPFONT ( 116, 26 ) ;
Size = MAP_APPFONT ( 48 , 12 ) ;
};
RadioButton RB_SELECTION
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_GENER:RB_SELECTION";
Pos = MAP_APPFONT ( 12 , 40 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "~Selection";
@@ -95,12 +99,14 @@ TabPage RID_PDF_TAB_GENER
};
RadioButton RB_LOSSLESSCOMPRESSION
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_GENER:RB_LOSSLESSCOMPRESSION";
Pos = MAP_APPFONT ( 12 , 64 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "~Lossless compression";
};
RadioButton RB_JPEGCOMPRESSION
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_GENER:RB_JPEGCOMPRESSION";
Pos = MAP_APPFONT ( 12 , 76 ) ;
Size = MAP_APPFONT ( 158, 10 ) ;
Text[ en-US ] = "~JPEG compression";
@@ -113,6 +119,7 @@ TabPage RID_PDF_TAB_GENER
};
MetricField NF_QUALITY
{
+ HelpID = "filter:MetricField:RID_PDF_TAB_GENER:NF_QUALITY";
Border = TRUE ;
Pos = MAP_APPFONT ( 116, 88 ) ;
Size = MAP_APPFONT ( 48, 12 ) ;
@@ -124,6 +131,7 @@ TabPage RID_PDF_TAB_GENER
};
CheckBox CB_REDUCEIMAGERESOLUTION
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_REDUCEIMAGERESOLUTION";
Pos = MAP_APPFONT ( 12 , 103 ) ;
Size = MAP_APPFONT ( 101 , 10 ) ;
TabStop = TRUE ;
@@ -131,6 +139,7 @@ TabPage RID_PDF_TAB_GENER
};
ComboBox CO_REDUCEIMAGERESOLUTION
{
+ HelpID = "filter:ComboBox:RID_PDF_TAB_GENER:CO_REDUCEIMAGERESOLUTION";
Pos = MAP_APPFONT ( 116 , 102 ) ;
Size = MAP_APPFONT ( 48 , 50 ) ;
TabStop = TRUE ;
@@ -152,6 +161,7 @@ TabPage RID_PDF_TAB_GENER
};
CheckBox CB_PDFA_1B_SELECT
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_PDFA_1B_SELECT";
Pos = MAP_APPFONT ( 12, 128 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -159,6 +169,7 @@ TabPage RID_PDF_TAB_GENER
};
CheckBox CB_TAGGEDPDF
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_TAGGEDPDF";
Pos = MAP_APPFONT ( 12 , 141 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -166,6 +177,7 @@ TabPage RID_PDF_TAB_GENER
};
CheckBox CB_EXPORTFORMFIELDS
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTFORMFIELDS";
Pos = MAP_APPFONT ( 12 , 154 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -179,6 +191,7 @@ TabPage RID_PDF_TAB_GENER
};
ListBox LB_FORMSFORMAT
{
+ HelpID = "filter:ListBox:RID_PDF_TAB_GENER:LB_FORMSFORMAT";
Border = TRUE ;
Pos = MAP_APPFONT ( 126, 166 ) ;
Size = MAP_APPFONT ( 38, 48 ) ;
@@ -195,6 +208,7 @@ TabPage RID_PDF_TAB_GENER
};
CheckBox CB_ALLOWDUPLICATEFIELDNAMES
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_ALLOWDUPLICATEFIELDNAMES";
Pos = MAP_APPFONT( 30, 178 );
Size = MAP_APPFONT( 128, 10 );
TabStop = TRUE;
@@ -202,6 +216,7 @@ TabPage RID_PDF_TAB_GENER
};
CheckBox CB_EXPORTBOOKMARKS
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTBOOKMARKS";
Pos = MAP_APPFONT ( 12 , 190 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -209,6 +224,7 @@ TabPage RID_PDF_TAB_GENER
};
CheckBox CB_EXPORTNOTES
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTNOTES";
Pos = MAP_APPFONT ( 12 , 203 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -216,6 +232,7 @@ TabPage RID_PDF_TAB_GENER
};
CheckBox CB_EXPORTNOTESPAGES
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTNOTESPAGES";
Pos = MAP_APPFONT ( 12 , 216 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -223,6 +240,7 @@ TabPage RID_PDF_TAB_GENER
};
CheckBox CB_EXPORTEMPTYPAGES
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTEMPTYPAGES";
Pos = MAP_APPFONT ( 12 , 229 ) ;
Size = MAP_APPFONT ( 158 , 16 ) ;
TabStop = TRUE ;
@@ -231,6 +249,7 @@ TabPage RID_PDF_TAB_GENER
};
CheckBox CB_EMBEDSTANDARDFONTS
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EMBEDSTANDARDFONTS";
Pos = MAP_APPFONT ( 12 , 248 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -238,6 +257,7 @@ TabPage RID_PDF_TAB_GENER
};
CheckBox CB_ADDSTREAM
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_ADDSTREAM";
Pos = MAP_APPFONT ( 12 , 261 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -245,6 +265,12 @@ TabPage RID_PDF_TAB_GENER
};
};
+WarningBox RID_PDF_WARNPDFAPASSWORD
+{
+ Title[en-US] = "PDF/A Export";
+ Message[ en-US ] = "PDF/A does not allow encryption. The exported PDF file will not be password protected.";
+};
+
//----------------------------------------------------------
//tab page for PDF Export, opening features
TabPage RID_PDF_TAB_OPNFTR
@@ -263,18 +289,21 @@ TabPage RID_PDF_TAB_OPNFTR
};
RadioButton RB_OPNMODE_PAGEONLY
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_OPNMODE_PAGEONLY";
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "~Page only" ;
};
RadioButton RB_OPNMODE_OUTLINE
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_OPNMODE_OUTLINE";
Pos = MAP_APPFONT ( 12 , 26 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "~Bookmarks and page" ;
};
RadioButton RB_OPNMODE_THUMBS
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_OPNMODE_THUMBS";
Pos = MAP_APPFONT ( 12 , 38 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "~Thumbnails and page" ;
@@ -288,6 +317,7 @@ TabPage RID_PDF_TAB_OPNFTR
};
NumericField NUM_MAGNF_INITIAL_PAGE
{
+ HelpID = "filter:NumericField:RID_PDF_TAB_OPNFTR:NUM_MAGNF_INITIAL_PAGE";
Pos = MAP_APPFONT( 124, 52 );
Size = MAP_APPFONT( 40, 12 );
Value = 1;
@@ -305,6 +335,7 @@ TabPage RID_PDF_TAB_OPNFTR
};
RadioButton RB_MAGNF_DEFAULT
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_MAGNF_DEFAULT";
// see PDF ref v 1.5 tab 8.2, pg. 542 ( /XYZ )
Pos = MAP_APPFONT ( 12 , 80 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
@@ -312,6 +343,7 @@ TabPage RID_PDF_TAB_OPNFTR
};
RadioButton RB_MAGNF_WIND
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_MAGNF_WIND";
// see PDF ref v 1.5 tab 8.2, pg. 542 ( /Fit )
Pos = MAP_APPFONT ( 12 , 92 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
@@ -319,6 +351,7 @@ TabPage RID_PDF_TAB_OPNFTR
};
RadioButton RB_MAGNF_WIDTH
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_MAGNF_WIDTH";
// see PDF ref v 1.5 tab 8.2, pg. 542 ( /FitH top )
Pos = MAP_APPFONT ( 12 , 104 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
@@ -326,6 +359,7 @@ TabPage RID_PDF_TAB_OPNFTR
};
RadioButton RB_MAGNF_VISIBLE
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_MAGNF_VISIBLE";
// see PDF ref v 1.5 tab 8.2, pg. 542 ( /FitBH top )
Pos = MAP_APPFONT ( 12 , 116 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
@@ -333,6 +367,7 @@ TabPage RID_PDF_TAB_OPNFTR
};
RadioButton RB_MAGNF_ZOOM
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_MAGNF_ZOOM";
// see PDF ref v 1.6 tab 8.2, pg. 551 ( /XYZ left top zoom )
Pos = MAP_APPFONT ( 12 , 128 ) ;
Size = MAP_APPFONT ( 109 , 10 ) ;
@@ -340,6 +375,7 @@ TabPage RID_PDF_TAB_OPNFTR
};
MetricField NUM_MAGNF_ZOOM
{
+ HelpID = "filter:MetricField:RID_PDF_TAB_OPNFTR:NUM_MAGNF_ZOOM";
Pos = MAP_APPFONT( 124, 128 ) ;
Size = MAP_APPFONT( 40, 12 ) ;
Unit = FUNIT_PERCENT;
@@ -358,30 +394,35 @@ TabPage RID_PDF_TAB_OPNFTR
};
RadioButton RB_PGLY_DEFAULT
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_PGLY_DEFAULT";
Pos = MAP_APPFONT ( 12 , 158 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "D~efault" ;
};
RadioButton RB_PGLY_SINGPG
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_PGLY_SINGPG";
Pos = MAP_APPFONT ( 12 , 170 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "~Single page" ;
};
RadioButton RB_PGLY_CONT
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_PGLY_CONT";
Pos = MAP_APPFONT ( 12 , 182 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "~Continuous" ;
};
RadioButton RB_PGLY_CONTFAC
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_OPNFTR:RB_PGLY_CONTFAC";
Pos = MAP_APPFONT ( 12 , 194 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "C~ontinuous facing" ;
};
CheckBox CB_PGLY_FIRSTLEFT
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_OPNFTR:CB_PGLY_FIRSTLEFT";
Pos = MAP_APPFONT ( 22 , 206 ) ;
Size = MAP_APPFONT ( 148 , 10 ) ;
Text[ en-US ] = "First page is ~left" ;
@@ -407,6 +448,7 @@ TabPage RID_PDF_TAB_VPREFER
CheckBox CB_WNDOPT_RESINIT
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_WNDOPT_RESINIT";
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -414,6 +456,7 @@ TabPage RID_PDF_TAB_VPREFER
};
CheckBox CB_WNDOPT_CNTRWIN
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_WNDOPT_CNTRWIN";
Pos = MAP_APPFONT ( 12 , 26 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -421,12 +464,14 @@ TabPage RID_PDF_TAB_VPREFER
};
CheckBox CB_WNDOPT_OPNFULL
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_WNDOPT_OPNFULL";
Pos = MAP_APPFONT ( 12 , 38 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "~Open in full screen mode" ;
};
CheckBox CB_DISPDOCTITLE
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_DISPDOCTITLE";
Pos = MAP_APPFONT ( 12 , 50 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -442,6 +487,7 @@ TabPage RID_PDF_TAB_VPREFER
};
CheckBox CB_UOP_HIDEVMENUBAR
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_UOP_HIDEVMENUBAR";
Pos = MAP_APPFONT ( 12 , 76 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -449,6 +495,7 @@ TabPage RID_PDF_TAB_VPREFER
};
CheckBox CB_UOP_HIDEVTOOLBAR
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_UOP_HIDEVTOOLBAR";
Pos = MAP_APPFONT ( 12 , 88 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -456,6 +503,7 @@ TabPage RID_PDF_TAB_VPREFER
};
CheckBox CB_UOP_HIDEVWINCTRL
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_UOP_HIDEVWINCTRL";
Pos = MAP_APPFONT ( 12 , 100 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -471,6 +519,7 @@ TabPage RID_PDF_TAB_VPREFER
};
CheckBox CB_TRANSITIONEFFECTS
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_VPREFER:CB_TRANSITIONEFFECTS";
Pos = MAP_APPFONT ( 12 , 126 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -485,18 +534,21 @@ TabPage RID_PDF_TAB_VPREFER
};
RadioButton RB_ALLBOOKMARKLEVELS
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_VPREFER:RB_ALLBOOKMARKLEVELS";
Pos = MAP_APPFONT ( 12 , 152 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
Text[ en-US ] = "All bookmark levels";
};
RadioButton RB_VISIBLEBOOKMARKLEVELS
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_VPREFER:RB_VISIBLEBOOKMARKLEVELS";
Pos = MAP_APPFONT ( 12 , 166 ) ;
Size = MAP_APPFONT ( 117 , 10 ) ;
Text[ en-US ] = "Visible bookmark levels";
};
NumericField NUM_BOOKMARKLEVELS
{
+ HelpID = "filter:NumericField:RID_PDF_TAB_VPREFER:NUM_BOOKMARKLEVELS";
Pos = MAP_APPFONT ( 132 , 165 ) ;
Size = MAP_APPFONT ( 32 , 12 ) ;
Border = TRUE;
@@ -515,19 +567,29 @@ TabPage RID_PDF_TAB_SECURITY
TAB_PDF_SIZE;
Hide = TRUE;
-//////////////////////////////////////
- PushButton BTN_USER_PWD
+ FixedLine FL_PWD_GROUP
{
+ Pos = MAP_APPFONT( 5, 5 );
+ Size = MAP_APPFONT( 125, 10 );
+ Text[ en-US ] = "File encryption and permission";
+ };
+ PushButton BTN_SET_PWD
+ {
+ HelpID = "filter:PushButton:RID_PDF_TAB_SECURITY:BTN_PWD";
TabStop = TRUE ;
Disable = TRUE ;
- Pos = MAP_APPFONT ( 12, 5 ) ;
+ Pos = MAP_APPFONT ( 12, 20 ) ;
Size = MAP_APPFONT ( 120 , 13 ) ;
- Text[ en-US ] = "Set ~open password...";
+ Text[ en-US ] = "Set ~passwords...";
+ };
+ String STR_SET_PWD
+ {
+ Text[ en-US ] = "Set passwords";
};
FixedText FT_USER_PWD
{
- Pos = MAP_APPFONT(12 , 25 );
+ Pos = MAP_APPFONT(12 , 40 );
Size = MAP_APPFONT( 160, 20 );
};
@@ -551,13 +613,9 @@ TabPage RID_PDF_TAB_SECURITY
Text [ en-US ] = "PDF document will not be encrypted";
};
- PushButton BTN_OWNER_PWD
+ String STR_USER_PWD_PDFA
{
- TabStop = TRUE ;
- Disable = TRUE ;
- Pos = MAP_APPFONT ( 12, 45 ) ;
- Size = MAP_APPFONT ( 120 , 13 ) ;
- Text[ en-US ] = "Set ~permission password...";
+ Text [en-US] = "PDF doument will not be encrypted due to PDF/A export.";
};
FixedText FT_OWNER_PWD
@@ -586,6 +644,11 @@ TabPage RID_PDF_TAB_SECURITY
Text [ en-US ] = "PDF document will be unrestricted";
};
+ String STR_OWNER_PWD_PDFA
+ {
+ Text [en-US] = "PDF doument will not be restricted due to PDF/A export.";
+ };
+
//////////////////////////////
FixedLine FL_PRINT_PERMISSIONS
{
@@ -595,18 +658,21 @@ TabPage RID_PDF_TAB_SECURITY
};
RadioButton RB_PRINT_NONE
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_PRINT_NONE";
Pos = MAP_APPFONT ( 18 , 101 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "~Not permitted";
};
RadioButton RB_PRINT_LOWRES
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_PRINT_LOWRES";
Pos = MAP_APPFONT ( 18 , 112 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "~Low resolution (150 dpi)";
};
RadioButton RB_PRINT_HIGHRES
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_PRINT_HIGHRES";
Pos = MAP_APPFONT ( 18 , 123 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "~High resolution";
@@ -621,24 +687,28 @@ TabPage RID_PDF_TAB_SECURITY
};
RadioButton RB_CHANGES_NONE
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_NONE";
Pos = MAP_APPFONT ( 18 , 145 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "No~t permitted";
};
RadioButton RB_CHANGES_INSDEL
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_INSDEL";
Pos = MAP_APPFONT ( 18 , 157 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "~Inserting, deleting, and rotating pages";
};
RadioButton RB_CHANGES_FILLFORM
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_FILLFORM";
Pos = MAP_APPFONT ( 18 , 168 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text[ en-US ] = "~Filling in form fields";
};
RadioButton RB_CHANGES_COMMENT
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_COMMENT";
Pos = MAP_APPFONT ( 18 , 179 ) ;
Size = MAP_APPFONT ( 152 , 16 ) ;
WordBreak = TRUE ;
@@ -646,6 +716,7 @@ TabPage RID_PDF_TAB_SECURITY
};
RadioButton RB_CHANGES_ANY_NOCOPY
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_SECURITY:RB_CHANGES_ANY_NOCOPY";
Pos = MAP_APPFONT ( 18 , 198 ) ;
Size = MAP_APPFONT ( 152 , 10 ) ;
Text[ en-US ] = "~Any except extracting pages";
@@ -653,6 +724,7 @@ TabPage RID_PDF_TAB_SECURITY
CheckBox CB_ENDAB_COPY
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_SECURITY:CB_ENDAB_COPY";
Pos = MAP_APPFONT ( 12 , 211 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -661,6 +733,7 @@ TabPage RID_PDF_TAB_SECURITY
CheckBox CB_ENAB_ACCESS
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_SECURITY:CB_ENAB_ACCESS";
Pos = MAP_APPFONT ( 12 , 224 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -679,6 +752,7 @@ TabPage RID_PDF_TAB_LINKS
CheckBox CB_EXP_BMRK_TO_DEST
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_LINKS:CB_EXP_BMRK_TO_DEST";
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 164 , 16 ) ;
TabStop = TRUE ;
@@ -688,6 +762,7 @@ TabPage RID_PDF_TAB_LINKS
CheckBox CB_CNV_OOO_DOCTOPDF
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_LINKS:CB_CNV_OOO_DOCTOPDF";
Pos = MAP_APPFONT ( 6 , 22 ) ;
Size = MAP_APPFONT ( 164 , 16 ) ;
TabStop = TRUE ;
@@ -697,6 +772,7 @@ TabPage RID_PDF_TAB_LINKS
CheckBox CB_ENAB_RELLINKFSYS
{
+ HelpID = "filter:CheckBox:RID_PDF_TAB_LINKS:CB_ENAB_RELLINKFSYS";
Pos = MAP_APPFONT ( 6 , 41 ) ;
Size = MAP_APPFONT ( 164 , 16 ) ;
TabStop = TRUE ;
@@ -713,6 +789,7 @@ TabPage RID_PDF_TAB_LINKS
RadioButton CB_VIEW_PDF_DEFAULT
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_LINKS:CB_VIEW_PDF_DEFAULT";
Pos = MAP_APPFONT ( 12 , 71 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -721,6 +798,7 @@ TabPage RID_PDF_TAB_LINKS
RadioButton CB_VIEW_PDF_APPLICATION
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_LINKS:CB_VIEW_PDF_APPLICATION";
Pos = MAP_APPFONT ( 12 , 84 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -729,6 +807,7 @@ TabPage RID_PDF_TAB_LINKS
RadioButton CB_VIEW_PDF_BROWSER
{
+ HelpID = "filter:RadioButton:RID_PDF_TAB_LINKS:CB_VIEW_PDF_BROWSER";
Pos = MAP_APPFONT ( 12 , 97 ) ;
Size = MAP_APPFONT ( 158 , 10 ) ;
TabStop = TRUE ;
@@ -782,6 +861,7 @@ TabDialog RID_PDF_EXPORT_DLG
ModalDialog RID_PDF_ERROR_DLG
{
+ HelpID = "filter:ModalDialog:RID_PDF_ERROR_DLG";
OutputSize = TRUE;
SVLook = TRUE;
Moveable = TRUE;
diff --git a/filter/source/pdf/makefile.mk b/filter/source/pdf/makefile.mk
index edf3147a822c..65028c7d5d8d 100644
--- a/filter/source/pdf/makefile.mk
+++ b/filter/source/pdf/makefile.mk
@@ -47,6 +47,7 @@ SLOFILES= $(SLO)$/pdfuno.obj \
$(SLO)$/pdfdialog.obj \
$(SLO)$/impdialog.obj \
$(SLO)$/pdffilter.obj \
+ $(SLO)$/pdfinteract.obj \
$(SLO)$/pdfexport.obj
# --- Library -----------------------------------
@@ -81,3 +82,11 @@ DEF1NAME=$(SHL1TARGET)
# --- Targets ----------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/pdffilter.component
+
+$(MISC)/pdffilter.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ pdffilter.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt pdffilter.component
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index f8c0dbc20739..3f3177f64082 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -33,46 +33,58 @@
#include "impdialog.hxx"
#include "pdf.hrc"
-#include <tools/urlobj.hxx>
-#include <tools/fract.hxx>
-#include <tools/poly.hxx>
-#include <vcl/mapmod.hxx>
-#include <vcl/virdev.hxx>
-#include <vcl/metaact.hxx>
-#include <vcl/gdimtf.hxx>
-#include <vcl/jobset.hxx>
-#include <vcl/salbtype.hxx>
-#include <vcl/bmpacc.hxx>
+#include "tools/urlobj.hxx"
+#include "tools/fract.hxx"
+#include "tools/poly.hxx"
+#include "vcl/mapmod.hxx"
+#include "vcl/virdev.hxx"
+#include "vcl/metaact.hxx"
+#include "vcl/gdimtf.hxx"
+#include "vcl/jobset.hxx"
+#include "vcl/salbtype.hxx"
+#include "vcl/bmpacc.hxx"
#include "vcl/svapp.hxx"
-#include <toolkit/awt/vclxdevice.hxx>
-#include <unotools/localfilehelper.hxx>
-#include <unotools/processfactory.hxx>
-#include <svtools/FilterConfigItem.hxx>
-#include <svtools/filter.hxx>
-#include <svl/solar.hrc>
-#include <comphelper/string.hxx>
+#include "toolkit/awt/vclxdevice.hxx"
+#include "unotools/localfilehelper.hxx"
+#include "unotools/processfactory.hxx"
+#include "svtools/FilterConfigItem.hxx"
+#include "svtools/filter.hxx"
+#include "svl/solar.hrc"
+#include "comphelper/string.hxx"
+#include "comphelper/storagehelper.hxx"
+#include "unotools/streamwrap.hxx"
+#include "com/sun/star/io/XSeekable.hpp"
+
#include "basegfx/polygon/b2dpolygon.hxx"
#include "basegfx/polygon/b2dpolypolygon.hxx"
#include "basegfx/polygon/b2dpolygontools.hxx"
-#include <unotools/saveopt.hxx> // only for testing of relative saving options in PDF
-
-#include <vcl/graphictools.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/awt/Rectangle.hpp>
-#include <com/sun/star/awt/XDevice.hpp>
-#include <com/sun/star/util/MeasureUnit.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/frame/XModuleManager.hpp>
-#include <com/sun/star/frame/XStorable.hpp>
-#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/document/XDocumentProperties.hpp>
-#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/view/XViewSettingsSupplier.hpp>
-#include <unotools/configmgr.hxx>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/drawing/XShapes.hpp>
+#include "unotools/saveopt.hxx" // only for testing of relative saving options in PDF
+
+#include "vcl/graphictools.hxx"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/awt/Rectangle.hpp"
+#include "com/sun/star/awt/XDevice.hpp"
+#include "com/sun/star/util/MeasureUnit.hpp"
+#include "com/sun/star/frame/XModel.hpp"
+#include "com/sun/star/frame/XModuleManager.hpp"
+#include "com/sun/star/frame/XStorable.hpp"
+#include "com/sun/star/frame/XController.hpp"
+#include "com/sun/star/document/XDocumentProperties.hpp"
+#include "com/sun/star/document/XDocumentPropertiesSupplier.hpp"
+#include "com/sun/star/container/XNameAccess.hpp"
+#include "com/sun/star/view/XViewSettingsSupplier.hpp"
+#include "com/sun/star/task/XInteractionRequest.hpp"
+#include "com/sun/star/task/PDFExportException.hpp"
+
+#include "unotools/configmgr.hxx"
+#include "cppuhelper/exc_hlp.hxx"
+#include "cppuhelper/compbase1.hxx"
+#include "cppuhelper/basemutex.hxx"
+
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/drawing/XShapes.hpp"
+#include "com/sun/star/graphic/XGraphicProvider.hpp"
using namespace ::rtl;
using namespace ::vcl;
@@ -81,15 +93,20 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::view;
+using namespace ::com::sun::star::graphic;
// -------------
// - PDFExport -
// -------------
-PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc, Reference< task::XStatusIndicator >& rxStatusIndicator, const Reference< lang::XMultiServiceFactory >& xFactory ) :
+PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc,
+ const Reference< task::XStatusIndicator >& rxStatusIndicator,
+ const Reference< task::XInteractionHandler >& rxIH,
+ const Reference< lang::XMultiServiceFactory >& xFactory ) :
mxSrcDoc ( rxSrcDoc ),
mxMSF ( xFactory ),
mxStatusIndicator ( rxStatusIndicator ),
+ mxIH ( rxIH ),
mbUseTaggedPDF ( sal_False ),
mnPDFTypeSelection ( 0 ),
mbExportNotes ( sal_True ),
@@ -127,9 +144,7 @@ PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc, Reference< task::
mbFirstPageLeft ( sal_False ),
mbEncrypt ( sal_False ),
- msOpenPassword (),
mbRestrictPermissions ( sal_False ),
- msPermissionPassword (),
mnPrintAllowed ( 2 ),
mnChangesAllowed ( 4 ),
mbCanCopyOrExtract ( sal_True ),
@@ -197,7 +212,7 @@ sal_Bool PDFExport::ExportSelection( vcl::PDFWriter& rPDFWriter, Reference< com:
const Size aMtfSize( aPageSize.Width, aPageSize.Height );
pOut->Push();
- pOut->EnableOutput( FALSE );
+ pOut->EnableOutput( sal_False );
pOut->SetMapMode( aMapMode );
aMtf.SetPrefSize( aMtfSize );
@@ -246,12 +261,12 @@ sal_Bool PDFExport::ExportSelection( vcl::PDFWriter& rPDFWriter, Reference< com:
class PDFExportStreamDoc : public vcl::PDFOutputStream
{
- Reference< XComponent > m_xSrcDoc;
- rtl::OUString m_aPassWd;
+ Reference< XComponent > m_xSrcDoc;
+ Sequence< beans::NamedValue > m_aPreparedPassword;
public:
- PDFExportStreamDoc( const Reference< XComponent >& xDoc, const rtl::OUString& rPwd )
+ PDFExportStreamDoc( const Reference< XComponent >& xDoc, const Sequence<beans::NamedValue>& rPwd )
: m_xSrcDoc( xDoc ),
- m_aPassWd( rPwd )
+ m_aPreparedPassword( rPwd )
{}
virtual ~PDFExportStreamDoc();
@@ -267,15 +282,16 @@ void PDFExportStreamDoc::write( const Reference< XOutputStream >& xStream )
Reference< com::sun::star::frame::XStorable > xStore( m_xSrcDoc, UNO_QUERY );
if( xStore.is() )
{
- Sequence< beans::PropertyValue > aArgs( m_aPassWd.getLength() ? 3 : 2 );
+ Sequence< beans::PropertyValue > aArgs( 2 + ((m_aPreparedPassword.getLength() > 0) ? 1 : 0) );
aArgs.getArray()[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
aArgs.getArray()[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "OutputStream" ) );
aArgs.getArray()[1].Value <<= xStream;
- if( m_aPassWd.getLength() )
+ if( m_aPreparedPassword.getLength() )
{
- aArgs.getArray()[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Password" ) );
- aArgs.getArray()[2].Value <<= m_aPassWd;
+ aArgs.getArray()[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptionData" ) );
+ aArgs.getArray()[2].Value <<= m_aPreparedPassword;
}
+
try
{
xStore->storeToURL( OUString( RTL_CONSTASCII_USTRINGPARAM( "private:stream" ) ),
@@ -386,6 +402,11 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
VCLXDevice* pXDevice = new VCLXDevice;
OUString aPageRange;
Any aSelection;
+ PDFWriter::PDFWriterContext aContext;
+ rtl::OUString aOpenPassword, aPermissionPassword;
+ Reference< beans::XMaterialHolder > xEnc;
+ Sequence< beans::NamedValue > aPreparedPermissionPassword;
+
// getting the string for the creator
String aCreator;
@@ -404,7 +425,34 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
aCreator.AppendAscii( "Math" );
}
- PDFWriter::PDFWriterContext aContext;
+ Reference< document::XDocumentPropertiesSupplier > xDocumentPropsSupplier( mxSrcDoc, UNO_QUERY );
+ if ( xDocumentPropsSupplier.is() )
+ {
+ Reference< document::XDocumentProperties > xDocumentProps( xDocumentPropsSupplier->getDocumentProperties() );
+ if ( xDocumentProps.is() )
+ {
+ aContext.DocumentInfo.Title = xDocumentProps->getTitle();
+ aContext.DocumentInfo.Author = xDocumentProps->getAuthor();
+ aContext.DocumentInfo.Subject = xDocumentProps->getSubject();
+ aContext.DocumentInfo.Keywords = ::comphelper::string::convertCommaSeparated(xDocumentProps->getKeywords());
+ }
+ }
+ // getting the string for the producer
+ String aProducer;
+ ::utl::ConfigManager* pMgr = ::utl::ConfigManager::GetConfigManager();
+ if ( pMgr )
+ {
+ Any aProductName = pMgr->GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
+ ::rtl::OUString sProductName;
+ aProductName >>= sProductName;
+ aProducer = sProductName;
+ aProductName = pMgr->GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION );
+ aProductName >>= sProductName;
+ aProducer.AppendAscii(" ");
+ aProducer += String( sProductName );
+ }
+ aContext.DocumentInfo.Producer = aProducer;
+ aContext.DocumentInfo.Creator = aCreator;
for( sal_Int32 nData = 0, nDataCount = rFilterData.getLength(); nData < nDataCount; ++nData )
{
@@ -478,11 +526,15 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "EncryptFile" ) ) )
rFilterData[ nData ].Value >>= mbEncrypt;
else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "DocumentOpenPassword" ) ) )
- rFilterData[ nData ].Value >>= msOpenPassword;
+ rFilterData[ nData ].Value >>= aOpenPassword;
else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "RestrictPermissions" ) ) )
rFilterData[ nData ].Value >>= mbRestrictPermissions;
else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "PermissionPassword" ) ) )
- rFilterData[ nData ].Value >>= msPermissionPassword;
+ rFilterData[ nData ].Value >>= aPermissionPassword;
+ else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "PreparedPasswords" ) ) )
+ rFilterData[ nData ].Value >>= xEnc;
+ else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "PreparedPermissionPassword" ) ) )
+ rFilterData[ nData ].Value >>= aPreparedPermissionPassword;
else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "Printing" ) ) )
rFilterData[ nData ].Value >>= mnPrintAllowed;
else if ( rFilterData[ nData ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "Changes" ) ) )
@@ -517,14 +569,17 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
break;
case 1:
aContext.Version = PDFWriter::PDF_A_1;
-//force the tagged PDF as well
+ //force the tagged PDF as well
mbUseTaggedPDF = sal_True;
-//force embedding of standard fonts
+ //force embedding of standard fonts
mbEmbedStandardFonts = sal_True;
-//force disabling of form conversion
+ //force disabling of form conversion
mbExportFormFields = sal_False;
-// PDF/A does not allow transparencies
+ // PDF/A does not allow transparencies
mbRemoveTransparencies = sal_True;
+ // no encryption
+ mbEncrypt = sal_False;
+ xEnc.clear();
break;
}
@@ -600,23 +655,17 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
if( aContext.Version != PDFWriter::PDF_A_1 )
{
//set values needed in encryption
- aContext.Encrypt = mbEncrypt;
//set encryption level, fixed, but here it can set by the UI if needed.
// true is 128 bit, false 40
//note that in 40 bit mode the UI needs reworking, since the current UI is meaningfull only for
//128bit security mode
- aContext.Security128bit = sal_True;
-
-//set the open password
- if( aContext.Encrypt && msOpenPassword.getLength() > 0 )
- aContext.UserPassword = msOpenPassword;
+ aContext.Encryption.Security128bit = sal_True;
//set check for permission change password
// if not enabled and no permission password, force permissions to default as if PDF where without encryption
- if( mbRestrictPermissions && msPermissionPassword.getLength() > 0 )
+ if( mbRestrictPermissions && (xEnc.is() || aPermissionPassword.getLength() > 0) )
{
- aContext.OwnerPassword = msPermissionPassword;
- aContext.Encrypt = sal_True;
+ mbEncrypt = sal_True;
//permission set as desired, done after
}
else
@@ -634,9 +683,9 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
break;
default:
case 2:
- aContext.AccessPermissions.CanPrintFull = sal_True;
+ aContext.Encryption.CanPrintFull = sal_True;
case 1:
- aContext.AccessPermissions.CanPrintTheDocument = sal_True;
+ aContext.Encryption.CanPrintTheDocument = sal_True;
break;
}
@@ -645,26 +694,36 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
case 0: //already in struct PDFSecPermissions CTOR
break;
case 1:
- aContext.AccessPermissions.CanAssemble = sal_True;
+ aContext.Encryption.CanAssemble = sal_True;
break;
case 2:
- aContext.AccessPermissions.CanFillInteractive = sal_True;
+ aContext.Encryption.CanFillInteractive = sal_True;
break;
case 3:
- aContext.AccessPermissions.CanAddOrModify = sal_True;
+ aContext.Encryption.CanAddOrModify = sal_True;
break;
default:
case 4:
- aContext.AccessPermissions.CanModifyTheContent =
- aContext.AccessPermissions.CanCopyOrExtract =
- aContext.AccessPermissions.CanAddOrModify =
- aContext.AccessPermissions.CanFillInteractive = sal_True;
+ aContext.Encryption.CanModifyTheContent =
+ aContext.Encryption.CanCopyOrExtract =
+ aContext.Encryption.CanAddOrModify =
+ aContext.Encryption.CanFillInteractive = sal_True;
break;
}
- aContext.AccessPermissions.CanCopyOrExtract = mbCanCopyOrExtract;
- aContext.AccessPermissions.CanExtractForAccessibility = mbCanExtractForAccessibility;
+ aContext.Encryption.CanCopyOrExtract = mbCanCopyOrExtract;
+ aContext.Encryption.CanExtractForAccessibility = mbCanExtractForAccessibility;
+ if( mbEncrypt && ! xEnc.is() )
+ xEnc = PDFWriter::InitEncryption( aPermissionPassword, aOpenPassword, aContext.Encryption.Security128bit );
+ if( mbEncrypt && aPermissionPassword.getLength() && ! aPreparedPermissionPassword.getLength() )
+ aPreparedPermissionPassword = comphelper::OStorageHelper::CreatePackageEncryptionData( aPermissionPassword );
}
+ // after this point we don't need the legacy clear passwords anymore
+ // however they are still inside the passed filter data sequence
+ // which is sadly out out our control
+ aPermissionPassword = rtl::OUString();
+ aOpenPassword = rtl::OUString();
+
/*
* FIXME: the entries are only implicitly defined by the resource file. Should there
* ever be an additional form submit format this could get invalid.
@@ -727,7 +786,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
//<---
}
// all context data set, time to create the printing device
- PDFWriter* pPDFWriter = new PDFWriter( aContext );
+ PDFWriter* pPDFWriter = new PDFWriter( aContext, xEnc );
OutputDevice* pOut = pPDFWriter->GetReferenceDevice();
vcl::PDFExtOutDevData* pPDFExtOutDevData = NULL;
@@ -740,38 +799,10 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
// get mimetype
OUString aSrcMimetype = getMimetypeForDocument( mxMSF, mxSrcDoc );
pPDFWriter->AddStream( aSrcMimetype,
- new PDFExportStreamDoc( mxSrcDoc, msPermissionPassword ),
+ new PDFExportStreamDoc( mxSrcDoc, aPreparedPermissionPassword ),
false
);
}
- PDFDocInfo aDocInfo;
- Reference< document::XDocumentPropertiesSupplier > xDocumentPropsSupplier( mxSrcDoc, UNO_QUERY );
- if ( xDocumentPropsSupplier.is() )
- {
- Reference< document::XDocumentProperties > xDocumentProps( xDocumentPropsSupplier->getDocumentProperties() );
- if ( xDocumentProps.is() )
- {
- aDocInfo.Title = xDocumentProps->getTitle();
- aDocInfo.Author = xDocumentProps->getAuthor();
- aDocInfo.Subject = xDocumentProps->getSubject();
- aDocInfo.Keywords = ::comphelper::string::convertCommaSeparated(xDocumentProps->getKeywords());
- }
- }
- // getting the string for the producer
- String aProducer;
- ::utl::ConfigManager& rMgr = ::utl::ConfigManager::GetConfigManager();
- Any aProductName = rMgr.GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
- ::rtl::OUString sProductName;
- aProductName >>= sProductName;
- aProducer = sProductName;
- aProductName = rMgr.GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION );
- aProductName >>= sProductName;
- aProducer.AppendAscii(" ");
- aProducer += String( sProductName );
- aDocInfo.Producer = aProducer;
- aDocInfo.Creator = aCreator;
-
- pPDFWriter->SetDocInfo( aDocInfo );
if ( pOut )
{
@@ -870,7 +901,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
if( nPageCount > 0 )
bRet = ExportSelection( *pPDFWriter, xRenderable, aSelection, aMultiSelection, aRenderOptions, nPageCount );
else
- bRet = FALSE;
+ bRet = sal_False;
if ( bRet && bSecondPassForImpressNotes )
{
@@ -915,12 +946,59 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
return bRet;
}
+namespace
+{
+
+typedef cppu::WeakComponentImplHelper1< task::XInteractionRequest > PDFErrorRequestBase;
+
+class PDFErrorRequest : private cppu::BaseMutex,
+ public PDFErrorRequestBase
+{
+ task::PDFExportException maExc;
+public:
+ PDFErrorRequest( const task::PDFExportException& i_rExc );
+
+ // XInteractionRequest
+ virtual uno::Any SAL_CALL getRequest() throw (uno::RuntimeException);
+ virtual uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL getContinuations() throw (uno::RuntimeException);
+};
+
+PDFErrorRequest::PDFErrorRequest( const task::PDFExportException& i_rExc ) :
+ PDFErrorRequestBase( m_aMutex ),
+ maExc( i_rExc )
+{
+}
+
+uno::Any SAL_CALL PDFErrorRequest::getRequest() throw (uno::RuntimeException)
+{
+ osl::MutexGuard const guard( m_aMutex );
+
+ uno::Any aRet;
+ aRet <<= maExc;
+ return aRet;
+}
+
+uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL PDFErrorRequest::getContinuations() throw (uno::RuntimeException)
+{
+ return uno::Sequence< uno::Reference< task::XInteractionContinuation > >();
+}
+
+} // namespace
+
void PDFExport::showErrors( const std::set< PDFWriter::ErrorCode >& rErrors )
{
- if( ! rErrors.empty() )
+ if( ! rErrors.empty() && mxIH.is() )
{
- ImplErrorDialog aDlg( rErrors );
- aDlg.Execute();
+ task::PDFExportException aExc;
+ aExc.ErrorCodes.realloc( sal_Int32(rErrors.size()) );
+ sal_Int32 i = 0;
+ for( std::set< PDFWriter::ErrorCode >::const_iterator it = rErrors.begin();
+ it != rErrors.end(); ++it, i++ )
+ {
+ aExc.ErrorCodes.getArray()[i] = (sal_Int32)*it;
+ }
+ Reference< task::XInteractionRequest > xReq( new PDFErrorRequest( aExc ) );
+ mxIH->handle( xReq );
}
}
@@ -928,21 +1006,36 @@ void PDFExport::showErrors( const std::set< PDFWriter::ErrorCode >& rErrors )
sal_Bool PDFExport::ImplExportPage( PDFWriter& rWriter, PDFExtOutDevData& rPDFExtOutDevData, const GDIMetaFile& rMtf )
{
- VirtualDevice aDummyVDev;
const Size aSizePDF( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MAP_POINT ) );
Point aOrigin;
Rectangle aPageRect( aOrigin, rMtf.GetPrefSize() );
- sal_Bool bRet = sal_False;
-
- aDummyVDev.EnableOutput( sal_False );
- aDummyVDev.SetMapMode( rMtf.GetPrefMapMode() );
+ sal_Bool bRet = sal_True;
rWriter.NewPage( aSizePDF.Width(), aSizePDF.Height() );
rWriter.SetMapMode( rMtf.GetPrefMapMode() );
+ vcl::PDFWriter::PlayMetafileContext aCtx;
+ GDIMetaFile aMtf;
+ if( mbRemoveTransparencies )
+ {
+ aCtx.m_bTransparenciesWereRemoved = rWriter.GetReferenceDevice()->
+ RemoveTransparenciesFromMetaFile( rMtf, aMtf, mnMaxImageResolution, mnMaxImageResolution,
+ false, true, mbReduceImageResolution );
+ }
+ else
+ {
+ aMtf = rMtf;
+ }
+ aCtx.m_nMaxImageResolution = mbReduceImageResolution ? mnMaxImageResolution : 0;
+ aCtx.m_bOnlyLosslessCompression = mbUseLosslessCompression;
+ aCtx.m_nJPEGQuality = mnQuality;
+
+
basegfx::B2DRectangle aB2DRect( aPageRect.Left(), aPageRect.Top(), aPageRect.Right(), aPageRect.Bottom() );
rWriter.SetClipRegion( basegfx::B2DPolyPolygon( basegfx::tools::createPolygonFromRect( aB2DRect ) ) );
- bRet = ImplWriteActions( rWriter, &rPDFExtOutDevData, rMtf, aDummyVDev );
+
+ rWriter.PlayMetafile( aMtf, aCtx, &rPDFExtOutDevData );
+
rPDFExtOutDevData.ResetSyncData();
if( mbWatermark )
@@ -1024,868 +1117,5 @@ void PDFExport::ImplWriteWatermark( PDFWriter& rWriter, const Size& rPageSize )
rWriter.Pop();
}
-// -----------------------------------------------------------------------------
-
-sal_Bool PDFExport::ImplWriteActions( PDFWriter& rWriter, PDFExtOutDevData* pPDFExtOutDevData,
- const GDIMetaFile& rInMtf, VirtualDevice& rDummyVDev )
-{
- bool bAssertionFired( false );
-
- GDIMetaFile aMtf;
- bool bTransparenciesRemoved = false;
- if( mbRemoveTransparencies )
- {
- bTransparenciesRemoved = rWriter.GetReferenceDevice()->
- RemoveTransparenciesFromMetaFile( rInMtf, aMtf, mnMaxImageResolution, mnMaxImageResolution,
- false, true, mbReduceImageResolution );
- }
- else
- {
- aMtf = rInMtf;
- }
-
-
- for( sal_uInt32 i = 0, nCount = aMtf.GetActionCount(); i < nCount; )
- {
- if ( !pPDFExtOutDevData || !pPDFExtOutDevData->PlaySyncPageAct( rWriter, i ) )
- {
- const MetaAction* pAction = aMtf.GetAction( i );
- const USHORT nType = pAction->GetType();
-
- switch( nType )
- {
- case( META_PIXEL_ACTION ):
- {
- const MetaPixelAction* pA = (const MetaPixelAction*) pAction;
- rWriter.DrawPixel( pA->GetPoint(), pA->GetColor() );
- }
- break;
-
- case( META_POINT_ACTION ):
- {
- const MetaPointAction* pA = (const MetaPointAction*) pAction;
- rWriter.DrawPixel( pA->GetPoint() );
- }
- break;
-
- case( META_LINE_ACTION ):
- {
- const MetaLineAction* pA = (const MetaLineAction*) pAction;
- if ( pA->GetLineInfo().IsDefault() )
- rWriter.DrawLine( pA->GetStartPoint(), pA->GetEndPoint() );
- else
- rWriter.DrawLine( pA->GetStartPoint(), pA->GetEndPoint(), pA->GetLineInfo() );
- }
- break;
-
- case( META_RECT_ACTION ):
- {
- const MetaRectAction* pA = (const MetaRectAction*) pAction;
- rWriter.DrawRect( pA->GetRect() );
- }
- break;
-
- case( META_ROUNDRECT_ACTION ):
- {
- const MetaRoundRectAction* pA = (const MetaRoundRectAction*) pAction;
- rWriter.DrawRect( pA->GetRect(), pA->GetHorzRound(), pA->GetVertRound() );
- }
- break;
-
- case( META_ELLIPSE_ACTION ):
- {
- const MetaEllipseAction* pA = (const MetaEllipseAction*) pAction;
- rWriter.DrawEllipse( pA->GetRect() );
- }
- break;
-
- case( META_ARC_ACTION ):
- {
- const MetaArcAction* pA = (const MetaArcAction*) pAction;
- rWriter.DrawArc( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
- }
- break;
-
- case( META_PIE_ACTION ):
- {
- const MetaArcAction* pA = (const MetaArcAction*) pAction;
- rWriter.DrawPie( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
- }
- break;
-
- case( META_CHORD_ACTION ):
- {
- const MetaChordAction* pA = (const MetaChordAction*) pAction;
- rWriter.DrawChord( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
- }
- break;
-
- case( META_POLYGON_ACTION ):
- {
- const MetaPolygonAction* pA = (const MetaPolygonAction*) pAction;
- rWriter.DrawPolygon( pA->GetPolygon() );
- }
- break;
-
- case( META_POLYLINE_ACTION ):
- {
- const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pAction;
- if ( pA->GetLineInfo().IsDefault() )
- rWriter.DrawPolyLine( pA->GetPolygon() );
- else
- rWriter.DrawPolyLine( pA->GetPolygon(), pA->GetLineInfo() );
- }
- break;
-
- case( META_POLYPOLYGON_ACTION ):
- {
- const MetaPolyPolygonAction* pA = (const MetaPolyPolygonAction*) pAction;
- rWriter.DrawPolyPolygon( pA->GetPolyPolygon() );
- }
- break;
-
- case( META_GRADIENT_ACTION ):
- {
- const MetaGradientAction* pA = (const MetaGradientAction*) pAction;
- const PolyPolygon aPolyPoly( pA->GetRect() );
-
- ImplWriteGradient( rWriter, aPolyPoly, pA->GetGradient(), rDummyVDev );
- }
- break;
-
- case( META_GRADIENTEX_ACTION ):
- {
- const MetaGradientExAction* pA = (const MetaGradientExAction*) pAction;
- ImplWriteGradient( rWriter, pA->GetPolyPolygon(), pA->GetGradient(), rDummyVDev );
- }
- break;
-
- case META_HATCH_ACTION:
- {
- const MetaHatchAction* pA = (const MetaHatchAction*) pAction;
- rWriter.DrawHatch( pA->GetPolyPolygon(), pA->GetHatch() );
- }
- break;
-
- case( META_TRANSPARENT_ACTION ):
- {
- const MetaTransparentAction* pA = (const MetaTransparentAction*) pAction;
- rWriter.DrawTransparent( pA->GetPolyPolygon(), pA->GetTransparence() );
- }
- break;
-
- case( META_FLOATTRANSPARENT_ACTION ):
- {
- const MetaFloatTransparentAction* pA = (const MetaFloatTransparentAction*) pAction;
-
- GDIMetaFile aTmpMtf( pA->GetGDIMetaFile() );
- const Point& rPos = pA->GetPoint();
- const Size& rSize= pA->GetSize();
- const Gradient& rTransparenceGradient = pA->GetGradient();
-
- // special case constant alpha value
- if( rTransparenceGradient.GetStartColor() == rTransparenceGradient.GetEndColor() )
- {
- const Color aTransCol( rTransparenceGradient.GetStartColor() );
- const USHORT nTransPercent = aTransCol.GetLuminance() * 100 / 255;
- rWriter.BeginTransparencyGroup();
- ImplWriteActions( rWriter, NULL, aTmpMtf, rDummyVDev );
- rWriter.EndTransparencyGroup( Rectangle( rPos, rSize ), nTransPercent );
- }
- else
- {
- const Size aDstSizeTwip( rDummyVDev.PixelToLogic( rDummyVDev.LogicToPixel( rSize ), MAP_TWIP ) );
- sal_Int32 nMaxBmpDPI = mbUseLosslessCompression ? 300 : 72;
- if ( mbReduceImageResolution )
- {
- if ( nMaxBmpDPI > mnMaxImageResolution )
- nMaxBmpDPI = mnMaxImageResolution;
- }
- const sal_Int32 nPixelX = (sal_Int32)((double)aDstSizeTwip.Width() * (double)nMaxBmpDPI / 1440.0);
- const sal_Int32 nPixelY = (sal_Int32)((double)aDstSizeTwip.Height() * (double)nMaxBmpDPI / 1440.0);
- if ( nPixelX && nPixelY )
- {
- Size aDstSizePixel( nPixelX, nPixelY );
- VirtualDevice* pVDev = new VirtualDevice;
- if( pVDev->SetOutputSizePixel( aDstSizePixel ) )
- {
- Bitmap aPaint, aMask;
- AlphaMask aAlpha;
- Point aPoint;
-
- MapMode aMapMode( rDummyVDev.GetMapMode() );
- aMapMode.SetOrigin( aPoint );
- pVDev->SetMapMode( aMapMode );
- Size aDstSize( pVDev->PixelToLogic( aDstSizePixel ) );
-
- Point aMtfOrigin( aTmpMtf.GetPrefMapMode().GetOrigin() );
- if ( aMtfOrigin.X() || aMtfOrigin.Y() )
- aTmpMtf.Move( -aMtfOrigin.X(), -aMtfOrigin.Y() );
- double fScaleX = (double)aDstSize.Width() / (double)aTmpMtf.GetPrefSize().Width();
- double fScaleY = (double)aDstSize.Height() / (double)aTmpMtf.GetPrefSize().Height();
- if( fScaleX != 1.0 || fScaleY != 1.0 )
- aTmpMtf.Scale( fScaleX, fScaleY );
- aTmpMtf.SetPrefMapMode( aMapMode );
-
- // create paint bitmap
- aTmpMtf.WindStart();
- aTmpMtf.Play( pVDev, aPoint, aDstSize );
- aTmpMtf.WindStart();
-
- pVDev->EnableMapMode( FALSE );
- aPaint = pVDev->GetBitmap( aPoint, aDstSizePixel );
- pVDev->EnableMapMode( TRUE );
-
- // create mask bitmap
- pVDev->SetLineColor( COL_BLACK );
- pVDev->SetFillColor( COL_BLACK );
- pVDev->DrawRect( Rectangle( aPoint, aDstSize ) );
- pVDev->SetDrawMode( DRAWMODE_WHITELINE | DRAWMODE_WHITEFILL | DRAWMODE_WHITETEXT |
- DRAWMODE_WHITEBITMAP | DRAWMODE_WHITEGRADIENT );
- aTmpMtf.WindStart();
- aTmpMtf.Play( pVDev, aPoint, aDstSize );
- aTmpMtf.WindStart();
- pVDev->EnableMapMode( FALSE );
- aMask = pVDev->GetBitmap( aPoint, aDstSizePixel );
- pVDev->EnableMapMode( TRUE );
-
- // create alpha mask from gradient
- pVDev->SetDrawMode( DRAWMODE_GRAYGRADIENT );
- pVDev->DrawGradient( Rectangle( aPoint, aDstSize ), rTransparenceGradient );
- pVDev->SetDrawMode( DRAWMODE_DEFAULT );
- pVDev->EnableMapMode( FALSE );
- pVDev->DrawMask( aPoint, aDstSizePixel, aMask, Color( COL_WHITE ) );
- aAlpha = pVDev->GetBitmap( aPoint, aDstSizePixel );
- ImplWriteBitmapEx( rWriter, rDummyVDev, rPos, rSize, BitmapEx( aPaint, aAlpha ) );
- }
- delete pVDev;
- }
- }
- }
- break;
-
- case( META_EPS_ACTION ):
- {
- const MetaEPSAction* pA = (const MetaEPSAction*) pAction;
- const GDIMetaFile aSubstitute( pA->GetSubstitute() );
-
- rWriter.Push();
- rDummyVDev.Push();
-
- MapMode aMapMode( aSubstitute.GetPrefMapMode() );
- Size aOutSize( rDummyVDev.LogicToLogic( pA->GetSize(), rDummyVDev.GetMapMode(), aMapMode ) );
- aMapMode.SetScaleX( Fraction( aOutSize.Width(), aSubstitute.GetPrefSize().Width() ) );
- aMapMode.SetScaleY( Fraction( aOutSize.Height(), aSubstitute.GetPrefSize().Height() ) );
- aMapMode.SetOrigin( rDummyVDev.LogicToLogic( pA->GetPoint(), rDummyVDev.GetMapMode(), aMapMode ) );
-
- rWriter.SetMapMode( aMapMode );
- rDummyVDev.SetMapMode( aMapMode );
- ImplWriteActions( rWriter, NULL, aSubstitute, rDummyVDev );
- rDummyVDev.Pop();
- rWriter.Pop();
- }
- break;
-
- case( META_COMMENT_ACTION ):
- if( ! bTransparenciesRemoved )
- {
- const MetaCommentAction* pA = (const MetaCommentAction*) pAction;
- String aSkipComment;
-
- if( pA->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL )
- {
- const MetaGradientExAction* pGradAction = NULL;
- sal_Bool bDone = sal_False;
-
- while( !bDone && ( ++i < nCount ) )
- {
- pAction = aMtf.GetAction( i );
-
- if( pAction->GetType() == META_GRADIENTEX_ACTION )
- pGradAction = (const MetaGradientExAction*) pAction;
- else if( ( pAction->GetType() == META_COMMENT_ACTION ) &&
- ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) )
- {
- bDone = sal_True;
- }
- }
-
- if( pGradAction )
- ImplWriteGradient( rWriter, pGradAction->GetPolyPolygon(), pGradAction->GetGradient(), rDummyVDev );
- }
- else
- {
- const BYTE* pData = pA->GetData();
- if ( pData )
- {
- SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), STREAM_READ );
- sal_Bool bSkipSequence = sal_False;
- ByteString sSeqEnd;
-
- if( pA->GetComment().Equals( "XPATHSTROKE_SEQ_BEGIN" ) )
- {
- sSeqEnd = ByteString( "XPATHSTROKE_SEQ_END" );
- SvtGraphicStroke aStroke;
- aMemStm >> aStroke;
-
- Polygon aPath;
- aStroke.getPath( aPath );
-
- PolyPolygon aStartArrow;
- PolyPolygon aEndArrow;
- double fTransparency( aStroke.getTransparency() );
- double fStrokeWidth( aStroke.getStrokeWidth() );
- SvtGraphicStroke::DashArray aDashArray;
-
- aStroke.getStartArrow( aStartArrow );
- aStroke.getEndArrow( aEndArrow );
- aStroke.getDashArray( aDashArray );
-
- bSkipSequence = sal_True;
- if ( aStartArrow.Count() || aEndArrow.Count() )
- bSkipSequence = sal_False;
- if ( aDashArray.size() && ( fStrokeWidth != 0.0 ) && ( fTransparency == 0.0 ) )
- bSkipSequence = sal_False;
- if ( bSkipSequence )
- {
- PDFWriter::ExtLineInfo aInfo;
- aInfo.m_fLineWidth = fStrokeWidth;
- aInfo.m_fTransparency = fTransparency;
- aInfo.m_fMiterLimit = aStroke.getMiterLimit();
- switch( aStroke.getCapType() )
- {
- default:
- case SvtGraphicStroke::capButt: aInfo.m_eCap = PDFWriter::capButt;break;
- case SvtGraphicStroke::capRound: aInfo.m_eCap = PDFWriter::capRound;break;
- case SvtGraphicStroke::capSquare: aInfo.m_eCap = PDFWriter::capSquare;break;
- }
- switch( aStroke.getJoinType() )
- {
- default:
- case SvtGraphicStroke::joinMiter: aInfo.m_eJoin = PDFWriter::joinMiter;break;
- case SvtGraphicStroke::joinRound: aInfo.m_eJoin = PDFWriter::joinRound;break;
- case SvtGraphicStroke::joinBevel: aInfo.m_eJoin = PDFWriter::joinBevel;break;
- case SvtGraphicStroke::joinNone:
- aInfo.m_eJoin = PDFWriter::joinMiter;
- aInfo.m_fMiterLimit = 0.0;
- break;
- }
- aInfo.m_aDashArray = aDashArray;
-
- if(SvtGraphicStroke::joinNone == aStroke.getJoinType()
- && fStrokeWidth > 0.0)
- {
- // emulate no edge rounding by handling single edges
- const sal_uInt16 nPoints(aPath.GetSize());
- const bool bCurve(aPath.HasFlags());
-
- for(sal_uInt16 a(0); a + 1 < nPoints; a++)
- {
- if(bCurve
- && POLY_NORMAL != aPath.GetFlags(a + 1)
- && a + 2 < nPoints
- && POLY_NORMAL != aPath.GetFlags(a + 2)
- && a + 3 < nPoints)
- {
- const Polygon aSnippet(4,
- aPath.GetConstPointAry() + a,
- aPath.GetConstFlagAry() + a);
- rWriter.DrawPolyLine( aSnippet, aInfo );
- a += 2;
- }
- else
- {
- const Polygon aSnippet(2,
- aPath.GetConstPointAry() + a);
- rWriter.DrawPolyLine( aSnippet, aInfo );
- }
- }
- }
- else
- {
- rWriter.DrawPolyLine( aPath, aInfo );
- }
- }
- }
- else if ( pA->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) )
- {
- sSeqEnd = ByteString( "XPATHFILL_SEQ_END" );
- SvtGraphicFill aFill;
- aMemStm >> aFill;
-
- if ( ( aFill.getFillType() == SvtGraphicFill::fillSolid ) && ( aFill.getFillRule() == SvtGraphicFill::fillEvenOdd ) )
- {
- double fTransparency = aFill.getTransparency();
- if ( fTransparency == 0.0 )
- {
- PolyPolygon aPath;
- aFill.getPath( aPath );
-
- bSkipSequence = sal_True;
- rWriter.DrawPolyPolygon( aPath );
- }
- else if ( fTransparency == 1.0 )
- bSkipSequence = sal_True;
- }
- }
- if ( bSkipSequence )
- {
- while( ++i < nCount )
- {
- pAction = aMtf.GetAction( i );
- if ( pAction->GetType() == META_COMMENT_ACTION )
- {
- ByteString sComment( ((MetaCommentAction*)pAction)->GetComment() );
- if ( sComment.Equals( sSeqEnd ) )
- break;
- }
- // #i44496#
- // the replacement action for stroke is a filled rectangle
- // the set fillcolor of the replacement is part of the graphics
- // state and must not be skipped
- else if( pAction->GetType() == META_FILLCOLOR_ACTION )
- {
- const MetaFillColorAction* pMA = (const MetaFillColorAction*) pAction;
- if( pMA->IsSetting() )
- rWriter.SetFillColor( pMA->GetColor() );
- else
- rWriter.SetFillColor();
- }
- }
- }
- }
- }
- }
- break;
-
- case( META_BMP_ACTION ):
- {
- const MetaBmpAction* pA = (const MetaBmpAction*) pAction;
- BitmapEx aBitmapEx( pA->GetBitmap() );
- Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(),
- aBitmapEx.GetPrefMapMode(), rDummyVDev.GetMapMode() ) );
- if( ! ( aSize.Width() && aSize.Height() ) )
- aSize = rDummyVDev.PixelToLogic( aBitmapEx.GetSizePixel() );
- ImplWriteBitmapEx( rWriter, rDummyVDev, pA->GetPoint(), aSize, aBitmapEx );
- }
- break;
-
- case( META_BMPSCALE_ACTION ):
- {
- const MetaBmpScaleAction* pA = (const MetaBmpScaleAction*) pAction;
- ImplWriteBitmapEx( rWriter, rDummyVDev, pA->GetPoint(), pA->GetSize(), BitmapEx( pA->GetBitmap() ) );
- }
- break;
-
- case( META_BMPSCALEPART_ACTION ):
- {
- const MetaBmpScalePartAction* pA = (const MetaBmpScalePartAction*) pAction;
- BitmapEx aBitmapEx( pA->GetBitmap() );
- aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
- ImplWriteBitmapEx( rWriter, rDummyVDev, pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx );
- }
- break;
-
- case( META_BMPEX_ACTION ):
- {
- const MetaBmpExAction* pA = (const MetaBmpExAction*) pAction;
- BitmapEx aBitmapEx( pA->GetBitmapEx() );
- Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(),
- aBitmapEx.GetPrefMapMode(), rDummyVDev.GetMapMode() ) );
- ImplWriteBitmapEx( rWriter, rDummyVDev, pA->GetPoint(), aSize, aBitmapEx );
- }
- break;
-
- case( META_BMPEXSCALE_ACTION ):
- {
- const MetaBmpExScaleAction* pA = (const MetaBmpExScaleAction*) pAction;
- ImplWriteBitmapEx( rWriter, rDummyVDev, pA->GetPoint(), pA->GetSize(), pA->GetBitmapEx() );
- }
- break;
-
- case( META_BMPEXSCALEPART_ACTION ):
- {
- const MetaBmpExScalePartAction* pA = (const MetaBmpExScalePartAction*) pAction;
- BitmapEx aBitmapEx( pA->GetBitmapEx() );
- aBitmapEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
- ImplWriteBitmapEx( rWriter, rDummyVDev, pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx );
- }
- break;
-
- case( META_MASK_ACTION ):
- case( META_MASKSCALE_ACTION ):
- case( META_MASKSCALEPART_ACTION ):
- {
- OSL_FAIL( "MetaMask...Action not supported yet" );
- }
- break;
-
- case( META_TEXT_ACTION ):
- {
- const MetaTextAction* pA = (const MetaTextAction*) pAction;
- rWriter.DrawText( pA->GetPoint(), String( pA->GetText(), pA->GetIndex(), pA->GetLen() ) );
- }
- break;
-
- case( META_TEXTRECT_ACTION ):
- {
- const MetaTextRectAction* pA = (const MetaTextRectAction*) pAction;
- rWriter.DrawText( pA->GetRect(), String( pA->GetText() ), pA->GetStyle() );
- }
- break;
-
- case( META_TEXTARRAY_ACTION ):
- {
- const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pAction;
- rWriter.DrawTextArray( pA->GetPoint(), pA->GetText(), pA->GetDXArray(), pA->GetIndex(), pA->GetLen() );
- }
- break;
-
- case( META_STRETCHTEXT_ACTION ):
- {
- const MetaStretchTextAction* pA = (const MetaStretchTextAction*) pAction;
- rWriter.DrawStretchText( pA->GetPoint(), pA->GetWidth(), pA->GetText(), pA->GetIndex(), pA->GetLen() );
- }
- break;
-
-
- case( META_TEXTLINE_ACTION ):
- {
- const MetaTextLineAction* pA = (const MetaTextLineAction*) pAction;
- rWriter.DrawTextLine( pA->GetStartPoint(), pA->GetWidth(), pA->GetStrikeout(), pA->GetUnderline(), pA->GetOverline() );
-
- }
- break;
-
- case( META_CLIPREGION_ACTION ):
- {
- const MetaClipRegionAction* pA = (const MetaClipRegionAction*) pAction;
-
- if( pA->IsClipping() )
- {
- if( pA->GetRegion().IsEmpty() )
- rWriter.SetClipRegion( basegfx::B2DPolyPolygon() );
- else
- {
- Region aReg( pA->GetRegion() );
- rWriter.SetClipRegion( aReg.ConvertToB2DPolyPolygon() );
- }
- }
- else
- rWriter.SetClipRegion();
- }
- break;
-
- case( META_ISECTRECTCLIPREGION_ACTION ):
- {
- const MetaISectRectClipRegionAction* pA = (const MetaISectRectClipRegionAction*) pAction;
- rWriter.IntersectClipRegion( pA->GetRect() );
- }
- break;
-
- case( META_ISECTREGIONCLIPREGION_ACTION ):
- {
- const MetaISectRegionClipRegionAction* pA = (const MetaISectRegionClipRegionAction*) pAction;
- Region aReg( pA->GetRegion() );
- rWriter.IntersectClipRegion( aReg.ConvertToB2DPolyPolygon() );
- }
- break;
-
- case( META_MOVECLIPREGION_ACTION ):
- {
- const MetaMoveClipRegionAction* pA = (const MetaMoveClipRegionAction*) pAction;
- rWriter.MoveClipRegion( pA->GetHorzMove(), pA->GetVertMove() );
- }
- break;
-
- case( META_MAPMODE_ACTION ):
- {
- const_cast< MetaAction* >( pAction )->Execute( &rDummyVDev );
- rWriter.SetMapMode( rDummyVDev.GetMapMode() );
- }
- break;
-
- case( META_LINECOLOR_ACTION ):
- {
- const MetaLineColorAction* pA = (const MetaLineColorAction*) pAction;
-
- if( pA->IsSetting() )
- rWriter.SetLineColor( pA->GetColor() );
- else
- rWriter.SetLineColor();
- }
- break;
-
- case( META_FILLCOLOR_ACTION ):
- {
- const MetaFillColorAction* pA = (const MetaFillColorAction*) pAction;
-
- if( pA->IsSetting() )
- rWriter.SetFillColor( pA->GetColor() );
- else
- rWriter.SetFillColor();
- }
- break;
-
- case( META_TEXTLINECOLOR_ACTION ):
- {
- const MetaTextLineColorAction* pA = (const MetaTextLineColorAction*) pAction;
-
- if( pA->IsSetting() )
- rWriter.SetTextLineColor( pA->GetColor() );
- else
- rWriter.SetTextLineColor();
- }
- break;
-
- case( META_OVERLINECOLOR_ACTION ):
- {
- const MetaOverlineColorAction* pA = (const MetaOverlineColorAction*) pAction;
-
- if( pA->IsSetting() )
- rWriter.SetOverlineColor( pA->GetColor() );
- else
- rWriter.SetOverlineColor();
- }
- break;
-
- case( META_TEXTFILLCOLOR_ACTION ):
- {
- const MetaTextFillColorAction* pA = (const MetaTextFillColorAction*) pAction;
-
- if( pA->IsSetting() )
- rWriter.SetTextFillColor( pA->GetColor() );
- else
- rWriter.SetTextFillColor();
- }
- break;
-
- case( META_TEXTCOLOR_ACTION ):
- {
- const MetaTextColorAction* pA = (const MetaTextColorAction*) pAction;
- rWriter.SetTextColor( pA->GetColor() );
- }
- break;
-
- case( META_TEXTALIGN_ACTION ):
- {
- const MetaTextAlignAction* pA = (const MetaTextAlignAction*) pAction;
- rWriter.SetTextAlign( pA->GetTextAlign() );
- }
- break;
-
- case( META_FONT_ACTION ):
- {
- const MetaFontAction* pA = (const MetaFontAction*) pAction;
- rWriter.SetFont( pA->GetFont() );
- }
- break;
-
- case( META_PUSH_ACTION ):
- {
- const MetaPushAction* pA = (const MetaPushAction*) pAction;
-
- rDummyVDev.Push( pA->GetFlags() );
- rWriter.Push( pA->GetFlags() );
- }
- break;
-
- case( META_POP_ACTION ):
- {
- rDummyVDev.Pop();
- rWriter.Pop();
- }
- break;
-
- case( META_LAYOUTMODE_ACTION ):
- {
- const MetaLayoutModeAction* pA = (const MetaLayoutModeAction*) pAction;
- rWriter.SetLayoutMode( pA->GetLayoutMode() );
- }
- break;
-
- case META_TEXTLANGUAGE_ACTION:
- {
- const MetaTextLanguageAction* pA = (const MetaTextLanguageAction*) pAction;
- rWriter.SetDigitLanguage( pA->GetTextLanguage() );
- }
- break;
-
- case( META_WALLPAPER_ACTION ):
- {
- const MetaWallpaperAction* pA = (const MetaWallpaperAction*) pAction;
- rWriter.DrawWallpaper( pA->GetRect(), pA->GetWallpaper() );
- }
- break;
-
- case( META_RASTEROP_ACTION ):
- {
- // !!! >>> we don't want to support this actions
- }
- break;
-
- case( META_REFPOINT_ACTION ):
- {
- // !!! >>> we don't want to support this actions
- }
- break;
-
- default:
- // #i24604# Made assertion fire only once per
- // metafile. The asserted actions here are all
- // deprecated
- if( !bAssertionFired )
- {
- bAssertionFired = true;
- OSL_FAIL( "PDFExport::ImplWriteActions: deprecated and unsupported MetaAction encountered" );
- }
- break;
- }
- i++;
- }
- }
-
- return sal_True;
-}
-
-// -----------------------------------------------------------------------------
-
-void PDFExport::ImplWriteGradient( PDFWriter& rWriter, const PolyPolygon& rPolyPoly, const Gradient& rGradient, VirtualDevice& rDummyVDev )
-{
- GDIMetaFile aTmpMtf;
-
- rDummyVDev.AddGradientActions( rPolyPoly.GetBoundRect(), rGradient, aTmpMtf );
-
- rWriter.Push();
- rWriter.IntersectClipRegion( rPolyPoly.getB2DPolyPolygon() );
- ImplWriteActions( rWriter, NULL, aTmpMtf, rDummyVDev );
- rWriter.Pop();
-}
-
-// -----------------------------------------------------------------------------
-
-void PDFExport::ImplWriteBitmapEx( PDFWriter& rWriter, VirtualDevice& rDummyVDev,
- const Point& rPoint, const Size& rSize, const BitmapEx& rBitmapEx )
-{
- if ( !rBitmapEx.IsEmpty() && rSize.Width() && rSize.Height() )
- {
- BitmapEx aBitmapEx( rBitmapEx );
- Point aPoint( rPoint );
- Size aSize( rSize );
-
- // #i19065# Negative sizes have mirror semantics on
- // OutputDevice. BitmapEx and co. have no idea about that, so
- // perform that _before_ doing anything with aBitmapEx.
- ULONG nMirrorFlags(BMP_MIRROR_NONE);
- if( aSize.Width() < 0 )
- {
- aSize.Width() *= -1;
- aPoint.X() -= aSize.Width();
- nMirrorFlags |= BMP_MIRROR_HORZ;
- }
- if( aSize.Height() < 0 )
- {
- aSize.Height() *= -1;
- aPoint.Y() -= aSize.Height();
- nMirrorFlags |= BMP_MIRROR_VERT;
- }
-
- if( nMirrorFlags != BMP_MIRROR_NONE )
- {
- aBitmapEx.Mirror( nMirrorFlags );
- }
- if ( mbReduceImageResolution )
- {
- // do downsampling if neccessary
- const Size aDstSizeTwip( rDummyVDev.PixelToLogic( rDummyVDev.LogicToPixel( aSize ), MAP_TWIP ) );
- const Size aBmpSize( aBitmapEx.GetSizePixel() );
- const double fBmpPixelX = aBmpSize.Width();
- const double fBmpPixelY = aBmpSize.Height();
- const double fMaxPixelX = aDstSizeTwip.Width() * mnMaxImageResolution / 1440.0;
- const double fMaxPixelY = aDstSizeTwip.Height() * mnMaxImageResolution / 1440.0;
-
- // check, if the bitmap DPI exceeds the maximum DPI (allow 4 pixel rounding tolerance)
- if( ( ( fBmpPixelX > ( fMaxPixelX + 4 ) ) ||
- ( fBmpPixelY > ( fMaxPixelY + 4 ) ) ) &&
- ( fBmpPixelY > 0.0 ) && ( fMaxPixelY > 0.0 ) )
- {
- // do scaling
- Size aNewBmpSize;
- const double fBmpWH = fBmpPixelX / fBmpPixelY;
- const double fMaxWH = fMaxPixelX / fMaxPixelY;
-
- if( fBmpWH < fMaxWH )
- {
- aNewBmpSize.Width() = FRound( fMaxPixelY * fBmpWH );
- aNewBmpSize.Height() = FRound( fMaxPixelY );
- }
- else if( fBmpWH > 0.0 )
- {
- aNewBmpSize.Width() = FRound( fMaxPixelX );
- aNewBmpSize.Height() = FRound( fMaxPixelX / fBmpWH);
- }
- if( aNewBmpSize.Width() && aNewBmpSize.Height() )
- aBitmapEx.Scale( aNewBmpSize );
- else
- aBitmapEx.SetEmpty();
- }
- }
-
- const Size aSizePixel( aBitmapEx.GetSizePixel() );
- if ( aSizePixel.Width() && aSizePixel.Height() )
- {
- sal_Bool bUseJPGCompression = !mbUseLosslessCompression;
- if ( ( aSizePixel.Width() < 32 ) || ( aSizePixel.Height() < 32 ) )
- bUseJPGCompression = sal_False;
-
- SvMemoryStream aStrm;
- Bitmap aMask;
-
- bool bTrueColorJPG = true;
- if ( bUseJPGCompression )
- {
- sal_uInt32 nZippedFileSize; // sj: we will calculate the filesize of a zipped bitmap
- { // to determine if jpeg compression is usefull
- SvMemoryStream aTemp;
- aTemp.SetCompressMode( aTemp.GetCompressMode() | COMPRESSMODE_ZBITMAP );
- aTemp.SetVersion( SOFFICE_FILEFORMAT_40 ); // sj: up from version 40 our bitmap stream operator
- aTemp << aBitmapEx; // is capable of zlib stream compression
- aTemp.Seek( STREAM_SEEK_TO_END );
- nZippedFileSize = aTemp.Tell();
- }
- if ( aBitmapEx.IsTransparent() )
- {
- if ( aBitmapEx.IsAlpha() )
- aMask = aBitmapEx.GetAlpha().GetBitmap();
- else
- aMask = aBitmapEx.GetMask();
- }
- GraphicFilter aGraphicFilter;
- Graphic aGraphic( aBitmapEx.GetBitmap() );
- sal_uInt16 nFormatName = aGraphicFilter.GetExportFormatNumberForShortName( OUString( RTL_CONSTASCII_USTRINGPARAM( "JPG" ) ) );
- sal_Int32 nColorMode = 0;
-
- Sequence< PropertyValue > aFilterData( 2 );
- aFilterData[ 0 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) );
- aFilterData[ 0 ].Value <<= mnQuality;
- aFilterData[ 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) );
- aFilterData[ 1 ].Value <<= nColorMode;
-
- /*sal_uInt16 nError =*/ aGraphicFilter.ExportGraphic( aGraphic, String(), aStrm, nFormatName, &aFilterData );
- bTrueColorJPG = ((aGraphicFilter.GetExportGraphicHint() & GRFILTER_OUTHINT_GREY) == 0);
- aStrm.Seek( STREAM_SEEK_TO_END );
- if ( aStrm.Tell() > nZippedFileSize )
- bUseJPGCompression = sal_False;
- }
- if ( bUseJPGCompression )
- rWriter.DrawJPGBitmap( aStrm, bTrueColorJPG, aSizePixel, Rectangle( aPoint, aSize ), aMask );
- else if ( aBitmapEx.IsTransparent() )
- rWriter.DrawBitmapEx( aPoint, aSize, aBitmapEx );
- else
- rWriter.DrawBitmap( aPoint, aSize, aBitmapEx.GetBitmap() );
- }
- }
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx
index d18a5b418ad1..965a86f8cc0a 100644
--- a/filter/source/pdf/pdfexport.hxx
+++ b/filter/source/pdf/pdfexport.hxx
@@ -57,6 +57,7 @@ private:
Reference< XComponent > mxSrcDoc;
Reference< lang::XMultiServiceFactory > mxMSF;
Reference< task::XStatusIndicator > mxStatusIndicator;
+ Reference< task::XInteractionHandler > mxIH;
sal_Bool mbUseTaggedPDF;
sal_Int32 mnPDFTypeSelection;
@@ -99,9 +100,7 @@ private:
sal_Bool mbFirstPageLeft;
sal_Bool mbEncrypt;
- rtl::OUString msOpenPassword;
sal_Bool mbRestrictPermissions;
- rtl::OUString msPermissionPassword;
sal_Int32 mnPrintAllowed;
sal_Int32 mnChangesAllowed;
sal_Bool mbCanCopyOrExtract;
@@ -118,17 +117,13 @@ private:
//<---
sal_Bool ImplExportPage( ::vcl::PDFWriter& rWriter, ::vcl::PDFExtOutDevData& rPDFExtOutDevData,
const GDIMetaFile& rMtf );
- sal_Bool ImplWriteActions( ::vcl::PDFWriter& rWriter, ::vcl::PDFExtOutDevData* pPDFExtOutDevData,
- const GDIMetaFile& rMtf, VirtualDevice& rDummyVDev );
- void ImplWriteGradient( ::vcl::PDFWriter& rWriter, const PolyPolygon& rPolyPoly,
- const Gradient& rGradient, VirtualDevice& rDummyVDev );
- void ImplWriteBitmapEx( ::vcl::PDFWriter& rWriter, VirtualDevice& rDummyVDev,
- const Point& rPoint, const Size& rSize, const BitmapEx& rBitmap );
-
void ImplWriteWatermark( ::vcl::PDFWriter& rWriter, const Size& rPageSize );
public:
- PDFExport( const Reference< XComponent >& rxSrcDoc, Reference< task::XStatusIndicator >& xStatusIndicator, const Reference< lang::XMultiServiceFactory >& xFact );
+ PDFExport( const Reference< XComponent >& rxSrcDoc,
+ const Reference< task::XStatusIndicator >& xStatusIndicator,
+ const Reference< task::XInteractionHandler >& xIH,
+ const Reference< lang::XMultiServiceFactory >& xFact );
~PDFExport();
sal_Bool ExportSelection( vcl::PDFWriter& rPDFWriter, Reference< com::sun::star::view::XRenderable >& rRenderable, Any& rSelection,
diff --git a/filter/source/pdf/pdffilter.component b/filter/source/pdf/pdffilter.component
new file mode 100644
index 000000000000..438d697a77b1
--- /dev/null
+++ b/filter/source/pdf/pdffilter.component
@@ -0,0 +1,40 @@
+<?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.PDF.PDFDialog">
+ <service name="com.sun.star.document.PDFDialog"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.PDF.PDFFilter">
+ <service name="com.sun.star.document.PDFFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.PDF.PDFExportInteractionHandler">
+ <service name="com.sun.star.filter.pdfexport.PDFExportInteractionHandler"/>
+ </implementation>
+</component>
diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx
index 6de525024a6b..520f02bb3823 100644
--- a/filter/source/pdf/pdffilter.cxx
+++ b/filter/source/pdf/pdffilter.cxx
@@ -61,6 +61,7 @@ sal_Bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
const PropertyValue* pValue = rDescriptor.getConstArray();
sal_Bool bRet = sal_False;
Reference< task::XStatusIndicator > xStatusIndicator;
+ Reference< task::XInteractionHandler > xIH;
for ( sal_Int32 i = 0 ; ( i < nLength ) && !xOStm.is(); ++i)
{
@@ -70,6 +71,8 @@ sal_Bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
pValue[ i ].Value >>= aFilterData;
else if ( pValue[ i ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StatusIndicator" ) ) )
pValue[ i ].Value >>= xStatusIndicator;
+ else if( pValue[i].Name.equalsAscii( "InteractionHandler" ) )
+ pValue[i].Value >>= xIH;
}
/* we don't get FilterData if we are exporting directly
@@ -118,7 +121,7 @@ sal_Bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
}
if( mxSrcDoc.is() && xOStm.is() )
{
- PDFExport aExport( mxSrcDoc, xStatusIndicator, mxMSF );
+ PDFExport aExport( mxSrcDoc, xStatusIndicator, xIH, mxMSF );
::utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
diff --git a/filter/source/pdf/pdffilter.hxx b/filter/source/pdf/pdffilter.hxx
index e08217caa8b0..9aa4e941b28c 100644
--- a/filter/source/pdf/pdffilter.hxx
+++ b/filter/source/pdf/pdffilter.hxx
@@ -43,6 +43,7 @@
#include <com/sun/star/beans/XPropertyAccess.hpp>
#include <comphelper/property.hxx>
#include <com/sun/star/task/XStatusIndicator.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
#include <osl/diagnose.h>
#include <rtl/process.h>
diff --git a/filter/source/pdf/pdfinteract.cxx b/filter/source/pdf/pdfinteract.cxx
new file mode 100644
index 000000000000..23ea98d6bf51
--- /dev/null
+++ b/filter/source/pdf/pdfinteract.cxx
@@ -0,0 +1,137 @@
+ /*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_filter.hxx"
+
+#include "pdfinteract.hxx"
+#include "impdialog.hxx"
+
+#include "com/sun/star/task/XInteractionRequest.hpp"
+#include "com/sun/star/task/PDFExportException.hpp"
+
+// -------------
+// - PDFInteractionHandler -
+// -------------
+
+PDFInteractionHandler::PDFInteractionHandler( const Reference< XMultiServiceFactory > &rxMSF ) :
+ mxMSF( rxMSF )
+{
+}
+
+// -----------------------------------------------------------------------------
+
+PDFInteractionHandler::~PDFInteractionHandler()
+{
+}
+
+
+void SAL_CALL PDFInteractionHandler::handle( const Reference< task::XInteractionRequest >& i_xRequest )
+ throw (RuntimeException)
+{
+ handleInteractionRequest( i_xRequest );
+}
+
+sal_Bool SAL_CALL PDFInteractionHandler::handleInteractionRequest( const Reference< task::XInteractionRequest >& i_xRequest )
+ throw (RuntimeException)
+{
+ sal_Bool bHandled = sal_False;
+
+ Any aRequest( i_xRequest->getRequest() );
+ task::PDFExportException aExc;
+ if( aRequest >>= aExc )
+ {
+ std::set< vcl::PDFWriter::ErrorCode > aCodes;
+ sal_Int32 nCodes = aExc.ErrorCodes.getLength();
+ for( sal_Int32 i = 0; i < nCodes; i++ )
+ aCodes.insert( (vcl::PDFWriter::ErrorCode)aExc.ErrorCodes.getConstArray()[i] );
+ ImplErrorDialog aDlg( aCodes );
+ aDlg.Execute();
+ bHandled = sal_True;
+ }
+ return bHandled;
+}
+
+// -----------------------------------------------------------------------------
+
+OUString PDFInteractionHandler_getImplementationName ()
+ throw (RuntimeException)
+{
+ return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.PDF.PDFExportInteractionHandler" ) );
+}
+
+// -----------------------------------------------------------------------------
+
+#define SERVICE_NAME "com.sun.star.filter.pdfexport.PDFExportInteractionHandler"
+
+sal_Bool SAL_CALL PDFInteractionHandler_supportsService( const OUString& ServiceName )
+ throw (RuntimeException)
+{
+ return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ) );
+}
+
+// -----------------------------------------------------------------------------
+
+Sequence< OUString > SAL_CALL PDFInteractionHandler_getSupportedServiceNames( ) throw (RuntimeException)
+{
+ Sequence < OUString > aRet(1);
+ OUString* pArray = aRet.getArray();
+ pArray[0] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );
+ return aRet;
+}
+
+#undef SERVICE_NAME
+
+// -----------------------------------------------------------------------------
+
+Reference< XInterface > SAL_CALL PDFInteractionHandler_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception )
+{
+ return (cppu::OWeakObject*) new PDFInteractionHandler( rSMgr );
+}
+
+// -----------------------------------------------------------------------------
+
+OUString SAL_CALL PDFInteractionHandler::getImplementationName()
+ throw (RuntimeException)
+{
+ return PDFInteractionHandler_getImplementationName();
+}
+
+// -----------------------------------------------------------------------------
+
+sal_Bool SAL_CALL PDFInteractionHandler::supportsService( const OUString& rServiceName )
+ throw (RuntimeException)
+{
+ return PDFInteractionHandler_supportsService( rServiceName );
+}
+
+// -----------------------------------------------------------------------------
+
+::com::sun::star::uno::Sequence< OUString > SAL_CALL PDFInteractionHandler::getSupportedServiceNames( ) throw (RuntimeException)
+{
+ return PDFInteractionHandler_getSupportedServiceNames();
+}
diff --git a/filter/source/pdf/pdfinteract.hxx b/filter/source/pdf/pdfinteract.hxx
new file mode 100644
index 000000000000..4cffc70c962a
--- /dev/null
+++ b/filter/source/pdf/pdfinteract.hxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * 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 PDFINTERACT_HXX
+#define PDFINTERACT_HXX
+
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "cppuhelper/implbase2.hxx"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/task/XInteractionHandler2.hpp"
+
+using namespace ::rtl;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+
+// -------------
+// - PDFFilter -
+// -------------
+
+class PDFInteractionHandler : public cppu::WeakImplHelper2 < task::XInteractionHandler2,
+ XServiceInfo >
+{
+private:
+
+ Reference< XMultiServiceFactory > mxMSF;
+
+protected:
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw(RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(RuntimeException);
+ virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(RuntimeException);
+
+ // XIniteractionHandler
+ virtual void SAL_CALL handle( const Reference< task::XInteractionRequest >& ) throw(RuntimeException);
+
+ // XIniteractionHandler2
+ virtual sal_Bool SAL_CALL handleInteractionRequest( const Reference< task::XInteractionRequest >& ) throw(RuntimeException);
+public:
+
+ PDFInteractionHandler( const Reference< XMultiServiceFactory >& rxMSF );
+ virtual ~PDFInteractionHandler();
+};
+
+// -----------------------------------------------------------------------------
+
+OUString PDFInteractionHandler_getImplementationName ()
+ throw ( RuntimeException );
+
+// -----------------------------------------------------------------------------
+
+sal_Bool SAL_CALL PDFInteractionHandler_supportsService( const OUString& ServiceName )
+ throw ( RuntimeException );
+
+// -----------------------------------------------------------------------------
+
+Sequence< OUString > SAL_CALL PDFInteractionHandler_getSupportedServiceNames( )
+ throw ( RuntimeException );
+
+// -----------------------------------------------------------------------------
+
+Reference< XInterface >
+SAL_CALL PDFInteractionHandler_createInstance( const Reference< XMultiServiceFactory > & rSMgr)
+ throw ( Exception );
+
+#endif // PDFINTERACT_HXX
+
diff --git a/filter/source/pdf/pdfuno.cxx b/filter/source/pdf/pdfuno.cxx
index 59ef536df046..3dc446d4bad7 100644
--- a/filter/source/pdf/pdfuno.cxx
+++ b/filter/source/pdf/pdfuno.cxx
@@ -37,6 +37,7 @@
#include <pdffilter.hxx>
#include <pdfdialog.hxx>
+#include <pdfinteract.hxx>
using namespace ::rtl;
using namespace ::cppu;
@@ -54,41 +55,6 @@ extern "C"
// -------------------------------------------------------------------------
- SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
- {
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey;
- sal_Int32 nPos;
-
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( PDFFilter_getImplementationName() );
- xNewKey = xNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" )) );
- const Sequence< OUString > & rSNL1 = PDFFilter_getSupportedServiceNames();
- const OUString * pArray1 = rSNL1.getConstArray();
- for ( nPos = rSNL1.getLength(); nPos--; )
- xNewKey->createKey( pArray1[nPos] );
-
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( PDFDialog_getImplementationName() );
- xNewKey = xNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" )) );
- const Sequence< OUString > & rSNL2 = PDFDialog_getSupportedServiceNames();
- const OUString * pArray2 = rSNL2.getConstArray();
- for ( nPos = rSNL2.getLength(); nPos--; )
- xNewKey->createKey( pArray2[nPos] );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
- }
-
- // -------------------------------------------------------------------------
-
SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
OUString aImplName( OUString::createFromAscii( pImplName ) );
@@ -112,6 +78,13 @@ extern "C"
PDFDialog_createInstance, PDFDialog_getSupportedServiceNames() );
}
+ else if( aImplName.equals( PDFInteractionHandler_getImplementationName() ) )
+ {
+ xFactory = createSingleFactory( reinterpret_cast< XMultiServiceFactory* >( pServiceManager ),
+ OUString::createFromAscii( pImplName ),
+ PDFInteractionHandler_createInstance, PDFInteractionHandler_getSupportedServiceNames() );
+
+ }
if( xFactory.is() )
{
diff --git a/filter/source/placeware/exports.dxp b/filter/source/placeware/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644
--- a/filter/source/placeware/exports.dxp
+++ b/filter/source/placeware/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/filter/source/placeware/makefile.mk b/filter/source/placeware/makefile.mk
index 3238193c52ae..e3bd32a9197f 100644
--- a/filter/source/placeware/makefile.mk
+++ b/filter/source/placeware/makefile.mk
@@ -65,3 +65,11 @@ DEF1NAME= $(SHL1TARGET)
# --- Targets ----------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/placeware.component
+
+$(MISC)/placeware.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ placeware.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt placeware.component
diff --git a/filter/source/placeware/placeware.component b/filter/source/placeware/placeware.component
new file mode 100644
index 000000000000..9a6ca703ef2d
--- /dev/null
+++ b/filter/source/placeware/placeware.component
@@ -0,0 +1,34 @@
+<?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.Impress.PlaceWareExportFilter">
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
+</component>
diff --git a/filter/source/placeware/uno.cxx b/filter/source/placeware/uno.cxx
index d7c8795ca20f..f8f1298b5283 100644
--- a/filter/source/placeware/uno.cxx
+++ b/filter/source/placeware/uno.cxx
@@ -60,32 +60,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//==================================================================================================
-sal_Bool SAL_CALL component_writeInfo(
- void * /* pServiceManager */, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( PlaceWareExportFilter_getImplementationName() ) );
- xNewKey = xNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" )) );
-
- const Sequence< OUString > & rSNL = PlaceWareExportFilter_getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-//==================================================================================================
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
{
diff --git a/filter/source/svg/makefile.mk b/filter/source/svg/makefile.mk
index a7df46b680e6..2df67b04bf08 100644
--- a/filter/source/svg/makefile.mk
+++ b/filter/source/svg/makefile.mk
@@ -92,13 +92,13 @@ DEF1NAME=$(SHL1TARGET)
.INCLUDE : target.mk
-# Generate gperf files - from oox/source/token
-$(INCCOM)$/tokens.hxx $(MISC)$/tokens.gperf : tokens.txt gentoken.pl
- $(PERL) gentoken.pl tokens.txt $(INCCOM)$/tokens.hxx $(MISC)$/tokens.gperf
-
-$(INCCOM)$/tokens.cxx : $(MISC)$/tokens.gperf makefile.mk
- $(GPERF) --compare-strncmp -C -m 20 $(MISC)$/tokens.gperf | $(SED) -e "s/(char\*)0/(char\*)0, 0/g" >$(INCCOM)$/tokens.cxx
+ALLTAR : $(MISC)/svgfilter.component
+$(MISC)/svgfilter.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ svgfilter.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt svgfilter.component
$(SLO)$/tokenmap.obj : $(INCCOM)$/tokens.cxx $(INCCOM)$/tokens.hxx
$(SLO)$/parserfragments.obj : $(INCCOM)$/tokens.cxx $(INCCOM)$/tokens.hxx
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 3661315d097e..06ae7d011ecb 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -327,7 +327,7 @@ sal_Bool SVGFilter::implExportDocument( const Reference< XDrawPages >& rxMasterP
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns", B2UCONST( "http://www.w3.org/2000/svg" ) );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:xlink", B2UCONST( "http://www.w3.org/1999/xlink" ) );
- mpSVGDoc = new SvXMLElementExport( *mpSVGExport, XML_NAMESPACE_NONE, "svg", TRUE, TRUE );
+ mpSVGDoc = new SvXMLElementExport( *mpSVGExport, XML_NAMESPACE_NONE, "svg", sal_True, sal_True );
while( ( nCurPage <= nLastPage ) && ( -1 == nVisible ) )
{
@@ -410,7 +410,7 @@ sal_Bool SVGFilter::implGenerateMetaData( const Reference< XDrawPages >& /* rxMa
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "numberOfSlides", OUString::valueOf( rxDrawPages->getCount() ) );
{
- SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "ooo:slidesInfo", TRUE, TRUE );
+ SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "ooo:slidesInfo", sal_True, sal_True );
const OUString aId( B2UCONST( "meta_slide" ) );
for( sal_Int32 i = 0, nCount = rxDrawPages->getCount(); i < nCount; ++i )
@@ -443,7 +443,7 @@ sal_Bool SVGFilter::implGenerateMetaData( const Reference< XDrawPages >& /* rxMa
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "master-visibility", aMasterVisibility );
{
- SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "ooo:slideInfo", TRUE, TRUE );
+ SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "ooo:slideInfo", sal_True, sal_True );
}
}
}
@@ -463,7 +463,7 @@ sal_Bool SVGFilter::implGenerateScript( const Reference< XDrawPages >& /* rxMast
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "type", B2UCONST( "text/ecmascript" ) );
{
- SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "script", TRUE, TRUE );
+ SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "script", sal_True, sal_True );
Reference< XExtendedDocumentHandler > xExtDocHandler( mpSVGExport->GetDocHandler(), UNO_QUERY );
if( xExtDocHandler.is() )
@@ -639,7 +639,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
if( xShapes.is() )
{
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", B2UCONST( "Group" ) );
- SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", TRUE, TRUE );
+ SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
bRet = implExportShapes( xShapes );
}
@@ -657,7 +657,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
{
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", implGetClassFromShape( rxShape ) );
- SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", TRUE, TRUE );
+ SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
Reference< XExtendedDocumentHandler > xExtDocHandler( mpSVGExport->GetDocHandler(), UNO_QUERY );
@@ -665,7 +665,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
xShapePropSet->getPropertyValue( B2UCONST( "Title" ) ) >>= aTitle;
if( aTitle.getLength() )
{
- SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "title", TRUE, TRUE );
+ SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "title", sal_True, sal_True );
xExtDocHandler->characters( aTitle );
}
@@ -673,13 +673,13 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
xShapePropSet->getPropertyValue( B2UCONST( "Description" ) ) >>= aDescription;
if( aDescription.getLength() )
{
- SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "desc", TRUE, TRUE );
+ SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "desc", sal_True, sal_True );
xExtDocHandler->characters( aDescription );
}
if( rMtf.GetActionCount() )
{
- SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", TRUE, TRUE );
+ SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
mpSVGWriter->WriteMetaFile( aTopLeft, aSize, rMtf, SVGWRITER_WRITE_ALL);
}
}
diff --git a/filter/source/svg/svgfilter.component b/filter/source/svg/svgfilter.component
new file mode 100644
index 000000000000..82db624ff9e0
--- /dev/null
+++ b/filter/source/svg/svgfilter.component
@@ -0,0 +1,34 @@
+<?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.Draw.SVGFilter">
+ <service name="com.sun.star.document.SVGFilter"/>
+ </implementation>
+</component>
diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index 25efa6cd0ba7..b214e8451042 100644
--- a/filter/source/svg/svgfilter.hxx
+++ b/filter/source/svg/svgfilter.hxx
@@ -112,7 +112,7 @@ private:
protected:
virtual void _ExportMeta() {}
- virtual void _ExportStyles( BOOL /* bUsed */ ) {}
+ virtual void _ExportStyles( sal_Bool /* bUsed */ ) {}
virtual void _ExportAutoStyles() {}
virtual void _ExportContent() {}
virtual void _ExportMasterStyles() {}
diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx
index b280c7a13b02..3eed223f0b58 100644
--- a/filter/source/svg/svgfontexport.cxx
+++ b/filter/source/svg/svgfontexport.cxx
@@ -72,7 +72,7 @@ void SVGFontExport::implCollectGlyphs()
{
::rtl::OUString aText;
MetaAction* pAction = rMtf.GetAction( i );
- const USHORT nType = pAction->GetType();
+ const sal_uInt16 nType = pAction->GetType();
switch( nType )
{
@@ -135,7 +135,7 @@ void SVGFontExport::implEmbedFont( const ::rtl::OUString& rFontName, const ::std
const ::rtl::OUString aEmbeddedFontStr( B2UCONST( "EmbeddedFont_" ) );
{
- SvXMLElementExport aExp( mrExport, XML_NAMESPACE_NONE, "defs", TRUE, TRUE );
+ SvXMLElementExport aExp( mrExport, XML_NAMESPACE_NONE, "defs", sal_True, sal_True );
::rtl::OUString aCurIdStr( aEmbeddedFontStr );
::rtl::OUString aUnitsPerEM( SVGActionWriter::GetValueString( nFontEM ) );
VirtualDevice aVDev;
@@ -149,7 +149,7 @@ void SVGFontExport::implEmbedFont( const ::rtl::OUString& rFontName, const ::std
mrExport.AddAttribute( XML_NAMESPACE_NONE, "horiz-adv-x", aUnitsPerEM );
{
- SvXMLElementExport aExp2( mrExport, XML_NAMESPACE_NONE, "font", TRUE, TRUE );
+ SvXMLElementExport aExp2( mrExport, XML_NAMESPACE_NONE, "font", sal_True, sal_True );
Point aPos;
Size aSize( nFontEM, nFontEM );
PolyPolygon aMissingGlyphPolyPoly( Rectangle( aPos, aSize ) );
@@ -163,7 +163,7 @@ void SVGFontExport::implEmbedFont( const ::rtl::OUString& rFontName, const ::std
mrExport.AddAttribute( XML_NAMESPACE_NONE, "descent", SVGActionWriter::GetValueString( aVDev.GetFontMetric().GetDescent() ) );
{
- SvXMLElementExport aExp3( mrExport, XML_NAMESPACE_NONE, "font-face", TRUE, TRUE );
+ SvXMLElementExport aExp3( mrExport, XML_NAMESPACE_NONE, "font-face", sal_True, sal_True );
}
mrExport.AddAttribute( XML_NAMESPACE_NONE, "horiz-adv-x", SVGActionWriter::GetValueString( aSize.Width() ) );
@@ -172,7 +172,7 @@ void SVGFontExport::implEmbedFont( const ::rtl::OUString& rFontName, const ::std
mrExport.AddAttribute( XML_NAMESPACE_NONE, "d", SVGActionWriter::GetPathString( aMissingGlyphPolyPoly, sal_False ) );
{
- SvXMLElementExport aExp3( mrExport, XML_NAMESPACE_NONE, "missing-glyph", TRUE, TRUE );
+ SvXMLElementExport aExp3( mrExport, XML_NAMESPACE_NONE, "missing-glyph", sal_True, sal_True );
}
while( aIter != rGlyphs.end() )
@@ -217,7 +217,7 @@ void SVGFontExport::implEmbedGlyph( OutputDevice& rOut, const ::rtl::OUString& r
}
{
- SvXMLElementExport aExp( mrExport, XML_NAMESPACE_NONE, "glyph", TRUE, TRUE );
+ SvXMLElementExport aExp( mrExport, XML_NAMESPACE_NONE, "glyph", sal_True, sal_True );
}
}
}
diff --git a/filter/source/svg/svguno.cxx b/filter/source/svg/svguno.cxx
index 92e092e8155c..5b7c1df9ccb4 100644
--- a/filter/source/svg/svguno.cxx
+++ b/filter/source/svg/svguno.cxx
@@ -52,32 +52,6 @@ extern "C"
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//==================================================================================================
- SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void * /* pServiceManager */, void * pRegistryKey )
- {
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( SVGFilter_getImplementationName() ) );
- xNewKey = xNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" )) );
-
- const Sequence< OUString > & rSNL = SVGFilter_getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
- }
- //==================================================================================================
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
{
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index c14a0f5773a8..8f7a9bf31740 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -364,7 +364,7 @@ void SVGAttributeWriter::SetFontAttr( const Font& rFont )
delete mpElemPaint, mpElemPaint = NULL;
delete mpElemFont;
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStyle, GetFontStyle( maCurFont = rFont ) );
- mpElemFont = new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemG, TRUE, TRUE );
+ mpElemFont = new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemG, sal_True, sal_True );
}
}
@@ -376,7 +376,7 @@ void SVGAttributeWriter::SetPaintAttr( const Color& rLineColor, const Color& rFi
{
delete mpElemPaint;
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStyle, GetPaintStyle( maCurLineColor = rLineColor, maCurFillColor = rFillColor, pLineInfo ) );
- mpElemPaint = new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemG, TRUE, TRUE );
+ mpElemPaint = new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemG, sal_True, sal_True );
}
}
@@ -488,8 +488,8 @@ NMSP_RTL::OUString SVGActionWriter::GetPathString( const PolyPolygon& rPolyPoly
for( long i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ )
{
- const Polygon& rPoly = rPolyPoly[ (USHORT) i ];
- USHORT n = 1, nSize = rPoly.GetSize();
+ const Polygon& rPoly = rPolyPoly[ (sal_uInt16) i ];
+ sal_uInt16 n = 1, nSize = rPoly.GetSize();
if( nSize > 1 )
{
@@ -566,7 +566,7 @@ void SVGActionWriter::ImplWriteLine( const Point& rPt1, const Point& rPt2, const
}
{
- SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemLine, TRUE, TRUE );
+ SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemLine, sal_True, sal_True );
}
}
@@ -593,7 +593,7 @@ void SVGActionWriter::ImplWriteRect( const Rectangle& rRect, long nRadX, long nR
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStyle, *pStyle );
{
- SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemRect, TRUE, TRUE );
+ SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemRect, sal_True, sal_True );
}
}
@@ -614,7 +614,7 @@ void SVGActionWriter::ImplWriteEllipse( const Point& rCenter, long nRadX, long n
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrStyle, *pStyle );
{
- SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemEllipse, TRUE, TRUE );
+ SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemEllipse, sal_True, sal_True );
}
}
@@ -628,10 +628,10 @@ void SVGActionWriter::ImplWritePolyPolygon( const PolyPolygon& rPolyPoly, sal_Bo
PolyPolygon aMappedPolyPoly;
FastString aStyle;
- for( USHORT i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ )
+ for( sal_uInt16 i = 0, nCount = rPolyPoly.Count(); i < nCount; i++ )
{
const Polygon& rPoly = rPolyPoly[ i ];
- const USHORT nSize = rPoly.GetSize();
+ const sal_uInt16 nSize = rPoly.GetSize();
// #i102224# congratulations, this throws away the curve flags
// and makes ANY curved polygon look bad. The Flags HAVE to be
@@ -642,7 +642,7 @@ void SVGActionWriter::ImplWritePolyPolygon( const PolyPolygon& rPolyPoly, sal_Bo
// new:
Polygon aMappedPoly(rPoly);
- for( USHORT n = 0; n < nSize; n++ )
+ for( sal_uInt16 n = 0; n < nSize; n++ )
aMappedPoly[ n ] = ImplMap( rPoly[ n ] );
aMappedPolyPoly.Insert( aMappedPoly );
@@ -665,7 +665,7 @@ void SVGActionWriter::ImplWritePolyPolygon( const PolyPolygon& rPolyPoly, sal_Bo
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrD, GetPathString( aMappedPolyPoly, bLineOnly ) );
{
// write polyline/polygon element
- SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemPath, TRUE, TRUE );
+ SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemPath, sal_True, sal_True );
}
}
}
@@ -758,14 +758,14 @@ void SVGActionWriter::ImplWriteGradientLinear( const PolyPolygon& rPolyPoly,
{
if( rPolyPoly.Count() )
{
- SvXMLElementExport aElemG( mrExport, XML_NAMESPACE_NONE, aXMLElemG, TRUE, TRUE );
+ SvXMLElementExport aElemG( mrExport, XML_NAMESPACE_NONE, aXMLElemG, sal_True, sal_True );
FastString aGradientId;
aGradientId += B2UCONST( "gradient" );
aGradientId += GetValueString( ImplGetNextGradientId() );
{
- SvXMLElementExport aElemDefs( mrExport, XML_NAMESPACE_NONE, aXMLElemDefs, TRUE, TRUE );
+ SvXMLElementExport aElemDefs( mrExport, XML_NAMESPACE_NONE, aXMLElemDefs, sal_True, sal_True );
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrId, aGradientId.GetString() );
{
@@ -795,7 +795,7 @@ void SVGActionWriter::ImplWriteGradientLinear( const PolyPolygon& rPolyPoly,
}
{
- SvXMLElementExport aElemLinearGradient( mrExport, XML_NAMESPACE_NONE, aXMLElemLinearGradient, TRUE, TRUE );
+ SvXMLElementExport aElemLinearGradient( mrExport, XML_NAMESPACE_NONE, aXMLElemLinearGradient, sal_True, sal_True );
const Color aStartColor = ImplGetColorWithIntensity( rGradient.GetStartColor(), rGradient.GetStartIntensity() );
const Color aEndColor = ImplGetColorWithIntensity( rGradient.GetEndColor(), rGradient.GetEndIntensity() );
@@ -1096,7 +1096,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText,
if( nLen > 1 )
{
- aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( rText.GetChar( sal::static_int_cast<USHORT>( nLen - 1 ) ) );
+ aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( rText.GetChar( sal::static_int_cast<sal_uInt16>( nLen - 1 ) ) );
if( nWidth && aNormSize.Width() && ( nWidth != aNormSize.Width() ) )
{
@@ -1177,7 +1177,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText,
// write text element
{
#ifdef _SVG_USE_TSPANS
- SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemText, TRUE, TRUE );
+ SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, aXMLElemText, sal_True, sal_True );
FastString aTSpanX;
const NMSP_RTL::OUString aSpace( ' ' );
String aOutputText( rText );
@@ -1186,25 +1186,25 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText,
for( long j = 0, nX = aPt.X(); j < nLen; ++j )
{
- const sal_Unicode cCode = rText.GetChar( sal::static_int_cast<USHORT>( j ) );
+ const sal_Unicode cCode = rText.GetChar( sal::static_int_cast<sal_uInt16>( j ) );
// don't take more than one whitespace into account
if( !bIgnoreWhitespace || ( ' ' != cCode ) )
{
- aOutputText.SetChar( sal::static_int_cast<USHORT>( nCurPos++ ), cCode );
+ aOutputText.SetChar( sal::static_int_cast<sal_uInt16>( nCurPos++ ), cCode );
( aTSpanX += GetValueString( nX + ( ( j > 0 ) ? pDX[ j - 1 ] : 0 ) ) ) += aSpace;
bIgnoreWhitespace = ( ' ' == cCode );
}
}
if( nCurPos < nLen )
- aOutputText.Erase( sal::static_int_cast<USHORT>( nCurPos ) );
+ aOutputText.Erase( sal::static_int_cast<sal_uInt16>( nCurPos ) );
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, aTSpanX.GetString() );
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY, GetValueString( aPt.Y() ) );
{
- SvXMLElementExport aElem2( mrExport, XML_NAMESPACE_NONE, aXMLElemTSpan, TRUE, TRUE );
+ SvXMLElementExport aElem2( mrExport, XML_NAMESPACE_NONE, aXMLElemTSpan, sal_True, sal_True );
mrExport.GetDocHandler()->characters( aOutputText );
}
#else
@@ -1212,7 +1212,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText,
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY, GetValueString( aPt.Y() ) );
{
- SvXMLElementExport aElem2( mrExport, XML_NAMESPACE_NONE, aXMLElemText, TRUE, TRUE );
+ SvXMLElementExport aElem2( mrExport, XML_NAMESPACE_NONE, aXMLElemText, sal_True, sal_True );
mrExport.GetDocHandler()->characters( rText );
}
#endif
@@ -1307,10 +1307,10 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
{
ImplAcquireContext();
- for( ULONG i = 0, nCount = rMtf.GetActionCount(); i < nCount; i++ )
+ for( sal_uLong i = 0, nCount = rMtf.GetActionCount(); i < nCount; i++ )
{
const MetaAction* pAction = rMtf.GetAction( i );
- const USHORT nType = pAction->GetType();
+ const sal_uInt16 nType = pAction->GetType();
switch( nType )
{
@@ -1560,8 +1560,8 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
const Color aOldLineColor( mpVDev->GetLineColor() ), aOldFillColor( mpVDev->GetFillColor() );
Color aNewLineColor( aOldLineColor ), aNewFillColor( aOldFillColor );
- aNewLineColor.SetTransparency( sal::static_int_cast<UINT8>( FRound( pA->GetTransparence() * 2.55 ) ) );
- aNewFillColor.SetTransparency( sal::static_int_cast<UINT8>( FRound( pA->GetTransparence() * 2.55 ) ) );
+ aNewLineColor.SetTransparency( sal::static_int_cast<sal_uInt8>( FRound( pA->GetTransparence() * 2.55 ) ) );
+ aNewFillColor.SetTransparency( sal::static_int_cast<sal_uInt8>( FRound( pA->GetTransparence() * 2.55 ) ) );
mpContext->SetPaintAttr( aNewLineColor, aNewFillColor );
ImplWritePolyPolygon( rPolyPoly, sal_False, pStyle );
@@ -1591,7 +1591,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf,
const GDIMetaFile aGDIMetaFile( pA->GetSubstitute() );
sal_Bool bFound = sal_False;
- for( ULONG j = 0, nC = aGDIMetaFile.GetActionCount(); ( j < nC ) && !bFound; j++ )
+ for( sal_uLong j = 0, nC = aGDIMetaFile.GetActionCount(); ( j < nC ) && !bFound; j++ )
{
const MetaAction* pSubstAct = aGDIMetaFile.GetAction( j );
diff --git a/filter/source/t602/filterenv.cxx b/filter/source/t602/filterenv.cxx
index 4327cc251b06..ab59b32f0463 100644
--- a/filter/source/t602/filterenv.cxx
+++ b/filter/source/t602/filterenv.cxx
@@ -53,41 +53,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//==================================================================================================
-sal_Bool SAL_CALL component_writeInfo(
- void * /* pServiceManager */, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- sal_Int32 nPos = 0;
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( T602ImportFilter_getImplementationName() ) );
- xNewKey = xNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" )) );
-
- const Sequence< OUString > & rSNL = T602ImportFilter_getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
- for ( nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( T602ImportFilterDialog_getImplementationName() );
- xNewKey = xNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" )) );
-
- const Sequence< OUString > & rSNL2 = T602ImportFilterDialog_getSupportedServiceNames();
- pArray = rSNL2.getConstArray();
- for ( nPos = rSNL2.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-//==================================================================================================
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
{
diff --git a/filter/source/t602/makefile.mk b/filter/source/t602/makefile.mk
index f5ee62405f7e..fce84f916f81 100644
--- a/filter/source/t602/makefile.mk
+++ b/filter/source/t602/makefile.mk
@@ -59,3 +59,11 @@ SHL1STDLIBS= \
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/t602filter.component
+
+$(MISC)/t602filter.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ t602filter.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt t602filter.component
diff --git a/filter/source/t602/t602filter.component b/filter/source/t602/t602filter.component
new file mode 100644
index 000000000000..fe512bf483ca
--- /dev/null
+++ b/filter/source/t602/t602filter.component
@@ -0,0 +1,38 @@
+<?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.Writer.T602ImportFilter">
+ <service name="com.sun.star.document.ExtendedTypeDetection"/>
+ <service name="com.sun.star.document.ImportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Writer.T602ImportFilterDialog">
+ <service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/>
+ </implementation>
+</component>
diff --git a/filter/source/xmlfilteradaptor/genericfilter.cxx b/filter/source/xmlfilteradaptor/genericfilter.cxx
index 2b312fdedfcb..48776a09ac8d 100644
--- a/filter/source/xmlfilteradaptor/genericfilter.cxx
+++ b/filter/source/xmlfilteradaptor/genericfilter.cxx
@@ -54,34 +54,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//==================================================================================================
-sal_Bool SAL_CALL component_writeInfo(
- void * /* pServiceManager */, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( XmlFilterAdaptor_getImplementationName() ) );
- xNewKey = xNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" )) );
-
- const Sequence< OUString > & rSNL = XmlFilterAdaptor_getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
-
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-
-//==================================================================================================
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
{
diff --git a/filter/source/xmlfilteradaptor/makefile.mk b/filter/source/xmlfilteradaptor/makefile.mk
index b3d39f860388..0e3732c20885 100644
--- a/filter/source/xmlfilteradaptor/makefile.mk
+++ b/filter/source/xmlfilteradaptor/makefile.mk
@@ -60,3 +60,11 @@ SHL1STDLIBS= $(COMPHELPERLIB) \
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/xmlfa.component
+
+$(MISC)/xmlfa.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ xmlfa.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt xmlfa.component
diff --git a/filter/source/xmlfilteradaptor/xmlfa.component b/filter/source/xmlfilteradaptor/xmlfa.component
new file mode 100644
index 000000000000..d835782c2f38
--- /dev/null
+++ b/filter/source/xmlfilteradaptor/xmlfa.component
@@ -0,0 +1,35 @@
+<?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.Writer.XmlFilterAdaptor">
+ <service name="com.sun.star.document.ExportFilter"/>
+ <service name="com.sun.star.document.ImportFilter"/>
+ </implementation>
+</component>
diff --git a/filter/source/xmlfilterdetect/fdcomp.cxx b/filter/source/xmlfilterdetect/fdcomp.cxx
index 82731faf90fb..5d172bdf534a 100644
--- a/filter/source/xmlfilterdetect/fdcomp.cxx
+++ b/filter/source/xmlfilterdetect/fdcomp.cxx
@@ -83,58 +83,6 @@ void SAL_CALL component_getImplementationEnvironment(
//==================================================================================================
-sal_Bool SAL_CALL component_writeInfo(
-
- void * /* pServiceManager */, void * pRegistryKey )
-
-{
-
- if (pRegistryKey)
-
- {
-
- try
-
- {
-
- Reference< XRegistryKey > xNewKey(
-
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( FilterDetect_getImplementationName() ) );
-
- xNewKey = xNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" )) );
-
-
-
- const Sequence< OUString > & rSNL = FilterDetect_getSupportedServiceNames();
-
- const OUString * pArray = rSNL.getConstArray();
-
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
-
- xNewKey->createKey( pArray[nPos] );
-
-
-
- return sal_True;
-
- }
-
- catch (InvalidRegistryException &)
-
- {
-
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
-
- }
-
- }
-
- return sal_False;
-
-}
-
-//==================================================================================================
-
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
diff --git a/filter/source/xmlfilterdetect/makefile.mk b/filter/source/xmlfilterdetect/makefile.mk
index d13c4af5f576..582b73950ef9 100644
--- a/filter/source/xmlfilterdetect/makefile.mk
+++ b/filter/source/xmlfilterdetect/makefile.mk
@@ -58,3 +58,11 @@ SHL1STDLIBS= $(UCBHELPERLIB) \
$(SALLIB)
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/xmlfd.component
+
+$(MISC)/xmlfd.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ xmlfd.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt xmlfd.component
diff --git a/filter/source/xmlfilterdetect/xmlfd.component b/filter/source/xmlfilterdetect/xmlfd.component
new file mode 100644
index 000000000000..3796b0e1fb46
--- /dev/null
+++ b/filter/source/xmlfilterdetect/xmlfd.component
@@ -0,0 +1,34 @@
+<?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.filters.XMLFilterDetect">
+ <service name="com.sun.star.document.ExtendedTypeDetection"/>
+ </implementation>
+</component>
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index c5c0ac86320e..9c51c5e731ef 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -57,15 +57,16 @@
<xsl:key match="style:master-page" name="masterPageElements" use="@style:name"/>
<xsl:key match="style:page-layout" name="pageLayoutElements" use="@style:name"/>
<xsl:key name="writingModeStyles" match="/*/office:styles/style:style/style:paragraph-properties/@style:writing-mode | /*/office:automatic-styles/style:style/style:paragraph-properties/@style:writing-mode" use="'test'"/>
+
<xsl:template name="create-body">
<xsl:param name="globalData"/>
- <xsl:call-template name="create-body.collect-page-properties">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:template>
+ <xsl:call-template name="create-body.collect-page-properties">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:template>
- <xsl:template name="create-body.collect-page-properties">
- <xsl:param name="globalData"/>
+ <xsl:template name="create-body.collect-page-properties">
+ <xsl:param name="globalData"/>
<!-- approximation to find the correct master page style (with page dimensions) -->
<xsl:variable name="masterPageNames">
@@ -93,34 +94,35 @@
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="create-body.create">
- <xsl:with-param name="globalData" select="common:node-set($globalData)"/>
- <xsl:with-param name="pageProperties" select="common:node-set($pagePropertiesRTF)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="create-body.create">
- <xsl:with-param name="globalData" select="xalan:nodeset($globalData)"/>
- <xsl:with-param name="pageProperties" select="xalan:nodeset($pagePropertiesRTF)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="create-body.create">
- <xsl:with-param name="globalData" select="xt:node-set($globalData)"/>
- <xsl:with-param name="pageProperties" select="xt:node-set($pagePropertiesRTF)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="create-body.create">
- <xsl:param name="globalData"/>
- <xsl:param name="pageProperties"/>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="create-body.create">
+ <xsl:with-param name="globalData" select="common:node-set($globalData)"/>
+ <xsl:with-param name="pageProperties" select="common:node-set($pagePropertiesRTF)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="create-body.create">
+ <xsl:with-param name="globalData" select="xalan:nodeset($globalData)"/>
+ <xsl:with-param name="pageProperties" select="xalan:nodeset($pagePropertiesRTF)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="create-body.create">
+ <xsl:with-param name="globalData" select="xt:node-set($globalData)"/>
+ <xsl:with-param name="pageProperties" select="xt:node-set($pagePropertiesRTF)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="create-body.create">
+ <xsl:param name="globalData"/>
+ <xsl:param name="pageProperties"/>
<xsl:element name="body">
<!-- direction of text flow -->
@@ -1803,11 +1805,11 @@
<xsl:param name="minLabelWidth"/>
<xsl:param name="listIndent" />
- <!-- The text:list-header shall not be labeled. According to ODF specification (sect. 4.3.2):
- "The <text:list-header> element represents a list header and is a special kind of list item. It
- contains one or more paragraphs that are displayed before a list. The paragraphs are formatted
- like list items but they do not have a preceding number or bullet." -->
- <xsl:variable name="isListHeader" select="boolean(self::text:list-header)"/>
+ <!-- The text:list-header shall not be labeled. According to ODF specification (sect. 4.3.2):
+ "The <text:list-header> element represents a list header and is a special kind of list item. It
+ contains one or more paragraphs that are displayed before a list. The paragraphs are formatted
+ like list items but they do not have a preceding number or bullet." -->
+ <xsl:variable name="isListHeader" select="boolean(self::text:list-header)"/>
<xsl:variable name="listIndentNew">
<xsl:choose>
@@ -1827,14 +1829,14 @@
<xsl:if test="$listStyle/text:list-style/text:list-level-style-number">
<xsl:choose>
<xsl:when test="$isListHeader">0</xsl:when>
- <xsl:when test="$isEmptyList">
+ <xsl:when test="$isEmptyList">
<!-- An empty list item (no text:h/text:p as child), will not count as item and does not increment the count. -->
<xsl:variable name="tempItemNumber">
<xsl:choose>
<!-- siblings will be incremented by one -->
<xsl:when test="$itemNumber">
<xsl:if test="not($isListHeader)">
- <xsl:value-of select="$itemNumber + 1"/>
+ <xsl:value-of select="$itemNumber + 1"/>
</xsl:if>
</xsl:when>
<!-- if a higher list level had content the numbering starts with 1 -->
@@ -2168,6 +2170,7 @@
<!-- E.g.: If a list level 2 number is searched, a level 3 with content found with only a level 1 parent with content,
the level 3 gets a 'pseudoLevel' -->
<xsl:param name="pseudoLevel" select="0" />
+
<xsl:variable name="isListHeader" select="boolean(self::text:list-header)"/>
<xsl:variable name="isEmptyList" select="not(*[name() = 'text:h' or name() = 'text:p'])"/>
diff --git a/filter/source/xsltdialog/exports.dxp b/filter/source/xsltdialog/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644
--- a/filter/source/xsltdialog/exports.dxp
+++ b/filter/source/xsltdialog/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/filter/source/xsltdialog/makefile.mk b/filter/source/xsltdialog/makefile.mk
index d4ee83a497cf..9b7a3225db42 100644
--- a/filter/source/xsltdialog/makefile.mk
+++ b/filter/source/xsltdialog/makefile.mk
@@ -91,3 +91,11 @@ DEF1EXPORTFILE=exports.dxp
# --- Targets ----------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/xsltdlg.component
+
+$(MISC)/xsltdlg.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ xsltdlg.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt xsltdlg.component
diff --git a/filter/source/xsltdialog/xmlfileview.cxx b/filter/source/xsltdialog/xmlfileview.cxx
index 4ee451e3869f..a7d916178259 100644
--- a/filter/source/xsltdialog/xmlfileview.cxx
+++ b/filter/source/xsltdialog/xmlfileview.cxx
@@ -54,6 +54,8 @@
#include "xmlfileview.hrc"
#include "xmlfilterhelpids.hrc"
+#include <deque>
+
using namespace osl;
using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
@@ -72,13 +74,12 @@ using ::rtl::OUString;
struct SwTextPortion
{
- USHORT nLine;
- USHORT nStart, nEnd;
+ sal_uInt16 nLine;
+ sal_uInt16 nStart, nEnd;
svtools::ColorConfigEntry eType;
};
-SV_DECL_VARARR(SwTextPortions, SwTextPortion,16,16)
-SV_IMPL_VARARR(SwTextPortions, SwTextPortion);
+typedef std::deque<SwTextPortion> SwTextPortions;
class XMLErrorHandler : public ::cppu::WeakImplHelper1< XErrorHandler >
{
@@ -112,7 +113,7 @@ void SAL_CALL XMLErrorHandler::error( const Any& aSAXParseException ) throw (SAX
String sErr( String::CreateFromInt32( e.LineNumber ) );
sErr += String( RTL_CONSTASCII_USTRINGPARAM( " : " ) );
sErr += String( e.Message );
- USHORT nEntry = mrListBox.InsertEntry( sErr );
+ sal_uInt16 nEntry = mrListBox.InsertEntry( sErr );
mrListBox.SetEntryData( nEntry, (void*)(sal_IntPtr)e.LineNumber );
}
}
@@ -127,7 +128,7 @@ void SAL_CALL XMLErrorHandler::fatalError( const Any& aSAXParseException ) throw
String sErr( String::CreateFromInt32( e.LineNumber ) );
sErr += String( RTL_CONSTASCII_USTRINGPARAM( " : " ) );
sErr += String( e.Message );
- USHORT nEntry = mrListBox.InsertEntry( sErr );
+ sal_uInt16 nEntry = mrListBox.InsertEntry( sErr );
mrListBox.SetEntryData( nEntry, (void*)(sal_IntPtr)e.LineNumber );
}
}
@@ -141,7 +142,7 @@ void SAL_CALL XMLErrorHandler::warning( const Any& /* aSAXParseException */ ) th
String sErr( String::CreateFromInt32( e.LineNumber ) );
sErr += String( RTL_CONSTASCII_USTRINGPARAM( " : " ) );
sErr += String( e.Message );
- USHORT nEntry = mrListBox.InsertEntry( sErr );
+ sal_uInt16 nEntry = mrListBox.InsertEntry( sErr );
mrListBox.SetEntryData( nEntry, (void*)e.LineNumber );
}
*/
@@ -343,14 +344,14 @@ void XMLFileWindow::CreateTextEngine()
pTextEngine = new TextEngine;
pTextView = new TextView( pTextEngine, pOutWin );
- pTextView->SetAutoIndentMode(TRUE);
+ pTextView->SetAutoIndentMode(sal_True);
pOutWin->SetTextView(pTextView);
- pTextEngine->SetUpdateMode( FALSE );
+ pTextEngine->SetUpdateMode( sal_False );
pTextEngine->InsertView( pTextView );
Font aFont;
- aFont.SetTransparent( FALSE );
+ aFont.SetTransparent( sal_False );
aFont.SetFillColor( rCol );
SetPointFont( aFont );
aFont = GetFont();
@@ -361,10 +362,10 @@ void XMLFileWindow::CreateTextEngine()
aSyntaxIdleTimer.SetTimeout( SYNTAX_HIGHLIGHT_TIMEOUT );
aSyntaxIdleTimer.SetTimeoutHdl( LINK( this, XMLFileWindow, SyntaxTimerHdl ) );
- pTextEngine->EnableUndo( FALSE );
- pTextEngine->SetUpdateMode( TRUE );
+ pTextEngine->EnableUndo( sal_False );
+ pTextEngine->SetUpdateMode( sal_True );
-// pTextView->ShowCursor( TRUE, TRUE );
+// pTextView->ShowCursor( sal_True, sal_True );
pTextView->HideCursor();
InitScrollBars();
@@ -399,14 +400,14 @@ IMPL_LINK(XMLFileWindow, ScrollHdl, ScrollBar*, pScroll)
{
long nDiff = pTextView->GetStartDocPos().Y() - pScroll->GetThumbPos();
GetTextView()->Scroll( 0, nDiff );
- pTextView->ShowCursor( FALSE, TRUE );
+ pTextView->ShowCursor( sal_False, sal_True );
pScroll->SetThumbPos( pTextView->GetStartDocPos().Y() );
}
else
{
long nDiff = pTextView->GetStartDocPos().X() - pScroll->GetThumbPos();
GetTextView()->Scroll( nDiff, 0 );
- pTextView->ShowCursor( FALSE, TRUE );
+ pTextView->ShowCursor( sal_False, sal_True );
pScroll->SetThumbPos( pTextView->GetStartDocPos().X() );
}
return 0;
@@ -431,7 +432,7 @@ void XMLFileWindow::Notify( SfxBroadcaster& /* rBC */, const SfxHint& rHint )
}
else if( rTextHint.GetId() == TEXT_HINT_FORMATPARA )
{
- DoDelayedSyntaxHighlight( (USHORT)rTextHint.GetValue() );
+ DoDelayedSyntaxHighlight( (sal_uInt16)rTextHint.GetValue() );
}
}
}
@@ -548,7 +549,7 @@ void XMLSourceFileDialog::ShowWindow( const rtl::OUString& rFileName, const filt
mpTextWindow = new XMLFileWindow( this );
maLBOutput.Hide();
maLBOutput.Clear();
- maPBValidate.Enable(TRUE);
+ maPBValidate.Enable(sal_True);
Resize();
}
@@ -588,7 +589,7 @@ void XMLSourceFileDialog::Resize()
IMPL_LINK(XMLSourceFileDialog, SelectHdl_Impl, ListBox *, pListBox )
{
- USHORT nEntry = pListBox->GetSelectEntryPos();
+ sal_uInt16 nEntry = pListBox->GetSelectEntryPos();
if( LISTBOX_ENTRY_NOTFOUND != nEntry )
{
int nLine = (int)(sal_IntPtr)pListBox->GetEntryData(nEntry);
@@ -614,7 +615,7 @@ void XMLSourceFileDialog::onValidate()
EnterWait();
maLBOutput.Show();
- maPBValidate.Enable(FALSE);
+ maPBValidate.Enable(sal_False);
Resize();
try
@@ -650,14 +651,14 @@ void XMLSourceFileDialog::onValidate()
catch(Exception& e)
{
String sErr( e.Message );
- USHORT nEntry = maLBOutput.InsertEntry( sErr );
+ sal_uInt16 nEntry = maLBOutput.InsertEntry( sErr );
maLBOutput.SetEntryData( nEntry, (void*)-1 );
}
if( 0 == maLBOutput.GetEntryCount() )
{
String sErr( RESID( STR_NO_ERRORS_FOUND ) );
- USHORT nEntry = maLBOutput.InsertEntry( sErr );
+ sal_uInt16 nEntry = maLBOutput.InsertEntry( sErr );
maLBOutput.SetEntryData( nEntry, (void*)-1 );
}
@@ -687,12 +688,12 @@ void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
const sal_Unicode cCR = 0x0d;
- const USHORT nStrLen = rSource.Len();
- USHORT nInsert = 0; // Anzahl der eingefuegten Portions
- USHORT nActPos = 0; //Position, an der '<' gefunden wurde
- USHORT nOffset = 0; //Offset von nActPos zur '<'
- USHORT nPortStart = USHRT_MAX; // fuer die TextPortion
- USHORT nPortEnd = 0; //
+ const sal_uInt16 nStrLen = rSource.Len();
+ sal_uInt16 nInsert = 0; // Number of inserted Portions
+ sal_uInt16 nActPos = 0; // Position, at the '<' was found
+ sal_uInt16 nOffset = 0; // Offset of nActPos for '<'
+ sal_uInt16 nPortStart = USHRT_MAX; // For the TextPortion
+ sal_uInt16 nPortEnd = 0; //
SwTextPortion aText;
while(nActPos < nStrLen)
{
@@ -709,7 +710,8 @@ void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
aText.nStart += 1;
aText.nEnd = nActPos - 1;
aText.eType = svtools::HTMLUNKNOWN;
- aPortionList.Insert(aText, nInsert++);
+ aPortionList.push_back( aText );
+ nInsert++;
}
sal_Unicode cFollowFirst = rSource.GetChar((xub_StrLen)(nActPos + 1));
sal_Unicode cFollowNext = rSource.GetChar((xub_StrLen)(nActPos + 2));
@@ -736,7 +738,7 @@ void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
if(svtools::HTMLUNKNOWN == eFoundType)
{
//jetzt koennte hier ein keyword folgen
- USHORT nSrchPos = nActPos;
+ sal_uInt16 nSrchPos = nActPos;
while(++nSrchPos < nStrLen - 1)
{
sal_Unicode cNext = rSource.GetChar(nSrchPos);
@@ -779,18 +781,18 @@ void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
// jetzt muss noch '>' gesucht werden
if(svtools::HTMLUNKNOWN != eFoundType)
{
- BOOL bFound = FALSE;
- for(USHORT i = nPortEnd; i < nStrLen; i++)
+ sal_Bool bFound = sal_False;
+ for(sal_uInt16 i = nPortEnd; i < nStrLen; i++)
if(cCloseBracket == rSource.GetChar(i))
{
- bFound = TRUE;
+ bFound = sal_True;
nPortEnd = i;
break;
}
if(!bFound && (eFoundType == svtools::HTMLCOMMENT))
{
// Kommentar ohne Ende in dieser Zeile
- bFound = TRUE;
+ bFound = sal_True;
nPortEnd = nStrLen - 1;
}
@@ -801,7 +803,8 @@ void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
aText2.nStart = nPortStart + 1;
aText2.nEnd = nPortEnd;
aText2.eType = eFoundType;
- aPortionList.Insert(aText2, nInsert++);
+ aPortionList.push_back( aText2 );
+ nInsert++;
eFoundType = svtools::HTMLUNKNOWN;
}
@@ -815,25 +818,26 @@ void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
aText.nStart = nPortEnd + 1;
aText.nEnd = nActPos - 1;
aText.eType = svtools::HTMLUNKNOWN;
- aPortionList.Insert(aText, nInsert++);
+ aPortionList.push_back( aText );
+ nInsert++;
}
}
-void XMLFileWindow::DoDelayedSyntaxHighlight( USHORT nPara )
+void XMLFileWindow::DoDelayedSyntaxHighlight( sal_uInt16 nPara )
{
if ( !bHighlighting )
{
- aSyntaxLineTable.Insert( nPara, (void*)(USHORT)1 );
+ aSyntaxLineTable.Insert( nPara, (void*)(sal_uInt16)1 );
aSyntaxIdleTimer.Start();
}
}
-void XMLFileWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff )
+void XMLFileWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff )
{
SwTextPortions aPortionList;
lcl_Highlight(rSource, aPortionList);
- USHORT nCount = aPortionList.Count();
+ size_t nCount = aPortionList.size();
if ( !nCount )
return;
@@ -841,7 +845,7 @@ void XMLFileWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff )
if ( rLast.nStart > rLast.nEnd ) // Nur bis Bug von MD behoeben
{
nCount--;
- aPortionList.Remove( nCount);
+ aPortionList.pop_back();
if ( !nCount )
return;
}
@@ -850,14 +854,14 @@ void XMLFileWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff )
// Wenn haufig gleiche Farbe, dazwischen Blank ohne Farbe,
// ggf. zusammenfassen, oder zumindest das Blank,
// damit weniger Attribute
- BOOL bOptimizeHighlight = TRUE; // war in der BasicIDE static
+ sal_Bool bOptimizeHighlight = sal_True; // war in der BasicIDE static
if ( bOptimizeHighlight )
{
// Es muessen nur die Blanks und Tabs mit attributiert werden.
// Wenn zwei gleiche Attribute hintereinander eingestellt werden,
// optimiert das die TextEngine.
- USHORT nLastEnd = 0;
- for ( USHORT i = 0; i < nCount; i++ )
+ sal_uInt16 nLastEnd = 0;
+ for ( size_t i = 0; i < nCount; i++ )
{
SwTextPortion& r = aPortionList[i];
DBG_ASSERT( r.nLine == aPortionList[0].nLine, "doch mehrere Zeilen ?" );
@@ -877,19 +881,19 @@ void XMLFileWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff )
}
svtools::ColorConfig aConfig;
- for ( USHORT i = 0; i < aPortionList.Count(); i++ )
+ for ( size_t i = 0; i < aPortionList.size(); i++ )
{
SwTextPortion& r = aPortionList[i];
if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoeben
continue;
-// USHORT nCol = r.eType;
+// sal_uInt16 nCol = r.eType;
if(r.eType != svtools::HTMLSGML &&
r.eType != svtools::HTMLCOMMENT &&
r.eType != svtools::HTMLKEYWORD &&
r.eType != svtools::HTMLUNKNOWN)
r.eType = (svtools::ColorConfigEntry)svtools::HTMLUNKNOWN;
Color aColor((ColorData)aConfig.GetColorValue((svtools::ColorConfigEntry)r.eType).nColor);
- USHORT nLine = nLineOff+r.nLine; //
+ sal_uInt16 nLine = nLineOff+r.nLine; //
pTextEngine->SetAttrib( TextAttribFontColor( aColor ), nLine, r.nStart, r.nEnd+1 );
}
}
@@ -898,20 +902,20 @@ IMPL_LINK( XMLFileWindow, SyntaxTimerHdl, Timer *, pTimer )
{
Time aSyntaxCheckStart;
DBG_ASSERT( pTextView, "Noch keine View, aber Syntax-Highlight ?!" );
- pTextEngine->SetUpdateMode( FALSE );
+ pTextEngine->SetUpdateMode( sal_False );
- bHighlighting = TRUE;
- USHORT nLine;
- USHORT nCount = 0;
+ bHighlighting = sal_True;
+ sal_uInt16 nLine;
+ sal_uInt16 nCount = 0;
// zuerst wird der Bereich um dem Cursor bearbeitet
TextSelection aSel = pTextView->GetSelection();
- USHORT nCur = (USHORT)aSel.GetStart().GetPara();
+ sal_uInt16 nCur = (sal_uInt16)aSel.GetStart().GetPara();
if(nCur > 40)
nCur -= 40;
else
nCur = 0;
if(aSyntaxLineTable.Count())
- for(USHORT i = 0; i < 80 && nCount < 40; i++, nCur++)
+ for(sal_uInt16 i = 0; i < 80 && nCount < 40; i++, nCur++)
{
void * p = aSyntaxLineTable.Get(nCur);
if(p)
@@ -933,9 +937,9 @@ IMPL_LINK( XMLFileWindow, SyntaxTimerHdl, Timer *, pTimer )
void* p = aSyntaxLineTable.First();
while ( p && nCount < MAX_SYNTAX_HIGHLIGHT)
{
- nLine = (USHORT)aSyntaxLineTable.GetCurKey();
+ nLine = (sal_uInt16)aSyntaxLineTable.GetCurKey();
DoSyntaxHighlight( nLine );
- USHORT nC = (USHORT)aSyntaxLineTable.GetCurKey();
+ sal_uInt16 nC = (sal_uInt16)aSyntaxLineTable.GetCurKey();
p = aSyntaxLineTable.Next();
aSyntaxLineTable.Remove(nC);
nCount ++;
@@ -949,9 +953,9 @@ IMPL_LINK( XMLFileWindow, SyntaxTimerHdl, Timer *, pTimer )
// waehrend des Highlightings funktionierte das Scrolling nicht
TextView* pTmp = pTextEngine->GetActiveView();
pTextEngine->SetActiveView(0);
- pTextEngine->SetUpdateMode( TRUE );
+ pTextEngine->SetUpdateMode( sal_True );
pTextEngine->SetActiveView(pTmp);
- pTextView->ShowCursor(FALSE, FALSE);
+ pTextView->ShowCursor(sal_False, sal_False);
if(aSyntaxLineTable.Count() && !pTimer->IsActive())
pTimer->Start();
@@ -961,12 +965,12 @@ IMPL_LINK( XMLFileWindow, SyntaxTimerHdl, Timer *, pTimer )
nCurTextWidth = pTextEngine->CalcTextWidth() + 25; // kleine Toleranz
if ( nCurTextWidth != nPrevTextWidth )
SetScrollBarRanges();
- bHighlighting = FALSE;
+ bHighlighting = sal_False;
return 0;
}
-void XMLFileWindow::DoSyntaxHighlight( USHORT nPara )
+void XMLFileWindow::DoSyntaxHighlight( sal_uInt16 nPara )
{
// Durch das DelayedSyntaxHighlight kann es passieren,
// dass die Zeile nicht mehr existiert!
@@ -974,18 +978,18 @@ void XMLFileWindow::DoSyntaxHighlight( USHORT nPara )
{
pTextEngine->RemoveAttribs( nPara );
String aSource( pTextEngine->GetText( nPara ) );
- pTextEngine->SetUpdateMode( FALSE );
+ pTextEngine->SetUpdateMode( sal_False );
ImpDoHighlight( aSource, nPara );
// os: #43050# hier wird ein TextView-Problem umpopelt:
// waehrend des Highlightings funktionierte das Scrolling nicht
TextView* pTmp = pTextEngine->GetActiveView();
- pTmp->SetAutoScroll(FALSE);
+ pTmp->SetAutoScroll(sal_False);
pTextEngine->SetActiveView(0);
- pTextEngine->SetUpdateMode( TRUE );
+ pTextEngine->SetUpdateMode( sal_True );
pTextEngine->SetActiveView(pTmp);
// Bug 72887 show the cursor
- pTmp->SetAutoScroll(TRUE);
- pTmp->ShowCursor( FALSE/*pTmp->IsAutoScroll()*/ );
+ pTmp->SetAutoScroll(sal_True);
+ pTmp->ShowCursor( sal_False/*pTmp->IsAutoScroll()*/ );
}
}
diff --git a/filter/source/xsltdialog/xmlfileview.hxx b/filter/source/xsltdialog/xmlfileview.hxx
index 587d523e4fdf..b03bc760700b 100644
--- a/filter/source/xsltdialog/xmlfileview.hxx
+++ b/filter/source/xsltdialog/xmlfileview.hxx
@@ -84,7 +84,7 @@ private:
*pVScrollbar;
long nCurTextWidth;
- USHORT nStartLine;
+ sal_uInt16 nStartLine;
rtl_TextEncoding eSourceEncoding;
Timer aSyntaxIdleTimer;
@@ -93,7 +93,7 @@ private:
bool bHighlighting;
protected:
DECL_LINK( SyntaxTimerHdl, Timer * );
- void ImpDoHighlight( const String& rSource, USHORT nLineOff );
+ void ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff );
virtual void Resize();
virtual void DataChanged( const DataChangedEvent& );
@@ -105,9 +105,9 @@ protected:
DECL_LINK(ScrollHdl, ScrollBar*);
- void DoDelayedSyntaxHighlight( USHORT nPara );
+ void DoDelayedSyntaxHighlight( sal_uInt16 nPara );
- void DoSyntaxHighlight( USHORT nPara );
+ void DoSyntaxHighlight( sal_uInt16 nPara );
public:
XMLFileWindow( Window* pParent );
@@ -115,7 +115,7 @@ public:
void SetScrollBarRanges();
void InitScrollBars();
- ULONG Read( SvStream& rInput) { return pTextEngine->Read(rInput); }
+ sal_uLong Read( SvStream& rInput) { return pTextEngine->Read(rInput); }
void ShowWindow( const rtl::OUString& rFileName );
@@ -127,7 +127,7 @@ public:
void CreateScrollbars();
- void SetStartLine(USHORT nLine) {nStartLine = nLine;}
+ void SetStartLine(sal_uInt16 nLine) {nStartLine = nLine;}
virtual void Command( const CommandEvent& rCEvt );
void HandleWheelCommand( const CommandEvent& rCEvt );
diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
index f2f93da3403a..38f8c797203c 100644
--- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
+++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
@@ -403,37 +403,7 @@ void SAL_CALL component_getImplementationEnvironment(
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//==================================================================================================
-
-void singlecomponent_writeInfo( Reference< XRegistryKey >& xNewKey, const Sequence< OUString > & rSNL )
-{
- const OUString * pArray = rSNL.getConstArray();
- for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-}
-
-sal_Bool SAL_CALL component_writeInfo(
- void * /* pServiceManager */, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( XMLFilterDialogComponent_getImplementationName() ) );
- xNewKey = xNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" )) );
- singlecomponent_writeInfo( xNewKey, XMLFilterDialogComponent_getSupportedServiceNames() );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
//==================================================================================================
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
diff --git a/filter/source/xsltdialog/xmlfilterhelpids.hrc b/filter/source/xsltdialog/xmlfilterhelpids.hrc
index 9c49d0537723..cced0609f5f4 100644
--- a/filter/source/xsltdialog/xmlfilterhelpids.hrc
+++ b/filter/source/xsltdialog/xmlfilterhelpids.hrc
@@ -27,62 +27,55 @@
#ifndef _XMLFILTERHELPIDS_HRC_
#define _XMLFILTERHELPIDS_HRC_
-#ifndef _FILTER_HRC
-#include "filter.hrc"
-#endif
-
-#define HID_XML_SOURCE_FILE_DIALOG (HID_FILTER_XSLT_START + 0)
-#define HID_XML_SOURCE_FILE_VALIDATE (HID_FILTER_XSLT_START + 1)
-#define HID_XML_FILTER_SETTINGS_DIALOG (HID_FILTER_XSLT_START + 2)
-#define HID_XML_FILTER_LIST (HID_FILTER_XSLT_START + 3)
-#define HID_XML_FILTER_NEW (HID_FILTER_XSLT_START + 4)
-#define HID_XML_FILTER_EDIT (HID_FILTER_XSLT_START + 5)
-#define HID_XML_FILTER_TEST (HID_FILTER_XSLT_START + 6)
-#define HID_XML_FILTER_DELETE (HID_FILTER_XSLT_START + 7)
-#define HID_XML_FILTER_SAVE (HID_FILTER_XSLT_START + 8)
-#define HID_XML_FILTER_OPEN (HID_FILTER_XSLT_START + 9)
-#define HID_XML_FILTER_CLOSE (HID_FILTER_XSLT_START + 10)
-
-#define HID_XML_FILTER_TABDIALOG (HID_FILTER_XSLT_START + 11)
-#define HID_XML_FILTER_TABPAGE_BASIC (HID_FILTER_XSLT_START + 12)
-#define HID_XML_FILTER_TABPAGE_XSLT (HID_FILTER_XSLT_START + 13)
-#define HID_XML_FILTER_NAME (HID_FILTER_XSLT_START + 14)
-#define HID_XML_FILTER_APPLICATION (HID_FILTER_XSLT_START + 15)
-#define HID_XML_FILTER_INTERFACE_NAME (HID_FILTER_XSLT_START + 16)
-#define HID_XML_FILTER_EXTENSION (HID_FILTER_XSLT_START + 17)
-#define HID_XML_FILTER_DESCRIPTION (HID_FILTER_XSLT_START + 18)
-#define HID_XML_FILTER_DOCTYPE (HID_FILTER_XSLT_START + 19)
-#define HID_XML_FILTER_DTD (HID_FILTER_XSLT_START + 20)
-#define HID_XML_FILTER_DTD_BROWSE (HID_FILTER_XSLT_START + 21)
-#define HID_XML_FILTER_EXPORT_XSLT (HID_FILTER_XSLT_START + 22)
-#define HID_XML_FILTER_EXPORT_XSLT_BROWSE (HID_FILTER_XSLT_START + 23)
-#define HID_XML_FILTER_IMPORT_XSLT (HID_FILTER_XSLT_START + 24)
-#define HID_XML_FILTER_IMPORT_XSLT_BROWSE (HID_FILTER_XSLT_START + 25)
-#define HID_XML_FILTER_IMPORT_TEMPLATE (HID_FILTER_XSLT_START + 26)
-#define HID_XML_FILTER_TEST_DIALOG (HID_FILTER_XSLT_START + 27)
+#define HID_XML_SOURCE_FILE_DIALOG "FILTER_HID_XML_SOURCE_FILE_DIALOG"
+#define HID_XML_SOURCE_FILE_VALIDATE "FILTER_HID_XML_SOURCE_FILE_VALIDATE"
+#define HID_XML_FILTER_SETTINGS_DIALOG "FILTER_HID_XML_FILTER_SETTINGS_DIALOG"
+#define HID_XML_FILTER_LIST "FILTER_HID_XML_FILTER_LIST"
+#define HID_XML_FILTER_NEW "FILTER_HID_XML_FILTER_NEW"
+#define HID_XML_FILTER_EDIT "FILTER_HID_XML_FILTER_EDIT"
+#define HID_XML_FILTER_TEST "FILTER_HID_XML_FILTER_TEST"
+#define HID_XML_FILTER_DELETE "FILTER_HID_XML_FILTER_DELETE"
+#define HID_XML_FILTER_SAVE "FILTER_HID_XML_FILTER_SAVE"
+#define HID_XML_FILTER_OPEN "FILTER_HID_XML_FILTER_OPEN"
+#define HID_XML_FILTER_CLOSE "FILTER_HID_XML_FILTER_CLOSE"
-#define HID_XML_FILTER_TEST_EXPORT_BROWSE (HID_FILTER_XSLT_START + 28)
-#define HID_XML_FILTER_TEST_EXPORT_CURRENT (HID_FILTER_XSLT_START + 29)
-#define HID_XML_FILTER_TEST_EXPORT_CURRENT_FILE (HID_FILTER_XSLT_START + 30)
+#define HID_XML_FILTER_TABDIALOG "FILTER_HID_XML_FILTER_TABDIALOG"
+#define HID_XML_FILTER_TABPAGE_BASIC "FILTER_HID_XML_FILTER_TABPAGE_BASIC"
+#define HID_XML_FILTER_TABPAGE_XSLT "FILTER_HID_XML_FILTER_TABPAGE_XSLT"
+#define HID_XML_FILTER_NAME "FILTER_HID_XML_FILTER_NAME"
+#define HID_XML_FILTER_APPLICATION "FILTER_HID_XML_FILTER_APPLICATION"
+#define HID_XML_FILTER_INTERFACE_NAME "FILTER_HID_XML_FILTER_INTERFACE_NAME"
+#define HID_XML_FILTER_EXTENSION "FILTER_HID_XML_FILTER_EXTENSION"
+#define HID_XML_FILTER_DESCRIPTION "FILTER_HID_XML_FILTER_DESCRIPTION"
+#define HID_XML_FILTER_DOCTYPE "FILTER_HID_XML_FILTER_DOCTYPE"
+#define HID_XML_FILTER_DTD "FILTER_HID_XML_FILTER_DTD"
+#define HID_XML_FILTER_DTD_BROWSE "FILTER_HID_XML_FILTER_DTD_BROWSE"
+#define HID_XML_FILTER_EXPORT_XSLT "FILTER_HID_XML_FILTER_EXPORT_XSLT"
+#define HID_XML_FILTER_EXPORT_XSLT_BROWSE "FILTER_HID_XML_FILTER_EXPORT_XSLT_BROWSE"
+#define HID_XML_FILTER_IMPORT_XSLT "FILTER_HID_XML_FILTER_IMPORT_XSLT"
+#define HID_XML_FILTER_IMPORT_XSLT_BROWSE "FILTER_HID_XML_FILTER_IMPORT_XSLT_BROWSE"
+#define HID_XML_FILTER_IMPORT_TEMPLATE "FILTER_HID_XML_FILTER_IMPORT_TEMPLATE"
+#define HID_XML_FILTER_TEST_DIALOG "FILTER_HID_XML_FILTER_TEST_DIALOG"
-#define HID_XML_FILTER_TEST_IMPORT_XSLT_FILE (HID_FILTER_XSLT_START + 31)
-#define HID_XML_FILTER_TEST_IMPORT_TEMPLATE_FILE (HID_FILTER_XSLT_START + 32)
-#define HID_XML_FILTER_TEST_IMPORT_DISPLAY_SOURCE (HID_FILTER_XSLT_START + 33)
-#define HID_XML_FILTER_TEST_IMPORT_BROWSE (HID_FILTER_XSLT_START + 34)
-#define HID_XML_FILTER_TEST_IMPORT_RECENT (HID_FILTER_XSLT_START + 35)
-#define HID_XML_FILTER_TEST_IMPORT_RECENT_FILE (HID_FILTER_XSLT_START + 36)
-#define HID_XML_FILTER_TEST_CLOSE (HID_FILTER_XSLT_START + 37)
+#define HID_XML_FILTER_TEST_EXPORT_BROWSE "FILTER_HID_XML_FILTER_TEST_EXPORT_BROWSE"
+#define HID_XML_FILTER_TEST_EXPORT_CURRENT "FILTER_HID_XML_FILTER_TEST_EXPORT_CURRENT"
+#define HID_XML_FILTER_TEST_EXPORT_CURRENT_FILE "FILTER_HID_XML_FILTER_TEST_EXPORT_CURRENT_FILE"
-#define HID_XML_FILTER_IMPORT_TEMPLATE_BROWSE (HID_FILTER_XSLT_START + 38)
+#define HID_XML_FILTER_TEST_IMPORT_XSLT_FILE "FILTER_HID_XML_FILTER_TEST_IMPORT_XSLT_FILE"
+#define HID_XML_FILTER_TEST_IMPORT_TEMPLATE_FILE "FILTER_HID_XML_FILTER_TEST_IMPORT_TEMPLATE_FILE"
+#define HID_XML_FILTER_TEST_IMPORT_DISPLAY_SOURCE "FILTER_HID_XML_FILTER_TEST_IMPORT_DISPLAY_SOURCE"
+#define HID_XML_FILTER_TEST_IMPORT_BROWSE "FILTER_HID_XML_FILTER_TEST_IMPORT_BROWSE"
+#define HID_XML_FILTER_TEST_IMPORT_RECENT "FILTER_HID_XML_FILTER_TEST_IMPORT_RECENT"
+#define HID_XML_FILTER_TEST_IMPORT_RECENT_FILE "FILTER_HID_XML_FILTER_TEST_IMPORT_RECENT_FILE"
+#define HID_XML_FILTER_TEST_CLOSE "FILTER_HID_XML_FILTER_TEST_CLOSE"
-#define HID_XML_FILTER_TEST_VALIDATE_OUPUT (HID_FILTER_XSLT_START + 39)
-#define HID_XML_FILTER_OUTPUT_WINDOW (HID_FILTER_XSLT_START + 40)
+#define HID_XML_FILTER_IMPORT_TEMPLATE_BROWSE "FILTER_HID_XML_FILTER_IMPORT_TEMPLATE_BROWSE"
-#define HID_XML_FILTER_TEST_EXPORT_XSLT_FILE (HID_FILTER_XSLT_START + 41)
+#define HID_XML_FILTER_TEST_VALIDATE_OUPUT "FILTER_HID_XML_FILTER_TEST_VALIDATE_OUPUT"
+#define HID_XML_FILTER_OUTPUT_WINDOW "FILTER_HID_XML_FILTER_OUTPUT_WINDOW"
-#define HID_XML_FILTER_TABPAGE_CTRL (HID_FILTER_XSLT_START + 42)
+#define HID_XML_FILTER_TEST_EXPORT_XSLT_FILE "FILTER_HID_XML_FILTER_TEST_EXPORT_XSLT_FILE"
-// last help id is HID_FILTER_XSLT_END !
-// #define HID_FILTER_XSLT_END (HID_FILTER_START + 99)
+#define HID_XML_FILTER_TABPAGE_CTRL "FILTER_HID_XML_FILTER_TABPAGE_CTRL"
#endif
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index ffd868a2c662..2ba839205b7e 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -92,6 +92,8 @@ XMLFilterSettingsDialog::XMLFilterSettingsDialog( Window* pParent, ResMgr& rResM
mpFilterListBox->SetSelectHdl( LINK( this, XMLFilterSettingsDialog, SelectionChangedHdl_Impl ) );
mpFilterListBox->SetDeselectHdl( LINK( this, XMLFilterSettingsDialog, SelectionChangedHdl_Impl ) );
mpFilterListBox->SetDoubleClickHdl( LINK( this, XMLFilterSettingsDialog, DoubleClickHdl_Impl ) );
+ mpFilterListBox->SetAccessibleName(String( RESID( STR_XML_FILTER_LISTBOX )));
+ maCtrlFilterList.SetAccessibleName(String( RESID( STR_XML_FILTER_LISTBOX )));
mpFilterListBox->SetHelpId( HID_XML_FILTER_LIST );
maPBNew.SetClickHdl(LINK( this, XMLFilterSettingsDialog, ClickHdl_Impl ) );
@@ -198,7 +200,7 @@ void XMLFilterSettingsDialog::ShowWindow()
updateStates();
mpFilterListBox->Reset();
- WorkWindow::Show( TRUE );
+ WorkWindow::Show( sal_True );
}
// -----------------------------------------------------------------------
@@ -1050,12 +1052,12 @@ long XMLFilterSettingsDialog::Notify( NotifyEvent& rNEvt )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
KeyCode aKeyCode = pKEvt->GetKeyCode();
- USHORT nKeyCode = aKeyCode.GetCode();
+ sal_uInt16 nKeyCode = aKeyCode.GetCode();
if( nKeyCode == KEY_ESCAPE )
{
Close();
- return TRUE;
+ return sal_True;
}
}
}
@@ -1434,9 +1436,7 @@ XMLFilterListBox::XMLFilterListBox( SvxPathControl_Impl * pParent )
static long nTabs[] = {3, 0, nTabSize, 2*nTabSize };
Size aHeadSize( mpHeaderBar->GetSizePixel() );
- WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
pParent->SetFocusControl( this );
- SetWindowBits( nBits );
// SetDoubleClickHdl( aLink );
// SetSelectHdl( LINK( this, SvxPathTabPage, PathSelect_Impl ) );
SetSelectionMode( MULTIPLE_SELECTION );
@@ -1496,7 +1496,7 @@ IMPL_LINK( XMLFilterListBox, HeaderSelect_Impl, HeaderBar*, pBar )
return 0;
HeaderBarItemBits nBits = mpHeaderBar->GetItemBits(ITEMID_TYPE);
- BOOL bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
+ sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
SvSortMode eMode = SortAscending;
if ( bUp )
@@ -1527,7 +1527,7 @@ IMPL_LINK( XMLFilterListBox, HeaderEndDrag_Impl, HeaderBar*, pBar )
if ( !mpHeaderBar->IsItemMode() )
{
Size aSz;
- USHORT nTabs = mpHeaderBar->GetItemCount();
+ sal_uInt16 nTabs = mpHeaderBar->GetItemCount();
long nTmpSz = 0;
long nWidth = mpHeaderBar->GetItemSize(ITEMID_NAME);
long nBarWidth = mpHeaderBar->GetSizePixel().Width();
@@ -1537,7 +1537,7 @@ IMPL_LINK( XMLFilterListBox, HeaderEndDrag_Impl, HeaderBar*, pBar )
else if ( ( nBarWidth - nWidth ) < 30 )
mpHeaderBar->SetItemSize( ITEMID_TYPE, nBarWidth - 30 );
- for ( USHORT i = 1; i <= nTabs; ++i )
+ for ( sal_uInt16 i = 1; i <= nTabs; ++i )
{
long nW = mpHeaderBar->GetItemSize(i);
aSz.Width() = nW + nTmpSz;
@@ -1561,8 +1561,8 @@ void XMLFilterListBox::addFilterEntry( const filter_info_impl* pInfo )
void XMLFilterListBox::changeEntry( const filter_info_impl* pInfo )
{
- const ULONG nCount = GetEntryCount();
- ULONG nPos;
+ const sal_uLong nCount = GetEntryCount();
+ sal_uLong nPos;
for( nPos = 0; nPos < nCount; nPos++ )
{
SvLBoxEntry* pEntry = GetEntry( nPos );
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hrc b/filter/source/xsltdialog/xmlfiltersettingsdialog.hrc
index 48ed1a2a4ee7..d611e2d1a824 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hrc
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hrc
@@ -39,5 +39,5 @@
#define PB_XML_FILTER_OPEN 7
#define BTN_XML_FILTER_HELP 8
#define PB_XML_FILTER_CLOSE 9
-
+#define STR_XML_FILTER_LISTBOX 10
#endif
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.src b/filter/source/xsltdialog/xmlfiltersettingsdialog.src
index b80dff3bfe50..deb15d18627d 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.src
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.src
@@ -126,6 +126,11 @@ WorkWindow DLG_XML_FILTER_SETTINGS_DIALOG
};
+String STR_XML_FILTER_LISTBOX
+{
+ Text [ en-US ] = "XML Filter List";
+};
+
diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/filter/source/xsltdialog/xmlfiltertabdialog.cxx
index 221ad42904bd..4d2dc0224566 100644
--- a/filter/source/xsltdialog/xmlfiltertabdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertabdialog.cxx
@@ -299,7 +299,7 @@ bool XMLFilterTabDialog::onOk()
if( 0 != nErrorId )
{
- maTabCtrl.SetCurPageId( (USHORT)nErrorPage );
+ maTabCtrl.SetCurPageId( (sal_uInt16)nErrorPage );
ActivatePageHdl( &maTabCtrl );
ResId aResId( nErrorId, mrResMgr );
@@ -358,7 +358,7 @@ IMPL_LINK( XMLFilterTabDialog, OkHdl, Button *, EMPTYARG )
IMPL_LINK( XMLFilterTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
{
- const USHORT nId = pTabCtrl->GetCurPageId();
+ const sal_uInt16 nId = pTabCtrl->GetCurPageId();
TabPage* pTabPage = pTabCtrl->GetTabPage( nId );
pTabPage->Show();
@@ -369,7 +369,7 @@ IMPL_LINK( XMLFilterTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
IMPL_LINK( XMLFilterTabDialog, DeactivatePageHdl, TabControl *, /* pTabCtrl */ )
{
- return TRUE;
+ return sal_True;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/xsltdialog/xsltdlg.component b/filter/source/xsltdialog/xsltdlg.component
new file mode 100644
index 000000000000..086208f4f830
--- /dev/null
+++ b/filter/source/xsltdialog/xsltdlg.component
@@ -0,0 +1,34 @@
+<?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="XMLFilterDialogComponent">
+ <service name="com.sun.star.comp.ui.XSLTFilterDialog"/>
+ </implementation>
+</component>
diff --git a/filter/source/xsltfilter/XSLTFilter.cxx b/filter/source/xsltfilter/XSLTFilter.cxx
index b00ccdd91b80..8e7795b70129 100644
--- a/filter/source/xsltfilter/XSLTFilter.cxx
+++ b/filter/source/xsltfilter/XSLTFilter.cxx
@@ -651,36 +651,6 @@ extern "C"
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- sal_Bool SAL_CALL
- component_writeInfo(void * /* pServiceManager */, void * pRegistryKey)
- {
- sal_Bool bRetVal = sal_False;
- if (pRegistryKey)
- {
- try
- {
- Reference<XRegistryKey> pXNewKey(
- static_cast<XRegistryKey*> (pRegistryKey));
- pXNewKey->createKey(
- OUString(
- RTL_CONSTASCII_USTRINGPARAM( "/" FILTER_IMPL_NAME "/UNO/SERVICES/" FILTER_SERVICE_NAME )));
- bRetVal = sal_True;
-
- pXNewKey = static_cast<XRegistryKey*> (pRegistryKey);
- pXNewKey->createKey(
- OUString(
- RTL_CONSTASCII_USTRINGPARAM( "/" TRANSFORMER_IMPL_NAME "/UNO/SERVICES/" TRANSFORMER_SERVICE_NAME )));
- bRetVal = sal_True;
- }
- catch (InvalidRegistryException&)
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- bRetVal = sal_False;
- }
- }
- return bRetVal;
- }
-
void *
SAL_CALL component_getFactory(const sal_Char * pImplName,
void * pServiceManager, void * /* pRegistryKey */)
diff --git a/filter/source/xsltfilter/XSLTFilter.jar.component b/filter/source/xsltfilter/XSLTFilter.jar.component
new file mode 100644
index 000000000000..d4ecd66f3b53
--- /dev/null
+++ b/filter/source/xsltfilter/XSLTFilter.jar.component
@@ -0,0 +1,34 @@
+<?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.Java2"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="XSLTransformer">
+ <service name="com.sun.star.comp.JAXTHelper"/>
+ </implementation>
+</component>
diff --git a/filter/source/xsltfilter/XSLTransformer.java b/filter/source/xsltfilter/XSLTransformer.java
index 4806c18b8161..315170ec7f98 100644
--- a/filter/source/xsltfilter/XSLTransformer.java
+++ b/filter/source/xsltfilter/XSLTransformer.java
@@ -81,9 +81,8 @@ import com.sun.star.lib.uno.adapter.XOutputStreamToOutputStreamAdapter;
import net.sf.saxon.FeatureKeys;
/** This outer class provides an inner class to implement the service
- * description, a method to instantiate the
- * component on demand (__getServiceFactory()), and a method to give
- * information about the component (__writeRegistryServiceInfo()).
+ * description and a method to instantiate the
+ * component on demand (__getServiceFactory()).
*/
public class XSLTransformer
implements XTypeProvider, XServiceName, XServiceInfo, XActiveDataSink,
@@ -476,9 +475,4 @@ public class XSLTransformer
}
return xSingleServiceFactory;
}
-
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
- return FactoryHelper.writeRegistryServiceInfo(XSLTransformer.class.getName(),
- _serviceName, regKey);
- }
}
diff --git a/filter/source/xsltfilter/makefile.mk b/filter/source/xsltfilter/makefile.mk
index 58f3c9e9a71c..61f4a4a92b1d 100644
--- a/filter/source/xsltfilter/makefile.mk
+++ b/filter/source/xsltfilter/makefile.mk
@@ -90,3 +90,17 @@ $(JAVACLASSFILES) : $(CLASSDIR)
$(CLASSDIR) :
$(MKDIR) $(CLASSDIR)
.ENDIF
+
+ALLTAR : $(MISC)/XSLTFilter.jar.component $(MISC)/xsltfilter.component
+
+$(MISC)/XSLTFilter.jar.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt XSLTFilter.jar.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_JAVA)$(JARTARGET)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt XSLTFilter.jar.component
+
+$(MISC)/xsltfilter.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ xsltfilter.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt xsltfilter.component
diff --git a/filter/source/xsltfilter/xsltfilter.component b/filter/source/xsltfilter/xsltfilter.component
new file mode 100644
index 000000000000..25a479794b29
--- /dev/null
+++ b/filter/source/xsltfilter/xsltfilter.component
@@ -0,0 +1,34 @@
+<?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.documentconversion.XSLTFilter">
+ <service name="com.sun.star.documentconversion.XSLTFilter"/>
+ </implementation>
+</component>
diff --git a/filter/source/xsltvalidate/XSLTValidate.component b/filter/source/xsltvalidate/XSLTValidate.component
new file mode 100644
index 000000000000..7d357be55119
--- /dev/null
+++ b/filter/source/xsltvalidate/XSLTValidate.component
@@ -0,0 +1,34 @@
+<?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.Java2"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="XSLTValidate$_XSLTValidate">
+ <service name="com.sun.star.documentconversion.XSLTValidate"/>
+ </implementation>
+</component>
diff --git a/filter/source/xsltvalidate/XSLTValidate.java b/filter/source/xsltvalidate/XSLTValidate.java
index 6dba438f4e47..591b7c6f354c 100644
--- a/filter/source/xsltvalidate/XSLTValidate.java
+++ b/filter/source/xsltvalidate/XSLTValidate.java
@@ -53,9 +53,8 @@ import com.sun.star.uno.AnyConverter;
import com.sun.star.lib.uno.adapter.*;
/** This outer class provides an inner class to implement the service
- * description, a method to instantiate the
- * component on demand (__getServiceFactory()), and a method to give
- * information about the component (__writeRegistryServiceInfo()).
+ * description and a method to instantiate the
+ * component on demand (__getServiceFactory()).
*/
public class XSLTValidate {
@@ -330,18 +329,4 @@ public class XSLTValidate {
return xSingleServiceFactory;
}
-
- /**
- * Writes the service information into the given registry key.
- * This method is called by the <code>JavaLoader</code>
- * <p>
- * @return returns true if the operation succeeded
- * @param regKey the registryKey
- * @see com.sun.star.comp.loader.JavaLoader
- */
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
-
- return FactoryHelper.writeRegistryServiceInfo(_XSLTValidate.class.getName(),
- _XSLTValidate.__serviceName, regKey);
- }
}
diff --git a/filter/source/xsltvalidate/makefile.mk b/filter/source/xsltvalidate/makefile.mk
index 50742dca31fd..503e24c8d99b 100644
--- a/filter/source/xsltvalidate/makefile.mk
+++ b/filter/source/xsltvalidate/makefile.mk
@@ -73,3 +73,11 @@ $(JARMANIFEST) : $(CLASSDIR)
$(CLASSDIR) :
$(MKDIR) $(CLASSDIR)
+
+ALLTAR : $(MISC)/XSLTValidate.component
+
+$(MISC)/XSLTValidate.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt XSLTValidate.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_JAVA)$(JARTARGET)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt XSLTValidate.component
diff --git a/hwpfilter/prj/build.lst b/hwpfilter/prj/build.lst
index ae47fe725ccc..51240453413d 100644
--- a/hwpfilter/prj/build.lst
+++ b/hwpfilter/prj/build.lst
@@ -1,4 +1,4 @@
-hw hwpfilter : offuh cppuhelper ZLIB:zlib NULL
+hw hwpfilter : offuh cppuhelper ZLIB:zlib LIBXSLT:libxslt NULL
hw hwpfilter usr1 - all hw_mkout NULL
hw hwpfilter\prj get - all hw_prj NULL
hw hwpfilter\inc nmake - all hw_inc NULL
diff --git a/hwpfilter/prj/d.lst b/hwpfilter/prj/d.lst
index 32763725af8b..0848b21f27ac 100644
--- a/hwpfilter/prj/d.lst
+++ b/hwpfilter/prj/d.lst
@@ -2,4 +2,4 @@
..\%__SRC%\lib\ihwp*.lib %_DEST%\bin%_EXT%\ihwp*.lib
..\%__SRC%\lib\libhwp.so %_DEST%\lib%_EXT%\libhwp.so
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
-
+..\%__SRC%\misc\hwp.component %_DEST%\xml%_EXT%\hwp.component
diff --git a/hwpfilter/source/hwp.component b/hwpfilter/source/hwp.component
new file mode 100644
index 000000000000..5280cfbbd46b
--- /dev/null
+++ b/hwpfilter/source/hwp.component
@@ -0,0 +1,34 @@
+<?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.comp.hwpimport.HwpImportFilter">
+ <service name="com.sun.star.document.ImportFilter"/>
+ </implementation>
+</component>
diff --git a/hwpfilter/source/hwpreader.hxx b/hwpfilter/source/hwpreader.hxx
index 5fba0eaf7f98..b0bbe416e5ad 100644
--- a/hwpfilter/source/hwpreader.hxx
+++ b/hwpfilter/source/hwpreader.hxx
@@ -346,30 +346,6 @@ extern "C"
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-
- sal_Bool SAL_CALL component_writeInfo(
- void * , void * pRegistryKey )
- {
- if (pRegistryKey)
- {
- try
- {
- Reference< XRegistryKey > xKey( reinterpret_cast< XRegistryKey * >( pRegistryKey ) );
-
- Reference< XRegistryKey > xNewKey = xKey->createKey(
- OUString(RTL_CONSTASCII_USTRINGPARAM( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" )) );
- xNewKey->createKey( OUString(RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME )) );
-
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
- }
-
void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * )
{
void * pRet = 0;
diff --git a/hwpfilter/source/makefile.mk b/hwpfilter/source/makefile.mk
index eaab1d32163c..accfe79dfb29 100644
--- a/hwpfilter/source/makefile.mk
+++ b/hwpfilter/source/makefile.mk
@@ -1,6 +1,4 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#************************************************************************* NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
@@ -94,3 +92,11 @@ DEF1NAME=$(SHL1TARGET)
# --- Tagets -------------------------------------------------------
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/hwp.component
+
+$(MISC)/hwp.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ hwp.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt hwp.component
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/filter/source/graphicfilter/epgm/epgmstr.src b/oox/inc/oox/token/namespacemap.hxx
index 8424505dbcd1..e4daa18f6b56 100644..100755
--- a/filter/source/graphicfilter/epgm/epgmstr.src
+++ b/oox/inc/oox/token/namespacemap.hxx
@@ -25,11 +25,25 @@
*
************************************************************************/
+#ifndef OOX_TOKEN_NAMESPACEMAP_HXX
+#define OOX_TOKEN_NAMESPACEMAP_HXX
-#include "strings.hrc"
+#include <map>
+#include <rtl/instance.hxx>
+#include <rtl/ustring.hxx>
-// Key fuer den Dialog
-String KEY_FORMAT
-{
- Text = "FileFormat";
-};
+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/filter/source/graphicfilter/egif/egifstr.src b/oox/source/token/namespaces.hxx.head
index ea258019d543..351bf2558303 100644..100755
--- a/filter/source/graphicfilter/egif/egifstr.src
+++ b/oox/source/token/namespaces.hxx.head
@@ -25,15 +25,12 @@
*
************************************************************************/
+#ifndef OOX_TOKEN_NAMESPACES_HXX
+#define OOX_TOKEN_NAMESPACES_HXX
-#include "strings.hrc"
+#include <sal/types.h>
+
+namespace oox {
+
+// ============================================================================
-// Key fuer den Dialog
-String KEY_INTER
-{
- Text = "Interlaced";
-};
-String KEY_TRANS
-{
- Text = "Translucent";
-};
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/filter/source/graphicfilter/epbm/epbmstr.src b/oox/source/token/properties.hxx.head
index 8424505dbcd1..25817b5e72f3 100644..100755
--- a/filter/source/graphicfilter/epbm/epbmstr.src
+++ b/oox/source/token/properties.hxx.head
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -25,11 +25,12 @@
*
************************************************************************/
+#ifndef OOX_TOKEN_PROPERTIES_HXX
+#define OOX_TOKEN_PROPERTIES_HXX
+
+#include <sal/types.h>
+
+namespace oox {
-#include "strings.hrc"
+// ============================================================================
-// Key fuer den Dialog
-String KEY_FORMAT
-{
- Text = "FileFormat";
-};
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/filter/source/graphicfilter/eos2met/eos2mstr.src b/oox/source/token/tokens.hxx.head
index 8afebcb7564c..dd201caeb1d9 100644..100755
--- a/filter/source/graphicfilter/eos2met/eos2mstr.src
+++ b/oox/source/token/tokens.hxx.head
@@ -25,14 +25,12 @@
*
************************************************************************/
-#include "strings.hrc"
+#ifndef OOX_TOKEN_TOKENS_HXX
+#define OOX_TOKEN_TOKENS_HXX
-String KEY_MODE
-{
- Text = "ExportMode";
-};
+#include <com/sun/star/xml/sax/FastToken.hpp>
+
+namespace oox {
+
+// ============================================================================
-String KEY_SIZE
-{
- Text = "Size";
-};
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>
diff --git a/unoxml/prj/build.lst b/unoxml/prj/build.lst
index cc54f6d3ad28..4da29cb9d669 100644
--- a/unoxml/prj/build.lst
+++ b/unoxml/prj/build.lst
@@ -1,6 +1,8 @@
-ux unoxml : offuh cppuhelper LIBXML2:libxml2 REDLAND:redland tools NULL
+ux unoxml : offuh cppuhelper LIBXML2:libxml2 LIBXSLT:libxslt REDLAND:redland tools NULL
ux unoxml\source\dom nmake - all ux_dom NULL
ux unoxml\source\xpath nmake - all ux_xpath ux_dom NULL
ux unoxml\source\events nmake - all ux_events ux_dom NULL
ux unoxml\source\service nmake - all ux_service ux_dom ux_xpath ux_events NULL
ux unoxml\source\rdf nmake - all ux_librdf NULL
+
+ux unoxml\qa\complex\unoxml nmake - all ux_complex ux_librdf NULL
diff --git a/unoxml/prj/d.lst b/unoxml/prj/d.lst
index e2bf5df03b34..4fcedbdba7a2 100644
--- a/unoxml/prj/d.lst
+++ b/unoxml/prj/d.lst
@@ -1,3 +1,5 @@
..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%\lib*.so
..\%__SRC%\lib\lib*.dylib %_DEST%\lib%_EXT%\lib*.dylib
..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll
+..\%__SRC%\misc\unordf.component %_DEST%\xml%_EXT%\unordf.component
+..\%__SRC%\misc\unoxml.component %_DEST%\xml%_EXT%\unoxml.component
diff --git a/unoxml/qa/complex/tests.sce b/unoxml/qa/complex/tests.sce
deleted file mode 100644
index 20596551f156..000000000000
--- a/unoxml/qa/complex/tests.sce
+++ /dev/null
@@ -1 +0,0 @@
--o complex.unoxml.RDFRepositoryTest
diff --git a/unoxml/qa/complex/RDFRepositoryTest.java b/unoxml/qa/complex/unoxml/RDFRepositoryTest.java
index f3f9cbd8ae41..d047ef77440e 100644
--- a/unoxml/qa/complex/RDFRepositoryTest.java
+++ b/unoxml/qa/complex/unoxml/RDFRepositoryTest.java
@@ -27,21 +27,16 @@
package complex.unoxml;
-import complexlib.ComplexTestCase;
import helper.StreamSimulator;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
-import com.sun.star.uno.Any;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XInitialization;
-import com.sun.star.lang.XEventListener;
import com.sun.star.lang.XServiceInfo;
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.WrappedTargetException;
import com.sun.star.lang.WrappedTargetRuntimeException;
import com.sun.star.beans.XPropertySet;
-import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.Pair;
import com.sun.star.beans.StringPair;
import com.sun.star.container.XEnumeration;
@@ -52,6 +47,15 @@ import com.sun.star.io.XOutputStream;
import com.sun.star.text.XTextRange;
import com.sun.star.text.XText;
import com.sun.star.rdf.*;
+import lib.TestParameters;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
/**
* Test case for service com.sun.star.rdf.Repository
@@ -60,7 +64,7 @@ import com.sun.star.rdf.*;
*
* @author mst
*/
-public class RDFRepositoryTest extends ComplexTestCase
+public class RDFRepositoryTest
{
XComponentContext xContext;
String tempDir;
@@ -80,112 +84,113 @@ public class RDFRepositoryTest extends ComplexTestCase
XLiteral littype;
String rdfs = "http://www.w3.org/2000/01/rdf-schema#";
- public String[] getTestMethodNames ()
- {
- return new String[] { "check", "checkSPARQL", "checkRDFa" };
- }
+ /**
+ * The test parameters
+ */
+ private static TestParameters param = null;
+
+// public String[] getTestMethodNames ()
+// {
+// return new String[] { "check", "checkSPARQL", "checkRDFa" };
+// }
- public void before()
+ @Before public void before()
{
try {
- XMultiServiceFactory xMSF = (XMultiServiceFactory) param.getMSF();
- assure("could not create MultiServiceFactory.", xMSF != null);
- XPropertySet xPropertySet = (XPropertySet)
- UnoRuntime.queryInterface(XPropertySet.class, xMSF);
+ XMultiServiceFactory xMSF = getMSF();
+ param = new TestParameters();
+ param.put("ServiceFactory", xMSF);
+
+ assertNotNull("could not create MultiServiceFactory.", xMSF);
+ XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xMSF);
Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext");
- xContext = (XComponentContext)
- UnoRuntime.queryInterface(XComponentContext.class, defaultCtx);
- assure("could not get component context.", xContext != null);
+ xContext = UnoRuntime.queryInterface(XComponentContext.class, defaultCtx);
+ assertNotNull("could not get component context.", xContext);
tempDir = util.utils.getOfficeTemp/*Dir*/(xMSF);
- log.println("tempdir: " + tempDir);
+ System.out.println("tempdir: " + tempDir);
foo = URI.create(xContext, "uri:foo");
- assure("foo", null != foo);
+ assertNotNull("foo", foo);
bar = URI.create(xContext, "uri:bar");
- assure("bar", null != bar);
+ assertNotNull("bar", bar);
baz = URI.create(xContext, "uri:baz");
- assure("baz", null != baz);
+ assertNotNull("baz", baz);
uint = URI.create(xContext, "uri:int");
- assure("uint", null != uint);
+ assertNotNull("uint", uint);
blank = BlankNode.create(xContext, "_:uno");
- assure("blank", null != blank);
+ assertNotNull("blank", blank);
lit = Literal.create(xContext, "i am the literal");
- assure("lit", null != lit);
+ assertNotNull("lit", lit);
litlang = Literal.createWithLanguage(xContext,
"i am the literal", "en");
- assure("litlang", null != litlang);
+ assertNotNull("litlang", litlang);
littype = Literal.createWithType(xContext, "42", uint);
- assure("littype", null != littype);
+ assertNotNull("littype", littype);
rdfslabel = URI.create(xContext, rdfs + "label");
- assure("rdfslabel", null != rdfslabel);
+ assertNotNull("rdfslabel", rdfslabel);
manifest = URI.create(xContext, "manifest:manifest"); //FIXME
- assure("manifest", null != manifest);
+ assertNotNull("manifest", manifest);
uuid = URI.create(xContext,
"urn:uuid:224ab023-77b8-4396-a75a-8cecd85b81e3");
- assure("uuid", null != uuid);
+ assertNotNull("uuid", uuid);
base = URI.create(xContext, "base-uri:"); //FIXME
- assure("base", null != base);
+ assertNotNull("base", base);
} catch (Exception e) {
report(e);
}
+ //FIXME: ?
+// xRep = Repository.create(xContext);
+ System.out.println("Creating service Repository...");
+ xRep = UnoRuntime.queryInterface(XDocumentRepository.class, Repository.create(xContext));
+ assertNotNull("null", xRep);
+ System.out.println("...done");
}
- public void after()
+ @After public void after()
{
xRep = null;
}
- public void check()
+ @Test public void check()
{
try {
-
- log.println("Creating service Repository...");
-
- //FIXME: ?
-// xRep = Repository.create(xContext);
- xRep = (XDocumentRepository) UnoRuntime.queryInterface(
- XDocumentRepository.class, Repository.create(xContext));
- assure("null", null != xRep);
-
- log.println("...done");
-
- log.println("Checking that new repository is really empty...");
- assure("empty: graphs", 0 == xRep.getGraphNames().length);
+ System.out.println("Checking that new repository is really empty...");
+ assertTrue("empty: graphs", 0 == xRep.getGraphNames().length);
XEnumeration stmts;
stmts = xRep.getStatements(null, null, null);
- assure("empty: stmts", !stmts.hasMoreElements());
+ assertTrue("empty: stmts", !stmts.hasMoreElements());
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking graph creation...");
+ System.out.println("Checking graph creation...");
XNamedGraph xFooGraph = xRep.createGraph(foo);
- assure("foo graph", null != xFooGraph);
+ assertNotNull("foo graph", xFooGraph);
try {
xRep.createGraph(foo);
- assure("creating duplicate graph was allowed", false);
+ assertFalse("creating duplicate graph was allowed", false);
} catch (ElementExistException e) {
// ignore
}
try {
xRep.createGraph(null);
- assure("invalid graph name was allowed", false);
+ assertFalse("invalid graph name was allowed", false);
} catch (IllegalArgumentException e) {
// ignore
}
XURI[] names = xRep.getGraphNames();
- assure("no foo graph in getGraphNames",
+ assertTrue("no foo graph in getGraphNames",
1 == names.length && eq(names[0], foo));
- assure("no foo graph", null != xRep.getGraph(foo));
+ assertNotNull("no foo graph", xRep.getGraph(foo));
stmts = xFooGraph.getStatements(null, null, null);
- assure("stmts in foo graph", !stmts.hasMoreElements());
+ assertTrue("stmts in foo graph", !stmts.hasMoreElements());
XOutputStream xFooOut =
new StreamSimulator(tempDir + "empty.rdf", false, param);
@@ -195,94 +200,94 @@ public class RDFRepositoryTest extends ComplexTestCase
XInputStream xFooIn =
new StreamSimulator(tempDir + "empty.rdf", true, param);
xRep.importGraph(FileFormat.RDF_XML, xFooIn, bar, base);
- assure("no bar graph", null != xRep.getGraph(bar));
+ assertNotNull("no bar graph", xRep.getGraph(bar));
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking graph manipulation...");
+ System.out.println("Checking graph manipulation...");
XEnumeration xFooEnum;
Statement xFoo_FooBarBaz = new Statement(foo, bar, baz, foo);
xFooGraph.addStatement(foo, bar, baz);
xFooEnum = xFooGraph.getStatements(null, null, null);
- assure("addStatement(foo,bar,baz)",
+ assertTrue("addStatement(foo,bar,baz)",
eq(xFooEnum, new Statement[] { xFoo_FooBarBaz }));
Statement xFoo_FooBarBlank = new Statement(foo, bar, blank, foo);
xFooGraph.addStatement(foo, bar, blank);
xFooEnum = xFooGraph.getStatements(null, null, null);
- assure("addStatement(foo,bar,blank)",
+ assertTrue("addStatement(foo,bar,blank)",
eq(xFooEnum,
new Statement[] { xFoo_FooBarBaz, xFoo_FooBarBlank }));
xFooEnum = xRep.getStatements(null, null, null);
- assure("addStatement(foo,bar,blank) (global)",
+ assertTrue("addStatement(foo,bar,blank) (global)",
eq(xFooEnum,
new Statement[] { xFoo_FooBarBaz, xFoo_FooBarBlank }));
Statement xFoo_BazBarLit = new Statement(baz, bar, lit, foo);
xFooGraph.addStatement(baz, bar, lit);
xFooEnum = xFooGraph.getStatements(null, null, null);
- assure("addStatement(baz,bar,lit)",
+ assertTrue("addStatement(baz,bar,lit)",
eq(xFooEnum, new Statement[] {
xFoo_FooBarBaz, xFoo_FooBarBlank, xFoo_BazBarLit }));
xFooEnum = xFooGraph.getStatements(baz, bar, null);
- assure("addStatement(baz,bar,lit) (baz,bar)",
+ assertTrue("addStatement(baz,bar,lit) (baz,bar)",
eq(xFooEnum, new Statement[] { xFoo_BazBarLit }));
Statement xFoo_BazBarLitlang =
new Statement(baz, bar, litlang, foo);
xFooGraph.addStatement(baz, bar, litlang);
xFooEnum = xFooGraph.getStatements(null, null, null);
- assure("addStatement(baz,bar,litlang)",
+ assertTrue("addStatement(baz,bar,litlang)",
eq(xFooEnum, new Statement[] {
xFoo_FooBarBaz, xFoo_FooBarBlank, xFoo_BazBarLit,
xFoo_BazBarLitlang }));
xFooEnum = xFooGraph.getStatements(null, null, baz);
- assure("addStatement(baz,bar,litlang) (baz)",
+ assertTrue("addStatement(baz,bar,litlang) (baz)",
eq(xFooEnum, new Statement[] { xFoo_FooBarBaz }));
Statement xFoo_BazBarLittype =
new Statement(baz, bar, littype, foo);
xFooGraph.addStatement(baz, bar, littype);
xFooEnum = xFooGraph.getStatements(null, null, null);
- assure("addStatement(baz,bar,littype)",
+ assertTrue("addStatement(baz,bar,littype)",
eq(xFooEnum, new Statement[] { xFoo_FooBarBaz, xFoo_FooBarBlank,
xFoo_BazBarLit, xFoo_BazBarLitlang, xFoo_BazBarLittype }));
xFooGraph.removeStatements(baz, bar, litlang);
xFooEnum = xFooGraph.getStatements(null, null, null);
- assure("removeStatement(baz,bar,litlang)",
+ assertTrue("removeStatement(baz,bar,litlang)",
eq(xFooEnum, new Statement[] { xFoo_FooBarBaz, xFoo_FooBarBlank,
xFoo_BazBarLit, xFoo_BazBarLittype }));
xFooGraph.removeStatements(foo, bar, null);
xFooEnum = xFooGraph.getStatements(null, null, null);
- assure("removeStatement(foo,bar,null)",
+ assertTrue("removeStatement(foo,bar,null)",
eq(xFooEnum, new Statement[] {
xFoo_BazBarLit, xFoo_BazBarLittype }));
xFooGraph.addStatement(foo, bar, baz);
xFooEnum = xFooGraph.getStatements(null, null, null);
- assure("addStatement(foo,bar,baz) (re-add)",
+ assertTrue("addStatement(foo,bar,baz) (re-add)",
eq(xFooEnum, new Statement[] { xFoo_FooBarBaz,
xFoo_BazBarLit, xFoo_BazBarLittype }));
xFooGraph.addStatement(foo, bar, baz);
xFooEnum = xFooGraph.getStatements(null, null, null);
- assure("addStatement(foo,bar,baz) (duplicate)",
+ assertTrue("addStatement(foo,bar,baz) (duplicate)",
eq(xFooEnum, new Statement[] { xFoo_FooBarBaz,
xFoo_BazBarLit, xFoo_BazBarLittype }));
xFooGraph.addStatement(xFooGraph, bar, baz);
xFooEnum = xFooGraph.getStatements(null, null, null);
- assure("addStatement(foo,bar,baz) (triplicate, as graph)",
+ assertTrue("addStatement(foo,bar,baz) (triplicate, as graph)",
eq(xFooEnum, new Statement[] { xFoo_FooBarBaz,
xFoo_BazBarLit, xFoo_BazBarLittype }));
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking graph import/export...");
+ System.out.println("Checking graph import/export...");
xFooOut = new StreamSimulator(tempDir + "foo.rdf", false, param);
xRep.exportGraph(FileFormat.RDF_XML, xFooOut, foo, base);
@@ -291,7 +296,7 @@ public class RDFRepositoryTest extends ComplexTestCase
xFooIn = new StreamSimulator(tempDir + "foo.rdf", true, param);
try {
xRep.importGraph(FileFormat.RDF_XML, xFooIn, bar, base);
- assure("importing existing graph did not fail", false);
+ assertFalse("importing existing graph did not fail", false);
} catch (ElementExistException e) {
// ignore
}
@@ -299,77 +304,77 @@ public class RDFRepositoryTest extends ComplexTestCase
xFooIn = new StreamSimulator(tempDir + "foo.rdf", true, param);
xRep.importGraph(FileFormat.RDF_XML, xFooIn, baz, base);
XNamedGraph xBazGraph = xRep.getGraph(baz);
- assure("no baz graph", null != xBazGraph);
+ assertNotNull("no baz graph", xBazGraph);
Statement xBaz_FooBarBaz = new Statement(foo, bar, baz, baz);
Statement xBaz_BazBarLit = new Statement(baz, bar, lit, baz);
Statement xBaz_BazBarLittype =
new Statement(baz, bar, littype, baz);
XEnumeration xBazEnum = xBazGraph.getStatements(null, null, null);
- assure("importing exported graph",
+ assertTrue("importing exported graph",
eq(xBazEnum, new Statement[] {
xBaz_FooBarBaz, xBaz_BazBarLit, xBaz_BazBarLittype }));
- log.println("...done");
+ System.out.println("...done");
- log.println("Checking graph deletion...");
+ System.out.println("Checking graph deletion...");
xFooGraph.clear();
xFooEnum = xFooGraph.getStatements(null, null, null);
- assure("clear", eq(xFooEnum, new Statement[] { }));
+ assertTrue("clear", eq(xFooEnum, new Statement[] { }));
xRep.destroyGraph(baz);
- assure("baz graph zombie", null == xRep.getGraph(baz));
+ assertNull("baz graph zombie", xRep.getGraph(baz));
try {
xBazGraph.clear();
- assure("deleted graph not invalid (clear)", false);
+ assertFalse("deleted graph not invalid (clear)", false);
} catch (NoSuchElementException e) {
// ignore
}
try {
xBazGraph.addStatement(foo, foo, foo);
- assure("deleted graph not invalid (add)", false);
+ assertFalse("deleted graph not invalid (add)", false);
} catch (NoSuchElementException e) {
// ignore
}
try {
xBazGraph.removeStatements(null, null, null);
- assure("deleted graph not invalid (remove)", false);
+ assertFalse("deleted graph not invalid (remove)", false);
} catch (NoSuchElementException e) {
// ignore
}
try {
xBazGraph.getStatements(null, null, null);
- assure("deleted graph not invalid (get)", false);
+ assertFalse("deleted graph not invalid (get)", false);
} catch (NoSuchElementException e) {
// ignore
}
- log.println("...done");
+ System.out.println("...done");
} catch (Exception e) {
report(e);
}
}
- public void checkSPARQL()
+ @Test public void checkSPARQL()
{
try {
- log.println("Checking SPARQL queries...");
+ System.out.println("Checking SPARQL queries...");
- XInputStream xIn = new StreamSimulator(
- util.utils.getFullTestDocName("example.rdf"), true, param);
+ XInputStream xIn = new StreamSimulator(TestDocument.getUrl("example.rdf"), true, param);
+ // util.utils.getFullTestDocName("example.rdf"), true, param);
xRep.importGraph(FileFormat.RDF_XML, xIn, manifest, base);
String query;
query = "SELECT ?p WHERE { ?p rdf:type pkg:Package . }";
XQuerySelectResult result = xRep.querySelect(mkNss() + query);
- assure("query: package-id\n" + query,
+ assertTrue("query: package-id\n" + query,
eq(result, new String[] { "p" },
new XNode[][] { { uuid } }));
@@ -377,7 +382,7 @@ public class RDFRepositoryTest extends ComplexTestCase
"> WHERE { ?pkg rdf:type pkg:Package . ?pkg pkg:hasPart ?part ."
+ " ?part pkg:path ?path . ?part rdf:type odf:ContentFile. }";
result = xRep.querySelect(mkNss() + query);
- assure("query: contentfile",
+ assertTrue("query: contentfile",
eq(result, new String[] { "part", "path" },
new XNode[][] { { BlankNode.create(xContext, "whatever"),
Literal.create(xContext, "content.xml") } }));
@@ -386,7 +391,7 @@ public class RDFRepositoryTest extends ComplexTestCase
+ "?pkg rdf:type pkg:Package . ?pkg pkg:hasPart ?part . "
+ "?part pkg:path ?path . ?part rdf:type odf:ContentFile. }";
result = xRep.querySelect(mkNss() + query);
- assure("query: contentfile\n" + query,
+ assertTrue("query: contentfile\n" + query,
eq(result, new String[] { "pkg", "path" },
new XNode[][] { { uuid ,
Literal.create(xContext, "content.xml") } }));
@@ -395,7 +400,7 @@ public class RDFRepositoryTest extends ComplexTestCase
+ "?pkg rdf:type pkg:Package . ?pkg pkg:hasPart ?part . "
+ "?part pkg:path ?path . ?part rdf:type odf:StylesFile. }";
result = xRep.querySelect(mkNss() + query);
- assure("query: stylesfile\n" + query,
+ assertTrue("query: stylesfile\n" + query,
eq(result, new String[] { "part", "path" },
new XNode[][] { }));
@@ -403,7 +408,7 @@ public class RDFRepositoryTest extends ComplexTestCase
+ "?pkg rdf:type pkg:Package . ?pkg pkg:hasPart ?part . "
+ "?part pkg:path ?path . ?part rdf:type odf:MetadataFile. }";
result = xRep.querySelect(mkNss() + query);
- assure("query: metadatafile\n" + query,
+ assertTrue("query: metadatafile\n" + query,
eq(result, new String[] { "part", "path" },
new XNode[][] { {
URI.create(xContext, "http://hospital-employee/doctor"),
@@ -424,9 +429,9 @@ public class RDFRepositoryTest extends ComplexTestCase
+ " pkg:idref ?idref . "
+ " FILTER (?type = odf:ContentFile || ?type = odf:StylesFile)"
+ " }";
-//log.println(query);
+//System.out.println(query);
result = xRep.querySelect(mkNss() + query);
- assure("query: example-element-2\n" + query,
+ assertTrue("query: example-element-2\n" + query,
eq(result, new String[] { "path", "idref" },
new XNode[][] { {
Literal.create(xContext, "content.xml"),
@@ -438,24 +443,24 @@ public class RDFRepositoryTest extends ComplexTestCase
lit.getStringValue() + "\" } FROM <" + toS(manifest) +
"> WHERE { ?pkg rdf:type pkg:Package . } ";
XEnumeration xResultEnum = xRep.queryConstruct(mkNss() + query);
- assure("query: construct\n" + query,
+ assertTrue("query: construct\n" + query,
eq(xResultEnum, new Statement[] { x_PkgFooLit }));
query = "ASK { ?pkg rdf:type pkg:Package . }";
boolean bResult = xRep.queryAsk(mkNss() + query);
- assure("query: ask\n" + query, bResult);
+ assertTrue("query: ask\n" + query, bResult);
- log.println("...done");
+ System.out.println("...done");
} catch (Exception e) {
report(e);
}
}
- public void checkRDFa()
+ @Test public void checkRDFa()
{
try {
- log.println("Checking RDFa gunk...");
+ System.out.println("Checking RDFa gunk...");
String content = "behold, for i am the content.";
XTextRange xTR = new TestRange(content);
@@ -463,19 +468,19 @@ public class RDFRepositoryTest extends ComplexTestCase
Pair<Statement[], Boolean> result =
xRep.getStatementRDFa((XMetadatable)xTR);
- assure("RDFa: get: not empty (initial)",
+ assertTrue("RDFa: get: not empty (initial)",
0 == result.First.length);
try {
xRep.setStatementRDFa(foo, new XURI[] {}, xM, "", null);
- assure("RDFa: set: no predicate", false);
+ assertFalse("RDFa: set: no predicate", false);
} catch (IllegalArgumentException e) {
// ignore
}
try {
xRep.setStatementRDFa(foo, new XURI[] {bar}, null, "", null);
- assure("RDFa: set: null", false);
+ assertFalse("RDFa: set: null", false);
} catch (IllegalArgumentException e) {
// ignore
}
@@ -485,16 +490,16 @@ public class RDFRepositoryTest extends ComplexTestCase
xRep.setStatementRDFa(foo, new XURI[] { bar }, xM, "", null);
result = xRep.getStatementRDFa((XMetadatable)xTR);
- assure("RDFa: get: without content",
+ assertTrue("RDFa: get: without content",
!result.Second && (1 == result.First.length)
- && eq((Statement)result.First[0], x_FooBarTRLit));
+ && eq(result.First[0], x_FooBarTRLit));
//FIXME: do this?
xTR.setString(lit.getStringValue());
/*
Statement xFooBarLit = new Statement(foo, bar, lit, null);
result = xRep.getStatementRDFa((XMetadatable)xTR);
- assure("RDFa: get: change",
+ assertTrue("RDFa: get: change",
eq((Statement)result.First, xFooBarLit) && null == result.Second);
*/
@@ -502,17 +507,17 @@ public class RDFRepositoryTest extends ComplexTestCase
xRep.setStatementRDFa(foo, new XURI[] { bar }, xM, "42", uint);
result = xRep.getStatementRDFa((XMetadatable)xTR);
- assure("RDFa: get: with content",
+ assertTrue("RDFa: get: with content",
result.Second &&
(1 == result.First.length) &&
- eq((Statement)result.First[0], x_FooBarLittype));
+ eq(result.First[0], x_FooBarLittype));
//FIXME: do this?
xTR.setString(content);
/*
Statement xFooLabelTRLit = new Statement(foo, rdfslabel, trlit, null);
result = xRep.getStatementRDFa((XMetadatable)xTR);
- assure("RDFa: get: change (label)",
+ assertTrue("RDFa: get: change (label)",
eq((Statement)result.First, xFooBarLittype) &&
eq((Statement)result.Second, xFooLabelTRLit));
*/
@@ -520,7 +525,7 @@ public class RDFRepositoryTest extends ComplexTestCase
xRep.removeStatementRDFa((XMetadatable)xTR);
result = xRep.getStatementRDFa((XMetadatable)xTR);
- assure("RDFa: get: not empty (removed)",
+ assertTrue("RDFa: get: not empty (removed)",
0 == result.First.length);
xRep.setStatementRDFa(foo, new XURI[] { foo, bar, baz }, xM,
@@ -529,7 +534,7 @@ public class RDFRepositoryTest extends ComplexTestCase
Statement x_FooFooTRLit = new Statement(foo, foo, trlit, null);
Statement x_FooBazTRLit = new Statement(foo, baz, trlit, null);
result = xRep.getStatementRDFa((XMetadatable) xTR);
- assure("RDFa: get: without content (multiple predicates, reinsert)",
+ assertTrue("RDFa: get: without content (multiple predicates, reinsert)",
!result.Second &&
eq(result.First, new Statement[] {
x_FooFooTRLit, x_FooBarTRLit, x_FooBazTRLit }));
@@ -537,10 +542,10 @@ public class RDFRepositoryTest extends ComplexTestCase
xRep.removeStatementRDFa((XMetadatable)xTR);
result = xRep.getStatementRDFa((XMetadatable) xTR);
- assure("RDFa: get: not empty (re-removed)",
+ assertTrue("RDFa: get: not empty (re-removed)",
0 == result.First.length);
- log.println("...done");
+ System.out.println("...done");
} catch (Exception e) {
report(e);
@@ -553,36 +558,38 @@ public class RDFRepositoryTest extends ComplexTestCase
{
if (e instanceof WrappedTargetException)
{
- log.println("Cause:");
+ System.out.println("Cause:");
Exception cause = (Exception)
(((WrappedTargetException)e).TargetException);
- log.println(cause.toString());
+ System.out.println(cause.toString());
report2(cause);
} else if (e instanceof WrappedTargetRuntimeException) {
- log.println("Cause:");
+ System.out.println("Cause:");
Exception cause = (Exception)
(((WrappedTargetRuntimeException)e).TargetException);
- log.println(cause.toString());
+ System.out.println(cause.toString());
report2(cause);
}
}
public void report(Exception e) {
- log.println("Exception occurred:");
- e.printStackTrace((java.io.PrintWriter) log);
+ System.out.println("Exception occurred:");
+ e.printStackTrace();
report2(e);
- failed();
+ fail();
}
public static String toS(XNode n) {
- if (null == n) return "< null >";
+ if (null == n)
+ {
+ return "< null >";
+ }
return n.getStringValue();
}
static boolean isBlank(XNode i_node)
{
- XBlankNode blank = (XBlankNode) UnoRuntime.queryInterface(
- XBlankNode.class, i_node);
+ XBlankNode blank = UnoRuntime.queryInterface(XBlankNode.class, i_node);
return blank != null;
}
@@ -615,7 +622,7 @@ public class RDFRepositoryTest extends ComplexTestCase
java.util.Collection c = new java.util.Vector();
while (i_Enum.hasMoreElements()) {
Statement s = (Statement) i_Enum.nextElement();
-//log.println("toSeq: " + s.getSubject().getStringValue() + " " + s.getPredicate().getStringValue() + " " + s.getObject().getStringValue() + ".");
+//System.out.println("toSeq: " + s.getSubject().getStringValue() + " " + s.getPredicate().getStringValue() + " " + s.getObject().getStringValue() + ".");
c.add(s);
}
// return (Statement[]) c.toArray();
@@ -650,7 +657,10 @@ public class RDFRepositoryTest extends ComplexTestCase
{
XNode[] left = (XNode[]) i_Left;
XNode[] right = (XNode[]) i_Right;
- if (left.length != right.length) throw new RuntimeException();
+ if (left.length != right.length)
+ {
+ throw new RuntimeException();
+ }
for (int i = 0; i < left.length; ++i) {
int eq = (left[i].getStringValue().compareTo(
right[i].getStringValue()));
@@ -667,10 +677,22 @@ public class RDFRepositoryTest extends ComplexTestCase
int eq;
Statement left = (Statement) i_Left;
Statement right = (Statement) i_Right;
- if ((eq = cmp(left.Graph, right.Graph )) != 0) return eq;
- if ((eq = cmp(left.Subject, right.Subject )) != 0) return eq;
- if ((eq = cmp(left.Predicate, right.Predicate)) != 0) return eq;
- if ((eq = cmp(left.Object, right.Object )) != 0) return eq;
+ if ((eq = cmp(left.Graph, right.Graph )) != 0)
+ {
+ return eq;
+ }
+ if ((eq = cmp(left.Subject, right.Subject )) != 0)
+ {
+ return eq;
+ }
+ if ((eq = cmp(left.Predicate, right.Predicate)) != 0)
+ {
+ return eq;
+ }
+ if ((eq = cmp(left.Object, right.Object )) != 0)
+ {
+ return eq;
+ }
return 0;
}
@@ -693,23 +715,23 @@ public class RDFRepositoryTest extends ComplexTestCase
XURI lG = i_Left.Graph;
XURI rG = i_Right.Graph;
if (!eq(lG, rG)) {
- log.println("Graphs differ: " + toS(lG) + " != " + toS(rG));
+ System.out.println("Graphs differ: " + toS(lG) + " != " + toS(rG));
return false;
}
if (!eq(i_Left.Subject, i_Right.Subject)) {
- log.println("Subjects differ: " +
+ System.out.println("Subjects differ: " +
i_Left.Subject.getStringValue() + " != " +
i_Right.Subject.getStringValue());
return false;
}
if (!eq(i_Left.Predicate, i_Right.Predicate)) {
- log.println("Predicates differ: " +
+ System.out.println("Predicates differ: " +
i_Left.Predicate.getStringValue() + " != " +
i_Right.Predicate.getStringValue());
return false;
}
if (!eq(i_Left.Object, i_Right.Object)) {
- log.println("Objects differ: " +
+ System.out.println("Objects differ: " +
i_Left.Object.getStringValue() + " != " +
i_Right.Object.getStringValue());
return false;
@@ -720,7 +742,7 @@ public class RDFRepositoryTest extends ComplexTestCase
static boolean eq(Statement[] i_Result, Statement[] i_Expected)
{
if (i_Result.length != i_Expected.length) {
- log.println("eq: different lengths: " + i_Result.length + " " +
+ System.out.println("eq: different lengths: " + i_Result.length + " " +
i_Expected.length);
return false;
}
@@ -729,7 +751,10 @@ public class RDFRepositoryTest extends ComplexTestCase
java.util.Arrays.sort(i_Result, new StmtComp());
java.util.Arrays.sort(expected, new StmtComp());
for (int i = 0; i < expected.length; ++i) {
- if (!eq(i_Result[i], expected[i])) return false;
+ if (!eq(i_Result[i], expected[i]))
+ {
+ return false;
+ }
}
return true;
}
@@ -760,11 +785,11 @@ public class RDFRepositoryTest extends ComplexTestCase
XEnumeration iter = (XEnumeration) i_Result;
XNode[][] bindings = toSeqs(iter);
if (vars.length != i_Vars.length) {
- log.println("var lengths differ");
+ System.out.println("var lengths differ");
return false;
}
if (bindings.length != i_Bindings.length) {
- log.println("binding lengths differ: " + i_Bindings.length +
+ System.out.println("binding lengths differ: " + i_Bindings.length +
" vs " + bindings.length );
return false;
}
@@ -772,16 +797,16 @@ public class RDFRepositoryTest extends ComplexTestCase
java.util.Arrays.sort(i_Bindings, new BindingComp());
for (int i = 0; i < i_Bindings.length; ++i) {
if (i_Bindings[i].length != i_Vars.length) {
- log.println("TEST ERROR!");
+ System.out.println("TEST ERROR!");
throw new Exception();
}
if (bindings[i].length != i_Vars.length) {
- log.println("binding length and var length differ");
+ System.out.println("binding length and var length differ");
return false;
}
for (int j = 0; j < i_Vars.length; ++j) {
if (!eq(bindings[i][j], i_Bindings[i][j])) {
- log.println("bindings differ: " +
+ System.out.println("bindings differ: " +
toS(bindings[i][j]) + " != " + toS(i_Bindings[i][j]));
return false;
}
@@ -789,7 +814,7 @@ public class RDFRepositoryTest extends ComplexTestCase
}
for (int i = 0; i < i_Vars.length; ++i) {
if (!vars[i].equals(i_Vars[i])) {
- log.println("variable names differ: " +
+ System.out.println("variable names differ: " +
vars[i] + " != " + i_Vars[i]);
return false;
}
@@ -828,7 +853,7 @@ public class RDFRepositoryTest extends ComplexTestCase
{ return new StringPair(m_Stream, m_XmlId); }
public void setMetadataReference(StringPair i_Ref)
throws IllegalArgumentException
- { m_Stream = (String)i_Ref.First; m_XmlId = (String)i_Ref.Second; }
+ { m_Stream = i_Ref.First; m_XmlId = i_Ref.Second; }
public void ensureMetadataReference()
{ m_Stream = "content.xml"; m_XmlId = "42"; }
@@ -843,5 +868,26 @@ public class RDFRepositoryTest extends ComplexTestCase
public String getString() { return m_Text; }
public void setString(String i_Str) { m_Text = i_Str; }
}
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
}
diff --git a/unoxml/qa/complex/unoxml/TestDocument.java b/unoxml/qa/complex/unoxml/TestDocument.java
new file mode 100644
index 000000000000..bce9510e4d94
--- /dev/null
+++ b/unoxml/qa/complex/unoxml/TestDocument.java
@@ -0,0 +1,39 @@
+/*************************************************************************
+*
+* 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.
+*
+************************************************************************/
+
+package complex.unoxml;
+
+import java.io.File;
+import org.openoffice.test.OfficeFileUrl;
+
+final class TestDocument {
+ public static String getUrl(String name) {
+ return OfficeFileUrl.getAbsolute(new File("testdocuments", name));
+ }
+
+ private TestDocument() {}
+}
diff --git a/unoxml/qa/complex/makefile.mk b/unoxml/qa/complex/unoxml/makefile.mk
index c74cbcb80dcf..136d23a9a232 100644
--- a/unoxml/qa/complex/makefile.mk
+++ b/unoxml/qa/complex/unoxml/makefile.mk
@@ -25,35 +25,35 @@
#
#***********************************************************************/
-PRJ = ..$/..
-TARGET = unoxml_test
-PRJNAME = $(TARGET)
-PACKAGE = complex$/unoxml
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-
-#----- compile .java files -----------------------------------------
+PRJ = ../../..
+PRJNAME = unoxml
+TARGET = qa_complex_unoxml
-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
-JAVAFILES = RDFRepositoryTest.java \
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/unoxml
+JAVATESTFILES = \
+ RDFRepositoryTest.java
-JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+JAVAFILES = $(JAVATESTFILES) \
+ TestDocument.java
-#----- make a jar from compiled files ------------------------------
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
-MAXLINELENGTH = 100000
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
+.END
-JARCLASSDIRS = $(PACKAGE)
-JARTARGET = $(TARGET).jar
-JARCOMPRESS = TRUE
-
-# --- Targets ------------------------------------------------------
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-.INCLUDE : target.mk
+ALLTAR : javatest
+.END
-run:
- +java -cp $(CLASSPATH) org.openoffice.Runner -TestBase java_complex -sce tests.sce -tdoc $(PWD)$/testdocuments
diff --git a/unoxml/qa/complex/testdocuments/example.rdf b/unoxml/qa/complex/unoxml/testdocuments/example.rdf
index 07ef7f07b6fd..07ef7f07b6fd 100644
--- a/unoxml/qa/complex/testdocuments/example.rdf
+++ b/unoxml/qa/complex/unoxml/testdocuments/example.rdf
diff --git a/unoxml/source/rdf/librdf_services.cxx b/unoxml/source/rdf/librdf_services.cxx
index aaa32a837ae7..efe632944c10 100644
--- a/unoxml/source/rdf/librdf_services.cxx
+++ b/unoxml/source/rdf/librdf_services.cxx
@@ -73,13 +73,6 @@ extern "C" void * SAL_CALL component_getFactory(
implName, serviceManager, registryKey, entries);
}
-extern "C" sal_Bool SAL_CALL component_writeInfo(
- void * serviceManager, void * registryKey)
-{
- return ::cppu::component_writeInfoHelper(serviceManager, registryKey,
- entries);
-}
-
} // extern "C"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unoxml/source/rdf/makefile.mk b/unoxml/source/rdf/makefile.mk
index 3f6d7f445297..1dbcffb8b6ac 100644
--- a/unoxml/source/rdf/makefile.mk
+++ b/unoxml/source/rdf/makefile.mk
@@ -82,3 +82,11 @@ SHL1STDLIBS= \
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/unordf.component
+
+$(MISC)/unordf.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ unordf.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt unordf.component
diff --git a/unoxml/source/rdf/unordf.component b/unoxml/source/rdf/unordf.component
new file mode 100644
index 000000000000..a828e7b05d47
--- /dev/null
+++ b/unoxml/source/rdf/unordf.component
@@ -0,0 +1,43 @@
+<?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="CBlankNode">
+ <service name="com.sun.star.rdf.BlankNode"/>
+ </implementation>
+ <implementation name="CLiteral">
+ <service name="com.sun.star.rdf.Literal"/>
+ </implementation>
+ <implementation name="CURI">
+ <service name="com.sun.star.rdf.URI"/>
+ </implementation>
+ <implementation name="librdf_Repository">
+ <service name="com.sun.star.rdf.Repository"/>
+ </implementation>
+</component>
diff --git a/unoxml/source/service/makefile.mk b/unoxml/source/service/makefile.mk
index 93aec0746323..5fbe62f67ec4 100644
--- a/unoxml/source/service/makefile.mk
+++ b/unoxml/source/service/makefile.mk
@@ -76,3 +76,11 @@ SHL1STDLIBS= \
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/unoxml.component
+
+$(MISC)/unoxml.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ unoxml.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt unoxml.component
diff --git a/unoxml/source/service/services.cxx b/unoxml/source/service/services.cxx
index 00cb14c00cc4..38d22b3ace3a 100644
--- a/unoxml/source/service/services.cxx
+++ b/unoxml/source/service/services.cxx
@@ -61,44 +61,6 @@ component_getImplementationEnvironment(const sal_Char **ppEnvironmentTypeName, u
*ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
}
-sal_Bool SAL_CALL
-component_writeInfo(void * /*pServiceManager*/, void* pRegistryKey )
-{
- Reference< XRegistryKey > xKey(reinterpret_cast< XRegistryKey* >(pRegistryKey));
- Reference< XRegistryKey > xNewKey;
- OUString aImpl;
-
- // register DOM service
- aImpl = OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += CDocumentBuilder::_getImplementationName();
- aImpl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey(aImpl);
- xNewKey->createKey(CDocumentBuilder::_getSupportedServiceNames()[0]);
-
- // register DOM service
- aImpl = OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += CSAXDocumentBuilder::_getImplementationName();
- aImpl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey(aImpl);
- xNewKey->createKey(CSAXDocumentBuilder::_getSupportedServiceNames()[0]);
-
- // register XPath service
- aImpl = OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += CXPathAPI::_getImplementationName();
- aImpl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey(aImpl);
- xNewKey->createKey(CXPathAPI::_getSupportedServiceNames()[0]);
-
- // register EventTest service
- aImpl = OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- aImpl += CTestListener::_getImplementationName();
- aImpl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
- xNewKey = xKey->createKey(aImpl);
- xNewKey->createKey(CTestListener::_getSupportedServiceNames()[0]);
-
- return sal_True;
-}
-
void* SAL_CALL
component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, void * /*pRegistryKey*/)
{
diff --git a/unoxml/source/service/unoxml.component b/unoxml/source/service/unoxml.component
new file mode 100644
index 000000000000..d8c907e6475b
--- /dev/null
+++ b/unoxml/source/service/unoxml.component
@@ -0,0 +1,43 @@
+<?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.xml.dom.DocumentBuilder">
+ <service name="com.sun.star.xml.dom.DocumentBuilder"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.xml.dom.SAXDocumentBuilder">
+ <service name="com.sun.star.xml.dom.SAXDocumentBuilder"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.xml.dom.events.TestListener">
+ <service name="com.sun.star.comp.xml.dom.events.TestListener"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.xml.xpath.XPathAPI">
+ <service name="com.sun.star.xml.xpath.XPathAPI"/>
+ </implementation>
+</component>
diff --git a/unoxml/source/xpath/xpathapi.hxx b/unoxml/source/xpath/xpathapi.hxx
index 67f744950a3f..4bc57a958014 100644
--- a/unoxml/source/xpath/xpathapi.hxx
+++ b/unoxml/source/xpath/xpathapi.hxx
@@ -70,7 +70,7 @@ namespace XPath
private:
nsmap_t m_nsmap;
- const Reference < XMultiServiceFactory > m_aFactory;
+ const Reference< XMultiServiceFactory > m_aFactory;
extensions_t m_extensions;
public:
diff --git a/writerfilter/inc/dmapper/DomainMapper.hxx b/writerfilter/inc/dmapper/DomainMapper.hxx
index b3ea929a30f7..d9d40aa32ad9 100644
--- a/writerfilter/inc/dmapper/DomainMapper.hxx
+++ b/writerfilter/inc/dmapper/DomainMapper.hxx
@@ -29,7 +29,7 @@
#define INCLUDED_DOMAINMAPPER_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/text/FontEmphasis.hpp>
#include <com/sun/star/style/TabAlign.hpp>
@@ -78,8 +78,8 @@ enum SourceDocumentType
DOCUMENT_OOXML,
DOCUMENT_RTF
};
-class WRITERFILTER_DLLPUBLIC DomainMapper : public Properties, public Table,
- public BinaryObj, public Stream
+class WRITERFILTER_DLLPUBLIC DomainMapper : public LoggedProperties, public LoggedTable,
+ public BinaryObj, public LoggedStream
{
DomainMapper_Impl *m_pImpl;
@@ -90,38 +90,14 @@ public:
SourceDocumentType eDocumentType );
virtual ~DomainMapper();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
- // Table
- virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+ // Stream
+ virtual void markLastParagraphInSection();
// BinaryObj
virtual void data(const sal_uInt8* buf, size_t len,
writerfilter::Reference<Properties>::Pointer_t ref);
- // Stream
- virtual void startSectionGroup();
- virtual void endSectionGroup();
- virtual void startParagraphGroup();
- virtual void endParagraphGroup();
- virtual void markLastParagraphInSection();
- virtual void startCharacterGroup();
- virtual void endCharacterGroup();
- virtual void startShape( ::com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape );
- virtual void endShape( );
-
- virtual void text(const sal_uInt8 * data, size_t len);
- virtual void utext(const sal_uInt8 * data, size_t len);
- virtual void props(writerfilter::Reference<Properties>::Pointer_t ref);
- virtual void table(Id name,
- writerfilter::Reference<Table>::Pointer_t ref);
- virtual void substream(Id name,
- ::writerfilter::Reference<Stream>::Pointer_t ref);
- virtual void info(const string & info);
-
- void sprm( Sprm& sprm, ::boost::shared_ptr<PropertyMap> pContext, SprmType = SPRM_DEFAULT );
+ void sprmWithProps( Sprm& sprm, ::boost::shared_ptr<PropertyMap> pContext, SprmType = SPRM_DEFAULT );
void PushStyleSheetProperties( ::boost::shared_ptr<PropertyMap> pStyleProperties, bool bAffectTableMngr = false );
void PopStyleSheetProperties( bool bAffectTableMngr = false );
@@ -138,6 +114,32 @@ public:
boost::shared_ptr< StyleSheetTable > GetStyleSheetTable( );
private:
+ // Stream
+ virtual void lcl_startSectionGroup();
+ virtual void lcl_endSectionGroup();
+ virtual void lcl_startParagraphGroup();
+ virtual void lcl_endParagraphGroup();
+ virtual void lcl_startCharacterGroup();
+ virtual void lcl_endCharacterGroup();
+ virtual void lcl_startShape( ::com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape );
+ virtual void lcl_endShape( );
+
+ virtual void lcl_text(const sal_uInt8 * data, size_t len);
+ virtual void lcl_utext(const sal_uInt8 * data, size_t len);
+ virtual void lcl_props(writerfilter::Reference<Properties>::Pointer_t ref);
+ virtual void lcl_table(Id name,
+ writerfilter::Reference<Table>::Pointer_t ref);
+ virtual void lcl_substream(Id name,
+ ::writerfilter::Reference<Stream>::Pointer_t ref);
+ virtual void lcl_info(const string & info);
+
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
+ // Table
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+
void handleUnderlineType(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext);
void handleParaJustification(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext, const bool bExchangeLeftRight);
bool getColorFromIndex(const sal_Int32 nIndex, sal_Int32 &nColor);
diff --git a/filter/source/graphicfilter/egif/dlgegif.hxx b/writerfilter/inc/resourcemodel/Fraction.hxx
index 4fd722d97c38..65e5ef251d15 100644
--- a/filter/source/graphicfilter/egif/dlgegif.hxx
+++ b/writerfilter/inc/resourcemodel/Fraction.hxx
@@ -25,49 +25,39 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#ifndef INCLUDED_FRACTION_HXX
+#define INCLUDED_FRACTION_HXX
+#include <sal/types.h>
-#ifndef _DLGEGIF_HXX_
-#define _DLGEGIF_HXX_
+namespace writerfilter {
+namespace resourcemodel {
-#include <svtools/fltcall.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen
-|*
-\************************************************************************/
-
-class FilterConfigItem;
-class ResMgr;
-
-class DlgExportEGIF : public ModalDialog
+class Fraction
{
-private:
-
- FltCallDialogParameter& rFltCallPara;
+public:
+ explicit Fraction(sal_Int32 nNumerator, sal_Int32 nDenominator = 1);
+ explicit Fraction(const Fraction & a, const Fraction & b);
+ virtual ~Fraction();
- CheckBox aCbxInterlaced;
- CheckBox aCbxTranslucent;
- FixedLine aGrpMode;
- FixedLine aGrpDraw;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
+ void init(sal_Int32 nNumerator, sal_Int32 nDenominator);
+ void assign(const Fraction & rFraction);
- FilterConfigItem* pConfigItem;
- ResMgr* pMgr;
+ Fraction inverse() const;
- DECL_LINK( OK, void * );
+ Fraction operator=(const Fraction & rFraction);
+ Fraction operator+(const Fraction & rFraction) const;
+ Fraction operator-(const Fraction & rFraction) const;
+ Fraction operator*(const Fraction & rFraction) const;
+ Fraction operator/(const Fraction & rFraction) const;
+ operator sal_Int32() const;
+ operator float() const;
-public:
- DlgExportEGIF( FltCallDialogParameter& rPara );
- ~DlgExportEGIF();
+private:
+ sal_Int32 mnNumerator;
+ sal_Int32 mnDenominator;
};
+}}
+#endif // INCLUDED_FRACTION_HXX
-#endif // _DLGEGIF_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/writerfilter/inc/resourcemodel/LoggedResources.hxx b/writerfilter/inc/resourcemodel/LoggedResources.hxx
new file mode 100644
index 000000000000..be30c32fd85e
--- /dev/null
+++ b/writerfilter/inc/resourcemodel/LoggedResources.hxx
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * 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 INCLUDED_LOGGED_RESOURCES_HXX
+#define INCLUDED_LOGGED_RESOURCES_HXX
+
+#include "WW8ResourceModel.hxx"
+#include "TagLogger.hxx"
+
+namespace writerfilter
+{
+
+class LoggedResourcesHelper
+{
+public:
+ explicit LoggedResourcesHelper(TagLogger::Pointer_t pLogger, const string & sPrefix);
+ virtual ~LoggedResourcesHelper();
+
+ void startElement(const string & sElement);
+ void endElement(const string & sElement);
+ void chars(const ::rtl::OUString & rChars);
+ void chars(const string & rChars);
+ void attribute(const string & rName, const string & rValue);
+ void attribute(const string & rName, sal_uInt32 nValue);
+
+ void setPrefix(const string & rPrefix);
+
+private:
+ TagLogger::Pointer_t mpLogger;
+ string msPrefix;
+};
+
+class LoggedStream : public Stream
+{
+public:
+ explicit LoggedStream(TagLogger::Pointer_t pLogger, const string & sPrefix);
+ virtual ~LoggedStream();
+
+ void startSectionGroup();
+ void endSectionGroup();
+ void startParagraphGroup();
+ void endParagraphGroup();
+ void startCharacterGroup();
+ void endCharacterGroup();
+ void startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ void endShape();
+ void text(const sal_uInt8 * data, size_t len);
+ void utext(const sal_uInt8 * data, size_t len);
+ void props(writerfilter::Reference<Properties>::Pointer_t ref);
+ void table(Id name, writerfilter::Reference<Table>::Pointer_t ref);
+ void substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref);
+ void info(const string & info);
+
+protected:
+ virtual void lcl_startSectionGroup() = 0;
+ virtual void lcl_endSectionGroup() = 0;
+ virtual void lcl_startParagraphGroup() = 0;
+ virtual void lcl_endParagraphGroup() = 0;
+ virtual void lcl_startCharacterGroup() = 0;
+ virtual void lcl_endCharacterGroup() = 0;
+ virtual void lcl_startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ) = 0;
+ virtual void lcl_endShape() = 0;
+ virtual void lcl_text(const sal_uInt8 * data, size_t len) = 0;
+ virtual void lcl_utext(const sal_uInt8 * data, size_t len) = 0;
+ virtual void lcl_props(writerfilter::Reference<Properties>::Pointer_t ref) = 0;
+ virtual void lcl_table(Id name, writerfilter::Reference<Table>::Pointer_t ref) = 0;
+ virtual void lcl_substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref) = 0;
+ virtual void lcl_info(const string & info) = 0;
+
+ LoggedResourcesHelper mHelper;
+};
+
+class LoggedProperties : public Properties
+{
+public:
+ explicit LoggedProperties(TagLogger::Pointer_t pLogger, const string & sPrefix);
+ virtual ~LoggedProperties();
+
+ void attribute(Id name, Value & val);
+ void sprm(Sprm & sprm);
+
+protected:
+ virtual void lcl_attribute(Id name, Value & val) = 0;
+ virtual void lcl_sprm(Sprm & sprm) = 0;
+
+ LoggedResourcesHelper mHelper;
+};
+
+class LoggedTable : public Table
+{
+public:
+ explicit LoggedTable(TagLogger::Pointer_t pLogger, const string & sPrefix);
+ virtual ~LoggedTable();
+
+ void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+
+protected:
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref) = 0;
+
+ LoggedResourcesHelper mHelper;
+};
+
+}
+#endif // INCLUDED_LOGGED_RESOURCES_HXX
diff --git a/writerfilter/inc/resourcemodel/TagLogger.hxx b/writerfilter/inc/resourcemodel/TagLogger.hxx
index e6de7b8835fd..ee3b3fdc1014 100644
--- a/writerfilter/inc/resourcemodel/TagLogger.hxx
+++ b/writerfilter/inc/resourcemodel/TagLogger.hxx
@@ -30,7 +30,6 @@
#define INCLUDED_TAG_LOGGER_HXX
#if OSL_DEBUG_LEVEL > 1
-
#include <rtl/ustring.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <WriterFilterDllApi.hxx>
diff --git a/filter/source/graphicfilter/epict/epictstr.src b/writerfilter/inc/resourcemodel/XPathLogger.hxx
index 8afebcb7564c..bc0cc6d11c10 100644
--- a/filter/source/graphicfilter/epict/epictstr.src
+++ b/writerfilter/inc/resourcemodel/XPathLogger.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,15 +25,42 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#ifndef INCLUDED_XPATH_LOGGER_HXX
+#define INCLUDED_XPATH_LOGGER_HXX
-#include "strings.hrc"
+#include <hash_map>
+#include <stack>
+#include <string>
+#include <vector>
+#include <boost/shared_ptr.hpp>
+#include <WriterFilterDllApi.hxx>
-String KEY_MODE
+namespace writerfilter
{
- Text = "ExportMode";
-};
+using ::std::hash_map;
+using ::std::stack;
+using ::std::string;
+using ::std::vector;
-String KEY_SIZE
+class WRITERFILTER_DLLPUBLIC XPathLogger
{
- Text = "Size";
+ typedef hash_map<string, unsigned int> TokenMap_t;
+ typedef boost::shared_ptr<TokenMap_t> TokenMapPointer_t;
+
+ TokenMapPointer_t mp_tokenMap;
+ stack<TokenMapPointer_t> m_tokenMapStack;
+ vector<string> m_path;
+ string m_currentPath;
+
+ void updateCurrentPath();
+
+public:
+ explicit XPathLogger();
+ virtual ~XPathLogger();
+
+ string getXPath() const;
+ void startElement(string _token);
+ void endElement();
};
+}
+#endif // INCLUDED_XPATH_LOGGER_HXX
diff --git a/writerfilter/prj/build.lst b/writerfilter/prj/build.lst
index b97a22778f78..e70b99a052c5 100644
--- a/writerfilter/prj/build.lst
+++ b/writerfilter/prj/build.lst
@@ -1,4 +1,4 @@
-wf writerfilter : soltools sal BOOST:boost cppu cppuhelper ucbhelper tools svx LIBXSLT:libxslt oox xmloff NULL
+wf writerfilter : soltools sal BOOST:boost cppu cppuhelper ucbhelper tools svx LIBXSLT:libxslt oox NULL
wf writerfilter usr1 - all wf_mkout NULL
wf writerfilter\source\resourcemodel nmake - all wf_resourcemodel NULL
wf writerfilter\source\doctok nmake - all wf_doctok wf_resourcemodel NULL
diff --git a/writerfilter/prj/d.lst b/writerfilter/prj/d.lst
index f941f4266035..1d09ecf9ad2b 100644
--- a/writerfilter/prj/d.lst
+++ b/writerfilter/prj/d.lst
@@ -2,6 +2,7 @@
..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll
..\%__SRC%\lib\*.so %_DEST%\lib%_EXT%\*.so
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
+..\%__SRC%\misc\writerfilter.component %_DEST%\xml%_EXT%\writerfilter.component
mkdir: %_DEST%\inc%_EXT%\writerfilter\doctok
..\%__SRC%\inc\doctok\sprmids.hxx %_DEST%\inc%_EXT%\writerfilter\doctok\sprmids.hxx
diff --git a/writerfilter/qa/complex/ooxml/testdocuments/Table5CellBorders.docx b/writerfilter/qa/complex/ooxml/testdocuments/Table5CellBorders.docx
new file mode 100644
index 000000000000..6b278175601b
--- /dev/null
+++ b/writerfilter/qa/complex/ooxml/testdocuments/Table5CellBorders.docx
Binary files differ
diff --git a/writerfilter/qa/complex/ooxml/testdocuments/TableDifferentColumns.docx b/writerfilter/qa/complex/ooxml/testdocuments/TableDifferentColumns.docx
new file mode 100644
index 000000000000..0503327ddecd
--- /dev/null
+++ b/writerfilter/qa/complex/ooxml/testdocuments/TableDifferentColumns.docx
Binary files differ
diff --git a/writerfilter/qa/complex/ooxml/testdocuments/TablePreferredWidth.docx b/writerfilter/qa/complex/ooxml/testdocuments/TablePreferredWidth.docx
new file mode 100644
index 000000000000..719b3888a018
--- /dev/null
+++ b/writerfilter/qa/complex/ooxml/testdocuments/TablePreferredWidth.docx
Binary files differ
diff --git a/writerfilter/qa/complex/ooxml/testdocuments/TableRowProperties.docx b/writerfilter/qa/complex/ooxml/testdocuments/TableRowProperties.docx
new file mode 100644
index 000000000000..775d63c97b34
--- /dev/null
+++ b/writerfilter/qa/complex/ooxml/testdocuments/TableRowProperties.docx
Binary files differ
diff --git a/writerfilter/qa/cppunittests/doctok/makefile.mk b/writerfilter/qa/cppunittests/doctok/makefile.mk
index f4b012c51b7d..2896e297a43f 100644
--- a/writerfilter/qa/cppunittests/doctok/makefile.mk
+++ b/writerfilter/qa/cppunittests/doctok/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=writerfilter
TARGET=test-doctok
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/writerfilter/qa/cppunittests/qname/makefile.mk b/writerfilter/qa/cppunittests/qname/makefile.mk
index bde10a119653..9877e271d821 100644
--- a/writerfilter/qa/cppunittests/qname/makefile.mk
+++ b/writerfilter/qa/cppunittests/qname/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=writerfilter
TARGET=test-qname
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/writerfilter/qa/cppunittests/sl/makefile.mk b/writerfilter/qa/cppunittests/sl/makefile.mk
index df1a6ab32bb0..0ea9c4800641 100644
--- a/writerfilter/qa/cppunittests/sl/makefile.mk
+++ b/writerfilter/qa/cppunittests/sl/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=writerfilter
TARGET=test-od_sl
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/writerfilter/qa/cppunittests/xxml/makefile.mk b/writerfilter/qa/cppunittests/xxml/makefile.mk
index d42426b61d34..fcce5dbec8dd 100644
--- a/writerfilter/qa/cppunittests/xxml/makefile.mk
+++ b/writerfilter/qa/cppunittests/xxml/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=writerfilter
TARGET=test-xxml
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/writerfilter/source/dmapper/BorderHandler.cxx b/writerfilter/source/dmapper/BorderHandler.cxx
index 2ecc10931ec0..5e354343acd4 100644
--- a/writerfilter/source/dmapper/BorderHandler.cxx
+++ b/writerfilter/source/dmapper/BorderHandler.cxx
@@ -42,12 +42,13 @@ using namespace ::com::sun::star;
BorderHandler::BorderHandler( bool bOOXML ) :
- m_nCurrentBorderPosition( BORDER_TOP ),
- m_nLineWidth(0),
- m_nLineType(0),
- m_nLineColor(0),
- m_nLineDistance(0),
- m_bOOXML( bOOXML )
+LoggedProperties(dmapper_logger, "BorderHandler"),
+m_nCurrentBorderPosition( BORDER_TOP ),
+m_nLineWidth(0),
+m_nLineType(0),
+m_nLineColor(0),
+m_nLineDistance(0),
+m_bOOXML( bOOXML )
{
const int nBorderCount(BORDER_COUNT);
std::fill_n(m_aFilledLines, nBorderCount, false);
@@ -58,14 +59,8 @@ BorderHandler::~BorderHandler()
{
}
-void BorderHandler::attribute(Id rName, Value & rVal)
+void BorderHandler::lcl_attribute(Id rName, Value & rVal)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("BorderHandler.attribute");
- dmapper_logger->attribute("id", (*QNameToString::Instance())(rName));
- dmapper_logger->endElement();
-#endif
-
sal_Int32 nIntValue = rVal.getInt();
switch( rName )
{
@@ -109,13 +104,8 @@ void BorderHandler::attribute(Id rName, Value & rVal)
}
}
-void BorderHandler::sprm(Sprm & rSprm)
+void BorderHandler::lcl_sprm(Sprm & rSprm)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("BorderHandler.sprm");
- dmapper_logger->attribute("sprm", rSprm.toString());
-#endif
-
switch( rSprm.getId())
{
case NS_ooxml::LN_CT_TblBorders_top:
@@ -136,11 +126,6 @@ void BorderHandler::sprm(Sprm & rSprm)
break;
default:;
}
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
-
}
PropertyMapPtr BorderHandler::getProperties()
diff --git a/writerfilter/source/dmapper/BorderHandler.hxx b/writerfilter/source/dmapper/BorderHandler.hxx
index 71c4b5e67510..6d23f123c2aa 100644
--- a/writerfilter/source/dmapper/BorderHandler.hxx
+++ b/writerfilter/source/dmapper/BorderHandler.hxx
@@ -29,7 +29,7 @@
#define INCLUDED_BORDERHANDLER_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
@@ -37,7 +37,7 @@ namespace writerfilter {
namespace dmapper
{
class PropertyMap;
-class WRITERFILTER_DLLPRIVATE BorderHandler : public Properties
+class WRITERFILTER_DLLPRIVATE BorderHandler : public LoggedProperties
{
public:
//todo: order is a guess
@@ -64,14 +64,14 @@ private:
bool m_aFilledLines[BORDER_COUNT];
::com::sun::star::table::BorderLine2 m_aBorderLines[BORDER_COUNT];
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
BorderHandler( bool bOOXML );
virtual ~BorderHandler();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
::boost::shared_ptr<PropertyMap> getProperties();
::com::sun::star::table::BorderLine2 getBorderLine();
sal_Int32 getLineDistance() const { return m_nLineDistance;}
diff --git a/writerfilter/source/dmapper/CellColorHandler.cxx b/writerfilter/source/dmapper/CellColorHandler.cxx
index 6472d1049962..bfb210ddc7a2 100644
--- a/writerfilter/source/dmapper/CellColorHandler.cxx
+++ b/writerfilter/source/dmapper/CellColorHandler.cxx
@@ -31,6 +31,7 @@
#include <ConversionHelper.hxx>
#include <ooxml/resourceids.hxx>
#include <sal/macros.h>
+#include "dmapperLoggers.hxx"
#define OOXML_COLOR_AUTO 0x0a //todo: AutoColor needs symbol
@@ -42,9 +43,10 @@ using namespace ::writerfilter;
CellColorHandler::CellColorHandler() :
- m_nShadowType( 0 ),
- m_nColor( 0xffffffff ),
- m_nFillColor( 0xffffffff ),
+LoggedProperties(dmapper_logger, "CellColorHandler"),
+m_nShadowType( 0 ),
+m_nColor( 0xffffffff ),
+m_nFillColor( 0xffffffff ),
m_OutputFormat( Form )
{
}
@@ -53,7 +55,7 @@ CellColorHandler::~CellColorHandler()
{
}
-void CellColorHandler::attribute(Id rName, Value & rVal)
+void CellColorHandler::lcl_attribute(Id rName, Value & rVal)
{
sal_Int32 nIntValue = rVal.getInt();
switch( rName )
@@ -92,7 +94,7 @@ void CellColorHandler::attribute(Id rName, Value & rVal)
}
}
-void CellColorHandler::sprm(Sprm & rSprm)
+void CellColorHandler::lcl_sprm(Sprm & rSprm)
{
(void)rSprm;
}
diff --git a/writerfilter/source/dmapper/CellColorHandler.hxx b/writerfilter/source/dmapper/CellColorHandler.hxx
index 3cdf730211b1..a745b8fcf73e 100644
--- a/writerfilter/source/dmapper/CellColorHandler.hxx
+++ b/writerfilter/source/dmapper/CellColorHandler.hxx
@@ -29,14 +29,14 @@
#define INCLUDED_CELLCOLORHANDLER_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
namespace writerfilter {
namespace dmapper
{
class TablePropertyMap;
-class WRITERFILTER_DLLPRIVATE CellColorHandler : public Properties
+class WRITERFILTER_DLLPRIVATE CellColorHandler : public LoggedProperties
{
public:
enum OutputFormat { Form, Paragraph, Character }; // for what part of the document
@@ -46,14 +46,14 @@ private:
sal_Int32 m_nFillColor;
OutputFormat m_OutputFormat;
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
CellColorHandler( );
virtual ~CellColorHandler();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
::boost::shared_ptr<TablePropertyMap> getProperties();
void setOutputFormat( OutputFormat format ) { m_OutputFormat = format; }
diff --git a/writerfilter/source/dmapper/CellMarginHandler.cxx b/writerfilter/source/dmapper/CellMarginHandler.cxx
index 035c73fc033d..a18e0e8a810b 100644
--- a/writerfilter/source/dmapper/CellMarginHandler.cxx
+++ b/writerfilter/source/dmapper/CellMarginHandler.cxx
@@ -30,6 +30,7 @@
#include <doctok/resourceids.hxx>
#include <ConversionHelper.hxx>
#include <ooxml/resourceids.hxx>
+#include "dmapperLoggers.hxx"
namespace writerfilter {
namespace dmapper {
@@ -39,15 +40,16 @@ using namespace ::writerfilter;
CellMarginHandler::CellMarginHandler() :
- m_nValue( 0 ),
- m_nLeftMargin( 0 ),
- m_bLeftMarginValid( false ),
- m_nRightMargin( 0 ),
- m_bRightMarginValid( false ),
- m_nTopMargin( 0 ),
- m_bTopMarginValid( false ),
- m_nBottomMargin( 0 ),
- m_bBottomMarginValid( false )
+LoggedProperties(dmapper_logger, "CellMarginHandler"),
+m_nValue( 0 ),
+m_nLeftMargin( 0 ),
+m_bLeftMarginValid( false ),
+m_nRightMargin( 0 ),
+m_bRightMarginValid( false ),
+m_nTopMargin( 0 ),
+m_bTopMarginValid( false ),
+m_nBottomMargin( 0 ),
+m_bBottomMarginValid( false )
{
}
@@ -55,7 +57,7 @@ CellMarginHandler::~CellMarginHandler()
{
}
-void CellMarginHandler::attribute(Id rName, Value & rVal)
+void CellMarginHandler::lcl_attribute(Id rName, Value & rVal)
{
sal_Int32 nIntValue = rVal.getInt();
(void)nIntValue;
@@ -73,7 +75,7 @@ void CellMarginHandler::attribute(Id rName, Value & rVal)
}
}
-void CellMarginHandler::sprm(Sprm & rSprm)
+void CellMarginHandler::lcl_sprm(Sprm & rSprm)
{
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
if( pProperties.get())
diff --git a/writerfilter/source/dmapper/CellMarginHandler.hxx b/writerfilter/source/dmapper/CellMarginHandler.hxx
index 4642f3a61b1b..7a36458a72c2 100644
--- a/writerfilter/source/dmapper/CellMarginHandler.hxx
+++ b/writerfilter/source/dmapper/CellMarginHandler.hxx
@@ -29,18 +29,22 @@
#define INCLUDED_CELLMARGINHANDLER_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
namespace writerfilter {
namespace dmapper
{
class TablePropertyMap;
-class WRITERFILTER_DLLPRIVATE CellMarginHandler : public Properties
+class WRITERFILTER_DLLPRIVATE CellMarginHandler : public LoggedProperties
{
private:
sal_Int32 m_nValue;
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
sal_Int32 m_nLeftMargin;
bool m_bLeftMarginValid;
@@ -55,10 +59,6 @@ public:
CellMarginHandler( );
virtual ~CellMarginHandler();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
::boost::shared_ptr<TablePropertyMap> getProperties();
};
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 7997f145bf6d..4e750bb96c4b 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -87,15 +87,11 @@
#include <vector>
#include <iostream>
-#ifdef DEBUG_DOMAINMAPPER
-#include <resourcemodel/QNameToString.hxx>
-#include <resourcemodel/util.hxx>
-#include <resourcemodel/TagLogger.hxx>
-#endif
#if OSL_DEBUG_LEVEL > 0
#include <resourcemodel/QNameToString.hxx>
#endif
+#include <resourcemodel/TagLogger.hxx>
using namespace ::com::sun::star;
using namespace ::rtl;
@@ -107,9 +103,7 @@ using resourcemodel::resolveAttributeProperties;
namespace dmapper{
-#ifdef DEBUG_DOMAINMAPPER
TagLogger::Pointer_t dmapper_logger(TagLogger::getInstance("DOMAINMAPPER"));
-#endif
struct _PageSz
{
@@ -124,6 +118,9 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon
uno::Reference< io::XInputStream > xInputStream,
uno::Reference< lang::XComponent > xModel,
SourceDocumentType eDocumentType) :
+LoggedProperties(dmapper_logger, "DomainMapper"),
+LoggedTable(dmapper_logger, "DomainMapper"),
+LoggedStream(dmapper_logger, "DomainMapper"),
m_pImpl( new DomainMapper_Impl( *this, xContext, xModel, eDocumentType )),
mnBackgroundColor(0), mbIsHighlightSet(false)
{
@@ -184,14 +181,8 @@ DomainMapper::~DomainMapper()
delete m_pImpl;
}
-void DomainMapper::attribute(Id nName, Value & val)
+void DomainMapper::lcl_attribute(Id nName, Value & val)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("attribute");
- dmapper_logger->attribute("name", (*QNameToString::Instance())(nName));
- dmapper_logger->attribute("value", val.toString());
- dmapper_logger->endElement();
-#endif
static ::rtl::OUString sLocalBookmarkName;
sal_Int32 nIntValue = val.getInt();
rtl::OUString sStringValue = val.getString();
@@ -1419,18 +1410,14 @@ void DomainMapper::attribute(Id nName, Value & val)
}
}
-void DomainMapper::sprm(Sprm & rSprm)
+void DomainMapper::lcl_sprm(Sprm & rSprm)
{
if( !m_pImpl->getTableManager().sprm(rSprm))
- DomainMapper::sprm( rSprm, m_pImpl->GetTopContext() );
+ sprmWithProps( rSprm, m_pImpl->GetTopContext() );
}
-void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmType )
+void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmType )
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("DomainMapper.sprm");
- dmapper_logger->chars(rSprm.toString());
-#endif
OSL_ENSURE(rContext.get(), "PropertyMap has to be valid!");
if(!rContext.get())
return ;
@@ -1960,12 +1947,6 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
{
uno::Any aBold( uno::makeAny( nIntValue ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL ) );
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("charWeight");
- dmapper_logger->attribute("weight", nIntValue ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL);
- dmapper_logger->endElement();
-#endif
-
rContext->Insert(ePropertyId, true, aBold );
if( nSprmId != NS_sprm::LN_CFBoldBi ) // sprmCFBoldBi
rContext->Insert(PROP_CHAR_WEIGHT_ASIAN, true, aBold );
@@ -3136,26 +3117,13 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
#endif
}
}
-
-#ifdef DEBUG_DOMAINMAPPER
- rContext->dumpXml(dmapper_logger);
- dmapper_logger->endElement();
-#endif
}
-void DomainMapper::entry(int /*pos*/,
+void DomainMapper::lcl_entry(int /*pos*/,
writerfilter::Reference<Properties>::Pointer_t ref)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("DomainMapper.entry");
-#endif
-
ref->resolve(*this);
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
void DomainMapper::data(const sal_uInt8* /*buf*/, size_t /*len*/,
@@ -3163,15 +3131,12 @@ void DomainMapper::data(const sal_uInt8* /*buf*/, size_t /*len*/,
{
}
-void DomainMapper::startSectionGroup()
+void DomainMapper::lcl_startSectionGroup()
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("section");
-#endif
m_pImpl->PushProperties(CONTEXT_SECTION);
}
-void DomainMapper::endSectionGroup()
+void DomainMapper::lcl_endSectionGroup()
{
PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_SECTION);
SectionPropertyMap* pSectionContext = dynamic_cast< SectionPropertyMap* >( pContext.get() );
@@ -3179,18 +3144,10 @@ void DomainMapper::endSectionGroup()
if(pSectionContext)
pSectionContext->CloseSectionGroup( *m_pImpl );
m_pImpl->PopProperties(CONTEXT_SECTION);
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
-void DomainMapper::startParagraphGroup()
+void DomainMapper::lcl_startParagraphGroup()
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("paragraph");
-#endif
-
m_pImpl->getTableManager().startParagraphGroup();
m_pImpl->PushProperties(CONTEXT_PARAGRAPH);
static ::rtl::OUString sDefault(RTL_CONSTASCII_USTRINGPARAM("Standard") );
@@ -3205,40 +3162,27 @@ void DomainMapper::startParagraphGroup()
m_pImpl->clearDeferredBreaks();
}
-void DomainMapper::endParagraphGroup()
+void DomainMapper::lcl_endParagraphGroup()
{
m_pImpl->PopProperties(CONTEXT_PARAGRAPH);
m_pImpl->getTableManager().endParagraphGroup();
//frame conversion has to be executed after table conversion
m_pImpl->ExecuteFrameConversion();
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
void DomainMapper::markLastParagraphInSection( )
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->element( "markLastParagraphInSection" );
-#endif
m_pImpl->SetIsLastParagraphInSection( true );
}
-void DomainMapper::startShape( uno::Reference< drawing::XShape > xShape )
+void DomainMapper::lcl_startShape( uno::Reference< drawing::XShape > xShape )
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("shape");
-#endif
m_pImpl->PushShapeContext( xShape );
}
-void DomainMapper::endShape( )
+void DomainMapper::lcl_endShape( )
{
m_pImpl->PopShapeContext( );
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
void DomainMapper::PushStyleSheetProperties( PropertyMapPtr pStyleProperties, bool bAffectTableMngr )
@@ -3268,12 +3212,8 @@ void DomainMapper::PopListProperties()
m_pImpl->PopProperties( CONTEXT_LIST );
}
-void DomainMapper::startCharacterGroup()
+void DomainMapper::lcl_startCharacterGroup()
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("charactergroup");
-#endif
-
m_pImpl->PushProperties(CONTEXT_CHARACTER);
DomainMapperTableManager& rTableManager = m_pImpl->getTableManager();
if( rTableManager.getTableStyleName().getLength() )
@@ -3283,16 +3223,12 @@ void DomainMapper::startCharacterGroup()
}
}
-void DomainMapper::endCharacterGroup()
+void DomainMapper::lcl_endCharacterGroup()
{
m_pImpl->PopProperties(CONTEXT_CHARACTER);
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
-void DomainMapper::text(const sal_uInt8 * data_, size_t len)
+void DomainMapper::lcl_text(const sal_uInt8 * data_, size_t len)
{
//TODO: Determine the right text encoding (FIB?)
::rtl::OUString sText( (const sal_Char*) data_, len, RTL_TEXTENCODING_MS_1252 );
@@ -3372,19 +3308,13 @@ void DomainMapper::text(const sal_uInt8 * data_, size_t len)
}
}
-void DomainMapper::utext(const sal_uInt8 * data_, size_t len)
+void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
{
OUString sText;
OUStringBuffer aBuffer = OUStringBuffer(len);
aBuffer.append( (const sal_Unicode *) data_, len);
sText = aBuffer.makeStringAndClear();
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("utext");
- dmapper_logger->chars(sText);
- dmapper_logger->endElement();
-#endif
-
try
{
m_pImpl->getTableManager().utext(data_, len);
@@ -3431,12 +3361,8 @@ void DomainMapper::utext(const sal_uInt8 * data_, size_t len)
}
}
-void DomainMapper::props(writerfilter::Reference<Properties>::Pointer_t ref)
+void DomainMapper::lcl_props(writerfilter::Reference<Properties>::Pointer_t ref)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("props");
-#endif
-
string sType = ref->getType();
if( sType == "PICF" )
{
@@ -3448,18 +3374,10 @@ void DomainMapper::props(writerfilter::Reference<Properties>::Pointer_t ref)
}
else
ref->resolve(*this);
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
-void DomainMapper::table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
+void DomainMapper::lcl_table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("table");
- dmapper_logger->attribute("id", (*QNameToString::Instance())(name));
-#endif
m_pImpl->SetAnyTableImport(true);
switch(name)
{
@@ -3504,18 +3422,10 @@ void DomainMapper::table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
OSL_ENSURE( false, "which table is to be filled here?");
}
m_pImpl->SetAnyTableImport(false);
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
-void DomainMapper::substream(Id rName, ::writerfilter::Reference<Stream>::Pointer_t ref)
+void DomainMapper::lcl_substream(Id rName, ::writerfilter::Reference<Stream>::Pointer_t ref)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("substream");
-#endif
-
m_pImpl->appendTableManager( );
m_pImpl->getTableManager().startLevel();
@@ -3577,13 +3487,9 @@ void DomainMapper::substream(Id rName, ::writerfilter::Reference<Stream>::Pointe
m_pImpl->getTableManager().endLevel();
m_pImpl->popTableManager( );
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
-void DomainMapper::info(const string & /*info_*/)
+void DomainMapper::lcl_info(const string & /*info_*/)
{
}
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 3093ff135cee..ebe7d41665f5 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -34,7 +34,7 @@
#include <com/sun/star/text/HoriOrientation.hpp>
#include <dmapperLoggers.hxx>
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
#include <PropertyMapHelper.hxx>
#endif
@@ -51,7 +51,7 @@ using namespace ::std;
#define DEF_BORDER_DIST 190 //0,19cm
#define DEFAULT_CELL_MARGIN 108 //default cell margin, not documented
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
static void lcl_printProperties( PropertyMapPtr pProps )
{
if( pProps.get() )
@@ -110,7 +110,7 @@ void DomainMapperTableHandler::startTable(unsigned int nRows,
m_pTableSeq = TableSequencePointer_t(new TableSequence_t(nRows));
m_nRowIndex = 0;
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("tablehandler.table");
dmapper_logger->attribute("rows", nRows);
@@ -123,11 +123,6 @@ void DomainMapperTableHandler::startTable(unsigned int nRows,
PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntryPtr pStyleSheet, StyleSheetTablePtr pStyleSheetTable)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("lcl_SearchParentStyleSheetAndMergeProperties");
- pStyleSheet->dumpXml( dmapper_logger );
-#endif
-
PropertyMapPtr pRet;
if( pStyleSheet->sBaseStyleIdentifier.getLength())
{
@@ -141,10 +136,6 @@ PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntr
pRet->insert( pStyleSheet->pProperties, true );
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
-
return pRet;
}
@@ -246,7 +237,7 @@ void lcl_computeCellBorders( PropertyMapPtr pTableBorders, PropertyMapPtr pCellP
}
}
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
void lcl_debug_BorderLine(table::BorderLine & rLine)
{
@@ -362,7 +353,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
PropertyMapPtr pMergedProperties = lcl_SearchParentStyleSheetAndMergeProperties(pStyleSheet, pStyleSheetTable);
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("mergedProps");
pMergedProperties->dumpXml( dmapper_logger );
dmapper_logger->endElement();
@@ -371,7 +362,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
m_aTableProperties->insert( pMergedProperties );
m_aTableProperties->insert( pTableProps );
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("TableProperties");
m_aTableProperties->dumpXml( dmapper_logger );
dmapper_logger->endElement();
@@ -382,7 +373,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
// Set the table default attributes for the cells
rInfo.pTableDefaults->insert( m_aTableProperties );
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("TableDefaults");
rInfo.pTableDefaults->dumpXml( dmapper_logger );
dmapper_logger->endElement();
@@ -452,7 +443,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
m_aTableProperties->Insert( PROP_TABLE_BORDER, false, uno::makeAny( aTableBorder ) );
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
lcl_debug_TableBorder(aTableBorder);
#endif
@@ -474,7 +465,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
rInfo.aTableProperties = m_aTableProperties->GetPropertyValues();
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("debug.tableprops");
m_aTableProperties->dumpXml( dmapper_logger );
dmapper_logger->endElement();
@@ -487,7 +478,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(TableInfo & rInfo)
{
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("getCellProperties");
#endif
@@ -580,7 +571,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
pAllCellProps->insert( *aCellIterator );
aCellIterator->get( )->swap( *pAllCellProps.get( ) );
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("cell");
dmapper_logger->attribute("cell", nCell);
dmapper_logger->attribute("row", nRow);
@@ -613,14 +604,14 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
uno::makeAny((sal_Int32) rInfo.nBottomBorderDistance ) );
pSingleCellProperties[nCell] = aCellIterator->get()->GetPropertyValues();
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->endElement();
#endif
}
++nCell;
++aCellIterator;
}
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
//-->debug cell properties
{
::rtl::OUString sNames;
@@ -647,7 +638,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
++aRowOfCellsIterator;
}
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->endElement();
#endif
@@ -656,7 +647,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
RowPropertyValuesSeq_t DomainMapperTableHandler::endTableGetRowProperties()
{
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("getRowProperties");
#endif
@@ -666,7 +657,7 @@ RowPropertyValuesSeq_t DomainMapperTableHandler::endTableGetRowProperties()
sal_Int32 nRow = 0;
while( aRowIter != aRowIterEnd )
{
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("rowProps.row");
#endif
if( aRowIter->get() )
@@ -676,19 +667,19 @@ RowPropertyValuesSeq_t DomainMapperTableHandler::endTableGetRowProperties()
aRowIter->get()->Insert( PROP_IS_SPLIT_ALLOWED, false, uno::makeAny(sal_True ) );
aRowProperties[nRow] = (*aRowIter)->GetPropertyValues();
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
((*aRowIter)->dumpXml( dmapper_logger ));
lcl_DumpPropertyValues(dmapper_logger, aRowProperties[nRow]);
#endif
}
++nRow;
++aRowIter;
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->endElement();
#endif
}
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->endElement();
#endif
@@ -697,7 +688,7 @@ RowPropertyValuesSeq_t DomainMapperTableHandler::endTableGetRowProperties()
void DomainMapperTableHandler::endTable()
{
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("tablehandler.endTable");
#endif
@@ -709,7 +700,7 @@ void DomainMapperTableHandler::endTable()
RowPropertyValuesSeq_t aRowProperties = endTableGetRowProperties();
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
lcl_DumpPropertyValueSeq(dmapper_logger, aRowProperties);
#endif
@@ -726,25 +717,25 @@ void DomainMapperTableHandler::endTable()
}
catch (lang::IllegalArgumentException e)
{
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->chars("failed to import table!");
#endif
}
-#ifdef DEBUG_DOMAINMAPPER
catch ( uno::Exception e )
{
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("exception");
dmapper_logger->chars(rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr( ));
dmapper_logger->endElement();
- }
#endif
+ }
}
m_aTableProperties.reset();
m_aCellProperties.clear();
m_aRowProperties.clear();
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->endElement();
dmapper_logger->endElement();
#endif
@@ -756,7 +747,7 @@ void DomainMapperTableHandler::startRow(unsigned int nCells,
m_aRowProperties.push_back( pProps );
m_aCellProperties.push_back( PropertyMapVector1() );
-#if DEBUG_DOMAINMAPPER
+#if DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("table.row");
dmapper_logger->attribute("cells", nCells);
if (pProps != NULL)
@@ -772,7 +763,7 @@ void DomainMapperTableHandler::endRow()
(*m_pTableSeq)[m_nRowIndex] = *m_pRowSeq;
++m_nRowIndex;
m_nCellIndex = 0;
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->endElement();
#endif
}
@@ -791,7 +782,7 @@ void DomainMapperTableHandler::startCell(const Handle_t & start,
m_aCellProperties[nRow - 1].push_back( pEmptyProps );
}
-#if DEBUG_DOMAINMAPPER
+#if DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("table.cell");
dmapper_logger->startElement("table.cell.start");
dmapper_logger->chars(toString(start));
@@ -808,7 +799,7 @@ void DomainMapperTableHandler::startCell(const Handle_t & start,
void DomainMapperTableHandler::endCell(const Handle_t & end)
{
-#ifdef DEBUG_DOMAINMAPPER
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("table.cell.end");
dmapper_logger->chars(toString(end));
dmapper_logger->endElement();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 7061fe5a83af..ae6cb04fcb63 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -701,10 +701,9 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->attribute("isTextAppend", xTextAppend.is());
- dmapper_logger->attribute("isIgnor", getTableManager().isIgnore());
#endif
- if(xTextAppend.is() && ! getTableManager( ).isIgnore())
+ if(xTextAppend.is() && ! getTableManager( ).isIgnore() && pParaContext != NULL)
{
try
{
@@ -723,7 +722,10 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
old _and_ new DropCap must not occur
*/
- bool bIsDropCap = pParaContext->IsFrameMode() && sal::static_int_cast<Id>(pParaContext->GetDropCap()) != NS_ooxml::LN_Value_wordprocessingml_ST_DropCap_none;
+ bool bIsDropCap =
+ pParaContext->IsFrameMode() &&
+ sal::static_int_cast<Id>(pParaContext->GetDropCap()) != NS_ooxml::LN_Value_wordprocessingml_ST_DropCap_none;
+
style::DropCapFormat aDrop;
ParagraphPropertiesPtr pToBeSavedProperties;
bool bKeepLastParagraphProperties = false;
@@ -2169,7 +2171,7 @@ void DomainMapper_Impl::handleToc
// {
//todo: entries can only be included completely
// }
-// \n Builds a table of contents or a range of entries, sucah as “1-9”, in a table of contents without page numbers
+// \n Builds a table of contents or a range of entries, sucah as �1-9�, in a table of contents without page numbers
// if( lcl_FindInCommand( pContext->GetCommand(), 'n', sValue ))
// {
//todo: what does the description mean?
diff --git a/writerfilter/source/dmapper/FFDataHandler.cxx b/writerfilter/source/dmapper/FFDataHandler.cxx
index db2bf648250c..0b42591b9a5c 100644
--- a/writerfilter/source/dmapper/FFDataHandler.cxx
+++ b/writerfilter/source/dmapper/FFDataHandler.cxx
@@ -28,10 +28,8 @@
#include "FFDataHandler.hxx"
#include <ooxml/resourceids.hxx>
-#ifdef DEBUG_DOMAINMAPPER
-#include <resourcemodel/QNameToString.hxx>
#include "dmapperLoggers.hxx"
-#endif
+
namespace writerfilter {
namespace dmapper {
@@ -39,17 +37,18 @@ namespace dmapper {
* class: FFDataHandler *
************************/
-FFDataHandler::FFDataHandler()
-: m_bEnabled(false),
- m_bCalcOnExit(false),
- m_nHelpTextType(0),
- m_nStatusTextType(0),
- m_nCheckboxHeight(0),
- m_bCheckboxAutoHeight(false),
- m_bCheckboxDefault(false),
- m_bCheckboxChecked(false),
- m_nTextType(0),
- m_nTextMaxLength(0)
+FFDataHandler::FFDataHandler() :
+LoggedProperties(dmapper_logger, "FFDataHandler"),
+m_bEnabled(false),
+m_bCalcOnExit(false),
+m_nHelpTextType(0),
+m_nStatusTextType(0),
+m_nCheckboxHeight(0),
+m_bCheckboxAutoHeight(false),
+m_bCheckboxDefault(false),
+m_bCheckboxChecked(false),
+m_nTextType(0),
+m_nTextMaxLength(0)
{
}
@@ -239,12 +238,8 @@ void FFDataHandler::setTextFormat(const rtl::OUString & r_sTextFormat)
}
-void FFDataHandler::sprm(Sprm & r_Sprm)
+void FFDataHandler::lcl_sprm(Sprm & r_Sprm)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("FFDataHandler.sprm");
- dmapper_logger->chars(r_Sprm.toString());
-#endif
switch(r_Sprm.getId())
{
case NS_ooxml::LN_CT_FFData_name:
@@ -358,9 +353,6 @@ void FFDataHandler::sprm(Sprm & r_Sprm)
#endif
break;
}
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
void FFDataHandler::resolveSprm(Sprm & r_Sprm)
@@ -370,14 +362,8 @@ void FFDataHandler::resolveSprm(Sprm & r_Sprm)
pProperties->resolve(*this);
}
-void FFDataHandler::attribute(Id name, Value & val)
+void FFDataHandler::lcl_attribute(Id name, Value & val)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("FFDataHandler.attribute");
- dmapper_logger->attribute("name", (*QNameToString::Instance())(name));
- dmapper_logger->attribute("value", val.toString());
- dmapper_logger->endElement();
-#endif
switch (name)
{
case NS_ooxml::LN_CT_FFHelpText_type:
diff --git a/writerfilter/source/dmapper/FFDataHandler.hxx b/writerfilter/source/dmapper/FFDataHandler.hxx
index 602bce7c4522..c340cd5ce886 100644
--- a/writerfilter/source/dmapper/FFDataHandler.hxx
+++ b/writerfilter/source/dmapper/FFDataHandler.hxx
@@ -27,11 +27,11 @@
************************************************************************/
#ifndef INCLUDED_FFDataHandler_HXX
#define INCLUDED_FFDataHandler_HXX
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <rtl/ustring.hxx>
namespace writerfilter {
namespace dmapper {
-class FFDataHandler : public Properties
+class FFDataHandler : public LoggedProperties
{
public:
// typedefs
@@ -116,12 +116,8 @@ public:
void setTextFormat(const rtl::OUString & r_sTextFormat);
// sprm
- void sprm(Sprm & r_sprm);
void resolveSprm(Sprm & r_sprm);
- // attribute
- void attribute(Id name, Value & val);
-
private:
rtl::OUString m_sName;
bool m_bEnabled;
@@ -143,6 +139,12 @@ private:
sal_uInt32 m_nTextMaxLength;
rtl::OUString m_sTextDefault;
rtl::OUString m_sTextFormat;
+
+ // sprm
+ void lcl_sprm(Sprm & r_sprm);
+
+ // attribute
+ void lcl_attribute(Id name, Value & val);
};
diff --git a/writerfilter/source/dmapper/FontTable.cxx b/writerfilter/source/dmapper/FontTable.cxx
index 3459fedba359..310c99afa1c6 100644
--- a/writerfilter/source/dmapper/FontTable.cxx
+++ b/writerfilter/source/dmapper/FontTable.cxx
@@ -35,19 +35,24 @@
#include <stdio.h>
#include <rtl/tencinfo.h>
+#include "dmapperLoggers.hxx"
+
namespace writerfilter {
namespace dmapper
{
struct FontTable_Impl
{
- std::vector< FontEntry > aFontEntries;
+ std::vector< FontEntry::Pointer_t > aFontEntries;
FontEntry::Pointer_t pCurrentEntry;
FontTable_Impl() {}
};
-FontTable::FontTable() :
- m_pImpl( new FontTable_Impl )
+FontTable::FontTable()
+: LoggedProperties(dmapper_logger, "FontTable")
+, LoggedTable(dmapper_logger, "FontTable")
+, LoggedStream(dmapper_logger, "FontTable")
+, m_pImpl( new FontTable_Impl )
{
}
@@ -56,7 +61,7 @@ FontTable::~FontTable()
delete m_pImpl;
}
-void FontTable::attribute(Id Name, Value & val)
+void FontTable::lcl_attribute(Id Name, Value & val)
{
OSL_ENSURE( m_pImpl->pCurrentEntry, "current entry has to be set here");
if(!m_pImpl->pCurrentEntry)
@@ -123,7 +128,7 @@ void FontTable::attribute(Id Name, Value & val)
}
}
-void FontTable::sprm(Sprm& rSprm)
+void FontTable::lcl_sprm(Sprm& rSprm)
{
OSL_ENSURE( m_pImpl->pCurrentEntry, "current entry has to be set here");
if(!m_pImpl->pCurrentEntry)
@@ -149,81 +154,78 @@ void FontTable::resolveSprm(Sprm & r_Sprm)
pProperties->resolve(*this);
}
-void FontTable::entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
+void FontTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
{
//create a new font entry
OSL_ENSURE( !m_pImpl->pCurrentEntry, "current entry has to be NULL here");
m_pImpl->pCurrentEntry.reset(new FontEntry);
ref->resolve(*this);
//append it to the table
- m_pImpl->aFontEntries.push_back( *m_pImpl->pCurrentEntry );
+ m_pImpl->aFontEntries.push_back( m_pImpl->pCurrentEntry );
m_pImpl->pCurrentEntry.reset();
}
-void FontTable::startSectionGroup()
+void FontTable::lcl_startSectionGroup()
{
}
-void FontTable::endSectionGroup()
+void FontTable::lcl_endSectionGroup()
{
}
-void FontTable::startParagraphGroup()
+void FontTable::lcl_startParagraphGroup()
{
}
-void FontTable::endParagraphGroup()
+void FontTable::lcl_endParagraphGroup()
{
}
-void FontTable::startCharacterGroup()
+void FontTable::lcl_startCharacterGroup()
{
}
-void FontTable::endCharacterGroup()
+void FontTable::lcl_endCharacterGroup()
{
}
-void FontTable::text(const sal_uInt8*, size_t )
+void FontTable::lcl_text(const sal_uInt8*, size_t )
{
}
-void FontTable::utext(const sal_uInt8* , size_t)
+void FontTable::lcl_utext(const sal_uInt8* , size_t)
{
}
-void FontTable::props(writerfilter::Reference<Properties>::Pointer_t)
+void FontTable::lcl_props(writerfilter::Reference<Properties>::Pointer_t)
{
}
-void FontTable::table(Id, writerfilter::Reference<Table>::Pointer_t)
+void FontTable::lcl_table(Id, writerfilter::Reference<Table>::Pointer_t)
{
}
-void FontTable::substream(Id, ::writerfilter::Reference<Stream>::Pointer_t)
+void FontTable::lcl_substream(Id, ::writerfilter::Reference<Stream>::Pointer_t)
{
}
-void FontTable::info(const string& )
+void FontTable::lcl_info(const string& )
{
}
-void FontTable::startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > )
+void FontTable::lcl_startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > )
{
}
-void FontTable::endShape( )
+void FontTable::lcl_endShape( )
{
}
const FontEntry::Pointer_t FontTable::getFontEntry(sal_uInt32 nIndex)
{
- FontEntry::Pointer_t pRet;
- if(m_pImpl->aFontEntries.size() > nIndex)
- {
- pRet.reset(&m_pImpl->aFontEntries[nIndex]);
- }
- return pRet;
+ return (m_pImpl->aFontEntries.size() > nIndex)
+ ? m_pImpl->aFontEntries[nIndex]
+ : FontEntry::Pointer_t();
}
sal_uInt32 FontTable::size()
diff --git a/writerfilter/source/dmapper/FontTable.hxx b/writerfilter/source/dmapper/FontTable.hxx
index 226ad371ca64..d2849107558c 100644
--- a/writerfilter/source/dmapper/FontTable.hxx
+++ b/writerfilter/source/dmapper/FontTable.hxx
@@ -31,7 +31,7 @@
#include <boost/shared_ptr.hpp>
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <com/sun/star/lang/XComponent.hpp>
namespace writerfilter {
@@ -63,43 +63,46 @@ struct FontEntry
nAltFontIndex( 0 )
{}
};
-class WRITERFILTER_DLLPRIVATE FontTable : public Properties, public Table
- /*,public BinaryObj*/, public Stream
+
+class WRITERFILTER_DLLPRIVATE FontTable : public LoggedProperties, public LoggedTable
+ /*,public BinaryObj*/, public LoggedStream
{
FontTable_Impl *m_pImpl;
-public:
+ public:
FontTable();
virtual ~FontTable();
+ sal_uInt32 size();
+ const FontEntry::Pointer_t getFontEntry(sal_uInt32 nIndex);
+
+ private:
// Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
void resolveSprm(Sprm & r_sprm);
// Table
- virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
// Stream
- virtual void startSectionGroup();
- virtual void endSectionGroup();
- virtual void startParagraphGroup();
- virtual void endParagraphGroup();
- virtual void startCharacterGroup();
- virtual void endCharacterGroup();
- virtual void text(const sal_uInt8 * data, size_t len);
- virtual void utext(const sal_uInt8 * data, size_t len);
- virtual void props(writerfilter::Reference<Properties>::Pointer_t ref);
- virtual void table(Id name,
- writerfilter::Reference<Table>::Pointer_t ref);
- virtual void substream(Id name,
- ::writerfilter::Reference<Stream>::Pointer_t ref);
- virtual void info(const string & info);
- virtual void startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
- virtual void endShape( );
+ virtual void lcl_startSectionGroup();
+ virtual void lcl_endSectionGroup();
+ virtual void lcl_startParagraphGroup();
+ virtual void lcl_endParagraphGroup();
+ virtual void lcl_startCharacterGroup();
+ virtual void lcl_endCharacterGroup();
+ virtual void lcl_text(const sal_uInt8 * data, size_t len);
+ virtual void lcl_utext(const sal_uInt8 * data, size_t len);
+ virtual void lcl_props(writerfilter::Reference<Properties>::Pointer_t ref);
+ virtual void lcl_table(Id name,
+ writerfilter::Reference<Table>::Pointer_t ref);
+ virtual void lcl_substream(Id name,
+ ::writerfilter::Reference<Stream>::Pointer_t ref);
+ virtual void lcl_info(const string & info);
+ virtual void lcl_startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual void lcl_endShape( );
- const FontEntry::Pointer_t getFontEntry(sal_uInt32 nIndex);
- sal_uInt32 size();
};
typedef boost::shared_ptr< FontTable > FontTablePtr;
}}
diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx
index 571812951fb8..d3af9dac4c35 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.cxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.cxx
@@ -9,6 +9,8 @@
#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/text/WrapTextMode.hpp>
+#include "dmapperLoggers.hxx"
+
#include <iostream>
using namespace std;
@@ -18,7 +20,7 @@ namespace dmapper {
using namespace com::sun::star;
PositionHandler::PositionHandler( ) :
- Properties( )
+LoggedProperties(dmapper_logger, "PositionHandler")
{
m_nOrient = text::VertOrientation::NONE;
m_nRelation = text::RelOrientation::FRAME;
@@ -29,7 +31,7 @@ PositionHandler::~PositionHandler( )
{
}
-void PositionHandler::attribute( Id aName, Value& rVal )
+void PositionHandler::lcl_attribute( Id aName, Value& rVal )
{
sal_Int32 nIntValue = rVal.getInt( );
switch ( aName )
@@ -86,11 +88,15 @@ void PositionHandler::attribute( Id aName, Value& rVal )
}
}
break;
- default:;
+ default:
+#ifdef DEBUG_DOMAINMAPPER
+ dmapper_logger->element("unhandled");
+#endif
+ break;
}
}
-void PositionHandler::sprm( Sprm& rSprm )
+void PositionHandler::lcl_sprm( Sprm& rSprm )
{
Value::Pointer_t pValue = rSprm.getValue();
sal_Int32 nIntValue = pValue->getInt();
@@ -154,12 +160,16 @@ void PositionHandler::sprm( Sprm& rSprm )
case NS_ooxml::LN_CT_PosH_posOffset:
case NS_ooxml::LN_CT_PosV_posOffset:
m_nPosition = ConversionHelper::convertEMUToMM100( nIntValue );
- default:;
+ default:
+#ifdef DEBUG_DOMAINMAPPER
+ dmapper_logger->element("unhandled");
+#endif
+ break;
}
}
WrapHandler::WrapHandler( ) :
- Properties( ),
+LoggedProperties(dmapper_logger, "WrapHandler"),
m_nType( 0 ),
m_nSide( 0 )
{
@@ -169,7 +179,7 @@ WrapHandler::~WrapHandler( )
{
}
-void WrapHandler::attribute( Id aName, Value& rVal )
+void WrapHandler::lcl_attribute( Id aName, Value& rVal )
{
switch ( aName )
{
@@ -183,7 +193,7 @@ void WrapHandler::attribute( Id aName, Value& rVal )
}
}
-void WrapHandler::sprm( Sprm& )
+void WrapHandler::lcl_sprm( Sprm& )
{
}
diff --git a/writerfilter/source/dmapper/GraphicHelpers.hxx b/writerfilter/source/dmapper/GraphicHelpers.hxx
index 911f2c9de155..c7761132359c 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.hxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.hxx
@@ -5,7 +5,7 @@
#include "PropertyMap.hxx"
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
@@ -13,7 +13,7 @@ namespace writerfilter {
namespace dmapper
{
-class WRITERFILTER_DLLPRIVATE PositionHandler: public Properties
+class WRITERFILTER_DLLPRIVATE PositionHandler: public LoggedProperties
{
public:
PositionHandler( );
@@ -23,12 +23,13 @@ public:
sal_Int16 m_nRelation;
sal_Int32 m_nPosition;
- virtual void attribute( Id aName, Value& rVal );
- virtual void sprm( Sprm& rSprm );
+ private:
+ virtual void lcl_attribute( Id aName, Value& rVal );
+ virtual void lcl_sprm( Sprm& rSprm );
};
typedef boost::shared_ptr<PositionHandler> PositionHandlerPtr;
-class WRITERFILTER_DLLPRIVATE WrapHandler: public Properties
+class WRITERFILTER_DLLPRIVATE WrapHandler: public LoggedProperties
{
public:
WrapHandler( );
@@ -39,8 +40,9 @@ public:
sal_Int32 getWrapMode( );
- virtual void attribute( Id aName, Value& rVal );
- virtual void sprm( Sprm& rSprm );
+ private:
+ virtual void lcl_attribute( Id aName, Value& rVal );
+ virtual void lcl_sprm( Sprm& rSprm );
};
typedef boost::shared_ptr<WrapHandler> WrapHandlerPtr;
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 696a5eed6b50..90c3dc8dd9db 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -26,54 +26,51 @@
*
************************************************************************/
-#include "GraphicImport.hxx"
-#include "GraphicHelpers.hxx"
+#include <string.h>
-#include <dmapper/DomainMapper.hxx>
-#include <PropertyMap.hxx>
-#include <doctok/resourceids.hxx>
-#include <ooxml/resourceids.hxx>
-#include <ConversionHelper.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/drawing/ColorMode.hpp>
-
-#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/drawing/PointSequenceSequence.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/text/GraphicCrop.hpp>
-#include <com/sun/star/text/XTextContent.hpp>
-#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/WrapTextMode.hpp>
-#include <com/sun/star/drawing/XShape.hpp>
-#include <rtl/ustrbuf.hxx>
+#include <com/sun/star/text/XTextContent.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <rtl/ustrbuf.hxx>
-#include <iostream>
-#include <resourcemodel/QNameToString.hxx>
-#include <string.h>
+#include <dmapper/DomainMapper.hxx>
+#include <doctok/resourceids.hxx>
+#include <ooxml/resourceids.hxx>
+#include <resourcemodel/ResourceModelHelper.hxx>
-#ifdef DEBUG_DOMAINMAPPER
-#include <resourcemodel/TagLogger.hxx>
-#endif
+#include "ConversionHelper.hxx"
+#include "GraphicHelpers.hxx"
+#include "GraphicImport.hxx"
+#include "PropertyMap.hxx"
+#include "WrapPolygonHandler.hxx"
+#include "dmapperLoggers.hxx"
namespace writerfilter {
+
+using resourcemodel::resolveSprmProps;
+
namespace dmapper
{
using namespace ::std;
using namespace ::com::sun::star;
-#ifdef DEBUG_DOMAINMAPPER
-extern TagLogger::Pointer_t dmapper_logger;
-#endif
-
class XInputStreamHelper : public cppu::WeakImplHelper1
< io::XInputStream >
{
@@ -221,6 +218,8 @@ public:
sal_Int32 nWrap;
bool bOpaque;
bool bContour;
+ bool bContourOutside;
+ WrapPolygon::Pointer_t mpWrapPolygon;
bool bIgnoreWRK;
sal_Int32 nLeftMargin;
@@ -283,6 +282,7 @@ public:
,nWrap(0)
,bOpaque( true )
,bContour(false)
+ ,bContourOutside(true)
,bIgnoreWRK(true)
,nLeftMargin(319)
,nRightMargin(319)
@@ -344,9 +344,12 @@ GraphicImport::GraphicImport(uno::Reference < uno::XComponentContext > xCompo
uno::Reference< lang::XMultiServiceFactory > xTextFactory,
DomainMapper& rDMapper,
GraphicImportType eImportType )
-: m_pImpl( new GraphicImport_Impl( eImportType, rDMapper ))
- ,m_xComponentContext( xComponentContext )
- ,m_xTextFactory( xTextFactory)
+: LoggedProperties(dmapper_logger, "GraphicImport")
+, LoggedTable(dmapper_logger, "GraphicImport")
+, LoggedStream(dmapper_logger, "GraphicImport")
+, m_pImpl( new GraphicImport_Impl( eImportType, rDMapper ))
+, m_xComponentContext( xComponentContext )
+, m_xTextFactory( xTextFactory)
{
}
@@ -356,13 +359,30 @@ GraphicImport::~GraphicImport()
delete m_pImpl;
}
+void GraphicImport::handleWrapTextValue(sal_uInt32 nVal)
+{
+ switch (nVal)
+ {
+ case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_bothSides: // 90920;
+ m_pImpl->nWrap = text::WrapTextMode_PARALLEL;
+ break;
+ case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_left: // 90921;
+ m_pImpl->nWrap = text::WrapTextMode_LEFT;
+ break;
+ case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_right: // 90922;
+ m_pImpl->nWrap = text::WrapTextMode_RIGHT;
+ break;
+ case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_largest: // 90923;
+ m_pImpl->nWrap = text::WrapTextMode_DYNAMIC;
+ break;
+ default:;
+ }
+}
+
+
-void GraphicImport::attribute(Id nName, Value & val)
+void GraphicImport::lcl_attribute(Id nName, Value & val)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("attribute");
- dmapper_logger->attribute("name", (*QNameToString::Instance())(nName));
-#endif
sal_Int32 nIntValue = val.getInt();
switch( nName )
{
@@ -834,25 +854,24 @@ void GraphicImport::attribute(Id nName, Value & val)
break;
case NS_ooxml::LN_CT_WrapTight_wrapText: // 90934;
m_pImpl->bContour = true;
- //no break;
+ m_pImpl->bContourOutside = true;
+
+ handleWrapTextValue(val.getInt());
+
+ break;
+ case NS_ooxml::LN_CT_WrapThrough_wrapText:
+ /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
+ m_pImpl->bContour = true;
+ m_pImpl->bContourOutside = false;
+
+ handleWrapTextValue(val.getInt());
+
+ break;
case NS_ooxml::LN_CT_WrapSquare_wrapText: //90928;
- switch ( val.getInt() )
- {
- case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_bothSides: // 90920;
- m_pImpl->nWrap = text::WrapTextMode_PARALLEL;
- break;
- case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_left: // 90921;
- m_pImpl->nWrap = text::WrapTextMode_LEFT;
- break;
- case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_right: // 90922;
- m_pImpl->nWrap = text::WrapTextMode_RIGHT;
- break;
- case NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_largest: // 90923;
- m_pImpl->nWrap = text::WrapTextMode_DYNAMIC;
- break;
- default:;
- }
- break;
+ /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
+
+ handleWrapTextValue(val.getInt());
+ break;
case NS_ooxml::LN_shape:
{
uno::Reference< drawing::XShape> xShape;
@@ -942,18 +961,11 @@ void GraphicImport::attribute(Id nName, Value & val)
//TODO: does it need to be handled?
break;
default:
-#if OSL_DEBUG_LEVEL > 0
- ::rtl::OString sMessage( "GraphicImport::attribute() - Id: ");
- sMessage += ::rtl::OString::valueOf( sal_Int32( nName ), 10 );
- sMessage += ::rtl::OString(" / 0x");
- sMessage += ::rtl::OString::valueOf( sal_Int32( nName ), 16 );
- OSL_ENSURE( false, sMessage.getStr())
+#ifdef DEBUG_DMAPPER_GRAPHIC_IMPORT
+ dmapper_logger->element("unhandled");
#endif
;
}
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
uno::Reference<text::XTextContent> GraphicImport::GetGraphicObject()
@@ -1115,13 +1127,8 @@ void GraphicImport::ProcessShapeOptions(Value& val)
}
-void GraphicImport::sprm(Sprm & rSprm)
+void GraphicImport::lcl_sprm(Sprm & rSprm)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("sprm");
- dmapper_logger->chars(rSprm.toString());
-#endif
-
sal_uInt32 nSprmId = rSprm.getId();
Value::Pointer_t pValue = rSprm.getValue();
@@ -1143,12 +1150,12 @@ void GraphicImport::sprm(Sprm & rSprm)
case NS_ooxml::LN_CT_Anchor_effectExtent: // 90979;
case NS_ooxml::LN_EG_WrapType_wrapSquare: // 90945;
case NS_ooxml::LN_EG_WrapType_wrapTight: // 90946;
+ case NS_ooxml::LN_EG_WrapType_wrapThrough:
case NS_ooxml::LN_CT_Anchor_docPr: // 90980;
case NS_ooxml::LN_CT_Anchor_cNvGraphicFramePr: // 90981;
case NS_ooxml::LN_CT_Anchor_a_graphic: // 90982;
case NS_ooxml::LN_CT_WrapPath_start: // 90924;
case NS_ooxml::LN_CT_WrapPath_lineTo: // 90925;
- case NS_ooxml::LN_CT_WrapTight_wrapPolygon: // 90933;
case NS_ooxml::LN_graphic_graphic:
case NS_ooxml::LN_pic_pic:
{
@@ -1159,6 +1166,17 @@ void GraphicImport::sprm(Sprm & rSprm)
}
}
break;
+ case NS_ooxml::LN_CT_WrapTight_wrapPolygon:
+ case NS_ooxml::LN_CT_WrapThrough_wrapPolygon:
+ /* WRITERFILTERSTATUS: done: 100, planned: 4, spent: 2 */
+ {
+ WrapPolygonHandler aHandler;
+
+ resolveSprmProps(aHandler, rSprm);
+
+ m_pImpl->mpWrapPolygon = aHandler.getPolygon();
+ }
+ break;
case NS_ooxml::LN_CT_Anchor_positionH: // 90976;
{
// Use a special handler for the positionning
@@ -1211,9 +1229,6 @@ void GraphicImport::sprm(Sprm & rSprm)
case NS_ooxml::LN_EG_WrapType_wrapTopAndBottom: // 90948;
m_pImpl->nWrap = text::WrapTextMode_NONE;
break;
- case NS_ooxml::LN_EG_WrapType_wrapThrough: // 90947;
- m_pImpl->nWrap = text::WrapTextMode_THROUGHT;
- break;
case 0xf010:
case 0xf011:
//ignore - doesn't contain useful members
@@ -1237,16 +1252,10 @@ void GraphicImport::sprm(Sprm & rSprm)
#endif
;
}
-
-
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
-void GraphicImport::entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t /*ref*/)
+void GraphicImport::lcl_entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t /*ref*/)
{
}
/*-- 16.11.2006 16:14:32---------------------------------------------------
@@ -1395,7 +1404,7 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_SURROUND_CONTOUR ),
uno::makeAny(m_pImpl->bContour));
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_CONTOUR_OUTSIDE ),
- uno::makeAny(true));
+ uno::makeAny(m_pImpl->bContourOutside));
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_LEFT_MARGIN ),
uno::makeAny(m_pImpl->nLeftMargin));
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_RIGHT_MARGIN ),
@@ -1405,8 +1414,6 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_BOTTOM_MARGIN ),
uno::makeAny(m_pImpl->nBottomMargin));
- xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_CONTOUR_POLY_POLYGON),
- uno::Any());
if( m_pImpl->eColorMode == drawing::ColorMode_STANDARD &&
m_pImpl->nContrast == -70 &&
m_pImpl->nBrightness == 70 )
@@ -1434,16 +1441,31 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_HORI_MIRRORED_ON_ODD_PAGES ),
uno::makeAny( m_pImpl->bHoriFlip ));
}
+
if( m_pImpl->bVertFlip )
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_MIRRORED ),
uno::makeAny( m_pImpl->bVertFlip ));
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_BACK_COLOR ),
uno::makeAny( m_pImpl->nFillColor ));
+
//there seems to be no way to detect the original size via _real_ API
uno::Reference< beans::XPropertySet > xGraphicProperties( xGraphic, uno::UNO_QUERY_THROW );
awt::Size aGraphicSize, aGraphicSizePixel;
xGraphicProperties->getPropertyValue(rPropNameSupplier.GetName( PROP_SIZE100th_M_M )) >>= aGraphicSize;
xGraphicProperties->getPropertyValue(rPropNameSupplier.GetName( PROP_SIZE_PIXEL )) >>= aGraphicSizePixel;
+
+ uno::Any aContourPolyPolygon;
+ if( aGraphicSize.Width && aGraphicSize.Height &&
+ m_pImpl->mpWrapPolygon.get() != NULL)
+ {
+ awt::Size aDstSize(m_pImpl->getXSize(), m_pImpl->getYSize());
+ WrapPolygon::Pointer_t pCorrected = m_pImpl->mpWrapPolygon->correctWordWrapPolygon(aGraphicSize, aDstSize);
+ aContourPolyPolygon <<= pCorrected->getPointSequenceSequence();
+ }
+
+ xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_CONTOUR_POLY_POLYGON),
+ aContourPolyPolygon);
+
if( aGraphicSize.Width && aGraphicSize.Height )
{
//todo: i71651 graphic size is not provided by the GraphicDescriptor
@@ -1452,9 +1474,11 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
lcl_CalcCrop( m_pImpl->nLeftCrop, aGraphicSize.Width );
lcl_CalcCrop( m_pImpl->nRightCrop, aGraphicSize.Width );
+
xGraphicProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_GRAPHIC_CROP ),
uno::makeAny(text::GraphicCrop(m_pImpl->nTopCrop, m_pImpl->nBottomCrop, m_pImpl->nLeftCrop, m_pImpl->nRightCrop)));
}
+
}
if(m_pImpl->eGraphicImportType == IMPORT_AS_DETECTED_INLINE || m_pImpl->eGraphicImportType == IMPORT_AS_DETECTED_ANCHOR)
@@ -1500,70 +1524,70 @@ void GraphicImport::data(const sal_uInt8* buf, size_t len, writerfilter::Referen
}
-void GraphicImport::startSectionGroup()
+void GraphicImport::lcl_startSectionGroup()
{
}
-void GraphicImport::endSectionGroup()
+void GraphicImport::lcl_endSectionGroup()
{
}
-void GraphicImport::startParagraphGroup()
+void GraphicImport::lcl_startParagraphGroup()
{
}
-void GraphicImport::endParagraphGroup()
+void GraphicImport::lcl_endParagraphGroup()
{
}
-void GraphicImport::startCharacterGroup()
+void GraphicImport::lcl_startCharacterGroup()
{
}
-void GraphicImport::endCharacterGroup()
+void GraphicImport::lcl_endCharacterGroup()
{
}
-void GraphicImport::text(const sal_uInt8 * /*_data*/, size_t /*len*/)
+void GraphicImport::lcl_text(const sal_uInt8 * /*_data*/, size_t /*len*/)
{
}
-void GraphicImport::utext(const sal_uInt8 * /*_data*/, size_t /*len*/)
+void GraphicImport::lcl_utext(const sal_uInt8 * /*_data*/, size_t /*len*/)
{
}
-void GraphicImport::props(writerfilter::Reference<Properties>::Pointer_t /*ref*/)
+void GraphicImport::lcl_props(writerfilter::Reference<Properties>::Pointer_t /*ref*/)
{
}
-void GraphicImport::table(Id /*name*/, writerfilter::Reference<Table>::Pointer_t /*ref*/)
+void GraphicImport::lcl_table(Id /*name*/, writerfilter::Reference<Table>::Pointer_t /*ref*/)
{
}
-void GraphicImport::substream(Id /*name*/, ::writerfilter::Reference<Stream>::Pointer_t /*ref*/)
+void GraphicImport::lcl_substream(Id /*name*/, ::writerfilter::Reference<Stream>::Pointer_t /*ref*/)
{
}
-void GraphicImport::info(const string & /*info*/)
+void GraphicImport::lcl_info(const string & /*info*/)
{
}
-void GraphicImport::startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > /*xShape*/ )
+void GraphicImport::lcl_startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > /*xShape*/ )
{
}
-void GraphicImport::endShape( )
+void GraphicImport::lcl_endShape( )
{
}
diff --git a/writerfilter/source/dmapper/GraphicImport.hxx b/writerfilter/source/dmapper/GraphicImport.hxx
index 210343e214a8..cc609a705e40 100644
--- a/writerfilter/source/dmapper/GraphicImport.hxx
+++ b/writerfilter/source/dmapper/GraphicImport.hxx
@@ -28,7 +28,7 @@
#ifndef INCLUDED_GRAPHICIMPORT_HXX
#define INCLUDED_GRAPHICIMPORT_HXX
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
namespace com{ namespace sun { namespace star {
namespace uno{
@@ -67,8 +67,8 @@ enum GraphicImportType
IMPORT_AS_DETECTED_ANCHOR
};
-class WRITERFILTER_DLLPRIVATE GraphicImport : public Properties, public Table
- ,public BinaryObj, public Stream
+class WRITERFILTER_DLLPRIVATE GraphicImport : public LoggedProperties, public LoggedTable
+ ,public BinaryObj, public LoggedStream
{
GraphicImport_Impl* m_pImpl;
::com::sun::star::uno::Reference < ::com::sun::star::uno::XComponentContext > m_xComponentContext;
@@ -89,37 +89,41 @@ public:
GraphicImportType eGraphicImportType);
virtual ~GraphicImport();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
- // Table
- virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
-
// BinaryObj
virtual void data(const sal_uInt8* buf, size_t len, writerfilter::Reference<Properties>::Pointer_t ref);
- // Stream
- virtual void startSectionGroup();
- virtual void endSectionGroup();
- virtual void startParagraphGroup();
- virtual void endParagraphGroup();
- virtual void startCharacterGroup();
- virtual void endCharacterGroup();
- virtual void text(const sal_uInt8 * data, size_t len);
- virtual void utext(const sal_uInt8 * data, size_t len);
- virtual void props(writerfilter::Reference<Properties>::Pointer_t ref);
- virtual void table(Id name,
- writerfilter::Reference<Table>::Pointer_t ref);
- virtual void substream(Id name,
- ::writerfilter::Reference<Stream>::Pointer_t ref);
- virtual void info(const string & info);
- virtual void startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
- virtual void endShape( );
-
::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > GetGraphicObject();
bool IsGraphic() const;
+
+ private:
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
+ // Table
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+
+ // Stream
+ virtual void lcl_startSectionGroup();
+ virtual void lcl_endSectionGroup();
+ virtual void lcl_startParagraphGroup();
+ virtual void lcl_endParagraphGroup();
+ virtual void lcl_startCharacterGroup();
+ virtual void lcl_endCharacterGroup();
+ virtual void lcl_text(const sal_uInt8 * data, size_t len);
+ virtual void lcl_utext(const sal_uInt8 * data, size_t len);
+ virtual void lcl_props(writerfilter::Reference<Properties>::Pointer_t ref);
+ virtual void lcl_table(Id name,
+ writerfilter::Reference<Table>::Pointer_t ref);
+ virtual void lcl_substream(Id name,
+ ::writerfilter::Reference<Stream>::Pointer_t ref);
+ virtual void lcl_info(const string & info);
+ virtual void lcl_startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
+ virtual void lcl_endShape( );
+
+ void handleWrapTextValue(sal_uInt32 nVal);
};
+
typedef boost::shared_ptr< GraphicImport > GraphicImportPtr;
}}
diff --git a/writerfilter/source/dmapper/MeasureHandler.cxx b/writerfilter/source/dmapper/MeasureHandler.cxx
index d605fd32b8cf..e4b3bb60d5d8 100644
--- a/writerfilter/source/dmapper/MeasureHandler.cxx
+++ b/writerfilter/source/dmapper/MeasureHandler.cxx
@@ -31,6 +31,7 @@
#include <ConversionHelper.hxx>
#include <ooxml/resourceids.hxx>
#include <com/sun/star/text/SizeType.hpp>
+#include "dmapperLoggers.hxx"
namespace writerfilter {
namespace dmapper {
@@ -40,9 +41,10 @@ using namespace ::com::sun::star;
MeasureHandler::MeasureHandler() :
- m_nMeasureValue( 0 ),
- m_nUnit( -1 ),
- m_nRowHeightSizeType( text::SizeType::MIN )
+LoggedProperties(dmapper_logger, "MeasureHandler"),
+m_nMeasureValue( 0 ),
+m_nUnit( -1 ),
+m_nRowHeightSizeType( text::SizeType::MIN )
{
}
@@ -52,7 +54,7 @@ MeasureHandler::~MeasureHandler()
}
-void MeasureHandler::attribute(Id rName, Value & rVal)
+void MeasureHandler::lcl_attribute(Id rName, Value & rVal)
{
sal_Int32 nIntValue = rVal.getInt();
(void)rName;
@@ -89,7 +91,7 @@ void MeasureHandler::attribute(Id rName, Value & rVal)
}
-void MeasureHandler::sprm(Sprm & rSprm)
+void MeasureHandler::lcl_sprm(Sprm & rSprm)
{
(void)rSprm;
}
diff --git a/writerfilter/source/dmapper/MeasureHandler.hxx b/writerfilter/source/dmapper/MeasureHandler.hxx
index 2c95293f9421..1fc9ae96985c 100644
--- a/writerfilter/source/dmapper/MeasureHandler.hxx
+++ b/writerfilter/source/dmapper/MeasureHandler.hxx
@@ -29,7 +29,7 @@
#define INCLUDED_MEASUREHANDLER_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
namespace writerfilter {
@@ -40,20 +40,20 @@ class PropertyMap;
- Left indent of tables
- Preferred width of tables
*/
-class WRITERFILTER_DLLPRIVATE MeasureHandler : public Properties
+class WRITERFILTER_DLLPRIVATE MeasureHandler : public LoggedProperties
{
sal_Int32 m_nMeasureValue;
sal_Int32 m_nUnit;
sal_Int16 m_nRowHeightSizeType; //table row height type
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
MeasureHandler();
virtual ~MeasureHandler();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
sal_Int32 getMeasureValue() const;
//at least tables can have automatic width
bool isAutoWidth() const;
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 4ad5872d62fc..2a696910ace5 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -20,6 +20,8 @@
#include <stdio.h>
#endif
+#include "dmapperLoggers.hxx"
+
using namespace com::sun::star;
using ::rtl::OUString;
@@ -618,10 +620,12 @@ void ListDef::CreateNumberingRules( DomainMapper& rDMapper,
//------------------------------------- NumberingManager implementation
-ListsManager::ListsManager( DomainMapper& rDMapper,
- const uno::Reference< lang::XMultiServiceFactory > xFactory ) :
- m_rDMapper( rDMapper ),
- m_xFactory( xFactory )
+ListsManager::ListsManager(DomainMapper& rDMapper,
+ const uno::Reference< lang::XMultiServiceFactory > xFactory) :
+LoggedProperties(dmapper_logger, "ListsManager"),
+LoggedTable(dmapper_logger, "ListsManager"),
+m_rDMapper( rDMapper ),
+m_xFactory( xFactory )
{
}
@@ -629,7 +633,7 @@ ListsManager::~ListsManager( )
{
}
-void ListsManager::attribute( Id nName, Value& rVal )
+void ListsManager::lcl_attribute( Id nName, Value& rVal )
{
OSL_ENSURE( m_pCurrentDefinition.get(), "current entry has to be set here");
if(!m_pCurrentDefinition.get())
@@ -750,7 +754,7 @@ void ListsManager::attribute( Id nName, Value& rVal )
}
}
-void ListsManager::sprm( Sprm& rSprm )
+void ListsManager::lcl_sprm( Sprm& rSprm )
{
//fill the attributes of the style sheet
sal_uInt32 nSprmId = rSprm.getId();
@@ -909,8 +913,8 @@ void ListsManager::sprm( Sprm& rSprm )
}
}
-void ListsManager::entry( int /* pos */,
- writerfilter::Reference<Properties>::Pointer_t ref )
+void ListsManager::lcl_entry( int /* pos */,
+ writerfilter::Reference<Properties>::Pointer_t ref )
{
if( m_rDMapper.IsOOXMLImport() )
{
diff --git a/writerfilter/source/dmapper/NumberingManager.hxx b/writerfilter/source/dmapper/NumberingManager.hxx
index 82787622324d..d001805f4333 100644
--- a/writerfilter/source/dmapper/NumberingManager.hxx
+++ b/writerfilter/source/dmapper/NumberingManager.hxx
@@ -6,7 +6,7 @@
#include <WriterFilterDllApi.hxx>
#include <dmapper/DomainMapper.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <com/sun/star/container/XIndexReplace.hpp>
@@ -171,8 +171,8 @@ public:
/** This class provides access to the defined numbering styles.
*/
class ListsManager :
- public Properties,
- public Table
+ public LoggedProperties,
+ public LoggedTable
{
private:
@@ -191,6 +191,13 @@ private:
AbstractListDef::Pointer GetAbstractList( sal_Int32 nId );
+ // Properties
+ virtual void lcl_attribute( Id nName, Value & rVal );
+ virtual void lcl_sprm(Sprm & sprm);
+
+ // Table
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+
public:
ListsManager(
@@ -200,13 +207,6 @@ public:
typedef boost::shared_ptr< ListsManager > Pointer;
- // Properties
- virtual void attribute( Id nName, Value & rVal );
- virtual void sprm(Sprm & sprm);
-
- // Table
- virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
-
// Config methods
void SetLFOImport( bool bLFOImport ) { m_bIsLFOImport = bLFOImport; };
diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx
index 25f6df4fd820..a42e0af43a1b 100644
--- a/writerfilter/source/dmapper/OLEHandler.cxx
+++ b/writerfilter/source/dmapper/OLEHandler.cxx
@@ -45,6 +45,8 @@
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include "dmapperLoggers.hxx"
+
namespace writerfilter {
namespace dmapper {
@@ -52,8 +54,9 @@ using namespace ::com::sun::star;
OLEHandler::OLEHandler() :
- m_nDxaOrig(0),
- m_nDyaOrig(0),
+LoggedProperties(dmapper_logger, "OLEHandler"),
+m_nDxaOrig(0),
+m_nDyaOrig(0),
m_nWrapMode(1)
{
}
@@ -64,7 +67,7 @@ OLEHandler::~OLEHandler()
}
-void OLEHandler::attribute(Id rName, Value & rVal)
+void OLEHandler::lcl_attribute(Id rName, Value & rVal)
{
rtl::OUString sStringValue = rVal.getString();
(void)rName;
@@ -135,7 +138,7 @@ void OLEHandler::attribute(Id rName, Value & rVal)
}
-void OLEHandler::sprm(Sprm & rSprm)
+void OLEHandler::lcl_sprm(Sprm & rSprm)
{
sal_uInt32 nSprmId = rSprm.getId();
switch( nSprmId )
diff --git a/writerfilter/source/dmapper/OLEHandler.hxx b/writerfilter/source/dmapper/OLEHandler.hxx
index 61b408fbbdd4..7a40f53986db 100644
--- a/writerfilter/source/dmapper/OLEHandler.hxx
+++ b/writerfilter/source/dmapper/OLEHandler.hxx
@@ -29,7 +29,7 @@
#define INCLUDED_OLEHANDLER_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Point.hpp>
@@ -59,7 +59,7 @@ namespace dmapper
//class PropertyMap;
/** Handler for OLE objects
*/
-class WRITERFILTER_DLLPRIVATE OLEHandler : public Properties
+class WRITERFILTER_DLLPRIVATE OLEHandler : public LoggedProperties
{
::rtl::OUString m_sObjectType;
::rtl::OUString m_sProgId;
@@ -80,14 +80,15 @@ class WRITERFILTER_DLLPRIVATE OLEHandler : public Properties
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > m_xReplacement;
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream;
+
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
OLEHandler();
virtual ~OLEHandler();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
inline ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getShape( ) { return m_xShape; };
inline bool isOLEObject( ) { return m_xInputStream.is( ); };
diff --git a/writerfilter/source/dmapper/PageBordersHandler.cxx b/writerfilter/source/dmapper/PageBordersHandler.cxx
index ae607199f588..41469d6cf507 100644
--- a/writerfilter/source/dmapper/PageBordersHandler.cxx
+++ b/writerfilter/source/dmapper/PageBordersHandler.cxx
@@ -3,6 +3,8 @@
#include <ooxml/resourceids.hxx>
+#include "dmapperLoggers.hxx"
+
namespace writerfilter {
namespace dmapper {
@@ -17,8 +19,9 @@ _PgBorder::~_PgBorder( )
}
PageBordersHandler::PageBordersHandler( ) :
- m_nDisplay( 0 ),
- m_nOffset( 0 )
+LoggedProperties(dmapper_logger, "PageBordersHandler"),
+m_nDisplay( 0 ),
+m_nOffset( 0 )
{
}
@@ -26,7 +29,7 @@ PageBordersHandler::~PageBordersHandler( )
{
}
-void PageBordersHandler::attribute( Id eName, Value& rVal )
+void PageBordersHandler::lcl_attribute( Id eName, Value& rVal )
{
int nIntValue = rVal.getInt( );
switch ( eName )
@@ -66,7 +69,7 @@ void PageBordersHandler::attribute( Id eName, Value& rVal )
}
}
-void PageBordersHandler::sprm( Sprm& rSprm )
+void PageBordersHandler::lcl_sprm( Sprm& rSprm )
{
switch ( rSprm.getId( ) )
{
diff --git a/writerfilter/source/dmapper/PageBordersHandler.hxx b/writerfilter/source/dmapper/PageBordersHandler.hxx
index 92a905c4f471..d238a71981d7 100644
--- a/writerfilter/source/dmapper/PageBordersHandler.hxx
+++ b/writerfilter/source/dmapper/PageBordersHandler.hxx
@@ -6,7 +6,7 @@
#include "PropertyMap.hxx"
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
@@ -28,7 +28,7 @@ public:
~_PgBorder( );
};
-class WRITERFILTER_DLLPRIVATE PageBordersHandler : public Properties
+class WRITERFILTER_DLLPRIVATE PageBordersHandler : public LoggedProperties
{
private:
@@ -37,14 +37,14 @@ private:
sal_Int32 m_nOffset;
vector<_PgBorder> m_aBorders;
+ // Properties
+ virtual void lcl_attribute( Id eName, Value& rVal );
+ virtual void lcl_sprm( Sprm& rSprm );
+
public:
PageBordersHandler( );
~PageBordersHandler( );
- // Properties
- virtual void attribute( Id eName, Value& rVal );
- virtual void sprm( Sprm& rSprm );
-
inline sal_Int32 GetDisplayOffset( )
{
return ( m_nOffset << 5 ) + m_nDisplay;
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index eea6d3c1ea22..6ddd1d86a16b 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -33,262 +33,262 @@ namespace rtl{ class OUString;}
namespace writerfilter {
namespace dmapper{
enum PropertyIds
-{
+ {
PROP_ID_START = 1
- /* 1*/ ,PROP_CHAR_WEIGHT = PROP_ID_START
- /* 2*/ ,PROP_CHAR_POSTURE
- /* 3*/ ,PROP_CHAR_STRIKEOUT
- /* 4*/ ,PROP_CHAR_CONTOURED
- /* 5*/ ,PROP_CHAR_SHADOWED
- /* 6*/ ,PROP_CHAR_CASE_MAP
- /* 7*/ ,PROP_CHAR_COLOR
- /* 8*/ ,PROP_CHAR_RELIEF
- /* 9*/ ,PROP_CHAR_UNDERLINE
- /*10*/ ,PROP_CHAR_WORD_MODE
- /*11*/ ,PROP_CHAR_ESCAPEMENT
- /*12*/ ,PROP_CHAR_ESCAPEMENT_HEIGHT
- /*13*/ ,PROP_CHAR_HEIGHT
- /*14*/ ,PROP_CHAR_HEIGHT_COMPLEX
- /*15*/ ,PROP_CHAR_LOCALE
- /*16*/ ,PROP_CHAR_LOCALE_ASIAN
- /*17*/ ,PROP_CHAR_WEIGHT_COMPLEX
- /*18*/ ,PROP_CHAR_POSTURE_COMPLEX
- /*19*/ ,PROP_CHAR_AUTO_KERNING
- /*20*/ ,PROP_CHAR_CHAR_KERNING
- /*21*/ ,PROP_CHAR_SCALE_WIDTH
- /*22*/ ,PROP_CHAR_LOCALE_COMPLEX
- /*23*/ ,PROP_CHAR_UNDERLINE_COLOR
-/*24*/ , PROP_CHAR_UNDERLINE_HAS_COLOR
-/*25*/ , PROP_CHAR_FONT_NAME
-/*26*/ , PROP_CHAR_FONT_STYLE
-/*27*/ , PROP_CHAR_FONT_FAMILY
-/*28*/ , PROP_CHAR_FONT_CHAR_SET
-/*29*/ , PROP_CHAR_FONT_PITCH
-/*30*/ , PROP_CHAR_FONT_NAME_ASIAN
-/*31*/ , PROP_CHAR_HEIGHT_ASIAN
-/*32*/ , PROP_CHAR_FONT_STYLE_ASIAN
-/*33*/ , PROP_CHAR_FONT_FAMILY_ASIAN
-/*34*/ , PROP_CHAR_FONT_CHAR_SET_ASIAN
-/*35*/ , PROP_CHAR_FONT_PITCH_ASIAN
-/*36*/ , PROP_CHAR_FONT_NAME_COMPLEX
-/*37*/ , PROP_CHAR_FONT_STYLE_COMPLEX
-/*38*/ , PROP_CHAR_FONT_FAMILY_COMPLEX
-/*39*/ , PROP_CHAR_FONT_CHAR_SET_COMPLEX
-/*40*/ , PROP_CHAR_FONT_PITCH_COMPLEX
-/*41*/ , PROP_CHAR_HIDDEN
-/*42*/ , PROP_CHAR_WEIGHT_ASIAN
-/*43*/ , PROP_CHAR_POSTURE_ASIAN
-/*44*/ , PROP_PARA_STYLE_NAME
-/*45*/ , PROP_CHAR_STYLE_NAME
-/*46*/ , PROP_PARA_ADJUST
-/*47*/ , PROP_PARA_LAST_LINE_ADJUST
-/*48*/ , PROP_PARA_RIGHT_MARGIN
-/*49*/ , PROP_PARA_LEFT_MARGIN
-/*50*/ , PROP_PARA_FIRST_LINE_INDENT
-/*51*/ , PROP_PARA_KEEP_TOGETHER
-/*52*/ , PROP_PARA_TOP_MARGIN
-/*53*/ , PROP_PARA_BOTTOM_MARGIN
-/*54*/ , PROP_PARA_IS_HYPHENATION
-/*55*/ , PROP_PARA_LINE_NUMBER_COUNT
-/*56*/ , PROP_PARA_IS_HANGING_PUNCTUATION
-/*57*/ , PROP_PARA_LINE_SPACING
-/*58*/ , PROP_PARA_TAB_STOPS
-/*59*/ , PROP_PARA_WIDOWS
-/*60*/ , PROP_PARA_ORPHANS
-/*61*/ , PROP_PARA_LINE_NUMBER_START_VALUE
-/*62*/ , PROP_NUMBERING_LEVEL
-/*63*/ , PROP_NUMBERING_RULES
-/*64*/ , PROP_NUMBERING_TYPE
-/*65*/ , PROP_START_WITH
-/*66*/ , PROP_ADJUST
-/*67*/ , PROP_PARENT_NUMBERING
-/*68*/ , PROP_LEFT_MARGIN
-/*69*/ , PROP_RIGHT_MARGIN
-/*70*/ , PROP_TOP_MARGIN
-/*71*/ , PROP_BOTTOM_MARGIN
-/*72*/ , PROP_FIRST_LINE_OFFSET
-/*73*/ , PROP_LEFT_BORDER
-/*74*/ , PROP_RIGHT_BORDER
-/*75*/ , PROP_TOP_BORDER
-/*76*/ , PROP_BOTTOM_BORDER
-/*77*/ , PROP_TABLE_BORDER
-/*78*/ , PROP_LEFT_BORDER_DISTANCE
-/*79*/ , PROP_RIGHT_BORDER_DISTANCE
-/*80*/ , PROP_TOP_BORDER_DISTANCE
-/*81*/ , PROP_BOTTOM_BORDER_DISTANCE
-/*82*/ , PROP_CURRENT_PRESENTATION
-/*83*/ , PROP_IS_FIXED
-/*84*/ , PROP_SUB_TYPE
-/*85*/ , PROP_FILE_FORMAT
-/*86*/ , PROP_HYPER_LINK_U_R_L
-/*87*/ , PROP_NUMBER_FORMAT
-/*88*/ , PROP_NAME
-/*89*/ , PROP_IS_INPUT
-/*90*/ , PROP_HINT
-/*91*/ , PROP_FULL_NAME
-/*92*/ , PROP_KEYWORDS
-/*93*/ , PROP_DESCRIPTION
-/*94*/ , PROP_MACRO_NAME
-/*95*/ , PROP_SUBJECT
-/*96*/ , PROP_USER_DATA_TYPE
-/*97*/ , PROP_TITLE
-/*98*/ , PROP_CONTENT
-/*99*/ , PROP_DATA_COLUMN_NAME
-/*100*/, PROP_INPUT_STREAM
-/*101*/, PROP_GRAPHIC
-/*102*/, PROP_ANCHOR_TYPE
-/*103*/ ,PROP_SIZE
-/*104*/ ,PROP_HORI_ORIENT
-/*105*/ ,PROP_HORI_ORIENT_POSITION
-/*106*/ ,PROP_HORI_ORIENT_RELATION
-/*107*/ ,PROP_VERT_ORIENT
-/*108*/ ,PROP_VERT_ORIENT_POSITION
-/*109*/ ,PROP_VERT_ORIENT_RELATION
-/*110*/ ,PROP_GRAPHIC_CROP
-/*111*/ ,PROP_SIZE100th_M_M
-/*112*/ ,PROP_SIZE_PIXEL
-/*113*/ ,PROP_SURROUND
-/*114*/ ,PROP_SURROUND_CONTOUR
-/*115*/ ,PROP_ADJUST_CONTRAST
-/*116*/ ,PROP_ADJUST_LUMINANCE
-/*117*/ ,PROP_GRAPHIC_COLOR_MODE
-/*118*/ ,PROP_GAMMA
-/*119*/ ,PROP_HORI_MIRRORED_ON_EVEN_PAGES
-/*120*/ ,PROP_HORI_MIRRORED_ON_ODD_PAGES
-/*121*/ ,PROP_VERT_MIRRORED
-/*122*/ ,PROP_CONTOUR_OUTSIDE
-/*123*/ ,PROP_CONTOUR_POLY_POLYGON
-/*124*/ ,PROP_PAGE_TOGGLE
-/*125*/ ,PROP_BACK_COLOR
-/*126*/ ,PROP_ALTERNATIVE_TEXT
-/*127*/ ,PROP_HEADER_TEXT_LEFT
-/*128*/ ,PROP_HEADER_TEXT
-/*129*/ ,PROP_HEADER_IS_SHARED
-/*130*/ ,PROP_HEADER_IS_ON
-/*131*/ ,PROP_FOOTER_TEXT_LEFT
-/*132*/ ,PROP_FOOTER_TEXT
-/*133*/ ,PROP_FOOTER_IS_SHARED
-/*134*/ ,PROP_FOOTER_IS_ON
-/*135*/ ,PROP_WIDTH
-/*136*/ ,PROP_HEIGHT
-/*137*/ ,PROP_SEPARATOR_LINE_IS_ON
-/*138*/ ,PROP_TEXT_COLUMNS
-/*139*/ ,PROP_AUTOMATIC_DISTANCE
-/*140*/ ,PROP_IS_LANDSCAPE
-/*141*/ ,PROP_PRINTER_PAPER_TRAY_INDEX
-/*142*/ ,PROP_FIRST_PAGE
-/*143*/ ,PROP_DEFAULT
-/*144*/ ,PROP_PAGE_DESC_NAME
-/*145*/ ,PROP_PAGE_NUMBER_OFFSET
-/*146*/ ,PROP_BREAK_TYPE
-/*147*/ ,PROP_FOOTER_IS_DYNAMIC_HEIGHT
-/*148*/ ,PROP_FOOTER_DYNAMIC_SPACING
-/*149*/ ,PROP_FOOTER_HEIGHT
-/*150*/ ,PROP_FOOTER_BODY_DISTANCE
-/*151*/ ,PROP_HEADER_IS_DYNAMIC_HEIGHT
-/*152*/ ,PROP_HEADER_DYNAMIC_SPACING
-/*153*/ ,PROP_HEADER_HEIGHT
-/*154*/ ,PROP_HEADER_BODY_DISTANCE
-/*155*/ ,PROP_WRITING_MODE
-/*156*/ ,PROP_GRID_MODE
-/*157*/ ,PROP_GRID_DISPLAY
-/*158*/ ,PROP_GRID_PRINT
-/*159*/ ,PROP_ADD_EXTERNAL_LEADING
-/*160*/ ,PROP_GRID_LINES
-/*161*/ ,PROP_GRID_BASE_HEIGHT
-/*162*/ ,PROP_GRID_RUBY_HEIGHT
-/*163*/ ,PROP_IS_ON
-/*164*/ ,PROP_RESTART_AT_EACH_PAGE
-/*165*/ ,PROP_COUNT_EMPTY_LINES
-/*166*/ ,PROP_COUNT_LINES_IN_FRAMES
-/*167*/ ,PROP_INTERVAL
-/*168*/ ,PROP_DISTANCE
-/*169*/ ,PROP_NUMBER_POSITION
-/*170*/ ,PROP_LEVEL
-/*171*/ ,PROP_LEVEL_PARAGRAPH_STYLES
-/*172*/ ,PROP_LEVEL_FORMAT
-/*173*/ ,PROP_TOKEN_TYPE
-/*174*/ ,PROP_TOKEN_HYPERLINK_START
-/*175*/ ,PROP_TOKEN_HYPERLINK_END
-/*176*/ ,PROP_TOKEN_CHAPTER_INFO
-/*177*/ ,PROP_CHAPTER_FORMAT
-/*178*/ ,PROP_TOKEN_TEXT
-/*179*/ ,PROP_TEXT
-/*180*/ ,PROP_CREATE_FROM_OUTLINE
-/*181*/ ,PROP_CREATE_FROM_MARKS
-/*182*/ ,PROP_STANDARD
-/*183*/ ,PROP_CHAR_BACK_COLOR
-/*184*/ ,PROP_CHAR_EMPHASIS
-/*185*/ ,PROP_CHAR_COMBINE_IS_ON
-/*186*/ ,PROP_CHAR_COMBINE_PREFIX
-/*187*/ ,PROP_CHAR_COMBINE_SUFFIX
-/*188*/ ,PROP_CHAR_ROTATION
-/*189*/ ,PROP_CHAR_ROTATION_IS_FIT_TO_LINE
-/*190*/ ,PROP_CHAR_FLASH
-/*191*/ ,PROP_IS_SPLIT_ALLOWED
-/*192*/ ,META_PROP_VERTICAL_BORDER
-/*193*/ ,META_PROP_HORIZONTAL_BORDER
-/*194*/ ,PROP_HEADER_ROW_COUNT
-/*195*/ ,PROP_IS_AUTO_HEIGHT
-/*196*/ ,PROP_SIZE_TYPE
-/*197*/ ,PROP_TABLE_COLUMN_SEPARATORS
-/*198*/ ,META_PROP_TABLE_STYLE_NAME
-/*199*/ ,PROP_REDLINE_AUTHOR
-/*200*/ ,PROP_REDLINE_DATE_TIME
-/*201*/ ,PROP_REDLINE_COMMENT
-/*202*/ ,PROP_REDLINE_TYPE
-/*203*/ ,PROP_REDLINE_SUCCESSOR_DATA
-/*204*/ ,PROP_REDLINE_IDENTIFIER
-/*205*/ ,PROP_SIZE_PROTECTED
-/*206*/ ,PROP_POSITION_PROTECTED
-/*207*/ ,PROP_OPAQUE
-/*208*/ ,PROP_VERTICAL_MERGE
-/*209*/ ,PROP_BULLET_CHAR
-/*210*/ ,PROP_BULLET_FONT_NAME
-/*211*/ ,PROP_PARA_BACK_COLOR
-/*212*/ ,PROP_TABS_RELATIVE_TO_INDENT
-/*213*/ ,PROP_PREFIX
-/*214*/ ,PROP_SUFFIX
-/*215*/ ,PROP_CREATE_FROM_LEVEL_PARAGRAPH_STYLES
-/*216*/ ,PROP_DROP_CAP_FORMAT
-/*217*/ , PROP_REFERENCE_FIELD_PART
-/*218*/ ,PROP_SOURCE_NAME
-/*219*/ ,PROP_REFERENCE_FIELD_SOURCE
-/*220*/ ,PROP_WIDTH_TYPE
-/*221*/ ,PROP_TEXT_RANGE
-/*222*/ ,PROP_SERVICE_CHAR_STYLE
-/*223*/ ,PROP_SERVICE_PARA_STYLE
-/*224*/ ,PROP_CHARACTER_STYLES
-/*225*/ ,PROP_PARAGRAPH_STYLES
-/*226*/ ,PROP_TABLE_BORDER_DISTANCES
-/*227*/ ,META_PROP_CELL_MAR_TOP
-/*228*/ ,META_PROP_CELL_MAR_BOTTOM
-/*229*/ ,META_PROP_CELL_MAR_LEFT
-/*230*/ ,META_PROP_CELL_MAR_RIGHT
-/*231*/ ,PROP_START_AT
-/*232*/ ,PROP_ADD_PARA_TABLE_SPACING
-/*233*/ ,PROP_CHAR_PROP_HEIGHT
-/*234*/ ,PROP_CHAR_PROP_HEIGHT_ASIAN
-/*235*/ ,PROP_CHAR_PROP_HEIGHT_COMPLEX
-/*236*/ ,PROP_FORMAT
-/*237*/ ,PROP_INSERT
-/*238*/ ,PROP_DELETE
-/*239*/ ,PROP_STREAM_NAME
-/*240*/ ,PROP_BITMAP
-/*241*/ ,PROP_IS_DATE
-/*242*/ ,PROP_TAB_STOP_DISTANCE
-/*243*/ ,PROP_CNF_STYLE
-/*244*/ ,PROP_INDENT_AT
-/*245*/ ,PROP_FIRST_LINE_INDENT
-/*246*/ ,PROP_NUMBERING_STYLE_NAME
-/*247*/ ,PROP_OUTLINE_LEVEL
-/*248*/ ,PROP_LISTTAB_STOP_POSITION
-/*249*/ ,PROP_POSITION_AND_SPACE_MODE
-/*250*/ ,PROP_HEADING_STYLE_NAME
-/*251*/ ,PROP_PARA_SPLIT
-/*252*/ ,PROP_HELP
+ ,META_PROP_CELL_MAR_BOTTOM = PROP_ID_START
+ ,META_PROP_CELL_MAR_LEFT
+ ,META_PROP_CELL_MAR_RIGHT
+ ,META_PROP_CELL_MAR_TOP
+ ,META_PROP_HORIZONTAL_BORDER
+ ,META_PROP_TABLE_STYLE_NAME
+ ,META_PROP_VERTICAL_BORDER
+ ,PROP_ADD_EXTERNAL_LEADING
+ ,PROP_ADD_PARA_TABLE_SPACING
+ ,PROP_ADJUST
+ ,PROP_ADJUST_CONTRAST
+ ,PROP_ADJUST_LUMINANCE
+ ,PROP_ALTERNATIVE_TEXT
+ ,PROP_ANCHOR_TYPE
+ ,PROP_AUTOMATIC_DISTANCE
+ ,PROP_BACK_COLOR
+ ,PROP_BITMAP
+ ,PROP_BOTTOM_BORDER
+ ,PROP_BOTTOM_BORDER_DISTANCE
+ ,PROP_BOTTOM_MARGIN
+ ,PROP_BREAK_TYPE
+ ,PROP_BULLET_CHAR
+ ,PROP_BULLET_FONT_NAME
+ ,PROP_CHAPTER_FORMAT
+ ,PROP_CHARACTER_STYLES
+ ,PROP_CHAR_AUTO_KERNING
+ ,PROP_CHAR_BACK_COLOR
+ ,PROP_CHAR_CASE_MAP
+ ,PROP_CHAR_CHAR_KERNING
+ ,PROP_CHAR_COLOR
+ ,PROP_CHAR_COMBINE_IS_ON
+ ,PROP_CHAR_COMBINE_PREFIX
+ ,PROP_CHAR_COMBINE_SUFFIX
+ ,PROP_CHAR_CONTOURED
+ ,PROP_CHAR_EMPHASIS
+ ,PROP_CHAR_ESCAPEMENT
+ ,PROP_CHAR_ESCAPEMENT_HEIGHT
+ ,PROP_CHAR_FLASH
+ ,PROP_CHAR_FONT_CHAR_SET
+ ,PROP_CHAR_FONT_CHAR_SET_ASIAN
+ ,PROP_CHAR_FONT_CHAR_SET_COMPLEX
+ ,PROP_CHAR_FONT_FAMILY
+ ,PROP_CHAR_FONT_FAMILY_ASIAN
+ ,PROP_CHAR_FONT_FAMILY_COMPLEX
+ ,PROP_CHAR_FONT_NAME
+ ,PROP_CHAR_FONT_NAME_ASIAN
+ ,PROP_CHAR_FONT_NAME_COMPLEX
+ ,PROP_CHAR_FONT_PITCH
+ ,PROP_CHAR_FONT_PITCH_ASIAN
+ ,PROP_CHAR_FONT_PITCH_COMPLEX
+ ,PROP_CHAR_FONT_STYLE
+ ,PROP_CHAR_FONT_STYLE_ASIAN
+ ,PROP_CHAR_FONT_STYLE_COMPLEX
+ ,PROP_CHAR_HEIGHT
+ ,PROP_CHAR_HEIGHT_ASIAN
+ ,PROP_CHAR_HEIGHT_COMPLEX
+ ,PROP_CHAR_HIDDEN
+ ,PROP_CHAR_LOCALE
+ ,PROP_CHAR_LOCALE_ASIAN
+ ,PROP_CHAR_LOCALE_COMPLEX
+ ,PROP_CHAR_POSTURE
+ ,PROP_CHAR_POSTURE_ASIAN
+ ,PROP_CHAR_POSTURE_COMPLEX
+ ,PROP_CHAR_PROP_HEIGHT
+ ,PROP_CHAR_PROP_HEIGHT_ASIAN
+ ,PROP_CHAR_PROP_HEIGHT_COMPLEX
+ ,PROP_CHAR_RELIEF
+ ,PROP_CHAR_ROTATION
+ ,PROP_CHAR_ROTATION_IS_FIT_TO_LINE
+ ,PROP_CHAR_SCALE_WIDTH
+ ,PROP_CHAR_SHADOWED
+ ,PROP_CHAR_STRIKEOUT
+ ,PROP_CHAR_STYLE_NAME
+ ,PROP_CHAR_UNDERLINE
+ ,PROP_CHAR_UNDERLINE_COLOR
+ ,PROP_CHAR_UNDERLINE_HAS_COLOR
+ ,PROP_CHAR_WEIGHT
+ ,PROP_CHAR_WEIGHT_ASIAN
+ ,PROP_CHAR_WEIGHT_COMPLEX
+ ,PROP_CHAR_WORD_MODE
+ ,PROP_CNF_STYLE
+ ,PROP_CONTENT
+ ,PROP_CONTOUR_OUTSIDE
+ ,PROP_CONTOUR_POLY_POLYGON
+ ,PROP_COUNT_EMPTY_LINES
+ ,PROP_COUNT_LINES_IN_FRAMES
+ ,PROP_CREATE_FROM_LEVEL_PARAGRAPH_STYLES
+ ,PROP_CREATE_FROM_MARKS
+ ,PROP_CREATE_FROM_OUTLINE
+ ,PROP_CURRENT_PRESENTATION
+ ,PROP_DATA_COLUMN_NAME
+ ,PROP_DEFAULT
+ ,PROP_DELETE
+ ,PROP_DESCRIPTION
+ ,PROP_DISTANCE
+ ,PROP_DROP_CAP_FORMAT
+ ,PROP_FILE_FORMAT
+ ,PROP_FIRST_LINE_INDENT
+ ,PROP_FIRST_LINE_OFFSET
+ ,PROP_FIRST_PAGE
+ ,PROP_FOOTER_BODY_DISTANCE
+ ,PROP_FOOTER_DYNAMIC_SPACING
+ ,PROP_FOOTER_HEIGHT
+ ,PROP_FOOTER_IS_DYNAMIC_HEIGHT
+ ,PROP_FOOTER_IS_ON
+ ,PROP_FOOTER_IS_SHARED
+ ,PROP_FOOTER_TEXT
+ ,PROP_FOOTER_TEXT_LEFT
+ ,PROP_FORMAT
+ ,PROP_FULL_NAME
+ ,PROP_GAMMA
+ ,PROP_GRAPHIC
+ ,PROP_GRAPHIC_COLOR_MODE
+ ,PROP_GRAPHIC_CROP
+ ,PROP_GRID_BASE_HEIGHT
+ ,PROP_GRID_DISPLAY
+ ,PROP_GRID_LINES
+ ,PROP_GRID_MODE
+ ,PROP_GRID_PRINT
+ ,PROP_GRID_RUBY_HEIGHT
+ ,PROP_HEADER_BODY_DISTANCE
+ ,PROP_HEADER_DYNAMIC_SPACING
+ ,PROP_HEADER_HEIGHT
+ ,PROP_HEADER_IS_DYNAMIC_HEIGHT
+ ,PROP_HEADER_IS_ON
+ ,PROP_HEADER_IS_SHARED
+ ,PROP_HEADER_ROW_COUNT
+ ,PROP_HEADER_TEXT
+ ,PROP_HEADER_TEXT_LEFT
+ ,PROP_HEADING_STYLE_NAME
+ ,PROP_HEIGHT
+ ,PROP_HELP
+ ,PROP_HINT
+ ,PROP_HORI_MIRRORED_ON_EVEN_PAGES
+ ,PROP_HORI_MIRRORED_ON_ODD_PAGES
+ ,PROP_HORI_ORIENT
+ ,PROP_HORI_ORIENT_POSITION
+ ,PROP_HORI_ORIENT_RELATION
+ ,PROP_HYPER_LINK_U_R_L
+ ,PROP_INDENT_AT
+ ,PROP_INPUT_STREAM
+ ,PROP_INSERT
+ ,PROP_INTERVAL
+ ,PROP_IS_AUTO_HEIGHT
+ ,PROP_IS_DATE
+ ,PROP_IS_FIXED
+ ,PROP_IS_INPUT
+ ,PROP_IS_LANDSCAPE
+ ,PROP_IS_ON
+ ,PROP_IS_SPLIT_ALLOWED
+ ,PROP_KEYWORDS
+ ,PROP_LEFT_BORDER
+ ,PROP_LEFT_BORDER_DISTANCE
+ ,PROP_LEFT_MARGIN
+ ,PROP_LEVEL
+ ,PROP_LEVEL_FORMAT
+ ,PROP_LEVEL_PARAGRAPH_STYLES
+ ,PROP_LISTTAB_STOP_POSITION
+ ,PROP_MACRO_NAME
+ ,PROP_NAME
+ ,PROP_NUMBERING_LEVEL
+ ,PROP_NUMBERING_RULES
+ ,PROP_NUMBERING_STYLE_NAME
+ ,PROP_NUMBERING_TYPE
+ ,PROP_NUMBER_FORMAT
+ ,PROP_NUMBER_POSITION
+ ,PROP_OPAQUE
+ ,PROP_OUTLINE_LEVEL
+ ,PROP_PAGE_DESC_NAME
+ ,PROP_PAGE_NUMBER_OFFSET
+ ,PROP_PAGE_TOGGLE
+ ,PROP_PARAGRAPH_STYLES
+ ,PROP_PARA_ADJUST
+ ,PROP_PARA_BACK_COLOR
+ ,PROP_PARA_BOTTOM_MARGIN
+ ,PROP_PARA_FIRST_LINE_INDENT
+ ,PROP_PARA_IS_HANGING_PUNCTUATION
+ ,PROP_PARA_IS_HYPHENATION
+ ,PROP_PARA_KEEP_TOGETHER
+ ,PROP_PARA_LAST_LINE_ADJUST
+ ,PROP_PARA_LEFT_MARGIN
+ ,PROP_PARA_LINE_NUMBER_COUNT
+ ,PROP_PARA_LINE_NUMBER_START_VALUE
+ ,PROP_PARA_LINE_SPACING
+ ,PROP_PARA_ORPHANS
+ ,PROP_PARA_RIGHT_MARGIN
+ ,PROP_PARA_SPLIT
+ ,PROP_PARA_STYLE_NAME
+ ,PROP_PARA_TAB_STOPS
+ ,PROP_PARA_TOP_MARGIN
+ ,PROP_PARA_WIDOWS
+ ,PROP_PARENT_NUMBERING
+ ,PROP_POSITION_AND_SPACE_MODE
+ ,PROP_POSITION_PROTECTED
+ ,PROP_PREFIX
+ ,PROP_PRINTER_PAPER_TRAY_INDEX
+ ,PROP_REDLINE_AUTHOR
+ ,PROP_REDLINE_COMMENT
+ ,PROP_REDLINE_DATE_TIME
+ ,PROP_REDLINE_IDENTIFIER
+ ,PROP_REDLINE_SUCCESSOR_DATA
+ ,PROP_REDLINE_TYPE
+ ,PROP_REFERENCE_FIELD_PART
+ ,PROP_REFERENCE_FIELD_SOURCE
+ ,PROP_RESTART_AT_EACH_PAGE
+ ,PROP_RIGHT_BORDER
+ ,PROP_RIGHT_BORDER_DISTANCE
+ ,PROP_RIGHT_MARGIN
+ ,PROP_SEPARATOR_LINE_IS_ON
+ ,PROP_SERVICE_CHAR_STYLE
+ ,PROP_SERVICE_PARA_STYLE
+ ,PROP_SIZE
+ ,PROP_SIZE100th_M_M
+ ,PROP_SIZE_PIXEL
+ ,PROP_SIZE_PROTECTED
+ ,PROP_SIZE_TYPE
+ ,PROP_SOURCE_NAME
+ ,PROP_STANDARD
+ ,PROP_START_AT
+ ,PROP_START_WITH
+ ,PROP_STREAM_NAME
+ ,PROP_SUBJECT
+ ,PROP_SUB_TYPE
+ ,PROP_SUFFIX
+ ,PROP_SURROUND
+ ,PROP_SURROUND_CONTOUR
+ ,PROP_TABLE_BORDER
+ ,PROP_TABLE_BORDER_DISTANCES
+ ,PROP_TABLE_COLUMN_SEPARATORS
+ ,PROP_TABS_RELATIVE_TO_INDENT
+ ,PROP_TAB_STOP_DISTANCE
+ ,PROP_TEXT
+ ,PROP_TEXT_COLUMNS
+ ,PROP_TEXT_RANGE
+ ,PROP_TITLE
+ ,PROP_TOKEN_CHAPTER_INFO
+ ,PROP_TOKEN_HYPERLINK_END
+ ,PROP_TOKEN_HYPERLINK_START
+ ,PROP_TOKEN_TEXT
+ ,PROP_TOKEN_TYPE
+ ,PROP_TOP_BORDER
+ ,PROP_TOP_BORDER_DISTANCE
+ ,PROP_TOP_MARGIN
+ ,PROP_USER_DATA_TYPE
+ ,PROP_VERTICAL_MERGE
+ ,PROP_VERT_MIRRORED
+ ,PROP_VERT_ORIENT
+ ,PROP_VERT_ORIENT_POSITION
+ ,PROP_VERT_ORIENT_RELATION
+ ,PROP_WIDTH
+ ,PROP_WIDTH_TYPE
+ ,PROP_WRITING_MODE
/*253*/ ,PROP_FRM_DIRECTION
-};
+ };
struct PropertyNameSupplier_Impl;
class PropertyNameSupplier
{
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index ea3de1404bb7..c12daa676ca5 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -111,9 +111,42 @@ uno::Sequence< beans::PropertyValue > PropertyMap::GetPropertyValues()
return m_aValues;
}
+void lcl_AnyToTag(XMLTag::Pointer_t pTag, const uno::Any & rAny)
+{
+ try {
+ sal_Int32 aInt = 0;
+ rAny >>= aInt;
+ pTag->addAttr("value", aInt);
+
+ sal_uInt32 auInt = 0;
+ rAny >>= auInt;
+ pTag->addAttr("unsignedValue", auInt);
+
+ float aFloat = 0.0f;
+ rAny >>= aFloat;
+ pTag->addAttr("floatValue", aFloat);
+
+ ::rtl::OUString aStr;
+ rAny >>= aStr;
+ pTag->addAttr("stringValue", aStr);
+ }
+ catch (...) {
+ }
+}
void PropertyMap::Insert( PropertyIds eId, bool bIsTextProperty, const uno::Any& rAny, bool bOverwrite )
{
+#ifdef DEBUG_DMAPPER_PROPERTY_MAP
+ const ::rtl::OUString& rInsert = PropertyNameSupplier::
+ GetPropertyNameSupplier().GetName(eId);
+
+ XMLTag::Pointer_t pTag(new XMLTag("propertyMap.insert"));
+ pTag->addAttr("name", rInsert);
+ lcl_AnyToTag(pTag, rAny);
+
+ dmapper_logger->addTag(pTag);
+#endif
+
PropertyMap::iterator aElement = find(PropertyDefinition( eId, bIsTextProperty ) );
if( aElement != end())
{
@@ -148,15 +181,15 @@ void PropertyMap::dumpXml( const TagLogger::Pointer_t pLogger ) const
default:
{
try {
- sal_Int32 aInt;
+ sal_Int32 aInt = 0;
aMapIter->second >>= aInt;
pLogger->attribute("value", aInt);
- sal_uInt32 auInt;
+ sal_uInt32 auInt = 0;
aMapIter->second >>= auInt;
pLogger->attribute("unsignedValue", auInt);
- float aFloat;
+ float aFloat = 0.0;
aMapIter->second >>= aFloat;
pLogger->attribute("floatValue", aFloat);
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index 6b50230c0a15..b0224d2c6edd 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -38,9 +38,7 @@
#include <map>
#include <vector>
-#ifdef DEBUG_DOMAINMAPPER
#include <resourcemodel/TagLogger.hxx>
-#endif
namespace com{namespace sun{namespace star{
namespace beans{
diff --git a/writerfilter/source/dmapper/SectionColumnHandler.cxx b/writerfilter/source/dmapper/SectionColumnHandler.cxx
index fd2f5ea676b8..e507c859aea9 100644
--- a/writerfilter/source/dmapper/SectionColumnHandler.cxx
+++ b/writerfilter/source/dmapper/SectionColumnHandler.cxx
@@ -31,6 +31,8 @@
#include <ConversionHelper.hxx>
#include <ooxml/resourceids.hxx>
+#include "dmapperLoggers.hxx"
+
namespace writerfilter {
namespace dmapper {
@@ -38,10 +40,11 @@ using namespace ::com::sun::star;
SectionColumnHandler::SectionColumnHandler() :
- bEqualWidth( false ),
- nSpace( 0 ),
- nNum( 0 ),
- bSep( false )
+LoggedProperties(dmapper_logger, "SectionColumnHandler"),
+bEqualWidth( false ),
+nSpace( 0 ),
+nNum( 0 ),
+bSep( false )
{
}
@@ -49,7 +52,7 @@ SectionColumnHandler::~SectionColumnHandler()
{
}
-void SectionColumnHandler::attribute(Id rName, Value & rVal)
+void SectionColumnHandler::lcl_attribute(Id rName, Value & rVal)
{
sal_Int32 nIntValue = rVal.getInt();
switch( rName )
@@ -78,7 +81,7 @@ void SectionColumnHandler::attribute(Id rName, Value & rVal)
}
}
-void SectionColumnHandler::sprm(Sprm & rSprm)
+void SectionColumnHandler::lcl_sprm(Sprm & rSprm)
{
switch( rSprm.getId())
{
diff --git a/writerfilter/source/dmapper/SectionColumnHandler.hxx b/writerfilter/source/dmapper/SectionColumnHandler.hxx
index bdeebd61d96c..3a420c74526f 100644
--- a/writerfilter/source/dmapper/SectionColumnHandler.hxx
+++ b/writerfilter/source/dmapper/SectionColumnHandler.hxx
@@ -29,7 +29,7 @@
#define INCLUDED_SECTIONCOLUMNHANDLER_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
@@ -45,7 +45,7 @@ struct _Column
};
-class WRITERFILTER_DLLPRIVATE SectionColumnHandler : public Properties
+class WRITERFILTER_DLLPRIVATE SectionColumnHandler : public LoggedProperties
{
bool bEqualWidth;
sal_Int32 nSpace;
@@ -55,14 +55,14 @@ class WRITERFILTER_DLLPRIVATE SectionColumnHandler : public Properties
_Column aTempColumn;
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
SectionColumnHandler();
virtual ~SectionColumnHandler();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
bool IsEqualWidth() const { return bEqualWidth; }
sal_Int32 GetSpace() const { return nSpace; }
sal_Int32 GetNum() const { return nNum; }
diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx
index 057e47e812b6..10a4e2568229 100644
--- a/writerfilter/source/dmapper/SettingsTable.cxx
+++ b/writerfilter/source/dmapper/SettingsTable.cxx
@@ -26,20 +26,17 @@
*
************************************************************************/
+#include <stdio.h>
+#include <rtl/ustring.hxx>
#include <resourcemodel/ResourceModelHelper.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
-
#include <SettingsTable.hxx>
+#include <resourcemodel/ResourceModelHelper.hxx>
#include <doctok/resourceids.hxx>
#include <ooxml/resourceids.hxx>
-#include <stdio.h>
#include <ConversionHelper.hxx>
-#include <rtl/ustring.hxx>
-#ifdef DEBUG_DOMAINMAPPER
-#include <resourcemodel/QNameToString.hxx>
#include "dmapperLoggers.hxx"
-#endif
namespace writerfilter {
@@ -95,10 +92,13 @@ struct SettingsTable_Impl
, m_nCryptAlgorithmType(NS_ooxml::LN_Value_wordprocessingml_ST_AlgType_typeAny)
, m_nCryptSpinCount(0)
{}
+
};
-SettingsTable::SettingsTable(DomainMapper& rDMapper, const uno::Reference< lang::XMultiServiceFactory > xTextFactory) :
-m_pImpl( new SettingsTable_Impl(rDMapper, xTextFactory) )
+SettingsTable::SettingsTable(DomainMapper& rDMapper, const uno::Reference< lang::XMultiServiceFactory > xTextFactory)
+: LoggedProperties(dmapper_logger, "SettingsTable")
+, LoggedTable(dmapper_logger, "SettingsTable")
+, m_pImpl( new SettingsTable_Impl(rDMapper, xTextFactory) )
{
}
@@ -108,14 +108,8 @@ SettingsTable::~SettingsTable()
delete m_pImpl;
}
-void SettingsTable::attribute(Id nName, Value & val)
+void SettingsTable::lcl_attribute(Id nName, Value & val)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("SettingsTable.attribute");
- dmapper_logger->attribute("name", (*QNameToString::Instance())(nName));
- dmapper_logger->attribute("value", val.toString());
-#endif
-
(void) nName;
int nIntValue = val.getInt();
(void)nIntValue;
@@ -133,18 +127,10 @@ void SettingsTable::attribute(Id nName, Value & val)
}
}
#endif
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
-void SettingsTable::sprm(Sprm& rSprm)
+void SettingsTable::lcl_sprm(Sprm& rSprm)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("SettingsTable.sprm");
- dmapper_logger->chars(rSprm.toString());
-#endif
-
sal_uInt32 nSprmId = rSprm.getId();
Value::Pointer_t pValue = rSprm.getValue();
@@ -211,16 +197,14 @@ void SettingsTable::sprm(Sprm& rSprm)
break;
default:
{
- OSL_ENSURE( false, "unknown sprmid in SettingsTable::sprm()");
+#ifdef DEBUG_DMAPPER_SETTINGS_TABLE
+ dmapper_logger->element("unhandled");
+#endif
}
}
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
-void SettingsTable::entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
+void SettingsTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
{
ref->resolve(*this);
}
diff --git a/writerfilter/source/dmapper/SettingsTable.hxx b/writerfilter/source/dmapper/SettingsTable.hxx
index a0037eda0f4c..2b50d5112ee1 100644
--- a/writerfilter/source/dmapper/SettingsTable.hxx
+++ b/writerfilter/source/dmapper/SettingsTable.hxx
@@ -30,7 +30,7 @@
#define INCLUDED_SETTINGSTABLE_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <map>
@@ -51,7 +51,7 @@ using namespace std;
struct SettingsTable_Impl;
-class WRITERFILTER_DLLPRIVATE SettingsTable : public Properties, public Table
+class WRITERFILTER_DLLPRIVATE SettingsTable : public LoggedProperties, public LoggedTable
{
SettingsTable_Impl *m_pImpl;
@@ -61,18 +61,19 @@ class WRITERFILTER_DLLPRIVATE SettingsTable : public Properties, public Table
);
virtual ~SettingsTable();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
- // Table
- virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
-
//returns default TabStop in 1/100th mm
int GetDefaultTabStop() const;
void ApplyProperties( uno::Reference< text::XTextDocument > xDoc );
+ private:
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
+ // Table
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+
};
typedef boost::shared_ptr< SettingsTable > SettingsTablePtr;
}}
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index a2ed63cac524..e803388ac1d6 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -49,10 +49,7 @@
#include <stdio.h>
#include <rtl/ustrbuf.hxx>
-#ifdef DEBUG_DOMAINMAPPER
#include <dmapperLoggers.hxx>
-#include <resourcemodel/QNameToString.hxx>
-#endif
using namespace ::com::sun::star;
namespace writerfilter {
@@ -83,32 +80,11 @@ StyleSheetEntry::~StyleSheetEntry()
{
}
-#ifdef DEBUG_DOMAINMAPPER
-void StyleSheetEntry::dumpXml( const TagLogger::Pointer_t pLogger )
-{
- pLogger->startElement("StyleSheetEntry");
-
- pLogger->attribute("identifierI", sStyleIdentifierI);
- pLogger->attribute("identifierD", sStyleIdentifierD);
- pLogger->attribute("default", bIsDefaultStyle ? "true" : "false");
- pLogger->attribute("invalidHeight", bInvalidHeight ? "true" : "false");
- pLogger->attribute("hasUPE", bHasUPE ? "true" : "false");
- pLogger->attribute("styleType", nStyleTypeCode);
- pLogger->attribute("baseStyle", sBaseStyleIdentifier);
- pLogger->attribute("nextStyle", sNextStyleIdentifier);
- pLogger->attribute("styleName", sStyleName);
- pLogger->attribute("styleName1", sStyleName1);
- pLogger->attribute("convertedName", sConvertedStyleName);
- pProperties->dumpXml( pLogger );
-
- pLogger->endElement();
-}
-#endif
-
TableStyleSheetEntry::TableStyleSheetEntry( StyleSheetEntry& rEntry, StyleSheetTable* pStyles ):
StyleSheetEntry( ),
m_pStyleSheet( pStyles )
{
+
bIsDefaultStyle = rEntry.bIsDefaultStyle;
bInvalidHeight = rEntry.bInvalidHeight;
bHasUPE = rEntry.bHasUPE;
@@ -129,13 +105,6 @@ TableStyleSheetEntry::~TableStyleSheetEntry( )
void TableStyleSheetEntry::AddTblStylePr( TblStyleType nType, PropertyMapPtr pProps )
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("AddTblStylePr");
- dmapper_logger->attribute("type", nType);
- pProps->dumpXml(dmapper_logger);
- dmapper_logger->endElement();
-#endif
-
static const TblStyleType pTypesToFix[] =
{
TBL_STYLE_FIRSTROW,
@@ -181,7 +150,7 @@ void TableStyleSheetEntry::AddTblStylePr( TblStyleType nType, PropertyMapPtr pPr
m_aStyles[nType] = pProps;
}
-PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask )
+PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask, StyleSheetEntryDequePtr pStack )
{
PropertyMapPtr pProps( new PropertyMap );
@@ -190,8 +159,20 @@ PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask )
if ( pEntry.get( ) )
{
+ if (pStack.get() == NULL)
+ pStack.reset(new StyleSheetEntryDeque());
+
+ StyleSheetEntryDeque::const_iterator aIt = find(pStack->begin(), pStack->end(), pEntry);
+
+ if (aIt != pStack->end())
+ {
+ pStack->push_back(pEntry);
+
TableStyleSheetEntry* pParent = static_cast<TableStyleSheetEntry *>( pEntry.get( ) );
- pProps->insert( pParent->GetProperties( nMask ) );
+ pProps->insert( pParent->GetProperties( nMask ), pStack );
+
+ pStack->pop_back();
+ }
}
// And finally get the mask ones
@@ -200,41 +181,6 @@ PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask )
return pProps;
}
-#ifdef DEBUG_DOMAINMAPPER
-void TableStyleSheetEntry::dumpXml( const TagLogger::Pointer_t pLogger )
-{
-
- pLogger->startElement("StyleSheetEntry");
-
- pLogger->attribute("identifierI", sStyleIdentifierI);
- pLogger->attribute("identifierD", sStyleIdentifierD);
- pLogger->attribute("default", bIsDefaultStyle ? "true" : "false");
- pLogger->attribute("invalidHeight", bInvalidHeight ? "true" : "false");
- pLogger->attribute("hasUPE", bHasUPE ? "true" : "false");
- pLogger->attribute("styleType", nStyleTypeCode);
- pLogger->attribute("baseStyle", sBaseStyleIdentifier);
- pLogger->attribute("nextStyle", sNextStyleIdentifier);
- pLogger->attribute("styleName", sStyleName);
- pLogger->attribute("styleName1", sStyleName1);
- pLogger->attribute("convertedName", sConvertedStyleName);
- pProperties->dumpXml( pLogger );
-
- for (sal_Int32 nBit = 0; nBit < 13; ++nBit)
- {
- pLogger->startElement("properties");
-
- PropertyMapPtr pMap = GetProperties(1 << nBit);
-
- pMap->dumpXml( pLogger );
- pLogger->attribute("kind", nBit);
-
- pLogger->endElement();
- }
-
- pLogger->endElement();
-}
-#endif
-
void lcl_mergeProps( PropertyMapPtr pToFill, PropertyMapPtr pToAdd, TblStyleType nStyleId )
{
static const PropertyIds pPropsToCheck[] =
@@ -410,8 +356,10 @@ StyleSheetTable_Impl::StyleSheetTable_Impl(DomainMapper& rDMapper, uno::Referenc
}
-StyleSheetTable::StyleSheetTable(DomainMapper& rDMapper, uno::Reference< text::XTextDocument> xTextDocument) :
- m_pImpl( new StyleSheetTable_Impl(rDMapper, xTextDocument) )
+StyleSheetTable::StyleSheetTable(DomainMapper& rDMapper, uno::Reference< text::XTextDocument> xTextDocument)
+: LoggedProperties(dmapper_logger, "StyleSheetTable")
+, LoggedTable(dmapper_logger, "StyleSheetTable")
+, m_pImpl( new StyleSheetTable_Impl(rDMapper, xTextDocument) )
{
}
@@ -422,14 +370,8 @@ StyleSheetTable::~StyleSheetTable()
}
-void StyleSheetTable::attribute(Id Name, Value & val)
+void StyleSheetTable::lcl_attribute(Id Name, Value & val)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("StyleSheetTable.attribute");
- dmapper_logger->attribute("name", (*QNameToString::Instance())(Name));
- dmapper_logger->attribute("value", val.toString());
-#endif
-
OSL_ENSURE( m_pImpl->m_pCurrentEntry, "current entry has to be set here");
if(!m_pImpl->m_pCurrentEntry)
return ;
@@ -522,20 +464,11 @@ void StyleSheetTable::attribute(Id Name, Value & val)
}
break;
}
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
-void StyleSheetTable::sprm(Sprm & rSprm)
+void StyleSheetTable::lcl_sprm(Sprm & rSprm)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("StyleSheetTable.sprm");
- dmapper_logger->attribute("sprm", rSprm.toString());
-#endif
-
sal_uInt32 nSprmId = rSprm.getId();
Value::Pointer_t pValue = rSprm.getValue();
sal_Int32 nIntValue = pValue.get() ? pValue->getInt() : 0;
@@ -602,6 +535,7 @@ void StyleSheetTable::sprm(Sprm & rSprm)
}
case NS_ooxml::LN_CT_DocDefaults_pPrDefault:
case NS_ooxml::LN_CT_PPrDefault_pPr:
+ case NS_ooxml::LN_CT_DocDefaults_pPrDefault:
m_pImpl->m_rDMapper.PushStyleSheetProperties( m_pImpl->m_pDefaultParaProps );
resourcemodel::resolveSprmProps( m_pImpl->m_rDMapper, rSprm );
m_pImpl->m_rDMapper.PopStyleSheetProperties();
@@ -609,6 +543,7 @@ void StyleSheetTable::sprm(Sprm & rSprm)
break;
case NS_ooxml::LN_CT_DocDefaults_rPrDefault:
case NS_ooxml::LN_CT_RPrDefault_rPr:
+ case NS_ooxml::LN_CT_DocDefaults_rPrDefault:
m_pImpl->m_rDMapper.PushStyleSheetProperties( m_pImpl->m_pDefaultCharProps );
resourcemodel::resolveSprmProps( m_pImpl->m_rDMapper, rSprm );
m_pImpl->m_rDMapper.PopStyleSheetProperties();
@@ -645,6 +580,7 @@ void StyleSheetTable::sprm(Sprm & rSprm)
pTEntry->m_nColBandSize = nIntValue;
}
}
+ break;
case NS_ooxml::LN_CT_TblPrBase_tblCellMar:
//no cell margins in styles
break;
@@ -664,7 +600,7 @@ void StyleSheetTable::sprm(Sprm & rSprm)
m_pImpl->m_rDMapper.PushStyleSheetProperties( m_pImpl->m_pCurrentEntry->pProperties );
PropertyMapPtr pProps(new PropertyMap());
- m_pImpl->m_rDMapper.sprm( rSprm, pProps );
+ m_pImpl->m_rDMapper.sprmWithProps( rSprm, pProps );
m_pImpl->m_pCurrentEntry->pProperties->insert(pProps);
@@ -672,20 +608,12 @@ void StyleSheetTable::sprm(Sprm & rSprm)
}
}
break;
- }
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
+}
}
-void StyleSheetTable::entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
+void StyleSheetTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("StyleSheetTable.entry");
-#endif
-
//create a new style entry
OSL_ENSURE( !m_pImpl->m_pCurrentEntry, "current entry has to be NULL here");
StyleSheetEntryPtr pNewEntry( new StyleSheetEntry );
@@ -704,16 +632,8 @@ void StyleSheetTable::entry(int /*pos*/, writerfilter::Reference<Properties>::Po
//TODO: this entry contains the default settings - they have to be added to the settings
}
-#ifdef DEBUG_DOMAINMAPPER
- m_pImpl->m_pCurrentEntry->dumpXml( dmapper_logger );
-#endif
-
StyleSheetEntryPtr pEmptyEntry;
m_pImpl->m_pCurrentEntry = pEmptyEntry;
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
/*-- 21.06.2006 15:34:49---------------------------------------------------
sorting helper
@@ -772,10 +692,6 @@ uno::Sequence< ::rtl::OUString > PropValVector::getNames()
void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("applyStyleSheets");
-#endif
-
try
{
uno::Reference< style::XStyleFamiliesSupplier > xStylesSupplier( m_pImpl->m_xTextDocument, uno::UNO_QUERY_THROW );
@@ -934,24 +850,13 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
PropValVector aSortedPropVals;
for( sal_Int32 nProp = 0; nProp < aPropValues.getLength(); ++nProp)
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->startElement("propvalue");
- dmapper_logger->attribute("name", aPropValues[nProp].Name);
- dmapper_logger->attribute("value", aPropValues[nProp].Value);
-#endif
// Don't add the style name properties
bool bIsParaStyleName = aPropValues[nProp].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ParaStyleName" ) );
bool bIsCharStyleName = aPropValues[nProp].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CharStyleName" ) );
if ( !bIsParaStyleName && !bIsCharStyleName )
{
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->element("insert");
-#endif
aSortedPropVals.Insert( aPropValues[nProp] );
}
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
if(bAddFollowStyle)
{
@@ -1002,12 +907,6 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
if(bInsert)
{
xStyles->insertByName( sConvertedStyleName, uno::makeAny( xStyle) );
-#ifdef DEBUG_DOMAINMAPPER
- uno::Reference<beans::XPropertySet> xProps(xStyle, uno::UNO_QUERY);
- dmapper_logger->startElement("insertStyle");
- dmapper_logger->unoPropertySet(xProps);
- dmapper_logger->endElement();
-#endif
}
}
++aIt;
@@ -1019,10 +918,6 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
(void)rEx;
OSL_ENSURE( false, "Styles could not be imported completely");
}
-
-#ifdef DEBUG_DOMAINMAPPER
- dmapper_logger->endElement();
-#endif
}
diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx b/writerfilter/source/dmapper/StyleSheetTable.hxx
index 47b211c1356c..8f3811b5066a 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.hxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.hxx
@@ -35,11 +35,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <PropertyMap.hxx>
#include <FontTable.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
-
-#ifdef DEBUG_DOMAINMAPPER
-#include <resourcemodel/TagLogger.hxx>
-#endif
+#include <resourcemodel/LoggedResources.hxx>
namespace com{ namespace sun { namespace star { namespace text{
class XTextDocument;
@@ -77,20 +73,18 @@ public:
PropertyMapPtr pProperties;
::rtl::OUString sConvertedStyleName;
-#ifdef DEBUG_DOMAINMAPPER
- virtual void dumpXml( const TagLogger::Pointer_t pLogger );
-#endif
-
StyleSheetEntry();
virtual ~StyleSheetEntry();
};
typedef boost::shared_ptr<StyleSheetEntry> StyleSheetEntryPtr;
+typedef ::std::deque<StyleSheetEntryPtr> StyleSheetEntryDeque;
+typedef boost::shared_ptr<StyleSheetEntryDeque> StyleSheetEntryDequePtr;
class DomainMapper;
class StyleSheetTable :
- public Properties,
- public Table
+ public LoggedProperties,
+ public LoggedTable
{
StyleSheetTable_Impl *m_pImpl;
@@ -99,13 +93,6 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument> xTextDocument );
virtual ~StyleSheetTable();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
- // Table
- virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
-
void ApplyStyleSheets( FontTablePtr rFontTable );
const StyleSheetEntryPtr FindStyleSheetByISTD(const ::rtl::OUString& sIndex);
const StyleSheetEntryPtr FindStyleSheetByStyleName(const ::rtl::OUString& rIndex);
@@ -119,6 +106,13 @@ public:
::rtl::OUString getOrCreateCharStyle( PropertyValueVector_t& rCharProperties );
private:
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
+ // Table
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
+
void resolveAttributeProperties(Value & val);
void resolveSprmProps(Sprm & sprm_);
void applyDefaults(bool bParaProperties);
@@ -147,11 +141,10 @@ public:
// Gets all the properties
// + corresponding to the mask,
// + from the parent styles
- PropertyMapPtr GetProperties( sal_Int32 nMask );
-
-#ifdef DEBUG_DOMAINMAPPER
- virtual void dumpXml( const TagLogger::Pointer_t pLogger );
-#endif
+ //
+ // @param mask mask describing which properties to return
+ // @param pStack already processed StyleSheetEntries
+ PropertyMapPtr GetProperties( sal_Int32 nMask, StyleSheetEntryDequePtr pStack = StyleSheetEntryDequePtr());
TableStyleSheetEntry( StyleSheetEntry& aEntry, StyleSheetTable* pStyles );
virtual ~TableStyleSheetEntry( );
diff --git a/writerfilter/source/dmapper/TDefTableHandler.cxx b/writerfilter/source/dmapper/TDefTableHandler.cxx
index ba00a9ef9212..45e2b17a8817 100644
--- a/writerfilter/source/dmapper/TDefTableHandler.cxx
+++ b/writerfilter/source/dmapper/TDefTableHandler.cxx
@@ -34,6 +34,8 @@
#include <com/sun/star/text/TableColumnSeparator.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
+#include "dmapperLoggers.hxx"
+
namespace writerfilter {
namespace dmapper {
@@ -42,11 +44,12 @@ using namespace ::com::sun::star;
TDefTableHandler::TDefTableHandler(bool bOOXML) :
- m_nLineWidth(0),
- m_nLineType(0),
- m_nLineColor(0),
- m_nLineDistance(0),
- m_bOOXML( bOOXML )
+LoggedProperties(dmapper_logger, "TDefTableHandler"),
+m_nLineWidth(0),
+m_nLineType(0),
+m_nLineColor(0),
+m_nLineDistance(0),
+m_bOOXML( bOOXML )
{
}
@@ -56,7 +59,7 @@ TDefTableHandler::~TDefTableHandler()
}
-void TDefTableHandler::attribute(Id rName, Value & rVal)
+void TDefTableHandler::lcl_attribute(Id rName, Value & rVal)
{
sal_Int32 nIntValue = rVal.getInt();
(void)nIntValue;
@@ -176,7 +179,7 @@ void TDefTableHandler::localResolve(Id rName, writerfilter::Reference<Properties
}
-void TDefTableHandler::sprm(Sprm & rSprm)
+void TDefTableHandler::lcl_sprm(Sprm & rSprm)
{
switch( rSprm.getId() )
{
diff --git a/writerfilter/source/dmapper/TDefTableHandler.hxx b/writerfilter/source/dmapper/TDefTableHandler.hxx
index 3776af84150e..8bbf07993fc3 100644
--- a/writerfilter/source/dmapper/TDefTableHandler.hxx
+++ b/writerfilter/source/dmapper/TDefTableHandler.hxx
@@ -29,7 +29,7 @@
#define INCLUDED_TDEFTABLEHANDLER_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
#include <vector>
namespace com{ namespace sun{ namespace star{namespace table {
@@ -41,7 +41,7 @@ namespace dmapper
{
class PropertyMap;
class TablePropertyMap;
-class WRITERFILTER_DLLPRIVATE TDefTableHandler : public Properties
+class WRITERFILTER_DLLPRIVATE TDefTableHandler : public LoggedProperties
{
public:
@@ -67,14 +67,15 @@ private:
bool m_bOOXML;
void localResolve(Id Name, writerfilter::Reference<Properties>::Pointer_t pProperties);
+
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
TDefTableHandler( bool bOOXML );
virtual ~TDefTableHandler();
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
size_t getCellCount() const;
void fillCellProperties( size_t nCell, ::boost::shared_ptr< TablePropertyMap > pCellProperties) const;
::boost::shared_ptr<PropertyMap> getRowProperties() const;
diff --git a/writerfilter/source/dmapper/TblStylePrHandler.cxx b/writerfilter/source/dmapper/TblStylePrHandler.cxx
index a3ac89b6a258..cf8bda4a85cc 100644
--- a/writerfilter/source/dmapper/TblStylePrHandler.cxx
+++ b/writerfilter/source/dmapper/TblStylePrHandler.cxx
@@ -5,14 +5,17 @@
#include <dmapperLoggers.hxx>
#include <resourcemodel/QNameToString.hxx>
+#include "dmapperLoggers.hxx"
+
namespace writerfilter {
namespace dmapper {
TblStylePrHandler::TblStylePrHandler( DomainMapper & rDMapper ) :
- m_rDMapper( rDMapper ),
- m_pTablePropsHandler( new TablePropertiesHandler( true ) ),
- m_nType( TBL_STYLE_UNKNOWN ),
- m_pProperties( new PropertyMap )
+LoggedProperties(dmapper_logger, "TblStylePrHandler"),
+m_rDMapper( rDMapper ),
+m_pTablePropsHandler( new TablePropertiesHandler( true ) ),
+m_nType( TBL_STYLE_UNKNOWN ),
+m_pProperties( new PropertyMap )
{
}
@@ -21,7 +24,7 @@ TblStylePrHandler::~TblStylePrHandler( )
delete m_pTablePropsHandler, m_pTablePropsHandler = NULL;
}
-void TblStylePrHandler::attribute(Id rName, Value & rVal)
+void TblStylePrHandler::lcl_attribute(Id rName, Value & rVal)
{
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("TblStylePrHandler.attribute");
@@ -42,7 +45,7 @@ void TblStylePrHandler::attribute(Id rName, Value & rVal)
}
}
-void TblStylePrHandler::sprm(Sprm & rSprm)
+void TblStylePrHandler::lcl_sprm(Sprm & rSprm)
{
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("TblStylePrHandler.sprm");
diff --git a/writerfilter/source/dmapper/TblStylePrHandler.hxx b/writerfilter/source/dmapper/TblStylePrHandler.hxx
index b9442f62862b..b665aeb4be29 100644
--- a/writerfilter/source/dmapper/TblStylePrHandler.hxx
+++ b/writerfilter/source/dmapper/TblStylePrHandler.hxx
@@ -6,7 +6,7 @@
#include <dmapper/DomainMapper.hxx>
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
namespace writerfilter {
@@ -33,7 +33,7 @@ enum TblStyleType
TBL_STYLE_SWCELL
};
-class WRITERFILTER_DLLPRIVATE TblStylePrHandler : public Properties
+class WRITERFILTER_DLLPRIVATE TblStylePrHandler : public LoggedProperties
{
private:
DomainMapper & m_rDMapper;
@@ -42,14 +42,14 @@ private:
TblStyleType m_nType;
PropertyMapPtr m_pProperties;
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
public:
TblStylePrHandler( DomainMapper & rDMapper );
virtual ~TblStylePrHandler( );
- // Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
-
inline PropertyMapPtr getProperties() { return m_pProperties; };
inline TblStyleType getType() { return m_nType; };
diff --git a/writerfilter/source/dmapper/ThemeTable.cxx b/writerfilter/source/dmapper/ThemeTable.cxx
index 9138b8a12830..aca4672a1d5e 100644
--- a/writerfilter/source/dmapper/ThemeTable.cxx
+++ b/writerfilter/source/dmapper/ThemeTable.cxx
@@ -31,11 +31,7 @@
#include <doctok/resourceids.hxx>
#include <ooxml/resourceids.hxx>
#endif
-#include <stdio.h>
-#ifdef DEBUG_DOMAINMAPPER
#include "dmapperLoggers.hxx"
-#include <resourcemodel/QNameToString.hxx>
-#endif
namespace writerfilter {
namespace dmapper
@@ -51,8 +47,10 @@ struct ThemeTable_Impl
std::map<sal_uInt32, ::rtl::OUString> m_currentFontThemeEntry;
};
-ThemeTable::ThemeTable() :
- m_pImpl( new ThemeTable_Impl )
+ThemeTable::ThemeTable()
+: LoggedProperties(dmapper_logger, "ThemeTable")
+, LoggedTable(dmapper_logger, "ThemeTable")
+, m_pImpl( new ThemeTable_Impl )
{
}
@@ -62,7 +60,7 @@ ThemeTable::~ThemeTable()
delete m_pImpl;
}
-void ThemeTable::attribute(Id Name, Value & val)
+void ThemeTable::lcl_attribute(Id Name, Value & val)
{
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("ThemeTable.attribute");
@@ -88,7 +86,7 @@ void ThemeTable::attribute(Id Name, Value & val)
#endif
}
-void ThemeTable::sprm(Sprm& rSprm)
+void ThemeTable::lcl_sprm(Sprm& rSprm)
{
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("ThemeTable.sprm");
@@ -144,7 +142,7 @@ void ThemeTable::sprm(Sprm& rSprm)
#endif
}
-void ThemeTable::entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
+void ThemeTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
{
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("ThemeTable.entry");
diff --git a/writerfilter/source/dmapper/ThemeTable.hxx b/writerfilter/source/dmapper/ThemeTable.hxx
index f604c61e8289..0bd7bd9d584e 100644
--- a/writerfilter/source/dmapper/ThemeTable.hxx
+++ b/writerfilter/source/dmapper/ThemeTable.hxx
@@ -30,7 +30,7 @@
#define INCLUDED_THEMETABLE_HXX
#include <WriterFilterDllApi.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/LoggedResources.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <map>
@@ -40,7 +40,7 @@ namespace dmapper
struct ThemeTable_Impl;
-class WRITERFILTER_DLLPRIVATE ThemeTable : public Properties, public Table
+class WRITERFILTER_DLLPRIVATE ThemeTable : public LoggedProperties, public LoggedTable
{
ThemeTable_Impl *m_pImpl;
@@ -48,14 +48,15 @@ public:
ThemeTable();
virtual ~ThemeTable();
+ const ::rtl::OUString getFontNameForTheme(const Id id) const;
+
+ private:
// Properties
- virtual void attribute(Id Name, Value & val);
- virtual void sprm(Sprm & sprm);
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
// Table
- virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
-
- const ::rtl::OUString getFontNameForTheme(const Id id) const;
+ virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
};
typedef boost::shared_ptr< ThemeTable > ThemeTablePtr;
}}
diff --git a/writerfilter/source/dmapper/WrapPolygonHandler.cxx b/writerfilter/source/dmapper/WrapPolygonHandler.cxx
new file mode 100644
index 000000000000..2aabc1a375a9
--- /dev/null
+++ b/writerfilter/source/dmapper/WrapPolygonHandler.cxx
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * 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/drawing/PointSequence.hpp>
+
+#include <ooxml/resourceids.hxx>
+#include <resourcemodel/ResourceModelHelper.hxx>
+
+#include "ConversionHelper.hxx"
+#include "WrapPolygonHandler.hxx"
+#include "dmapperLoggers.hxx"
+
+namespace writerfilter {
+
+using resourcemodel::resolveSprmProps;
+
+namespace dmapper {
+
+WrapPolygon::WrapPolygon()
+{
+}
+
+WrapPolygon::~WrapPolygon()
+{
+}
+
+void WrapPolygon::addPoint(const awt::Point & rPoint)
+{
+ mPoints.push_back(rPoint);
+}
+
+WrapPolygon::Points_t::const_iterator WrapPolygon::begin() const
+{
+ return mPoints.begin();
+}
+
+WrapPolygon::Points_t::const_iterator WrapPolygon::end() const
+{
+ return mPoints.end();
+}
+
+WrapPolygon::Points_t::iterator WrapPolygon::begin()
+{
+ return mPoints.begin();
+}
+
+WrapPolygon::Points_t::iterator WrapPolygon::end()
+{
+ return mPoints.end();
+}
+
+size_t WrapPolygon::size() const
+{
+ return mPoints.size();
+}
+
+WrapPolygon::Pointer_t WrapPolygon::move(const awt::Point & rPoint)
+{
+ WrapPolygon::Pointer_t pResult(new WrapPolygon);
+
+ Points_t::iterator aIt = begin();
+ Points_t::iterator aItEnd = end();
+
+ while (aIt != aItEnd)
+ {
+ awt::Point aPoint(aIt->X + rPoint.X, aIt->Y + rPoint.Y);
+ pResult->addPoint(aPoint);
+ aIt++;
+ }
+
+ return pResult;
+}
+
+WrapPolygon::Pointer_t WrapPolygon::scale(const Fraction & rFractionX, const Fraction & rFractionY)
+{
+ WrapPolygon::Pointer_t pResult(new WrapPolygon);
+
+ Points_t::iterator aIt = begin();
+ Points_t::iterator aItEnd = end();
+
+ while (aIt != aItEnd)
+ {
+ awt::Point aPoint(Fraction(aIt->X) * rFractionX, Fraction(aIt->Y) * rFractionY);
+ pResult->addPoint(aPoint);
+ aIt++;
+ }
+
+ return pResult;
+}
+
+WrapPolygon::Pointer_t WrapPolygon::correctWordWrapPolygon(const awt::Size & rSrcSize, const awt::Size & rDstSize)
+{
+ WrapPolygon::Pointer_t pResult;
+
+ const sal_uInt32 nWrap100Percent = 21600;
+
+ Fraction aMove(nWrap100Percent, rSrcSize.Width);
+ aMove = aMove * Fraction(15, 1);
+ awt::Point aMovePoint(aMove, 0);
+ pResult = move(aMovePoint);
+
+ Fraction aScaleX(nWrap100Percent, Fraction(nWrap100Percent) + aMove);
+ Fraction aScaleY(nWrap100Percent, Fraction(nWrap100Percent) - aMove);
+ pResult = pResult->scale(aScaleX, aScaleY);
+
+ Fraction aScaleDestX(rDstSize.Width, nWrap100Percent);
+ Fraction aScaleDestY(rDstSize.Height, nWrap100Percent);
+ pResult = pResult->scale(aScaleDestX, aScaleDestY);
+
+ return pResult;
+}
+
+drawing::PointSequenceSequence WrapPolygon::getPointSequenceSequence() const
+{
+ drawing::PointSequenceSequence aPolyPolygon(1L);
+ drawing::PointSequence * pPolygon = aPolyPolygon.getArray();
+ pPolygon->realloc(size());
+
+ sal_uInt32 n = 0;
+ Points_t::const_iterator aIt = begin();
+ Points_t::const_iterator aItEnd = end();
+
+ while (aIt != aItEnd)
+ {
+ (*pPolygon)[n] = *aIt;
+ ++n;
+ aIt++;
+ }
+
+ return aPolyPolygon;
+}
+
+WrapPolygonHandler::WrapPolygonHandler()
+: LoggedProperties(dmapper_logger, "WrapPolygonHandler")
+, mpPolygon(new WrapPolygon)
+{
+}
+
+WrapPolygonHandler::~WrapPolygonHandler()
+{
+}
+
+void WrapPolygonHandler::lcl_attribute(Id Name, Value & val)
+{
+ sal_Int32 nIntValue = val.getInt();
+
+ switch(Name)
+ {
+ case NS_ooxml::LN_CT_Point2D_x:
+ /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
+ mnX = nIntValue;
+ break;
+ case NS_ooxml::LN_CT_Point2D_y:
+ /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
+ mnY = nIntValue;
+ break;
+ default:
+#ifdef DEBUG_WRAP_POLYGON_HANDLER
+ dmapper_logger->element("unhandled");
+#endif
+ break;
+ }
+}
+
+void WrapPolygonHandler::lcl_sprm(Sprm & _sprm)
+{
+ switch (_sprm.getId())
+ {
+ case NS_ooxml::LN_CT_WrapPath_lineTo:
+ case NS_ooxml::LN_CT_WrapPath_start:
+ /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
+ {
+ resolveSprmProps(*this, _sprm);
+
+ awt::Point aPoint(mnX, mnY);
+ mpPolygon->addPoint(aPoint);
+ }
+ break;
+ default:
+#ifdef DEBUG_WRAP_POLYGON_HANDLER
+ dmapper_logger->element("unhandled");
+#endif
+ break;
+ }
+}
+
+WrapPolygon::Pointer_t WrapPolygonHandler::getPolygon()
+{
+ return mpPolygon;
+}
+
+}}
diff --git a/writerfilter/source/dmapper/WrapPolygonHandler.hxx b/writerfilter/source/dmapper/WrapPolygonHandler.hxx
new file mode 100644
index 000000000000..05161096f81a
--- /dev/null
+++ b/writerfilter/source/dmapper/WrapPolygonHandler.hxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * 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 WRAP_POLYGON_HANDLER_HXX
+#define WRAP_POLYGON_HANDLER_HXX
+
+#include <com/sun/star/drawing/PointSequenceSequence.hpp>
+#include <resourcemodel/LoggedResources.hxx>
+#include <resourcemodel/Fraction.hxx>
+
+namespace writerfilter {
+namespace dmapper {
+
+using namespace ::com::sun::star;
+using resourcemodel::Fraction;
+
+class WrapPolygon
+{
+public:
+ typedef ::std::deque<awt::Point> Points_t;
+ typedef ::boost::shared_ptr<WrapPolygon> Pointer_t;
+
+private:
+ Points_t mPoints;
+
+public:
+ WrapPolygon();
+ virtual ~WrapPolygon();
+
+ void addPoint(const awt::Point & rPoint);
+
+ Points_t::const_iterator begin() const;
+ Points_t::const_iterator end() const;
+ Points_t::iterator begin();
+ Points_t::iterator end();
+
+ size_t size() const;
+
+ WrapPolygon::Pointer_t move(const awt::Point & rMove);
+ WrapPolygon::Pointer_t scale(const Fraction & rFractionX, const Fraction & rFractionY);
+ WrapPolygon::Pointer_t correctWordWrapPolygon(const awt::Size & rSrcSize, const awt::Size & rDstSize);
+ drawing::PointSequenceSequence getPointSequenceSequence() const;
+};
+
+class WrapPolygonHandler : public LoggedProperties
+{
+public:
+ WrapPolygonHandler();
+ virtual ~WrapPolygonHandler();
+
+ WrapPolygon::Pointer_t getPolygon();
+
+private:
+ WrapPolygon::Pointer_t mpPolygon;
+
+ sal_uInt32 mnX;
+ sal_uInt32 mnY;
+
+ // Properties
+ virtual void lcl_attribute(Id Name, Value & val);
+ virtual void lcl_sprm(Sprm & sprm);
+
+};
+
+}}
+
+#endif // WRAP_POLYGON_HANDLER_HXX
diff --git a/writerfilter/source/dmapper/dmapperLoggers.hxx b/writerfilter/source/dmapper/dmapperLoggers.hxx
index ea34e6a7cd7f..752705d50d17 100644
--- a/writerfilter/source/dmapper/dmapperLoggers.hxx
+++ b/writerfilter/source/dmapper/dmapperLoggers.hxx
@@ -37,6 +37,7 @@ namespace writerfilter {
extern TagLogger::Pointer_t dmapper_logger;
}
}
+
#endif // DEBUG
#endif // INCLUDED_DMAPPER_LOGGERS_HXX
diff --git a/writerfilter/source/dmapper/makefile.mk b/writerfilter/source/dmapper/makefile.mk
index 300dfb31d959..a4b000411b4e 100644
--- a/writerfilter/source/dmapper/makefile.mk
+++ b/writerfilter/source/dmapper/makefile.mk
@@ -48,13 +48,13 @@ SLOFILES= \
$(SLO)$/DomainMapperTableManager.obj \
$(SLO)$/DomainMapper_Impl.obj \
$(SLO)$/FFDataHandler.obj \
- $(SLO)$/FormControlHelper.obj \
$(SLO)$/FontTable.obj \
+ $(SLO)$/FormControlHelper.obj \
$(SLO)$/GraphicHelpers.obj \
$(SLO)$/GraphicImport.obj \
- $(SLO)$/NumberingManager.obj \
$(SLO)$/MeasureHandler.obj \
$(SLO)$/ModelEventListener.obj \
+ $(SLO)$/NumberingManager.obj \
$(SLO)$/OLEHandler.obj \
$(SLO)$/PageBordersHandler.obj \
$(SLO)$/PropertyIds.obj \
@@ -66,7 +66,9 @@ SLOFILES= \
$(SLO)$/TDefTableHandler.obj \
$(SLO)$/TablePropertiesHandler.obj \
$(SLO)$/TblStylePrHandler.obj \
- $(SLO)$/ThemeTable.obj
+ $(SLO)$/ThemeTable.obj \
+ $(SLO)$/WrapPolygonHandler.obj \
+
# --- Targets ----------------------------------
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx
index 4eac9ed72279..33c460964e11 100644
--- a/writerfilter/source/filter/ImportFilter.cxx
+++ b/writerfilter/source/filter/ImportFilter.cxx
@@ -76,8 +76,7 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes
try
{
// use the oox.core.FilterDetect implementation to extract the decrypted ZIP package
- uno::Reference< lang::XMultiServiceFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_QUERY_THROW );
- ::oox::core::FilterDetect aDetector( xFactory );
+ ::oox::core::FilterDetect aDetector( m_xContext );
xInputStream = aDetector.extractUnencryptedPackage( aMediaDesc );
}
catch( uno::Exception& )
@@ -89,7 +88,7 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes
return sal_False;
}
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_IMPORT
OUString sURL = aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_URL(), OUString() );
::std::string sURLc = OUStringToOString(sURL, RTL_TEXTENCODING_ASCII_US).getStr();
@@ -154,8 +153,8 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes
}
pStream.reset();
+#ifdef DEBUG_IMPORT
-#ifdef DEBUG_ELEMENT
dmapperLogger->endDocument();
debugLogger->endDocument();
#endif
diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx
index fabc34f0ba26..0fe5d4b0bf3d 100644
--- a/writerfilter/source/filter/WriterFilter.cxx
+++ b/writerfilter/source/filter/WriterFilter.cxx
@@ -65,11 +65,6 @@ void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvType
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo( ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry )
-{
- return ::cppu::component_writeInfoHelper( xMgr, xRegistry, s_component_entries );
-}
-
void * SAL_CALL component_getFactory(sal_Char const * implName, ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry )
{
return ::cppu::component_getFactoryHelper(implName, xMgr, xRegistry, s_component_entries );
diff --git a/writerfilter/source/filter/WriterFilterDetection.cxx b/writerfilter/source/filter/WriterFilterDetection.cxx
index 6fae09584d2a..994ac218f221 100644
--- a/writerfilter/source/filter/WriterFilterDetection.cxx
+++ b/writerfilter/source/filter/WriterFilterDetection.cxx
@@ -91,7 +91,7 @@ OUString WriterFilterDetection::detect( uno::Sequence< beans::PropertyValue >& r
if ( pStream && SotStorage::IsStorageFile(pStream) )
{
- SotStorageRef xStg = new SotStorage( pStream, FALSE );
+ SotStorageRef xStg = new SotStorage( pStream, sal_False );
bool bTable2 = xStg->IsContained( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1Table")));
SotStorageStreamRef xRef =
diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx b/writerfilter/source/ooxml/OOXMLFactory.cxx
index be29cf5bc39a..0dc29db2f0de 100644
--- a/writerfilter/source/ooxml/OOXMLFactory.cxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.cxx
@@ -132,8 +132,8 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
if (pFactory.get() != NULL)
{
-#ifdef DEBUG_ATTRIBUTES
- debug_logger->startElement("attributes");
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.attributes");
debug_logger->attribute("define", pFactory->getDefineName(nDefine));
char sBuffer[256];
snprintf(sBuffer, sizeof(sBuffer), "%08" SAL_PRIxUINT32, nDefine);
@@ -149,8 +149,8 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
for (aIt = pMap->begin(); aIt != aEndIt; ++aIt)
{
Id nId = (*pTokenToIdMap)[aIt->first];
-#ifdef DEBUG_ATTRIBUTES
- debug_logger->startElement("attribute");
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.attribute");
debug_logger->attribute("name", fastTokenToId(aIt->first));
debug_logger->attribute("tokenid", (*QNameToString::Instance())(nId));
snprintf(sBuffer, sizeof(sBuffer), "%08" SAL_PRIxUINT32, nId);
@@ -162,7 +162,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
{
case RT_Boolean:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("boolean");
#endif
::rtl::OUString aValue(Attribs->getValue(aIt->first));
@@ -174,7 +174,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break;
case RT_String:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("string");
#endif
::rtl::OUString aValue(Attribs->getValue(aIt->first));
@@ -187,7 +187,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break;
case RT_Integer:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("integer");
#endif
::rtl::OUString aValue(Attribs->getValue(aIt->first));
@@ -200,7 +200,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break;
case RT_Hex:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("hex");
#endif
::rtl::OUString aValue(Attribs->getValue(aIt->first));
@@ -213,7 +213,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
break;
case RT_List:
{
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->startElement("list");
#endif
ListValueMapPointer pListValueMap =
@@ -224,7 +224,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
::rtl::OUString aValue(Attribs->getValue(aIt->first));
sal_uInt32 nValue = (*pListValueMap)[aValue];
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->attribute("value", aValue);
debug_logger->attribute("value-num", nValue);
#endif
@@ -235,24 +235,24 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * pHandler,
OOXMLValue::Pointer_t pValue(new OOXMLIntegerValue(nValue));
pFactory->attributeAction(pHandler, aIt->first, pValue);
}
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->endElement();
#endif
}
break;
default:
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->element("unknown-attribute-type");
#endif
break;
}
}
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->endElement();
#endif
}
-#ifdef DEBUG_ATTRIBUTES
+#ifdef DEBUG_FACTORY
debug_logger->endElement();
#endif
}
@@ -262,6 +262,11 @@ uno::Reference< xml::sax::XFastContextHandler>
OOXMLFactory::createFastChildContext(OOXMLFastContextHandler * pHandler,
Token_t Element)
{
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.createFastChildContext");
+ debug_logger->attribute("token", fastTokenToId(Element));
+#endif
+
Id nDefine = pHandler->getDefine();
OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine);
@@ -272,12 +277,21 @@ OOXMLFactory::createFastChildContext(OOXMLFastContextHandler * pHandler,
if ((Element & 0xffff) < OOXML_FAST_TOKENS_END)
ret = createFastChildContextFromFactory(pHandler, pFactory, Element);
+#ifdef DEBUG_FACTORY
+ debug_logger->endElement("factory.createFastChildContext");
+#endif
+
return ret;
}
void OOXMLFactory::characters(OOXMLFastContextHandler * pHandler,
const ::rtl::OUString & rString)
{
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.characters");
+ debug_logger->chars(rString);
+#endif
+
Id nDefine = pHandler->getDefine();
OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine);
@@ -285,6 +299,10 @@ void OOXMLFactory::characters(OOXMLFastContextHandler * pHandler,
{
pFactory->charactersAction(pHandler, rString);
}
+
+#ifdef DEBUG_FACTORY
+ debug_logger->endElement("factory.characters");
+#endif
}
void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler, Token_t /*nToken*/)
@@ -295,7 +313,7 @@ void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler, Token_t /*nTo
if (pFactory.get() != NULL)
{
#ifdef DEBUG_ELEMENT
- debug_logger->startElement("factory-startAction");
+ debug_logger->startElement("factory.startAction");
#endif
pFactory->startAction(pHandler);
#ifdef DEBUG_ELEMENT
@@ -312,7 +330,7 @@ void OOXMLFactory::endAction(OOXMLFastContextHandler * pHandler, Token_t /*nToke
if (pFactory.get() != NULL)
{
#ifdef DEBUG_ELEMENT
- debug_logger->startElement("factory-endAction");
+ debug_logger->startElement("factory.endAction");
#endif
pFactory->endAction(pHandler);
#ifdef DEBUG_ELEMENT
@@ -337,6 +355,13 @@ void OOXMLFactory_ns::attributeAction(OOXMLFastContextHandler *, Token_t, OOXMLV
{
}
+#ifdef DEBUG_FACTORY
+string OOXMLFactory_ns::getName() const
+{
+ return "noname";
+}
+#endif
+
}
}
diff --git a/writerfilter/source/ooxml/OOXMLFactory.hxx b/writerfilter/source/ooxml/OOXMLFactory.hxx
index f4510474c807..03d1a14b3fcf 100644
--- a/writerfilter/source/ooxml/OOXMLFactory.hxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.hxx
@@ -109,6 +109,9 @@ public:
virtual void endAction(OOXMLFastContextHandler * pHandler);
virtual void attributeAction(OOXMLFastContextHandler * pHandler, Token_t nToken, OOXMLValue::Pointer_t pValue);
virtual string getDefineName(Id nId) const;
+#ifdef DEBUG_FACTORY
+ virtual string getName() const;
+#endif
AttributeToResourceMapPointer getAttributeToResourceMap(Id nId);
ListValueMapPointer getListValueMap(Id nId);
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 868f6359e7cb..df6c7deb063b 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -32,6 +32,7 @@
#include <rtl/uuid.h>
#include <com/sun/star/drawing/XShapes.hpp>
#include <resourcemodel/QNameToString.hxx>
+#include <resourcemodel/XPathLogger.hxx>
#include <resourcemodel/util.hxx>
#include <ooxml/resourceids.hxx>
#include <doctok/sprmids.hxx>
@@ -183,52 +184,23 @@ OOXMLFastContextHandler::~OOXMLFastContextHandler()
aSetContexts.erase(this);
}
-#ifdef DEBUG_MEMORY
-void SAL_CALL OOXMLFastContextHandler::acquire()
- throw ()
-{
- mnRefCount++;
-
- static char buffer[256];
- snprintf(buffer, sizeof(buffer), "%ld: %s: aquire(%ld)", mnInstanceNumber,
- getType().c_str(), mnRefCount);
- logger("MEMORY", buffer);
-
- cppu::WeakImplHelper1<com::sun::star::xml::sax::XFastContextHandler>::acquire();
-}
-
-void SAL_CALL OOXMLFastContextHandler::release()
- throw ()
-{
- static char buffer[256];
- snprintf(buffer, sizeof(buffer), "%s: release(%ld)",
- getType().c_str(), mnRefCount);
- logger("MEMORY", buffer);
-
- cppu::WeakImplHelper1<com::sun::star::xml::sax::XFastContextHandler>::release();
- mnRefCount--;
-}
-#endif
-
// ::com::sun::star::xml::sax::XFastContextHandler:
void SAL_CALL OOXMLFastContextHandler::startFastElement
(Token_t Element,
const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
throw (uno::RuntimeException, xml::sax::SAXException)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("element");
- debug_logger->attribute("token", fastTokenToId(Element));
- debug_logger->attribute("type",getType());
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.element");
+ string sToken = fastTokenToId(Element);
+ mpParserState->getXPathLogger().startElement(sToken);
+ debug_logger->attribute("token", sToken);
+ debug_logger->attribute("type", getType());
+ debug_logger->attribute("xpath", mpParserState->getXPathLogger().getXPath());
debug_logger->startElement("at-start");
dumpXml( debug_logger );
debug_logger->endElement();
#endif
-#ifdef DEBUG_MEMORY
- static char buffer[256];
- snprintf(buffer, sizeof(buffer), "%ld: startFastElement", mnInstanceNumber);
- logger("MEMORY", buffer);
-#endif
attributes(Attribs);
lcl_startFastElement(Element, Attribs);
}
@@ -238,10 +210,11 @@ void SAL_CALL OOXMLFastContextHandler::startUnknownElement
const uno::Reference< xml::sax::XFastAttributeList > & /*Attribs*/)
throw (uno::RuntimeException, xml::sax::SAXException)
{
-#ifdef DEBUG_CONTEXT_STACK
- debug_logger->startElement("unknown-element");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.unknown-element");
debug_logger->attribute("namespace", Namespace);
debug_logger->attribute("name", Name);
+ mpParserState->getXPathLogger().startElement("unknown");
#else
(void) Namespace;
(void) Name;
@@ -251,19 +224,19 @@ throw (uno::RuntimeException, xml::sax::SAXException)
void SAL_CALL OOXMLFastContextHandler::endFastElement(Token_t Element)
throw (uno::RuntimeException, xml::sax::SAXException)
{
+#ifdef DEBUG_CONTEXT_HANDLER
+ string sToken = fastTokenToId(Element);
+ (void) sToken;
+#endif
+
lcl_endFastElement(Element);
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_CONTEXT_HANDLER
debug_logger->startElement("at-end");
dumpXml( debug_logger );
debug_logger->endElement();
debug_logger->endElement();
-#endif
-#ifdef DEBUG_MEMORY
- static char buffer[256];
- snprintf(buffer, sizeof(buffer), "%ld: %s:endFastElement", mnInstanceNumber,
- getType().c_str());
- logger("MEMORY", buffer);
+ mpParserState->getXPathLogger().endElement();
#endif
}
@@ -279,14 +252,6 @@ void OOXMLFastContextHandler::lcl_endFastElement
(Token_t Element)
throw (uno::RuntimeException, xml::sax::SAXException)
{
-#ifdef DEBUG_CONTEXT_STACK
- debug_logger->startElement("endAction");
- debug_logger->endElement();
- debug_logger->startElement("token");
- debug_logger->chars(fastTokenToId(Element));
- debug_logger->endElement();
-#endif
-
OOXMLFactory::getInstance()->endAction(this, Element);
}
@@ -294,9 +259,9 @@ void SAL_CALL OOXMLFastContextHandler::endUnknownElement
(const ::rtl::OUString & , const ::rtl::OUString & )
throw (uno::RuntimeException, xml::sax::SAXException)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("unknown-element");
- debug_logger->endElement();
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->endElement("contexthandler.unknown-element");
+ mpParserState->getXPathLogger().endElement();
#endif
}
@@ -306,8 +271,8 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
throw (uno::RuntimeException, xml::sax::SAXException)
{
-#ifdef DEBUG_CONTEXT_STACK
- debug_logger->startElement("createFastChildContext");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.createFastChildContext");
debug_logger->attribute("token", fastTokenToId(Element));
debug_logger->attribute("type", getType());
#endif
@@ -315,7 +280,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
uno::Reference< xml::sax::XFastContextHandler > xResult
(lcl_createFastChildContext(Element, Attribs));
-#ifdef DEBUG_CONTEXT_STACK
+#ifdef DEBUG_CONTEXT_HANDLER
debug_logger->endElement();
#endif
@@ -338,8 +303,8 @@ OOXMLFastContextHandler::createUnknownChildContext
const uno::Reference< xml::sax::XFastAttributeList > & /*Attribs*/)
throw (uno::RuntimeException, xml::sax::SAXException)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("createUnknownChildContext");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.createUnknownChildContext");
debug_logger->attribute("namespace", Namespace);
debug_logger->attribute("name", Name);
debug_logger->endElement();
@@ -405,11 +370,11 @@ void OOXMLFastContextHandler::attributes
void OOXMLFastContextHandler::startAction(Token_t Element)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("startAction");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.startAction");
#endif
lcl_startAction(Element);
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_CONTEXT_HANDLER
debug_logger->endElement();
#endif
}
@@ -421,11 +386,11 @@ void OOXMLFastContextHandler::lcl_startAction(Token_t Element)
void OOXMLFastContextHandler::endAction(Token_t Element)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("endAction");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.endAction");
#endif
lcl_endAction(Element);
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_CONTEXT_HANDLER
debug_logger->endElement();
#endif
}
@@ -473,14 +438,14 @@ string OOXMLFastContextHandler::getResourceString() const
void OOXMLFastContextHandler::setId(Id rId)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("setId");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.setId");
static char sBuffer[256];
snprintf(sBuffer, sizeof(sBuffer), "%" SAL_PRIuUINT32, rId);
debug_logger->attribute("id", sBuffer);
- debug_logger->chars((*QNameToString::Instance())(rId));
+ debug_logger->attribute("name", (*QNameToString::Instance())(rId));
debug_logger->endElement();
#endif
@@ -511,7 +476,7 @@ void OOXMLFastContextHandler::setToken(Token_t nToken)
{
mnToken = nToken;
-#ifdef DEBUG_CONTEXT_STACK
+#ifdef DEBUG_CONTEXT_HANDLER
msTokenString = fastTokenToId(mnToken);
#endif
}
@@ -527,11 +492,6 @@ void OOXMLFastContextHandler::mark(const Id & rId, OOXMLValue::Pointer_t pVal)
OOXMLPropertyImpl::Pointer_t pProperty
(new OOXMLPropertyImpl(rId, pVal, OOXMLPropertyImpl::ATTRIBUTE));
-#ifdef DEBUG_PROPERTIES
- debug_logger->startElement("mark");
- debug_logger->chars(xmlify(pProperty->toString()));
- debug_logger->endElement();
-#endif
pPropSet->add(pProperty);
mpStream->props(pPropSet);
}
@@ -551,8 +511,8 @@ OOXMLPropertySet * OOXMLFastContextHandler::getPicturePropSet
void OOXMLFastContextHandler::sendTableDepth() const
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("sendTableDepth");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendTableDepth");
#endif
if (mnTableDepth > 0)
@@ -573,14 +533,9 @@ void OOXMLFastContextHandler::sendTableDepth() const
pProps->add(pProp);
}
-#ifdef DEBUG_PROPERTIES
- debug_logger->startElement("props");
- debug_logger->chars(pProps->toString());
- debug_logger->endElement();
-#endif
mpStream->props(writerfilter::Reference<Properties>::Pointer_t(pProps));
}
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_CONTEXT_HANDLER
debug_logger->endElement();
#endif
}
@@ -593,6 +548,10 @@ void OOXMLFastContextHandler::setHandle()
void OOXMLFastContextHandler::startCharacterGroup()
{
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.startCharacterGroup");
+#endif
+
if (isForwardEvents())
{
if (mpParserState->isInCharacterGroup())
@@ -603,10 +562,6 @@ void OOXMLFastContextHandler::startCharacterGroup()
if (! mpParserState->isInCharacterGroup())
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("startCharacterGroup");
-#endif
-
mpStream->startCharacterGroup();
mpParserState->setInCharacterGroup(true);
mpParserState->resolveCharacterProperties(*mpStream);
@@ -616,12 +571,12 @@ void OOXMLFastContextHandler::startCharacterGroup()
void OOXMLFastContextHandler::endCharacterGroup()
{
- if (isForwardEvents() && mpParserState->isInCharacterGroup())
- {
-#ifdef DEBUG_ELEMENT
- debug_logger->element("endCharacterGroup");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.endCharacterGroup");
#endif
+ if (isForwardEvents() && mpParserState->isInCharacterGroup())
+ {
mpStream->endCharacterGroup();
mpParserState->setInCharacterGroup(false);
}
@@ -629,6 +584,10 @@ void OOXMLFastContextHandler::endCharacterGroup()
void OOXMLFastContextHandler::startParagraphGroup()
{
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.startParagraphGroup");
+#endif
+
if (isForwardEvents())
{
if (mpParserState->isInParagraphGroup())
@@ -639,10 +598,6 @@ void OOXMLFastContextHandler::startParagraphGroup()
if (! mpParserState->isInParagraphGroup())
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("startParagraphGroup");
-#endif
-
mpStream->startParagraphGroup();
mpParserState->setInParagraphGroup(true);
}
@@ -651,6 +606,10 @@ void OOXMLFastContextHandler::startParagraphGroup()
void OOXMLFastContextHandler::endParagraphGroup()
{
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.endParagraphGroup");
+#endif
+
if (isForwardEvents())
{
if (mpParserState->isInCharacterGroup())
@@ -658,9 +617,6 @@ void OOXMLFastContextHandler::endParagraphGroup()
if (mpParserState->isInParagraphGroup())
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("endParagraphGroup");
-#endif
mpStream->endParagraphGroup();
mpParserState->setInParagraphGroup(false);
}
@@ -669,6 +625,10 @@ void OOXMLFastContextHandler::endParagraphGroup()
void OOXMLFastContextHandler::startSectionGroup()
{
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.startSectionGroup");
+#endif
+
if (isForwardEvents())
{
if (mpParserState->isInSectionGroup())
@@ -676,9 +636,6 @@ void OOXMLFastContextHandler::startSectionGroup()
if (! mpParserState->isInSectionGroup())
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("startSectionGroup");
-#endif
mpStream->info(mpParserState->getHandle());
mpStream->startSectionGroup();
mpParserState->setInSectionGroup(true);
@@ -688,6 +645,10 @@ void OOXMLFastContextHandler::startSectionGroup()
void OOXMLFastContextHandler::endSectionGroup()
{
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.endSectionGroup");
+#endif
+
if (isForwardEvents())
{
if (mpParserState->isInParagraphGroup())
@@ -695,9 +656,6 @@ void OOXMLFastContextHandler::endSectionGroup()
if (mpParserState->isInSectionGroup())
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("endSectionGroup");
-#endif
mpStream->endSectionGroup();
mpParserState->setInSectionGroup(false);
}
@@ -706,10 +664,6 @@ void OOXMLFastContextHandler::endSectionGroup()
void OOXMLFastContextHandler::setLastParagraphInSection()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("setLastParagraphInSection");
-#endif
-
mpParserState->setLastParagraphInSection(true);
mpStream->markLastParagraphInSection( );
}
@@ -731,8 +685,8 @@ OOXMLPropertySet::Pointer_t OOXMLFastContextHandler::getPropertySet() const
void OOXMLFastContextHandler::startField()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("startField");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.startField");
#endif
startCharacterGroup();
if (isForwardEvents())
@@ -742,8 +696,8 @@ void OOXMLFastContextHandler::startField()
void OOXMLFastContextHandler::fieldSeparator()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("fieldSeparator");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.fieldSeparator");
#endif
startCharacterGroup();
if (isForwardEvents())
@@ -753,8 +707,8 @@ void OOXMLFastContextHandler::fieldSeparator()
void OOXMLFastContextHandler::endField()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("endField");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.endField");
#endif
startCharacterGroup();
if (isForwardEvents())
@@ -764,8 +718,8 @@ void OOXMLFastContextHandler::endField()
void OOXMLFastContextHandler::ftnednref()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("ftnednref");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.ftnednref");
#endif
if (isForwardEvents())
mpStream->utext(sFtnEdnRef, 1);
@@ -773,8 +727,8 @@ void OOXMLFastContextHandler::ftnednref()
void OOXMLFastContextHandler::ftnednsep()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("ftnednsep");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.ftnednsep");
#endif
if (isForwardEvents())
mpStream->utext(sFtnEdnSep, 1);
@@ -782,8 +736,8 @@ void OOXMLFastContextHandler::ftnednsep()
void OOXMLFastContextHandler::ftnedncont()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("ftnedncont");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.ftnedncont");
#endif
if (isForwardEvents())
mpStream->text(sFtnEdnCont, 1);
@@ -791,8 +745,8 @@ void OOXMLFastContextHandler::ftnedncont()
void OOXMLFastContextHandler::pgNum()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("pgNum");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.pgNum");
#endif
if (isForwardEvents())
mpStream->utext((const sal_uInt8*)sPgNum, 1);
@@ -800,8 +754,8 @@ void OOXMLFastContextHandler::pgNum()
void OOXMLFastContextHandler::tab()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("tab");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.tab");
#endif
if (isForwardEvents())
mpStream->utext((const sal_uInt8*)sTab, 1);
@@ -809,8 +763,8 @@ void OOXMLFastContextHandler::tab()
void OOXMLFastContextHandler::cr()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("cr");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.cr");
#endif
if (isForwardEvents())
mpStream->utext((const sal_uInt8*)sCR, 1);
@@ -818,8 +772,8 @@ void OOXMLFastContextHandler::cr()
void OOXMLFastContextHandler::noBreakHyphen()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("noBreakHyphen");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.noBreakHyphen");
#endif
if (isForwardEvents())
mpStream->utext((const sal_uInt8*)sNoBreakHyphen, 1);
@@ -827,8 +781,8 @@ void OOXMLFastContextHandler::noBreakHyphen()
void OOXMLFastContextHandler::softHyphen()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("softHyphen");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.softHyphen");
#endif
if (isForwardEvents())
mpStream->utext((const sal_uInt8*)sSoftHyphen, 1);
@@ -836,8 +790,8 @@ void OOXMLFastContextHandler::softHyphen()
void OOXMLFastContextHandler::handleLastParagraphInSection()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("handleLastParagraphInSection");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.handleLastParagraphInSection");
#endif
if (mpParserState->isLastParagraphInSection())
@@ -849,8 +803,8 @@ void OOXMLFastContextHandler::handleLastParagraphInSection()
void OOXMLFastContextHandler::endOfParagraph()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("endOfParagraph");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.endOfParagraph");
#endif
if (! mpParserState->isInCharacterGroup())
startCharacterGroup();
@@ -860,8 +814,8 @@ void OOXMLFastContextHandler::endOfParagraph()
void OOXMLFastContextHandler::text(const ::rtl::OUString & sText)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("text");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.text");
debug_logger->chars(sText);
debug_logger->endElement();
#endif
@@ -873,8 +827,8 @@ void OOXMLFastContextHandler::text(const ::rtl::OUString & sText)
void OOXMLFastContextHandler::propagateCharacterProperties()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("propagateCharacterProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.propagateCharacterProperties");
debug_logger->propertySet(getPropertySet(),
IdToString::Pointer_t(new OOXMLIdToString()));
debug_logger->endElement();
@@ -885,8 +839,8 @@ void OOXMLFastContextHandler::propagateCharacterProperties()
void OOXMLFastContextHandler::propagateCharacterPropertiesAsSet(const Id & rId)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("propagateCharacterPropertiesAsSet");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.propagateCharacterPropertiesAsSet");
debug_logger->propertySet(getPropertySet(),
IdToString::Pointer_t(new OOXMLIdToString()));
debug_logger->endElement();
@@ -909,8 +863,8 @@ bool OOXMLFastContextHandler::propagatesProperties() const
void OOXMLFastContextHandler::propagateCellProperties()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("propagateCellProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.propagateCellProperties");
#endif
mpParserState->setCellProperties(getPropertySet());
@@ -918,8 +872,8 @@ void OOXMLFastContextHandler::propagateCellProperties()
void OOXMLFastContextHandler::propagateRowProperties()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("propagateRowProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.propagateRowProperties");
#endif
mpParserState->setRowProperties(getPropertySet());
@@ -928,8 +882,8 @@ void OOXMLFastContextHandler::propagateRowProperties()
void OOXMLFastContextHandler::propagateTableProperties()
{
OOXMLPropertySet::Pointer_t pProps = getPropertySet();
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("propagateTableProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.propagateTableProperties");
debug_logger->propertySet(getPropertySet(),
IdToString::Pointer_t(new OOXMLIdToString()));
debug_logger->endElement();
@@ -940,47 +894,47 @@ void OOXMLFastContextHandler::propagateTableProperties()
void OOXMLFastContextHandler::sendCellProperties()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("sendCellProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendCellProperties");
#endif
mpParserState->resolveCellProperties(*mpStream);
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_CONTEXT_HANDLER
debug_logger->endElement();
#endif
}
void OOXMLFastContextHandler::sendRowProperties()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("sendRowProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendRowProperties");
#endif
mpParserState->resolveRowProperties(*mpStream);
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_CONTEXT_HANDLER
debug_logger->endElement();
#endif
}
void OOXMLFastContextHandler::sendTableProperties()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("sendTableProperties");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendTableProperties");
#endif
mpParserState->resolveTableProperties(*mpStream);
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_CONTEXT_HANDLER
debug_logger->endElement();
#endif
}
void OOXMLFastContextHandler::clearTableProps()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("clearTableProps");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.clearTableProps");
#endif
mpParserState->setTableProperties(OOXMLPropertySet::Pointer_t
@@ -989,8 +943,8 @@ void OOXMLFastContextHandler::clearTableProps()
void OOXMLFastContextHandler::sendPropertiesWithId(const Id & rId)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("sendPropertiesWithId");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendPropertiesWithId");
debug_logger->attribute("id", fastTokenToId(rId));
#endif
@@ -1003,7 +957,7 @@ void OOXMLFastContextHandler::sendPropertiesWithId(const Id & rId)
pPropertySet->add(pProp);
mpStream->props(pPropertySet);
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_CONTEXT_HANDLER
debug_logger->propertySet(getPropertySet(),
IdToString::Pointer_t(new OOXMLIdToString()));
debug_logger->endElement();
@@ -1012,8 +966,8 @@ void OOXMLFastContextHandler::sendPropertiesWithId(const Id & rId)
void OOXMLFastContextHandler::clearProps()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->element("clearProps");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->element("contexthandler.clearProps");
#endif
setPropertySet(OOXMLPropertySet::Pointer_t(new OOXMLPropertySetImpl()));
@@ -1047,8 +1001,8 @@ OOXMLDocument * OOXMLFastContextHandler::getDocument()
void OOXMLFastContextHandler::setForwardEvents(bool bForwardEvents)
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("setForwardEvents");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.setForwardEvents");
if (bForwardEvents)
debug_logger->chars("true");
@@ -1138,7 +1092,7 @@ void OOXMLFastContextHandler::resolvePropertySetAttrs()
void OOXMLFastContextHandler::sendPropertyToParent()
{
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_CONTEXT_HANDLER
debug_logger->element("sendPropertyToParent");
#endif
@@ -1158,8 +1112,8 @@ void OOXMLFastContextHandler::sendPropertyToParent()
void OOXMLFastContextHandler::sendPropertiesToParent()
{
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("sendPropertiesToParent");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendPropertiesToParent");
#endif
if (mpParent != NULL)
{
@@ -1177,24 +1131,13 @@ void OOXMLFastContextHandler::sendPropertiesToParent()
OOXMLProperty::Pointer_t pProp
(new OOXMLPropertyImpl(getId(), pValue, OOXMLPropertyImpl::SPRM));
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("propertyForSet");
- debug_logger->chars(pProp->toString());
- debug_logger->endElement();
-#endif
pParentProps->add(pProp);
-#ifdef DEBUG_ELEMENT
- debug_logger->startElement("parent");
- debug_logger->propertySet(pParentProps,
- IdToString::Pointer_t(new OOXMLIdToString()));
- debug_logger->endElement();
-#endif
}
}
}
-#ifdef DEBUG_ELEMENT
+#ifdef DEBUG_CONTEXT_HANDLER
debug_logger->endElement();
#endif
}
@@ -1234,8 +1177,8 @@ void OOXMLFastContextHandlerStream::newProperty(const Id & rId,
void OOXMLFastContextHandlerStream::sendProperty(Id nId)
{
-#ifdef DEBUG_PROPERTIES
- debug_logger->startElement("sendProperty");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.sendProperty");
debug_logger->attribute("id", (*QNameToString::Instance())(nId));
debug_logger->chars(xmlify(getPropertySetAttrs()->toString()));
debug_logger->endElement();
@@ -1257,8 +1200,8 @@ OOXMLFastContextHandlerStream::getPropertySetAttrs() const
void OOXMLFastContextHandlerStream::resolvePropertySetAttrs()
{
-#ifdef DEBUG_PROPERTIES
- debug_logger->startElement("resolvePropertySetAttrs");
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.resolvePropertySetAttrs");
debug_logger->chars(mpPropertySetAttrs->toString());
debug_logger->endElement();
#endif
@@ -1310,13 +1253,7 @@ void OOXMLFastContextHandlerProperties::lcl_endFastElement
{
if (isForwardEvents())
{
-#ifdef DEBUG_PROPERTIES
- debug_logger->startElement("sendproperties");
-#endif
mpStream->props(mpPropertySet);
-#ifdef DEBUG_PROPERTIES
- debug_logger->endElement();
-#endif
}
}
else
@@ -1537,7 +1474,16 @@ OOXMLFastContextHandlerValue::~OOXMLFastContextHandlerValue()
void OOXMLFastContextHandlerValue::setValue(OOXMLValue::Pointer_t pValue)
{
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->startElement("contexthandler.setValue");
+ debug_logger->attribute("value", pValue->toString());
+#endif
+
mpValue = pValue;
+
+#ifdef DEBUG_CONTEXT_HANDLER
+ debug_logger->endElement("contexthandler.setValue");
+#endif
}
OOXMLValue::Pointer_t OOXMLFastContextHandlerValue::getValue() const
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
index 5e44eaf9dac3..7017e81e22ed 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
@@ -229,19 +229,14 @@ public:
virtual void dumpXml( const TagLogger::Pointer_t pLogger ) const;
#endif
-#ifdef DEBUG_MEMORY
sal_uInt32 getInstanceNumber() { return mnInstanceNumber; }
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-#endif
-
protected:
OOXMLFastContextHandler * mpParent;
Id mId;
Id mnDefine;
Token_t mnToken;
-#ifdef DEBUG_CONTEXT_STACK
+#ifdef DEBUG_CONTEXT_HANDLER
string msTokenString;
#endif
diff --git a/writerfilter/source/ooxml/OOXMLFastHelper.hxx b/writerfilter/source/ooxml/OOXMLFastHelper.hxx
index 321ec17042b6..f9555662041e 100644
--- a/writerfilter/source/ooxml/OOXMLFastHelper.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastHelper.hxx
@@ -75,6 +75,12 @@ uno::Reference<XFastContextHandler>
OOXMLFastHelper<T>::createAndSetParent
(OOXMLFastContextHandler * pHandler, sal_uInt32 nToken, Id nId)
{
+#ifdef DEBUG_HELPER
+ debug_logger->startElement("helper.createAndSetParent");
+ debug_logger->attribute("context", pHandler->getType());
+ debug_logger->attribute("id", (*QNameToString::Instance())(nId));
+#endif
+
OOXMLFastContextHandler * pTmp = new T(pHandler);
pTmp->setToken(nToken);
@@ -89,7 +95,7 @@ OOXMLFastHelper<T>::createAndSetParent
debug_logger->startElement("created");
debug_logger->addTag(pTmp->toTag());
debug_logger->endElement("created");
- debug_logger->endElement("createAndSetParent");
+ debug_logger->endElement("helper.createAndSetParent");
#endif
uno::Reference<XFastContextHandler> aResult(pTmp);
@@ -102,27 +108,29 @@ uno::Reference<XFastContextHandler>
OOXMLFastHelper<T>::createAndSetParentAndDefine
(OOXMLFastContextHandler * pHandler, sal_uInt32 nToken, Id nId, Id nDefine)
{
- OOXMLFastContextHandler * pTmp = new T(pHandler);
-
- pTmp->setToken(nToken);
- pTmp->setId(nId);
- pTmp->setDefine(nDefine);
-
-#ifdef DEBUG_CREATE
- debug_logger->startElement("createAndSetParentAndDefine");
+#ifdef DEBUG_HELPER
+ debug_logger->startElement("helper.createAndSetParentAndDefine");
debug_logger->attribute("context", pHandler->getType());
- debug_logger->attribute("token", fastTokenToId(pTmp->getToken()));
debug_logger->attribute("id", (*QNameToString::Instance())(nId));
static char buffer[16];
snprintf(buffer, sizeof(buffer), "0x%08" SAL_PRIxUINT32, nId);
debug_logger->attribute("idnum", buffer);
+#endif
+
+ OOXMLFastContextHandler * pTmp = new T(pHandler);
+
+ pTmp->setToken(nToken);
+ pTmp->setId(nId);
+ pTmp->setDefine(nDefine);
+
+#ifdef DEBUG_HELPER
debug_logger->startElement("created");
debug_logger->addTag(pTmp->toTag());
debug_logger->endElement("created");
- debug_logger->endElement("createAndSetParentAndDefine");
+ debug_logger->endElement("helper.createAndSetParentAndDefine");
#endif
uno::Reference<XFastContextHandler> aResult(pTmp);
@@ -136,6 +144,12 @@ OOXMLFastHelper<T>::createAndSetParentRef
(OOXMLFastContextHandler * pHandler, sal_uInt32 nToken,
const uno::Reference < xml::sax::XFastAttributeList > & Attribs)
{
+#ifdef DEBUG_HELPER
+ debug_logger->startElement("helper.createAndSetParentRef");
+ debug_logger->attribute("context", pHandler->getType());
+ debug_logger->attribute("type", fastTokenToId(nToken));
+#endif
+
boost::shared_ptr<OOXMLFastContextHandler> pTmp(new T(pHandler));
uno::Reference<XFastContextHandler> xChild =
@@ -150,15 +164,11 @@ OOXMLFastHelper<T>::createAndSetParentRef
}
-#ifdef DEBUG_CREATE
- debug_logger->startElement("createAndSetParentRef");
- debug_logger->attribute("context", pHandler->getType());
- debug_logger->attribute("type", fastTokenToId(nToken));
-
+#ifdef DEBUG_HELPER
debug_logger->startElement("created");
- debug_logger->chars(pTmp->getType());
+ debug_logger->addTag(pTmp->toTag());
debug_logger->endElement("created");
- debug_logger->endElement("createAndSetParentRef");
+ debug_logger->endElement("helper.createAndSetParentRef");
#endif
return xChild;
@@ -171,7 +181,7 @@ void OOXMLFastHelper<T>::newProperty(OOXMLFastContextHandler * pHandler,
{
OOXMLValue::Pointer_t pVal(new T(rValue));
-#ifdef DEBUG_PROPERTIES
+#ifdef DEBUG_HELPER
string aStr = (*QNameToString::Instance())(nId);
debug_logger->startElement("newProperty-from-string");
@@ -183,11 +193,14 @@ void OOXMLFastHelper<T>::newProperty(OOXMLFastContextHandler * pHandler,
if (aStr.size() == 0)
debug_logger->element( "unknown-qname" );
+#endif
+ pHandler->newProperty(nId, pVal);
+
+#ifdef DEBUG_HELPER
debug_logger->endElement();
#endif
- pHandler->newProperty(nId, pVal);
}
template <class T>
@@ -197,10 +210,10 @@ void OOXMLFastHelper<T>::newProperty(OOXMLFastContextHandler * pHandler,
{
OOXMLValue::Pointer_t pVal(new T(nVal));
-#ifdef DEBUG_PROPERTIES
+#ifdef DEBUG_HELPER
string aStr = (*QNameToString::Instance())(nId);
- debug_logger->startElement("newProperty-from-int");
+ debug_logger->startElement("helper.newProperty-from-int");
debug_logger->attribute("name", aStr);
debug_logger->attribute("value", pVal->toString());
@@ -222,8 +235,8 @@ void OOXMLFastHelper<T>::mark(OOXMLFastContextHandler * pHandler,
string aStr = (*QNameToString::Instance())(nId);
-#ifdef DEBUG_PROPERTIES
- debug_logger->startElement("mark");
+#ifdef DEBUG_HELPER
+ debug_logger->startElement("helper.mark");
debug_logger->attribute("name", aStr);
debug_logger->attribute
("value",
@@ -238,18 +251,6 @@ void OOXMLFastHelper<T>::mark(OOXMLFastContextHandler * pHandler,
pHandler->mark(nId, pVal);
}
-
-template <class T>
-void OOXMLFastHelper<T>::attributes
-(OOXMLFastContextHandler * pContext,
- const uno::Reference < xml::sax::XFastAttributeList > & Attribs)
- {
- T aContext(pContext);
-
- aContext.setPropertySet(pContext->getPropertySet());
- aContext.attributes(Attribs);
-}
-
}}
#endif // INCLUDED_FAST_HELPER_HXX
diff --git a/writerfilter/source/ooxml/OOXMLParserState.cxx b/writerfilter/source/ooxml/OOXMLParserState.cxx
index cd319dc44378..1e935104bcce 100644
--- a/writerfilter/source/ooxml/OOXMLParserState.cxx
+++ b/writerfilter/source/ooxml/OOXMLParserState.cxx
@@ -316,6 +316,11 @@ void OOXMLParserState::dumpXml( const TagLogger::Pointer_t& pLogger )
pLogger->endElement();
}
+
+XPathLogger & OOXMLParserState::getXPathLogger()
+{
+ return m_xPathLogger;
+}
#endif
}}
diff --git a/writerfilter/source/ooxml/OOXMLParserState.hxx b/writerfilter/source/ooxml/OOXMLParserState.hxx
index 4a99b56fcbb4..58c35b0363c1 100644
--- a/writerfilter/source/ooxml/OOXMLParserState.hxx
+++ b/writerfilter/source/ooxml/OOXMLParserState.hxx
@@ -34,6 +34,7 @@
#if OSL_DEBUG_LEVEL > 1
#include <resourcemodel/TagLogger.hxx>
+#include <resourcemodel/XPathLogger.hxx>
#endif
namespace writerfilter {
@@ -58,6 +59,9 @@ class OOXMLParserState
stack<OOXMLPropertySet::Pointer_t> mCellProps;
stack<OOXMLPropertySet::Pointer_t> mRowProps;
stack<OOXMLPropertySet::Pointer_t> mTableProps;
+#ifdef DEBUG
+ XPathLogger m_xPathLogger;
+#endif
public:
typedef boost::shared_ptr<OOXMLParserState> Pointer_t;
@@ -109,6 +113,7 @@ public:
public:
unsigned int getContextCount() const;
void dumpXml( const TagLogger::Pointer_t& pLogger );
+ XPathLogger & getXPathLogger();
#endif
};
diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
index 1ccfe9545b58..c8e0aad9bc0a 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
@@ -35,8 +35,6 @@
#include <ooxml/OOXMLFastTokens.hxx>
#include "ooxmlLoggers.hxx"
-//#define DEBUG_RESOLVE
-
namespace writerfilter {
namespace ooxml
{
@@ -475,15 +473,22 @@ string OOXMLPropertySetImpl::getType() const
void OOXMLPropertySetImpl::add(OOXMLProperty::Pointer_t pProperty)
{
+#ifdef DEBUG_PROPERTY_SET
+ debug_logger->startElement("propertyset.add");
+ debug_logger->chars(pProperty->toString());
+#endif
+
if (pProperty.get() != NULL && pProperty->getId() != 0x0)
{
mProperties.push_back(pProperty);
}
-#ifdef DEBUG_PROPERTIES
+#ifdef DEBUG_PROPERTY_SET
else
{
debug_logger->element("warning.property_not_added");
}
+
+ debug_logger->endElement("propertyset.add");
#endif
}
diff --git a/writerfilter/source/ooxml/analyzemodel.xsl b/writerfilter/source/ooxml/analyzemodel.xsl
index d887a9a178a6..3cce9795a947 100644
--- a/writerfilter/source/ooxml/analyzemodel.xsl
+++ b/writerfilter/source/ooxml/analyzemodel.xsl
@@ -98,6 +98,7 @@
</xsl:for-each>
</xsl:when>
</xsl:choose>
+ <xsl:copy-of select="@tag"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet> \ No newline at end of file
diff --git a/writerfilter/source/ooxml/effort.xsl b/writerfilter/source/ooxml/effort.xsl
index 47f278a63f4f..3dfc102e0780 100644
--- a/writerfilter/source/ooxml/effort.xsl
+++ b/writerfilter/source/ooxml/effort.xsl
@@ -7,33 +7,40 @@
<xsl:output method="text"/>
<xsl:template match="/">
- <xsl:text>Namespace,Define,Name,Done,Planned,qname-count&#xa;</xsl:text>
- <xsl:for-each select="/todo/attribute|/todo/element">
- <xsl:for-each select=".//status">
- <xsl:for-each select="ancestor::attribute|ancestor::element">
- <xsl:value-of select="@namespace"/>
- <xsl:text>,</xsl:text>
- <xsl:value-of select="@define"/>
- <xsl:text>,</xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>,</xsl:text>
- </xsl:for-each>
- <xsl:value-of select="@done"/>
- <xsl:text>,</xsl:text>
- <xsl:value-of select="@planned"/>
- <xsl:text>,</xsl:text>
- <xsl:value-of select="@qname-count"/>
- <xsl:text>&#xa;</xsl:text>
- </xsl:for-each>
- <xsl:if test="not(.//status)">
- <xsl:value-of select="@namespace"/>
- <xsl:text>,</xsl:text>
- <xsl:value-of select="@define"/>
- <xsl:text>,</xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>,0,0.5,1&#xa;</xsl:text>
- </xsl:if>
+ <xsl:text>Namespace,Define,Name,Tag,Done,Planned,qname-count&#xa;</xsl:text>
+ <xsl:for-each select="/todo/attribute|/todo/element">
+ <xsl:variable name="namespace" select="@namespace"/>
+ <xsl:variable name="define" select="@define"/>
+ <xsl:variable name="name" select="@name"/>
+ <xsl:variable name="tag" select="@tag"/>
+
+ <xsl:for-each select=".//status">
+ <xsl:value-of select="$namespace"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="$define"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="$name"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="$tag"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="@done"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="@planned"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="@qname-count"/>
+ <xsl:text>&#xa;</xsl:text>
</xsl:for-each>
+ <xsl:if test="not(.//status)">
+ <xsl:value-of select="$namespace"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="$define"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="$name"/>
+ <xsl:text>,</xsl:text>
+ <xsl:value-of select="$tag"/>
+ <xsl:text>,0,0.5,1&#xa;</xsl:text>
+ </xsl:if>
+ </xsl:for-each>
</xsl:template>
</xsl:stylesheet> \ No newline at end of file
diff --git a/writerfilter/source/ooxml/factory_ns.xsl b/writerfilter/source/ooxml/factory_ns.xsl
index 0716a1225b82..d0dd1ab503fd 100644
--- a/writerfilter/source/ooxml/factory_ns.xsl
+++ b/writerfilter/source/ooxml/factory_ns.xsl
@@ -65,19 +65,18 @@
<xsl:template name="factoryactiondecls">
<xsl:variable name="ns" select="@name"/>
- <xsl:for-each select="resource/action">
+ <xsl:for-each select="resource/action[not(@name='characters')]">
<xsl:sort select="@name"/>
<xsl:if test="generate-id(key('actions', @name)[ancestor::namespace/@name=$ns][1]) = generate-id(.)">
<xsl:text>
void </xsl:text>
<xsl:value-of select="@name"/>
<xsl:text>Action(OOXMLFastContextHandler * pHandler</xsl:text>
- <xsl:if test="@name='characters'">
- <xsl:text>, const ::rtl::OUString &amp; sText</xsl:text>
- </xsl:if>
<xsl:text>);</xsl:text>
</xsl:if>
</xsl:for-each>
+ <xsl:text>
+ virtual void charactersAction(OOXMLFastContextHandler * pHandler, const ::rtl::OUString &amp; sText);</xsl:text>
</xsl:template>
<!-- factorydecl -->
@@ -102,6 +101,10 @@ public:
virtual string getDefineName(Id nId) const;</xsl:text>
<xsl:call-template name="factoryactiondecls"/>
virtual void attributeAction(OOXMLFastContextHandler * pHandler, Token_t nToken, OOXMLValue::Pointer_t pValue);
+
+#ifdef DEBUG_FACTORY
+ virtual string getName() const;
+#endif
<xsl:text>
virtual ~</xsl:text>
diff --git a/writerfilter/source/ooxml/factoryimpl.xsl b/writerfilter/source/ooxml/factoryimpl.xsl
index e3c169145ab3..e555ae1b7d6f 100644
--- a/writerfilter/source/ooxml/factoryimpl.xsl
+++ b/writerfilter/source/ooxml/factoryimpl.xsl
@@ -74,6 +74,10 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh
uno::Reference &lt; xml::sax::XFastContextHandler &gt; aResult;
Id nDefine = pHandler->getDefine();
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.createFastChildContextFromFactory");
+#endif
+
if (pFactory.get() != NULL)
{
CreateElementMapPointer pMap = pFactory-&gt;getCreateElementMap(nDefine);
@@ -82,12 +86,13 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh
if (pMap.get() != NULL)
{
Id nId = (*pTokenMap)[Element];
-#ifdef DEBUG_CREATE
+#ifdef DEBUG_FACTORY
+ string sFactoryName(pFactory->getName());
string sDefine(pFactory->getDefineName(nDefine));
string sElement(fastTokenToId(Element));
string sQName((*QNameToString::Instance())(nId));
- debug_logger->startElement("createFastChildContextFromFactory");
+ debug_logger->attribute("factory-name", sFactoryName);
debug_logger->attribute("define", sDefine);
debug_logger->attribute("element", sElement);
debug_logger->attribute("qname", sQName);
@@ -130,12 +135,13 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh
break;
}
-#ifdef DEBUG_CREATE
- debug_logger->endElement("createFastChildContextFromFactory");
-#endif
}
}
+#ifdef DEBUG_FACTORY
+ debug_logger->endElement("factory.createFastChildContextFromFactory");
+#endif
+
return aResult;
}
</xsl:text>
@@ -174,8 +180,8 @@ OOXMLFactory_ns::Pointer_t OOXMLFactory::getFactoryForNamespace(Id nId)
uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastChildContextFromStart
(OOXMLFastContextHandler * pHandler, Token_t Element)
{
-#ifdef DEBUG_CREATE
- debug_logger->startElement("createFastChildContextFromStart");
+#ifdef DEBUG_FACTORY
+ debug_logger->startElement("factory.createFastChildContextFromStart");
#endif
uno::Reference &lt; xml::sax::XFastContextHandler &gt; aResult;
@@ -194,8 +200,8 @@ uno::Reference&lt; xml::sax::XFastContextHandler &gt; OOXMLFactory::createFastCh
</xsl:for-each>
<xsl:text>
-#ifdef DEBUG_CREATE
- debug_logger->endElement("createFastChildContextFromStart");
+#ifdef DEBUG_FACTORY
+ debug_logger->endElement("factory.createFastChildContextFromStart");
#endif
return aResult;
}
diff --git a/writerfilter/source/ooxml/factoryimpl_ns.xsl b/writerfilter/source/ooxml/factoryimpl_ns.xsl
index 8d5d014a92cc..ddb21a06c25c 100644
--- a/writerfilter/source/ooxml/factoryimpl_ns.xsl
+++ b/writerfilter/source/ooxml/factoryimpl_ns.xsl
@@ -139,6 +139,47 @@ OOXMLFactory_ns::Pointer_t </xsl:text>
</xsl:text>
</xsl:template>
+<!--
+ Returns resource for attribute.
+-->
+
+<xsl:template name="resourceforattribute">
+ <xsl:variable name="mynsid" select="generate-id(ancestor::namespace)"/>
+ <xsl:for-each select="rng:ref">
+ <xsl:variable name="name" select="@name"/>
+ <xsl:variable name="resource1">
+ <xsl:for-each select="key('context-resource', @name)[generate-id(ancestor::namespace) = $mynsid]">
+ <xsl:value-of select="@resource"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="string-length($resource1) > 0">
+ <xsl:value-of select="$resource1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="ancestor::namespace/rng:grammar/rng:define[@name=$name]">
+ <xsl:call-template name="resourceforattribute"/>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ <xsl:for-each select=".//rng:text">
+ <xsl:text>String</xsl:text>
+ </xsl:for-each>
+ <xsl:for-each select=".//rng:data[@type='base64Binary']">
+ <xsl:text>String</xsl:text>
+ </xsl:for-each>
+ <xsl:for-each select=".//rng:data[@type='boolean']">
+ <xsl:text>Boolean</xsl:text>
+ </xsl:for-each>
+ <xsl:for-each select=".//rng:data[@type='unsignedInt']">
+ <xsl:text>Integer</xsl:text>
+ </xsl:for-each>
+ <xsl:for-each select=".//rng:data[@type='int']">
+ <xsl:text>Integer</xsl:text>
+ </xsl:for-each>
+</xsl:template>
+
<!--
creates code block in OOXMLFactory_<namespace>::createAttributeToResourceMap
@@ -160,19 +201,8 @@ for a rng:define
// </xsl:text>
<xsl:value-of select="$defname"/>
</xsl:if>
- <xsl:variable name="mynsid" select="generate-id(ancestor::namespace)"/>
<xsl:variable name="resource">
- <xsl:for-each select="rng:ref">
- <xsl:for-each select="key('context-resource', @name)[generate-id(ancestor::namespace) = $mynsid]">
- <xsl:value-of select="@resource"/>
- </xsl:for-each>
- </xsl:for-each>
- <xsl:for-each select=".//rng:text">
- <xsl:text>String</xsl:text>
- </xsl:for-each>
- <xsl:for-each select=".//rng:data[@type='base64Binary']">
- <xsl:text>String</xsl:text>
- </xsl:for-each>
+ <xsl:call-template name="resourceforattribute"/>
<xsl:for-each select=".//rng:data[@type='boolean']">
<xsl:text>Boolean</xsl:text>
</xsl:for-each>
@@ -184,27 +214,26 @@ for a rng:define
</xsl:for-each>
</xsl:variable>
- <xsl:variable name="refdefine1">
- <xsl:for-each select="rng:ref">
- <xsl:variable name="refname" select="@name"/>
- <xsl:for-each select="ancestor::rng:grammar/rng:define[@name=$refname]">
- <xsl:call-template name="idfordefine"/>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="refdefine">
- <xsl:choose>
- <xsl:when test="string-length($refdefine1) > 0">
- <xsl:value-of select="$refdefine1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>0</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
<xsl:choose>
<xsl:when test="string-length($resource) > 0">
+ <xsl:variable name="refdefine1">
+ <xsl:for-each select="rng:ref">
+ <xsl:variable name="refname" select="@name"/>
+ <xsl:for-each select="ancestor::rng:grammar/rng:define[@name=$refname]">
+ <xsl:call-template name="idfordefine"/>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="refdefine">
+ <xsl:choose>
+ <xsl:when test="string-length($refdefine1) > 0">
+ <xsl:value-of select="$refdefine1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>0</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
<xsl:text>
(*pMap)[</xsl:text>
<xsl:call-template name="fasttoken"/>
@@ -546,42 +575,103 @@ CreateElementMapPointer </xsl:text>
<!-- factoryaction -->
<xsl:template name="factoryaction">
- <xsl:param name="action"/>
- <xsl:text>
-void </xsl:text>
- <xsl:call-template name="factoryclassname"/>
- <xsl:text>::</xsl:text>
- <xsl:value-of select="$action"/>
- <xsl:text>Action(OOXMLFastContextHandler * pHandler</xsl:text>
+ <xsl:param name="action"/>
+ <xsl:variable name="switchblock1">
+ <xsl:for-each select="resource[action/@name=$action]">
+ <xsl:text>
+ </xsl:text>
+ <xsl:call-template name="caselabeldefine"/>
+ <xsl:for-each select="action[@name=$action]">
+ <xsl:call-template name="factorychooseaction"/>
+ </xsl:for-each>
+ <xsl:text> break;&#xa;</xsl:text>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="switchblock2">
<xsl:if test="$action='characters'">
- <xsl:text>, const ::rtl::OUString &amp; sText</xsl:text>
+ <xsl:for-each select="resource[@resource='Value']">
+ <xsl:if test="count(attribute) = 0">
+ <xsl:variable name="name" select="@name"/>
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="caselabeldefine"/>
+ <xsl:text>&#xa;</xsl:text>
+ <xsl:for-each select="ancestor::namespace/rng:grammar/rng:define[@name=$name]">
+ <xsl:for-each select="rng:ref">
+ <xsl:call-template name="charactersactionforvalues"/>
+ </xsl:for-each>
+ </xsl:for-each>
+ <xsl:text> break;&#xa;</xsl:text>
+ </xsl:if>
+ </xsl:for-each>
</xsl:if>
- <xsl:text>)
-{
- switch (pHandler->getDefine())
- {</xsl:text>
- <xsl:for-each select="resource[action/@name=$action]">
- <xsl:text>
- </xsl:text>
- <xsl:call-template name="caselabeldefine"/>
- <xsl:for-each select="action[@name=$action]">
- <xsl:call-template name="factorychooseaction"/>
- </xsl:for-each>
- <xsl:text>
- break;</xsl:text>
+ </xsl:variable>
+ <xsl:text>&#xa;&#xa;</xsl:text>
+ <xsl:text>void </xsl:text>
+ <xsl:call-template name="factoryclassname"/>
+ <xsl:text>::</xsl:text>
+ <xsl:value-of select="$action"/>
+ <xsl:text>Action(OOXMLFastContextHandler*</xsl:text>
+ <xsl:if test="string-length($switchblock1) &gt; 0 or string-length($switchblock2) &gt; 0">
+ <xsl:text> pHandler</xsl:text>
+ </xsl:if>
+ <xsl:if test="$action='characters'">
+ <xsl:text>, const ::rtl::OUString &amp;</xsl:text>
+ <xsl:if test="contains($switchblock1, 'sText') or contains($switchblock2, 'sText')">
+ <xsl:text> sText</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ <xsl:text>)&#xa;</xsl:text>
+ <xsl:text>{&#xa;</xsl:text>
+ <xsl:if test="string-length($switchblock1) > 0 or string-length($switchblock2) > 0">
+ <xsl:text> sal_uInt32 nDefine = pHandler->getDefine();&#xa;</xsl:text>
+ </xsl:if>
+ <xsl:if test="string-length($switchblock1) > 0">
+ <xsl:text> switch (nDefine)&#xa;</xsl:text>
+ <xsl:text> {&#xa;</xsl:text>
+ <xsl:value-of select="$switchblock1"/>
+ <xsl:text> default:&#xa;</xsl:text>
+ <xsl:text> break;&#xa;</xsl:text>
+ <xsl:text> }&#xa;</xsl:text>
+ </xsl:if>
+ <xsl:if test="string-length($switchblock2) > 0">
+ <xsl:text> OOXMLFastContextHandlerValue * pValueHandler = dynamic_cast&lt;OOXMLFastContextHandlerValue *&gt;(pHandler);&#xa;</xsl:text>
+ <xsl:text> switch (nDefine)&#xa;</xsl:text>
+ <xsl:text> {&#xa;</xsl:text>
+ <xsl:value-of select="$switchblock2"/>
+ <xsl:text> default:&#xa;</xsl:text>
+ <xsl:text> break;&#xa;</xsl:text>
+ <xsl:text> }&#xa;</xsl:text>
+ </xsl:if>
+ <xsl:text>}&#xa;</xsl:text>
+</xsl:template>
+
+<xsl:template name="charactersactionforvalues">
+ <xsl:variable name="name" select="@name"/>
+ <xsl:for-each select="ancestor::namespace/rng:grammar/rng:define[@name=$name]">
+ <xsl:text> {&#xa;</xsl:text>
+ <xsl:text> // </xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>&#xa;</xsl:text>
+ <xsl:for-each select="rng:data[@type='int']">
+ <xsl:text> OOXMLValue::Pointer_t pValue(new OOXMLIntegerValue(sText));&#xa;</xsl:text>
+ <xsl:text> pValueHandler->setValue(pValue);&#xa;</xsl:text>
</xsl:for-each>
- <xsl:text>
- default:
- break;
- }
-}
-</xsl:text>
+ <xsl:for-each select="rng:list">
+ <xsl:text> ListValueMapPointer pListValueMap = getListValueMap(nDefine);&#xa;</xsl:text>
+ <xsl:text> if (pListValueMap.get() != NULL)&#xa;</xsl:text>
+ <xsl:text> {&#xa;</xsl:text>
+ <xsl:text> OOXMLValue::Pointer_t pValue(new OOXMLIntegerValue((*pListValueMap)[sText]));&#xa;</xsl:text>
+ <xsl:text> pValueHandler->setValue(pValue);</xsl:text>
+ <xsl:text> }&#xa;</xsl:text>
+ </xsl:for-each>
+ <xsl:text> }&#xa;</xsl:text>
+ </xsl:for-each>
</xsl:template>
<!-- factoryactions -->
<xsl:template name="factoryactions">
<xsl:variable name="ns" select="@name"/>
- <xsl:for-each select="resource/action">
+ <xsl:for-each select="resource/action[not(@name='characters')]">
<xsl:sort select="@name"/>
<xsl:if test="generate-id(key('actions', @name)[ancestor::namespace/@name=$ns][1]) = generate-id(.)">
<xsl:variable name="name" select="@name"/>
@@ -592,6 +682,9 @@ void </xsl:text>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
+ <xsl:call-template name="factoryaction">
+ <xsl:with-param name="action">characters</xsl:with-param>
+ </xsl:call-template>
</xsl:template>
<xsl:template name="factorygetdefinename">
@@ -799,6 +892,22 @@ void </xsl:text>
</xsl:choose>
</xsl:template>
+<xsl:template name="factorygetname">
+ <xsl:param name="ns"/>
+ <xsl:text>
+#ifdef DEBUG_FACTORY
+string </xsl:text>
+<xsl:call-template name="factoryclassname"/>
+<xsl:text>::getName() const
+{
+ return "</xsl:text>
+ <xsl:value-of select="$ns"/>
+ <xsl:text>";
+}
+#endif
+</xsl:text>
+</xsl:template>
+
<xsl:template match="/">
<xsl:variable name="ns" select="substring-before(substring-after($file, 'OOXMLFactory_'), '.cxx')"/>
<xsl:text>
@@ -828,6 +937,9 @@ namespace ooxml {
<xsl:call-template name="factorygetdefinename"/>
<xsl:call-template name="factorytokentoidmap"/>
<xsl:call-template name="factoryattributeaction"/>
+ <xsl:call-template name="factorygetname">
+ <xsl:with-param name="ns" select="$ns"/>
+ </xsl:call-template>
</xsl:for-each>
<xsl:text>
/// @endcond
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 2285cec70fca..8809069429cf 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<model xmlns:rng="http://relaxng.org/ns/structure/1.0">
- <namespace-alias name="http://www.w3.org/XML/1998/namespace" alias="xml" id="XML"/>
- <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/relationships" alias="relationships" id="RELATIONSHIPS"/>
- <namespace-alias name="urn:schemas-microsoft-com:office:office" alias="office" id="OFFICE"/>
- <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" alias="theme" id="THEME"/>
- <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" alias="wordprocessingDrawing" id="DOC_DRAWINGML"/>
- <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/main" alias="drawingml" id="DRAWINGML"/>
- <namespace-alias name="urn:schemas-microsoft-com:vml" alias="vml" id="VML"/>
- <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/picture" alias="picture" id="PICTURE"/>
- <namespace-alias name="urn:schemas-microsoft-com:office:word" alias="vml_wordprocessingDrawing" id="VML_DOC"/>
- <namespace-alias name="http://schemas.openxmlformats.org/wordprocessingml/2006/main" alias="wordprocessingml" id="DOC"/>
- <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/math" alias="math" id="MATH"/>
- <namespace-alias name="http://schemas.openxmlformats.org/schemaLibrary/2006/main" alias="schemaLibrary" id="SML"/>
- <namespace-alias name="http://sprm" alias="sprm" id="SPRM"/>
+ <namespace-alias name="http://www.w3.org/XML/1998/namespace" alias="xml" id="xml"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/relationships" alias="relationships" id="officeRel"/>
+ <namespace-alias name="urn:schemas-microsoft-com:office:office" alias="office" id="vmlOffice"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" alias="theme" id="officeRelTheme"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" alias="wordprocessingDrawing" id="dmlWordDr"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/main" alias="drawingml" id="dml"/>
+ <namespace-alias name="urn:schemas-microsoft-com:vml" alias="vml" id="vml"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/picture" alias="picture" id="dmlPicture"/>
+ <namespace-alias name="urn:schemas-microsoft-com:office:word" alias="vml_wordprocessingDrawing" id="vmlWord"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/wordprocessingml/2006/main" alias="wordprocessingml" id="doc"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/math" alias="math" id="officeMath"/>
+ <namespace-alias name="http://schemas.openxmlformats.org/schemaLibrary/2006/main" alias="schemaLibrary" id="schema"/>
+ <namespace-alias name="http://sprm" alias="sprm" id="sprm"/>
<token tokenid="ooxml:shape"/>
<token tokenid="ooxml:token"/>
<token tokenid="ooxml:inputstream"/>
@@ -191,11 +191,11 @@
</define>
</grammar>
<resource name="CT_OfficeStyleSheet" resource="Table" tokenid="ooxml:THEMETABLE"/>
- <resource name="theme" resource="Stream">
+ <resource name="theme" resource="Stream" tag="theme">
<element name="theme" tokenid="ooxml:THEMETABLE"/>
</resource>
- <resource name="themeOverride" resource="Stream"/>
- <resource name="themeManager" resource="Stream"/>
+ <resource name="themeOverride" resource="Stream" tag="theme"/>
+ <resource name="themeManager" resource="Stream" tag="theme"/>
</namespace>
<namespace name="dml-styleDefaults" file="dml-styleDefaults">
<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="http://schemas.openxmlformats.org/drawingml/2006/main">
@@ -1114,7 +1114,7 @@
<value name="hlink" tokenid="ooxml:Value_drawingml_ST_ColorSchemeIndex_hlink">hlink</value>
<value name="folHlink" tokenid="ooxml:Value_drawingml_ST_ColorSchemeIndex_folHlink">folHlink</value>
</resource>
- <resource name="CT_ColorScheme" resource="Properties">
+ <resource name="CT_ColorScheme" resource="Properties" tag="theme">
<element name="dk1" tokenid="ooxml:CT_ColorScheme_dk1"/>
<element name="lt1" tokenid="ooxml:CT_ColorScheme_lt1"/>
<element name="dk2" tokenid="ooxml:CT_ColorScheme_dk2"/>
@@ -1130,39 +1130,39 @@
<element name="extLst" tokenid="ooxml:CT_ColorScheme_extLst"/>
<attribute name="name" tokenid="ooxml:CT_ColorScheme_name"/>
</resource>
- <resource name="CT_SupplementalFont" resource="Properties">
+ <resource name="CT_SupplementalFont" resource="Properties" tag="theme">
<attribute name="script" tokenid="ooxml:CT_SupplementalFont_script"/>
<attribute name="typeface" tokenid="ooxml:CT_SupplementalFont_typeface"/>
</resource>
- <resource name="CT_FontCollection" resource="Properties">
+ <resource name="CT_FontCollection" resource="Properties" tag="theme">
<element name="latin" tokenid="ooxml:CT_FontCollection_latin"/>
<element name="ea" tokenid="ooxml:CT_FontCollection_ea"/>
<element name="cs" tokenid="ooxml:CT_FontCollection_cs"/>
<element name="font" tokenid="ooxml:CT_FontCollection_font"/>
<element name="extLst" tokenid="ooxml:CT_FontCollection_extLst"/>
</resource>
- <resource name="CT_FontScheme" resource="Properties">
+ <resource name="CT_FontScheme" resource="Properties" tag="theme">
<element name="majorFont" tokenid="ooxml:CT_FontScheme_majorFont"/>
<element name="minorFont" tokenid="ooxml:CT_FontScheme_minorFont"/>
<element name="extLst" tokenid="ooxml:CT_FontScheme_extLst"/>
<attribute name="name" tokenid="ooxml:CT_FontScheme_name"/>
</resource>
- <resource name="CT_FillStyleList" resource="Properties"/>
- <resource name="CT_LineStyleList" resource="Properties">
+ <resource name="CT_FillStyleList" resource="Properties" tag="theme"/>
+ <resource name="CT_LineStyleList" resource="Properties" tag="theme">
<element name="ln" tokenid="ooxml:CT_LineStyleList_ln"/>
</resource>
- <resource name="CT_EffectStyleList" resource="Properties">
+ <resource name="CT_EffectStyleList" resource="Properties" tag="theme">
<element name="effectStyle" tokenid="ooxml:CT_EffectStyleList_effectStyle"/>
</resource>
- <resource name="CT_BackgroundFillStyleList" resource="Properties"/>
- <resource name="CT_StyleMatrix" resource="Properties">
+ <resource name="CT_BackgroundFillStyleList" resource="Properties" tag="theme"/>
+ <resource name="CT_StyleMatrix" resource="Properties" tag="theme">
<element name="fillStyleLst" tokenid="ooxml:CT_StyleMatrix_fillStyleLst"/>
<element name="lnStyleLst" tokenid="ooxml:CT_StyleMatrix_lnStyleLst"/>
<element name="effectStyleLst" tokenid="ooxml:CT_StyleMatrix_effectStyleLst"/>
<element name="bgFillStyleLst" tokenid="ooxml:CT_StyleMatrix_bgFillStyleLst"/>
<attribute name="name" tokenid="ooxml:CT_StyleMatrix_name"/>
</resource>
- <resource name="CT_BaseStyles" resource="Properties">
+ <resource name="CT_BaseStyles" resource="Properties" tag="theme">
<element name="clrScheme" tokenid="ooxml:CT_BaseStyles_clrScheme"/>
<element name="fontScheme" tokenid="ooxml:CT_BaseStyles_fontScheme"/>
<element name="fmtScheme" tokenid="ooxml:CT_BaseStyles_fmtScheme"/>
@@ -1541,7 +1541,7 @@
<resource name="ST_TextFontSize" resource="Integer" generated="yes"/>
<resource name="ST_Panose" resource="Hex" generated="yes"/>
<resource name="ST_TextTypeface" resource="String" generated="yes"/>
- <resource name="CT_TextFont" resource="Properties">
+ <resource name="CT_TextFont" resource="Properties" tag="character">
<attribute name="typeface" tokenid="ooxml:CT_TextFont_typeface"/>
<attribute name="panose" tokenid="ooxml:CT_TextFont_panose"/>
<attribute name="pitchFamily" tokenid="ooxml:CT_TextFont_pitchFamily"/>
@@ -2738,7 +2738,7 @@
<value name="shdw19" tokenid="ooxml:Value_drawingml_ST_PresetShadowVal_shdw19">shdw19</value>
<value name="shdw20" tokenid="ooxml:Value_drawingml_ST_PresetShadowVal_shdw20">shdw20</value>
</resource>
- <resource name="CT_SolidColorFillProperties" resource="Properties"/>
+ <resource name="CT_SolidColorFillProperties" resource="Properties" tag="shape"/>
<resource name="ST_PathShadeType" resource="List" generated="yes">
<value name="shape" tokenid="ooxml:Value_drawingml_ST_PathShadeType_shape">shape</value>
<value name="circle" tokenid="ooxml:Value_drawingml_ST_PathShadeType_circle">circle</value>
@@ -2750,7 +2750,7 @@
<value name="y" tokenid="ooxml:Value_drawingml_ST_TileFlipMode_y">y</value>
<value name="xy" tokenid="ooxml:Value_drawingml_ST_TileFlipMode_xy">xy</value>
</resource>
- <resource name="CT_GradientStop" resource="Properties">
+ <resource name="CT_GradientStop" resource="Properties" tag="shape">
<attribute name="pos" tokenid="ooxml:CT_GradientStop_pos"/>
</resource>
<resource name="CT_TileInfoProperties" resource="Properties">
@@ -2761,10 +2761,10 @@
<attribute name="flip" tokenid="ooxml:CT_TileInfoProperties_flip"/>
<attribute name="algn" tokenid="ooxml:CT_TileInfoProperties_algn"/>
</resource>
- <resource name="CT_StretchInfoProperties" resource="Properties">
+ <resource name="CT_StretchInfoProperties" resource="Properties" tag="shape">
<element name="fillRect" tokenid="ooxml:CT_StretchInfoProperties_fillRect"/>
</resource>
- <resource name="EG_FillModeProperties" resource="Properties">
+ <resource name="EG_FillModeProperties" resource="Properties" tag="shape">
<element name="tile" tokenid="ooxml:EG_FillModeProperties_tile"/>
<element name="stretch" tokenid="ooxml:EG_FillModeProperties_stretch"/>
</resource>
@@ -2775,7 +2775,7 @@
<value name="hqprint" tokenid="ooxml:Value_drawingml_ST_BlipCompression_hqprint">hqprint</value>
<value name="none" tokenid="ooxml:Value_drawingml_ST_BlipCompression_none">none</value>
</resource>
- <resource name="CT_Blip" resource="Properties">
+ <resource name="CT_Blip" resource="Properties" tag="shape">
<element name="alphaBiLevel" tokenid="ooxml:CT_Blip_alphaBiLevel"/>
<element name="alphaCeiling" tokenid="ooxml:CT_Blip_alphaCeiling"/>
<element name="alphaFloor" tokenid="ooxml:CT_Blip_alphaFloor"/>
@@ -2796,7 +2796,7 @@
<element name="extLst" tokenid="ooxml:CT_Blip_extLst"/>
<attribute name="cstate" tokenid="ooxml:CT_Blip_cstate"/>
</resource>
- <resource name="CT_BlipFillProperties" resource="Properties">
+ <resource name="CT_BlipFillProperties" resource="Properties" tag="shape">
<element name="blip" tokenid="ooxml:CT_BlipFillProperties_blip"/>
<element name="srcRect" tokenid="ooxml:CT_BlipFillProperties_srcRect"/>
<attribute name="dpi" tokenid="ooxml:CT_BlipFillProperties_dpi"/>
@@ -2865,7 +2865,7 @@
<value name="darken" tokenid="ooxml:Value_drawingml_ST_BlendMode_darken">darken</value>
<value name="lighten" tokenid="ooxml:Value_drawingml_ST_BlendMode_lighten">lighten</value>
</resource>
- <resource name="EG_Effect" resource="Properties">
+ <resource name="EG_Effect" resource="Properties" tag="shape">
<element name="cont" tokenid="ooxml:EG_Effect_cont"/>
<element name="effect" tokenid="ooxml:EG_Effect_effect"/>
<element name="alphaBiLevel" tokenid="ooxml:EG_Effect_alphaBiLevel"/>
@@ -2901,7 +2901,7 @@
<value name="sib" tokenid="ooxml:Value_drawingml_ST_EffectContainerType_sib">sib</value>
<value name="tree" tokenid="ooxml:Value_drawingml_ST_EffectContainerType_tree">tree</value>
</resource>
- <resource name="CT_EffectContainer" resource="Properties">
+ <resource name="CT_EffectContainer" resource="Properties" tag="shape">
<attribute name="type" tokenid="ooxml:CT_EffectContainer_type"/>
<attribute name="name" tokenid="ooxml:CT_EffectContainer_name"/>
</resource>
@@ -3197,12 +3197,12 @@
<value name="med" tokenid="ooxml:Value_drawingml_ST_LineEndLength_med">med</value>
<value name="lg" tokenid="ooxml:Value_drawingml_ST_LineEndLength_lg">lg</value>
</resource>
- <resource name="CT_LineEndProperties" resource="Properties">
+ <resource name="CT_LineEndProperties" resource="Properties" tag="shape">
<attribute name="type" tokenid="ooxml:CT_LineEndProperties_type"/>
<attribute name="w" tokenid="ooxml:CT_LineEndProperties_w"/>
<attribute name="len" tokenid="ooxml:CT_LineEndProperties_len"/>
</resource>
- <resource name="EG_LineFillProperties" resource="Properties">
+ <resource name="EG_LineFillProperties" resource="Properties" tag="shape">
<element name="noFill" tokenid="ooxml:EG_LineFillProperties_noFill"/>
<element name="solidFill" tokenid="ooxml:EG_LineFillProperties_solidFill"/>
<element name="gradFill" tokenid="ooxml:EG_LineFillProperties_gradFill"/>
@@ -3237,7 +3237,7 @@
<value name="thinThick" tokenid="ooxml:Value_drawingml_ST_CompoundLine_thinThick">thinThick</value>
<value name="tri" tokenid="ooxml:Value_drawingml_ST_CompoundLine_tri">tri</value>
</resource>
- <resource name="CT_LineProperties" resource="Properties">
+ <resource name="CT_LineProperties" resource="Properties" tag="shape">
<element name="headEnd" tokenid="ooxml:CT_LineProperties_headEnd"/>
<element name="tailEnd" tokenid="ooxml:CT_LineProperties_tailEnd"/>
<element name="extLst" tokenid="ooxml:CT_LineProperties_extLst"/>
@@ -3331,7 +3331,7 @@
</optional>
</define>
</grammar>
- <resource name="CT_ShapeProperties" resource="Properties">
+ <resource name="CT_ShapeProperties" resource="Properties" tag="shape">
<element name="xfrm" tokenid="ooxml:CT_ShapeProperties_xfrm"/>
<element name="ln" tokenid="ooxml:CT_ShapeProperties_ln"/>
<element name="scene3d" tokenid="ooxml:CT_ShapeProperties_scene3d"/>
@@ -4429,41 +4429,41 @@
<attribute name="val" tokenid="ooxml:CT_Angle_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
- <resource name="CT_PositiveFixedAngle" resource="Value" generated="yes">
+ <resource name="CT_PositiveFixedAngle" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_PositiveFixedAngle_val" action="setValue"/>
</resource>
<resource name="ST_Percentage" resource="Integer" generated="yes"/>
- <resource name="CT_Percentage" resource="Value" generated="yes">
+ <resource name="CT_Percentage" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Percentage_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
- <resource name="CT_PositivePercentage" resource="Value" generated="yes">
+ <resource name="CT_PositivePercentage" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_PositivePercentage_val" action="setValue"/>
</resource>
- <resource name="CT_FixedPercentage" resource="Value" generated="yes">
+ <resource name="CT_FixedPercentage" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_FixedPercentage_val" action="setValue"/>
</resource>
- <resource name="CT_PositiveFixedPercentage" resource="Value" generated="yes">
+ <resource name="CT_PositiveFixedPercentage" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_PositiveFixedPercentage_val" action="setValue"/>
</resource>
- <resource name="CT_Point2D" resource="Properties">
+ <resource name="CT_Point2D" resource="Properties" tag="shape">
<attribute name="x" tokenid="ooxml:CT_Point2D_x"/>
<attribute name="y" tokenid="ooxml:CT_Point2D_y"/>
</resource>
- <resource name="CT_PositiveSize2D" resource="Properties">
+ <resource name="CT_PositiveSize2D" resource="Properties" tag="shape">
<attribute name="cx" tokenid="ooxml:CT_PositiveSize2D_cx"/>
<attribute name="cy" tokenid="ooxml:CT_PositiveSize2D_cy"/>
</resource>
- <resource name="CT_ScRgbColor" resource="Properties">
+ <resource name="CT_ScRgbColor" resource="Properties" tag="shape">
<attribute name="r" tokenid="ooxml:CT_ScRgbColor_r"/>
<attribute name="g" tokenid="ooxml:CT_ScRgbColor_g"/>
<attribute name="b" tokenid="ooxml:CT_ScRgbColor_b"/>
</resource>
<resource name="ST_HexBinary3" resource="Hex" generated="yes"/>
- <resource name="CT_SRgbColor" resource="Properties">
+ <resource name="CT_SRgbColor" resource="Properties" tag="shape">
<attribute name="val" tokenid="ooxml:CT_SRgbColor_val"/>
</resource>
- <resource name="CT_HslColor" resource="Properties">
+ <resource name="CT_HslColor" resource="Properties" tag="shape">
<attribute name="hue" tokenid="ooxml:CT_HslColor_hue"/>
<attribute name="sat" tokenid="ooxml:CT_HslColor_sat"/>
<attribute name="lum" tokenid="ooxml:CT_HslColor_lum"/>
@@ -4500,7 +4500,7 @@
<value name="menuHighlight" tokenid="ooxml:Value_drawingml_ST_SystemColorVal_menuHighlight">menuHighlight</value>
<value name="menuBar" tokenid="ooxml:Value_drawingml_ST_SystemColorVal_menuBar">menuBar</value>
</resource>
- <resource name="CT_SystemColor" resource="Properties">
+ <resource name="CT_SystemColor" resource="Properties" tag="shape">
<attribute name="val" tokenid="ooxml:CT_SystemColor_val"/>
<attribute name="lastClr" tokenid="ooxml:CT_SytemColor_lastClr"/>
</resource>
@@ -4523,7 +4523,7 @@
<value name="dk2" tokenid="ooxml:Value_drawingml_ST_SchemeColorVal_dk2">dk2</value>
<value name="lt2" tokenid="ooxml:Value_drawingml_ST_SchemeColorVal_lt2">lt2</value>
</resource>
- <resource name="CT_SchemeColor" resource="Properties">
+ <resource name="CT_SchemeColor" resource="Properties" tag="shape">
<attribute name="val" tokenid="ooxml:CT_SchemeColor_val"/>
</resource>
<resource name="ST_PresetColorVal" resource="List">
@@ -4668,10 +4668,10 @@
<value tokenid="0xffff00">yellow</value>
<value tokenid="0x9acd32">yellowGreen</value>
</resource>
- <resource name="CT_PresetColor" resource="Properties">
+ <resource name="CT_PresetColor" resource="Properties" tag="shape">
<attribute name="val" tokenid="ooxml:CT_PresetColor_val"/>
</resource>
- <resource name="CT_Transform2D" resource="Properties">
+ <resource name="CT_Transform2D" resource="Properties" tag="shape">
<element name="off" tokenid="ooxml:CT_Transform2D_off"/>
<element name="ext" tokenid="ooxml:CT_Transform2D_ext"/>
<attribute name="rot" tokenid="ooxml:CT_Transform2D_rot"/>
@@ -4690,7 +4690,7 @@
<value name="br" tokenid="ooxml:Value_drawingml_ST_RectAlignment_br">br</value>
</resource>
<resource name="ST_Guid" resource="String" generated="yes"/>
- <resource name="EG_ColorChoice" resource="Properties">
+ <resource name="EG_ColorChoice" resource="Properties" tag="shape">
<element name="scrgbClr" tokenid="ooxml:EG_ColorChoice_scrgbClr"/>
<element name="srgbClr" tokenid="ooxml:EG_ColorChoice_srgbClr"/>
<element name="hslClr" tokenid="ooxml:EG_ColorChoice_hslClr"/>
@@ -4698,8 +4698,8 @@
<element name="schemeClr" tokenid="ooxml:EG_ColorChoice_schemeClr"/>
<element name="prstClr" tokenid="ooxml:EG_ColorChoice_prstClr"/>
</resource>
- <resource name="CT_Color" resource="Properties"/>
- <resource name="CT_ColorMRU" resource="Properties"/>
+ <resource name="CT_Color" resource="Properties" tag="shape"/>
+ <resource name="CT_ColorMRU" resource="Properties" tag="shape"/>
<resource name="ST_BlackWhiteMode" resource="List" generated="yes">
<value name="clr" tokenid="ooxml:Value_drawingml_ST_BlackWhiteMode_clr">clr</value>
<value name="auto" tokenid="ooxml:Value_drawingml_ST_BlackWhiteMode_auto">auto</value>
@@ -4713,7 +4713,7 @@
<value name="white" tokenid="ooxml:Value_drawingml_ST_BlackWhiteMode_white">white</value>
<value name="hidden" tokenid="ooxml:Value_drawingml_ST_BlackWhiteMode_hidden">hidden</value>
</resource>
- <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="AG_Blob" resource="Properties">
+ <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="AG_Blob" resource="Properties" tag="shape">
<attribute name="r:embed" tokenid="ooxml:AG_Blob_r_embed"/>
<attribute name="r:link" tokenid="ooxml:AG_Blob_r_link"/>
</resource>
@@ -5100,7 +5100,7 @@
</optional>
</define>
</grammar>
- <resource name="CT_GraphicalObjectFrameLocking" resource="Properties">
+ <resource name="CT_GraphicalObjectFrameLocking" resource="Properties" tag="shape">
<element name="extLst" tokenid="ooxml:CT_GraphicalObjectFrameLocking_extLst"/>
<attribute name="noGrp" tokenid="ooxml:CT_GraphicalObjectFrameLocking_noGrp"/>
<attribute name="noDrilldown" tokenid="ooxml:CT_GraphicalObjectFrameLocking_noDrilldown"/>
@@ -5109,7 +5109,7 @@
<attribute name="noMove" tokenid="ooxml:CT_GraphicalObjectFrameLocking_noMove"/>
<attribute name="noResize" tokenid="ooxml:CT_GraphicalObjectFrameLocking_noResize"/>
</resource>
- <resource name="CT_NonVisualDrawingProps" resource="Properties">
+ <resource name="CT_NonVisualDrawingProps" resource="Properties" tag="shape">
<element name="hlinkClick" tokenid="ooxml:CT_NonVisualDrawingProps_hlinkClick"/>
<element name="hlinkHover" tokenid="ooxml:CT_NonVisualDrawingProps_hlinkHover"/>
<element name="extLst" tokenid="ooxml:CT_NonVisualDrawingProps_extLst"/>
@@ -5118,12 +5118,12 @@
<attribute name="descr" tokenid="ooxml:CT_NonVisualDrawingProps_descr"/>
<attribute name="hidden" tokenid="ooxml:CT_NonVisualDrawingProps_hidden"/>
</resource>
- <resource name="CT_NonVisualPictureProperties" resource="Properties">
+ <resource name="CT_NonVisualPictureProperties" resource="Properties" tag="shape">
<element name="picLocks" tokenid="ooxml:CT_NonVisualPictureProperties_picLocks"/>
<element name="extLst" tokenid="ooxml:CT_NonVisualPictureProperties_extLst"/>
<attribute name="preferRelativeResize" tokenid="ooxml:CT_NonVisualPictureProperties_preferRelativeResize"/>
</resource>
- <resource name="CT_NonVisualGraphicFrameProperties" resource="Properties">
+ <resource name="CT_NonVisualGraphicFrameProperties" resource="Properties" tag="shape">
<element name="graphicFrameLocks" tokenid="ooxml:CT_NonVisualGraphicFrameProperties_graphicFrameLocks"/>
<element name="extLst" tokenid="ooxml:CT_NonVisualGraphicFrameProperties_extLst"/>
</resource>
@@ -5159,14 +5159,14 @@
</element>
</define>
</grammar>
- <resource name="CT_GraphicalObjectData" resource="Properties">
+ <resource name="CT_GraphicalObjectData" resource="Properties" tag="shape">
<element name="pic" tokenid="ooxml:CT_GraphicalObjectData_pic"/>
<attribute name="uri" tokenid="ooxml:CT_GraphicalObjectData_uri"/>
</resource>
- <resource name="CT_GraphicalObject" resource="Properties">
+ <resource name="CT_GraphicalObject" resource="Properties" tag="shape">
<element name="graphicData" tokenid="ooxml:CT_GraphicalObject_graphicData"/>
</resource>
- <resource name="graphic" resource="Properties">
+ <resource name="graphic" resource="Properties" tag="shape">
<element name="graphic" tokenid="ooxml:graphic_graphic"/>
</resource>
</namespace>
@@ -6271,7 +6271,7 @@
</resource>
<resource name="ST_GeomGuideName" resource="String" generated="yes"/>
<resource name="ST_GeomGuideFormula" resource="String" generated="yes"/>
- <resource name="CT_GeomGuideList" resource="Properties">
+ <resource name="CT_GeomGuideList" resource="Properties" tag="shape">
<element name="gd" tokenid="ooxml:CT_GeomGuideList_gd"/>
</resource>
<resource name="ST_PathFillMode" resource="List" generated="yes">
@@ -6282,11 +6282,11 @@
<value name="darken" tokenid="ooxml:Value_drawingml_ST_PathFillMode_darken">darken</value>
<value name="darkenLess" tokenid="ooxml:Value_drawingml_ST_PathFillMode_darkenLess">darkenLess</value>
</resource>
- <resource name="CT_PresetGeometry2D" resource="Properties">
+ <resource name="CT_PresetGeometry2D" resource="Properties" tag="shape">
<element name="avLst" tokenid="ooxml:CT_PresetGeometry2D_avLst"/>
<attribute name="prst" tokenid="ooxml:CT_PresetGeometry2D_prst"/>
</resource>
- <resource name="CT_CustomGeometry2D" resource="Properties">
+ <resource name="CT_CustomGeometry2D" resource="Properties" tag="shape">
<element name="avLst" tokenid="ooxml:CT_CustomGeometry2D_avLst"/>
<element name="gdLst" tokenid="ooxml:CT_CustomGeometry2D_gdLst"/>
<element name="ahLst" tokenid="ooxml:CT_CustomGeometry2D_ahLst"/>
@@ -6294,7 +6294,7 @@
<element name="rect" tokenid="ooxml:CT_CustomGeometry2D_rect"/>
<element name="pathLst" tokenid="ooxml:CT_CustomGeometry2D_pathLst"/>
</resource>
- <resource name="EG_Geometry" resource="Properties">
+ <resource name="EG_Geometry" resource="Properties" tag="shape">
<element name="custGeom" tokenid="ooxml:EG_Geometry_custGeom"/>
<element name="prstGeom" tokenid="ooxml:EG_Geometry_prstGeom"/>
</resource>
@@ -6764,14 +6764,14 @@
</element>
</define>
</grammar>
- <resource name="CT_EffectExtent" resource="Properties">
+ <resource name="CT_EffectExtent" resource="Properties" tag="shape">
<attribute name="l" tokenid="ooxml:CT_EffectExtent_l"/>
<attribute name="t" tokenid="ooxml:CT_EffectExtent_t"/>
<attribute name="r" tokenid="ooxml:CT_EffectExtent_r"/>
<attribute name="b" tokenid="ooxml:CT_EffectExtent_b"/>
</resource>
<resource name="ST_WrapDistance" resource="Integer" generated="yes"/>
- <resource xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="CT_Inline" resource="Properties">
+ <resource xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="CT_Inline" resource="Properties" tag="shape">
<element name="extent" tokenid="ooxml:CT_Inline_extent"/>
<element name="effectExtent" tokenid="ooxml:CT_Inline_effectExtent"/>
<element name="docPr" tokenid="ooxml:CT_Inline_docPr"/>
@@ -6788,13 +6788,13 @@
<value name="right" tokenid="ooxml:Value_wordprocessingDrawing_ST_WrapText_right">right</value>
<value name="largest" tokenid="ooxml:Value_wordprocessingDrawing_ST_WrapText_largest">largest</value>
</resource>
- <resource name="CT_WrapPath" resource="Properties">
+ <resource name="CT_WrapPath" resource="Properties" tag="shape">
<element name="start" tokenid="ooxml:CT_WrapPath_start"/>
<element name="lineTo" tokenid="ooxml:CT_WrapPath_lineTo"/>
<attribute name="edited" tokenid="ooxml:CT_WrapPath_edited"/>
</resource>
- <resource name="CT_WrapNone" resource="Properties"/>
- <resource name="CT_WrapSquare" resource="Properties">
+ <resource name="CT_WrapNone" resource="Properties" tag="shape"/>
+ <resource name="CT_WrapSquare" resource="Properties" tag="shape">
<element name="effectExtent" tokenid="ooxml:CT_WrapSquare_effectExtent"/>
<attribute name="wrapText" tokenid="ooxml:CT_WrapSquare_wrapText"/>
<attribute name="distT" tokenid="ooxml:CT_WrapSquare_distT"/>
@@ -6802,34 +6802,34 @@
<attribute name="distL" tokenid="ooxml:CT_WrapSquare_distL"/>
<attribute name="distR" tokenid="ooxml:CT_WrapSquare_distR"/>
</resource>
- <resource name="CT_WrapTight" resource="Properties">
+ <resource name="CT_WrapTight" resource="Properties" tag="shape">
<element name="wrapPolygon" tokenid="ooxml:CT_WrapTight_wrapPolygon"/>
<attribute name="wrapText" tokenid="ooxml:CT_WrapTight_wrapText"/>
<attribute name="distL" tokenid="ooxml:CT_WrapTight_distL"/>
<attribute name="distR" tokenid="ooxml:CT_WrapTight_distR"/>
</resource>
- <resource name="CT_WrapThrough" resource="Properties">
+ <resource name="CT_WrapThrough" resource="Properties" tag="shape">
<element name="wrapPolygon" tokenid="ooxml:CT_WrapThrough_wrapPolygon"/>
<attribute name="wrapText" tokenid="ooxml:CT_WrapThrough_wrapText"/>
<attribute name="distL" tokenid="ooxml:CT_WrapThrough_distL"/>
<attribute name="distR" tokenid="ooxml:CT_WrapThrough_distR"/>
</resource>
- <resource name="CT_WrapTopBottom" resource="Properties">
+ <resource name="CT_WrapTopBottom" resource="Properties" tag="shape">
<element name="effectExtent" tokenid="ooxml:CT_WrapTopBottom_effectExtent"/>
<attribute name="distT" tokenid="ooxml:CT_WrapTopBottom_distT"/>
<attribute name="distB" tokenid="ooxml:CT_WrapTopBottom_distB"/>
</resource>
- <resource name="EG_WrapType" resource="Properties">
+ <resource name="EG_WrapType" resource="Properties" tag="shape">
<element name="wrapNone" tokenid="ooxml:EG_WrapType_wrapNone"/>
<element name="wrapSquare" tokenid="ooxml:EG_WrapType_wrapSquare"/>
<element name="wrapTight" tokenid="ooxml:EG_WrapType_wrapTight"/>
<element name="wrapThrough" tokenid="ooxml:EG_WrapType_wrapThrough"/>
<element name="wrapTopAndBottom" tokenid="ooxml:EG_WrapType_wrapTopAndBottom"/>
</resource>
- <resource name="CT_PositionOffset" resource="Value"/>
+ <resource name="CT_PositionOffset" resource="Value" tag="shape"/>
<resource name="ST_PositionOffset" resource="Integer" generated="yes"/>
- <resource name="CT_AlignH" resource="Value"/>
- <resource name="ST_AlignH" resource="List" generated="yes">
+ <resource name="CT_AlignH" resource="Value" tag="shape"/>
+ <resource name="ST_AlignH" resource="List" generated="yes" tag="shape">
<value name="left" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignH_left">left</value>
<value name="right" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignH_right">right</value>
<value name="center" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignH_center">center</value>
@@ -6846,12 +6846,12 @@
<value name="insideMargin" tokenid="ooxml:Value_wordprocessingDrawing_ST_RelFromH_insideMargin">insideMargin</value>
<value name="outsideMargin" tokenid="ooxml:Value_wordprocessingDrawing_ST_RelFromH_outsideMargin">outsideMargin</value>
</resource>
- <resource name="CT_PosH" resource="Properties">
+ <resource name="CT_PosH" resource="Properties" tag="shape">
<element name="align" tokenid="ooxml:CT_PosH_align"/>
<element name="posOffset" tokenid="ooxml:CT_PosH_posOffset"/>
<attribute name="relativeFrom" tokenid="ooxml:CT_PosH_relativeFrom"/>
</resource>
- <resource name="CT_AlignV" resource="Value"/>
+ <resource name="CT_AlignV" resource="Value" tag="shape"/>
<resource name="ST_AlignV" resource="List" generated="yes">
<value name="top" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignV_top">top</value>
<value name="bottom" tokenid="ooxml:Value_wordprocessingDrawing_ST_AlignV_bottom">bottom</value>
@@ -6869,12 +6869,12 @@
<value name="insideMargin" tokenid="ooxml:Value_wordprocessingDrawing_ST_RelFromV_insideMargin">insideMargin</value>
<value name="outsideMargin" tokenid="ooxml:Value_wordprocessingDrawing_ST_RelFromV_outsideMargin">outsideMargin</value>
</resource>
- <resource name="CT_PosV" resource="Properties">
+ <resource name="CT_PosV" resource="Properties" tag="shape">
<element name="align" tokenid="ooxml:CT_PosV_align"/>
<element name="posOffset" tokenid="ooxml:CT_PosV_posOffset"/>
<attribute name="relativeFrom" tokenid="ooxml:CT_PosV_relativeFrom"/>
</resource>
- <resource xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="CT_Anchor" resource="Properties">
+ <resource xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="CT_Anchor" resource="Properties" tag="shape">
<element name="simplePos" tokenid="ooxml:CT_Anchor_simplePos_elem"/>
<element name="positionH" tokenid="ooxml:CT_Anchor_positionH"/>
<element name="positionV" tokenid="ooxml:CT_Anchor_positionV"/>
@@ -6895,10 +6895,10 @@
<attribute name="hidden" tokenid="ooxml:CT_Anchor_hidden"/>
<attribute name="allowOverlap" tokenid="ooxml:CT_Anchor_allowOverlap"/>
</resource>
- <resource name="inline" resource="Properties">
+ <resource name="inline" resource="Properties" tag="shape">
<element name="inline" tokenid="ooxml:inline_inline"/>
</resource>
- <resource name="anchor" resource="Properties">
+ <resource name="anchor" resource="Properties" tag="shape">
<element name="anchor" tokenid="ooxml:anchor_anchor"/>
</resource>
</namespace>
@@ -8206,27 +8206,27 @@
</define>
</grammar>
<resource name="ST_Integer255" resource="Integer" generated="yes"/>
- <resource name="CT_Integer255" resource="Value" generated="yes">
+ <resource name="CT_Integer255" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Integer255_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_Integer2" resource="Integer" generated="yes"/>
- <resource name="CT_Integer2" resource="Value" generated="yes">
+ <resource name="CT_Integer2" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Integer2_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_SpacingRule" resource="Integer" generated="yes"/>
- <resource name="CT_SpacingRule" resource="Value" generated="yes">
+ <resource name="CT_SpacingRule" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_SpacingRule_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_UnSignedInteger" resource="Integer" generated="yes"/>
- <resource name="CT_UnSignedInteger" resource="Value" generated="yes">
+ <resource name="CT_UnSignedInteger" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_UnSignedInteger_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_Char" resource="String" generated="yes"/>
- <resource name="CT_Char" resource="Value" generated="yes">
+ <resource name="CT_Char" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Char_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -8234,12 +8234,12 @@
<value name="on" tokenid="ooxml:Value_math_ST_OnOff_on">on</value>
<value name="off" tokenid="ooxml:Value_math_ST_OnOff_off">off</value>
</resource>
- <resource name="CT_OnOff" resource="Value">
+ <resource name="CT_OnOff" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_OnOff_val" action="setValue"/>
<action name="start" action="setDefaultBooleanValue"/>
</resource>
<resource name="ST_String" resource="String" generated="yes"/>
- <resource name="CT_String" resource="Value" generated="yes">
+ <resource name="CT_String" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_String_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -8248,7 +8248,7 @@
<value name="center" tokenid="ooxml:Value_math_ST_XAlign_center">center</value>
<value name="right" tokenid="ooxml:Value_math_ST_XAlign_right">right</value>
</resource>
- <resource name="CT_XAlign" resource="Value" generated="yes">
+ <resource name="CT_XAlign" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_XAlign_val" action="setValue"/>
</resource>
<resource name="ST_YAlign" resource="List" generated="yes">
@@ -8256,14 +8256,14 @@
<value name="center" tokenid="ooxml:Value_math_ST_YAlign_center">center</value>
<value name="bot" tokenid="ooxml:Value_math_ST_YAlign_bot">bot</value>
</resource>
- <resource name="CT_YAlign" resource="Value" generated="yes">
+ <resource name="CT_YAlign" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_YAlign_val" action="setValue"/>
</resource>
<resource name="ST_Shp" resource="List" generated="yes">
<value name="centered" tokenid="ooxml:Value_math_ST_Shp_centered">centered</value>
<value name="match" tokenid="ooxml:Value_math_ST_Shp_match">match</value>
</resource>
- <resource name="CT_Shp" resource="Value" generated="yes">
+ <resource name="CT_Shp" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_Shp_val" action="setValue"/>
</resource>
<resource name="ST_FType" resource="List" generated="yes">
@@ -8272,21 +8272,21 @@
<value name="lin" tokenid="ooxml:Value_math_ST_FType_lin">lin</value>
<value name="noBar" tokenid="ooxml:Value_math_ST_FType_noBar">noBar</value>
</resource>
- <resource name="CT_FType" resource="Value" generated="yes">
+ <resource name="CT_FType" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_FType_val" action="setValue"/>
</resource>
<resource name="ST_LimLoc" resource="List" generated="yes">
<value name="undOvr" tokenid="ooxml:Value_math_ST_LimLoc_undOvr">undOvr</value>
<value name="subSup" tokenid="ooxml:Value_math_ST_LimLoc_subSup">subSup</value>
</resource>
- <resource name="CT_LimLoc" resource="Value" generated="yes">
+ <resource name="CT_LimLoc" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_LimLoc_val" action="setValue"/>
</resource>
<resource name="ST_TopBot" resource="List" generated="yes">
<value name="top" tokenid="ooxml:Value_math_ST_TopBot_top">top</value>
<value name="bot" tokenid="ooxml:Value_math_ST_TopBot_bot">bot</value>
</resource>
- <resource name="CT_TopBot" resource="Value" generated="yes">
+ <resource name="CT_TopBot" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_TopBot_val" action="setValue"/>
</resource>
<resource name="ST_Script" resource="List" generated="yes">
@@ -8297,7 +8297,7 @@
<value name="sansmserif" tokenid="ooxml:Value_math_ST_Script_sansmserif">sans-serif</value>
<value name="monospace" tokenid="ooxml:Value_math_ST_Script_monospace">monospace</value>
</resource>
- <resource name="CT_Script" resource="Value" generated="yes">
+ <resource name="CT_Script" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_Script_val" action="setValue"/>
</resource>
<resource name="ST_Style" resource="List">
@@ -8306,7 +8306,7 @@
<value tokenid="ooxml:Value_ST_Style_i">i</value>
<value tokenid="ooxml:Value_ST_Style_p">p</value>
</resource>
- <resource name="CT_Style" resource="Value">
+ <resource name="CT_Style" resource="Value" tag="math">
<attribute name="val" tokenid="ooxml:CT_Style_val" action="setValue"/>
</resource>
<resource name="ST_Jc" resource="List" generated="yes">
@@ -8317,11 +8317,11 @@
<value name="center" tokenid="ooxml:Value_math_ST_Jc_center">center</value>
<value name="centerGroup" tokenid="ooxml:Value_math_ST_Jc_centerGroup">centerGroup</value>
</resource>
- <resource name="CT_OMathJc" resource="Value" generated="yes">
+ <resource name="CT_OMathJc" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_OMathJc_val" action="setValue"/>
</resource>
<resource name="ST_TwipsMeasure" resource="Integer" generated="yes"/>
- <resource name="CT_TwipsMeasure" resource="Value" generated="yes">
+ <resource name="CT_TwipsMeasure" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_TwipsMeasure_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
@@ -8330,7 +8330,7 @@
<value name="after" tokenid="ooxml:Value_math_ST_BreakBin_after">after</value>
<value name="repeat" tokenid="ooxml:Value_math_ST_BreakBin_repeat">repeat</value>
</resource>
- <resource name="CT_BreakBin" resource="Value" generated="yes">
+ <resource name="CT_BreakBin" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_BreakBin_val" action="setValue"/>
</resource>
<resource name="ST_BreakBinSub" resource="List" generated="yes">
@@ -8338,7 +8338,7 @@
<value name="mp" tokenid="ooxml:Value_math_ST_BreakBinSub_mp">-+</value>
<value name="pm" tokenid="ooxml:Value_math_ST_BreakBinSub_pm">+-</value>
</resource>
- <resource name="CT_BreakBinSub" resource="Value" generated="yes">
+ <resource name="CT_BreakBinSub" resource="Value" generated="yes" tag="math">
<attribute name="val" tokenid="ooxml:CT_BreakBinSub_val" action="setValue"/>
</resource>
</namespace>
@@ -8424,16 +8424,16 @@
</element>
</define>
</grammar>
- <resource name="CT_PictureNonVisual" resource="Properties">
+ <resource name="CT_PictureNonVisual" resource="Properties" tag="shape">
<element name="cNvPr" tokenid="ooxml:CT_PictureNonVisual_cNvPr"/>
<element name="cNvPicPr" tokenid="ooxml:CT_PictureNonVisual_cNvPicPr"/>
</resource>
- <resource name="CT_Picture" resource="Shape">
+ <resource name="CT_Picture" resource="Shape" tag="shape">
<element name="nvPicPr" tokenid="ooxml:CT_Picture_nvPicPr"/>
<element name="blipFill" tokenid="ooxml:CT_Picture_blipFill"/>
<element name="spPr" tokenid="ooxml:CT_Picture_spPr"/>
</resource>
- <resource name="pic" resource="Properties">
+ <resource name="pic" resource="Properties" tag="shape">
<element name="pic" tokenid="ooxml:pic_pic"/>
</resource>
</namespace>
@@ -11945,10 +11945,10 @@
</zeroOrMore>
</define>
</grammar>
- <resource name="OLEObject" resource="Properties">
+ <resource name="OLEObject" resource="Properties" tag="ole">
<element name="OLEObject" tokenid="ooxml:OLEObject_OLEObject"/>
</resource>
- <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_OLEObject" resource="Properties">
+ <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_OLEObject" resource="Properties" tag="ole">
<element name="LinkType" tokenid="ooxml:CT_OLEObject_LinkType"/>
<element name="LockedField" tokenid="ooxml:CT_OLEObject_LockedField"/>
<element name="FieldCodes" tokenid="ooxml:CT_OLEObject_FieldCodes"/>
@@ -12326,10 +12326,10 @@
</list>
</define>
</grammar>
- <resource name="wrap" resource="Properties">
+ <resource name="wrap" resource="Properties" tag="shape">
<element name="wrap" tokenid="ooxml:wrap_wrap"/>
</resource>
- <resource name="CT_Wrap" resource="Properties">
+ <resource name="CT_Wrap" resource="Properties" tag="shape">
<attribute name="type" tokenid="ooxml:CT_Wrap_type"/>
<attribute name="side" tokenid="ooxml:CT_Wrap_side"/>
<attribute name="anchorx" tokenid="ooxml:CT_Wrap_anchorx"/>
@@ -13996,6 +13996,11 @@
</choice>
</list>
</define>
+ <define name="ST_Percentage">
+ <data type="int">
+ <xs:documentation>Percentage</xs:documentation>
+ </data>
+ </define>
<define name="CT_Zoom">
<optional>
<attribute name="val">
@@ -21094,77 +21099,77 @@
</zeroOrMore>
</define>
</grammar>
- <resource name="CT_Empty" resource="Stream">
+ <resource name="CT_Empty" resource="Stream" tag="content">
<action name="end" tokenid="ooxml:EG_RunInnerContent_noBreakHyphen" action="noBreakHyphen"/>
<action name="end" tokenid="ooxml:EG_RunInnerContent_softHyphen" action="softHyphen"/>
<action name="end" tokenid="ooxml:EG_RunInnerContent_cr" action="cr"/>
</resource>
<resource name="ST_OnOff" resource="Boolean"/>
- <resource name="CT_OnOff" resource="Value">
+ <resource name="CT_OnOff" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_OnOff_val" action="setValue"/>
<action name="start" action="setDefaultBooleanValue"/>
</resource>
<resource name="ST_LongHexNumber" resource="Hex"/>
- <resource name="CT_LongHexNumber" resource="Value">
+ <resource name="CT_LongHexNumber" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_LongHexNumber_val" action="setValue"/>
<action name="start" action="setDefaultHexValue"/>
</resource>
<resource name="ST_ShortHexNumber" resource="Hex"/>
- <resource name="CT_ShortHexNumber" resource="Value">
+ <resource name="CT_ShortHexNumber" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_ShortHexNumber_val" action="setValue"/>
<action name="start" action="setDefaultHexValue"/>
</resource>
<resource name="ST_UcharHexNumber" resource="Hex"/>
- <resource name="CT_UcharHexNumber" resource="Value">
+ <resource name="CT_UcharHexNumber" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_UcharHexNumber_val" action="setValue"/>
<action name="start" action="setDefaultHexValue"/>
</resource>
<resource name="ST_DecimalNumber" resource="Integer"/>
- <resource name="CT_DecimalNumber" resource="Value">
+ <resource name="CT_DecimalNumber" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_DecimalNumber_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_UnsignedDecimalNumber" resource="Integer" generated="yes"/>
<resource name="ST_TwipsMeasure" resource="Integer"/>
- <resource name="CT_TwipsMeasure" resource="Value">
+ <resource name="CT_TwipsMeasure" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_TwipsMeasure_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_SignedTwipsMeasure" resource="Integer"/>
- <resource name="CT_SignedTwipsMeasure" resource="Value">
+ <resource name="CT_SignedTwipsMeasure" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_SignedTwipsMeasure_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_PixelsMeasure" resource="Integer" generated="yes"/>
- <resource name="CT_PixelsMeasure" resource="Value">
+ <resource name="CT_PixelsMeasure" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_PixelsMeasure_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_HpsMeasure" resource="Integer"/>
- <resource name="CT_HpsMeasure" resource="Value">
+ <resource name="CT_HpsMeasure" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_HpsMeasure_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_SignedHpsMeasure" resource="Integer"/>
- <resource name="CT_SignedHpsMeasure" resource="Value">
+ <resource name="CT_SignedHpsMeasure" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_SignedHpsMeasure_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_DateTime" resource="String" generated="yes"/>
<resource name="ST_MacroName" resource="String" generated="yes"/>
- <resource name="CT_MacroName" resource="Value" generated="yes">
+ <resource name="CT_MacroName" resource="Value" generated="yes" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_MacroName_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
<resource name="ST_EighthPointMeasure" resource="Integer"/>
<resource name="ST_PointMeasure" resource="Integer"/>
<resource name="ST_String" resource="String"/>
- <resource name="CT_String" resource="Value">
+ <resource name="CT_String" resource="Value" tag="attribute" >
<attribute name="val" tokenid="ooxml:CT_String_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
<resource name="ST_TextScale" resource="Integer"/>
- <resource name="CT_TextScale" resource="Value">
+ <resource name="CT_TextScale" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_TextScale_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
@@ -21187,7 +21192,7 @@
<value tokenid="16">lightGray</value>
<value tokenid="0">none</value>
</resource>
- <resource name="CT_Highlight" resource="Value">
+ <resource name="CT_Highlight" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Highlight_val" action="setValue"/>
</resource>
<resource name="ST_HexColorAuto" resource="List">
@@ -21195,7 +21200,7 @@
</resource>
<resource name="ST_HexColorRGB" resource="Hex"/>
<resource name="ST_HexColor" resource="Hex"/>
- <resource name="CT_Color" resource="Properties">
+ <resource name="CT_Color" resource="Properties" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Color_val"/>
<attribute name="themeColor" tokenid="ooxml:CT_Color_themeColor"/>
<attribute name="themeTint" tokenid="ooxml:CT_Color_themeTint"/>
@@ -21203,12 +21208,12 @@
</resource>
<resource name="ST_LangCode" resource="Hex" generated="yes"/>
<resource name="ST_Lang" resource="String"/>
- <resource name="CT_Lang" resource="Value">
+ <resource name="CT_Lang" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Lang_val" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
<resource name="ST_Guid" resource="String"/>
- <resource name="CT_Guid" resource="Value">
+ <resource name="CT_Guid" resource="Value" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Guid_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -21232,7 +21237,7 @@
<value tokenid="43">wavyDouble</value>
<value tokenid="0">none</value>
</resource>
- <resource name="CT_Underline" resource="Properties">
+ <resource name="CT_Underline" resource="Properties" tag="character">
<attribute name="val" tokenid="ooxml:CT_Underline_val" default="single"/>
<attribute name="color" tokenid="ooxml:CT_Underline_color"/>
<attribute name="themeColor" tokenid="ooxml:CT_Underline_themeColor"/>
@@ -21248,7 +21253,7 @@
<value tokenid="5">antsRed</value>
<value tokenid="6">shimmer</value>
</resource>
- <resource name="CT_TextEffect" resource="Value">
+ <resource name="CT_TextEffect" resource="Value" tag="character">
<attribute name="val" tokenid="ooxml:CT_TextEffect_val" action="setValue"/>
</resource>
<resource name="ST_Border" resource="List">
@@ -21444,7 +21449,7 @@
<value tokenid="226">zigZag</value>
<value tokenid="227">zigZagStitch</value>
</resource>
- <resource name="CT_Border" resource="Properties">
+ <resource name="CT_Border" resource="Properties" tag="attribute">
<attribute name="val" tokenid="rtf:BRCTYPE"/>
<attribute name="color" tokenid="ooxml:CT_Border_color"/>
<attribute name="themeColor" tokenid="ooxml:CT_Border_themeColor"/>
@@ -21495,7 +21500,7 @@
<value tokenid="13">pct90</value>
<value tokenid="60">pct95</value>
</resource>
- <resource name="CT_Shd" resource="Properties">
+ <resource name="CT_Shd" resource="Properties" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Shd_val"/>
<attribute name="color" tokenid="ooxml:CT_Shd_color"/>
<attribute name="themeColor" tokenid="ooxml:CT_Shd_themeColor"/>
@@ -21506,16 +21511,16 @@
<attribute name="themeFillTint" tokenid="ooxml:CT_Shd_themeFillTint"/>
<attribute name="themeFillShade" tokenid="ooxml:CT_Shd_themeFillShade"/>
</resource>
- <resource name="ST_VerticalAlignRun" resource="List" generated="yes">
+ <resource name="ST_VerticalAlignRun" resource="List" generated="yes" tag="character">
<value name="baseline" tokenid="ooxml:Value_wordprocessingml_ST_VerticalAlignRun_baseline">baseline</value>
<value name="superscript" tokenid="ooxml:Value_wordprocessingml_ST_VerticalAlignRun_superscript">superscript</value>
<value name="subscript" tokenid="ooxml:Value_wordprocessingml_ST_VerticalAlignRun_subscript">subscript</value>
</resource>
- <resource name="CT_VerticalAlignRun" resource="Value" generated="yes">
+ <resource name="CT_VerticalAlignRun" resource="Value" generated="yes" tag="character">
<attribute name="val" tokenid="ooxml:CT_VerticalAlignRun_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_FitText" resource="Properties">
+ <resource name="CT_FitText" resource="Properties" tag="paragraph">
<attribute name="val" tokenid="ooxml:CT_FitText_val"/>
<attribute name="id" tokenid="ooxml:CT_FitText_id"/>
</resource>
@@ -21526,10 +21531,10 @@
<value tokenid="3">circle</value>
<value tokenid="4">underDot</value>
</resource>
- <resource name="CT_Em" resource="Value">
+ <resource name="CT_Em" resource="Value" tag="character">
<attribute name="val" tokenid="ooxml:CT_Em_val" action="setValue"/>
</resource>
- <resource name="CT_Language" resource="Properties">
+ <resource name="CT_Language" resource="Properties" tag="character">
<attribute name="val" tokenid="ooxml:CT_Language_val"/>
<attribute name="eastAsia" tokenid="ooxml:CT_Language_eastAsia"/>
<attribute name="bidi" tokenid="ooxml:CT_Language_bidi"/>
@@ -21541,7 +21546,7 @@
<value tokenid="3">angle</value>
<value tokenid="4">curly</value>
</resource>
- <resource name="CT_EastAsianLayout" resource="Properties">
+ <resource name="CT_EastAsianLayout" resource="Properties" tag="character">
<attribute name="id" tokenid="ooxml:CT_EastAsianLayout_id"/>
<attribute name="combine" tokenid="ooxml:CT_EastAsianLayout_combine"/>
<attribute name="combineBrackets" tokenid="ooxml:CT_EastAsianLayout_combineBrackets"/>
@@ -21591,7 +21596,7 @@
<value name="drop" tokenid="ooxml:Value_wordprocessingml_ST_DropCap_drop">drop</value>
<value name="margin" tokenid="ooxml:Value_wordprocessingml_ST_DropCap_margin">margin</value>
</resource>
- <resource name="CT_FramePr" resource="Properties">
+ <resource name="CT_FramePr" resource="Properties" tag="frame">
<kind name="paragraph"/>
<attribute name="dropCap" tokenid="ooxml:CT_FramePr_dropCap"/>
<attribute name="lines" tokenid="ooxml:CT_FramePr_lines"/>
@@ -21626,7 +21631,7 @@
<value tokenid="4">heavy</value>
<value tokenid="ooxml:Value_ST_TabTlc_middleDot">middleDot</value>
</resource>
- <resource name="CT_TabStop" resource="Properties">
+ <resource name="CT_TabStop" resource="Properties" tag="paragraph">
<attribute name="val" tokenid="ooxml:CT_TabStop_val"/>
<attribute name="leader" tokenid="ooxml:CT_TabStop_leader"/>
<attribute name="pos" tokenid="ooxml:CT_TabStop_pos"/>
@@ -21636,7 +21641,7 @@
<value name="exact" tokenid="ooxml:Value_wordprocessingml_ST_LineSpacingRule_exact">exact</value>
<value name="atLeast" tokenid="ooxml:Value_wordprocessingml_ST_LineSpacingRule_atLeast">atLeast</value>
</resource>
- <resource name="CT_Spacing" resource="Properties">
+ <resource name="CT_Spacing" resource="Properties" tag="paragraüh">
<attribute name="before" tokenid="ooxml:CT_Spacing_before"/>
<attribute name="beforeLines" tokenid="ooxml:CT_Spacing_beforeLines"/>
<attribute name="beforeAutospacing" tokenid="ooxml:CT_Spacing_beforeAutospacing"/>
@@ -21646,7 +21651,7 @@
<attribute name="line" tokenid="ooxml:CT_Spacing_line"/>
<attribute name="lineRule" tokenid="ooxml:CT_Spacing_lineRule"/>
</resource>
- <resource name="CT_Ind" resource="Properties">
+ <resource name="CT_Ind" resource="Properties" tag="paragraph">
<attribute name="end" tokenid="ooxml:CT_Ind_end"/>
<attribute name="endChars" tokenid="ooxml:CT_Ind_endChars"/>
<attribute name="start" tokenid="ooxml:CT_Ind_start"/>
@@ -21675,7 +21680,7 @@
<value tokenid="ooxml:Value_ST_Jc_lowKashida">lowKashida</value>
<value tokenid="ooxml:Value_ST_Jc_thaiDistribute">thaiDistribute</value>
</resource>
- <resource name="CT_Jc" resource="Value">
+ <resource name="CT_Jc" resource="Value" tag="character">
<attribute name="val" tokenid="ooxml:CT_Jc_val" action="setValue"/>
</resource>
<resource name="ST_View" resource="List" generated="yes">
@@ -21686,7 +21691,7 @@
<value name="normal" tokenid="ooxml:Value_wordprocessingml_ST_View_normal">normal</value>
<value name="web" tokenid="ooxml:Value_wordprocessingml_ST_View_web">web</value>
</resource>
- <resource name="CT_View" resource="Properties">
+ <resource name="CT_View" resource="Properties" tag="settings">
<attribute name="val" tokenid="ooxml:CT_View_val"/>
</resource>
<resource name="ST_Zoom" resource="List" generated="yes">
@@ -21695,11 +21700,11 @@
<value name="bestFit" tokenid="ooxml:Value_wordprocessingml_ST_Zoom_bestFit">bestFit</value>
<value name="textFit" tokenid="ooxml:Value_wordprocessingml_ST_Zoom_textFit">textFit</value>
</resource>
- <resource name="CT_Zoom" resource="Properties">
+ <resource name="CT_Zoom" resource="Properties" tag="settings">
<attribute name="val" tokenid="ooxml:CT_Zoom_val"/>
<attribute name="percent" tokenid="ooxml:CT_Zoom_percent"/>
</resource>
- <resource name="CT_WritingStyle" resource="Properties">
+ <resource name="CT_WritingStyle" resource="Properties" tag="settings">
<attribute name="lang" tokenid="ooxml:CT_WritingStyle_lang"/>
<attribute name="vendorID" tokenid="ooxml:CT_WritingStyle_vendorID"/>
<attribute name="dllVersion" tokenid="ooxml:CT_WritingStyle_dllVersion"/>
@@ -21711,7 +21716,7 @@
<value name="clean" tokenid="ooxml:Value_wordprocessingml_ST_Proof_clean">clean</value>
<value name="dirty" tokenid="ooxml:Value_wordprocessingml_ST_Proof_dirty">dirty</value>
</resource>
- <resource name="CT_Proof" resource="Properties">
+ <resource name="CT_Proof" resource="Properties" tag="redline">
<attribute name="spelling" tokenid="ooxml:CT_Proof_spelling"/>
<attribute name="grammar" tokenid="ooxml:CT_Proof_grammar"/>
</resource>
@@ -21720,7 +21725,7 @@
<value name="letter" tokenid="ooxml:Value_wordprocessingml_ST_DocType_letter">letter</value>
<value name="eMail" tokenid="ooxml:Value_wordprocessingml_ST_DocType_eMail">eMail</value>
</resource>
- <resource name="CT_DocType" resource="Properties">
+ <resource name="CT_DocType" resource="Properties" tag="document">
<attribute name="val" tokenid="ooxml:CT_DocType_val"/>
</resource>
<resource name="ST_DocProtect" resource="List" generated="yes">
@@ -21754,7 +21759,7 @@
<attribute name="hash" tokenid="ooxml:AG_Password_hash"/>
<attribute name="salt" tokenid="ooxml:AG_Password_salt"/>
</resource>
- <resource name="CT_DocProtect" resource="Properties">
+ <resource name="CT_DocProtect" resource="Properties" tag="document">
<attribute name="edit" tokenid="ooxml:CT_DocProtect_edit"/>
<attribute name="formatting" tokenid="ooxml:CT_DocProtect_formatting"/>
<attribute name="enforcement" tokenid="ooxml:CT_DocProtect_enforcement"/>
@@ -21767,7 +21772,7 @@
<value name="email" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeDocType_email">email</value>
<value name="fax" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeDocType_fax">fax</value>
</resource>
- <resource name="CT_MailMergeDocType" resource="Value" generated="yes">
+ <resource name="CT_MailMergeDocType" resource="Value" generated="yes" tag="mailmerge">
<attribute name="val" tokenid="ooxml:CT_MailMergeDocType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -21779,7 +21784,7 @@
<value name="odbc" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeDataType_odbc">odbc</value>
<value name="native" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeDataType_native">native</value>
</resource>
- <resource name="CT_MailMergeDataType" resource="Value" generated="yes">
+ <resource name="CT_MailMergeDataType" resource="Value" generated="yes" tag="mailmerge">
<attribute name="val" tokenid="ooxml:CT_MailMergeDataType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -21789,7 +21794,7 @@
<value name="email" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeDest_email">email</value>
<value name="fax" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeDest_fax">fax</value>
</resource>
- <resource name="CT_MailMergeDest" resource="Value" generated="yes">
+ <resource name="CT_MailMergeDest" resource="Value" generated="yes" tag="mailmerge">
<attribute name="val" tokenid="ooxml:CT_MailMergeDest_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -21797,18 +21802,18 @@
<value name="null" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeOdsoFMDFieldType_null">null</value>
<value name="dbColumn" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeOdsoFMDFieldType_dbColumn">dbColumn</value>
</resource>
- <resource name="CT_MailMergeOdsoFMDFieldType" resource="Value" generated="yes">
+ <resource name="CT_MailMergeOdsoFMDFieldType" resource="Value" generated="yes" tag="mailmerge">
<attribute name="val" tokenid="ooxml:CT_MailMergeOdsoFMDFieldType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_TrackChangesView" resource="Properties">
+ <resource name="CT_TrackChangesView" resource="Properties" tag="redline">
<attribute name="markup" tokenid="ooxml:CT_TrackChangesView_markup"/>
<attribute name="comments" tokenid="ooxml:CT_TrackChangesView_comments"/>
<attribute name="insDel" tokenid="ooxml:CT_TrackChangesView_insDel"/>
<attribute name="formatting" tokenid="ooxml:CT_TrackChangesView_formatting"/>
<attribute name="inkAnnotations" tokenid="ooxml:CT_TrackChangesView_inkAnnotations"/>
</resource>
- <resource name="CT_Kinsoku" resource="Properties">
+ <resource name="CT_Kinsoku" resource="Properties" tag="character">
<attribute name="lang" tokenid="ooxml:CT_Kinsoku_lang"/>
<attribute name="val" tokenid="ooxml:CT_Kinsoku_val"/>
</resource>
@@ -21820,7 +21825,7 @@
<value tokenid="5">tbRlV</value>
<value tokenid="ooxml:Value_ST_TextDirection_tbLrV">tbLrV</value>
</resource>
- <resource name="CT_TextDirection" resource="Value">
+ <resource name="CT_TextDirection" resource="Value" tag="paragraph">
<attribute name="val" tokenid="ooxml:CT_TextDirection_val" action="setValue"/>
</resource>
<resource name="ST_TextAlignment" resource="List" generated="yes">
@@ -21830,7 +21835,7 @@
<value name="bottom" tokenid="ooxml:Value_wordprocessingml_ST_TextAlignment_bottom">bottom</value>
<value name="auto" tokenid="ooxml:Value_wordprocessingml_ST_TextAlignment_auto">auto</value>
</resource>
- <resource name="CT_TextAlignment" resource="Value" generated="yes">
+ <resource name="CT_TextAlignment" resource="Value" generated="yes" tag="paragraph">
<attribute name="val" tokenid="ooxml:CT_TextAlignment_val" action="setValue"/>
</resource>
<resource name="ST_DisplacedByCustomXml" resource="List" generated="yes">
@@ -21841,80 +21846,80 @@
<value name="cont" tokenid="ooxml:Value_wordprocessingml_ST_AnnotationVMerge_cont">cont</value>
<value name="rest" tokenid="ooxml:Value_wordprocessingml_ST_AnnotationVMerge_rest">rest</value>
</resource>
- <resource name="CT_Markup" resource="Properties">
+ <resource name="CT_Markup" resource="Properties" tag="redline">
<attribute name="id" tokenid="ooxml:CT_Markup_id"/>
</resource>
- <resource name="CT_TrackChange" resource="Properties">
+ <resource name="CT_TrackChange" resource="Properties" tag="redline">
<attribute name="author" tokenid="ooxml:CT_TrackChange_author"/>
<attribute name="date" tokenid="ooxml:CT_TrackChange_date"/>
</resource>
- <resource name="CT_CellMergeTrackChange" resource="Properties">
+ <resource name="CT_CellMergeTrackChange" resource="Properties" tag="redline">
<attribute name="vMerge" tokenid="ooxml:CT_CellMergeTrackChange_vMerge"/>
<attribute name="vMergeOrig" tokenid="ooxml:CT_CellMergeTrackChange_vMergeOrig"/>
</resource>
- <resource name="CT_TrackChangeRange" resource="Properties">
+ <resource name="CT_TrackChangeRange" resource="Properties" tag="redline">
<attribute name="displacedByCustomXml" tokenid="ooxml:CT_TrackChangeRange_displacedByCustomXml"/>
</resource>
- <resource name="CT_MarkupRange" resource="Properties">
+ <resource name="CT_MarkupRange" resource="Properties" tag="redline">
<attribute name="displacedByCustomXml" tokenid="ooxml:CT_MarkupRange_displacedByCustomXml"/>
</resource>
- <resource name="CT_MarkupRangeBookmark" resource="Properties">
+ <resource name="CT_MarkupRangeBookmark" resource="Properties" tag="redline">
<attribute name="id" tokenid="rtf:IBKL"/>
</resource>
- <resource name="CT_BookmarkRange" resource="Properties">
+ <resource name="CT_BookmarkRange" resource="Properties" tag="reference">
<type name="Bookmark"/>
<attribute name="colFirst" tokenid="ooxml:CT_BookmarkRange_colFirst"/>
<attribute name="colLast" tokenid="ooxml:CT_BookmarkRange_colLast"/>
</resource>
- <resource name="CT_Bookmark" resource="Properties">
+ <resource name="CT_Bookmark" resource="Properties" tag="reference">
<type name="Bookmark"/>
<attribute name="name" tokenid="rtf:BOOKMARKNAME"/>
</resource>
- <resource name="CT_MoveBookmark" resource="Properties">
+ <resource name="CT_MoveBookmark" resource="Properties" tag="reference">
<attribute name="author" tokenid="ooxml:CT_MoveBookmark_author"/>
<attribute name="date" tokenid="ooxml:CT_MoveBookmark_date"/>
</resource>
- <resource name="CT_Comment" resource="XNote">
+ <resource name="CT_Comment" resource="XNote" tag="content">
<attribute name="id" action="checkId"/>
<attribute name="initials" tokenid="ooxml:CT_Comment_initials"/>
</resource>
- <resource name="CT_TrackChangeNumbering" resource="Properties">
+ <resource name="CT_TrackChangeNumbering" resource="Properties" tag="numbering">
<attribute name="original" tokenid="ooxml:CT_TrackChangeNumbering_original"/>
</resource>
- <resource name="CT_TblPrExChange" resource="Properties">
+ <resource name="CT_TblPrExChange" resource="Properties" tag="table">
<element name="tblPrEx" tokenid="ooxml:CT_TblPrExChange_tblPrEx"/>
</resource>
- <resource name="CT_TcPrChange" resource="Properties">
+ <resource name="CT_TcPrChange" resource="Properties" tag="table">
<element name="tcPr" tokenid="ooxml:CT_TcPrChange_tcPr"/>
</resource>
- <resource name="CT_TrPrChange" resource="Properties">
+ <resource name="CT_TrPrChange" resource="Properties" tag="table">
<element name="trPr" tokenid="ooxml:CT_TrPrChange_trPr"/>
</resource>
- <resource name="CT_TblGridChange" resource="Properties">
+ <resource name="CT_TblGridChange" resource="Properties" tag="table">
<element name="tblGrid" tokenid="ooxml:CT_TblGridChange_tblGrid"/>
</resource>
- <resource name="CT_TblPrChange" resource="Properties">
+ <resource name="CT_TblPrChange" resource="Properties" tag="table">
<element name="tblPr" tokenid="ooxml:CT_TblPrChange_tblPr"/>
</resource>
- <resource name="CT_SectPrChange" resource="Properties">
+ <resource name="CT_SectPrChange" resource="Properties" tag="section">
<element name="sectPr" tokenid="ooxml:CT_SectPrChange_sectPr"/>
</resource>
- <resource name="CT_PPrChange" resource="Properties">
+ <resource name="CT_PPrChange" resource="Properties" tag="paragraph">
<element name="pPr" tokenid="ooxml:CT_PPrChange_pPr"/>
</resource>
- <resource name="CT_RPrChange" resource="Properties">
+ <resource name="CT_RPrChange" resource="Properties" tag="character">
<element name="rPr" tokenid="ooxml:CT_RPrChange_rPr"/>
</resource>
- <resource name="CT_ParaRPrChange" resource="Properties">
+ <resource name="CT_ParaRPrChange" resource="Properties" tag="character">
<element name="rPr" tokenid="ooxml:CT_ParaRPrChange_rPr"/>
</resource>
- <resource name="CT_RunTrackChange" resource="Stream">
+ <resource name="CT_RunTrackChange" resource="Stream" tag="redlines">
<action name="start" action="tokenproperty"/>
<action name="start" action="propagateCharacterPropertiesAsSet" sendtokenid="ooxml:trackchange"/>
<action name="start" action="clearProps"/>
<action name="end" action="mark" sendtokenid="ooxml:endtrackchange"/>
</resource>
- <resource name="EG_RangeMarkupElements" resource="Properties">
+ <resource name="EG_RangeMarkupElements" resource="Properties" tag="redlines">
<element name="bookmarkStart" tokenid="ooxml:EG_RangeMarkupElements_bookmarkStart"/>
<element name="bookmarkEnd" tokenid="ooxml:EG_RangeMarkupElements_bookmarkEnd"/>
<element name="moveFromRangeStart" tokenid="ooxml:EG_RangeMarkupElements_moveFromRangeStart"/>
@@ -21932,14 +21937,14 @@
<element name="customXmlMoveToRangeStart" tokenid="ooxml:EG_RangeMarkupElements_customXmlMoveToRangeStart"/>
<element name="customXmlMoveToRangeEnd" tokenid="ooxml:EG_RangeMarkupElements_customXmlMoveToRangeEnd"/>
</resource>
- <resource name="CT_NumPr" resource="Properties">
+ <resource name="CT_NumPr" resource="Properties" tag="numbering">
<kind name="paragraph"/>
<element name="ilvl" tokenid="sprm:PIlvl"/>
<element name="numId" tokenid="sprm:PIlfo"/>
<element name="numberingChange" tokenid="ooxml:CT_NumPr_numberingChange"/>
<element name="ins" tokenid="ooxml:CT_NumPr_ins"/>
</resource>
- <resource name="CT_PBdr" resource="Properties">
+ <resource name="CT_PBdr" resource="Properties" tag="paragraph">
<kind name="paragraph"/>
<element name="top" tokenid="sprm:PBrcTop"/>
<element name="left" tokenid="sprm:PBrcLeft"/>
@@ -21948,7 +21953,7 @@
<element name="between" tokenid="sprm:PBrcBetween"/>
<element name="bar" tokenid="sprm:PBrcBar"/>
</resource>
- <resource name="CT_Tabs" resource="Properties">
+ <resource name="CT_Tabs" resource="Properties" tag="paragraph">
<element name="tab" tokenid="ooxml:CT_Tabs_tab"/>
</resource>
<resource name="ST_TextboxTightWrap" resource="List" generated="yes">
@@ -21958,11 +21963,11 @@
<value name="firstLineOnly" tokenid="ooxml:Value_wordprocessingml_ST_TextboxTightWrap_firstLineOnly">firstLineOnly</value>
<value name="lastLineOnly" tokenid="ooxml:Value_wordprocessingml_ST_TextboxTightWrap_lastLineOnly">lastLineOnly</value>
</resource>
- <resource name="CT_TextboxTightWrap" resource="Value" generated="yes">
+ <resource name="CT_TextboxTightWrap" resource="Value" generated="yes" tag="textbox">
<attribute name="val" tokenid="ooxml:CT_TextboxTightWrap_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_PPrBase" resource="Properties">
+ <resource name="CT_PPrBase" resource="Properties" tag="paragraph">
<kind name="paragraph"/>
<element name="pStyle" tokenid="ooxml:CT_PPrBase_pStyle"/>
<element name="keepNext" tokenid="sprm:PFKeepFollow"/>
@@ -21998,12 +22003,12 @@
<element name="divId" tokenid="ooxml:CT_PPrBase_divId"/>
<element name="cnfStyle" tokenid="ooxml:CT_PPrBase_cnfStyle"/>
</resource>
- <resource name="CT_PPr" resource="Properties">
+ <resource name="CT_PPr" resource="Properties" tag="paragraph">
<element name="rPr" tokenid="ooxml:CT_PPr_rPr"/>
<element name="sectPr" tokenid="ooxml:CT_PPr_sectPr"/>
<element name="pPrChange" tokenid="ooxml:CT_PPr_pPrChange"/>
</resource>
- <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_Control" resource="Properties">
+ <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_Control" resource="Properties" tag="control">
<attribute name="name" tokenid="ooxml:CT_Control_name"/>
<attribute name="shapeid" tokenid="ooxml:CT_Control_shapeid"/>
<attribute name="r:id" tokenid="ooxml:CT_Control_r_id"/>
@@ -22017,24 +22022,24 @@
<resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_Rel" resource="Properties">
<attribute name="r:id" tokenid="ooxml:CT_Rel_id"/>
</resource>
- <resource name="CT_PictureBase" resource="Properties"/>
- <resource name="CT_Object" resource="Shape">
+ <resource name="CT_PictureBase" resource="Properties" tag="shape"/>
+ <resource name="CT_Object" resource="Shape" tag="shape">
<element name="control" tokenid="ooxml:CT_Object_control"/>
<attribute name="dxaOrig" tokenid="ooxml:CT_Object_dxaOrig"/>
<attribute name="dyaOrig" tokenid="ooxml:CT_Object_dyaOrig"/>
<action name="end" action="sendPropertiesWithId" sendtokenid="ooxml:object"/>
<action name="end" action="clearProps"/>
</resource>
- <resource name="CT_Picture" resource="Shape">
+ <resource name="CT_Picture" resource="Shape" tag="shape">
<element name="movie" tokenid="ooxml:CT_Picture_movie"/>
<element name="control" tokenid="ooxml:CT_Picture_control"/>
<action name="end" action="sendPropertiesWithId" sendtokenid="ooxml:object"/>
<action name="end" action="clearProps"/>
</resource>
- <resource name="CT_Drawing" resource="Properties">
+ <resource name="CT_Drawing" resource="Properties" tag="shape">
<action name="end" action="handlePicture"/>
</resource>
- <resource name="CT_SimpleField" resource="Stream">
+ <resource name="CT_SimpleField" resource="Stream" tag="field">
<element name="fldData" tokenid="ooxml:CT_SimpleField_fldData"/>
<attribute name="instr" tokenid="ooxml:CT_SimpleField_instr"/>
<attribute name="fldLock" tokenid="ooxml:CT_SimpleField_fldLock"/>
@@ -22066,15 +22071,15 @@
<value name="currentDate" tokenid="ooxml:Value_wordprocessingml_ST_FFTextType_currentDate">currentDate</value>
<value name="calculated" tokenid="ooxml:Value_wordprocessingml_ST_FFTextType_calculated">calculated</value>
</resource>
- <resource name="CT_FFTextType" resource="Value" generated="yes">
+ <resource name="CT_FFTextType" resource="Value" generated="yes" tag="field">
<attribute name="val" tokenid="ooxml:CT_FFTextType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_FFName" resource="Value" generated="yes">
+ <resource name="CT_FFName" resource="Value" generated="yes" tag="field">
<attribute name="val" tokenid="ooxml:CT_FFName_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_FldChar" resource="Stream">
+ <resource name="CT_FldChar" resource="Stream" tag="field">
<element name="fldData" tokenid="ooxml:CT_FldChar_fldData"/>
<element name="ffData" tokenid="ooxml:CT_FldChar_ffData"/>
<element name="numberingChange" tokenid="ooxml:CT_FldChar_numberingChange"/>
@@ -22091,7 +22096,7 @@
<cond tokenid="ooxml:CT_FldChar_fldCharType" value="ooxml:Value_ST_FldCharType_end"/>
</action>
</resource>
- <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_Hyperlink" resource="Stream">
+ <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_Hyperlink" resource="Stream" tag="link">
<attribute name="tgtFrame" tokenid="ooxml:CT_Hyperlink_tgtFrame"/>
<attribute name="tooltip" tokenid="ooxml:CT_Hyperlink_tooltip"/>
<attribute name="docLocation" tokenid="ooxml:CT_Hyperlink_docLocation"/>
@@ -22103,7 +22108,7 @@
<action name="start" action="fieldsep"/>
<action name="end" action="fieldend"/>
</resource>
- <resource name="CT_FFData" resource="Properties">
+ <resource name="CT_FFData" resource="Properties" tag="field">
<element name="name" tokenid="ooxml:CT_FFData_name"/>
<element name="enabled" tokenid="ooxml:CT_FFData_enabled"/>
<element name="calcOnExit" tokenid="ooxml:CT_FFData_calcOnExit"/>
@@ -22117,39 +22122,39 @@
<action name="end" action="propagateCharacterPropertiesAsSet" sendtokenid="ooxml:ffdata"/>
<action name="end" action="clearProps"/>
</resource>
- <resource name="CT_FFHelpText" resource="Properties">
+ <resource name="CT_FFHelpText" resource="Properties" tag="field">
<attribute name="type" tokenid="ooxml:CT_FFHelpText_type"/>
<attribute name="val" tokenid="ooxml:CT_FFHelpText_val"/>
</resource>
- <resource name="CT_FFStatusText" resource="Properties">
+ <resource name="CT_FFStatusText" resource="Properties" tag="field">
<attribute name="type" tokenid="ooxml:CT_FFStatusText_type"/>
<attribute name="val" tokenid="ooxml:CT_FFStatusText_val"/>
</resource>
- <resource name="CT_FFCheckBox" resource="Properties">
+ <resource name="CT_FFCheckBox" resource="Properties" tag="field">
<element name="size" tokenid="ooxml:CT_FFCheckBox_size"/>
<element name="sizeAuto" tokenid="ooxml:CT_FFCheckBox_sizeAuto"/>
<element name="default" tokenid="ooxml:CT_FFCheckBox_default"/>
<element name="checked" tokenid="ooxml:CT_FFCheckBox_checked"/>
</resource>
- <resource name="CT_FFDDList" resource="Properties">
+ <resource name="CT_FFDDList" resource="Properties" tag="field">
<element name="result" tokenid="ooxml:CT_FFDDList_result"/>
<element name="default" tokenid="ooxml:CT_FFDDList_default"/>
<element name="listEntry" tokenid="ooxml:CT_FFDDList_listEntry"/>
</resource>
- <resource name="CT_FFTextInput" resource="Properties">
+ <resource name="CT_FFTextInput" resource="Properties" tag="field">
<element name="type" tokenid="ooxml:CT_FFTextInput_type"/>
<element name="default" tokenid="ooxml:CT_FFTextInput_default"/>
<element name="maxLength" tokenid="ooxml:CT_FFTextInput_maxLength"/>
<element name="format" tokenid="ooxml:CT_FFTextInput_format"/>
</resource>
- <resource name="ST_SectionMark" resource="List">
+ <resource name="ST_SectionMark" resource="List" tag="section">
<value tokenid="0">continuous</value>
<value tokenid="1">nextColumn</value>
<value tokenid="2">nextPage</value>
<value tokenid="3">evenPage</value>
<value tokenid="4">oddPage</value>
</resource>
- <resource name="CT_SectType" resource="Value">
+ <resource name="CT_SectType" resource="Value" tag="section">
<attribute name="val" tokenid="ooxml:CT_SectType_val" action="setValue"/>
</resource>
<resource name="ST_NumberFormat" resource="List">
@@ -22218,13 +22223,13 @@
<value tokenid="0">portrait</value>
<value tokenid="1">landscape</value>
</resource>
- <resource name="CT_PageSz" resource="Properties">
+ <resource name="CT_PageSz" resource="Properties" tag="page">
<attribute name="w" tokenid="ooxml:CT_PageSz_w"/>
<attribute name="h" tokenid="ooxml:CT_PageSz_h"/>
<attribute name="orient" tokenid="ooxml:CT_PageSz_orient"/>
<attribute name="code" tokenid="ooxml:CT_PageSz_code"/>
</resource>
- <resource name="CT_PageMar" resource="Properties">
+ <resource name="CT_PageMar" resource="Properties" tag="page">
<attribute name="top" tokenid="ooxml:CT_PageMar_top"/>
<attribute name="right" tokenid="ooxml:CT_PageMar_right"/>
<attribute name="bottom" tokenid="ooxml:CT_PageMar_bottom"/>
@@ -22246,7 +22251,7 @@
<value name="page" tokenid="ooxml:Value_wordprocessingml_ST_PageBorderOffset_page">page</value>
<value name="text" tokenid="ooxml:Value_wordprocessingml_ST_PageBorderOffset_text">text</value>
</resource>
- <resource name="CT_PageBorders" resource="Properties">
+ <resource name="CT_PageBorders" resource="Properties" tag="page">
<element name="top" tokenid="ooxml:CT_PageBorders_top"/>
<element name="left" tokenid="ooxml:CT_PageBorders_left"/>
<element name="bottom" tokenid="ooxml:CT_PageBorders_bottom"/>
@@ -22267,23 +22272,23 @@
<value tokenid="1">newSection</value>
<value tokenid="2">continuous</value>
</resource>
- <resource name="CT_LineNumber" resource="Properties">
+ <resource name="CT_LineNumber" resource="Properties" tag="section">
<attribute name="countBy" tokenid="ooxml:CT_LineNumber_countBy"/>
<attribute name="start" tokenid="ooxml:CT_LineNumber_start"/>
<attribute name="distance" tokenid="ooxml:CT_LineNumber_distance"/>
<attribute name="restart" tokenid="ooxml:CT_LineNumber_restart"/>
</resource>
- <resource name="CT_PageNumber" resource="Properties">
+ <resource name="CT_PageNumber" resource="Properties" tag="page">
<attribute name="fmt" tokenid="ooxml:CT_PageNumber_fmt"/>
<attribute name="start" tokenid="ooxml:CT_PageNumber_start"/>
<attribute name="chapStyle" tokenid="ooxml:CT_PageNumber_chapStyle"/>
<attribute name="chapSep" tokenid="ooxml:CT_PageNumber_chapSep"/>
</resource>
- <resource name="CT_Column" resource="Properties">
+ <resource name="CT_Column" resource="Properties" tag="page">
<attribute name="space" tokenid="ooxml:CT_Column_space"/>
<attribute name="w" tokenid="ooxml:CT_Column_w"/>
</resource>
- <resource name="CT_Columns" resource="Properties">
+ <resource name="CT_Columns" resource="Properties" tag="page">
<attribute name="equalWidth" tokenid="ooxml:CT_Columns_equalWidth"/>
<attribute name="space" tokenid="ooxml:CT_Columns_space"/>
<attribute name="num" tokenid="ooxml:CT_Columns_num"/>
@@ -22296,7 +22301,7 @@
<value tokenid="2">both</value>
<value tokenid="3">bottom</value>
</resource>
- <resource name="CT_VerticalJc" resource="Value">
+ <resource name="CT_VerticalJc" resource="Value" tag="page">
<attribute name="val" tokenid="ooxml:CT_VerticalJc_val" action="setValue"/>
</resource>
<resource name="ST_DocGrid" resource="List" generated="yes">
@@ -22305,7 +22310,7 @@
<value name="linesAndChars" tokenid="ooxml:Value_wordprocessingml_ST_DocGrid_linesAndChars">linesAndChars</value>
<value name="snapToChars" tokenid="ooxml:Value_wordprocessingml_ST_DocGrid_snapToChars">snapToChars</value>
</resource>
- <resource name="CT_DocGrid" resource="Properties">
+ <resource name="CT_DocGrid" resource="Properties" tag="document">
<attribute name="type" tokenid="ooxml:CT_DocGrid_type"/>
<attribute name="linePitch" tokenid="ooxml:CT_DocGrid_linePitch"/>
<attribute name="charSpace" tokenid="ooxml:CT_DocGrid_charSpace"/>
@@ -22321,17 +22326,17 @@
<value name="continuationSeparator" tokenid="ooxml:Value_wordprocessingml_ST_FtnEdn_continuationSeparator">continuationSeparator</value>
<value name="continuationNotice" tokenid="ooxml:Value_wordprocessingml_ST_FtnEdn_continuationNotice">continuationNotice</value>
</resource>
- <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_HdrFtrRef" resource="Properties">
+ <resource xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" name="CT_HdrFtrRef" resource="Properties" tag="header">
<attribute name="type" tokenid="ooxml:CT_HdrFtrRef_type"/>
<attribute name="r:id" tokenid="ooxml:CT_HdrFtrRef_id"/>
<action name="end" action="handleHdrFtr"/>
</resource>
- <resource name="EG_HdrFtrReferences" resource="Properties">
+ <resource name="EG_HdrFtrReferences" resource="Properties" tag="header">
<element name="headerReference" tokenid="ooxml:EG_HdrFtrReferences_headerReference"/>
<element name="footerReference" tokenid="ooxml:EG_HdrFtrReferences_footerReference"/>
</resource>
- <resource name="CT_HdrFtr" resource="Stream"/>
- <resource name="EG_SectPrContents" resource="Properties">
+ <resource name="CT_HdrFtr" resource="Stream" tag="header"/>
+ <resource name="EG_SectPrContents" resource="Properties" tag="section">
<element name="bidi" tokenid="ooxml:EG_SectPrContents_bidi"/>
<element name="cols" tokenid="ooxml:EG_SectPrContents_cols"/>
<element name="docGrid" tokenid="ooxml:EG_SectPrContents_docGrid"/>
@@ -22352,8 +22357,8 @@
<element name="type" tokenid="sprm:SBkc"/>
<element name="vAlign" tokenid="ooxml:EG_SectPrContents_vAlign"/>
</resource>
- <resource name="CT_SectPrBase" resource="Properties"/>
- <resource name="CT_SectPr" resource="Properties">
+ <resource name="CT_SectPrBase" resource="Properties" tag="section"/>
+ <resource name="CT_SectPr" resource="Properties" tag="section">
<element name="sectPrChange" tokenid="ooxml:CT_SectPr_sectPrChange"/>
<action name="start" action="setLastParagraphInSection"/>
</resource>
@@ -22368,7 +22373,7 @@
<value tokenid="ooxml:Value_ST_BrClear_right">right</value>
<value tokenid="ooxml:Value_ST_BrClear_all">all</value>
</resource>
- <resource name="CT_Br" resource="Properties">
+ <resource name="CT_Br" resource="Properties" tag="content">
<attribute name="type" tokenid="ooxml:CT_Br_type"/>
<attribute name="clear" tokenid="ooxml:CT_Br_clear"/>
<action name="end" action="handleBreak"/>
@@ -22389,13 +22394,13 @@
<value tokenid="ooxml:Value_ST_PTabLeader_underscore">underscore</value>
<value tokenid="ooxml:Value_ST_PTabLeader_middleDot">middleDot</value>
</resource>
- <resource name="CT_PTab" resource="Stream">
+ <resource name="CT_PTab" resource="Stream" tag="paragraph">
<attribute name="alignment" tokenid="ooxml:CT_PTab_alignment"/>
<attribute name="relativeTo" tokenid="ooxml:CT_PTab_relativeTo"/>
<attribute name="leader" tokenid="ooxml:CT_PTab_leader"/>
<action name="end" action="tab"/>
</resource>
- <resource name="CT_Sym" resource="Properties">
+ <resource name="CT_Sym" resource="Properties" tag="character">
<attribute name="font" tokenid="ooxml:CT_Sym_font"/>
<attribute name="char" tokenid="ooxml:CT_Sym_char"/>
</resource>
@@ -22414,29 +22419,29 @@
<value name="owners" tokenid="ooxml:Value_wordprocessingml_ST_EdGrp_owners">owners</value>
<value name="current" tokenid="ooxml:Value_wordprocessingml_ST_EdGrp_current">current</value>
</resource>
- <resource name="CT_Text" resource="Stream">
+ <resource name="CT_Text" resource="Stream" tag="content">
<attribute name="xml:space" tokenid="ooxml:CT_Text_space"/>
<action name="characters" action="text"/>
</resource>
- <resource name="CT_FtnEdnRefChar" resource="Stream">
+ <resource name="CT_FtnEdnRefChar" resource="Stream" tag="reference">
<action name="end" action="ftnednref"/>
</resource>
- <resource name="CT_FtnEdnSep" resource="Stream">
+ <resource name="CT_FtnEdnSep" resource="Stream" tag="reference">
<action name="end" action="ftnednsep"/>
</resource>
- <resource name="CT_FtnEdnCont" resource="Stream">
+ <resource name="CT_FtnEdnCont" resource="Stream" tag="reference">
<action name="end" action="ftnedncont"/>
</resource>
- <resource name="CT_PgNum" resource="Stream">
+ <resource name="CT_PgNum" resource="Stream" tag="reference">
<action name="end" action="pgNum"/>
</resource>
- <resource name="CT_Cr" resource="Stream">
+ <resource name="CT_Cr" resource="Stream" tag="content">
<action name="end" action="endOfParagraph"/>
</resource>
- <resource name="CT_Tab" resource="Stream">
+ <resource name="CT_Tab" resource="Stream" tag="content">
<action name="end" action="tab"/>
</resource>
- <resource name="EG_RunInnerContent" resource="Stream">
+ <resource name="EG_RunInnerContent" resource="Stream" tag="content">
<element name="br" tokenid="ooxml:EG_RunInnerContent_br"/>
<element name="t" tokenid="ooxml:EG_RunInnerContent_t"/>
<element name="delText" tokenid="ooxml:EG_RunInnerContent_delText"/>
@@ -22470,7 +22475,7 @@
<element name="ptab" tokenid="ooxml:EG_RunInnerContent_ptab"/>
<element name="lastRenderedPageBreak" tokenid="ooxml:EG_RunInnerContent_lastRenderedPageBreak"/>
</resource>
- <resource name="CT_R" resource="Stream">
+ <resource name="CT_R" resource="Stream" tag="content">
<action name="start" action="startCharacterGroup"/>
</resource>
<resource name="ST_Hint" resource="List">
@@ -22488,7 +22493,7 @@
<value tokenid="ooxml:Value_ST_Theme_minorAscii">minorAscii</value>
<value tokenid="ooxml:Value_ST_Theme_minorHAnsi">minorHAnsi</value>
</resource>
- <resource name="CT_Fonts" resource="Properties">
+ <resource name="CT_Fonts" resource="Properties" tag="font">
<attribute name="hint" tokenid="ooxml:CT_Fonts_hint"/>
<attribute name="ascii" tokenid="ooxml:CT_Fonts_ascii"/>
<attribute name="hAnsi" tokenid="ooxml:CT_Fonts_hAnsi"/>
@@ -22499,7 +22504,7 @@
<attribute name="eastAsiaTheme" tokenid="ooxml:CT_Fonts_eastAsiaTheme"/>
<attribute name="cstheme" tokenid="ooxml:CT_Fonts_cstheme"/>
</resource>
- <resource name="EG_RPrBase" resource="Properties">
+ <resource name="EG_RPrBase" resource="Properties" tag="paragraph">
<kind name="paragraph"/>
<element name="rStyle" tokenid="ooxml:EG_RPrBase_rStyle"/>
<element name="rFonts" tokenid="ooxml:EG_RPrBase_rFonts"/>
@@ -22541,19 +22546,19 @@
<element name="specVanish" tokenid="0x818"/>
<element name="oMath" tokenid="ooxml:EG_RPrBase_oMath"/>
</resource>
- <resource name="EG_RPrContent" resource="Properties">
+ <resource name="EG_RPrContent" resource="Properties" tag="character">
<element name="rPrChange" tokenid="ooxml:EG_RPrContent_rPrChange"/>
</resource>
- <resource name="CT_RPr" resource="Properties">
+ <resource name="CT_RPr" resource="Properties" tag="character">
</resource>
- <resource name="CT_RPrOriginal" resource="Properties"/>
- <resource name="CT_ParaRPrOriginal" resource="Properties"/>
- <resource name="CT_ParaRPr" resource="Properties">
+ <resource name="CT_RPrOriginal" resource="Properties" tag="character"/>
+ <resource name="CT_ParaRPrOriginal" resource="Properties" tag="paragraph"/>
+ <resource name="CT_ParaRPr" resource="Properties" tag="redline">
<element name="ins" tokenid="ooxml:CT_ParaRPr_ins"/>
<element name="del" tokenid="ooxml:CT_ParaRPr_del"/>
<element name="rPrChange" tokenid="ooxml:CT_ParaRPr_rPrChange"/>
</resource>
- <resource name="CT_ParaTrackChange" resource="Properties">
+ <resource name="CT_ParaTrackChange" resource="Properties" tag="redline">
<action name="start" action="tokenproperty"/>
<action name="start" action="propagateCharacterPropertiesAsSet" sendtokenid="ooxml:paratrackchange"/>
<action name="start" action="clearProps"/>
@@ -22566,7 +22571,7 @@
<value name="right" tokenid="ooxml:Value_wordprocessingml_ST_RubyAlign_right">right</value>
<value name="rightVertical" tokenid="ooxml:Value_wordprocessingml_ST_RubyAlign_rightVertical">rightVertical</value>
</resource>
- <resource name="CT_RubyAlign" resource="Value" generated="yes">
+ <resource name="CT_RubyAlign" resource="Value" generated="yes" tag="character">
<attribute name="val" tokenid="ooxml:CT_RubyAlign_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -22576,7 +22581,7 @@
<value name="unlocked" tokenid="ooxml:Value_wordprocessingml_ST_Lock_unlocked">unlocked</value>
<value name="sdtContentLocked" tokenid="ooxml:Value_wordprocessingml_ST_Lock_sdtContentLocked">sdtContentLocked</value>
</resource>
- <resource name="CT_Lock" resource="Value" generated="yes">
+ <resource name="CT_Lock" resource="Value" generated="yes" tag="content">
<attribute name="val" tokenid="ooxml:CT_Lock_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -22585,7 +22590,7 @@
<value name="date" tokenid="ooxml:Value_wordprocessingml_ST_SdtDateMappingType_date">date</value>
<value name="dateTime" tokenid="ooxml:Value_wordprocessingml_ST_SdtDateMappingType_dateTime">dateTime</value>
</resource>
- <resource name="CT_SdtDateMappingType" resource="Value" generated="yes">
+ <resource name="CT_SdtDateMappingType" resource="Value" generated="yes" tag="content">
<attribute name="val" tokenid="ooxml:CT_SdtDateMappingType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -22601,27 +22606,27 @@
<value name="gregorianXlitEnglish" tokenid="ooxml:Value_wordprocessingml_ST_CalendarType_gregorianXlitEnglish">gregorianXlitEnglish</value>
<value name="gregorianXlitFrench" tokenid="ooxml:Value_wordprocessingml_ST_CalendarType_gregorianXlitFrench">gregorianXlitFrench</value>
</resource>
- <resource name="CT_CalendarType" resource="Value" generated="yes">
+ <resource name="CT_CalendarType" resource="Value" generated="yes" tag="content">
<attribute name="val" tokenid="ooxml:CT_CalendarType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_SdtContentRun" resource="Properties"/>
- <resource name="CT_Attr" resource="Properties">
+ <resource name="CT_SdtContentRun" resource="Properties" tag="content"/>
+ <resource name="CT_Attr" resource="Properties" tag="content">
<attribute name="uri" tokenid="ooxml:CT_Attr_uri"/>
<attribute name="name" tokenid="ooxml:CT_Attr_name"/>
<attribute name="val" tokenid="ooxml:CT_Attr_val"/>
</resource>
- <resource name="CT_CustomXmlRun" resource="Properties">
+ <resource name="CT_CustomXmlRun" resource="Properties" tag="content">
<element name="customXmlPr" tokenid="ooxml:CT_CustomXmlRun_customXmlPr"/>
<attribute name="uri" tokenid="ooxml:CT_CustomXmlRun_uri"/>
<attribute name="element" tokenid="ooxml:CT_CustomXmlRun_element"/>
</resource>
- <resource name="CT_SmartTagRun" resource="Properties">
+ <resource name="CT_SmartTagRun" resource="Properties" tag="content">
<element name="smartTagPr" tokenid="ooxml:CT_SmartTagRun_smartTagPr"/>
<attribute name="uri" tokenid="ooxml:CT_SmartTagRun_uri"/>
<attribute name="element" tokenid="ooxml:CT_SmartTagRun_element"/>
</resource>
- <resource name="CT_SdtRun" resource="Properties">
+ <resource name="EG_PContent" resource="Properties" tag="content">
<element name="sdtPr" tokenid="ooxml:CT_SdtPr"/>
<element name="sdtEndPr" tokenid="ooxml:CT_SdtEndPr"/>
<element name="sdtContent" tokenid="ooxml:CT_SdtContentRun"/>
@@ -22632,12 +22637,12 @@
<element name="sdtContent" tokenid="ooxml:CT_SdtContentBlock"/>
</resource>
<resource name="CT_SdtContentBlock" resource="Properties"/>
- <resource name="EG_PContent" resource="Properties">
+ <resource name="EG_PContent" resource="Properties" tag ="content">
<element name="fldSimple" tokenid="ooxml:EG_PContent_fldSimple"/>
<element name="hyperlink" tokenid="ooxml:EG_PContent_hyperlink"/>
<element name="subDoc" tokenid="ooxml:EG_PContent_subDoc"/>
</resource>
- <resource name="CT_P" resource="Stream">
+ <resource name="CT_P" resource="Stream" tag="content">
<action name="start" action="handleLastParagraphInSection"/>
<action name="start" action="startParagraphGroup"/>
<action name="start" action="setHandle"/>
@@ -22650,27 +22655,27 @@
<value tokenid="ooxml:Value_ST_TblWidth_dxa">dxa</value>
<value tokenid="ooxml:Value_ST_TblWidth_auto">auto</value>
</resource>
- <resource name="CT_Height" resource="Properties">
+ <resource name="CT_Height" resource="Properties" tag="attribute">
<attribute name="val" tokenid="ooxml:CT_Height_val"/>
<attribute name="hRule" tokenid="ooxml:CT_Height_hRule"/>
</resource>
- <resource name="CT_TblWidth" resource="Properties">
+ <resource name="CT_TblWidth" resource="Properties" tag="table">
<attribute name="w" tokenid="ooxml:CT_TblWidth_w"/>
<attribute name="type" tokenid="ooxml:CT_TblWidth_type"/>
</resource>
- <resource name="CT_TblGridCol" resource="Value">
+ <resource name="CT_TblGridCol" resource="Value" tag="table">
<attribute name="w" tokenid="ooxml:CT_TblGridCol_w" action="setValue"/>
<action name="start" action="setDefaultIntegerValue"/>
</resource>
- <resource name="CT_TblGridBase" resource="Properties">
+ <resource name="CT_TblGridBase" resource="Properties" tag="table">
<element name="gridCol" tokenid="ooxml:CT_TblGridBase_gridCol"/>
</resource>
- <resource name="CT_TblGrid" resource="Properties">
+ <resource name="CT_TblGrid" resource="Properties" tag="table">
<element name="tblGridChange" tokenid="ooxml:CT_TblGrid_tblGridChange"/>
<action name="end" action="propagateTableProperties"/>
<action name="end" action="clearProps"/>
</resource>
- <resource name="CT_TcBorders" resource="Properties">
+ <resource name="CT_TcBorders" resource="Properties" tag="table">
<kind name="table"/>
<element name="top" tokenid="ooxml:CT_TcBorders_top"/>
<element name="left" tokenid="ooxml:CT_TcBorders_left"/>
@@ -22681,7 +22686,7 @@
<element name="tl2br" tokenid="ooxml:CT_TcBorders_tl2br"/>
<element name="tr2bl" tokenid="ooxml:CT_TcBorders_tr2bl"/>
</resource>
- <resource name="CT_TcMar" resource="Properties">
+ <resource name="CT_TcMar" resource="Properties" tag="table">
<kind name="table"/>
<element name="top" tokenid="ooxml:CT_TcMar_top"/>
<element name="left" tokenid="ooxml:CT_TcMar_left"/>
@@ -22693,13 +22698,13 @@
<value tokenid="ooxml:Value_ST_Merge_restart">restart</value>
<default tokenid="ooxml:Value_ST_Merge_continue"/>
</resource>
- <resource name="CT_VMerge" resource="Value">
+ <resource name="CT_VMerge" resource="Value" tag="table">
<attribute name="val" tokenid="ooxml:CT_VMerge_val" action="setValue"/>
</resource>
- <resource name="CT_HMerge" resource="Value">
+ <resource name="CT_HMerge" resource="Value" tag="table">
<attribute name="val" tokenid="ooxml:CT_HMerge_val" action="setValue"/>
</resource>
- <resource name="CT_TcPrBase" resource="Properties">
+ <resource name="CT_TcPrBase" resource="Properties" tag="table">
<kind name="table"/>
<element name="cnfStyle" tokenid="ooxml:CT_TcPrBase_cnfStyle"/>
<element name="tcW" tokenid="ooxml:CT_TcPrBase_tcW"/>
@@ -22715,12 +22720,12 @@
<element name="vAlign" tokenid="ooxml:CT_TcPrBase_vAlign"/>
<element name="hideMark" tokenid="ooxml:CT_TcPrBase_hideMark"/>
</resource>
- <resource name="CT_TcPr" resource="Properties">
+ <resource name="CT_TcPr" resource="Properties" tag="table">
<element name="tcPrChange" tokenid="ooxml:CT_TcPr_tcPrChange"/>
<action name="end" action="propagateCellProperties"/>
<action name="end" action="clearProps"/>
</resource>
- <resource name="CT_TcPrInner" resource="Properties"/>
+ <resource name="CT_TcPrInner" resource="Properties" tag="table"/>
<resource name="CT_Tc" resource="TextTableCell">
<action name="start" action="startCell"/>
<action name="end" action="endCell"/>
@@ -22728,11 +22733,11 @@
<action name="end" action="endParagraphGroup"/>
</resource>
<resource name="ST_Cnf" resource="String" generated="yes"/>
- <resource name="CT_Cnf" resource="Value" generated="yes">
+ <resource name="CT_Cnf" resource="Value" generated="yes" tag="content">
<attribute name="val" tokenid="ooxml:CT_Cnf_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_TrPrBase" resource="Properties">
+ <resource name="CT_TrPrBase" resource="Properties" tag="table">
<kind name="table"/>
<element name="cnfStyle" tokenid="ooxml:CT_TrPrBase_cnfStyle"/>
<element name="divId" tokenid="ooxml:CT_TrPrBase_divId"/>
@@ -22747,7 +22752,7 @@
<element name="jc" tokenid="ooxml:CT_TrPrBase_jc"/>
<element name="hidden" tokenid="ooxml:CT_TrPrBase_hidden"/>
</resource>
- <resource name="CT_TrPr" resource="Properties">
+ <resource name="CT_TrPr" resource="Properties" tag="table">
<kind name="table"/>
<element name="ins" tokenid="ooxml:CT_TrPr_ins"/>
<element name="del" tokenid="ooxml:CT_TrPr_del"/>
@@ -22755,7 +22760,7 @@
<action name="end" action="propagateRowProperties"/>
<action name="end" action="clearProps"/>
</resource>
- <resource name="CT_Row" resource="TextTableRow">
+ <resource name="CT_Row" resource="TextTableRow" tag="table">
<action name="start" action="startRow"/>
<action name="end" action="sendRowProperties"/>
<action name="end" action="sendTableProperties"/>
@@ -22769,16 +22774,16 @@
<value tokenid="ooxml:Value_ST_TblOverlap_never">never</value>
<value tokenid="ooxml:Value_ST_TblOverlap_overlap">overlap</value>
</resource>
- <resource name="CT_TblOverlap" resource="Value">
+ <resource name="CT_TblOverlap" resource="Value" tag="table">
<attribute name="val" tokenid="ooxml:CT_TblOverlap_val" action="setValue"/>
</resource>
- <resource name="CT_TblCellMar" resource="Properties">
+ <resource name="CT_TblCellMar" resource="Properties" tag="table">
<element name="top" tokenid="ooxml:CT_TblCellMar_top"/>
<element name="left" tokenid="ooxml:CT_TblCellMar_left"/>
<element name="bottom" tokenid="ooxml:CT_TblCellMar_bottom"/>
<element name="right" tokenid="ooxml:CT_TblCellMar_right"/>
</resource>
- <resource name="CT_TblBorders" resource="Properties">
+ <resource name="CT_TblBorders" resource="Properties" tag="table">
<kind name="table"/>
<element name="top" tokenid="ooxml:CT_TblBorders_top"/>
<element name="left" tokenid="ooxml:CT_TblBorders_left"/>
@@ -22787,7 +22792,7 @@
<element name="insideH" tokenid="ooxml:CT_TblBorders_insideH"/>
<element name="insideV" tokenid="ooxml:CT_TblBorders_insideV"/>
</resource>
- <resource name="CT_TblPrBase" resource="Properties">
+ <resource name="CT_TblPrBase" resource="Properties" tag="table">
<kind name="table"/>
<element name="tblStyle" tokenid="ooxml:CT_TblPrBase_tblStyle"/>
<element name="tblpPr" tokenid="ooxml:CT_TblPrBase_tblpPr"/>
@@ -22805,30 +22810,30 @@
<element name="tblCellMar" tokenid="ooxml:CT_TblPrBase_tblCellMar"/>
<element name="tblLook" tokenid="ooxml:CT_TblPrBase_tblLook"/>
</resource>
- <resource name="CT_TblPr" resource="Properties">
+ <resource name="CT_TblPr" resource="Properties" tag="table">
<kind name="table"/>
<element name="tblPrChange" tokenid="ooxml:CT_TblPr_tblPrChange"/>
<action name="end" action="propagateTableProperties"/>
<action name="end" action="clearProps"/>
</resource>
- <resource name="CT_Tbl" resource="TextTable"/>
+ <resource name="CT_Tbl" resource="TextTable" tag="table"/>
<resource name="ST_FtnPos" resource="List">
<value tokenid="ooxml:Value_ST_FtnPos_pageBottom">pageBottom</value>
<value tokenid="ooxml:Value_ST_FtnPos_beneathText">beneathText</value>
<value tokenid="ooxml:Value_ST_FtnPos_sectEnd">sectEnd</value>
<value tokenid="ooxml:Value_ST_FtnPos_docEnd">docEnd</value>
</resource>
- <resource name="CT_FtnPos" resource="Value">
+ <resource name="CT_FtnPos" resource="Value" tag="reference">
<attribute name="val" tokenid="ooxml:CT_FtnPos_val" action="setValue"/>
</resource>
<resource name="ST_EdnPos" resource="List">
<value tokenid="ooxml:Value_ST_EdnPos_sectEnd">sectEnd</value>
<value tokenid="ooxml:Value_ST_EdnPos_docEnd">docEnd</value>
</resource>
- <resource name="CT_EdnPos" resource="Value">
+ <resource name="CT_EdnPos" resource="Value" tag="reference">
<attribute name="val" tokenid="ooxml:CT_EdnPos_val" action="setValue"/>
</resource>
- <resource name="CT_NumFmt" resource="Value">
+ <resource name="CT_NumFmt" resource="Value" tag="numbering">
<attribute name="val" tokenid="ooxml:CT_NumFmt_val" action="setValue"/>
</resource>
<resource name="ST_RestartNumber" resource="List">
@@ -22836,42 +22841,42 @@
<value tokenid="ooxml:Value_ST_RestartNumber_eachSect">eachSect</value>
<value tokenid="ooxml:Value_ST_RestartNumber_eachPage">eachPage</value>
</resource>
- <resource name="CT_NumRestart" resource="Value">
+ <resource name="CT_NumRestart" resource="Value" tag="numbering">
<attribute name="val" tokenid="ooxml:CT_NumRestart_val" action="setValue"/>
</resource>
- <resource name="CT_FtnEdnRef" resource="Properties">
+ <resource name="CT_FtnEdnRef" resource="Properties" tag="reference">
<attribute name="customMarkFollows" tokenid="ooxml:CT_FtnEdnRef_customMarkFollows"/>
<attribute name="id" tokenid="ooxml:CT_FtnEdnRef_id" action="setXNoteId"/>
<action name="end" action="handleXNotes"/>
</resource>
- <resource name="CT_FtnEdnSepRef" resource="Properties">
+ <resource name="CT_FtnEdnSepRef" resource="Properties" tag="reference">
<attribute name="id" tokenid="ooxml:CT_FtnEdnSepRef_id"/>
</resource>
- <resource name="CT_FtnEdn" resource="XNote">
+ <resource name="CT_FtnEdn" resource="XNote" tag="reference">
<attribute name="type" tokenid="ooxml:CT_FtnEdn_type"/>
<attribute name="id" tokenid="ooxml:CT_FtnEdn_id" action="checkId"/>
<action name="start" action="propagateCharacterProperties"/>
<action name="end" action="endSectionGroup"/>
</resource>
- <resource name="CT_CommentRef" resource="Properties">
+ <resource name="CT_CommentRef" resource="Properties" tag="reference">
<action name="end" action="handleComment"/>
</resource>
- <resource name="EG_FtnEdnNumProps" resource="Properties">
+ <resource name="EG_FtnEdnNumProps" resource="Properties" tag="reference">
<element name="numStart" tokenid="ooxml:EG_FtnEdnNumProps_numStart"/>
<element name="numRestart" tokenid="ooxml:EG_FtnEdnNumProps_numRestart"/>
</resource>
- <resource name="CT_FtnProps" resource="Properties">
+ <resource name="CT_FtnProps" resource="Properties" tag="reference">
<element name="pos" tokenid="ooxml:CT_FtnProps_pos"/>
<element name="numFmt" tokenid="ooxml:CT_FtnProps_numFmt"/>
</resource>
- <resource name="CT_EdnProps" resource="Properties">
+ <resource name="CT_EdnProps" resource="Properties" tag="reference">
<element name="pos" tokenid="ooxml:CT_EdnProps_pos"/>
<element name="numFmt" tokenid="ooxml:CT_EdnProps_numFmt"/>
</resource>
- <resource name="CT_FtnDocProps" resource="Properties">
+ <resource name="CT_FtnDocProps" resource="Properties" tag="reference">
<element name="footnote" tokenid="ooxml:CT_FtnDocProps_footnote"/>
</resource>
- <resource name="CT_EdnDocProps" resource="Properties">
+ <resource name="CT_EdnDocProps" resource="Properties" tag="reference">
<element name="endnote" tokenid="ooxml:CT_EdnDocProps_endnote"/>
</resource>
<resource name="ST_MailMergeSourceType" resource="List" generated="yes">
@@ -22885,11 +22890,11 @@
<value name="legacy" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeSourceType_legacy">legacy</value>
<value name="master" tokenid="ooxml:Value_wordprocessingml_ST_MailMergeSourceType_master">master</value>
</resource>
- <resource name="CT_MailMergeSourceType" resource="Value" generated="yes">
+ <resource name="CT_MailMergeSourceType" resource="Value" generated="yes" tag="mailmerge">
<attribute name="val" tokenid="ooxml:CT_MailMergeSourceType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_MailMerge" resource="Properties">
+ <resource name="CT_MailMerge" resource="Properties" tag="mailmerge">
<element name="mainDocumentType" tokenid="ooxml:CT_MailMerge_mainDocumentType"/>
<element name="linkToQuery" tokenid="ooxml:CT_MailMerge_linkToQuery"/>
<element name="dataType" tokenid="ooxml:CT_MailMerge_dataType"/>
@@ -22920,11 +22925,11 @@
<value name="1800x1440" tokenid="ooxml:Value_wordprocessingml_ST_TargetScreenSz_1800x1440">1800x1440</value>
<value name="1920x1200" tokenid="ooxml:Value_wordprocessingml_ST_TargetScreenSz_1920x1200">1920x1200</value>
</resource>
- <resource name="CT_TargetScreenSz" resource="Value" generated="yes">
+ <resource name="CT_TargetScreenSz" resource="Value" generated="yes" tag="settings">
<attribute name="val" tokenid="ooxml:CT_TargetScreenSz_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_Compat" resource="Properties">
+ <resource name="CT_Compat" resource="Properties" tag="settings">
<element name="useSingleBorderforContiguousCells" tokenid="ooxml:CT_Compat_useSingleBorderforContiguousCells"/>
<element name="wpJustification" tokenid="ooxml:CT_Compat_wpJustification"/>
<element name="noTabHangInd" tokenid="ooxml:CT_Compat_noTabHangInd"/>
@@ -22991,11 +22996,11 @@
<element name="useAnsiKerningPairs" tokenid="ooxml:CT_Compat_useAnsiKerningPairs"/>
<element name="cachedColBalance" tokenid="ooxml:CT_Compat_cachedColBalance"/>
</resource>
- <resource name="CT_DocVar" resource="Properties">
+ <resource name="CT_DocVar" resource="Properties" tag="document">
<attribute name="name" tokenid="ooxml:CT_DocVar_name"/>
<attribute name="val" tokenid="ooxml:CT_DocVar_val"/>
</resource>
- <resource name="CT_DocRsids" resource="Properties">
+ <resource name="CT_DocRsids" resource="Properties" tag="redline">
<element name="rsidRoot" tokenid="ooxml:CT_DocRsids_rsidRoot"/>
<element name="rsid" tokenid="ooxml:CT_DocRsids_rsid"/>
</resource>
@@ -23004,21 +23009,21 @@
<value name="compressPunctuation" tokenid="ooxml:Value_wordprocessingml_ST_CharacterSpacing_compressPunctuation">compressPunctuation</value>
<value name="compressPunctuationAndJapaneseKana" tokenid="ooxml:Value_wordprocessingml_ST_CharacterSpacing_compressPunctuationAndJapaneseKana">compressPunctuationAndJapaneseKana</value>
</resource>
- <resource name="CT_CharacterSpacing" resource="Value" generated="yes">
+ <resource name="CT_CharacterSpacing" resource="Value" generated="yes" tag="character">
<attribute name="val" tokenid="ooxml:CT_CharacterSpacing_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_SaveThroughXslt" resource="Properties">
+ <resource name="CT_SaveThroughXslt" resource="Properties" tag="settings">
<attribute name="r:id" tokenid="ooxml:CT_SaveThroughXslt_r_id"/>
<attribute name="solutionID" tokenid="ooxml:CT_SaveThroughXslt_solutionID"/>
</resource>
- <resource name="CT_RPrDefault" resource="Properties">
+ <resource name="CT_RPrDefault" resource="Properties" tag="character">
<element name="rPr" tokenid="ooxml:CT_RPrDefault_rPr"/>
</resource>
- <resource name="CT_PPrDefault" resource="Properties">
+ <resource name="CT_PPrDefault" resource="Properties" tag="paragraph">
<element name="pPr" tokenid="ooxml:CT_PPrDefault_pPr"/>
</resource>
- <resource name="CT_DocDefaults" resource="Properties">
+ <resource name="CT_DocDefaults" resource="Properties" tag="document">
<element name="pPrDefault" tokenid="ooxml:CT_DocDefaults_pPrDefault"/>
<element name="rPrDefault" tokenid="ooxml:CT_DocDefaults_rPrDefault"/>
</resource>
@@ -23042,10 +23047,10 @@
<attribute name="h" tokenid="ooxml:CT_ReadingModeInkLockDown_h"/>
<attribute name="fontSz" tokenid="ooxml:CT_ReadingModeInkLockDown_fontSz"/>
</resource>
- <resource name="CT_WriteProtection" resource="Properties">
+ <resource name="CT_WriteProtection" resource="Properties" tag="document">
<attribute name="recommended" tokenid="ooxml:CT_WriteProtection_recommended"/>
</resource>
- <resource name="CT_Settings" resource="PropertyTable" tokenid="ooxml:SETTINGS">
+ <resource name="CT_Settings" resource="PropertyTable" tokenid="ooxml:SETTINGS" tag="settings">
<element name="writeProtection" tokenid="ooxml:CT_Settings_writeProtection"/>
<element name="view" tokenid="ooxml:CT_Settings_view"/>
<element name="zoom" tokenid="ooxml:CT_Settings_zoom"/>
@@ -23149,7 +23154,7 @@
<value name="off" tokenid="ooxml:Value_wordprocessingml_ST_FrameScrollbar_off">off</value>
<value name="auto" tokenid="ooxml:Value_wordprocessingml_ST_FrameScrollbar_auto">auto</value>
</resource>
- <resource name="CT_FrameScrollbar" resource="Value" generated="yes">
+ <resource name="CT_FrameScrollbar" resource="Value" generated="yes" tag="frame">
<attribute name="val" tokenid="ooxml:CT_FrameScrollbar_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -23158,7 +23163,7 @@
<value name="cols" tokenid="ooxml:Value_wordprocessingml_ST_FrameLayout_cols">cols</value>
<value name="none" tokenid="ooxml:Value_wordprocessingml_ST_FrameLayout_none">none</value>
</resource>
- <resource name="CT_FrameLayout" resource="Value" generated="yes">
+ <resource name="CT_FrameLayout" resource="Value" generated="yes" tag="frame">
<attribute name="val" tokenid="ooxml:CT_FrameLayout_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -23167,20 +23172,20 @@
<value name="space" tokenid="ooxml:Value_wordprocessingml_ST_LevelSuffix_space">space</value>
<value name="nothing" tokenid="ooxml:Value_wordprocessingml_ST_LevelSuffix_nothing">nothing</value>
</resource>
- <resource name="CT_LevelSuffix" resource="Value" generated="yes">
+ <resource name="CT_LevelSuffix" resource="Value" generated="yes" tag="numbering">
<attribute name="val" tokenid="ooxml:CT_LevelSuffix_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_LevelText" resource="Properties">
+ <resource name="CT_LevelText" resource="Properties" tag="numbering">
<attribute name="val" tokenid="ooxml:CT_LevelText_val"/>
<attribute name="null" tokenid="ooxml:CT_LevelText_null"/>
</resource>
- <resource name="CT_LvlLegacy" resource="Properties">
+ <resource name="CT_LvlLegacy" resource="Properties" tag="numbering">
<attribute name="legacy" tokenid="ooxml:CT_LvlLegacy_legacy"/>
<attribute name="legacySpace" tokenid="ooxml:CT_LvlLegacy_legacySpace"/>
<attribute name="legacyIndent" tokenid="ooxml:CT_LvlLegacy_legacyIndent"/>
</resource>
- <resource name="CT_Lvl" resource="Properties">
+ <resource name="CT_Lvl" resource="Properties" tag="numbering">
<kind name="paragraph"/>
<element name="start" tokenid="rtf:ISTARTAT"/>
<element name="numFmt" tokenid="rtf:NFC"/>
@@ -23198,15 +23203,15 @@
<attribute name="tplc" tokenid="ooxml:CT_Lvl_tplc"/>
<attribute name="tentative" tokenid="ooxml:CT_Lvl_tentative"/>
</resource>
- <resource name="ST_MultiLevelType" resource="List">
+ <resource name="ST_MultiLevelType" resource="List" tag="numbering">
<value tokenid="ooxml:Value_ST_MultiLevelType_singleLevel">singleLevel</value>
<value tokenid="ooxml:Value_ST_MultiLevelType_multilevel">multilevel</value>
<value tokenid="ooxml:Value_ST_MultiLevelType_hybridMultilevel">hybridMultilevel</value>
</resource>
- <resource name="CT_MultiLevelType" resource="Value">
+ <resource name="CT_MultiLevelType" resource="Value" tag="numbering">
<attribute name="val" tokenid="ooxml:CT_MultiLevelType_val" action="setValue"/>
</resource>
- <resource name="CT_AbstractNum" resource="Properties">
+ <resource name="CT_AbstractNum" resource="Properties" tag="numbering">
<kind name="paragraph"/>
<element name="nsid" tokenid="rtf:LSID"/>
<element name="multiLevelType" tokenid="ooxml:CT_AbstractNum_multiLevelType"/>
@@ -23217,19 +23222,19 @@
<element name="lvl" tokenid="ooxml:CT_AbstractNum_lvl"/>
<attribute name="abstractNumId" tokenid="ooxml:CT_AbstractNum_abstractNumId"/>
</resource>
- <resource name="CT_NumLvl" resource="Properties">
+ <resource name="CT_NumLvl" resource="Properties" tag="numbering">
<kind name="paragraph"/>
<element name="startOverride" tokenid="ooxml:CT_NumLvl_startOverride"/>
<element name="lvl" tokenid="ooxml:CT_NumLvl_lvl"/>
<attribute name="ilvl" tokenid="ooxml:CT_NumLvl_ilvl"/>
</resource>
- <resource name="CT_Num" resource="Properties">
+ <resource name="CT_Num" resource="Properties" tag="numbering">
<kind name="paragraph"/>
<element name="abstractNumId" tokenid="ooxml:CT_Num_abstractNumId"/>
<element name="lvlOverride" tokenid="ooxml:CT_Num_lvlOverride"/>
<attribute name="numId" tokenid="ooxml:CT_Num_numId"/>
</resource>
- <resource name="CT_Numbering" resource="PropertyTable" tokenid="ooxml:NUMBERING">
+ <resource name="CT_Numbering" resource="PropertyTable" tokenid="ooxml:NUMBERING" tag="numbering">
<kind name="paragraph"/>
<element name="numPicBullet" tokenid="ooxml:CT_Numbering_numPicBullet"/>
<element name="abstractNum" tokenid="ooxml:CT_Numbering_abstractNum"/>
@@ -23251,7 +23256,7 @@
<value tokenid="12">seCell</value>
<value tokenid="13">swCell</value>
</resource>
- <resource name="CT_Style_tblStylePr" resource="Properties">
+ <resource name="CT_Style_tblStylePr" resource="Properties" tag="style">
<element name="pPr" tokenid="ooxml:CT_PPrBase"/>
<element name="rPr" tokenid="ooxml:EG_RPrBase"/>
<element name="tblPr" tokenid="ooxml:CT_TblPrBase"/>
@@ -23265,7 +23270,7 @@
<value tokenid="3">table</value>
<value tokenid="4">numbering</value>
</resource>
- <resource name="CT_Style" resource="Properties">
+ <resource name="CT_Style" resource="Properties" tag="style">
<element name="name" tokenid="ooxml:CT_Style_name"/>
<element name="aliases" tokenid="ooxml:CT_Style_aliases"/>
<element name="basedOn" tokenid="ooxml:CT_Style_basedOn"/>
@@ -23293,9 +23298,9 @@
<attribute name="default" tokenid="ooxml:CT_Style_default"/>
<attribute name="customStyle" tokenid="ooxml:CT_Style_customStyle"/>
</resource>
- <resource name="CT_Styles" resource="Table" tokenid="rtf:STYLESHEET"/>
+ <resource name="CT_Styles" resource="Table" tokenid="rtf:STYLESHEET" tag="style"/>
<resource name="ST_Panose" resource="Hex"/>
- <resource name="CT_Panose" resource="Value">
+ <resource name="CT_Panose" resource="Value" tag="font">
<attribute name="val" tokenid="ooxml:CT_Panose_val" action="setValue"/>
<action name="start" action="setDefaultHexValue"/>
</resource>
@@ -23311,7 +23316,7 @@
<value tokenid="ooxml:Value_ST_FontFamily_swiss">swiss</value>
<value tokenid="ooxml:Value_ST_FontFamily_auto">auto</value>
</resource>
- <resource name="CT_FontFamily" resource="Value">
+ <resource name="CT_FontFamily" resource="Value" tag="font">
<attribute name="val" tokenid="ooxml:CT_FontFamily_val" action="setValue"/>
</resource>
<resource name="ST_Pitch" resource="List">
@@ -23319,10 +23324,10 @@
<value tokenid="ooxml:Value_ST_Pitch_variable">variable</value>
<value tokenid="ooxml:Value_ST_Pitch_default">default</value>
</resource>
- <resource name="CT_Pitch" resource="Value">
+ <resource name="CT_Pitch" resource="Value" tag="font">
<attribute name="val" tokenid="ooxml:CT_Pitch_val" action="setValue"/>
</resource>
- <resource name="CT_FontSig" resource="Properties">
+ <resource name="CT_FontSig" resource="Properties" tag="font">
<attribute name="usb0" tokenid="ooxml:CT_FontSig_usb0"/>
<attribute name="usb1" tokenid="ooxml:CT_FontSig_usb1"/>
<attribute name="usb2" tokenid="ooxml:CT_FontSig_usb2"/>
@@ -23330,11 +23335,11 @@
<attribute name="csb0" tokenid="ooxml:CT_FontSig_csb0"/>
<attribute name="csb1" tokenid="ooxml:CT_FontSig_csb1"/>
</resource>
- <resource name="CT_FontRel" resource="Properties">
+ <resource name="CT_FontRel" resource="Properties" tag="font">
<attribute name="fontKey" tokenid="ooxml:CT_FontRel_fontKey"/>
<attribute name="subsetted" tokenid="ooxml:CT_FontRel_subsetted"/>
</resource>
- <resource name="CT_Font" resource="Properties">
+ <resource name="CT_Font" resource="Properties" tag="font">
<kind name="character"/>
<element name="altName" tokenid="ooxml:CT_Font_altName"/>
<element name="panose1" tokenid="ooxml:CT_Font_panose1"/>
@@ -23350,8 +23355,8 @@
<element name="embedBoldItalic" tokenid="ooxml:CT_Font_embedBoldItalic"/>
<attribute name="name" tokenid="ooxml:CT_Font_name"/>
</resource>
- <resource name="CT_FontsList" resource="Table" tokenid="rtf:FONTTABLE"/>
- <resource name="EG_RunLevelElts" resource="Stream">
+ <resource name="CT_FontsList" resource="Table" tokenid="rtf:FONTTABLE" tag="font"/>
+ <resource name="EG_RunLevelElts" resource="Stream" tag="character">
<element name="proofErr" tokenid="ooxml:EG_RunLevelElts_proofErr"/>
<element name="permStart" tokenid="ooxml:EG_RunLevelElts_permStart"/>
<element name="permEnd" tokenid="ooxml:EG_RunLevelElts_permEnd"/>
@@ -23362,7 +23367,7 @@
<element name="moveFrom" tokenid="ooxml:EG_RunLevelElts_moveFrom"/>
<element name="moveTo" tokenid="ooxml:EG_RunLevelElts_moveTo"/>
</resource>
- <resource name="CT_Body" resource="Stream">
+ <resource name="CT_Body" resource="Stream" tag="content">
<action name="start" action="startSectionGroup"/>
<!--
<action name="start" action="footnoteSeparator"/>
@@ -23374,7 +23379,7 @@
<action name="end" action="endParagraphGroup"/>
<action name="end" action="endSectionGroup"/>
</resource>
- <resource xmlns:v="urn:schemas-microsoft-com:vml" name="CT_ShapeDefaults" resource="Properties">
+ <resource xmlns:v="urn:schemas-microsoft-com:vml" name="CT_ShapeDefaults" resource="Properties" tag="shape">
<element name="v:fill" tokenid="ooxml:CT_ShapeDefaults_v_fill"/>
<element name="v:stroke" tokenid="ooxml:CT_ShapeDefaults_v_stroke"/>
<element name="v:textbox" tokenid="ooxml:CT_ShapeDefaults_v_textbox"/>
@@ -23389,15 +23394,15 @@
<attribute name="strokecolor" tokenid="ooxml:CT_ShapeDefaults_strokecolor"/>
<attribute name="allowincell" tokenid="ooxml:CT_ShapeDefaults_allowincell"/>
</resource>
- <resource name="CT_Comments" resource="Stream">
+ <resource name="CT_Comments" resource="Stream" tag="content">
<action name="start" action="startSectionGroup"/>
<action name="end" action="endSectionGroup"/>
</resource>
- <resource name="CT_Footnotes" resource="Stream"/>
- <resource name="footnotes" resource="Stream"/>
- <resource name="CT_Endnotes" resource="Stream"/>
- <resource name="endnotes" resource="Stream"/>
- <resource name="CT_SmartTagType" resource="Properties">
+ <resource name="CT_Footnotes" resource="Stream" tag="reference"/>
+ <resource name="footnotes" resource="Stream" tag="reference"/>
+ <resource name="CT_Endnotes" resource="Stream" tag="reference"/>
+ <resource name="endnotes" resource="Stream" tag="reference"/>
+ <resource name="CT_SmartTagType" resource="Properties" tag="content">
<attribute name="namespaceuri" tokenid="ooxml:CT_SmartTagType_namespaceuri"/>
<attribute name="name" tokenid="ooxml:CT_SmartTagType_name"/>
<attribute name="url" tokenid="ooxml:CT_SmartTagType_url"/>
@@ -23426,7 +23431,7 @@
<value name="p" tokenid="ooxml:Value_wordprocessingml_ST_DocPartBehavior_p">p</value>
<value name="pg" tokenid="ooxml:Value_wordprocessingml_ST_DocPartBehavior_pg">pg</value>
</resource>
- <resource name="CT_DocPartBehavior" resource="Value" generated="yes">
+ <resource name="CT_DocPartBehavior" resource="Value" generated="yes" tag="document">
<attribute name="val" tokenid="ooxml:CT_DocPartBehavior_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -23439,7 +23444,7 @@
<value name="formFld" tokenid="ooxml:Value_wordprocessingml_ST_DocPartType_formFld">formFld</value>
<value name="bbPlcHdr" tokenid="ooxml:Value_wordprocessingml_ST_DocPartType_bbPlcHdr">bbPlcHdr</value>
</resource>
- <resource name="CT_DocPartType" resource="Value" generated="yes">
+ <resource name="CT_DocPartType" resource="Value" generated="yes" tag="document">
<attribute name="val" tokenid="ooxml:CT_DocPartType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
@@ -23483,24 +23488,24 @@
<value name="custom4" tokenid="ooxml:Value_wordprocessingml_ST_DocPartGallery_custom4">custom4</value>
<value name="custom5" tokenid="ooxml:Value_wordprocessingml_ST_DocPartGallery_custom5">custom5</value>
</resource>
- <resource name="CT_DocPartGallery" resource="Value" generated="yes">
+ <resource name="CT_DocPartGallery" resource="Value" generated="yes" tag="document">
<attribute name="val" tokenid="ooxml:CT_DocPartGallery_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
- <resource name="CT_DocPartName" resource="Properties">
+ <resource name="CT_DocPartName" resource="Properties" tag="document">
<attribute name="val" tokenid="ooxml:CT_DocPartName_val"/>
<attribute name="decorated" tokenid="ooxml:CT_DocPartName_decorated"/>
</resource>
- <resource name="settings" resource="Stream">
+ <resource name="settings" resource="Stream" tag="settings">
<element name="settings" tokenid="ooxml:settings_settings"/>
</resource>
- <resource name="fonts" resource="Stream">
+ <resource name="fonts" resource="Stream" tag="font">
<element name="fonts" tokenid="rtf:FONTTABLE"/>
</resource>
- <resource name="numbering" resource="Stream">
+ <resource name="numbering" resource="Stream" tag="numbering">
<element name="numbering" tokenid="ooxml:NUMBERING"/>
</resource>
- <resource name="styles" resource="Stream">
+ <resource name="styles" resource="Stream" tag="style">
<element name="styles" tokenid="rtf:STYLESHEET"/>
</resource>
<resource name="ST_CaptionPos" resource="List" generated="yes">
@@ -23509,7 +23514,7 @@
<value name="left" tokenid="ooxml:Value_wordprocessingml_ST_CaptionPos_left">left</value>
<value name="right" tokenid="ooxml:Value_wordprocessingml_ST_CaptionPos_right">right</value>
</resource>
- <resource name="CT_Caption" resource="Properties">
+ <resource name="CT_Caption" resource="Properties" tag="content">
<attribute name="name" tokenid="ooxml:CT_Caption_name"/>
<attribute name="pos" tokenid="ooxml:CT_Caption_pos"/>
<attribute name="chapNum" tokenid="ooxml:CT_Caption_chapNum"/>
@@ -23518,23 +23523,23 @@
<attribute name="numFmt" tokenid="ooxml:CT_Caption_numFmt"/>
<attribute name="sep" tokenid="ooxml:CT_Caption_sep"/>
</resource>
- <resource name="CT_AutoCaption" resource="Properties">
+ <resource name="CT_AutoCaption" resource="Properties" tag="content">
<attribute name="name" tokenid="ooxml:CT_AutoCaption_name"/>
<attribute name="caption" tokenid="ooxml:CT_AutoCaption_caption"/>
</resource>
- <resource name="CT_AutoCaptions" resource="Properties">
+ <resource name="CT_AutoCaptions" resource="Properties" tag="content">
<element name="autoCaption" tokenid="ooxml:CT_AutoCaptions_autoCaption"/>
</resource>
- <resource name="CT_Captions" resource="Properties">
+ <resource name="CT_Captions" resource="Properties" tag="content">
<element name="caption" tokenid="ooxml:CT_Captions_caption"/>
<element name="autoCaptions" tokenid="ooxml:CT_Captions_autoCaptions"/>
</resource>
- <resource name="CT_DocumentBase" resource="Properties">
+ <resource name="CT_DocumentBase" resource="Properties" tag="content">
<element name="background" tokenid="ooxml:CT_DocumentBase_background"/>
</resource>
- <resource name="CT_Document" resource="Stream"/>
- <resource name="CT_GlossaryDocument" resource="Stream"/>
- <resource name="document" resource="Stream"/>
- <resource name="glossaryDocument" resource="Stream"/>
+ <resource name="CT_Document" resource="Stream" tag="content"/>
+ <resource name="CT_GlossaryDocument" resource="Stream" tag="content"/>
+ <resource name="document" resource="Stream" tag="content"/>
+ <resource name="glossaryDocument" resource="Stream" tag="content"/>
</namespace>
</model>
diff --git a/writerfilter/source/ooxml/namespaceids.xsl b/writerfilter/source/ooxml/namespaceids.xsl
index 45828761da0c..4a1f3b2ba381 100644
--- a/writerfilter/source/ooxml/namespaceids.xsl
+++ b/writerfilter/source/ooxml/namespaceids.xsl
@@ -67,7 +67,7 @@ const sal_uInt32 </xsl:text>
<xsl:call-template name="namespaceid"/>
<xsl:text> = </xsl:text>
<xsl:value-of select="@id"/>
-<xsl:text> &lt;&lt; 16;</xsl:text>
+<xsl:text>;</xsl:text>
</xsl:for-each>
</xsl:template>
diff --git a/writerfilter/source/resourcemodel/Fraction.cxx b/writerfilter/source/resourcemodel/Fraction.cxx
new file mode 100644
index 000000000000..c50668a7db03
--- /dev/null
+++ b/writerfilter/source/resourcemodel/Fraction.cxx
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * 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 <resourcemodel/Fraction.hxx>
+
+namespace writerfilter {
+namespace resourcemodel {
+
+sal_uInt32 gcd(sal_uInt32 a, sal_uInt32 b)
+{
+ if (a == 0 || b == 0)
+ return a | b;
+
+ sal_uInt32 nShift = 0;
+ while (((a | b) & 1) == 0)
+ {
+ a >>= 1;
+ b >>= 1;
+ ++nShift;
+ }
+
+ while ((a & 1) == 0)
+ a >>= 1;
+
+ do
+ {
+ while ((b & 1) == 0)
+ b >>= 1;
+
+ if (a < b)
+ {
+ b -= a;
+ }
+ else
+ {
+ sal_uInt32 nDiff = a - b;
+ a = b;
+ b = nDiff;
+ }
+
+ b >>= 1;
+ }
+ while (b != 0);
+
+ return a << nShift;
+}
+
+sal_uInt32 lcm(sal_Int32 a, sal_Int32 b)
+{
+ return abs(a * b) / gcd(abs(a), abs(b));
+}
+
+Fraction::Fraction(sal_Int32 nNumerator, sal_Int32 nDenominator)
+{
+ init(nNumerator, nDenominator);
+}
+
+Fraction::Fraction(const Fraction & a, const Fraction & b)
+{
+ init(a.mnNumerator * b.mnDenominator, a.mnDenominator * b.mnNumerator);
+}
+
+Fraction::~Fraction()
+{
+}
+
+void Fraction::init(sal_Int32 nNumerator, sal_Int32 nDenominator)
+{
+ sal_uInt32 nGCD = gcd(nNumerator, nDenominator);
+
+ mnNumerator = nNumerator/ nGCD;
+ mnDenominator = nDenominator / nGCD;
+}
+
+void Fraction::assign(const Fraction & rFraction)
+{
+ init(rFraction.mnNumerator, rFraction.mnDenominator);
+}
+
+Fraction Fraction::inverse() const
+{
+ return Fraction(mnDenominator, mnNumerator);
+}
+
+Fraction Fraction::operator + (const Fraction & rFraction) const
+{
+ sal_uInt32 nLCM = lcm(mnDenominator, rFraction.mnDenominator);
+
+ return Fraction(mnNumerator * nLCM / mnDenominator + rFraction.mnNumerator * nLCM / rFraction.mnDenominator, nLCM);
+}
+
+Fraction Fraction::operator - (const Fraction & rFraction) const
+{
+ sal_uInt32 nLCM = lcm(mnDenominator, rFraction.mnDenominator);
+
+ return Fraction(mnNumerator * nLCM / mnDenominator - rFraction.mnNumerator * nLCM / rFraction.mnDenominator, nLCM);
+}
+
+Fraction Fraction::operator * (const Fraction & rFraction) const
+{
+ return Fraction(mnNumerator * rFraction.mnNumerator, mnDenominator * rFraction.mnDenominator);
+}
+
+Fraction Fraction::operator / (const Fraction & rFraction) const
+{
+ return *this * rFraction.inverse();
+}
+
+Fraction Fraction::operator = (const Fraction & rFraction)
+{
+ assign(rFraction);
+
+ return *this;
+}
+
+Fraction::operator sal_Int32() const
+{
+ return mnNumerator / mnDenominator;
+}
+
+Fraction::operator float() const
+{
+ return static_cast<float>(mnNumerator) / static_cast<float>(mnDenominator);
+}
+
+}}
diff --git a/writerfilter/source/resourcemodel/LoggedResources.cxx b/writerfilter/source/resourcemodel/LoggedResources.cxx
new file mode 100644
index 000000000000..f60b48b82b5b
--- /dev/null
+++ b/writerfilter/source/resourcemodel/LoggedResources.cxx
@@ -0,0 +1,322 @@
+/*************************************************************************
+ *
+ * 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 <rtl/ustrbuf.hxx>
+#include <resourcemodel/LoggedResources.hxx>
+#include <resourcemodel/QNameToString.hxx>
+
+namespace writerfilter
+{
+
+// class: LoggedResourcesHelper
+
+LoggedResourcesHelper::LoggedResourcesHelper(TagLogger::Pointer_t pLogger, const string & sPrefix)
+: mpLogger(pLogger), msPrefix(sPrefix)
+{
+}
+
+LoggedResourcesHelper::~LoggedResourcesHelper()
+{
+}
+
+void LoggedResourcesHelper::startElement(const string & sElement)
+{
+ mpLogger->startElement(msPrefix + "." + sElement);
+}
+
+void LoggedResourcesHelper::endElement(const string & sElement)
+{
+ mpLogger->endElement(msPrefix + "." + sElement);
+}
+
+void LoggedResourcesHelper::chars(const ::rtl::OUString & rChars)
+{
+ mpLogger->chars(rChars);
+}
+
+void LoggedResourcesHelper::chars(const string & rChars)
+{
+ mpLogger->chars(rChars);
+}
+
+void LoggedResourcesHelper::attribute(const string & rName, const string & rValue)
+{
+ mpLogger->attribute(rName, rValue);
+}
+
+void LoggedResourcesHelper::attribute(const string & rName, sal_uInt32 nValue)
+{
+ mpLogger->attribute(rName, nValue);
+}
+
+void LoggedResourcesHelper::setPrefix(const string & rPrefix)
+{
+ msPrefix = rPrefix;
+}
+
+// class: LoggedStream
+
+LoggedStream::LoggedStream(TagLogger::Pointer_t pLogger, const string & sPrefix)
+: mHelper(pLogger, sPrefix)
+{
+}
+
+LoggedStream::~LoggedStream()
+{
+}
+
+void LoggedStream::startSectionGroup()
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("section");
+#endif
+
+ lcl_startSectionGroup();
+}
+
+void LoggedStream::endSectionGroup()
+{
+ lcl_endSectionGroup();
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("section");
+#endif
+}
+
+void LoggedStream::startParagraphGroup()
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("paragraph");
+#endif
+
+ lcl_startParagraphGroup();
+}
+
+void LoggedStream::endParagraphGroup()
+{
+ lcl_endParagraphGroup();
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("paragraph");
+#endif
+}
+
+
+void LoggedStream::startCharacterGroup()
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("charactergroup");
+#endif
+
+ lcl_startCharacterGroup();
+}
+
+void LoggedStream::endCharacterGroup()
+{
+ lcl_endCharacterGroup();
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("charactergroup");
+#endif
+}
+
+void LoggedStream::startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape )
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("shape");
+#endif
+
+ lcl_startShape(xShape);
+}
+
+void LoggedStream::endShape()
+{
+ lcl_endShape();
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("shape");
+#endif
+}
+
+void LoggedStream::text(const sal_uInt8 * data, size_t len)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("text");
+
+ ::rtl::OUString sText( (const sal_Char*) data, len, RTL_TEXTENCODING_MS_1252 );
+
+ mHelper.startElement("data");
+ mHelper.chars(sText);
+ mHelper.endElement("data");
+#endif
+
+ lcl_text(data, len);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("text");
+#endif
+}
+
+void LoggedStream::utext(const sal_uInt8 * data, size_t len)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("utext");
+ mHelper.startElement("data");
+
+ ::rtl::OUString sText;
+ ::rtl::OUStringBuffer aBuffer = ::rtl::OUStringBuffer(len);
+ aBuffer.append( (const sal_Unicode *) data, len);
+ sText = aBuffer.makeStringAndClear();
+
+ mHelper.chars(sText);
+
+ mHelper.endElement("data");
+#endif
+
+ lcl_utext(data, len);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("utext");
+#endif
+}
+
+void LoggedStream::props(writerfilter::Reference<Properties>::Pointer_t ref)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("props");
+#endif
+
+ lcl_props(ref);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("props");
+#endif
+}
+
+void LoggedStream::table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("table");
+ mHelper.attribute("name", (*QNameToString::Instance())(name));
+#endif
+
+ lcl_table(name, ref);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("table");
+#endif
+}
+
+void LoggedStream::substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("substream");
+ mHelper.attribute("name", (*QNameToString::Instance())(name));
+#endif
+
+ lcl_substream(name, ref);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("substream");
+#endif
+}
+
+void LoggedStream::info(const string & _info)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("info");
+ mHelper.attribute("text", _info);
+#endif
+
+ lcl_info(_info);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("info");
+#endif
+}
+
+// class LoggedProperties
+LoggedProperties::LoggedProperties(TagLogger::Pointer_t pLogger, const string & sPrefix)
+: mHelper(pLogger, sPrefix)
+{
+}
+
+LoggedProperties::~LoggedProperties()
+{
+}
+
+void LoggedProperties::attribute(Id name, Value & val)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("attribute");
+ mHelper.attribute("name", (*QNameToString::Instance())(name));
+ mHelper.attribute("value", val.toString());
+ mHelper.endElement("attribute");
+#endif
+
+ lcl_attribute(name, val);
+}
+
+void LoggedProperties::sprm(Sprm & _sprm)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("sprm");
+ mHelper.attribute("name", (*QNameToString::Instance())(_sprm.getId()));
+ mHelper.chars(sprm.toString());
+#endif
+
+ lcl_sprm(_sprm);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("sprm");
+#endif
+}
+
+LoggedTable::LoggedTable(TagLogger::Pointer_t pLogger, const string & sPrefix)
+: mHelper(pLogger, sPrefix)
+{
+}
+
+LoggedTable::~LoggedTable()
+{
+}
+
+void LoggedTable::entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref)
+{
+#ifdef DEBUG_LOGGING
+ mHelper.startElement("entry");
+ mHelper.attribute("pos", pos);
+#endif
+
+ lcl_entry(pos, ref);
+
+#ifdef DEBUG_LOGGING
+ mHelper.endElement("entry");
+#endif
+}
+
+}
diff --git a/writerfilter/source/resourcemodel/TagLogger.cxx b/writerfilter/source/resourcemodel/TagLogger.cxx
index 15786951c131..d14ba13613d6 100644
--- a/writerfilter/source/resourcemodel/TagLogger.cxx
+++ b/writerfilter/source/resourcemodel/TagLogger.cxx
@@ -35,27 +35,27 @@
namespace writerfilter
{
- struct eqstr
+struct eqstr
+{
+ bool operator()(const char* s1, const char* s2) const
{
- bool operator()(const char* s1, const char* s2) const
- {
- return strcmp(s1, s2) == 0;
- }
- };
+ return strcmp(s1, s2) == 0;
+ }
+};
typedef boost::unordered_map<const char *, TagLogger::Pointer_t, hash<const char *>, eqstr> TagLoggerHashMap_t;
- static TagLoggerHashMap_t * tagLoggers = NULL;
+static TagLoggerHashMap_t * tagLoggers = NULL;
TagLogger::TagLogger(const char* name)
: pWriter( NULL ), pName( name )
- {
- }
+{
+}
- TagLogger::~TagLogger()
- {
+TagLogger::~TagLogger()
+{
pWriter = NULL;
pName = NULL;
- }
+}
void TagLogger::setFileName( const string & filename )
{
@@ -205,7 +205,7 @@ namespace writerfilter
class PropertySetDumpHandler : public Properties
- {
+{
IdToString::Pointer_t mpIdToString;
TagLogger::Pointer_t m_pLogger;
@@ -316,6 +316,5 @@ namespace writerfilter
}
}
-#endif // DEBUG
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphicfilter/eppm/dlgeppm.hxx b/writerfilter/source/resourcemodel/XPathLogger.cxx
index bbeabf93349b..803fca098efd 100644
--- a/filter/source/graphicfilter/eppm/dlgeppm.hxx
+++ b/writerfilter/source/resourcemodel/XPathLogger.cxx
@@ -26,49 +26,66 @@
*
************************************************************************/
+#include <stdio.h>
+#include <resourcemodel/XPathLogger.hxx>
-#ifndef _DLGEPPM_HXX_
-#define _DLGEPPM_HXX_
-#include <svtools/fltcall.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <svtools/stdctrl.hxx>
+namespace writerfilter
+{
+XPathLogger::XPathLogger()
+: mp_tokenMap(new TokenMap_t)
+{
+}
+XPathLogger::~XPathLogger()
+{
+}
-/*************************************************************************
-|*
-|* Dialog zum Einstellen von Filteroptionen
-|*
-\************************************************************************/
+string XPathLogger::getXPath() const
+{
+ return m_currentPath;
+}
-class FilterConfigItem;
-class ResMgr;
+void XPathLogger::updateCurrentPath()
+{
+ m_currentPath = "";
+
+ for (vector<string>::const_iterator aIt = m_path.begin();
+ aIt != m_path.end();
+ aIt++)
+ {
+ if (m_currentPath.size() > 0)
+ m_currentPath += "/";
-class DlgExportEPPM : public ModalDialog
+ m_currentPath += *aIt;
+ }
+}
+
+void XPathLogger::startElement(string _token)
{
-private:
+ TokenMap_t::const_iterator aIt = mp_tokenMap->find(_token);
- FltCallDialogParameter& rFltCallPara;
+ if (aIt == mp_tokenMap->end())
+ (*mp_tokenMap)[_token] = 1;
+ else
+ (*mp_tokenMap)[_token]++;
- FixedLine aGrpFormat;
- RadioButton aRBRaw;
- RadioButton aRBASCII;
- OKButton aBtnOK;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
+ static char sBuffer[256];
+ snprintf(sBuffer, sizeof(sBuffer), "[%d]", (*mp_tokenMap)[_token]);
+ m_path.push_back(_token + sBuffer);
- FilterConfigItem* pConfigItem;
- ResMgr* pMgr;
+ m_tokenMapStack.push(mp_tokenMap);
+ mp_tokenMap.reset(new TokenMap_t);
- DECL_LINK( OK, void * );
+ updateCurrentPath();
+}
-public:
- DlgExportEPPM( FltCallDialogParameter& rPara );
- ~DlgExportEPPM();
-};
+void XPathLogger::endElement()
+{
+ mp_tokenMap = m_tokenMapStack.top();
+ m_tokenMapStack.pop();
+ m_path.pop_back();
-#endif // _DLGEPPM_HXX_
+ updateCurrentPath();
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/resourcemodel/makefile.mk b/writerfilter/source/resourcemodel/makefile.mk
index 927daf589190..531209c8d0fe 100644
--- a/writerfilter/source/resourcemodel/makefile.mk
+++ b/writerfilter/source/resourcemodel/makefile.mk
@@ -44,14 +44,17 @@ NOOPTFILES= \
$(SLO)$/qnametostr.obj
SLOFILES= \
+ $(SLO)$/Fraction.obj \
+ $(SLO)$/LoggedResources.obj \
+ $(SLO)$/Protocol.obj \
+ $(SLO)$/ResourceModelHelper.obj \
+ $(SLO)$/TagLogger.obj \
+ $(SLO)$/WW8Analyzer.obj \
+ $(SLO)$/XPathLogger.obj \
$(SLO)$/qnametostr.obj \
- $(SLO)$/sprmcodetostr.obj \
$(SLO)$/resourcemodel.obj \
+ $(SLO)$/sprmcodetostr.obj \
$(SLO)$/util.obj \
- $(SLO)$/TagLogger.obj \
- $(SLO)$/ResourceModelHelper.obj \
- $(SLO)$/WW8Analyzer.obj \
- $(SLO)$/Protocol.obj
SHL1TARGET=$(TARGET)
diff --git a/writerfilter/source/resourcemodel/namespace_preprocess.pl b/writerfilter/source/resourcemodel/namespace_preprocess.pl
index 22c172329f61..66644b70fd47 100644
--- a/writerfilter/source/resourcemodel/namespace_preprocess.pl
+++ b/writerfilter/source/resourcemodel/namespace_preprocess.pl
@@ -30,31 +30,16 @@ EOF
# print the mapping
open ( NAMESPACES, $ARGV0 ) || die "can't open namespace file: $!";
-$group = 0;
-$i = 1;
while ( <NAMESPACES> )
{
chomp( $_ );
- $_ =~ s/\s*//g;
- if ( $_ =~ m/^$/ )
- {
- # Start a new group
- $i = 0;
- $group++;
- }
- elsif ( $_ =~ m/^[^#]/ )
- {
- # Neither an empty line nor a comment
- $_ =~ /^[a-zA-Z0-9-_]+$/ or die "Invalid namespace token $_";
- $_ =~ s/-/_/g;
- $no = $group*10 + $i;
- print <<EOF;
- <xsl:when test="\$id = '$_'">
- <xsl:text>$no</xsl:text>
+ # line format is: numeric-id short-name namespace-URL
+ $_ =~ /^([0-9]+)\s+([a-zA-Z]+)\s+([a-zA-Z0-9-.:\/]+)\s*$/ or die "Error: invalid character in input data";
+ print <<EOF;
+ <xsl:when test="\$id = '$2'">
+ <xsl:text>$1</xsl:text>
</xsl:when>
EOF
- ++$i;
- }
}
print <<EOF;
diff --git a/writerfilter/unocomponent/component.cxx b/writerfilter/unocomponent/component.cxx
index 5ff7cff43ad4..a2f44a636460 100644
--- a/writerfilter/unocomponent/component.cxx
+++ b/writerfilter/unocomponent/component.cxx
@@ -62,12 +62,6 @@ static struct ::cppu::ImplementationEntry s_component_entries [] =
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-sal_Bool SAL_CALL component_writeInfo( ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry )
-{
- return ::cppu::component_writeInfoHelper( xMgr, xRegistry, s_component_entries );
-}
-
-
void * SAL_CALL component_getFactory(sal_Char const * implName, ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry )
{
fprintf(stderr, "Loading service: %s: ", implName);
diff --git a/writerfilter/unocomponent/exports.dxp b/writerfilter/unocomponent/exports.dxp
index 028ac4175990..f0e1c69934bc 100644
--- a/writerfilter/unocomponent/exports.dxp
+++ b/writerfilter/unocomponent/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/writerfilter/util/makefile.mk b/writerfilter/util/makefile.mk
index 805326730db2..fe634c4d0c05 100644
--- a/writerfilter/util/makefile.mk
+++ b/writerfilter/util/makefile.mk
@@ -79,4 +79,10 @@ DEF1NAME=$(SHL1TARGET)
.INCLUDE : target.mk
+ALLTAR : $(MISC)/writerfilter.component
+$(MISC)/writerfilter.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt writerfilter.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt writerfilter.component
diff --git a/writerfilter/util/writerfilter.component b/writerfilter/util/writerfilter.component
new file mode 100644
index 000000000000..7a81b6cc3a2b
--- /dev/null
+++ b/writerfilter/util/writerfilter.component
@@ -0,0 +1,42 @@
+<?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.Writer.WriterFilter">
+ <service name="com.sun.star.document.ExportFilter"/>
+ <service name="com.sun.star.document.ImportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Writer.WriterFilterDetector">
+ <service name="com.sun.star.document.ExtendedTypeDetection"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Writer.RtfFilter">
+ <service name="com.sun.star.document.ImportFilter"/>
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
+</component>
diff --git a/writerperfect/prj/build.lst b/writerperfect/prj/build.lst
index 87b258ac3016..4e083aeda8e8 100644
--- a/writerperfect/prj/build.lst
+++ b/writerperfect/prj/build.lst
@@ -1,4 +1,4 @@
-wp writerperfect : LIBWPG:libwpg LIBWPS:libwps LIBWPD:libwpd sot comphelper xmloff svtools sfx2 NULL
+wp writerperfect : LIBWPG:libwpg LIBWPS:libwps LIBWPD:libwpd sot comphelper xmloff svtools sfx2 LIBXSLT:libxslt NULL
wp writerperfect usr1 - all wp_mkout NULL
wp writerperfect\source\stream nmake - all wp_stream NULL
wp writerperfect\source\filter nmake - all wp_filter NULL
diff --git a/writerperfect/prj/d.lst b/writerperfect/prj/d.lst
index fb11fa974311..8b281c57aea3 100644
--- a/writerperfect/prj/d.lst
+++ b/writerperfect/prj/d.lst
@@ -2,3 +2,4 @@
..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%
..\%__SRC%\bin\wpftgo.dll %_DEST%\bin%_EXT%\wpftgo.dll
..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
+..\%__SRC%\misc\wpft.component %_DEST%\xml%_EXT%\wpft.component
diff --git a/writerperfect/source/stream/WPXSvStream.cxx b/writerperfect/source/stream/WPXSvStream.cxx
index fd7d98604a07..594944e63cf5 100644
--- a/writerperfect/source/stream/WPXSvStream.cxx
+++ b/writerperfect/source/stream/WPXSvStream.cxx
@@ -147,7 +147,7 @@ WPXInputStream * WPXSvInputStream::getDocumentOLEStream(const char * name)
return 0;
}
- mxChildStorage = new SotStorage( pStream, TRUE );
+ mxChildStorage = new SotStorage( pStream, sal_True );
mxChildStream = mxChildStorage->OpenSotStream(
rtl::OUString::createFromAscii( name ),
diff --git a/writerperfect/source/wpdimp/wpft_genericfilter.cxx b/writerperfect/source/wpdimp/wpft_genericfilter.cxx
index eb3cb035a001..6e184333eecd 100644
--- a/writerperfect/source/wpdimp/wpft_genericfilter.cxx
+++ b/writerperfect/source/wpdimp/wpft_genericfilter.cxx
@@ -47,41 +47,6 @@ void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//==================================================================================================
-sal_Bool SAL_CALL component_writeInfo(
- void * /* pServiceManager */, void * pRegistryKey )
-{
- if (pRegistryKey)
- {
- try
- {
- sal_Int32 nPos = 0;
- Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( WordPerfectImportFilter_getImplementationName() ) );
- xNewKey = xNewKey->createKey( OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")) );
-
- const Sequence< OUString > & rSNL = WordPerfectImportFilter_getSupportedServiceNames();
- const OUString * pArray = rSNL.getConstArray();
- for ( nPos = rSNL.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-#if 0
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( WordPerfectImportFilterDialog_getImplementationName() );
- xNewKey = xNewKey->createKey( OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")) );
-
- const Sequence< OUString > & rSNL2 = WordPerfectImportFilterDialog_getSupportedServiceNames();
- pArray = rSNL2.getConstArray();
- for ( nPos = rSNL2.getLength(); nPos--; )
- xNewKey->createKey( pArray[nPos] );
-#endif
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
-}
-//==================================================================================================
void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
{
@@ -101,21 +66,6 @@ void * SAL_CALL component_getFactory(
pRet = xFactory.get();
}
}
-#if 0
- else if ( pServiceManager && implName.equals(WordPerfectImportFilterDialog_getImplementationName()) )
- {
- Reference< XSingleServiceFactory > xFactory( createSingleFactory(
- reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
- OUString::createFromAscii( pImplName ),
- WordPerfectImportFilterDialog_createInstance, WordPerfectImportFilterDialog_getSupportedServiceNames() ) );
-
- if (xFactory.is())
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
-#endif
return pRet;
}
diff --git a/writerperfect/util/makefile.mk b/writerperfect/util/makefile.mk
index 9ac9e4c35cda..c202bf3caa54 100644
--- a/writerperfect/util/makefile.mk
+++ b/writerperfect/util/makefile.mk
@@ -119,3 +119,11 @@ SHL3VERSIONMAP = $(SOLARENV)/src/component.map
DEF3NAME = $(SHL3TARGET)
.INCLUDE : target.mk
+
+ALLTAR : $(MISC)/wpft.component
+
+$(MISC)/wpft.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ wpft.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt wpft.component
diff --git a/writerperfect/util/wpft.component b/writerperfect/util/wpft.component
new file mode 100644
index 000000000000..2d8a013606a9
--- /dev/null
+++ b/writerperfect/util/wpft.component
@@ -0,0 +1,35 @@
+<?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.Writer.WordPerfectImportFilter">
+ <service name="com.sun.star.document.ExtendedTypeDetection"/>
+ <service name="com.sun.star.document.ImportFilter"/>
+ </implementation>
+</component>
diff --git a/xmerge/prj/build.lst b/xmerge/prj/build.lst
index c9f6a8e4d332..39cde4210a1b 100644
--- a/xmerge/prj/build.lst
+++ b/xmerge/prj/build.lst
@@ -1,4 +1,4 @@
-xmrg xmerge : solenv unoil javaunohelper NULL
+xmrg xmerge : solenv unoil javaunohelper LIBXSLT:libxslt NULL
xmrg xmerge usr1 - all xmrg_mkout NULL
xmrg xmerge\inc nmake - all xmrg_inc NULL
xmrg xmerge\source\xmerge nmake - all xmrg_xmerge xmrg_inc NULL
diff --git a/xmerge/prj/d.lst b/xmerge/prj/d.lst
index 03cd7235c126..9cfd7927ed00 100644
--- a/xmerge/prj/d.lst
+++ b/xmerge/prj/d.lst
@@ -9,3 +9,4 @@ mkdir: %_DEST%\doc%_EXT%\xmerge
..\%__SRC%\doc\javadoc\package-list %_DEST%\doc%_EXT%\xmerge\package-list
..\%__SRC%\doc\xmerge_javadoc.zip %_DEST%\doc%_EXT%\xmerge_javadoc.zip
..\%__SRC%\doc\writer2latex_javadoc.zip %_DEST%\doc%_EXT%\writer2latex_javadoc.zip
+..\%__SRC%\misc\XMergeBridge.component %_DEST%\xml%_EXT%\XMergeBridge.component
diff --git a/xmerge/source/bridge/XMergeBridge.component b/xmerge/source/bridge/XMergeBridge.component
new file mode 100644
index 000000000000..c48aae6a0e20
--- /dev/null
+++ b/xmerge/source/bridge/XMergeBridge.component
@@ -0,0 +1,34 @@
+<?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.Java2"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="XMergeBridge$_XMergeBridge">
+ <service name="com.sun.star.documentconversion.XMergeBridge"/>
+ </implementation>
+</component>
diff --git a/xmerge/source/bridge/java/XMergeBridge.java b/xmerge/source/bridge/java/XMergeBridge.java
index 8c230760e93d..9bcd469544eb 100644
--- a/xmerge/source/bridge/java/XMergeBridge.java
+++ b/xmerge/source/bridge/java/XMergeBridge.java
@@ -74,9 +74,8 @@ import java.net.URI;
/** This outer class provides an inner class to implement the service
- * description, a method to instantiate the
- * component on demand (__getServiceFactory()), and a method to give
- * information about the component (__writeRegistryServiceInfo()).
+ * description and a method to instantiate the
+ * component on demand (__getServiceFactory()).
*/
public class XMergeBridge {
@@ -639,21 +638,4 @@ public class XMergeBridge {
return xSingleServiceFactory;
}
-
- /**
- * Writes the service information into the given registry key.
- * This method is called by the <code>JavaLoader</code>
- * <p>
- * @return returns true if the operation succeeded
- * @param regKey the registryKey
- * @see com.sun.star.comp.loader.JavaLoader
- */
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
-
- return FactoryHelper.writeRegistryServiceInfo(_XMergeBridge.class.getName(),
- _XMergeBridge.__serviceName, regKey);
- }
}
-
-
-
diff --git a/xmerge/source/bridge/makefile.mk b/xmerge/source/bridge/makefile.mk
index 77a39a568966..05fa5a738d84 100644
--- a/xmerge/source/bridge/makefile.mk
+++ b/xmerge/source/bridge/makefile.mk
@@ -33,3 +33,11 @@ PRJNAME=xmerge
.IF "$(L10N_framework)"==""
ALLTAR: ANTBUILD
.ENDIF
+
+ALLTAR : $(MISC)/XMergeBridge.component
+
+$(MISC)/XMergeBridge.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt XMergeBridge.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_JAVA)XMergeBridge.jar' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt XMergeBridge.component