summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--starmath/inc/action.hxx2
-rw-r--r--starmath/inc/config.hxx4
-rw-r--r--starmath/inc/document.hxx2
-rw-r--r--starmath/inc/format.hxx4
-rw-r--r--starmath/inc/smmod.hxx9
-rw-r--r--starmath/inc/starmath.hrc2
-rw-r--r--starmath/inc/symbol.hxx4
-rw-r--r--starmath/inc/types.hxx102
-rw-r--r--starmath/sdi/makefile.mk10
-rw-r--r--starmath/sdi/smitems.sdi (renamed from starmath/sdi/svxitems.sdi)0
-rw-r--r--starmath/sdi/smslots.sdi16
-rw-r--r--starmath/source/accessibility.cxx2
-rw-r--r--starmath/source/accessibility.hxx2
-rw-r--r--starmath/source/cfgitem.cxx2
-rw-r--r--starmath/source/cfgitem.hxx4
-rw-r--r--starmath/source/config.cxx16
-rw-r--r--starmath/source/dialog.cxx18
-rw-r--r--starmath/source/document.cxx30
-rw-r--r--starmath/source/edit.cxx8
-rw-r--r--starmath/source/format.cxx6
-rw-r--r--starmath/source/math_pch.cxx36
-rw-r--r--starmath/source/mathmlexport.cxx24
-rw-r--r--starmath/source/mathmlimport.cxx6379
-rw-r--r--starmath/source/node.cxx4
-rw-r--r--starmath/source/parse.cxx2
-rw-r--r--starmath/source/rect.cxx3
-rw-r--r--starmath/source/smdetect.cxx6
-rw-r--r--starmath/source/smmod.cxx17
-rw-r--r--starmath/source/toolbox.cxx6
-rw-r--r--starmath/source/typemap.cxx6
-rw-r--r--starmath/source/types.cxx214
-rw-r--r--starmath/source/unomodel.cxx2
-rw-r--r--starmath/source/view.cxx18
-rw-r--r--sw/inc/PostItMgr.hxx7
-rw-r--r--sw/inc/SwAppletImpl.hxx4
-rw-r--r--sw/inc/SwNumberTree.hxx4
-rw-r--r--sw/inc/acmplwrd.hxx2
-rw-r--r--sw/inc/authfld.hxx2
-rw-r--r--sw/inc/calc.hxx2
-rw-r--r--sw/inc/ccoll.hxx2
-rw-r--r--sw/inc/cellatr.hxx4
-rw-r--r--sw/inc/crsrsh.hxx4
-rw-r--r--sw/inc/dbmgr.hxx2
-rw-r--r--sw/inc/doc.hxx8
-rw-r--r--sw/inc/docary.hxx2
-rw-r--r--sw/inc/docsh.hxx2
-rw-r--r--sw/inc/docstat.hxx11
-rw-r--r--sw/inc/docstyle.hxx6
-rw-r--r--sw/inc/docufld.hxx4
-rw-r--r--sw/inc/edglbldc.hxx2
-rw-r--r--sw/inc/edimp.hxx2
-rw-r--r--sw/inc/editsh.hxx2
-rw-r--r--sw/inc/errhdl.hxx2
-rw-r--r--sw/inc/expfld.hxx2
-rw-r--r--sw/inc/extinput.hxx2
-rw-r--r--sw/inc/fchrfmt.hxx2
-rw-r--r--sw/inc/fldbas.hxx4
-rw-r--r--sw/inc/flypos.hxx2
-rw-r--r--sw/inc/fmtanchr.hxx2
-rw-r--r--sw/inc/fmtautofmt.hxx2
-rw-r--r--sw/inc/fmtclbl.hxx2
-rw-r--r--sw/inc/fmtclds.hxx2
-rw-r--r--sw/inc/fmtcnct.hxx2
-rw-r--r--sw/inc/fmtcntnt.hxx2
-rw-r--r--sw/inc/fmtcol.hxx2
-rw-r--r--sw/inc/fmteiro.hxx2
-rw-r--r--sw/inc/fmtflcnt.hxx2
-rw-r--r--sw/inc/fmtfld.hxx6
-rw-r--r--sw/inc/fmtfollowtextflow.hxx2
-rw-r--r--sw/inc/fmtfordr.hxx2
-rw-r--r--sw/inc/fmtfsize.hxx2
-rw-r--r--sw/inc/fmtftn.hxx2
-rw-r--r--sw/inc/fmtftntx.hxx2
-rw-r--r--sw/inc/fmthdft.hxx2
-rw-r--r--sw/inc/fmtinfmt.hxx2
-rw-r--r--sw/inc/fmtline.hxx2
-rw-r--r--sw/inc/fmtlsplt.hxx2
-rw-r--r--[-rwxr-xr-x]sw/inc/fmtmeta.hxx2
-rw-r--r--sw/inc/fmtornt.hxx2
-rw-r--r--sw/inc/fmtpdsc.hxx2
-rw-r--r--sw/inc/fmtrfmrk.hxx2
-rw-r--r--sw/inc/fmtrowsplt.hxx2
-rw-r--r--sw/inc/fmtruby.hxx2
-rw-r--r--sw/inc/fmtsrnd.hxx2
-rw-r--r--sw/inc/fmturl.hxx2
-rw-r--r--sw/inc/fmtwrapinfluenceonobjpos.hxx2
-rw-r--r--sw/inc/ftnidx.hxx2
-rw-r--r--sw/inc/grfatr.hxx4
-rw-r--r--sw/inc/helpid.h2
-rw-r--r--sw/inc/hfspacingitem.hxx2
-rw-r--r--sw/inc/hints.hxx21
-rw-r--r--sw/inc/index.hxx6
-rw-r--r--sw/inc/istyleaccess.hxx2
-rw-r--r--sw/inc/makefile.mk6
-rw-r--r--sw/inc/modcfg.hxx6
-rw-r--r--sw/inc/ndarr.hxx2
-rw-r--r--sw/inc/ndhints.hxx4
-rw-r--r--sw/inc/ndindex.hxx2
-rw-r--r--sw/inc/node.hxx4
-rw-r--r--sw/inc/numrule.hxx2
-rw-r--r--sw/inc/pam.hxx2
-rw-r--r--sw/inc/paratr.hxx4
-rw-r--r--sw/inc/pch/precompiled_sw.hxx119
-rw-r--r--sw/inc/postithelper.hxx2
-rw-r--r--sw/inc/redline.hxx4
-rw-r--r--sw/inc/rolbck.hxx7
-rw-r--r--sw/inc/rubylist.hxx2
-rw-r--r--sw/inc/section.hxx2
-rw-r--r--sw/inc/shellio.hxx4
-rw-r--r--sw/inc/shellres.hxx4
-rw-r--r--sw/inc/sortopt.hxx2
-rw-r--r--sw/inc/swatrset.hxx4
-rw-r--r--sw/inc/swfltopt.hxx2
-rw-r--r--sw/inc/swhints.hxx2
-rw-r--r--sw/inc/swmodule.hxx9
-rw-r--r--sw/inc/swrect.hxx129
-rw-r--r--sw/inc/swregion.hxx2
-rw-r--r--sw/inc/swtable.hxx14
-rw-r--r--sw/inc/swundo.hxx2
-rw-r--r--sw/inc/tabcol.hxx2
-rw-r--r--sw/inc/tblafmt.hxx4
-rw-r--r--sw/inc/tblsel.hxx2
-rw-r--r--sw/inc/tgrditem.hxx2
-rw-r--r--sw/inc/tox.hxx4
-rw-r--r--sw/inc/txatbase.hxx10
-rw-r--r--sw/inc/txatritr.hxx2
-rw-r--r--sw/inc/txtatr.hxx9
-rw-r--r--sw/inc/undobj.hxx11
-rw-r--r--sw/inc/unoatxt.hxx4
-rw-r--r--sw/inc/unocoll.hxx3
-rw-r--r--sw/inc/unodraw.hxx2
-rw-r--r--sw/inc/unoevent.hxx2
-rw-r--r--sw/inc/unoevtlstnr.hxx2
-rw-r--r--sw/inc/unomailmerge.hxx2
-rw-r--r--sw/inc/unomap.hxx4
-rw-r--r--sw/inc/unoobj.hxx4
-rw-r--r--sw/inc/unoport.hxx2
-rw-r--r--sw/inc/unoprnms.hxx4
-rw-r--r--sw/inc/unosett.hxx2
-rw-r--r--sw/inc/unostyle.hxx4
-rw-r--r--sw/inc/unotbl.hxx4
-rw-r--r--sw/inc/unotxdoc.hxx4
-rw-r--r--sw/inc/viewopt.hxx4
-rw-r--r--sw/inc/viewsh.hxx2
-rw-r--r--sw/inc/viscrs.hxx4
-rwxr-xr-x[-rw-r--r--]sw/prj/build.lst5
-rw-r--r--sw/prj/d.lst1
-rwxr-xr-xsw/qa/complex/checkColor/makefile.mk2
-rwxr-xr-xsw/qa/complex/indeterminateState/makefile.mk2
-rwxr-xr-xsw/qa/complex/writer/TextPortionEnumerationTest.java13
-rwxr-xr-xsw/qa/complex/writer/makefile.mk2
-rw-r--r--sw/qa/core/Test-BigPtrArray.cxx2
-rw-r--r--sw/qa/core/makefile.mk16
-rw-r--r--sw/sdi/_docsh.sdi2
-rw-r--r--sw/sdi/_viewsh.sdi2
-rw-r--r--sw/sdi/docsh.sdi2
-rw-r--r--sw/sdi/makefile.mk10
-rw-r--r--sw/sdi/swslots.sdi9
-rw-r--r--sw/sdi/viewsh.sdi6
-rw-r--r--sw/sdi/wdocsh.sdi2
-rw-r--r--sw/sdi/wviewsh.sdi6
-rw-r--r--sw/source/core/SwNumberTree/SwNumberTree.cxx8
-rw-r--r--sw/source/core/access/accmap.cxx18
-rw-r--r--sw/source/core/attr/calbck.cxx6
-rw-r--r--sw/source/core/attr/hints.cxx16
-rw-r--r--sw/source/core/attr/swatrset.cxx4
-rw-r--r--sw/source/core/bastyp/bparr.cxx2
-rw-r--r--sw/source/core/bastyp/calc.cxx4
-rw-r--r--sw/source/core/bastyp/index.cxx10
-rw-r--r--sw/source/core/bastyp/init.cxx6
-rw-r--r--sw/source/core/bastyp/swcache.cxx20
-rw-r--r--sw/source/core/bastyp/swrect.cxx123
-rw-r--r--sw/source/core/bastyp/swregion.cxx2
-rw-r--r--sw/source/core/crsr/crsrsh.cxx6
-rw-r--r--sw/source/core/crsr/crstrvl.cxx10
-rw-r--r--sw/source/core/crsr/findattr.cxx4
-rw-r--r--sw/source/core/crsr/findtxt.cxx2
-rw-r--r--sw/source/core/crsr/pam.cxx2
-rw-r--r--sw/source/core/crsr/swcrsr.cxx2
-rw-r--r--sw/source/core/crsr/trvltbl.cxx2
-rw-r--r--sw/source/core/crsr/viscrs.cxx6
-rw-r--r--sw/source/core/doc/SwStyleNameMapper.cxx2
-rw-r--r--sw/source/core/doc/dbgoutsw.cxx6
-rw-r--r--sw/source/core/doc/doc.cxx52
-rw-r--r--sw/source/core/doc/doccomp.cxx4
-rw-r--r--sw/source/core/doc/docdde.cxx2
-rw-r--r--sw/source/core/doc/docdesc.cxx2
-rw-r--r--sw/source/core/doc/docdraw.cxx2
-rw-r--r--sw/source/core/doc/docfld.cxx12
-rw-r--r--sw/source/core/doc/docfly.cxx4
-rw-r--r--sw/source/core/doc/docfmt.cxx99
-rw-r--r--sw/source/core/doc/docglbl.cxx6
-rw-r--r--sw/source/core/doc/doclay.cxx8
-rw-r--r--sw/source/core/doc/docnew.cxx13
-rw-r--r--sw/source/core/doc/docredln.cxx17
-rw-r--r--sw/source/core/doc/docsort.cxx26
-rw-r--r--sw/source/core/doc/docstat.cxx6
-rw-r--r--sw/source/core/doc/doctxm.cxx6
-rw-r--r--sw/source/core/doc/fmtcol.cxx2
-rw-r--r--sw/source/core/doc/htmltbl.cxx8
-rw-r--r--sw/source/core/doc/notxtfrm.cxx2
-rw-r--r--sw/source/core/doc/number.cxx16
-rw-r--r--sw/source/core/doc/swstylemanager.cxx2
-rw-r--r--sw/source/core/doc/tblafmt.cxx8
-rw-r--r--sw/source/core/doc/tblcpy.cxx2
-rw-r--r--sw/source/core/doc/tblrwcl.cxx6
-rw-r--r--sw/source/core/doc/visiturl.cxx2
-rw-r--r--sw/source/core/docnode/ndcopy.cxx4
-rw-r--r--sw/source/core/docnode/ndindex.cxx8
-rw-r--r--sw/source/core/docnode/ndnotxt.cxx2
-rw-r--r--sw/source/core/docnode/ndnum.cxx2
-rw-r--r--sw/source/core/docnode/ndsect.cxx2
-rw-r--r--sw/source/core/docnode/ndtbl.cxx6
-rw-r--r--sw/source/core/docnode/node.cxx21
-rw-r--r--sw/source/core/docnode/nodes.cxx4
-rw-r--r--sw/source/core/docnode/section.cxx4
-rw-r--r--sw/source/core/docnode/swthreadmanager.cxx18
-rw-r--r--sw/source/core/draw/dcontact.cxx29
-rw-r--r--sw/source/core/draw/dflyobj.cxx12
-rw-r--r--sw/source/core/draw/dpage.cxx4
-rw-r--r--sw/source/core/draw/drawdoc.cxx4
-rw-r--r--sw/source/core/edit/autofmt.cxx2
-rw-r--r--sw/source/core/edit/edattr.cxx2
-rw-r--r--sw/source/core/edit/edglss.cxx2
-rw-r--r--sw/source/core/edit/editsh.cxx6
-rw-r--r--sw/source/core/edit/ednumber.cxx2
-rw-r--r--sw/source/core/edit/edtab.cxx2
-rw-r--r--sw/source/core/edit/edtox.cxx2
-rw-r--r--sw/source/core/except/dbgloop.cxx2
-rw-r--r--sw/source/core/except/makefile.mk6
-rw-r--r--sw/source/core/fields/authfld.cxx2
-rw-r--r--sw/source/core/fields/dbfld.cxx2
-rw-r--r--sw/source/core/fields/docufld.cxx88
-rw-r--r--sw/source/core/fields/fldbas.cxx8
-rw-r--r--sw/source/core/fields/flddat.cxx2
-rw-r--r--sw/source/core/fields/flddropdown.cxx2
-rw-r--r--sw/source/core/fields/reffld.cxx2
-rw-r--r--sw/source/core/fields/usrfld.cxx4
-rw-r--r--sw/source/core/frmedt/fecopy.cxx2
-rw-r--r--sw/source/core/frmedt/fedesc.cxx2
-rw-r--r--sw/source/core/frmedt/fefly1.cxx6
-rw-r--r--sw/source/core/frmedt/feflyole.cxx2
-rw-r--r--sw/source/core/graphic/ndgrf.cxx4
-rw-r--r--sw/source/core/inc/SwXTextDefaults.hxx2
-rw-r--r--sw/source/core/inc/blink.hxx2
-rw-r--r--sw/source/core/inc/dbg_lay.hxx2
-rw-r--r--sw/source/core/inc/dbgloop.hxx2
-rw-r--r--sw/source/core/inc/docsort.hxx2
-rw-r--r--sw/source/core/inc/doctxm.hxx2
-rw-r--r--sw/source/core/inc/drawfont.hxx34
-rw-r--r--sw/source/core/inc/flyfrm.hxx2
-rw-r--r--sw/source/core/inc/fntcache.hxx2
-rw-r--r--sw/source/core/inc/frame.hxx2
-rw-r--r--sw/source/core/inc/ftnfrm.hxx4
-rw-r--r--sw/source/core/inc/layact.hxx4
-rw-r--r--sw/source/core/inc/laycache.hxx2
-rw-r--r--sw/source/core/inc/mvsave.hxx2
-rw-r--r--sw/source/core/inc/noteurl.hxx2
-rw-r--r--sw/source/core/inc/pagefrm.hxx2
-rw-r--r--sw/source/core/inc/rootfrm.hxx4
-rw-r--r--sw/source/core/inc/scriptinfo.hxx2
-rw-r--r--sw/source/core/inc/scrrect.hxx2
-rw-r--r--sw/source/core/inc/swblocks.hxx2
-rw-r--r--sw/source/core/inc/swcache.hxx14
-rw-r--r--sw/source/core/inc/swfntcch.hxx2
-rw-r--r--sw/source/core/inc/swfont.hxx2
-rw-r--r--sw/source/core/inc/swthreadmanager.hxx15
-rw-r--r--sw/source/core/inc/tblrwcl.hxx4
-rw-r--r--sw/source/core/inc/txtfrm.hxx2
-rw-r--r--sw/source/core/inc/visiturl.hxx2
-rw-r--r--sw/source/core/layout/atrfrm.cxx6
-rw-r--r--sw/source/core/layout/calcmove.cxx6
-rw-r--r--sw/source/core/layout/dbg_lay.cxx6
-rw-r--r--sw/source/core/layout/fly.cxx2
-rw-r--r--sw/source/core/layout/flylay.cxx4
-rw-r--r--sw/source/core/layout/frmtool.cxx2
-rw-r--r--sw/source/core/layout/ftnfrm.cxx14
-rw-r--r--sw/source/core/layout/layact.cxx10
-rw-r--r--sw/source/core/layout/laycache.cxx2
-rw-r--r--sw/source/core/layout/layhelp.hxx2
-rw-r--r--sw/source/core/layout/layouter.cxx2
-rw-r--r--sw/source/core/layout/makefile.mk6
-rw-r--r--sw/source/core/layout/newfrm.cxx4
-rw-r--r--sw/source/core/layout/pagechg.cxx8
-rw-r--r--sw/source/core/layout/paintfrm.cxx6
-rw-r--r--sw/source/core/layout/sectfrm.cxx8
-rw-r--r--sw/source/core/layout/ssfrm.cxx2
-rw-r--r--sw/source/core/layout/tabfrm.cxx6
-rw-r--r--sw/source/core/layout/trvlfrm.cxx2
-rw-r--r--sw/source/core/layout/unusedf.cxx2
-rw-r--r--sw/source/core/layout/virtoutp.cxx4
-rw-r--r--sw/source/core/layout/wsfrm.cxx8
-rw-r--r--sw/source/core/makefile.mk4
-rw-r--r--sw/source/core/sw3io/sw3convert.cxx10
-rw-r--r--sw/source/core/swg/SwXMLSectionList.cxx2
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks1.cxx2
-rw-r--r--sw/source/core/swg/swblocks.cxx4
-rw-r--r--sw/source/core/table/swnewtable.cxx8
-rw-r--r--sw/source/core/table/swtable.cxx10
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx24
-rw-r--r--sw/source/core/text/atrstck.cxx21
-rw-r--r--sw/source/core/text/frmcrsr.cxx4
-rw-r--r--sw/source/core/text/frmform.cxx14
-rw-r--r--sw/source/core/text/frmpaint.cxx2
-rw-r--r--sw/source/core/text/guess.cxx2
-rw-r--r--sw/source/core/text/inftxt.cxx18
-rw-r--r--sw/source/core/text/inftxt.hxx6
-rw-r--r--sw/source/core/text/itratr.hxx2
-rw-r--r--sw/source/core/text/itrcrsr.cxx25
-rw-r--r--sw/source/core/text/itrform2.cxx2
-rw-r--r--sw/source/core/text/itrpaint.cxx2
-rw-r--r--sw/source/core/text/makefile.mk11
-rw-r--r--sw/source/core/text/porfld.cxx7
-rw-r--r--sw/source/core/text/porfld.hxx2
-rw-r--r--sw/source/core/text/porglue.cxx2
-rw-r--r--sw/source/core/text/porlay.cxx2
-rw-r--r--sw/source/core/text/porlay.hxx2
-rw-r--r--sw/source/core/text/porlin.cxx8
-rw-r--r--sw/source/core/text/porlin.hxx4
-rw-r--r--sw/source/core/text/redlnitr.cxx2
-rw-r--r--sw/source/core/text/redlnitr.hxx2
-rw-r--r--sw/source/core/text/txtfly.cxx8
-rw-r--r--sw/source/core/text/txtfly.hxx6
-rw-r--r--sw/source/core/text/txtfrm.cxx13
-rw-r--r--sw/source/core/text/txtftn.cxx6
-rw-r--r--sw/source/core/text/txthyph.cxx2
-rw-r--r--sw/source/core/text/txtinit.cxx2
-rw-r--r--sw/source/core/text/txtio.cxx2
-rw-r--r--sw/source/core/text/txtpaint.cxx2
-rw-r--r--sw/source/core/text/txtpaint.hxx2
-rw-r--r--sw/source/core/text/txttab.cxx4
-rw-r--r--sw/source/core/tox/toxhlp.cxx24
-rw-r--r--sw/source/core/tox/txmsrt.cxx2
-rw-r--r--sw/source/core/txtnode/atrfld.cxx2
-rw-r--r--sw/source/core/txtnode/atrftn.cxx2
-rw-r--r--sw/source/core/txtnode/fmtatr2.cxx8
-rw-r--r--sw/source/core/txtnode/fntcache.cxx12
-rw-r--r--sw/source/core/txtnode/fntcap.cxx4
-rw-r--r--sw/source/core/txtnode/ndhints.cxx18
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx31
-rw-r--r--sw/source/core/txtnode/swfont.cxx2
-rw-r--r--sw/source/core/txtnode/thints.cxx106
-rw-r--r--sw/source/core/txtnode/txatbase.cxx2
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx8
-rw-r--r--sw/source/core/txtnode/txtedt.cxx4
-rw-r--r--sw/source/core/undo/docundo.cxx4
-rw-r--r--sw/source/core/undo/rolbck.cxx4
-rw-r--r--sw/source/core/undo/unattr.cxx2
-rw-r--r--sw/source/core/undo/undobj.cxx30
-rw-r--r--sw/source/core/undo/undobj1.cxx2
-rw-r--r--sw/source/core/undo/unredln.cxx51
-rw-r--r--sw/source/core/undo/untbl.cxx9
-rw-r--r--sw/source/core/unocore/swunohelper.cxx2
-rw-r--r--sw/source/core/unocore/unochart.cxx2
-rw-r--r--sw/source/core/unocore/unocoll.cxx2
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx10
-rw-r--r--sw/source/core/unocore/unodraw.cxx20
-rw-r--r--sw/source/core/unocore/unoevent.cxx2
-rw-r--r--sw/source/core/unocore/unofield.cxx2
-rw-r--r--sw/source/core/unocore/unomap.cxx2
-rw-r--r--sw/source/core/unocore/unoobj.cxx2
-rw-r--r--sw/source/core/unocore/unoobj2.cxx8
-rw-r--r--sw/source/core/unocore/unoparagraph.cxx5
-rw-r--r--sw/source/core/unocore/unoport.cxx6
-rw-r--r--sw/source/core/unocore/unoportenum.cxx1
-rw-r--r--sw/source/core/unocore/unoprnms.cxx2
-rw-r--r--sw/source/core/unocore/unosect.cxx2
-rw-r--r--sw/source/core/unocore/unostyle.cxx6
-rw-r--r--sw/source/core/unocore/unotbl.cxx4
-rw-r--r--sw/source/core/unocore/unotext.cxx58
-rw-r--r--sw/source/core/view/vdraw.cxx2
-rw-r--r--sw/source/core/view/viewsh.cxx41
-rw-r--r--sw/source/core/view/vprint.cxx61
-rw-r--r--sw/source/filter/ascii/ascatr.cxx2
-rw-r--r--sw/source/filter/basflt/fltini.cxx26
-rw-r--r--sw/source/filter/basflt/shellio.cxx49
-rw-r--r--sw/source/filter/html/SwAppletImpl.cxx2
-rw-r--r--sw/source/filter/html/css1atr.cxx4
-rw-r--r--sw/source/filter/html/htmlatr.cxx4
-rw-r--r--sw/source/filter/html/htmlbas.cxx2
-rw-r--r--sw/source/filter/html/htmlcss1.cxx6
-rw-r--r--sw/source/filter/html/htmlctxt.cxx2
-rw-r--r--sw/source/filter/html/htmldraw.cxx4
-rw-r--r--sw/source/filter/html/htmlfld.cxx4
-rw-r--r--sw/source/filter/html/htmlfly.cxx2
-rw-r--r--sw/source/filter/html/htmlfly.hxx2
-rw-r--r--sw/source/filter/html/htmlform.cxx5
-rw-r--r--sw/source/filter/html/htmlforw.cxx4
-rw-r--r--sw/source/filter/html/htmlftn.cxx4
-rw-r--r--sw/source/filter/html/htmlgrin.cxx6
-rw-r--r--sw/source/filter/html/htmlnum.cxx2
-rw-r--r--sw/source/filter/html/htmlplug.cxx6
-rw-r--r--sw/source/filter/html/htmlsect.cxx2
-rw-r--r--sw/source/filter/html/htmltab.cxx10
-rw-r--r--sw/source/filter/html/htmltabw.cxx4
-rw-r--r--sw/source/filter/html/svxcss1.cxx4
-rw-r--r--sw/source/filter/html/svxcss1.hxx4
-rw-r--r--sw/source/filter/html/swhtml.cxx28
-rw-r--r--sw/source/filter/html/swhtml.hxx6
-rw-r--r--sw/source/filter/html/wrthtml.cxx4
-rw-r--r--sw/source/filter/html/wrthtml.hxx2
-rw-r--r--sw/source/filter/inc/fltglbls.hxx2
-rw-r--r--sw/source/filter/inc/msfilter.hxx2
-rw-r--r--sw/source/filter/inc/wrtswtbl.hxx4
-rw-r--r--sw/source/filter/rtf/rtfatr.cxx8
-rw-r--r--sw/source/filter/rtf/rtffld.cxx4
-rw-r--r--sw/source/filter/rtf/rtffly.cxx2
-rw-r--r--sw/source/filter/rtf/rtfnum.cxx4
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx8
-rw-r--r--sw/source/filter/rtf/swparrtf.hxx2
-rw-r--r--sw/source/filter/rtf/wrtrtf.cxx2
-rw-r--r--sw/source/filter/writer/writer.cxx6
-rw-r--r--sw/source/filter/writer/wrt_fn.cxx4
-rw-r--r--sw/source/filter/writer/wrtswtbl.cxx22
-rw-r--r--sw/source/filter/ww1/fltshell.cxx6
-rw-r--r--sw/source/filter/ww1/w1class.cxx2
-rw-r--r--sw/source/filter/ww1/w1filter.cxx6
-rw-r--r--sw/source/filter/ww1/w1sprm.cxx4
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.cxx38
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.hxx3
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/dump/ww8scan.hxx2
-rw-r--r--sw/source/filter/ww8/escher.hxx2
-rw-r--r--sw/source/filter/ww8/tracer.cxx2
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx2
-rw-r--r--sw/source/filter/ww8/writerhelper.hxx4
-rw-r--r--sw/source/filter/ww8/writerwordglue.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx7
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx4
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx63
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx182
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx32
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx6
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx34
-rw-r--r--sw/source/filter/ww8/ww8attributeoutput.hxx3
-rw-r--r--sw/source/filter/ww8/ww8glsy.cxx2
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx9
-rw-r--r--sw/source/filter/ww8/ww8graf2.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par.cxx40
-rw-r--r--sw/source/filter/ww8/ww8par.hxx4
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx56
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx4
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx66
-rw-r--r--sw/source/filter/ww8/ww8scan.hxx2
-rw-r--r--sw/source/filter/xml/XMLRedlineImportHelper.cxx2
-rw-r--r--sw/source/filter/xml/swxml.cxx4
-rw-r--r--sw/source/filter/xml/wrtxml.cxx4
-rw-r--r--sw/source/filter/xml/xmlexp.cxx14
-rw-r--r--sw/source/filter/xml/xmlexpit.cxx8
-rw-r--r--sw/source/filter/xml/xmlfmt.cxx2
-rw-r--r--sw/source/filter/xml/xmlfmte.cxx8
-rw-r--r--sw/source/filter/xml/xmlimp.cxx4
-rw-r--r--sw/source/filter/xml/xmlimpit.cxx6
-rw-r--r--sw/source/filter/xml/xmltble.cxx14
-rw-r--r--sw/source/filter/xml/xmltbli.cxx6
-rw-r--r--sw/source/filter/xml/xmltbli.hxx2
-rw-r--r--sw/source/filter/xml/xmltexte.cxx4
-rw-r--r--sw/source/filter/xml/xmltexti.cxx2
-rw-r--r--sw/source/ui/app/app.src2
-rw-r--r--sw/source/ui/app/apphdl.cxx196
-rw-r--r--sw/source/ui/app/appopt.cxx16
-rw-r--r--sw/source/ui/app/docsh.cxx29
-rw-r--r--sw/source/ui/app/docsh2.cxx14
-rw-r--r--sw/source/ui/app/docshdrw.cxx2
-rw-r--r--sw/source/ui/app/docshini.cxx11
-rw-r--r--sw/source/ui/app/docst.cxx8
-rw-r--r--sw/source/ui/app/docstyle.cxx10
-rw-r--r--sw/source/ui/app/mainwn.cxx2
-rw-r--r--sw/source/ui/app/swdll.cxx2
-rw-r--r--sw/source/ui/app/swmodul1.cxx2
-rw-r--r--sw/source/ui/app/swmodule.cxx2
-rw-r--r--sw/source/ui/chrdlg/break.cxx2
-rw-r--r--sw/source/ui/chrdlg/ccoll.cxx8
-rw-r--r--sw/source/ui/chrdlg/chardlg.cxx6
-rw-r--r--sw/source/ui/chrdlg/drpcps.cxx6
-rw-r--r--sw/source/ui/chrdlg/numpara.cxx6
-rw-r--r--sw/source/ui/chrdlg/pardlg.cxx10
-rw-r--r--sw/source/ui/chrdlg/tblnumfm.cxx2
-rw-r--r--sw/source/ui/config/barcfg.cxx2
-rw-r--r--sw/source/ui/config/cfgitems.cxx2
-rw-r--r--sw/source/ui/config/dbconfig.cxx2
-rw-r--r--sw/source/ui/config/fontcfg.cxx4
-rw-r--r--sw/source/ui/config/mailconfigpage.cxx2
-rw-r--r--sw/source/ui/config/modcfg.cxx10
-rw-r--r--sw/source/ui/config/optload.cxx2
-rw-r--r--sw/source/ui/config/optpage.cxx14
-rw-r--r--sw/source/ui/config/prtopt.cxx3
-rw-r--r--sw/source/ui/config/uinums.cxx6
-rw-r--r--sw/source/ui/config/usrpref.cxx13
-rw-r--r--sw/source/ui/config/viewopt.cxx12
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx4
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx2
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx12
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx18
-rw-r--r--sw/source/ui/dbui/maildispatcher.cxx11
-rw-r--r--sw/source/ui/dbui/mailmergechildwindow.cxx6
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.hxx2
-rw-r--r--sw/source/ui/dbui/mmconfigitem.cxx8
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.cxx2
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx4
-rw-r--r--sw/source/ui/dbui/mmmergepage.cxx2
-rw-r--r--sw/source/ui/dbui/mmoutputpage.cxx6
-rw-r--r--sw/source/ui/dialog/SwSpellDialogChildWindow.cxx4
-rw-r--r--sw/source/ui/dialog/ascfldlg.cxx2
-rw-r--r--sw/source/ui/dialog/macassgn.cxx2
-rw-r--r--sw/source/ui/dialog/regionsw.cxx8
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx4
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx14
-rw-r--r--sw/source/ui/dochdl/gloshdl.cxx6
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx6
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx9
-rw-r--r--sw/source/ui/docvw/edtwin.cxx16
-rw-r--r--sw/source/ui/docvw/edtwin2.cxx14
-rw-r--r--sw/source/ui/docvw/postit.cxx18
-rw-r--r--sw/source/ui/docvw/romenu.cxx6
-rw-r--r--sw/source/ui/docvw/srcedtw.cxx16
-rw-r--r--sw/source/ui/envelp/envfmt.cxx2
-rw-r--r--sw/source/ui/envelp/envfmt.hxx2
-rw-r--r--sw/source/ui/envelp/envimg.cxx5
-rw-r--r--sw/source/ui/envelp/envprt.cxx2
-rw-r--r--sw/source/ui/envelp/labelcfg.cxx3
-rw-r--r--sw/source/ui/envelp/labimg.cxx4
-rw-r--r--sw/source/ui/envelp/labprt.cxx4
-rw-r--r--sw/source/ui/envelp/mailmrge.cxx6
-rw-r--r--sw/source/ui/fldui/flddinf.cxx82
-rw-r--r--sw/source/ui/fldui/flddinf.hxx7
-rw-r--r--sw/source/ui/fldui/flddok.cxx2
-rw-r--r--sw/source/ui/fldui/fldedt.cxx18
-rw-r--r--sw/source/ui/fldui/fldfunc.cxx2
-rw-r--r--sw/source/ui/fldui/fldmgr.cxx8
-rw-r--r--sw/source/ui/fldui/fldpage.cxx2
-rw-r--r--sw/source/ui/fldui/fldtdlg.cxx34
-rw-r--r--sw/source/ui/fldui/fldvar.cxx2
-rw-r--r--sw/source/ui/fldui/javaedit.cxx2
-rw-r--r--sw/source/ui/fldui/makefile.mk1
-rw-r--r--sw/source/ui/fmtui/tmpdlg.cxx14
-rw-r--r--sw/source/ui/frmdlg/colex.cxx2
-rw-r--r--sw/source/ui/frmdlg/column.cxx2
-rw-r--r--sw/source/ui/frmdlg/frmmgr.cxx2
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx8
-rw-r--r--sw/source/ui/frmdlg/uiborder.cxx4
-rw-r--r--sw/source/ui/frmdlg/wrap.cxx4
-rw-r--r--sw/source/ui/globdoc/globdoc.cxx2
-rw-r--r--sw/source/ui/inc/barcfg.hxx3
-rw-r--r--sw/source/ui/inc/basesh.hxx2
-rw-r--r--sw/source/ui/inc/cfgitems.hxx6
-rw-r--r--sw/source/ui/inc/dbconfig.hxx2
-rw-r--r--sw/source/ui/inc/dbinsdlg.hxx6
-rw-r--r--sw/source/ui/inc/edtwin.hxx2
-rw-r--r--sw/source/ui/inc/envimg.hxx3
-rw-r--r--sw/source/ui/inc/fldmgr.hxx2
-rw-r--r--sw/source/ui/inc/fontcfg.hxx1
-rw-r--r--sw/source/ui/inc/formatclipboard.hxx4
-rw-r--r--sw/source/ui/inc/glosdoc.hxx2
-rw-r--r--sw/source/ui/inc/gloslst.hxx2
-rw-r--r--sw/source/ui/inc/label.hxx2
-rw-r--r--sw/source/ui/inc/labelcfg.hxx3
-rw-r--r--sw/source/ui/inc/labimg.hxx5
-rw-r--r--sw/source/ui/inc/maildispatcher.hxx2
-rw-r--r--sw/source/ui/inc/navicfg.hxx3
-rw-r--r--sw/source/ui/inc/navipi.hxx2
-rw-r--r--sw/source/ui/inc/numfmtlb.hxx2
-rw-r--r--sw/source/ui/inc/optcomp.hxx2
-rw-r--r--sw/source/ui/inc/optpage.hxx2
-rw-r--r--sw/source/ui/inc/prtopt.hxx3
-rw-r--r--sw/source/ui/inc/redlndlg.hxx4
-rw-r--r--sw/source/ui/inc/srcedtw.hxx13
-rw-r--r--sw/source/ui/inc/swlbox.hxx2
-rw-r--r--sw/source/ui/inc/swwrtshitem.hxx2
-rw-r--r--sw/source/ui/inc/uiitems.hxx2
-rw-r--r--sw/source/ui/inc/uinums.hxx2
-rw-r--r--sw/source/ui/inc/unotxvw.hxx4
-rw-r--r--sw/source/ui/inc/usrpref.hxx10
-rw-r--r--sw/source/ui/index/cnttab.cxx6
-rw-r--r--sw/source/ui/index/idxmrk.cxx10
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx10
-rw-r--r--sw/source/ui/lingu/olmenu.cxx24
-rw-r--r--sw/source/ui/misc/bookmark.cxx2
-rw-r--r--sw/source/ui/misc/docfnote.cxx2
-rw-r--r--sw/source/ui/misc/glosbib.cxx4
-rw-r--r--sw/source/ui/misc/glosdoc.cxx8
-rw-r--r--sw/source/ui/misc/glossary.cxx12
-rw-r--r--sw/source/ui/misc/glshell.cxx6
-rw-r--r--sw/source/ui/misc/insfnote.cxx4
-rw-r--r--sw/source/ui/misc/insrule.cxx2
-rw-r--r--sw/source/ui/misc/linenum.cxx2
-rw-r--r--sw/source/ui/misc/num.cxx6
-rw-r--r--sw/source/ui/misc/outline.cxx2
-rw-r--r--sw/source/ui/misc/pgfnote.cxx4
-rw-r--r--sw/source/ui/misc/redlndlg.cxx6
-rw-r--r--sw/source/ui/misc/srtdlg.cxx4
-rw-r--r--sw/source/ui/misc/swmodalredlineacceptdlg.cxx4
-rw-r--r--sw/source/ui/ribbar/concustomshape.cxx2
-rw-r--r--sw/source/ui/ribbar/drawbase.cxx2
-rw-r--r--sw/source/ui/ribbar/inputwin.cxx21
-rw-r--r--sw/source/ui/ribbar/tblctrl.cxx2
-rw-r--r--sw/source/ui/ribbar/tbxanchr.cxx2
-rw-r--r--sw/source/ui/ribbar/workctrl.cxx16
-rwxr-xr-xsw/source/ui/shells/annotsh.cxx20
-rw-r--r--sw/source/ui/shells/basesh.cxx21
-rw-r--r--sw/source/ui/shells/beziersh.cxx4
-rw-r--r--sw/source/ui/shells/drawdlg.cxx4
-rw-r--r--sw/source/ui/shells/drawsh.cxx4
-rw-r--r--sw/source/ui/shells/drformsh.cxx4
-rw-r--r--sw/source/ui/shells/drwbassh.cxx12
-rw-r--r--sw/source/ui/shells/drwtxtex.cxx10
-rw-r--r--sw/source/ui/shells/drwtxtsh.cxx8
-rw-r--r--sw/source/ui/shells/frmsh.cxx11
-rw-r--r--sw/source/ui/shells/grfsh.cxx6
-rw-r--r--sw/source/ui/shells/grfshex.cxx4
-rwxr-xr-xsw/source/ui/shells/langhelper.cxx8
-rw-r--r--sw/source/ui/shells/listsh.cxx8
-rw-r--r--sw/source/ui/shells/mediash.cxx6
-rw-r--r--sw/source/ui/shells/slotadd.cxx12
-rw-r--r--sw/source/ui/shells/tabsh.cxx10
-rw-r--r--sw/source/ui/shells/textdrw.cxx2
-rw-r--r--sw/source/ui/shells/textfld.cxx12
-rw-r--r--sw/source/ui/shells/textglos.cxx4
-rw-r--r--sw/source/ui/shells/textidx.cxx4
-rw-r--r--sw/source/ui/shells/textsh.cxx12
-rw-r--r--sw/source/ui/shells/textsh1.cxx22
-rw-r--r--sw/source/ui/shells/textsh2.cxx8
-rw-r--r--sw/source/ui/shells/txtattr.cxx8
-rw-r--r--sw/source/ui/shells/txtcrsr.cxx2
-rw-r--r--sw/source/ui/shells/txtnum.cxx4
-rw-r--r--sw/source/ui/smartmenu/stmenu.cxx2
-rw-r--r--sw/source/ui/table/convert.cxx2
-rw-r--r--sw/source/ui/table/convert.src2
-rw-r--r--sw/source/ui/table/instable.src2
-rw-r--r--sw/source/ui/table/rowht.cxx4
-rw-r--r--sw/source/ui/table/swtablerep.cxx6
-rw-r--r--sw/source/ui/table/tabledlg.cxx6
-rw-r--r--sw/source/ui/table/tautofmt.cxx2
-rw-r--r--sw/source/ui/uiview/pview.cxx10
-rw-r--r--sw/source/ui/uiview/srcview.cxx16
-rw-r--r--sw/source/ui/uiview/view.cxx8
-rw-r--r--sw/source/ui/uiview/view0.cxx10
-rw-r--r--sw/source/ui/uiview/view2.cxx14
-rw-r--r--sw/source/ui/uiview/viewcoll.cxx2
-rw-r--r--sw/source/ui/uiview/viewdlg.cxx2
-rw-r--r--sw/source/ui/uiview/viewdraw.cxx4
-rw-r--r--sw/source/ui/uiview/viewling.cxx4
-rw-r--r--sw/source/ui/uiview/viewprt.cxx29
-rw-r--r--sw/source/ui/uiview/viewsrch.cxx14
-rw-r--r--sw/source/ui/uiview/viewstat.cxx16
-rw-r--r--sw/source/ui/uiview/viewtab.cxx6
-rw-r--r--sw/source/ui/uno/SwXDocumentSettings.cxx2
-rw-r--r--sw/source/ui/uno/dlelstnr.cxx2
-rw-r--r--sw/source/ui/uno/swdet2.cxx2
-rw-r--r--sw/source/ui/uno/swdetect.cxx8
-rw-r--r--sw/source/ui/uno/unoatxt.cxx8
-rw-r--r--sw/source/ui/uno/unomailmerge.cxx4
-rw-r--r--sw/source/ui/uno/unomod.cxx6
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx14
-rw-r--r--sw/source/ui/uno/unotxvw.cxx4
-rw-r--r--sw/source/ui/uno/warnpassword.cxx2
-rw-r--r--sw/source/ui/utlui/attrdesc.cxx2
-rw-r--r--sw/source/ui/utlui/bookctrl.cxx6
-rw-r--r--sw/source/ui/utlui/content.cxx8
-rw-r--r--sw/source/ui/utlui/glbltree.cxx14
-rw-r--r--sw/source/ui/utlui/gloslst.cxx6
-rw-r--r--sw/source/ui/utlui/initui.cxx3
-rw-r--r--sw/source/ui/utlui/initui.hrc1
-rw-r--r--sw/source/ui/utlui/initui.src4
-rw-r--r--sw/source/ui/utlui/navicfg.cxx3
-rw-r--r--sw/source/ui/utlui/navipi.cxx14
-rw-r--r--sw/source/ui/utlui/numfmtlb.cxx6
-rw-r--r--sw/source/ui/utlui/swrenamexnameddlg.cxx2
-rw-r--r--sw/source/ui/utlui/tmplctrl.cxx4
-rw-r--r--sw/source/ui/utlui/uitool.cxx8
-rw-r--r--sw/source/ui/utlui/unotools.cxx2
-rw-r--r--sw/source/ui/utlui/viewlayoutctrl.cxx16
-rw-r--r--sw/source/ui/utlui/zoomctrl.cxx2
-rw-r--r--sw/source/ui/vba/makefile.mk111
-rw-r--r--sw/source/ui/vba/service.cxx87
-rw-r--r--sw/source/ui/vba/vbaaddin.cxx107
-rw-r--r--sw/source/ui/vba/vbaaddin.hxx62
-rw-r--r--sw/source/ui/vba/vbaaddins.cxx110
-rw-r--r--sw/source/ui/vba/vbaaddins.hxx55
-rw-r--r--sw/source/ui/vba/vbaapplication.cxx206
-rw-r--r--sw/source/ui/vba/vbaapplication.hxx77
-rw-r--r--sw/source/ui/vba/vbaautotextentry.cxx129
-rw-r--r--sw/source/ui/vba/vbaautotextentry.hxx83
-rw-r--r--sw/source/ui/vba/vbabookmark.cxx112
-rw-r--r--sw/source/ui/vba/vbabookmark.hxx68
-rw-r--r--sw/source/ui/vba/vbabookmarks.cxx240
-rw-r--r--sw/source/ui/vba/vbabookmarks.hxx78
-rw-r--r--sw/source/ui/vba/vbaborders.cxx381
-rw-r--r--sw/source/ui/vba/vbaborders.hxx66
-rw-r--r--sw/source/ui/vba/vbadialog.cxx81
-rw-r--r--sw/source/ui/vba/vbadialog.hxx53
-rw-r--r--sw/source/ui/vba/vbadialogs.cxx64
-rw-r--r--sw/source/ui/vba/vbadialogs.hxx56
-rw-r--r--sw/source/ui/vba/vbadocument.cxx384
-rw-r--r--sw/source/ui/vba/vbadocument.hxx83
-rw-r--r--sw/source/ui/vba/vbadocumentproperties.cxx767
-rw-r--r--sw/source/ui/vba/vbadocumentproperties.hxx70
-rw-r--r--sw/source/ui/vba/vbadocuments.cxx200
-rw-r--r--sw/source/ui/vba/vbadocuments.hxx69
-rw-r--r--sw/source/ui/vba/vbafield.cxx481
-rw-r--r--sw/source/ui/vba/vbafield.hxx80
-rw-r--r--sw/source/ui/vba/vbafind.cxx431
-rw-r--r--sw/source/ui/vba/vbafind.hxx104
-rw-r--r--sw/source/ui/vba/vbafont.cxx216
-rw-r--r--sw/source/ui/vba/vbafont.hxx31
-rw-r--r--sw/source/ui/vba/vbaglobals.cxx196
-rw-r--r--sw/source/ui/vba/vbaglobals.hxx83
-rw-r--r--sw/source/ui/vba/vbaheaderfooter.cxx114
-rw-r--r--sw/source/ui/vba/vbaheaderfooter.hxx63
-rw-r--r--sw/source/ui/vba/vbaheaderfooterhelper.cxx178
-rw-r--r--sw/source/ui/vba/vbaheaderfooterhelper.hxx52
-rw-r--r--sw/source/ui/vba/vbainformationhelper.cxx71
-rw-r--r--sw/source/ui/vba/vbainformationhelper.hxx46
-rw-r--r--sw/source/ui/vba/vbaoptions.cxx287
-rw-r--r--sw/source/ui/vba/vbaoptions.hxx90
-rw-r--r--sw/source/ui/vba/vbapagesetup.cxx275
-rw-r--r--sw/source/ui/vba/vbapagesetup.hxx70
-rw-r--r--sw/source/ui/vba/vbapalette.cxx75
-rw-r--r--sw/source/ui/vba/vbapalette.hxx15
-rw-r--r--sw/source/ui/vba/vbapane.cxx79
-rw-r--r--sw/source/ui/vba/vbapane.hxx57
-rw-r--r--sw/source/ui/vba/vbapanes.cxx127
-rw-r--r--sw/source/ui/vba/vbapanes.hxx60
-rw-r--r--sw/source/ui/vba/vbaparagraph.cxx177
-rw-r--r--sw/source/ui/vba/vbaparagraph.hxx84
-rw-r--r--sw/source/ui/vba/vbaparagraphformat.cxx576
-rw-r--r--sw/source/ui/vba/vbaparagraphformat.hxx98
-rw-r--r--sw/source/ui/vba/vbarange.cxx348
-rw-r--r--sw/source/ui/vba/vbarange.hxx93
-rw-r--r--sw/source/ui/vba/vbarangehelper.cxx174
-rw-r--r--sw/source/ui/vba/vbarangehelper.hxx46
-rw-r--r--sw/source/ui/vba/vbareplacement.cxx74
-rw-r--r--sw/source/ui/vba/vbareplacement.hxx57
-rw-r--r--sw/source/ui/vba/vbasection.cxx90
-rw-r--r--sw/source/ui/vba/vbasection.hxx62
-rw-r--r--sw/source/ui/vba/vbasections.cxx190
-rw-r--r--sw/source/ui/vba/vbasections.hxx62
-rw-r--r--sw/source/ui/vba/vbaselection.cxx682
-rw-r--r--sw/source/ui/vba/vbaselection.hxx108
-rw-r--r--sw/source/ui/vba/vbastyle.cxx152
-rw-r--r--sw/source/ui/vba/vbastyle.hxx70
-rw-r--r--sw/source/ui/vba/vbastyles.cxx380
-rw-r--r--sw/source/ui/vba/vbastyles.hxx54
-rw-r--r--sw/source/ui/vba/vbasystem.cxx195
-rw-r--r--sw/source/ui/vba/vbasystem.hxx75
-rw-r--r--sw/source/ui/vba/vbatable.cxx97
-rw-r--r--sw/source/ui/vba/vbatable.hxx28
-rw-r--r--sw/source/ui/vba/vbatables.cxx131
-rw-r--r--sw/source/ui/vba/vbatables.hxx28
-rw-r--r--sw/source/ui/vba/vbatemplate.cxx106
-rw-r--r--sw/source/ui/vba/vbatemplate.hxx55
-rw-r--r--sw/source/ui/vba/vbavariable.cxx108
-rw-r--r--sw/source/ui/vba/vbavariable.hxx62
-rw-r--r--sw/source/ui/vba/vbavariables.cxx105
-rw-r--r--sw/source/ui/vba/vbavariables.hxx64
-rw-r--r--sw/source/ui/vba/vbaview.cxx425
-rw-r--r--sw/source/ui/vba/vbaview.hxx71
-rw-r--r--sw/source/ui/vba/vbawindow.cxx116
-rw-r--r--sw/source/ui/vba/vbawindow.hxx61
-rw-r--r--sw/source/ui/vba/vbawrapformat.cxx260
-rw-r--r--sw/source/ui/vba/vbawrapformat.hxx73
-rw-r--r--sw/source/ui/vba/wordvbahelper.cxx95
-rw-r--r--sw/source/ui/vba/wordvbahelper.hxx57
-rw-r--r--sw/source/ui/wrtsh/select.cxx5
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx4
-rw-r--r--sw/source/ui/wrtsh/wrtsh2.cxx8
-rw-r--r--sw/source/ui/wrtsh/wrtundo.cxx2
-rw-r--r--sw/util/makefile.mk44
-rwxr-xr-x[-rw-r--r--]sw/util/msword.map3
-rw-r--r--sw/util/vbaswobj.map9
773 files changed, 19161 insertions, 5942 deletions
diff --git a/starmath/inc/action.hxx b/starmath/inc/action.hxx
index 6e2375331de9..6a816a447d8c 100644
--- a/starmath/inc/action.hxx
+++ b/starmath/inc/action.hxx
@@ -30,7 +30,7 @@
#ifndef ACTION_HXX
#define ACTION_HXX
-#include <svtools/undo.hxx>
+#include <svl/undo.hxx>
#include "format.hxx"
class SmDocShell;
diff --git a/starmath/inc/config.hxx b/starmath/inc/config.hxx
index 6528c81b45ac..ecf30b244f80 100644
--- a/starmath/inc/config.hxx
+++ b/starmath/inc/config.hxx
@@ -30,8 +30,8 @@
#ifndef CONFIG_HXX
#define CONFIG_HXX
-#include <svtools/brdcst.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
#include "format.hxx"
#include "cfgitem.hxx"
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index fac4f1b0faa4..94bffbaad48d 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -35,7 +35,7 @@
#include <sot/storage.hxx>
#include <sot/sotref.hxx>
#include <sfx2/objsh.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <sfx2/docfac.hxx>
#include <vcl/virdev.hxx>
#include "format.hxx"
diff --git a/starmath/inc/format.hxx b/starmath/inc/format.hxx
index 05375f8a73e0..6b9b5ad650b5 100644
--- a/starmath/inc/format.hxx
+++ b/starmath/inc/format.hxx
@@ -31,8 +31,8 @@
#define FORMAT_HXX
-#include <svtools/smplhint.hxx>
-#include <svtools/brdcst.hxx>
+#include <svl/smplhint.hxx>
+#include <svl/brdcst.hxx>
#include "utility.hxx"
#include <types.hxx>
diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx
index 4b493c0cbca7..722efd82595c 100644
--- a/starmath/inc/smmod.hxx
+++ b/starmath/inc/smmod.hxx
@@ -34,7 +34,7 @@
#ifndef _SV_RESARY_HXX
#include <tools/resary.hxx>
#endif
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <svtools/colorcfg.hxx>
#include <tools/shl.hxx>
@@ -44,6 +44,8 @@
#include "starmath.hrc"
#endif
+#include <unotools/options.hxx>
+
class SvxErrorHandler;
class SfxObjectFactory;
class SmConfig;
@@ -124,7 +126,7 @@ public:
/////////////////////////////////////////////////////////////////
-class SmModule : public SfxModule, public SfxListener
+class SmModule : public SfxModule, utl::ConfigurationListener
{
svtools::ColorConfig *pColorConfig;
SmConfig *pConfig;
@@ -145,8 +147,7 @@ public:
SmModule(SfxObjectFactory* pObjFact);
virtual ~SmModule();
- // SfxListener
- virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+ virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
svtools::ColorConfig & GetColorConfig();
diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc
index 6d117bcc9524..0f93e6551cc9 100644
--- a/starmath/inc/starmath.hrc
+++ b/starmath/inc/starmath.hrc
@@ -31,7 +31,7 @@
#define _STARMATH_HRC
#ifndef _SVX_SVXIDS_HRC
-#include <svtools/solar.hrc>
+#include <svl/solar.hrc>
#endif
#ifndef _SFXSIDS_HRC //autogen
#include <sfx2/sfxsids.hrc>
diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx
index d39376c30ed0..9d0707a19690 100644
--- a/starmath/inc/symbol.hxx
+++ b/starmath/inc/symbol.hxx
@@ -37,8 +37,8 @@
#include <tools/list.hxx>
#include <tools/debug.hxx>
#include <tools/dynary.hxx>
-#include <svtools/lstner.hxx>
-#include <svtools/svarray.hxx>
+#include <svl/lstner.hxx>
+#include <svl/svarray.hxx>
#include "utility.hxx"
#include <smmod.hxx>
diff --git a/starmath/inc/types.hxx b/starmath/inc/types.hxx
index 3cf63b076391..be3db98dbd94 100644
--- a/starmath/inc/types.hxx
+++ b/starmath/inc/types.hxx
@@ -31,9 +31,9 @@
#define TYPES_HXX
#include <sal/types.h>
+#include <tools/debug.hxx>
-#define FONTNAME_MATH "StarSymbol"
-#define FONTNAME_MATH2 "OpenSymbol"
+#define FONTNAME_MATH "OpenSymbol"
/////////////////////////////////////////////////////////////////
@@ -54,19 +54,8 @@ inline sal_Bool IsInPrivateUseArea( sal_Unicode cChar ) { return 0xE000 <= cChar
inline sal_Bool IsGreekChar( sal_Unicode cChar ) { return 0x0370 <= cChar && cChar <= 0x03FF; }
sal_Unicode ConvertMathPrivateUseAreaToUnicode( sal_Unicode cChar );
-#ifdef TL_NOT_YET_USED
-sal_Unicode ConvertUnicodeToMathPrivateUseArea( sal_Unicode cChar );
-
-sal_Unicode ConvertMathToMathType( sal_Unicode cChar );
-sal_Unicode ConvertMathTypeToMath( sal_Unicode cChar );
-#endif //TL_NOT_YET_USED
sal_Unicode ConvertMathToMathML( sal_Unicode cChar );
-#ifdef TL_NOT_YET_USED
-sal_Unicode ConvertMathMLToMath( sal_Unicode cChar );
-
-sal_Unicode GetTokenChar( sal_Unicode cChar, sal_Bool bConvertForExport );
-#endif //TL_NOT_YET_USED
/////////////////////////////////////////////////////////////////
// enum definitions for characters from the 'StarSymbol' font
@@ -84,14 +73,14 @@ enum MathSymbol
MS_DRARROW = (sal_Unicode) 0x21D2,
MS_DLARROW = (sal_Unicode) 0x21D0,
MS_DLRARROW = (sal_Unicode) 0x21D4,
- MS_UNDERBRACE = (sal_Unicode) 0xE081,
- MS_OVERBRACE = (sal_Unicode) 0xE082,
- MS_CIRC = (sal_Unicode) 0x00B0,
+ MS_OVERBRACE = (sal_Unicode) 0x23DE,
+ MS_UNDERBRACE = (sal_Unicode) 0x23DF,
+ MS_CIRC = (sal_Unicode) 0x2218,
MS_ASSIGN = (sal_Unicode) 0x003D,
MS_ERROR = (sal_Unicode) 0x00BF,
MS_NEQ = (sal_Unicode) 0x2260,
- MS_PLUS = (sal_Unicode) 0xE083,
+ MS_PLUS = (sal_Unicode) 0x002B,
MS_MINUS = (sal_Unicode) 0x2212,
MS_MULTIPLY = (sal_Unicode) 0x2217,
MS_TIMES = (sal_Unicode) 0x00D7,
@@ -107,23 +96,23 @@ enum MathSymbol
MS_UNION = (sal_Unicode) 0x222A,
MS_INTERSECT = (sal_Unicode) 0x2229,
- MS_LT = (sal_Unicode) 0xE084,
- MS_GT = (sal_Unicode) 0xE085,
+ MS_LT = (sal_Unicode) 0x003C,
+ MS_GT = (sal_Unicode) 0x003E,
MS_LE = (sal_Unicode) 0x2264,
MS_GE = (sal_Unicode) 0x2265,
- MS_LESLANT = (sal_Unicode) 0xE086,
- MS_GESLANT = (sal_Unicode) 0xE087,
+ MS_LESLANT = (sal_Unicode) 0x2A7D,
+ MS_GESLANT = (sal_Unicode) 0x2A7E,
MS_LL = (sal_Unicode) 0x226A,
MS_GG = (sal_Unicode) 0x226B,
- MS_SIM = (sal_Unicode) 0x007E,
+ MS_SIM = (sal_Unicode) 0x223C,
MS_SIMEQ = (sal_Unicode) 0x2243,
MS_APPROX = (sal_Unicode) 0x2248,
MS_DEF = (sal_Unicode) 0x225D,
MS_EQUIV = (sal_Unicode) 0x2261,
MS_PROP = (sal_Unicode) 0x221D,
MS_PARTIAL = (sal_Unicode) 0x2202,
- MS_SUBSET = (sal_Unicode) 0x2282,
+ MS_SUBSET = (sal_Unicode) 0x2282,
MS_SUPSET = (sal_Unicode) 0x2283,
MS_SUBSETEQ = (sal_Unicode) 0x2286,
MS_SUPSETEQ = (sal_Unicode) 0x2287,
@@ -143,70 +132,69 @@ enum MathSymbol
MS_LINE = (sal_Unicode) 0x2223,
MS_DLINE = (sal_Unicode) 0x2225,
MS_ORTHO = (sal_Unicode) 0x22A5,
- MS_DOTSLOW = (sal_Unicode) 0xE08B,
+ MS_DOTSLOW = (sal_Unicode) 0x2026,
MS_DOTSAXIS = (sal_Unicode) 0x22EF,
MS_DOTSVERT = (sal_Unicode) 0x22EE,
MS_DOTSUP = (sal_Unicode) 0x22F0,
MS_DOTSDOWN = (sal_Unicode) 0x22F1,
MS_TRANSR = (sal_Unicode) 0x22B6,
MS_TRANSL = (sal_Unicode) 0x22B7,
- MS_RIGHTARROW = (sal_Unicode) 0xE08C,
MS_BACKSLASH = (sal_Unicode) 0x2216,
MS_NEG = (sal_Unicode) 0x00AC,
+ MS_FORALL = (sal_Unicode) 0x2200,
+ MS_NABLA = (sal_Unicode) 0x2207,
+ MS_PROD = (sal_Unicode) 0x220F,
+ MS_COPROD = (sal_Unicode) 0x2210,
+ MS_SUM = (sal_Unicode) 0x2211,
+ MS_SQRT = (sal_Unicode) 0x221A,
MS_INT = (sal_Unicode) 0x222B,
MS_IINT = (sal_Unicode) 0x222C,
MS_IIINT = (sal_Unicode) 0x222D,
MS_LINT = (sal_Unicode) 0x222E,
MS_LLINT = (sal_Unicode) 0x222F,
MS_LLLINT = (sal_Unicode) 0x2230,
- MS_SQRT = (sal_Unicode) 0xE08D,
- MS_COPROD = (sal_Unicode) 0x2210,
- MS_PROD = (sal_Unicode) 0x220F,
- MS_SUM = (sal_Unicode) 0x2211,
- MS_NABLA = (sal_Unicode) 0x2207,
- MS_FORALL = (sal_Unicode) 0x2200,
- MS_HAT = (sal_Unicode) 0xE091,
- MS_CHECK = (sal_Unicode) 0xE092,
- MS_BREVE = (sal_Unicode) 0xE093,
- MS_ACUTE = (sal_Unicode) 0xE094,
- MS_GRAVE = (sal_Unicode) 0xE095,
- MS_TILDE = (sal_Unicode) 0xE096,
- MS_BAR = (sal_Unicode) 0xE097,
- MS_VEC = (sal_Unicode) 0xE098,
+ MS_GRAVE = (sal_Unicode) 0x0300,
+ MS_ACUTE = (sal_Unicode) 0x0301,
+ MS_HAT = (sal_Unicode) 0x0302,
+ MS_TILDE = (sal_Unicode) 0x0303,
+ MS_BAR = (sal_Unicode) 0x0304,
+ MS_BREVE = (sal_Unicode) 0x0306,
+ MS_CIRCLE = (sal_Unicode) 0x030A,
+ MS_CHECK = (sal_Unicode) 0x030C,
+ MS_VEC = (sal_Unicode) 0x20D7,
MS_DOT = (sal_Unicode) 0x02D9,
MS_DDOT = (sal_Unicode) 0x00A8,
- MS_DDDOT = (sal_Unicode) 0xE09B,
- MS_CIRCLE = (sal_Unicode) 0x02DA,
+ MS_DDDOT = (sal_Unicode) 0x20DB,
MS_AND = (sal_Unicode) 0x2227,
MS_OR = (sal_Unicode) 0x2228,
MS_NI = (sal_Unicode) 0x220B,
MS_EMPTYSET = (sal_Unicode) 0x2205,
- MS_LBRACE = (sal_Unicode) 0x007B,
- MS_RBRACE = (sal_Unicode) 0x007D,
- MS_LPARENT = (sal_Unicode) 0xE09E,
- MS_RPARENT = (sal_Unicode) 0xE09F,
- MS_LANGLE = (sal_Unicode) 0x2329,
- MS_RANGLE = (sal_Unicode) 0x232A,
+ MS_LPARENT = (sal_Unicode) 0x0028,
+ MS_RPARENT = (sal_Unicode) 0x0029,
MS_LBRACKET = (sal_Unicode) 0x005B,
MS_RBRACKET = (sal_Unicode) 0x005D,
-
- MS_LDBRACKET = (sal_Unicode) 0x301A,
- MS_RDBRACKET = (sal_Unicode) 0x301B,
- MS_PLACE = (sal_Unicode) 0xE0AA,
-
+ MS_LBRACE = (sal_Unicode) 0x007B,
+ MS_RBRACE = (sal_Unicode) 0x007D,
MS_LCEIL = (sal_Unicode) 0x2308,
- MS_LFLOOR = (sal_Unicode) 0x230A,
MS_RCEIL = (sal_Unicode) 0x2309,
+ MS_LFLOOR = (sal_Unicode) 0x230A,
MS_RFLOOR = (sal_Unicode) 0x230B,
+ MS_LANGLE = (sal_Unicode) 0x2329,
+ MS_RANGLE = (sal_Unicode) 0x232A,
+ MS_LDBRACKET = (sal_Unicode) 0x27E6,
+ MS_RDBRACKET = (sal_Unicode) 0x27E7,
+
+ MS_PLACE = (sal_Unicode) 0x2751,
- MS_HBAR = (sal_Unicode) 0x210F,
MS_LAMBDABAR = (sal_Unicode) 0x019B,
- MS_LEFTARROW = (sal_Unicode) 0xE0DB,
- MS_UPARROW = (sal_Unicode) 0xE0DC,
- MS_DOWNARROW = (sal_Unicode) 0xE0DD,
+ MS_HBAR = (sal_Unicode) 0x210F,
+ MS_LEFTARROW = (sal_Unicode) 0x2190,
+ MS_UPARROW = (sal_Unicode) 0x2191,
+ MS_RIGHTARROW = (sal_Unicode) 0x2192,
+ MS_DOWNARROW = (sal_Unicode) 0x2193,
MS_SETN = (sal_Unicode) 0x2115,
MS_SETZ = (sal_Unicode) 0x2124,
MS_SETQ = (sal_Unicode) 0x211A,
diff --git a/starmath/sdi/makefile.mk b/starmath/sdi/makefile.mk
index 768280af9747..f868756f5990 100644
--- a/starmath/sdi/makefile.mk
+++ b/starmath/sdi/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -46,8 +46,12 @@ SVSDIINC=$(PRJ)$/inc
SDI1NAME=$(TARGET)
SVSDI1DEPEND= \
- $(SOLARINCDIR)$/svxslots.ilb \
- smath.sdi \
+ $(SOLARINCXDIR)$/sfx2/sfx.sdi \
+ $(SOLARINCXDIR)$/sfx2/sfxitems.sdi \
+ $(SOLARINCXDIR)$/svx/svx.sdi \
+ $(SOLARINCXDIR)$/svx/svxitems.sdi \
+ $(SOLARINCXDIR)$/svx/xoitems.sdi \
+ smath.sdi \
smslots.sdi \
$(SVSDIINC)$/starmath.hrc
diff --git a/starmath/sdi/svxitems.sdi b/starmath/sdi/smitems.sdi
index ddbf0f2fc185..ddbf0f2fc185 100644
--- a/starmath/sdi/svxitems.sdi
+++ b/starmath/sdi/smitems.sdi
diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi
index 40b9da78d7ff..88bd108bddff 100644
--- a/starmath/sdi/smslots.sdi
+++ b/starmath/sdi/smslots.sdi
@@ -28,8 +28,6 @@
*
************************************************************************/
-import "svxslots.ilb"
-
module
"312C4240-35E7-101C-B12A-04021C007002"
"58216740-35E7-101C-B12A-04021C007002"
@@ -39,9 +37,13 @@ StarMath
SlotIdFile ( "starmath.hrc" )
SlotIdFile ( "sfx2/sfxsids.hrc" )
SlotIdFile ( "svx/svxids.hrc" )
- TypeLibFile ( "smslots.tlb" )
]
{
+ include "sfx2/sfxitems.sdi"
+ include "sfx2/sfx.sdi"
+ include "svx/svxitems.sdi"
+ include "svx/xoitems.sdi"
+ include "svx/svx.sdi"
include "smath.sdi"
interface StarMath
[
@@ -59,7 +61,7 @@ shell SmModule
import StarMath[Automation];
}
-interface FormulaDocument : OfficeDocument
+interface FormulaDocument
[
uuid ( "815CBB20-2FC3-11CF-89CA-008029E4B0B1" )
]
@@ -149,13 +151,13 @@ interface FormulaDocument : OfficeDocument
]
}
-shell SmDocShell : SfxObjectShell
+shell SmDocShell
{
import FormulaDocument[Automation];
}
-interface FormulaView : View
+interface FormulaView
[
uuid ( "CE1A6C00-2FC3-11CF-89CA-008029E4B0B1" )
]
@@ -323,7 +325,7 @@ interface FormulaView : View
]
}
-shell SmViewShell : SfxViewShell
+shell SmViewShell
{
import FormulaView[Automation];
}
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index f258d7f31176..823e5bbd926e 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -51,7 +51,7 @@
#include <vcl/unohelp2.hxx>
#include <tools/gen.hxx>
#include <vos/mutex.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/editobj.hxx>
#include <svx/editdata.hxx>
diff --git a/starmath/source/accessibility.hxx b/starmath/source/accessibility.hxx
index 7199583dd4ff..07217bee9f1a 100644
--- a/starmath/source/accessibility.hxx
+++ b/starmath/source/accessibility.hxx
@@ -52,7 +52,7 @@
#include <cppuhelper/interfacecontainer.h>
#include <cppuhelper/implbase5.hxx>
#include <cppuhelper/implbase6.hxx>
-#include <svtools/brdcst.hxx>
+#include <svl/brdcst.hxx>
#include <svx/editeng.hxx>
#include <svx/unoedsrc.hxx> // SvxEditSource, SvxTextForwarder, SvxViewForwarder, SvxEditViewForwarder
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 175c41c173eb..e9a816fc76a4 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -1279,6 +1279,8 @@ void SmMathConfig::SetShowFormulaCursor( BOOL bVal )
SetOtherIfNotEqual( pOther->bFormulaCursor, bVal );
}
+void SmMathConfig::Notify( const com::sun::star::uno::Sequence< rtl::OUString >& )
+{}
/////////////////////////////////////////////////////////////////
diff --git a/starmath/source/cfgitem.hxx b/starmath/source/cfgitem.hxx
index 4c028039ea5e..a56a503d7bfd 100644
--- a/starmath/source/cfgitem.hxx
+++ b/starmath/source/cfgitem.hxx
@@ -44,7 +44,7 @@
#include <tools/solar.h>
#include <rtl/ustring.hxx>
#include <unotools/configitem.hxx>
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <vcl/timer.hxx>
#include <symbol.hxx>
@@ -174,7 +174,7 @@ public:
virtual ~SmMathConfig();
// utl::ConfigItem
- //virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString > &rPropertyNames );
+ virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString > &rPropertyNames );
virtual void Commit();
// make some protected functions of utl::ConfigItem public
diff --git a/starmath/source/config.cxx b/starmath/source/config.cxx
index b778571a5c0f..284a7898499d 100644
--- a/starmath/source/config.cxx
+++ b/starmath/source/config.cxx
@@ -32,15 +32,15 @@
#include "precompiled_starmath.hxx"
-#include <svtools/itemset.hxx>
-#include <svtools/hint.hxx>
-#include <svtools/smplhint.hxx>
-#include <svtools/pathoptions.hxx>
+#include <svl/itemset.hxx>
+#include <svl/hint.hxx>
+#include <svl/smplhint.hxx>
+#include <unotools/pathoptions.hxx>
#include <sfx2/sfxsids.hrc>
-#include <svtools/eitem.hxx>
-#include <svtools/itempool.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/intitem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/itempool.hxx>
+#include <svl/stritem.hxx>
+#include <svl/intitem.hxx>
#include <tools/stream.hxx>
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 20af2f38b3ee..95b2e0c36aad 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -34,9 +34,9 @@
#define SMDLL 1
#include "tools/rcid.h"
-#include <svtools/eitem.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/stritem.hxx>
#include <sfx2/app.hxx>
#include <vcl/msgbox.hxx>
#include <svtools/ctrltool.hxx>
@@ -396,9 +396,9 @@ void SmFontDialog::InitColor_Impl()
#endif
ColorData nBgCol = COL_WHITE,
nTxtCol = COL_BLACK;
- if (GetDisplayBackground().GetColor().IsDark())
+ const StyleSettings &rS = GetSettings().GetStyleSettings();
+ if (rS.GetHighContrastMode())
{
- const StyleSettings &rS = GetSettings().GetStyleSettings();
nBgCol = rS.GetFieldColor().GetColor();
nTxtCol = rS.GetFieldTextColor().GetColor();
}
@@ -967,7 +967,7 @@ SmDistanceDialog::~SmDistanceDialog()
void SmDistanceDialog::ApplyImages()
{
- BOOL bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0;
+ BOOL bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
for (int i = 0; i < NOCATEGORIES; ++i)
{
SmCategoryDesc *pCat = Categories[i];
@@ -1551,9 +1551,9 @@ void SmSymbolDialog::InitColor_Impl()
#endif
ColorData nBgCol = COL_WHITE,
nTxtCol = COL_BLACK;
- if (GetDisplayBackground().GetColor().IsDark())
+ const StyleSettings &rS = GetSettings().GetStyleSettings();
+ if (rS.GetHighContrastMode())
{
- const StyleSettings &rS = GetSettings().GetStyleSettings();
nBgCol = rS.GetFieldColor().GetColor();
nTxtCol = rS.GetFieldTextColor().GetColor();
}
@@ -2180,7 +2180,7 @@ void SmSymDefineDialog::InitColor_Impl()
#endif
ColorData nBgCol = COL_WHITE,
nTxtCol = COL_BLACK;
- BOOL bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0;
+ BOOL bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
if (bHighContrast)
{
const StyleSettings &rS = GetSettings().GetStyleSettings();
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index ab467fc034e3..b9064a78a5f5 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -55,22 +55,22 @@
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
#include <sot/storage.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/fstathelper.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/itempool.hxx>
-#include <svtools/lingucfg.hxx>
-#include <svtools/linguprops.hxx>
-#include <svtools/pathoptions.hxx>
-#include <svtools/ptitem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/fstathelper.hxx>
+#include <svl/intitem.hxx>
+#include <svl/itempool.hxx>
+#include <unotools/lingucfg.hxx>
+#include <unotools/linguprops.hxx>
+#include <unotools/pathoptions.hxx>
+#include <svl/ptitem.hxx>
#include <svtools/sfxecode.hxx>
-#include <svtools/slstitm.hxx>
-#include <svtools/smplhint.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/slstitm.hxx>
+#include <svl/smplhint.hxx>
+#include <svl/stritem.hxx>
#include <svtools/transfer.hxx>
-#include <svtools/undo.hxx>
-#include <svtools/urihelper.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/undo.hxx>
+#include <svl/urihelper.hxx>
+#include <svl/whiter.hxx>
#include <svx/editeng.hxx>
#include <svx/editstat.hxx>
#include <svx/eeitem.hxx>
@@ -467,7 +467,7 @@ void SmDocShell::Draw(OutputDevice &rDev, Point &rPosition)
ULONG nOldDrawMode = DRAWMODE_DEFAULT;
BOOL bRestoreDrawMode = FALSE;
if (OUTDEV_WINDOW == rDev.GetOutDevType() &&
- ((Window &) rDev).GetDisplayBackground().GetColor().IsDark())
+ ((Window &) rDev).GetSettings().GetStyleSettings().GetHighContrastMode())
{
nOldDrawMode = rDev.GetDrawMode();
rDev.SetDrawMode( DRAWMODE_DEFAULT );
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 8435b7b5f35a..6f69f52539aa 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -52,13 +52,13 @@
#include <svx/editstat.hxx>
#include <svx/eeitem.hxx>
#include <sfx2/dispatch.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/itempool.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/itempool.hxx>
+#include <svl/stritem.hxx>
#include <svx/fhgtitem.hxx>
#include <svx/wghtitem.hxx>
#include <svx/lrspitem.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <svx/fontitem.hxx>
#include <sfx2/viewfrm.hxx>
diff --git a/starmath/source/format.cxx b/starmath/source/format.cxx
index 9ecfd1720b1e..d859f208161a 100644
--- a/starmath/source/format.cxx
+++ b/starmath/source/format.cxx
@@ -49,7 +49,7 @@ static const USHORT aLatinDefFnts[FNT_END] =
DEFAULTFONT_SERIF, // FNT_SERIF
DEFAULTFONT_SANS, // FNT_SANS
DEFAULTFONT_FIXED // FNT_FIXED
- //StarSymbol, // FNT_MATH
+ //OpenSymbol, // FNT_MATH
};
// CJK default-fonts
@@ -65,7 +65,7 @@ static const USHORT aCJKDefFnts[FNT_END] =
DEFAULTFONT_CJK_TEXT, // FNT_SERIF
DEFAULTFONT_CJK_DISPLAY, // FNT_SANS
DEFAULTFONT_CJK_TEXT // FNT_FIXED
- //StarSymbol, // FNT_MATH
+ //OpenSymbol, // FNT_MATH
};
// CTL default-fonts
@@ -78,7 +78,7 @@ static const USHORT aCTLDefFnts[FNT_END] =
DEFAULTFONT_CTL_TEXT, // FNT_SERIF
DEFAULTFONT_CTL_TEXT, // FNT_SANS
DEFAULTFONT_CTL_TEXT // FNT_FIXED
- //StarSymbol, // FNT_MATH
+ //OpenSymbol, // FNT_MATH
};
diff --git a/starmath/source/math_pch.cxx b/starmath/source/math_pch.cxx
index 5ea88307fb2d..6dba5ec80379 100644
--- a/starmath/source/math_pch.cxx
+++ b/starmath/source/math_pch.cxx
@@ -48,11 +48,11 @@
#include <tools/rtti.hxx>
#include <tools/ref.hxx>
#include <tools/link.hxx>
-#include <svtools/brdcst.hxx>
-#include <svtools/svarray.hxx>
+#include <svl/brdcst.hxx>
+#include <svl/svarray.hxx>
#include <tools/debug.hxx>
-#include <svtools/hint.hxx>
-#include <svtools/smplhint.hxx>
+#include <svl/hint.hxx>
+#include <svl/smplhint.hxx>
#include <sot/sotref.hxx>
#include <tools/globname.hxx>
#include <sot/factory.hxx>
@@ -130,9 +130,9 @@
#include <smdll.hxx>
#include <sfx2/sfxsids.hrc>
#include <chaos/cntids.hrc>
-#include <svtools/cntwids.hrc>
-#include <svtools/solar.hrc>
-#include <svtools/lstner.hxx>
+#include <svl/cntwids.hrc>
+#include <svl/solar.hrc>
+#include <svl/lstner.hxx>
#include <starmath.hrc>
#include <basic/sbx.hxx>
#include <basic/sbxform.hxx>
@@ -143,7 +143,7 @@
#include <basic/sbxmeth.hxx>
#include <tools/unqid.hxx>
#include <tools/unqidx.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <svtools/args.hxx>
#include <smmod.hxx>
#include <vos/thread.hxx>
@@ -156,7 +156,7 @@
#include <vcl/timer.hxx>
#include <sfx2/app.hxx>
#include <sfx2/sfx.hrc>
-#include <svtools/memberid.hrc>
+#include <svl/memberid.hrc>
#include <vcl/syswin.hxx>
#include <vcl/virdev.hxx>
#include <tools/datetime.hxx>
@@ -736,7 +736,7 @@
#endif
#include <usr/refl.hxx>
#include <sfx2/msg.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <sfx2/basedlgs.hxx>
#include <vcl/floatwin.hxx>
#include <vcl/dialog.hxx>
@@ -745,10 +745,10 @@
#include <sfx2/frame.hxx>
#include <sfx2/objface.hxx>
#include <vcl/event.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/intitem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/intitem.hxx>
#include <symbol.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <vcl/image.hxx>
#include <vcl/metric.hxx>
#include <sfx2/inimgr.hxx>
@@ -756,14 +756,14 @@
#include <tools/pstm.hxx>
#include <tools/table.hxx>
#include <sfx2/docfac.hxx>
-#include <svtools/ownlist.hxx>
+#include <svl/ownlist.hxx>
#include <sfx2/objsh.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/stritem.hxx>
#include <vcl/mapmod.hxx>
#include <sfx2/ipfrm.hxx>
#include <vcl/dialog.hxx>
#include <sfx2/dispatch.hxx>
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#include <sfx2/bindings.hxx>
#include <dialog.hxx>
#include <vcl/button.hxx>
@@ -822,9 +822,9 @@
#include <vcl/toolbox.hxx>
#include <vcl/dockwin.hxx>
#include <smslots.hxx>
-#include <svtools/undo.hxx>
+#include <svl/undo.hxx>
#include <sfx2/request.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/whiter.hxx>
#include <vcl/prntypes.hxx>
#include <vcl/jobset.hxx>
#include <vcl/gdimtf.hxx>
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index 9ddabab9c325..c9b12abcdb90 100644
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -61,9 +61,9 @@
#include <tools/debug.hxx>
#include <tools/urlobj.hxx>
#include <svtools/sfxecode.hxx>
-#include <svtools/saveopt.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/itemprop.hxx>
+#include <unotools/saveopt.hxx>
+#include <svl/stritem.hxx>
+#include <svl/itemprop.hxx>
#include <unotools/processfactory.hxx>
#include <unotools/streamwrap.hxx>
#include <xmloff/xmlnmspe.hxx>
@@ -403,8 +403,8 @@ SmXMLExport::SmXMLExport(
{
}
-sal_Int64 SAL_CALL SmXMLExport::getSomething(
- const uno::Sequence< sal_Int8 >& rId )
+sal_Int64 SAL_CALL SmXMLExport::getSomething(
+ const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
if ( rId.getLength() == 16 &&
@@ -833,7 +833,7 @@ void SmXMLExport::ExportTable(const SmNode *pNode, int nLevel)
if (nSize >= 1 && pNode->GetSubNode(nSize-1)->GetNumSubNodes() == 0)
--nSize;
- // try to avoid creating a mtable element when the formula consists only
+ // try to avoid creating a mtable element when the formula consists only
// of a single output line
if (nLevel || (nSize >1))
pTable = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MTABLE, sal_True, sal_True);
@@ -902,7 +902,7 @@ void SmXMLExport::ExportText(const SmNode *pNode, int /*nLevel*/)
void SmXMLExport::ExportBlank(const SmNode * /*pNode*/, int /*nLevel*/)
{
- //!! exports an empty <mi> tag since for example "~_~" is allowed in
+ //!! exports an empty <mi> tag since for example "~_~" is allowed in
//!! Math (so it has no sense at all) but must not result in an empty
//!! <msub> tag in MathML !!
@@ -910,7 +910,7 @@ void SmXMLExport::ExportBlank(const SmNode * /*pNode*/, int /*nLevel*/)
//const SmBlankNode *pTemp = static_cast<const SmBlankNode *>(pNode);
pText = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MI, sal_True, sal_False);
-
+
GetDocHandler()->characters( OUString() );
delete pText;
}
@@ -1203,10 +1203,10 @@ void SmXMLExport::ExportAttributes(const SmNode *pNode, int nLevel)
static bool lcl_HasEffectOnMathvariant( const SmTokenType eType )
{
- return eType == TBOLD || eType == TNBOLD ||
+ return eType == TBOLD || eType == TNBOLD ||
eType == TITALIC || eType == TNBOLD ||
eType == TSANS || eType == TSERIF || eType == TFIXED;
-}
+}
void SmXMLExport::ExportFont(const SmNode *pNode, int nLevel)
{
@@ -1480,7 +1480,7 @@ void SmXMLExport::ExportNodes(const SmNode *pNode, int nLevel)
// thus at least it will not vanish into nothing
ExportText(pNode, nLevel);
}
- else
+ else
{
//To fully handle generic MathML we need to implement the full
//operator dictionary, we will generate MathML with explicit
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 1f7336db6d3c..56b35a96c6ff 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -1,3189 +1,3190 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: x $
- * $Revision: 1.00 $
- *
- * 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_starmath.hxx"
-
-/*todo: Change characters and tcharacters to accumulate the characters together
-into one string, xml parser hands them to us line by line rather than all in
-one go*/
-
-#include <com/sun/star/xml/sax/XErrorHandler.hpp>
-#include <com/sun/star/xml/sax/XEntityResolver.hpp>
-#include <com/sun/star/xml/sax/InputSource.hpp>
-#include <com/sun/star/xml/sax/XDTDHandler.hpp>
-#include <com/sun/star/xml/sax/XParser.hpp>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/io/XActiveDataControl.hpp>
-#include <com/sun/star/document/XDocumentProperties.hpp>
-#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-#include <com/sun/star/packages/zip/ZipIOException.hpp>
-#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
-#include <com/sun/star/uno/Any.h>
-
-#include <rtl/math.hxx>
-#include <sfx2/frame.hxx>
-#include <sfx2/docfile.hxx>
-#include <tools/debug.hxx>
-#include <tools/urlobj.hxx>
-#include <svtools/sfxecode.hxx>
-#include <svtools/saveopt.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/itemprop.hxx>
-#include <unotools/processfactory.hxx>
-#include <unotools/streamwrap.hxx>
-#include <xmloff/xmlnmspe.hxx>
-#include <xmloff/xmltoken.hxx>
-#include <xmloff/nmspmap.hxx>
-#include <xmloff/attrlist.hxx>
-#include <xmloff/xmluconv.hxx>
-#include <xmloff/xmlmetai.hxx>
-#include <osl/mutex.hxx>
-#include <comphelper/genericpropertyset.hxx>
-
-#include <memory>
-
-#include "mathmlimport.hxx"
-#include "mathtype.hxx"
-#include <starmath.hrc>
-#include <unomodel.hxx>
-#include <document.hxx>
-#include <utility.hxx>
-
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star;
-using namespace ::xmloff::token;
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-
-#define IMPORT_SVC_NAME RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.XMLImportFilter")
-
-#undef WANTEXCEPT
-
-////////////////////////////////////////////////////////////
-
-ULONG SmXMLImportWrapper::Import(SfxMedium &rMedium)
-{
- ULONG nError = ERRCODE_SFX_DOLOADFAILED;
-
- uno::Reference<lang::XMultiServiceFactory> xServiceFactory(
- utl::getProcessServiceFactory());
- DBG_ASSERT(xServiceFactory.is(), "XMLReader::Read: got no service manager");
- if ( !xServiceFactory.is() )
- return nError;
-
- //Make a model component from our SmModel
- uno::Reference< lang::XComponent > xModelComp( xModel, uno::UNO_QUERY );
- DBG_ASSERT( xModelComp.is(), "XMLReader::Read: got no model" );
-
- // try to get an XStatusIndicator from the Medium
- uno::Reference<task::XStatusIndicator> xStatusIndicator;
-
- sal_Bool bEmbedded = sal_False;
- uno::Reference <lang::XUnoTunnel> xTunnel;
- xTunnel = uno::Reference <lang::XUnoTunnel> (xModel,uno::UNO_QUERY);
- SmModel *pModel = reinterpret_cast<SmModel *>
- (xTunnel->getSomething(SmModel::getUnoTunnelId()));
-
- SmDocShell *pDocShell = pModel ?
- static_cast<SmDocShell*>(pModel->GetObjectShell()) : 0;
- if (pDocShell)
- {
-// if (pDocShell->GetMedium())
- {
- DBG_ASSERT( pDocShell->GetMedium() == &rMedium,
- "different SfxMedium found" );
-
- SfxItemSet* pSet = rMedium.GetItemSet();
- if (pSet)
- {
- const SfxUnoAnyItem* pItem = static_cast<const SfxUnoAnyItem*>(
- pSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) );
- if (pItem)
- pItem->GetValue() >>= xStatusIndicator;
- }
- }
-
- if ( SFX_CREATE_MODE_EMBEDDED == pDocShell->GetCreateMode() )
- bEmbedded = sal_True;
- }
-
- comphelper::PropertyMapEntry aInfoMap[] =
- {
- { "PrivateData", sizeof("PrivateData")-1, 0,
- &::getCppuType( (Reference<XInterface> *)0 ),
- beans::PropertyAttribute::MAYBEVOID, 0 },
- { "BaseURI", sizeof("BaseURI")-1, 0,
- &::getCppuType( (OUString *)0 ),
- beans::PropertyAttribute::MAYBEVOID, 0 },
- { "StreamRelPath", sizeof("StreamRelPath")-1, 0,
- &::getCppuType( (OUString *)0 ),
- beans::PropertyAttribute::MAYBEVOID, 0 },
- { "StreamName", sizeof("StreamName")-1, 0,
- &::getCppuType( (OUString *)0 ),
- beans::PropertyAttribute::MAYBEVOID, 0 },
- { NULL, 0, 0, NULL, 0, 0 }
- };
- uno::Reference< beans::XPropertySet > xInfoSet(
- comphelper::GenericPropertySet_CreateInstance(
- new comphelper::PropertySetInfo( aInfoMap ) ) );
-
- // Set base URI
- OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BaseURI") );
- xInfoSet->setPropertyValue( sPropName, makeAny( rMedium.GetBaseURL() ) );
-
- sal_Int32 nSteps=3;
- if ( !(rMedium.IsStorage()))
- nSteps = 1;
-
- sal_Int32 nProgressRange(nSteps);
- if (xStatusIndicator.is())
- {
- xStatusIndicator->start(String(SmResId(STR_STATSTR_READING)),
- nProgressRange);
- }
-
- nSteps=0;
- if (xStatusIndicator.is())
- xStatusIndicator->setValue(nSteps++);
-
- if ( rMedium.IsStorage())
- {
- // TODO/LATER: handle the case of embedded links gracefully
- if ( bEmbedded ) // && !rMedium.GetStorage()->IsRoot() )
- {
- OUString aName( RTL_CONSTASCII_USTRINGPARAM( "dummyObjName" ) );
- if ( rMedium.GetItemSet() )
- {
- const SfxStringItem* pDocHierarchItem = static_cast<const SfxStringItem*>(
- rMedium.GetItemSet()->GetItem(SID_DOC_HIERARCHICALNAME) );
- if ( pDocHierarchItem )
- aName = pDocHierarchItem->GetValue();
- }
-
- if ( aName.getLength() )
- {
- sPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath"));
- xInfoSet->setPropertyValue( sPropName, makeAny( aName ) );
- }
- }
-
- sal_Bool bOASIS = ( SotStorage::GetVersion( rMedium.GetStorage() ) > SOFFICE_FILEFORMAT_60 );
- if (xStatusIndicator.is())
- xStatusIndicator->setValue(nSteps++);
-
- ULONG nWarn = ReadThroughComponent(
- rMedium.GetStorage(), xModelComp, "meta.xml", "Meta.xml",
- xServiceFactory, xInfoSet,
- (bOASIS ? "com.sun.star.comp.Math.XMLOasisMetaImporter"
- : "com.sun.star.comp.Math.XMLMetaImporter") );
-
- if ( nWarn != ERRCODE_IO_BROKENPACKAGE )
- {
- if (xStatusIndicator.is())
- xStatusIndicator->setValue(nSteps++);
-
- nWarn = ReadThroughComponent(
- rMedium.GetStorage(), xModelComp, "settings.xml", 0,
- xServiceFactory, xInfoSet,
- (bOASIS ? "com.sun.star.comp.Math.XMLOasisSettingsImporter"
- : "com.sun.star.comp.Math.XMLSettingsImporter" ) );
-
- if ( nWarn != ERRCODE_IO_BROKENPACKAGE )
- {
- if (xStatusIndicator.is())
- xStatusIndicator->setValue(nSteps++);
-
- nError = ReadThroughComponent(
- rMedium.GetStorage(), xModelComp, "content.xml", "Content.xml",
- xServiceFactory, xInfoSet, "com.sun.star.comp.Math.XMLImporter" );
- }
- else
- nError = ERRCODE_IO_BROKENPACKAGE;
- }
- else
- nError = ERRCODE_IO_BROKENPACKAGE;
- }
- else
- {
- Reference<io::XInputStream> xInputStream =
- new utl::OInputStreamWrapper(rMedium.GetInStream());
-
- if (xStatusIndicator.is())
- xStatusIndicator->setValue(nSteps++);
-
- nError = ReadThroughComponent( xInputStream, xModelComp,
- xServiceFactory, xInfoSet, "com.sun.star.comp.Math.XMLImporter", FALSE );
- }
-
- if (xStatusIndicator.is())
- xStatusIndicator->end();
- return nError;
-}
-
-
-/// read a component (file + filter version)
-ULONG SmXMLImportWrapper::ReadThroughComponent(
- Reference<io::XInputStream> xInputStream,
- Reference<XComponent> xModelComponent,
- Reference<lang::XMultiServiceFactory> & rFactory,
- Reference<beans::XPropertySet> & rPropSet,
- const sal_Char* pFilterName,
- sal_Bool bEncrypted )
-{
- ULONG nError = ERRCODE_SFX_DOLOADFAILED;
- DBG_ASSERT(xInputStream.is(), "input stream missing");
- DBG_ASSERT(xModelComponent.is(), "document missing");
- DBG_ASSERT(rFactory.is(), "factory missing");
- DBG_ASSERT(NULL != pFilterName,"I need a service name for the component!");
-
- // prepare ParserInputSrouce
- xml::sax::InputSource aParserInput;
- aParserInput.aInputStream = xInputStream;
-
- // get parser
- Reference< xml::sax::XParser > xParser(
- rFactory->createInstance(
- OUString::createFromAscii("com.sun.star.xml.sax.Parser") ),
- UNO_QUERY );
- DBG_ASSERT( xParser.is(), "Can't create parser" );
- if ( !xParser.is() )
- return nError;
-
- Sequence<Any> aArgs( 1 );
- aArgs[0] <<= rPropSet;
-
- // get filter
- Reference< xml::sax::XDocumentHandler > xFilter(
- rFactory->createInstanceWithArguments(
- OUString::createFromAscii(pFilterName), aArgs ),
- UNO_QUERY );
- DBG_ASSERT( xFilter.is(), "Can't instantiate filter component." );
- if ( !xFilter.is() )
- return nError;
-
- // connect parser and filter
- xParser->setDocumentHandler( xFilter );
-
- // connect model and filter
- Reference < XImporter > xImporter( xFilter, UNO_QUERY );
- xImporter->setTargetDocument( xModelComponent );
-
- // finally, parser the stream
- try
- {
- xParser->parseStream( aParserInput );
-
- uno::Reference<lang::XUnoTunnel> xFilterTunnel;
- xFilterTunnel = uno::Reference<lang::XUnoTunnel>
- ( xFilter, uno::UNO_QUERY );
- SmXMLImport *pFilter = reinterpret_cast< SmXMLImport * >(
- sal::static_int_cast< sal_uIntPtr >(
- xFilterTunnel->getSomething( SmXMLImport::getUnoTunnelId() )));
- if ( pFilter && pFilter->GetSuccess() )
- nError = 0;
- }
- catch( xml::sax::SAXParseException& r )
- {
- // sax parser sends wrapped exceptions,
- // try to find the original one
- xml::sax::SAXException aSaxEx = *(xml::sax::SAXException*)(&r);
- sal_Bool bTryChild = sal_True;
-
- while( bTryChild )
- {
- xml::sax::SAXException aTmp;
- if ( aSaxEx.WrappedException >>= aTmp )
- aSaxEx = aTmp;
- else
- bTryChild = sal_False;
- }
-
- packages::zip::ZipIOException aBrokenPackage;
- if ( aSaxEx.WrappedException >>= aBrokenPackage )
- return ERRCODE_IO_BROKENPACKAGE;
-
- if ( bEncrypted )
- nError = ERRCODE_SFX_WRONGPASSWORD;
- }
- catch( xml::sax::SAXException& r )
- {
- packages::zip::ZipIOException aBrokenPackage;
- if ( r.WrappedException >>= aBrokenPackage )
- return ERRCODE_IO_BROKENPACKAGE;
-
- if ( bEncrypted )
- nError = ERRCODE_SFX_WRONGPASSWORD;
- }
- catch( packages::zip::ZipIOException& )
- {
- nError = ERRCODE_IO_BROKENPACKAGE;
- }
- catch( io::IOException& )
- {
- }
-
- return nError;
-}
-
-
-ULONG SmXMLImportWrapper::ReadThroughComponent(
- const uno::Reference< embed::XStorage >& xStorage,
- Reference<XComponent> xModelComponent,
- const sal_Char* pStreamName,
- const sal_Char* pCompatibilityStreamName,
- Reference<lang::XMultiServiceFactory> & rFactory,
- Reference<beans::XPropertySet> & rPropSet,
- const sal_Char* pFilterName )
-{
- DBG_ASSERT(xStorage.is(), "Need storage!");
- DBG_ASSERT(NULL != pStreamName, "Please, please, give me a name!");
-
- // open stream (and set parser input)
- OUString sStreamName = OUString::createFromAscii(pStreamName);
- uno::Reference < container::XNameAccess > xAccess( xStorage, uno::UNO_QUERY );
- if ( !xAccess->hasByName(sStreamName) || !xStorage->isStreamElement(sStreamName) )
- {
- // stream name not found! Then try the compatibility name.
- // do we even have an alternative name?
- if ( pCompatibilityStreamName )
- sStreamName = OUString::createFromAscii(pCompatibilityStreamName);
- }
-
- // get input stream
- try
- {
- uno::Reference < io::XStream > xEventsStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ );
-
- // determine if stream is encrypted or not
- uno::Reference < beans::XPropertySet > xProps( xEventsStream, uno::UNO_QUERY );
- Any aAny = xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Encrypted") ) );
- sal_Bool bEncrypted = sal_False;
- if ( aAny.getValueType() == ::getBooleanCppuType() )
- aAny >>= bEncrypted;
-
- // set Base URL
- if ( rPropSet.is() )
- {
- OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") );
- rPropSet->setPropertyValue( sPropName, makeAny( sStreamName ) );
- }
-
-
- Reference < io::XInputStream > xStream = xEventsStream->getInputStream();
- return ReadThroughComponent( xStream, xModelComponent, rFactory, rPropSet, pFilterName, bEncrypted );
- }
- catch ( packages::WrongPasswordException& )
- {
- return ERRCODE_SFX_WRONGPASSWORD;
- }
- catch( packages::zip::ZipIOException& )
- {
- return ERRCODE_IO_BROKENPACKAGE;
- }
- catch ( uno::Exception& )
- {
- }
-
- return ERRCODE_SFX_DOLOADFAILED;
-}
-
-////////////////////////////////////////////////////////////
-
-SmXMLImport::SmXMLImport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
- sal_uInt16 nImportFlags)
-: SvXMLImport( xServiceFactory, nImportFlags ),
- pPresLayoutElemTokenMap(0),
- pPresLayoutAttrTokenMap(0),
- pFencedAttrTokenMap(0),
- pOperatorAttrTokenMap(0),
- pAnnotationAttrTokenMap(0),
- pPresElemTokenMap(0),
- pPresScriptEmptyElemTokenMap(0),
- pPresTableElemTokenMap(0),
- pColorTokenMap(0),
- bSuccess(sal_False)
-{
-}
-
-const uno::Sequence< sal_Int8 > & SmXMLImport::getUnoTunnelId() throw()
-{
- static uno::Sequence< sal_Int8 > * pSeq = 0;
- if ( !pSeq )
- {
- osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
- if ( !pSeq )
- {
- static uno::Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
-}
-
-OUString SAL_CALL SmXMLImport_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Math.XMLImporter" ) );
-}
-
-uno::Sequence< OUString > SAL_CALL SmXMLImport_getSupportedServiceNames()
- throw()
-{
- const OUString aServiceName( IMPORT_SVC_NAME );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SmXMLImport_createInstance(
- const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
- throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SmXMLImport(IMPORT_ALL);
- return (cppu::OWeakObject*)new SmXMLImport(rSMgr, IMPORT_ALL);
-}
-
-////////////////////////////////////////////////////////////
-
-OUString SAL_CALL SmXMLImportMeta_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Math.XMLOasisMetaImporter" ) );
-}
-
-uno::Sequence< OUString > SAL_CALL SmXMLImportMeta_getSupportedServiceNames()
-throw()
-{
- const OUString aServiceName( IMPORT_SVC_NAME );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SmXMLImportMeta_createInstance(
- const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
-throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SmXMLImport( IMPORT_META );
- return (cppu::OWeakObject*)new SmXMLImport( rSMgr, IMPORT_META );
-}
-
-////////////////////////////////////////////////////////////
-
-OUString SAL_CALL SmXMLImportSettings_getImplementationName() throw()
-{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Math.XMLOasisSettingsImporter" ) );
-}
-
-uno::Sequence< OUString > SAL_CALL SmXMLImportSettings_getSupportedServiceNames()
- throw()
-{
- const OUString aServiceName( IMPORT_SVC_NAME );
- const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
- return aSeq;
-}
-
-uno::Reference< uno::XInterface > SAL_CALL SmXMLImportSettings_createInstance(
- const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
- throw( uno::Exception )
-{
- // #110680#
- // return (cppu::OWeakObject*)new SmXMLImport( IMPORT_SETTINGS );
- return (cppu::OWeakObject*)new SmXMLImport( rSMgr, IMPORT_SETTINGS );
-}
-
-////////////////////////////////////////////////////////////
-
-// XServiceInfo
-// override empty method from parent class
-rtl::OUString SAL_CALL SmXMLImport::getImplementationName()
- throw(uno::RuntimeException)
-{
- OUString aTxt;
- switch( getImportFlags() )
- {
- case IMPORT_META:
- aTxt = SmXMLImportMeta_getImplementationName();
- break;
- case IMPORT_SETTINGS:
- aTxt = SmXMLImportSettings_getImplementationName();
- break;
- case IMPORT_ALL:
- default:
- aTxt = SmXMLImport_getImplementationName();
- break;
- }
- return aTxt;
-}
-
-
-sal_Int64 SAL_CALL SmXMLImport::getSomething(
- const uno::Sequence< sal_Int8 >&rId )
-throw(uno::RuntimeException)
-{
- if ( rId.getLength() == 16 &&
- 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
- return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_uIntPtr >(this));
-
- return SvXMLImport::getSomething( rId );
-}
-
-void SmXMLImport::endDocument(void)
- throw(xml::sax::SAXException, uno::RuntimeException)
-{
- //Set the resulted tree into the SmDocShell where it belongs
- SmNode *pTree;
- if (NULL != (pTree = GetTree()))
- {
- uno::Reference <frame::XModel> xModel = GetModel();
- uno::Reference <lang::XUnoTunnel> xTunnel;
- xTunnel = uno::Reference <lang::XUnoTunnel> (xModel,uno::UNO_QUERY);
- SmModel *pModel = reinterpret_cast<SmModel *>
- (xTunnel->getSomething(SmModel::getUnoTunnelId()));
-
- if (pModel)
- {
- SmDocShell *pDocShell =
- static_cast<SmDocShell*>(pModel->GetObjectShell());
- pDocShell->SetFormulaTree(pTree);
- if (0 == aText.Len()) //If we picked up no annotation text
- {
- //Make up some editable text
- aText = pDocShell->GetText();
- pTree->CreateTextFromNode(aText);
- aText.EraseTrailingChars();
- if ((aText.GetChar(0) == '{') &&
- (aText.GetChar(aText.Len()-1) == '}'))
- {
- aText.Erase(0,1);
- aText.Erase(aText.Len()-1,1);
- }
- }
- pDocShell->SetText( String() );
-
- // Convert symbol names
- SmParser &rParser = pDocShell->GetParser();
- BOOL bVal = rParser.IsImportSymbolNames();
- rParser.SetImportSymbolNames( TRUE );
- SmNode *pTmpTree = rParser.Parse( aText );
- aText = rParser.GetText();
- delete pTmpTree;
- rParser.SetImportSymbolNames( bVal );
-
- pDocShell->SetText( aText );
- }
- DBG_ASSERT(pModel,"So there *was* a uno problem after all");
-
- bSuccess = sal_True;
- }
-
- SvXMLImport::endDocument();
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLImportContext: public SvXMLImportContext
-{
-public:
- SmXMLImportContext( SmXMLImport &rImport, sal_uInt16 nPrfx,
- const OUString& rLName)
- : SvXMLImportContext(rImport, nPrfx, rLName) {}
-
- const SmXMLImport& GetSmImport() const
- {
- return (const SmXMLImport&)GetImport();
- }
-
- SmXMLImport& GetSmImport()
- {
- return (SmXMLImport&)GetImport();
- }
-
- virtual void TCharacters(const OUString & /*rChars*/);
- virtual void Characters(const OUString &rChars);
- virtual SvXMLImportContext *CreateChildContext(sal_uInt16 /*nPrefix*/, const OUString& /*rLocalName*/, const uno::Reference< xml::sax::XAttributeList > & /*xAttrList*/);
-};
-
-void SmXMLImportContext::TCharacters(const OUString & /*rChars*/)
-{
-}
-
-void SmXMLImportContext::Characters(const OUString &rChars)
-{
- /*
- Whitespace occurring within the content of token elements is "trimmed"
- from the ends (i.e. all whitespace at the beginning and end of the
- content is removed), and "collapsed" internally (i.e. each sequence of
- 1 or more whitespace characters is replaced with one blank character).
- */
- //collapsing not done yet!
- const OUString &rChars2 = rChars.trim();
- if (rChars2.getLength())
- TCharacters(rChars2/*.collapse()*/);
-}
-
-SvXMLImportContext * SmXMLImportContext::CreateChildContext(sal_uInt16 /*nPrefix*/,
- const OUString& /*rLocalName*/,
- const uno::Reference< xml::sax::XAttributeList > & /*xAttrList*/)
-{
- return 0;
-}
-
-////////////////////////////////////////////////////////////
-
-struct SmXMLContext_Helper
-{
- sal_Int8 nIsBold;
- sal_Int8 nIsItalic;
- double nFontSize;
- sal_Bool bFontNodeNeeded;
- OUString sFontFamily;
- OUString sColor;
-
- SmXMLImportContext rContext;
-
- SmXMLContext_Helper(SmXMLImportContext &rImport) :
- nIsBold(-1), nIsItalic(-1), nFontSize(0.0), rContext(rImport) {}
-
- void RetrieveAttrs(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
- void ApplyAttrs();
-};
-
-void SmXMLContext_Helper::RetrieveAttrs(const uno::Reference<
- xml::sax::XAttributeList > & xAttrList )
-{
- sal_Int8 nOldIsBold=nIsBold;
- sal_Int8 nOldIsItalic=nIsItalic;
- double nOldFontSize=nFontSize;
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- OUString sOldFontFamily = sFontFamily;
- for (sal_Int16 i=0;i<nAttrCount;i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex(i);
- OUString aLocalName;
- sal_uInt16 nPrefix = rContext.GetSmImport().GetNamespaceMap().
- GetKeyByAttrName(sAttrName,&aLocalName);
- OUString sValue = xAttrList->getValueByIndex(i);
- const SvXMLTokenMap &rAttrTokenMap =
- rContext.GetSmImport().GetPresLayoutAttrTokenMap();
- switch(rAttrTokenMap.Get(nPrefix,aLocalName))
- {
- case XML_TOK_FONTWEIGHT:
- nIsBold = sValue.equals(GetXMLToken(XML_BOLD));
- break;
- case XML_TOK_FONTSTYLE:
- nIsItalic = sValue.equals(GetXMLToken(XML_ITALIC));
- break;
- case XML_TOK_FONTSIZE:
- SvXMLUnitConverter::convertDouble(nFontSize,sValue);
- rContext.GetSmImport().GetMM100UnitConverter().
- setXMLMeasureUnit(MAP_POINT);
- if (-1 == sValue.indexOf(GetXMLToken(XML_UNIT_PT)))
- {
- if (-1 == sValue.indexOf('%'))
- nFontSize=0.0;
- else
- {
- rContext.GetSmImport().GetMM100UnitConverter().
- setXMLMeasureUnit(MAP_RELATIVE);
- }
- }
- break;
- case XML_TOK_FONTFAMILY:
- sFontFamily = sValue;
- break;
- case XML_TOK_COLOR:
- sColor = sValue;
- break;
- default:
- break;
- }
- }
-
- if ((nOldIsBold!=nIsBold) || (nOldIsItalic!=nIsItalic) ||
- (nOldFontSize!=nFontSize) || (sOldFontFamily!=sFontFamily)
- || sColor.getLength())
- bFontNodeNeeded=sal_True;
- else
- bFontNodeNeeded=sal_False;
-}
-
-void SmXMLContext_Helper::ApplyAttrs()
-{
- SmNodeStack &rNodeStack = rContext.GetSmImport().GetNodeStack();
-
- if (bFontNodeNeeded)
- {
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
-
- if (nIsBold != -1)
- {
- if (nIsBold)
- aToken.eType = TBOLD;
- else
- aToken.eType = TNBOLD;
- SmStructureNode *pFontNode = static_cast<SmStructureNode *>
- (new SmFontNode(aToken));
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (nIsItalic != -1)
- {
- if (nIsItalic)
- aToken.eType = TITALIC;
- else
- aToken.eType = TNITALIC;
- SmStructureNode *pFontNode = static_cast<SmStructureNode *>
- (new SmFontNode(aToken));
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (nFontSize != 0.0)
- {
- aToken.eType = TSIZE;
- SmFontNode *pFontNode = new SmFontNode(aToken);
-
- if (MAP_RELATIVE == rContext.GetSmImport().GetMM100UnitConverter().
- getXMLMeasureUnit())
- {
- if (nFontSize < 100.00)
- pFontNode->SetSizeParameter(Fraction(100.00/nFontSize),
- FNTSIZ_DIVIDE);
- else
- pFontNode->SetSizeParameter(Fraction(nFontSize/100.00),
- FNTSIZ_MULTIPLY);
- }
- else
- pFontNode->SetSizeParameter(Fraction(nFontSize),FNTSIZ_ABSOLUT);
-
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (sFontFamily.getLength())
- {
- if (sFontFamily.equalsIgnoreAsciiCase(GetXMLToken(XML_FIXED)))
- aToken.eType = TFIXED;
- else if (sFontFamily.equalsIgnoreAsciiCase(OUString(
- RTL_CONSTASCII_USTRINGPARAM("sans"))))
- aToken.eType = TSANS;
- else if (sFontFamily.equalsIgnoreAsciiCase(OUString(
- RTL_CONSTASCII_USTRINGPARAM("serif"))))
- aToken.eType = TSERIF;
- else //Just give up, we need to extend our font mechanism to be
- //more general
- return;
-
- aToken.aText = sFontFamily;
- SmFontNode *pFontNode = new SmFontNode(aToken);
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (sColor.getLength())
- {
- //Again we can only handle a small set of colours in
- //StarMath for now.
- const SvXMLTokenMap& rTokenMap =
- rContext.GetSmImport().GetColorTokenMap();
- aToken.eType = static_cast<SmTokenType>(rTokenMap.Get(
- XML_NAMESPACE_MATH, sColor));
- if (aToken.eType != -1)
- {
- SmFontNode *pFontNode = new SmFontNode(aToken);
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- }
-
- }
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLDocContext_Impl : public SmXMLImportContext
-{
-public:
- SmXMLDocContext_Impl( SmXMLImport &rImport, sal_uInt16 nPrfx,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrfx,rLName) {}
-
- virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &xAttrList);
-
- void EndElement();
-};
-
-////////////////////////////////////////////////////////////
-
-/*avert thy gaze from the proginator*/
-class SmXMLRowContext_Impl : public SmXMLDocContext_Impl
-{
-protected:
- ULONG nElementCount;
-
-public:
- SmXMLRowContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLDocContext_Impl(rImport,nPrefix,rLName)
- { nElementCount = GetSmImport().GetNodeStack().Count(); }
-
- virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &xAttrList);
-
- SvXMLImportContext *StrictCreateChildContext(sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > &xAttrList);
-
- void EndElement();
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLFracContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLFracContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement();
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLSqrtContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLSqrtContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement();
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLRootContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLRootContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement();
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLStyleContext_Impl : public SmXMLRowContext_Impl
-{
-protected:
- SmXMLContext_Helper aStyleHelper;
-
-public:
- /*Right now the style tag is completely ignored*/
- SmXMLStyleContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName) : SmXMLRowContext_Impl(rImport,nPrefix,rLName),
- aStyleHelper(*this) {}
-
- void EndElement();
- void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
-};
-
-void SmXMLStyleContext_Impl::StartElement(const uno::Reference<
- xml::sax::XAttributeList > & xAttrList )
-{
-#if 1
- aStyleHelper.RetrieveAttrs(xAttrList);
-#else
- sal_Int8 nOldIsBold=nIsBold;
- sal_Int8 nOldIsItalic=nIsItalic;
- double nOldFontSize=nFontSize;
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- OUString sOldFontFamily = sFontFamily;
- for (sal_Int16 i=0;i<nAttrCount;i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex(i);
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName(sAttrName,&aLocalName);
- OUString sValue = xAttrList->getValueByIndex(i);
- const SvXMLTokenMap &rAttrTokenMap =
- GetSmImport().GetPresLayoutAttrTokenMap();
- switch(rAttrTokenMap.Get(nPrefix,aLocalName))
- {
- case XML_TOK_FONTWEIGHT:
- nIsBold = sValue.equals(GetXMLToken(XML_BOLD));
- break;
- case XML_TOK_FONTSTYLE:
- nIsItalic = sValue.equals(GetXMLToken(XML_ITALIC));
- break;
- case XML_TOK_FONTSIZE:
- SvXMLUnitConverter::convertDouble(nFontSize,sValue);
- GetSmImport().GetMM100UnitConverter().
- setXMLMeasureUnit(MAP_POINT);
- if (-1 == sValue.indexOf(GetXMLToken(XML_UNIT_PT)))
- if (-1 == sValue.indexOf('%'))
- nFontSize=0.0;
- else
- {
- GetSmImport().GetMM100UnitConverter().
- setXMLMeasureUnit(MAP_RELATIVE);
- }
- break;
- case XML_TOK_FONTFAMILY:
- sFontFamily = sValue;
- break;
- case XML_TOK_COLOR:
- sColor = sValue;
- break;
- default:
- break;
- }
- }
-
- if ((nOldIsBold!=nIsBold) || (nOldIsItalic!=nIsItalic) ||
- (nOldFontSize!=nFontSize) || (sOldFontFamily!=sFontFamily)
- || sColor.getLength())
- bFontNodeNeeded=sal_True;
- else
- bFontNodeNeeded=sal_False;
-#endif
-}
-
-
-void SmXMLStyleContext_Impl::EndElement()
-{
- /*
- <mstyle> accepts any number of arguments; if this number is not 1, its
- contents are treated as a single "inferred <mrow>" containing its
- arguments
- */
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- if (rNodeStack.Count() - nElementCount > 1)
- SmXMLRowContext_Impl::EndElement();
-#if 1
- aStyleHelper.ApplyAttrs();
-#else
- if (bFontNodeNeeded)
- {
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
-
- if (nIsBold != -1)
- {
- if (nIsBold)
- aToken.eType = TBOLD;
- else
- aToken.eType = TNBOLD;
- SmStructureNode *pFontNode = static_cast<SmStructureNode *>
- (new SmFontNode(aToken));
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (nIsItalic != -1)
- {
- if (nIsItalic)
- aToken.eType = TITALIC;
- else
- aToken.eType = TNITALIC;
- SmStructureNode *pFontNode = static_cast<SmStructureNode *>
- (new SmFontNode(aToken));
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (nFontSize != 0.0)
- {
- aToken.eType = TSIZE;
- SmFontNode *pFontNode = new SmFontNode(aToken);
-
- if (MAP_RELATIVE == GetSmImport().GetMM100UnitConverter().
- getXMLMeasureUnit())
- {
- if (nFontSize < 100.00)
- pFontNode->SetSizeParameter(Fraction(100.00/nFontSize),
- FNTSIZ_DIVIDE);
- else
- pFontNode->SetSizeParameter(Fraction(nFontSize/100.00),
- FNTSIZ_MULTIPLY);
- }
- else
- pFontNode->SetSizeParameter(Fraction(nFontSize),FNTSIZ_ABSOLUT);
-
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (sFontFamily.getLength())
- {
- if (sFontFamily.equalsIgnoreCase(GetXMLToken(XML_FIXED)))
- aToken.eType = TFIXED;
- else if (sFontFamily.equalsIgnoreCase(OUString(
- RTL_CONSTASCII_USTRINGPARAM("sans"))))
- aToken.eType = TSANS;
- else if (sFontFamily.equalsIgnoreCase(OUString(
- RTL_CONSTASCII_USTRINGPARAM("serif"))))
- aToken.eType = TSERIF;
- else //Just give up, we need to extend our font mechanism to be
- //more general
- return;
-
- aToken.aText = sFontFamily;
- SmFontNode *pFontNode = new SmFontNode(aToken);
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- if (sColor.getLength())
- {
- //Again we can only handle a small set of colours in
- //StarMath for now.
- const SvXMLTokenMap& rTokenMap =
- GetSmImport().GetColorTokenMap();
- aToken.eType = static_cast<SmTokenType>(rTokenMap.Get(
- XML_NAMESPACE_MATH, sColor));
- if (aToken.eType != -1)
- {
- SmFontNode *pFontNode = new SmFontNode(aToken);
- pFontNode->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pFontNode);
- }
- }
-
- }
-#endif
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLPaddedContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- /*Right now the style tag is completely ignored*/
- SmXMLPaddedContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement();
-};
-
-void SmXMLPaddedContext_Impl::EndElement()
-{
- /*
- <mpadded> accepts any number of arguments; if this number is not 1, its
- contents are treated as a single "inferred <mrow>" containing its
- arguments
- */
- if (GetSmImport().GetNodeStack().Count() - nElementCount > 1)
- SmXMLRowContext_Impl::EndElement();
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLPhantomContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- /*Right now the style tag is completely ignored*/
- SmXMLPhantomContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement();
-};
-
-void SmXMLPhantomContext_Impl::EndElement()
-{
- /*
- <mphantom> accepts any number of arguments; if this number is not 1, its
- contents are treated as a single "inferred <mrow>" containing its
- arguments
- */
- if (GetSmImport().GetNodeStack().Count() - nElementCount > 1)
- SmXMLRowContext_Impl::EndElement();
-
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
- aToken.eType = TPHANTOM;
-
- SmStructureNode *pPhantom = static_cast<SmStructureNode *>
- (new SmFontNode(aToken));
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- pPhantom->SetSubNodes(0,rNodeStack.Pop());
- rNodeStack.Push(pPhantom);
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLFencedContext_Impl : public SmXMLRowContext_Impl
-{
-protected:
- sal_Unicode cBegin;
- sal_Unicode cEnd;
-
-public:
- SmXMLFencedContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName),
- cBegin('('), cEnd(')') {}
-
- void StartElement(const uno::Reference< xml::sax::XAttributeList > & xAttrList );
- void EndElement();
-};
-
-
-void SmXMLFencedContext_Impl::StartElement(const uno::Reference<
- xml::sax::XAttributeList > & xAttrList )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for (sal_Int16 i=0;i<nAttrCount;i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex(i);
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName(sAttrName,&aLocalName);
- OUString sValue = xAttrList->getValueByIndex(i);
- const SvXMLTokenMap &rAttrTokenMap =
- GetSmImport().GetFencedAttrTokenMap();
- switch(rAttrTokenMap.Get(nPrefix,aLocalName))
- {
- //temp, starmath cannot handle multichar brackets (I think)
- case XML_TOK_OPEN:
- cBegin = sValue[0];
- break;
- case XML_TOK_CLOSE:
- cEnd = sValue[0];
- break;
- default:
- /*Go to superclass*/
- break;
- }
- }
-}
-
-
-void SmXMLFencedContext_Impl::EndElement()
-{
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.aText = ',';
- aToken.eType = TLEFT;
- aToken.nLevel = 5;
-
- aToken.eType = TLPARENT;
- aToken.cMathChar = cBegin;
- SmStructureNode *pSNode = new SmBraceNode(aToken);
- SmNode *pLeft = new SmMathSymbolNode(aToken);
-
- aToken.cMathChar = cEnd;
- aToken.eType = TRPARENT;
- SmNode *pRight = new SmMathSymbolNode(aToken);
-
- SmNodeArray aRelationArray;
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
-
- aToken.cMathChar = '\0';
- aToken.aText = ',';
- aToken.eType = TIDENT;
-
- ULONG i = rNodeStack.Count() - nElementCount;
- if (rNodeStack.Count() - nElementCount > 1)
- i += rNodeStack.Count() - 1 - nElementCount;
- aRelationArray.resize(i);
- while (rNodeStack.Count() > nElementCount)
- {
- aRelationArray[--i] = rNodeStack.Pop();
- if (i > 1 && rNodeStack.Count() > 1)
- aRelationArray[--i] = new SmGlyphSpecialNode(aToken);
- }
-
- SmToken aDummy;
- SmStructureNode *pBody = new SmExpressionNode(aDummy);
- pBody->SetSubNodes(aRelationArray);
-
-
- pSNode->SetSubNodes(pLeft,pBody,pRight);
- pSNode->SetScaleMode(SCALE_HEIGHT);
- GetSmImport().GetNodeStack().Push(pSNode);
-}
-
-
-////////////////////////////////////////////////////////////
-
-class SmXMLErrorContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLErrorContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement();
-};
-
-void SmXMLErrorContext_Impl::EndElement()
-{
- /*Right now the error tag is completely ignored, what
- can I do with it in starmath, ?, maybe we need a
- report window ourselves, do a test for validity of
- the xml input, use merrors, and then generate
- the markup inside the merror with a big red colour
- of something. For now just throw them all away.
- */
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- while (rNodeStack.Count() > nElementCount)
- {
- SmNode *pNode = rNodeStack.Pop();
- delete pNode;
- }
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLNumberContext_Impl : public SmXMLImportContext
-{
-protected:
- SmToken aToken;
-
-public:
- SmXMLNumberContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName)
- {
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
- aToken.eType = TNUMBER;
- }
-
- virtual void TCharacters(const OUString &rChars);
-
- void EndElement();
-};
-
-void SmXMLNumberContext_Impl::TCharacters(const OUString &rChars)
-{
- aToken.aText = rChars;
-}
-
-void SmXMLNumberContext_Impl::EndElement()
-{
- GetSmImport().GetNodeStack().Push(new SmTextNode(aToken,FNT_NUMBER));
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLAnnotationContext_Impl : public SmXMLImportContext
-{
- sal_Bool bIsStarMath;
-
-public:
- SmXMLAnnotationContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName), bIsStarMath(sal_False) {}
-
- virtual void Characters(const OUString &rChars);
-
- void StartElement(const uno::Reference<xml::sax::XAttributeList > & xAttrList );
-};
-
-void SmXMLAnnotationContext_Impl::StartElement(const uno::Reference<
- xml::sax::XAttributeList > & xAttrList )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for (sal_Int16 i=0;i<nAttrCount;i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex(i);
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName(sAttrName,&aLocalName);
-
- OUString sValue = xAttrList->getValueByIndex(i);
- const SvXMLTokenMap &rAttrTokenMap =
- GetSmImport().GetAnnotationAttrTokenMap();
- switch(rAttrTokenMap.Get(nPrefix,aLocalName))
- {
- case XML_TOK_ENCODING:
- bIsStarMath= sValue.equals(
- OUString(RTL_CONSTASCII_USTRINGPARAM("StarMath 5.0")));
- break;
- default:
- break;
- }
- }
-}
-
-void SmXMLAnnotationContext_Impl::Characters(const OUString &rChars)
-{
- if (bIsStarMath)
- GetSmImport().GetText().Append(String(rChars));
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLTextContext_Impl : public SmXMLImportContext
-{
-protected:
- SmToken aToken;
-
-public:
- SmXMLTextContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName)
- {
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
- aToken.eType = TTEXT;
- }
-
- virtual void TCharacters(const OUString &rChars);
-
- void EndElement();
-};
-
-void SmXMLTextContext_Impl::TCharacters(const OUString &rChars)
-{
- aToken.aText = rChars;
-}
-
-void SmXMLTextContext_Impl::EndElement()
-{
- GetSmImport().GetNodeStack().Push(new SmTextNode(aToken,FNT_TEXT));
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLStringContext_Impl : public SmXMLImportContext
-{
-protected:
- SmToken aToken;
-
-public:
- SmXMLStringContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName)
- {
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
- aToken.eType = TTEXT;
- }
-
- virtual void TCharacters(const OUString &rChars);
-
- void EndElement();
-};
-
-void SmXMLStringContext_Impl::TCharacters(const OUString &rChars)
-{
- /*
- The content of <ms> elements should be rendered with visible "escaping" of
- certain characters in the content, including at least "double quote"
- itself, and preferably whitespace other than individual blanks. The intent
- is for the viewer to see that the expression is a string literal, and to
- see exactly which characters form its content. For example, <ms>double
- quote is "</ms> might be rendered as "double quote is \"".
-
- Obviously this isn't fully done here.
- */
- aToken.aText.Erase();
- aToken.aText += '\"';
- aToken.aText += String(rChars);
- aToken.aText += '\"';
-}
-
-void SmXMLStringContext_Impl::EndElement()
-{
- GetSmImport().GetNodeStack().Push(new SmTextNode(aToken,FNT_FIXED));
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLIdentifierContext_Impl : public SmXMLImportContext
-{
-protected:
- SmXMLContext_Helper aStyleHelper;
- SmToken aToken;
-
-public:
- SmXMLIdentifierContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName),aStyleHelper(*this)
- {
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
- aToken.eType = TIDENT;
- }
-
- void TCharacters(const OUString &rChars);
- void StartElement(const uno::Reference< xml::sax::XAttributeList > & xAttrList )
- {
- aStyleHelper.RetrieveAttrs(xAttrList);
- };
- void EndElement();
-};
-
-void SmXMLIdentifierContext_Impl::EndElement()
-{
- SmTextNode *pNode = 0;
- //we will handle identifier italic/normal here instead of with a standalone
- //font node
- if (((aStyleHelper.nIsItalic == -1) && (aToken.aText.Len() > 1))
- || ((aStyleHelper.nIsItalic == 0) && (aToken.aText.Len() == 1)))
- {
- pNode = new SmTextNode(aToken,FNT_FUNCTION);
- pNode->GetFont().SetItalic(ITALIC_NONE);
- aStyleHelper.nIsItalic = -1;
- }
- else
- pNode = new SmTextNode(aToken,FNT_VARIABLE);
- if (aStyleHelper.bFontNodeNeeded && aStyleHelper.nIsItalic != -1)
- {
- if (aStyleHelper.nIsItalic)
- pNode->GetFont().SetItalic(ITALIC_NORMAL);
- else
- pNode->GetFont().SetItalic(ITALIC_NONE);
- }
-
- if ((-1!=aStyleHelper.nIsBold) || (0.0!=aStyleHelper.nFontSize) ||
- (aStyleHelper.sFontFamily.getLength()) ||
- aStyleHelper.sColor.getLength())
- aStyleHelper.bFontNodeNeeded=sal_True;
- else
- aStyleHelper.bFontNodeNeeded=sal_False;
- if (aStyleHelper.bFontNodeNeeded)
- aStyleHelper.ApplyAttrs();
- GetSmImport().GetNodeStack().Push(pNode);
-}
-
-void SmXMLIdentifierContext_Impl::TCharacters(const OUString &rChars)
-{
- aToken.aText = rChars;
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLOperatorContext_Impl : public SmXMLImportContext
-{
- sal_Bool bIsStretchy;
-
-protected:
- SmToken aToken;
-
-public:
- SmXMLOperatorContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName), bIsStretchy(sal_False)
- {
- aToken.nGroup = 0;
- aToken.eType = TSPECIAL;
- aToken.nLevel = 5;
- }
-
- void TCharacters(const OUString &rChars);
- void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
- void EndElement();
-};
-
-void SmXMLOperatorContext_Impl::TCharacters(const OUString &rChars)
-{
- aToken.cMathChar = rChars[0];
-}
-
-void SmXMLOperatorContext_Impl::EndElement()
-{
- SmMathSymbolNode *pNode = new SmMathSymbolNode(aToken);
- //For stretchy scaling the scaling must be retrieved from this node
- //and applied to the expression itself so as to get the expression
- //to scale the operator to the height of the expression itself
- if (bIsStretchy)
- pNode->SetScaleMode(SCALE_HEIGHT);
- GetSmImport().GetNodeStack().Push(pNode);
-}
-
-
-
-void SmXMLOperatorContext_Impl::StartElement(const uno::Reference<
- xml::sax::XAttributeList > & xAttrList )
-{
- sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
- for (sal_Int16 i=0;i<nAttrCount;i++)
- {
- OUString sAttrName = xAttrList->getNameByIndex(i);
- OUString aLocalName;
- sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
- GetKeyByAttrName(sAttrName,&aLocalName);
-
- OUString sValue = xAttrList->getValueByIndex(i);
- const SvXMLTokenMap &rAttrTokenMap =
- GetSmImport().GetOperatorAttrTokenMap();
- switch(rAttrTokenMap.Get(nPrefix,aLocalName))
- {
- case XML_TOK_STRETCHY:
- bIsStretchy = sValue.equals(
- GetXMLToken(XML_TRUE));
- break;
- default:
- break;
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-
-class SmXMLSpaceContext_Impl : public SmXMLImportContext
-{
-public:
- SmXMLSpaceContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName) {}
-
- void StartElement(const uno::Reference< xml::sax::XAttributeList >& xAttrList );
-};
-
-void SmXMLSpaceContext_Impl::StartElement(
- const uno::Reference<xml::sax::XAttributeList > & /*xAttrList*/ )
-{
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.eType = TBLANK;
- aToken.nLevel = 5;
- SmBlankNode *pBlank = new SmBlankNode(aToken);
- pBlank->IncreaseBy(aToken);
- GetSmImport().GetNodeStack().Push(pBlank);
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLSubContext_Impl : public SmXMLRowContext_Impl
-{
-protected:
- void GenericEndElement(SmTokenType eType,SmSubSup aSubSup);
-
-public:
- SmXMLSubContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement()
- {
- GenericEndElement(TRSUB,RSUB);
- }
-};
-
-
-void SmXMLSubContext_Impl::GenericEndElement(SmTokenType eType, SmSubSup eSubSup)
-{
- /*The <msub> element requires exactly 2 arguments.*/
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
- "Sub has not two arguments");
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = eType;
- SmSubSupNode *pNode = new SmSubSupNode(aToken);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
-
- // initialize subnodes array
- SmNodeArray aSubNodes;
- aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES);
- for (ULONG i = 1; i < aSubNodes.size(); i++)
- aSubNodes[i] = NULL;
-
- aSubNodes[eSubSup+1] = rNodeStack.Pop();
- aSubNodes[0] = rNodeStack.Pop();
- pNode->SetSubNodes(aSubNodes);
- rNodeStack.Push(pNode);
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLSupContext_Impl : public SmXMLSubContext_Impl
-{
-public:
- SmXMLSupContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLSubContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement()
- {
- GenericEndElement(TRSUP,RSUP);
- }
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLSubSupContext_Impl : public SmXMLRowContext_Impl
-{
-protected:
- void GenericEndElement(SmTokenType eType, SmSubSup aSub,SmSubSup aSup);
-
-public:
- SmXMLSubSupContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement()
- {
- GenericEndElement(TRSUB,RSUB,RSUP);
- }
-};
-
-void SmXMLSubSupContext_Impl::GenericEndElement(SmTokenType eType,
- SmSubSup aSub,SmSubSup aSup)
-{
- /*The <msub> element requires exactly 3 arguments.*/
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 3,
- "SubSup has not three arguments");
-
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = eType;
- SmSubSupNode *pNode = new SmSubSupNode(aToken);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
-
- // initialize subnodes array
- SmNodeArray aSubNodes;
- aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES);
- for (ULONG i = 1; i < aSubNodes.size(); i++)
- aSubNodes[i] = NULL;
-
- aSubNodes[aSup+1] = rNodeStack.Pop();
- aSubNodes[aSub+1] = rNodeStack.Pop();
- aSubNodes[0] = rNodeStack.Pop();
- pNode->SetSubNodes(aSubNodes);
- rNodeStack.Push(pNode);
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLUnderContext_Impl : public SmXMLSubContext_Impl
-{
-protected:
- sal_Int16 nAttrCount;
-
-public:
- SmXMLUnderContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLSubContext_Impl(rImport,nPrefix,rLName) {}
-
- void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
- void EndElement();
- void HandleAccent();
-};
-
-void SmXMLUnderContext_Impl::StartElement(const uno::Reference<
- xml::sax::XAttributeList > & xAttrList )
-{
- nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
-}
-
-void SmXMLUnderContext_Impl::HandleAccent()
-{
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
- "Sub has not two arguments");
-
- /*Just one special case for the underline thing*/
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- SmNode *pTest = rNodeStack.Pop();
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = TUNDERLINE;
-
-
- SmNodeArray aSubNodes;
- aSubNodes.resize(2);
-
- SmStructureNode *pNode = new SmAttributNode(aToken);
- if ((pTest->GetToken().cMathChar & 0x0FFF) == 0x0332)
- {
- aSubNodes[0] = new SmRectangleNode(aToken);
- delete pTest;
- }
- else
- aSubNodes[0] = pTest;
-
- aSubNodes[1] = rNodeStack.Pop();
- pNode->SetSubNodes(aSubNodes);
- pNode->SetScaleMode(SCALE_WIDTH);
- rNodeStack.Push(pNode);
-}
-
-
-void SmXMLUnderContext_Impl::EndElement()
-{
- if (!nAttrCount)
- GenericEndElement(TCSUB,CSUB);
- else
- HandleAccent();
-#if 0
- //UnderBrace trick
- SmStructureNode *pNode = rNodeStack.Pop();
- if (pNode->GetSubNode(1)->GetToken().cMathChar == (0x0332|0xf000))
- if (pNode->GetSubNode(0)->GetToken().cMathChar == (0x0332|0xf000))
-#endif
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLOverContext_Impl : public SmXMLSubContext_Impl
-{
-protected:
- sal_Int16 nAttrCount;
-
-public:
- SmXMLOverContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLSubContext_Impl(rImport,nPrefix,rLName), nAttrCount(0) {}
-
- void EndElement();
- void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
- void HandleAccent();
-};
-
-
-void SmXMLOverContext_Impl::StartElement(const uno::Reference<
- xml::sax::XAttributeList > & xAttrList )
-{
- nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
-}
-
-
-void SmXMLOverContext_Impl::EndElement()
-{
- if (!nAttrCount)
- GenericEndElement(TCSUP,CSUP);
- else
- HandleAccent();
-}
-
-
-void SmXMLOverContext_Impl::HandleAccent()
-{
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
- "Sub has not two arguments");
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = TACUTE;
-
- SmAttributNode *pNode = new SmAttributNode(aToken);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
-
- SmNodeArray aSubNodes;
- aSubNodes.resize(2);
- aSubNodes[0] = rNodeStack.Pop();
- aSubNodes[1] = rNodeStack.Pop();
- pNode->SetSubNodes(aSubNodes);
- pNode->SetScaleMode(SCALE_WIDTH);
- rNodeStack.Push(pNode);
-
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLUnderOverContext_Impl : public SmXMLSubSupContext_Impl
-{
-public:
- SmXMLUnderOverContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLSubSupContext_Impl(rImport,nPrefix,rLName) {}
-
- void EndElement()
- {
- GenericEndElement(TCSUB,CSUB,CSUP);
- }
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLMultiScriptsContext_Impl : public SmXMLSubSupContext_Impl
-{
- sal_Bool bHasPrescripts;
-
-public:
- SmXMLMultiScriptsContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName) :
- SmXMLSubSupContext_Impl(rImport,nPrefix,rLName),
- bHasPrescripts(FALSE) {}
-
- void EndElement();
- void MiddleElement();
- SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > &xAttrList);
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLNoneContext_Impl : public SmXMLImportContext
-{
-public:
- SmXMLNoneContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName) {}
-
- void EndElement();
-};
-
-
-void SmXMLNoneContext_Impl::EndElement(void)
-{
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.aText.Erase();
- aToken.nLevel = 5;
- aToken.eType = TIDENT;
- GetSmImport().GetNodeStack().Push(
- new SmTextNode(aToken,FNT_VARIABLE));
-}
-
-////////////////////////////////////////////////////////////
-
-class SmXMLPrescriptsContext_Impl : public SmXMLImportContext
-{
-public:
- SmXMLPrescriptsContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName)
- : SmXMLImportContext(rImport,nPrefix,rLName) {}
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLTableRowContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLTableRowContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName) :
- SmXMLRowContext_Impl(rImport,nPrefix,rLName)
- {}
-
- SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > &xAttrList);
-};
-
-
-////////////////////////////////////////////////////////////
-
-class SmXMLTableContext_Impl : public SmXMLTableRowContext_Impl
-{
-public:
- SmXMLTableContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName) :
- SmXMLTableRowContext_Impl(rImport,nPrefix,rLName)
- {}
-
- void EndElement();
- SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > &xAttrList);
-};
-
-
-////////////////////////////////////////////////////////////
-
-class SmXMLTableCellContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLTableCellContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName) :
- SmXMLRowContext_Impl(rImport,nPrefix,rLName)
- {}
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLAlignGroupContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLAlignGroupContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName) :
- SmXMLRowContext_Impl(rImport,nPrefix,rLName)
- {}
-
- /*Don't do anything with alignment for now*/
- void EndElement()
- {
- }
-};
-
-////////////////////////////////////////////////////////////
-
-class SmXMLActionContext_Impl : public SmXMLRowContext_Impl
-{
-public:
- SmXMLActionContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
- const OUString& rLName) :
- SmXMLRowContext_Impl(rImport,nPrefix,rLName)
- {}
-
- void EndElement();
-};
-
-////////////////////////////////////////////////////////////
-
-// NB: virtually inherit so we can multiply inherit properly
-// in SmXMLFlatDocContext_Impl
-class SmXMLOfficeContext_Impl : public virtual SvXMLImportContext
-{
-public:
- SmXMLOfficeContext_Impl( SmXMLImport &rImport, sal_uInt16 nPrfx,
- const OUString& rLName)
- : SvXMLImportContext(rImport,nPrfx,rLName) {}
-
- virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &xAttrList);
-};
-
-SvXMLImportContext *SmXMLOfficeContext_Impl::CreateChildContext(sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > &xAttrList)
-{
- SvXMLImportContext *pContext = 0;
- if ( XML_NAMESPACE_OFFICE == nPrefix &&
- rLocalName == GetXMLToken(XML_META) )
- {
- DBG_WARNING("XML_TOK_DOC_META: should not have come here, maybe document is invalid?");
- }
- else if ( XML_NAMESPACE_OFFICE == nPrefix &&
- rLocalName == GetXMLToken(XML_SETTINGS) )
- {
- pContext = new XMLDocumentSettingsContext( GetImport(),
- XML_NAMESPACE_OFFICE, rLocalName,
- xAttrList );
- }
- else
- pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
-
- return pContext;
-}
-
-////////////////////////////////////////////////////////////
-
-// context for flat file xml format
-class SmXMLFlatDocContext_Impl
- : public SmXMLOfficeContext_Impl, public SvXMLMetaDocumentContext
-{
-public:
- SmXMLFlatDocContext_Impl( SmXMLImport& i_rImport,
- USHORT i_nPrefix, const OUString & i_rLName,
- const uno::Reference<document::XDocumentProperties>& i_xDocProps,
- const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder);
-
- virtual ~SmXMLFlatDocContext_Impl();
-
- virtual SvXMLImportContext *CreateChildContext(USHORT i_nPrefix, const OUString& i_rLocalName, const uno::Reference<xml::sax::XAttributeList>& i_xAttrList);
-};
-
-SmXMLFlatDocContext_Impl::SmXMLFlatDocContext_Impl( SmXMLImport& i_rImport,
- USHORT i_nPrefix, const OUString & i_rLName,
- const uno::Reference<document::XDocumentProperties>& i_xDocProps,
- const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder) :
- SvXMLImportContext(i_rImport, i_nPrefix, i_rLName),
- SmXMLOfficeContext_Impl(i_rImport, i_nPrefix, i_rLName),
- SvXMLMetaDocumentContext(i_rImport, i_nPrefix, i_rLName,
- i_xDocProps, i_xDocBuilder)
-{
-}
-
-SmXMLFlatDocContext_Impl::~SmXMLFlatDocContext_Impl()
-{
-}
-
-SvXMLImportContext *SmXMLFlatDocContext_Impl::CreateChildContext(
- USHORT i_nPrefix, const OUString& i_rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& i_xAttrList)
-{
- // behave like meta base class iff we encounter office:meta
- if ( XML_NAMESPACE_OFFICE == i_nPrefix &&
- i_rLocalName == GetXMLToken(XML_META) )
- {
- return SvXMLMetaDocumentContext::CreateChildContext(
- i_nPrefix, i_rLocalName, i_xAttrList );
- }
- else
- {
- return SmXMLOfficeContext_Impl::CreateChildContext(
- i_nPrefix, i_rLocalName, i_xAttrList );
- }
-}
-
-////////////////////////////////////////////////////////////
-
-static __FAR_DATA SvXMLTokenMapEntry aPresLayoutElemTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_SEMANTICS, XML_TOK_SEMANTICS },
- { XML_NAMESPACE_MATH, XML_MATH, XML_TOK_MATH },
- { XML_NAMESPACE_MATH, XML_MSTYLE, XML_TOK_MSTYLE },
- { XML_NAMESPACE_MATH, XML_MERROR, XML_TOK_MERROR },
- { XML_NAMESPACE_MATH, XML_MPHANTOM, XML_TOK_MPHANTOM },
- { XML_NAMESPACE_MATH, XML_MROW, XML_TOK_MROW },
- { XML_NAMESPACE_MATH, XML_MFRAC, XML_TOK_MFRAC },
- { XML_NAMESPACE_MATH, XML_MSQRT, XML_TOK_MSQRT },
- { XML_NAMESPACE_MATH, XML_MROOT, XML_TOK_MROOT },
- { XML_NAMESPACE_MATH, XML_MSUB, XML_TOK_MSUB },
- { XML_NAMESPACE_MATH, XML_MSUP, XML_TOK_MSUP },
- { XML_NAMESPACE_MATH, XML_MSUBSUP, XML_TOK_MSUBSUP },
- { XML_NAMESPACE_MATH, XML_MUNDER, XML_TOK_MUNDER },
- { XML_NAMESPACE_MATH, XML_MOVER, XML_TOK_MOVER },
- { XML_NAMESPACE_MATH, XML_MUNDEROVER, XML_TOK_MUNDEROVER },
- { XML_NAMESPACE_MATH, XML_MMULTISCRIPTS, XML_TOK_MMULTISCRIPTS },
- { XML_NAMESPACE_MATH, XML_MTABLE, XML_TOK_MTABLE },
- { XML_NAMESPACE_MATH, XML_MACTION, XML_TOK_MACTION },
- { XML_NAMESPACE_MATH, XML_MFENCED, XML_TOK_MFENCED },
- { XML_NAMESPACE_MATH, XML_MPADDED, XML_TOK_MPADDED },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aPresLayoutAttrTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_FONTWEIGHT, XML_TOK_FONTWEIGHT },
- { XML_NAMESPACE_MATH, XML_FONTSTYLE, XML_TOK_FONTSTYLE },
- { XML_NAMESPACE_MATH, XML_FONTSIZE, XML_TOK_FONTSIZE },
- { XML_NAMESPACE_MATH, XML_FONTFAMILY, XML_TOK_FONTFAMILY },
- { XML_NAMESPACE_MATH, XML_COLOR, XML_TOK_COLOR },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aFencedAttrTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_OPEN, XML_TOK_OPEN },
- { XML_NAMESPACE_MATH, XML_CLOSE, XML_TOK_CLOSE },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aOperatorAttrTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_STRETCHY, XML_TOK_STRETCHY },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aAnnotationAttrTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_ENCODING, XML_TOK_ENCODING },
- XML_TOKEN_MAP_END
-};
-
-
-static __FAR_DATA SvXMLTokenMapEntry aPresElemTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_ANNOTATION, XML_TOK_ANNOTATION },
- { XML_NAMESPACE_MATH, XML_MI, XML_TOK_MI },
- { XML_NAMESPACE_MATH, XML_MN, XML_TOK_MN },
- { XML_NAMESPACE_MATH, XML_MO, XML_TOK_MO },
- { XML_NAMESPACE_MATH, XML_MTEXT, XML_TOK_MTEXT },
- { XML_NAMESPACE_MATH, XML_MSPACE,XML_TOK_MSPACE },
- { XML_NAMESPACE_MATH, XML_MS, XML_TOK_MS },
- { XML_NAMESPACE_MATH, XML_MALIGNGROUP, XML_TOK_MALIGNGROUP },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aPresScriptEmptyElemTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_MPRESCRIPTS, XML_TOK_MPRESCRIPTS },
- { XML_NAMESPACE_MATH, XML_NONE, XML_TOK_NONE },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aPresTableElemTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_MTR, XML_TOK_MTR },
- { XML_NAMESPACE_MATH, XML_MTD, XML_TOK_MTD },
- XML_TOKEN_MAP_END
-};
-
-static __FAR_DATA SvXMLTokenMapEntry aColorTokenMap[] =
-{
- { XML_NAMESPACE_MATH, XML_BLACK, TBLACK},
- { XML_NAMESPACE_MATH, XML_WHITE, TWHITE},
- { XML_NAMESPACE_MATH, XML_RED, TRED},
- { XML_NAMESPACE_MATH, XML_GREEN, TGREEN},
- { XML_NAMESPACE_MATH, XML_BLUE, TBLUE},
- { XML_NAMESPACE_MATH, XML_AQUA, TCYAN},
- { XML_NAMESPACE_MATH, XML_FUCHSIA, TMAGENTA},
- { XML_NAMESPACE_MATH, XML_YELLOW, TYELLOW},
- XML_TOKEN_MAP_END
-};
-
-
-////////////////////////////////////////////////////////////
-
-const SvXMLTokenMap& SmXMLImport::GetPresLayoutElemTokenMap()
-{
- if (!pPresLayoutElemTokenMap)
- pPresLayoutElemTokenMap = new SvXMLTokenMap(aPresLayoutElemTokenMap);
- return *pPresLayoutElemTokenMap;
-}
-
-const SvXMLTokenMap& SmXMLImport::GetPresLayoutAttrTokenMap()
-{
- if (!pPresLayoutAttrTokenMap)
- pPresLayoutAttrTokenMap = new SvXMLTokenMap(aPresLayoutAttrTokenMap);
- return *pPresLayoutAttrTokenMap;
-}
-
-
-const SvXMLTokenMap& SmXMLImport::GetFencedAttrTokenMap()
-{
- if (!pFencedAttrTokenMap)
- pFencedAttrTokenMap = new SvXMLTokenMap(aFencedAttrTokenMap);
- return *pFencedAttrTokenMap;
-}
-
-const SvXMLTokenMap& SmXMLImport::GetOperatorAttrTokenMap()
-{
- if (!pOperatorAttrTokenMap)
- pOperatorAttrTokenMap = new SvXMLTokenMap(aOperatorAttrTokenMap);
- return *pOperatorAttrTokenMap;
-}
-
-const SvXMLTokenMap& SmXMLImport::GetAnnotationAttrTokenMap()
-{
- if (!pAnnotationAttrTokenMap)
- pAnnotationAttrTokenMap = new SvXMLTokenMap(aAnnotationAttrTokenMap);
- return *pAnnotationAttrTokenMap;
-}
-
-const SvXMLTokenMap& SmXMLImport::GetPresElemTokenMap()
-{
- if (!pPresElemTokenMap)
- pPresElemTokenMap = new SvXMLTokenMap(aPresElemTokenMap);
- return *pPresElemTokenMap;
-}
-
-const SvXMLTokenMap& SmXMLImport::GetPresScriptEmptyElemTokenMap()
-{
- if (!pPresScriptEmptyElemTokenMap)
- pPresScriptEmptyElemTokenMap = new
- SvXMLTokenMap(aPresScriptEmptyElemTokenMap);
- return *pPresScriptEmptyElemTokenMap;
-}
-
-const SvXMLTokenMap& SmXMLImport::GetPresTableElemTokenMap()
-{
- if (!pPresTableElemTokenMap)
- pPresTableElemTokenMap = new SvXMLTokenMap(aPresTableElemTokenMap);
- return *pPresTableElemTokenMap;
-}
-
-const SvXMLTokenMap& SmXMLImport::GetColorTokenMap()
-{
- if (!pColorTokenMap)
- pColorTokenMap = new SvXMLTokenMap(aColorTokenMap);
- return *pColorTokenMap;
-}
-
-////////////////////////////////////////////////////////////
-
-SvXMLImportContext *SmXMLDocContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = 0L;
-
- const SvXMLTokenMap& rTokenMap = GetSmImport().GetPresLayoutElemTokenMap();
-
- //UINT32 nTest = rTokenMap.Get(nPrefix, rLocalName);
-
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- //Consider semantics a dummy except for any starmath annotations
- case XML_TOK_SEMANTICS:
- pContext = GetSmImport().CreateRowContext(nPrefix,rLocalName,
- xAttrList);
- break;
- /*General Layout Schemata*/
- case XML_TOK_MROW:
- pContext = GetSmImport().CreateRowContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MFRAC:
- pContext = GetSmImport().CreateFracContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MSQRT:
- pContext = GetSmImport().CreateSqrtContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MROOT:
- pContext = GetSmImport().CreateRootContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MSTYLE:
- pContext = GetSmImport().CreateStyleContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MERROR:
- pContext = GetSmImport().CreateErrorContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MPADDED:
- pContext = GetSmImport().CreatePaddedContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MPHANTOM:
- pContext = GetSmImport().CreatePhantomContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MFENCED:
- pContext = GetSmImport().CreateFencedContext(nPrefix,rLocalName,
- xAttrList);
- break;
- /*Script and Limit Schemata*/
- case XML_TOK_MSUB:
- pContext = GetSmImport().CreateSubContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MSUP:
- pContext = GetSmImport().CreateSupContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MSUBSUP:
- pContext = GetSmImport().CreateSubSupContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MUNDER:
- pContext = GetSmImport().CreateUnderContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MOVER:
- pContext = GetSmImport().CreateOverContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MUNDEROVER:
- pContext = GetSmImport().CreateUnderOverContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MMULTISCRIPTS:
- pContext = GetSmImport().CreateMultiScriptsContext(nPrefix,
- rLocalName, xAttrList);
- break;
- case XML_TOK_MTABLE:
- pContext = GetSmImport().CreateTableContext(nPrefix,
- rLocalName, xAttrList);
- break;
- case XML_TOK_MACTION:
- pContext = GetSmImport().CreateActionContext(nPrefix,
- rLocalName, xAttrList);
- break;
- default:
- /*Basically theres an implicit mrow around certain bare
- *elements, use a RowContext to see if this is one of
- *those ones*/
- SmXMLRowContext_Impl aTempContext(GetSmImport(),nPrefix,
- GetXMLToken(XML_MROW));
-
- pContext = aTempContext.StrictCreateChildContext(nPrefix,
- rLocalName, xAttrList);
- break;
- }
- return pContext;
-}
-
-void SmXMLDocContext_Impl::EndElement()
-{
- SmNodeArray ContextArray;
- ContextArray.resize(1);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
-
- for (ULONG i=0;i< 1;i++)
- ContextArray[i] = rNodeStack.Pop();
-
- SmToken aDummy;
- SmStructureNode *pSNode = new SmLineNode(aDummy);
- pSNode->SetSubNodes(ContextArray);
- rNodeStack.Push(pSNode);
-
- SmNodeArray LineArray;
- ULONG n = rNodeStack.Count();
- LineArray.resize(n);
- for (ULONG j = 0; j < n; j++)
- LineArray[n - (j + 1)] = rNodeStack.Pop();
- SmStructureNode *pSNode2 = new SmTableNode(aDummy);
- pSNode2->SetSubNodes(LineArray);
- rNodeStack.Push(pSNode2);
-}
-
-void SmXMLFracContext_Impl::EndElement()
-{
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = TOVER;
- SmStructureNode *pSNode = new SmBinVerNode(aToken);
- SmNode *pOper = new SmRectangleNode(aToken);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- DBG_ASSERT(rNodeStack.Count() - nElementCount == 2,
- "Fraction (mfrac) tag is missing component");
- if (rNodeStack.Count() - nElementCount == 2)
- {
- SmNode *pSecond = rNodeStack.Pop();
- SmNode *pFirst = rNodeStack.Pop();
- pSNode->SetSubNodes(pFirst,pOper,pSecond);
- rNodeStack.Push(pSNode);
- }
-}
-
-void SmXMLRootContext_Impl::EndElement()
-{
- /*The <mroot> element requires exactly 2 arguments.*/
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
- "Root tag is missing component");
-
- SmToken aToken;
- aToken.cMathChar = MS_SQRT; //Temporary: alert, based on StarSymbol font
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = TNROOT;
- SmStructureNode *pSNode = new SmRootNode(aToken);
- SmNode *pOper = new SmRootSymbolNode(aToken);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- SmNode *pIndex = rNodeStack.Pop();
- SmNode *pBase = rNodeStack.Pop();
- pSNode->SetSubNodes(pIndex,pOper,pBase);
- rNodeStack.Push(pSNode);
-}
-
-void SmXMLSqrtContext_Impl::EndElement()
-{
- /*
- <msqrt> accepts any number of arguments; if this number is not 1, its
- contents are treated as a single "inferred <mrow>" containing its
- arguments
- */
- if (GetSmImport().GetNodeStack().Count() - nElementCount > 1)
- SmXMLRowContext_Impl::EndElement();
-
- SmToken aToken;
- aToken.cMathChar = MS_SQRT; //Temporary: alert, based on StarSymbol font
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = TSQRT;
- SmStructureNode *pSNode = new SmRootNode(aToken);
- SmNode *pOper = new SmRootSymbolNode(aToken);
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- pSNode->SetSubNodes(0,pOper,rNodeStack.Pop());
- rNodeStack.Push(pSNode);
-}
-
-void SmXMLRowContext_Impl::EndElement()
-{
- SmNodeArray aRelationArray;
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- ULONG nSize = rNodeStack.Count()-nElementCount;
-
- if (nSize > 0)
- {
- aRelationArray.resize(nSize);
- for (ULONG j=rNodeStack.Count()-nElementCount;j > 0;j--)
- aRelationArray[j-1] = rNodeStack.Pop();
-
-
- //If the first or last element is an operator with stretchyness
- //set then we must create a brace node here from those elements,
- //removing the stretchness from the operators and applying it to
- //ourselves, and creating the appropiate dummy StarMath none bracket
- //to balance the arrangement
- if (((aRelationArray[0]->GetScaleMode() == SCALE_HEIGHT)
- && (aRelationArray[0]->GetType() == NMATH))
- || ((aRelationArray[nSize-1]->GetScaleMode() == SCALE_HEIGHT)
- && (aRelationArray[nSize-1]->GetType() == NMATH)))
- {
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
-
- int nLeft=0,nRight=0;
- if ((aRelationArray[0]->GetScaleMode() == SCALE_HEIGHT)
- && (aRelationArray[0]->GetType() == NMATH))
- {
- aToken = aRelationArray[0]->GetToken();
- nLeft=1;
- }
- else
- aToken.cMathChar = '\0';
-
- aToken.eType = TLPARENT;
- SmNode *pLeft = new SmMathSymbolNode(aToken);
-
- if ((aRelationArray[nSize-1]->GetScaleMode() == SCALE_HEIGHT)
- && (aRelationArray[nSize-1]->GetType() == NMATH))
- {
- aToken = aRelationArray[nSize-1]->GetToken();
- nRight=1;
- }
- else
- aToken.cMathChar = '\0';
-
- aToken.eType = TRPARENT;
- SmNode *pRight = new SmMathSymbolNode(aToken);
-
- SmNodeArray aRelationArray2;
-
- //!! nSize-nLeft-nRight may be < 0 !!
- int nRelArrSize = nSize-nLeft-nRight;
- if (nRelArrSize > 0)
- {
- aRelationArray2.resize(nRelArrSize);
- for (int i=0;i < nRelArrSize;i++)
- aRelationArray2[i] = aRelationArray[i+nLeft];
- }
-
- SmToken aDummy;
- SmStructureNode *pSNode = new SmBraceNode(aToken);
- SmStructureNode *pBody = new SmExpressionNode(aDummy);
- pBody->SetSubNodes(aRelationArray2);
-
- pSNode->SetSubNodes(pLeft,pBody,pRight);
- pSNode->SetScaleMode(SCALE_HEIGHT);
- rNodeStack.Push(pSNode);
- return;
- }
- }
- else //Multiple newlines result in empty row elements
- {
- aRelationArray.resize(1);
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 5;
- aToken.eType = TNEWLINE;
- aRelationArray[0] = new SmLineNode(aToken);
- }
-
- SmToken aDummy;
- SmStructureNode *pSNode = new SmExpressionNode(aDummy);
- pSNode->SetSubNodes(aRelationArray);
- rNodeStack.Push(pSNode);
-}
-
-
-SvXMLImportContext *SmXMLRowContext_Impl::StrictCreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = 0L;
-
- const SvXMLTokenMap& rTokenMap = GetSmImport().GetPresElemTokenMap();
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- /*Note that these should accept malignmark subelements, but do not*/
- case XML_TOK_MN:
- pContext = GetSmImport().CreateNumberContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MI:
- pContext = GetSmImport().CreateIdentifierContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MO:
- pContext = GetSmImport().CreateOperatorContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MTEXT:
- pContext = GetSmImport().CreateTextContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MSPACE:
- pContext = GetSmImport().CreateSpaceContext(nPrefix,rLocalName,
- xAttrList);
- break;
- case XML_TOK_MS:
- pContext = GetSmImport().CreateStringContext(nPrefix,rLocalName,
- xAttrList);
- break;
-
- /*Note: The maligngroup should only be seen when the row
- * (or decendants) are in a table*/
- case XML_TOK_MALIGNGROUP:
- pContext = GetSmImport().CreateAlignGroupContext(nPrefix,rLocalName,
- xAttrList);
- break;
-
- case XML_TOK_ANNOTATION:
- pContext = GetSmImport().CreateAnnotationContext(nPrefix,rLocalName,
- xAttrList);
- break;
-
- default:
- break;
- }
- return pContext;
-}
-
-
-SvXMLImportContext *SmXMLRowContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = StrictCreateChildContext(nPrefix,
- rLocalName, xAttrList);
-
- if (!pContext)
- {
- //Hmm, unrecognized for this level, check to see if its
- //an element that can have an implicit schema around it
- pContext = SmXMLDocContext_Impl::CreateChildContext(nPrefix,
- rLocalName,xAttrList);
- }
- return pContext;
-}
-
-
-SvXMLImportContext *SmXMLMultiScriptsContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = 0L;
-
- const SvXMLTokenMap& rTokenMap = GetSmImport().
- GetPresScriptEmptyElemTokenMap();
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_MPRESCRIPTS:
- MiddleElement();
- pContext = GetSmImport().CreatePrescriptsContext(nPrefix,
- rLocalName, xAttrList);
- break;
- case XML_TOK_NONE:
- pContext = GetSmImport().CreateNoneContext(nPrefix,rLocalName,
- xAttrList);
- break;
- default:
- pContext = SmXMLRowContext_Impl::CreateChildContext(nPrefix,
- rLocalName,xAttrList);
- break;
- }
- return pContext;
-}
-
-void SmXMLMultiScriptsContext_Impl::MiddleElement()
-{
- bHasPrescripts=sal_True;
-
- DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount > 0,
- "Sub has no arguments");
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- if (rNodeStack.Count()-nElementCount > 1)
- {
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = TRSUB;
- ULONG nFinalCount = rNodeStack.Count()-nElementCount-1;
-
- SmNodeStack aReverseStack;
- while (rNodeStack.Count()-nElementCount)
- {
- SmNode *pThing = rNodeStack.Pop();
- aReverseStack.Push(pThing);
- }
-
- for (ULONG nCount=0;nCount < nFinalCount;nCount+=2)
- {
- SmSubSupNode *pNode = new SmSubSupNode(aToken);
-
- // initialize subnodes array
- SmNodeArray aSubNodes;
- aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES);
- for (ULONG i = 1; i < aSubNodes.size(); i++)
- aSubNodes[i] = NULL;
-
- /*On each loop the base and its sub sup pair becomes the
- base for the next loop to which the next sub sup pair is
- attached, i.e. wheels within wheels*/
- //if (nCount == 0)
- aSubNodes[0] = aReverseStack.Pop();
-
- SmNode *pScriptNode = aReverseStack.Pop();
-
- if (pScriptNode && ((pScriptNode->GetToken().eType != TIDENT) ||
- (pScriptNode->GetToken().aText.Len())))
- aSubNodes[RSUB+1] = pScriptNode;
- pScriptNode = aReverseStack.Pop();
- if (pScriptNode && ((pScriptNode->GetToken().eType != TIDENT) ||
- (pScriptNode->GetToken().aText.Len())))
- aSubNodes[RSUP+1] = pScriptNode;
-
- pNode->SetSubNodes(aSubNodes);
- aReverseStack.Push(pNode);
- }
- rNodeStack.Push(aReverseStack.Pop());
- }
-}
-
-
-void SmXMLTableContext_Impl::EndElement()
-{
- SmNodeArray aExpressionArray;
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- SmNodeStack aReverseStack;
- aExpressionArray.resize(rNodeStack.Count()-nElementCount);
-
- ULONG nRows = rNodeStack.Count()-nElementCount;
- USHORT nCols = 0;
-
- SmStructureNode *pArray;
- for (ULONG i=rNodeStack.Count()-nElementCount;i > 0;i--)
- {
- pArray = (SmStructureNode *)rNodeStack.Pop();
- if (pArray->GetNumSubNodes() == 0)
- {
- //This is a little tricky, it is possible that there was
- //be elements that were not inside a <mtd> pair, in which
- //case they will not be in a row, i.e. they will not have
- //SubNodes, so we have to wait until here before we can
- //resolve the situation. Implicitsurrounding tags are
- //surprisingly difficult to get right within this
- //architecture
-
- SmNodeArray aRelationArray;
- aRelationArray.resize(1);
- aRelationArray[0] = pArray;
- SmToken aDummy;
- pArray = new SmExpressionNode(aDummy);
- pArray->SetSubNodes(aRelationArray);
- }
-
- if (pArray->GetNumSubNodes() > nCols)
- nCols = pArray->GetNumSubNodes();
- aReverseStack.Push(pArray);
- }
- aExpressionArray.resize(nCols*nRows);
- ULONG j=0;
- while (aReverseStack.Count())
- {
- pArray = (SmStructureNode *)aReverseStack.Pop();
- for (USHORT i=0;i<pArray->GetNumSubNodes();i++)
- aExpressionArray[j++] = pArray->GetSubNode(i);
- }
-
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = TRGROUP;
- aToken.nLevel = 0;
- aToken.eType = TMATRIX;
- SmMatrixNode *pSNode = new SmMatrixNode(aToken);
- pSNode->SetSubNodes(aExpressionArray);
- pSNode->SetRowCol(static_cast<USHORT>(nRows),nCols);
- rNodeStack.Push(pSNode);
-}
-
-SvXMLImportContext *SmXMLTableRowContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = 0L;
-
- const SvXMLTokenMap& rTokenMap = GetSmImport().
- GetPresTableElemTokenMap();
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_MTD:
- pContext = GetSmImport().CreateTableCellContext(nPrefix,
- rLocalName, xAttrList);
- break;
- default:
- pContext = SmXMLRowContext_Impl::CreateChildContext(nPrefix,
- rLocalName,xAttrList);
- break;
- }
- return pContext;
-}
-
-SvXMLImportContext *SmXMLTableContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContext* pContext = 0L;
-
- const SvXMLTokenMap& rTokenMap = GetSmImport().
- GetPresTableElemTokenMap();
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_MTR:
- pContext = GetSmImport().CreateTableRowContext(nPrefix,rLocalName,
- xAttrList);
- break;
- default:
- pContext = SmXMLTableRowContext_Impl::CreateChildContext(nPrefix,
- rLocalName,xAttrList);
- break;
- }
- return pContext;
-}
-
-void SmXMLMultiScriptsContext_Impl::EndElement()
-{
- if (!bHasPrescripts)
- MiddleElement();
-
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- if (rNodeStack.Count()-nElementCount > 1)
- {
- SmToken aToken;
- aToken.cMathChar = '\0';
- aToken.nGroup = 0;
- aToken.nLevel = 0;
- aToken.eType = TLSUB;
- ULONG nFinalCount = rNodeStack.Count()-nElementCount-1;
-
- SmNodeStack aReverseStack;
- while (rNodeStack.Count()-nElementCount)
- aReverseStack.Push(rNodeStack.Pop());
- for (ULONG nCount=0;nCount < nFinalCount;nCount+=2)
- {
- SmSubSupNode *pNode = new SmSubSupNode(aToken);
-
- // initialize subnodes array
- SmNodeArray aSubNodes;
- aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES);
- for (ULONG i = 1; i < aSubNodes.size(); i++)
- aSubNodes[i] = NULL;
-
- /*On each loop the base and its sub sup pair becomes the
- base for the next loop to which the next sub sup pair is
- attached, i.e. wheels within wheels*/
- //if (nCount == 0)
- aSubNodes[0] = aReverseStack.Pop();
-
- SmNode *pScriptNode = aReverseStack.Pop();
- if (pScriptNode->GetToken().aText.Len())
- aSubNodes[LSUB+1] = pScriptNode;
- pScriptNode = aReverseStack.Pop();
- if (pScriptNode->GetToken().aText.Len())
- aSubNodes[LSUP+1] = pScriptNode;
-
- pNode->SetSubNodes(aSubNodes);
- aReverseStack.Push(pNode);
- }
- rNodeStack.Push(aReverseStack.Pop());
- }
-
-}
-void SmXMLActionContext_Impl::EndElement()
-{
- /*For now we will just assume that the
- selected attribute is one, and then just display
- that expression alone, i.e. remove all expect the
- first pushed one*/
-
- SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- for (ULONG i=rNodeStack.Count()-nElementCount;i > 1;i--)
- {
- delete rNodeStack.Pop();
- }
-}
-
-SvXMLImportContext *SmXMLImport::CreateContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- if ( XML_NAMESPACE_OFFICE == nPrefix )
- {
- if ( (IsXMLToken(rLocalName, XML_DOCUMENT) ||
- IsXMLToken(rLocalName, XML_DOCUMENT_META)))
- {
- uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
- mxServiceFactory->createInstance(
- ::rtl::OUString::createFromAscii(
- "com.sun.star.xml.dom.SAXDocumentBuilder")),
- uno::UNO_QUERY_THROW);
- uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
- GetModel(), uno::UNO_QUERY_THROW);
- return IsXMLToken(rLocalName, XML_DOCUMENT_META)
- ? new SvXMLMetaDocumentContext(*this,
- XML_NAMESPACE_OFFICE, rLocalName,
- xDPS->getDocumentProperties(), xDocBuilder)
- // flat OpenDocument file format -- this has not been tested...
- : new SmXMLFlatDocContext_Impl( *this, nPrefix, rLocalName,
- xDPS->getDocumentProperties(), xDocBuilder);
- }
- else
- {
- return new SmXMLOfficeContext_Impl( *this,nPrefix,rLocalName);
- }
- }
- else
- return new SmXMLDocContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateRowContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLRowContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateTextContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLTextContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateAnnotationContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLAnnotationContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateStringContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLStringContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateNumberContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLNumberContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateIdentifierContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLIdentifierContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateOperatorContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLOperatorContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateSpaceContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLSpaceContext_Impl(*this,nPrefix,rLocalName);
-}
-
-
-SvXMLImportContext *SmXMLImport::CreateFracContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLFracContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateSqrtContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLSqrtContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateRootContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLRootContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateStyleContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLStyleContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreatePaddedContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLPaddedContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreatePhantomContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLPhantomContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateFencedContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLFencedContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateErrorContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLErrorContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateSubContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLSubContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateSubSupContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLSubSupContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateSupContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLSupContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateUnderContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLUnderContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateOverContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLOverContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateUnderOverContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLUnderOverContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateMultiScriptsContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLMultiScriptsContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateTableContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLTableContext_Impl(*this,nPrefix,rLocalName);
-}
-SvXMLImportContext *SmXMLImport::CreateTableRowContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLTableRowContext_Impl(*this,nPrefix,rLocalName);
-}
-SvXMLImportContext *SmXMLImport::CreateTableCellContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLTableCellContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateNoneContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLNoneContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreatePrescriptsContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLPrescriptsContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateAlignGroupContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLAlignGroupContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SvXMLImportContext *SmXMLImport::CreateActionContext(sal_uInt16 nPrefix,
- const OUString &rLocalName,
- const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
-{
- return new SmXMLActionContext_Impl(*this,nPrefix,rLocalName);
-}
-
-SmXMLImport::~SmXMLImport() throw ()
-{
- delete pPresLayoutElemTokenMap;
- delete pPresElemTokenMap;
- delete pPresScriptEmptyElemTokenMap;
- delete pPresTableElemTokenMap;
- delete pPresLayoutAttrTokenMap;
- delete pFencedAttrTokenMap;
- delete pColorTokenMap;
- delete pOperatorAttrTokenMap;
- delete pAnnotationAttrTokenMap;
-}
-
-void SmXMLImport::SetViewSettings(const Sequence<PropertyValue>& aViewProps)
-{
- uno::Reference <frame::XModel> xModel = GetModel();
- if ( !xModel.is() )
- return;
-
- uno::Reference <lang::XUnoTunnel> xTunnel;
- xTunnel = uno::Reference <lang::XUnoTunnel> (xModel,uno::UNO_QUERY);
- SmModel *pModel = reinterpret_cast<SmModel *>
- (xTunnel->getSomething(SmModel::getUnoTunnelId()));
-
- if ( !pModel )
- return;
-
- SmDocShell *pDocShell =
- static_cast<SmDocShell*>(pModel->GetObjectShell());
- if ( !pDocShell )
- return;
-
- Rectangle aRect( pDocShell->GetVisArea() );
-
- sal_Int32 nCount = aViewProps.getLength();
- const PropertyValue *pValue = aViewProps.getConstArray();
-
- long nTmp = 0;
- //sal_Bool bShowDeletes = sal_False, bShowInserts = sal_False, bShowFooter = sal_False, bShowHeader = sal_False;
-
- for (sal_Int32 i = 0; i < nCount ; i++)
- {
- if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaTop" ) ) )
- {
- pValue->Value >>= nTmp;
- aRect.setY( nTmp );
- }
- else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaLeft" ) ) )
- {
- pValue->Value >>= nTmp;
- aRect.setX( nTmp );
- }
- else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaWidth" ) ) )
- {
- pValue->Value >>= nTmp;
- Size aSize( aRect.GetSize() );
- aSize.Width() = nTmp;
- aRect.SetSize( aSize );
- }
- else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaHeight" ) ) )
- {
- pValue->Value >>= nTmp;
- Size aSize( aRect.GetSize() );
- aSize.Height() = nTmp;
- aRect.SetSize( aSize );
- }
- pValue++;
- }
-
- pDocShell->SetVisArea ( aRect );
-}
-
-void SmXMLImport::SetConfigurationSettings(const Sequence<PropertyValue>& aConfProps)
-{
- uno::Reference < XPropertySet > xProps ( GetModel(), UNO_QUERY );
- if ( xProps.is() )
- {
- Reference < XPropertySetInfo > xInfo ( xProps->getPropertySetInfo() );
- if (xInfo.is() )
- {
- sal_Int32 nCount = aConfProps.getLength();
- const PropertyValue* pValues = aConfProps.getConstArray();
-
- const OUString sFormula ( RTL_CONSTASCII_USTRINGPARAM ( "Formula" ) );
- const OUString sBasicLibraries ( RTL_CONSTASCII_USTRINGPARAM ( "BasicLibraries" ) );
- const OUString sDialogLibraries ( RTL_CONSTASCII_USTRINGPARAM ( "DialogLibraries" ) );
- while ( nCount-- )
- {
- if (pValues->Name != sFormula &&
- pValues->Name != sBasicLibraries &&
- pValues->Name != sDialogLibraries)
- {
- try
- {
- if ( xInfo->hasPropertyByName( pValues->Name ) )
- xProps->setPropertyValue( pValues->Name, pValues->Value );
- }
- catch( Exception& )
- {
- DBG_ERROR( "SmXMLImport::SetConfigurationSettings: Exception!" );
- }
- }
-
- pValues++;
- }
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////
-
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: x $
+ * $Revision: 1.00 $
+ *
+ * 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_starmath.hxx"
+
+/*todo: Change characters and tcharacters to accumulate the characters together
+into one string, xml parser hands them to us line by line rather than all in
+one go*/
+
+#include <com/sun/star/xml/sax/XErrorHandler.hpp>
+#include <com/sun/star/xml/sax/XEntityResolver.hpp>
+#include <com/sun/star/xml/sax/InputSource.hpp>
+#include <com/sun/star/xml/sax/XDTDHandler.hpp>
+#include <com/sun/star/xml/sax/XParser.hpp>
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#include <com/sun/star/io/XActiveDataControl.hpp>
+#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/packages/zip/ZipIOException.hpp>
+#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/uno/Any.h>
+
+#include <rtl/math.hxx>
+#include <sfx2/frame.hxx>
+#include <sfx2/docfile.hxx>
+#include <tools/debug.hxx>
+#include <tools/urlobj.hxx>
+#include <svtools/sfxecode.hxx>
+#include <unotools/saveopt.hxx>
+#include <svl/stritem.hxx>
+#include <svl/itemprop.hxx>
+#include <unotools/processfactory.hxx>
+#include <unotools/streamwrap.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/nmspmap.hxx>
+#include <xmloff/attrlist.hxx>
+#include <xmloff/xmluconv.hxx>
+#include <xmloff/xmlmetai.hxx>
+#include <osl/mutex.hxx>
+#include <comphelper/genericpropertyset.hxx>
+
+#include <memory>
+
+#include "mathmlimport.hxx"
+#include "mathtype.hxx"
+#include <starmath.hrc>
+#include <unomodel.hxx>
+#include <document.hxx>
+#include <utility.hxx>
+
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star;
+using namespace ::xmloff::token;
+
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
+#define IMPORT_SVC_NAME RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.XMLImportFilter")
+
+#undef WANTEXCEPT
+
+////////////////////////////////////////////////////////////
+
+ULONG SmXMLImportWrapper::Import(SfxMedium &rMedium)
+{
+ ULONG nError = ERRCODE_SFX_DOLOADFAILED;
+
+ uno::Reference<lang::XMultiServiceFactory> xServiceFactory(
+ utl::getProcessServiceFactory());
+ DBG_ASSERT(xServiceFactory.is(), "XMLReader::Read: got no service manager");
+ if ( !xServiceFactory.is() )
+ return nError;
+
+ //Make a model component from our SmModel
+ uno::Reference< lang::XComponent > xModelComp( xModel, uno::UNO_QUERY );
+ DBG_ASSERT( xModelComp.is(), "XMLReader::Read: got no model" );
+
+ // try to get an XStatusIndicator from the Medium
+ uno::Reference<task::XStatusIndicator> xStatusIndicator;
+
+ sal_Bool bEmbedded = sal_False;
+ uno::Reference <lang::XUnoTunnel> xTunnel;
+ xTunnel = uno::Reference <lang::XUnoTunnel> (xModel,uno::UNO_QUERY);
+ SmModel *pModel = reinterpret_cast<SmModel *>
+ (xTunnel->getSomething(SmModel::getUnoTunnelId()));
+
+ SmDocShell *pDocShell = pModel ?
+ static_cast<SmDocShell*>(pModel->GetObjectShell()) : 0;
+ if (pDocShell)
+ {
+// if (pDocShell->GetMedium())
+ {
+ DBG_ASSERT( pDocShell->GetMedium() == &rMedium,
+ "different SfxMedium found" );
+
+ SfxItemSet* pSet = rMedium.GetItemSet();
+ if (pSet)
+ {
+ const SfxUnoAnyItem* pItem = static_cast<const SfxUnoAnyItem*>(
+ pSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) );
+ if (pItem)
+ pItem->GetValue() >>= xStatusIndicator;
+ }
+ }
+
+ if ( SFX_CREATE_MODE_EMBEDDED == pDocShell->GetCreateMode() )
+ bEmbedded = sal_True;
+ }
+
+ comphelper::PropertyMapEntry aInfoMap[] =
+ {
+ { "PrivateData", sizeof("PrivateData")-1, 0,
+ &::getCppuType( (Reference<XInterface> *)0 ),
+ beans::PropertyAttribute::MAYBEVOID, 0 },
+ { "BaseURI", sizeof("BaseURI")-1, 0,
+ &::getCppuType( (OUString *)0 ),
+ beans::PropertyAttribute::MAYBEVOID, 0 },
+ { "StreamRelPath", sizeof("StreamRelPath")-1, 0,
+ &::getCppuType( (OUString *)0 ),
+ beans::PropertyAttribute::MAYBEVOID, 0 },
+ { "StreamName", sizeof("StreamName")-1, 0,
+ &::getCppuType( (OUString *)0 ),
+ beans::PropertyAttribute::MAYBEVOID, 0 },
+ { NULL, 0, 0, NULL, 0, 0 }
+ };
+ uno::Reference< beans::XPropertySet > xInfoSet(
+ comphelper::GenericPropertySet_CreateInstance(
+ new comphelper::PropertySetInfo( aInfoMap ) ) );
+
+ // Set base URI
+ OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BaseURI") );
+ xInfoSet->setPropertyValue( sPropName, makeAny( rMedium.GetBaseURL() ) );
+
+ sal_Int32 nSteps=3;
+ if ( !(rMedium.IsStorage()))
+ nSteps = 1;
+
+ sal_Int32 nProgressRange(nSteps);
+ if (xStatusIndicator.is())
+ {
+ xStatusIndicator->start(String(SmResId(STR_STATSTR_READING)),
+ nProgressRange);
+ }
+
+ nSteps=0;
+ if (xStatusIndicator.is())
+ xStatusIndicator->setValue(nSteps++);
+
+ if ( rMedium.IsStorage())
+ {
+ // TODO/LATER: handle the case of embedded links gracefully
+ if ( bEmbedded ) // && !rMedium.GetStorage()->IsRoot() )
+ {
+ OUString aName( RTL_CONSTASCII_USTRINGPARAM( "dummyObjName" ) );
+ if ( rMedium.GetItemSet() )
+ {
+ const SfxStringItem* pDocHierarchItem = static_cast<const SfxStringItem*>(
+ rMedium.GetItemSet()->GetItem(SID_DOC_HIERARCHICALNAME) );
+ if ( pDocHierarchItem )
+ aName = pDocHierarchItem->GetValue();
+ }
+
+ if ( aName.getLength() )
+ {
+ sPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath"));
+ xInfoSet->setPropertyValue( sPropName, makeAny( aName ) );
+ }
+ }
+
+ sal_Bool bOASIS = ( SotStorage::GetVersion( rMedium.GetStorage() ) > SOFFICE_FILEFORMAT_60 );
+ if (xStatusIndicator.is())
+ xStatusIndicator->setValue(nSteps++);
+
+ ULONG nWarn = ReadThroughComponent(
+ rMedium.GetStorage(), xModelComp, "meta.xml", "Meta.xml",
+ xServiceFactory, xInfoSet,
+ (bOASIS ? "com.sun.star.comp.Math.XMLOasisMetaImporter"
+ : "com.sun.star.comp.Math.XMLMetaImporter") );
+
+ if ( nWarn != ERRCODE_IO_BROKENPACKAGE )
+ {
+ if (xStatusIndicator.is())
+ xStatusIndicator->setValue(nSteps++);
+
+ nWarn = ReadThroughComponent(
+ rMedium.GetStorage(), xModelComp, "settings.xml", 0,
+ xServiceFactory, xInfoSet,
+ (bOASIS ? "com.sun.star.comp.Math.XMLOasisSettingsImporter"
+ : "com.sun.star.comp.Math.XMLSettingsImporter" ) );
+
+ if ( nWarn != ERRCODE_IO_BROKENPACKAGE )
+ {
+ if (xStatusIndicator.is())
+ xStatusIndicator->setValue(nSteps++);
+
+ nError = ReadThroughComponent(
+ rMedium.GetStorage(), xModelComp, "content.xml", "Content.xml",
+ xServiceFactory, xInfoSet, "com.sun.star.comp.Math.XMLImporter" );
+ }
+ else
+ nError = ERRCODE_IO_BROKENPACKAGE;
+ }
+ else
+ nError = ERRCODE_IO_BROKENPACKAGE;
+ }
+ else
+ {
+ Reference<io::XInputStream> xInputStream =
+ new utl::OInputStreamWrapper(rMedium.GetInStream());
+
+ if (xStatusIndicator.is())
+ xStatusIndicator->setValue(nSteps++);
+
+ nError = ReadThroughComponent( xInputStream, xModelComp,
+ xServiceFactory, xInfoSet, "com.sun.star.comp.Math.XMLImporter", FALSE );
+ }
+
+ if (xStatusIndicator.is())
+ xStatusIndicator->end();
+ return nError;
+}
+
+
+/// read a component (file + filter version)
+ULONG SmXMLImportWrapper::ReadThroughComponent(
+ Reference<io::XInputStream> xInputStream,
+ Reference<XComponent> xModelComponent,
+ Reference<lang::XMultiServiceFactory> & rFactory,
+ Reference<beans::XPropertySet> & rPropSet,
+ const sal_Char* pFilterName,
+ sal_Bool bEncrypted )
+{
+ ULONG nError = ERRCODE_SFX_DOLOADFAILED;
+ DBG_ASSERT(xInputStream.is(), "input stream missing");
+ DBG_ASSERT(xModelComponent.is(), "document missing");
+ DBG_ASSERT(rFactory.is(), "factory missing");
+ DBG_ASSERT(NULL != pFilterName,"I need a service name for the component!");
+
+ // prepare ParserInputSrouce
+ xml::sax::InputSource aParserInput;
+ aParserInput.aInputStream = xInputStream;
+
+ // get parser
+ Reference< xml::sax::XParser > xParser(
+ rFactory->createInstance(
+ OUString::createFromAscii("com.sun.star.xml.sax.Parser") ),
+ UNO_QUERY );
+ DBG_ASSERT( xParser.is(), "Can't create parser" );
+ if ( !xParser.is() )
+ return nError;
+
+ Sequence<Any> aArgs( 1 );
+ aArgs[0] <<= rPropSet;
+
+ // get filter
+ Reference< xml::sax::XDocumentHandler > xFilter(
+ rFactory->createInstanceWithArguments(
+ OUString::createFromAscii(pFilterName), aArgs ),
+ UNO_QUERY );
+ DBG_ASSERT( xFilter.is(), "Can't instantiate filter component." );
+ if ( !xFilter.is() )
+ return nError;
+
+ // connect parser and filter
+ xParser->setDocumentHandler( xFilter );
+
+ // connect model and filter
+ Reference < XImporter > xImporter( xFilter, UNO_QUERY );
+ xImporter->setTargetDocument( xModelComponent );
+
+ // finally, parser the stream
+ try
+ {
+ xParser->parseStream( aParserInput );
+
+ uno::Reference<lang::XUnoTunnel> xFilterTunnel;
+ xFilterTunnel = uno::Reference<lang::XUnoTunnel>
+ ( xFilter, uno::UNO_QUERY );
+ SmXMLImport *pFilter = reinterpret_cast< SmXMLImport * >(
+ sal::static_int_cast< sal_uIntPtr >(
+ xFilterTunnel->getSomething( SmXMLImport::getUnoTunnelId() )));
+ if ( pFilter && pFilter->GetSuccess() )
+ nError = 0;
+ }
+ catch( xml::sax::SAXParseException& r )
+ {
+ // sax parser sends wrapped exceptions,
+ // try to find the original one
+ xml::sax::SAXException aSaxEx = *(xml::sax::SAXException*)(&r);
+ sal_Bool bTryChild = sal_True;
+
+ while( bTryChild )
+ {
+ xml::sax::SAXException aTmp;
+ if ( aSaxEx.WrappedException >>= aTmp )
+ aSaxEx = aTmp;
+ else
+ bTryChild = sal_False;
+ }
+
+ packages::zip::ZipIOException aBrokenPackage;
+ if ( aSaxEx.WrappedException >>= aBrokenPackage )
+ return ERRCODE_IO_BROKENPACKAGE;
+
+ if ( bEncrypted )
+ nError = ERRCODE_SFX_WRONGPASSWORD;
+ }
+ catch( xml::sax::SAXException& r )
+ {
+ packages::zip::ZipIOException aBrokenPackage;
+ if ( r.WrappedException >>= aBrokenPackage )
+ return ERRCODE_IO_BROKENPACKAGE;
+
+ if ( bEncrypted )
+ nError = ERRCODE_SFX_WRONGPASSWORD;
+ }
+ catch( packages::zip::ZipIOException& )
+ {
+ nError = ERRCODE_IO_BROKENPACKAGE;
+ }
+ catch( io::IOException& )
+ {
+ }
+
+ return nError;
+}
+
+
+ULONG SmXMLImportWrapper::ReadThroughComponent(
+ const uno::Reference< embed::XStorage >& xStorage,
+ Reference<XComponent> xModelComponent,
+ const sal_Char* pStreamName,
+ const sal_Char* pCompatibilityStreamName,
+ Reference<lang::XMultiServiceFactory> & rFactory,
+ Reference<beans::XPropertySet> & rPropSet,
+ const sal_Char* pFilterName )
+{
+ DBG_ASSERT(xStorage.is(), "Need storage!");
+ DBG_ASSERT(NULL != pStreamName, "Please, please, give me a name!");
+
+ // open stream (and set parser input)
+ OUString sStreamName = OUString::createFromAscii(pStreamName);
+ uno::Reference < container::XNameAccess > xAccess( xStorage, uno::UNO_QUERY );
+ if ( !xAccess->hasByName(sStreamName) || !xStorage->isStreamElement(sStreamName) )
+ {
+ // stream name not found! Then try the compatibility name.
+ // do we even have an alternative name?
+ if ( pCompatibilityStreamName )
+ sStreamName = OUString::createFromAscii(pCompatibilityStreamName);
+ }
+
+ // get input stream
+ try
+ {
+ uno::Reference < io::XStream > xEventsStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ );
+
+ // determine if stream is encrypted or not
+ uno::Reference < beans::XPropertySet > xProps( xEventsStream, uno::UNO_QUERY );
+ Any aAny = xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Encrypted") ) );
+ sal_Bool bEncrypted = sal_False;
+ if ( aAny.getValueType() == ::getBooleanCppuType() )
+ aAny >>= bEncrypted;
+
+ // set Base URL
+ if ( rPropSet.is() )
+ {
+ OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") );
+ rPropSet->setPropertyValue( sPropName, makeAny( sStreamName ) );
+ }
+
+
+ Reference < io::XInputStream > xStream = xEventsStream->getInputStream();
+ return ReadThroughComponent( xStream, xModelComponent, rFactory, rPropSet, pFilterName, bEncrypted );
+ }
+ catch ( packages::WrongPasswordException& )
+ {
+ return ERRCODE_SFX_WRONGPASSWORD;
+ }
+ catch( packages::zip::ZipIOException& )
+ {
+ return ERRCODE_IO_BROKENPACKAGE;
+ }
+ catch ( uno::Exception& )
+ {
+ }
+
+ return ERRCODE_SFX_DOLOADFAILED;
+}
+
+////////////////////////////////////////////////////////////
+
+SmXMLImport::SmXMLImport(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
+ sal_uInt16 nImportFlags)
+: SvXMLImport( xServiceFactory, nImportFlags ),
+ pPresLayoutElemTokenMap(0),
+ pPresLayoutAttrTokenMap(0),
+ pFencedAttrTokenMap(0),
+ pOperatorAttrTokenMap(0),
+ pAnnotationAttrTokenMap(0),
+ pPresElemTokenMap(0),
+ pPresScriptEmptyElemTokenMap(0),
+ pPresTableElemTokenMap(0),
+ pColorTokenMap(0),
+ bSuccess(sal_False)
+{
+}
+
+const uno::Sequence< sal_Int8 > & SmXMLImport::getUnoTunnelId() throw()
+{
+ static uno::Sequence< sal_Int8 > * pSeq = 0;
+ if ( !pSeq )
+ {
+ osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
+ if ( !pSeq )
+ {
+ static uno::Sequence< sal_Int8 > aSeq( 16 );
+ rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
+ pSeq = &aSeq;
+ }
+ }
+ return *pSeq;
+}
+
+OUString SAL_CALL SmXMLImport_getImplementationName() throw()
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Math.XMLImporter" ) );
+}
+
+uno::Sequence< OUString > SAL_CALL SmXMLImport_getSupportedServiceNames()
+ throw()
+{
+ const OUString aServiceName( IMPORT_SVC_NAME );
+ const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+}
+
+uno::Reference< uno::XInterface > SAL_CALL SmXMLImport_createInstance(
+ const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
+ throw( uno::Exception )
+{
+ // #110680#
+ // return (cppu::OWeakObject*)new SmXMLImport(IMPORT_ALL);
+ return (cppu::OWeakObject*)new SmXMLImport(rSMgr, IMPORT_ALL);
+}
+
+////////////////////////////////////////////////////////////
+
+OUString SAL_CALL SmXMLImportMeta_getImplementationName() throw()
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Math.XMLOasisMetaImporter" ) );
+}
+
+uno::Sequence< OUString > SAL_CALL SmXMLImportMeta_getSupportedServiceNames()
+throw()
+{
+ const OUString aServiceName( IMPORT_SVC_NAME );
+ const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+}
+
+uno::Reference< uno::XInterface > SAL_CALL SmXMLImportMeta_createInstance(
+ const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
+throw( uno::Exception )
+{
+ // #110680#
+ // return (cppu::OWeakObject*)new SmXMLImport( IMPORT_META );
+ return (cppu::OWeakObject*)new SmXMLImport( rSMgr, IMPORT_META );
+}
+
+////////////////////////////////////////////////////////////
+
+OUString SAL_CALL SmXMLImportSettings_getImplementationName() throw()
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Math.XMLOasisSettingsImporter" ) );
+}
+
+uno::Sequence< OUString > SAL_CALL SmXMLImportSettings_getSupportedServiceNames()
+ throw()
+{
+ const OUString aServiceName( IMPORT_SVC_NAME );
+ const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
+ return aSeq;
+}
+
+uno::Reference< uno::XInterface > SAL_CALL SmXMLImportSettings_createInstance(
+ const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
+ throw( uno::Exception )
+{
+ // #110680#
+ // return (cppu::OWeakObject*)new SmXMLImport( IMPORT_SETTINGS );
+ return (cppu::OWeakObject*)new SmXMLImport( rSMgr, IMPORT_SETTINGS );
+}
+
+////////////////////////////////////////////////////////////
+
+// XServiceInfo
+// override empty method from parent class
+rtl::OUString SAL_CALL SmXMLImport::getImplementationName()
+ throw(uno::RuntimeException)
+{
+ OUString aTxt;
+ switch( getImportFlags() )
+ {
+ case IMPORT_META:
+ aTxt = SmXMLImportMeta_getImplementationName();
+ break;
+ case IMPORT_SETTINGS:
+ aTxt = SmXMLImportSettings_getImplementationName();
+ break;
+ case IMPORT_ALL:
+ default:
+ aTxt = SmXMLImport_getImplementationName();
+ break;
+ }
+ return aTxt;
+}
+
+
+sal_Int64 SAL_CALL SmXMLImport::getSomething(
+ const uno::Sequence< sal_Int8 >&rId )
+throw(uno::RuntimeException)
+{
+ if ( rId.getLength() == 16 &&
+ 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+ rId.getConstArray(), 16 ) )
+ return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_uIntPtr >(this));
+
+ return SvXMLImport::getSomething( rId );
+}
+
+void SmXMLImport::endDocument(void)
+ throw(xml::sax::SAXException, uno::RuntimeException)
+{
+ //Set the resulted tree into the SmDocShell where it belongs
+ SmNode *pTree;
+ if (NULL != (pTree = GetTree()))
+ {
+ uno::Reference <frame::XModel> xModel = GetModel();
+ uno::Reference <lang::XUnoTunnel> xTunnel;
+ xTunnel = uno::Reference <lang::XUnoTunnel> (xModel,uno::UNO_QUERY);
+ SmModel *pModel = reinterpret_cast<SmModel *>
+ (xTunnel->getSomething(SmModel::getUnoTunnelId()));
+
+ if (pModel)
+ {
+ SmDocShell *pDocShell =
+ static_cast<SmDocShell*>(pModel->GetObjectShell());
+ pDocShell->SetFormulaTree(pTree);
+ if (0 == aText.Len()) //If we picked up no annotation text
+ {
+ //Make up some editable text
+ aText = pDocShell->GetText();
+ pTree->CreateTextFromNode(aText);
+ aText.EraseTrailingChars();
+ if ((aText.GetChar(0) == '{') &&
+ (aText.GetChar(aText.Len()-1) == '}'))
+ {
+ aText.Erase(0,1);
+ aText.Erase(aText.Len()-1,1);
+ }
+ }
+ pDocShell->SetText( String() );
+
+ // Convert symbol names
+ SmParser &rParser = pDocShell->GetParser();
+ BOOL bVal = rParser.IsImportSymbolNames();
+ rParser.SetImportSymbolNames( TRUE );
+ SmNode *pTmpTree = rParser.Parse( aText );
+ aText = rParser.GetText();
+ delete pTmpTree;
+ rParser.SetImportSymbolNames( bVal );
+
+ pDocShell->SetText( aText );
+ }
+ DBG_ASSERT(pModel,"So there *was* a uno problem after all");
+
+ bSuccess = sal_True;
+ }
+
+ SvXMLImport::endDocument();
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLImportContext: public SvXMLImportContext
+{
+public:
+ SmXMLImportContext( SmXMLImport &rImport, sal_uInt16 nPrfx,
+ const OUString& rLName)
+ : SvXMLImportContext(rImport, nPrfx, rLName) {}
+
+ const SmXMLImport& GetSmImport() const
+ {
+ return (const SmXMLImport&)GetImport();
+ }
+
+ SmXMLImport& GetSmImport()
+ {
+ return (SmXMLImport&)GetImport();
+ }
+
+ virtual void TCharacters(const OUString & /*rChars*/);
+ virtual void Characters(const OUString &rChars);
+ virtual SvXMLImportContext *CreateChildContext(sal_uInt16 /*nPrefix*/, const OUString& /*rLocalName*/, const uno::Reference< xml::sax::XAttributeList > & /*xAttrList*/);
+};
+
+void SmXMLImportContext::TCharacters(const OUString & /*rChars*/)
+{
+}
+
+void SmXMLImportContext::Characters(const OUString &rChars)
+{
+ /*
+ Whitespace occurring within the content of token elements is "trimmed"
+ from the ends (i.e. all whitespace at the beginning and end of the
+ content is removed), and "collapsed" internally (i.e. each sequence of
+ 1 or more whitespace characters is replaced with one blank character).
+ */
+ //collapsing not done yet!
+ const OUString &rChars2 = rChars.trim();
+ if (rChars2.getLength())
+ TCharacters(rChars2/*.collapse()*/);
+}
+
+SvXMLImportContext * SmXMLImportContext::CreateChildContext(sal_uInt16 /*nPrefix*/,
+ const OUString& /*rLocalName*/,
+ const uno::Reference< xml::sax::XAttributeList > & /*xAttrList*/)
+{
+ return 0;
+}
+
+////////////////////////////////////////////////////////////
+
+struct SmXMLContext_Helper
+{
+ sal_Int8 nIsBold;
+ sal_Int8 nIsItalic;
+ double nFontSize;
+ sal_Bool bFontNodeNeeded;
+ OUString sFontFamily;
+ OUString sColor;
+
+ SmXMLImportContext rContext;
+
+ SmXMLContext_Helper(SmXMLImportContext &rImport) :
+ nIsBold(-1), nIsItalic(-1), nFontSize(0.0), rContext(rImport) {}
+
+ void RetrieveAttrs(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
+ void ApplyAttrs();
+};
+
+void SmXMLContext_Helper::RetrieveAttrs(const uno::Reference<
+ xml::sax::XAttributeList > & xAttrList )
+{
+ sal_Int8 nOldIsBold=nIsBold;
+ sal_Int8 nOldIsItalic=nIsItalic;
+ double nOldFontSize=nFontSize;
+ sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+ OUString sOldFontFamily = sFontFamily;
+ for (sal_Int16 i=0;i<nAttrCount;i++)
+ {
+ OUString sAttrName = xAttrList->getNameByIndex(i);
+ OUString aLocalName;
+ sal_uInt16 nPrefix = rContext.GetSmImport().GetNamespaceMap().
+ GetKeyByAttrName(sAttrName,&aLocalName);
+ OUString sValue = xAttrList->getValueByIndex(i);
+ const SvXMLTokenMap &rAttrTokenMap =
+ rContext.GetSmImport().GetPresLayoutAttrTokenMap();
+ switch(rAttrTokenMap.Get(nPrefix,aLocalName))
+ {
+ case XML_TOK_FONTWEIGHT:
+ nIsBold = sValue.equals(GetXMLToken(XML_BOLD));
+ break;
+ case XML_TOK_FONTSTYLE:
+ nIsItalic = sValue.equals(GetXMLToken(XML_ITALIC));
+ break;
+ case XML_TOK_FONTSIZE:
+ SvXMLUnitConverter::convertDouble(nFontSize,sValue);
+ rContext.GetSmImport().GetMM100UnitConverter().
+ setXMLMeasureUnit(MAP_POINT);
+ if (-1 == sValue.indexOf(GetXMLToken(XML_UNIT_PT)))
+ {
+ if (-1 == sValue.indexOf('%'))
+ nFontSize=0.0;
+ else
+ {
+ rContext.GetSmImport().GetMM100UnitConverter().
+ setXMLMeasureUnit(MAP_RELATIVE);
+ }
+ }
+ break;
+ case XML_TOK_FONTFAMILY:
+ sFontFamily = sValue;
+ break;
+ case XML_TOK_COLOR:
+ sColor = sValue;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if ((nOldIsBold!=nIsBold) || (nOldIsItalic!=nIsItalic) ||
+ (nOldFontSize!=nFontSize) || (sOldFontFamily!=sFontFamily)
+ || sColor.getLength())
+ bFontNodeNeeded=sal_True;
+ else
+ bFontNodeNeeded=sal_False;
+}
+
+void SmXMLContext_Helper::ApplyAttrs()
+{
+ SmNodeStack &rNodeStack = rContext.GetSmImport().GetNodeStack();
+
+ if (bFontNodeNeeded)
+ {
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 5;
+
+ if (nIsBold != -1)
+ {
+ if (nIsBold)
+ aToken.eType = TBOLD;
+ else
+ aToken.eType = TNBOLD;
+ SmStructureNode *pFontNode = static_cast<SmStructureNode *>
+ (new SmFontNode(aToken));
+ pFontNode->SetSubNodes(0,rNodeStack.Pop());
+ rNodeStack.Push(pFontNode);
+ }
+ if (nIsItalic != -1)
+ {
+ if (nIsItalic)
+ aToken.eType = TITALIC;
+ else
+ aToken.eType = TNITALIC;
+ SmStructureNode *pFontNode = static_cast<SmStructureNode *>
+ (new SmFontNode(aToken));
+ pFontNode->SetSubNodes(0,rNodeStack.Pop());
+ rNodeStack.Push(pFontNode);
+ }
+ if (nFontSize != 0.0)
+ {
+ aToken.eType = TSIZE;
+ SmFontNode *pFontNode = new SmFontNode(aToken);
+
+ if (MAP_RELATIVE == rContext.GetSmImport().GetMM100UnitConverter().
+ getXMLMeasureUnit())
+ {
+ if (nFontSize < 100.00)
+ pFontNode->SetSizeParameter(Fraction(100.00/nFontSize),
+ FNTSIZ_DIVIDE);
+ else
+ pFontNode->SetSizeParameter(Fraction(nFontSize/100.00),
+ FNTSIZ_MULTIPLY);
+ }
+ else
+ pFontNode->SetSizeParameter(Fraction(nFontSize),FNTSIZ_ABSOLUT);
+
+ pFontNode->SetSubNodes(0,rNodeStack.Pop());
+ rNodeStack.Push(pFontNode);
+ }
+ if (sFontFamily.getLength())
+ {
+ if (sFontFamily.equalsIgnoreAsciiCase(GetXMLToken(XML_FIXED)))
+ aToken.eType = TFIXED;
+ else if (sFontFamily.equalsIgnoreAsciiCase(OUString(
+ RTL_CONSTASCII_USTRINGPARAM("sans"))))
+ aToken.eType = TSANS;
+ else if (sFontFamily.equalsIgnoreAsciiCase(OUString(
+ RTL_CONSTASCII_USTRINGPARAM("serif"))))
+ aToken.eType = TSERIF;
+ else //Just give up, we need to extend our font mechanism to be
+ //more general
+ return;
+
+ aToken.aText = sFontFamily;
+ SmFontNode *pFontNode = new SmFontNode(aToken);
+ pFontNode->SetSubNodes(0,rNodeStack.Pop());
+ rNodeStack.Push(pFontNode);
+ }
+ if (sColor.getLength())
+ {
+ //Again we can only handle a small set of colours in
+ //StarMath for now.
+ const SvXMLTokenMap& rTokenMap =
+ rContext.GetSmImport().GetColorTokenMap();
+ aToken.eType = static_cast<SmTokenType>(rTokenMap.Get(
+ XML_NAMESPACE_MATH, sColor));
+ if (aToken.eType != -1)
+ {
+ SmFontNode *pFontNode = new SmFontNode(aToken);
+ pFontNode->SetSubNodes(0,rNodeStack.Pop());
+ rNodeStack.Push(pFontNode);
+ }
+ }
+
+ }
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLDocContext_Impl : public SmXMLImportContext
+{
+public:
+ SmXMLDocContext_Impl( SmXMLImport &rImport, sal_uInt16 nPrfx,
+ const OUString& rLName)
+ : SmXMLImportContext(rImport,nPrfx,rLName) {}
+
+ virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &xAttrList);
+
+ void EndElement();
+};
+
+////////////////////////////////////////////////////////////
+
+/*avert thy gaze from the proginator*/
+class SmXMLRowContext_Impl : public SmXMLDocContext_Impl
+{
+protected:
+ ULONG nElementCount;
+
+public:
+ SmXMLRowContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLDocContext_Impl(rImport,nPrefix,rLName)
+ { nElementCount = GetSmImport().GetNodeStack().Count(); }
+
+ virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &xAttrList);
+
+ SvXMLImportContext *StrictCreateChildContext(sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const uno::Reference< xml::sax::XAttributeList > &xAttrList);
+
+ void EndElement();
+};
+
+////////////////////////////////////////////////////////////
+
+class SmXMLFracContext_Impl : public SmXMLRowContext_Impl
+{
+public:
+ SmXMLFracContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
+
+ void EndElement();
+};
+
+////////////////////////////////////////////////////////////
+
+class SmXMLSqrtContext_Impl : public SmXMLRowContext_Impl
+{
+public:
+ SmXMLSqrtContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
+
+ void EndElement();
+};
+
+////////////////////////////////////////////////////////////
+
+class SmXMLRootContext_Impl : public SmXMLRowContext_Impl
+{
+public:
+ SmXMLRootContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
+
+ void EndElement();
+};
+
+////////////////////////////////////////////////////////////
+
+class SmXMLStyleContext_Impl : public SmXMLRowContext_Impl
+{
+protected:
+ SmXMLContext_Helper aStyleHelper;
+
+public:
+ /*Right now the style tag is completely ignored*/
+ SmXMLStyleContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName) : SmXMLRowContext_Impl(rImport,nPrefix,rLName),
+ aStyleHelper(*this) {}
+
+ void EndElement();
+ void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
+};
+
+void SmXMLStyleContext_Impl::StartElement(const uno::Reference<
+ xml::sax::XAttributeList > & xAttrList )
+{
+#if 1
+ aStyleHelper.RetrieveAttrs(xAttrList);
+#else
+ sal_Int8 nOldIsBold=nIsBold;
+ sal_Int8 nOldIsItalic=nIsItalic;
+ double nOldFontSize=nFontSize;
+ sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+ OUString sOldFontFamily = sFontFamily;
+ for (sal_Int16 i=0;i<nAttrCount;i++)
+ {
+ OUString sAttrName = xAttrList->getNameByIndex(i);
+ OUString aLocalName;
+ sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
+ GetKeyByAttrName(sAttrName,&aLocalName);
+ OUString sValue = xAttrList->getValueByIndex(i);
+ const SvXMLTokenMap &rAttrTokenMap =
+ GetSmImport().GetPresLayoutAttrTokenMap();
+ switch(rAttrTokenMap.Get(nPrefix,aLocalName))
+ {
+ case XML_TOK_FONTWEIGHT:
+ nIsBold = sValue.equals(GetXMLToken(XML_BOLD));
+ break;
+ case XML_TOK_FONTSTYLE:
+ nIsItalic = sValue.equals(GetXMLToken(XML_ITALIC));
+ break;
+ case XML_TOK_FONTSIZE:
+ SvXMLUnitConverter::convertDouble(nFontSize,sValue);
+ GetSmImport().GetMM100UnitConverter().
+ setXMLMeasureUnit(MAP_POINT);
+ if (-1 == sValue.indexOf(GetXMLToken(XML_UNIT_PT)))
+ if (-1 == sValue.indexOf('%'))
+ nFontSize=0.0;
+ else
+ {
+ GetSmImport().GetMM100UnitConverter().
+ setXMLMeasureUnit(MAP_RELATIVE);
+ }
+ break;
+ case XML_TOK_FONTFAMILY:
+ sFontFamily = sValue;
+ break;
+ case XML_TOK_COLOR:
+ sColor = sValue;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if ((nOldIsBold!=nIsBold) || (nOldIsItalic!=nIsItalic) ||
+ (nOldFontSize!=nFontSize) || (sOldFontFamily!=sFontFamily)
+ || sColor.getLength())
+ bFontNodeNeeded=sal_True;
+ else
+ bFontNodeNeeded=sal_False;
+#endif
+}
+
+
+void SmXMLStyleContext_Impl::EndElement()
+{
+ /*
+ <mstyle> accepts any number of arguments; if this number is not 1, its
+ contents are treated as a single "inferred <mrow>" containing its
+ arguments
+ */
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+ if (rNodeStack.Count() - nElementCount > 1)
+ SmXMLRowContext_Impl::EndElement();
+#if 1
+ aStyleHelper.ApplyAttrs();
+#else
+ if (bFontNodeNeeded)
+ {
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 5;
+
+ if (nIsBold != -1)
+ {
+ if (nIsBold)
+ aToken.eType = TBOLD;
+ else
+ aToken.eType = TNBOLD;
+ SmStructureNode *pFontNode = static_cast<SmStructureNode *>
+ (new SmFontNode(aToken));
+ pFontNode->SetSubNodes(0,rNodeStack.Pop());
+ rNodeStack.Push(pFontNode);
+ }
+ if (nIsItalic != -1)
+ {
+ if (nIsItalic)
+ aToken.eType = TITALIC;
+ else
+ aToken.eType = TNITALIC;
+ SmStructureNode *pFontNode = static_cast<SmStructureNode *>
+ (new SmFontNode(aToken));
+ pFontNode->SetSubNodes(0,rNodeStack.Pop());
+ rNodeStack.Push(pFontNode);
+ }
+ if (nFontSize != 0.0)
+ {
+ aToken.eType = TSIZE;
+ SmFontNode *pFontNode = new SmFontNode(aToken);
+
+ if (MAP_RELATIVE == GetSmImport().GetMM100UnitConverter().
+ getXMLMeasureUnit())
+ {
+ if (nFontSize < 100.00)
+ pFontNode->SetSizeParameter(Fraction(100.00/nFontSize),
+ FNTSIZ_DIVIDE);
+ else
+ pFontNode->SetSizeParameter(Fraction(nFontSize/100.00),
+ FNTSIZ_MULTIPLY);
+ }
+ else
+ pFontNode->SetSizeParameter(Fraction(nFontSize),FNTSIZ_ABSOLUT);
+
+ pFontNode->SetSubNodes(0,rNodeStack.Pop());
+ rNodeStack.Push(pFontNode);
+ }
+ if (sFontFamily.getLength())
+ {
+ if (sFontFamily.equalsIgnoreCase(GetXMLToken(XML_FIXED)))
+ aToken.eType = TFIXED;
+ else if (sFontFamily.equalsIgnoreCase(OUString(
+ RTL_CONSTASCII_USTRINGPARAM("sans"))))
+ aToken.eType = TSANS;
+ else if (sFontFamily.equalsIgnoreCase(OUString(
+ RTL_CONSTASCII_USTRINGPARAM("serif"))))
+ aToken.eType = TSERIF;
+ else //Just give up, we need to extend our font mechanism to be
+ //more general
+ return;
+
+ aToken.aText = sFontFamily;
+ SmFontNode *pFontNode = new SmFontNode(aToken);
+ pFontNode->SetSubNodes(0,rNodeStack.Pop());
+ rNodeStack.Push(pFontNode);
+ }
+ if (sColor.getLength())
+ {
+ //Again we can only handle a small set of colours in
+ //StarMath for now.
+ const SvXMLTokenMap& rTokenMap =
+ GetSmImport().GetColorTokenMap();
+ aToken.eType = static_cast<SmTokenType>(rTokenMap.Get(
+ XML_NAMESPACE_MATH, sColor));
+ if (aToken.eType != -1)
+ {
+ SmFontNode *pFontNode = new SmFontNode(aToken);
+ pFontNode->SetSubNodes(0,rNodeStack.Pop());
+ rNodeStack.Push(pFontNode);
+ }
+ }
+
+ }
+#endif
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLPaddedContext_Impl : public SmXMLRowContext_Impl
+{
+public:
+ /*Right now the style tag is completely ignored*/
+ SmXMLPaddedContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
+
+ void EndElement();
+};
+
+void SmXMLPaddedContext_Impl::EndElement()
+{
+ /*
+ <mpadded> accepts any number of arguments; if this number is not 1, its
+ contents are treated as a single "inferred <mrow>" containing its
+ arguments
+ */
+ if (GetSmImport().GetNodeStack().Count() - nElementCount > 1)
+ SmXMLRowContext_Impl::EndElement();
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLPhantomContext_Impl : public SmXMLRowContext_Impl
+{
+public:
+ /*Right now the style tag is completely ignored*/
+ SmXMLPhantomContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
+
+ void EndElement();
+};
+
+void SmXMLPhantomContext_Impl::EndElement()
+{
+ /*
+ <mphantom> accepts any number of arguments; if this number is not 1, its
+ contents are treated as a single "inferred <mrow>" containing its
+ arguments
+ */
+ if (GetSmImport().GetNodeStack().Count() - nElementCount > 1)
+ SmXMLRowContext_Impl::EndElement();
+
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 5;
+ aToken.eType = TPHANTOM;
+
+ SmStructureNode *pPhantom = static_cast<SmStructureNode *>
+ (new SmFontNode(aToken));
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+ pPhantom->SetSubNodes(0,rNodeStack.Pop());
+ rNodeStack.Push(pPhantom);
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLFencedContext_Impl : public SmXMLRowContext_Impl
+{
+protected:
+ sal_Unicode cBegin;
+ sal_Unicode cEnd;
+
+public:
+ SmXMLFencedContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLRowContext_Impl(rImport,nPrefix,rLName),
+ cBegin('('), cEnd(')') {}
+
+ void StartElement(const uno::Reference< xml::sax::XAttributeList > & xAttrList );
+ void EndElement();
+};
+
+
+void SmXMLFencedContext_Impl::StartElement(const uno::Reference<
+ xml::sax::XAttributeList > & xAttrList )
+{
+ sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+ for (sal_Int16 i=0;i<nAttrCount;i++)
+ {
+ OUString sAttrName = xAttrList->getNameByIndex(i);
+ OUString aLocalName;
+ sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
+ GetKeyByAttrName(sAttrName,&aLocalName);
+ OUString sValue = xAttrList->getValueByIndex(i);
+ const SvXMLTokenMap &rAttrTokenMap =
+ GetSmImport().GetFencedAttrTokenMap();
+ switch(rAttrTokenMap.Get(nPrefix,aLocalName))
+ {
+ //temp, starmath cannot handle multichar brackets (I think)
+ case XML_TOK_OPEN:
+ cBegin = sValue[0];
+ break;
+ case XML_TOK_CLOSE:
+ cEnd = sValue[0];
+ break;
+ default:
+ /*Go to superclass*/
+ break;
+ }
+ }
+}
+
+
+void SmXMLFencedContext_Impl::EndElement()
+{
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.aText = ',';
+ aToken.eType = TLEFT;
+ aToken.nLevel = 5;
+
+ aToken.eType = TLPARENT;
+ aToken.cMathChar = cBegin;
+ SmStructureNode *pSNode = new SmBraceNode(aToken);
+ SmNode *pLeft = new SmMathSymbolNode(aToken);
+
+ aToken.cMathChar = cEnd;
+ aToken.eType = TRPARENT;
+ SmNode *pRight = new SmMathSymbolNode(aToken);
+
+ SmNodeArray aRelationArray;
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+
+ aToken.cMathChar = '\0';
+ aToken.aText = ',';
+ aToken.eType = TIDENT;
+
+ ULONG i = rNodeStack.Count() - nElementCount;
+ if (rNodeStack.Count() - nElementCount > 1)
+ i += rNodeStack.Count() - 1 - nElementCount;
+ aRelationArray.resize(i);
+ while (rNodeStack.Count() > nElementCount)
+ {
+ aRelationArray[--i] = rNodeStack.Pop();
+ if (i > 1 && rNodeStack.Count() > 1)
+ aRelationArray[--i] = new SmGlyphSpecialNode(aToken);
+ }
+
+ SmToken aDummy;
+ SmStructureNode *pBody = new SmExpressionNode(aDummy);
+ pBody->SetSubNodes(aRelationArray);
+
+
+ pSNode->SetSubNodes(pLeft,pBody,pRight);
+ pSNode->SetScaleMode(SCALE_HEIGHT);
+ GetSmImport().GetNodeStack().Push(pSNode);
+}
+
+
+////////////////////////////////////////////////////////////
+
+class SmXMLErrorContext_Impl : public SmXMLRowContext_Impl
+{
+public:
+ SmXMLErrorContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
+
+ void EndElement();
+};
+
+void SmXMLErrorContext_Impl::EndElement()
+{
+ /*Right now the error tag is completely ignored, what
+ can I do with it in starmath, ?, maybe we need a
+ report window ourselves, do a test for validity of
+ the xml input, use merrors, and then generate
+ the markup inside the merror with a big red colour
+ of something. For now just throw them all away.
+ */
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+ while (rNodeStack.Count() > nElementCount)
+ {
+ SmNode *pNode = rNodeStack.Pop();
+ delete pNode;
+ }
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLNumberContext_Impl : public SmXMLImportContext
+{
+protected:
+ SmToken aToken;
+
+public:
+ SmXMLNumberContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLImportContext(rImport,nPrefix,rLName)
+ {
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 5;
+ aToken.eType = TNUMBER;
+ }
+
+ virtual void TCharacters(const OUString &rChars);
+
+ void EndElement();
+};
+
+void SmXMLNumberContext_Impl::TCharacters(const OUString &rChars)
+{
+ aToken.aText = rChars;
+}
+
+void SmXMLNumberContext_Impl::EndElement()
+{
+ GetSmImport().GetNodeStack().Push(new SmTextNode(aToken,FNT_NUMBER));
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLAnnotationContext_Impl : public SmXMLImportContext
+{
+ sal_Bool bIsStarMath;
+
+public:
+ SmXMLAnnotationContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLImportContext(rImport,nPrefix,rLName), bIsStarMath(sal_False) {}
+
+ virtual void Characters(const OUString &rChars);
+
+ void StartElement(const uno::Reference<xml::sax::XAttributeList > & xAttrList );
+};
+
+void SmXMLAnnotationContext_Impl::StartElement(const uno::Reference<
+ xml::sax::XAttributeList > & xAttrList )
+{
+ sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+ for (sal_Int16 i=0;i<nAttrCount;i++)
+ {
+ OUString sAttrName = xAttrList->getNameByIndex(i);
+ OUString aLocalName;
+ sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
+ GetKeyByAttrName(sAttrName,&aLocalName);
+
+ OUString sValue = xAttrList->getValueByIndex(i);
+ const SvXMLTokenMap &rAttrTokenMap =
+ GetSmImport().GetAnnotationAttrTokenMap();
+ switch(rAttrTokenMap.Get(nPrefix,aLocalName))
+ {
+ case XML_TOK_ENCODING:
+ bIsStarMath= sValue.equals(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("StarMath 5.0")));
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+void SmXMLAnnotationContext_Impl::Characters(const OUString &rChars)
+{
+ if (bIsStarMath)
+ GetSmImport().GetText().Append(String(rChars));
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLTextContext_Impl : public SmXMLImportContext
+{
+protected:
+ SmToken aToken;
+
+public:
+ SmXMLTextContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLImportContext(rImport,nPrefix,rLName)
+ {
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 5;
+ aToken.eType = TTEXT;
+ }
+
+ virtual void TCharacters(const OUString &rChars);
+
+ void EndElement();
+};
+
+void SmXMLTextContext_Impl::TCharacters(const OUString &rChars)
+{
+ aToken.aText = rChars;
+}
+
+void SmXMLTextContext_Impl::EndElement()
+{
+ GetSmImport().GetNodeStack().Push(new SmTextNode(aToken,FNT_TEXT));
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLStringContext_Impl : public SmXMLImportContext
+{
+protected:
+ SmToken aToken;
+
+public:
+ SmXMLStringContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLImportContext(rImport,nPrefix,rLName)
+ {
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 5;
+ aToken.eType = TTEXT;
+ }
+
+ virtual void TCharacters(const OUString &rChars);
+
+ void EndElement();
+};
+
+void SmXMLStringContext_Impl::TCharacters(const OUString &rChars)
+{
+ /*
+ The content of <ms> elements should be rendered with visible "escaping" of
+ certain characters in the content, including at least "double quote"
+ itself, and preferably whitespace other than individual blanks. The intent
+ is for the viewer to see that the expression is a string literal, and to
+ see exactly which characters form its content. For example, <ms>double
+ quote is "</ms> might be rendered as "double quote is \"".
+
+ Obviously this isn't fully done here.
+ */
+ aToken.aText.Erase();
+ aToken.aText += '\"';
+ aToken.aText += String(rChars);
+ aToken.aText += '\"';
+}
+
+void SmXMLStringContext_Impl::EndElement()
+{
+ GetSmImport().GetNodeStack().Push(new SmTextNode(aToken,FNT_FIXED));
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLIdentifierContext_Impl : public SmXMLImportContext
+{
+protected:
+ SmXMLContext_Helper aStyleHelper;
+ SmToken aToken;
+
+public:
+ SmXMLIdentifierContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLImportContext(rImport,nPrefix,rLName),aStyleHelper(*this)
+ {
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 5;
+ aToken.eType = TIDENT;
+ }
+
+ void TCharacters(const OUString &rChars);
+ void StartElement(const uno::Reference< xml::sax::XAttributeList > & xAttrList )
+ {
+ aStyleHelper.RetrieveAttrs(xAttrList);
+ };
+ void EndElement();
+};
+
+void SmXMLIdentifierContext_Impl::EndElement()
+{
+ SmTextNode *pNode = 0;
+ //we will handle identifier italic/normal here instead of with a standalone
+ //font node
+ if (((aStyleHelper.nIsItalic == -1) && (aToken.aText.Len() > 1))
+ || ((aStyleHelper.nIsItalic == 0) && (aToken.aText.Len() == 1)))
+ {
+ pNode = new SmTextNode(aToken,FNT_FUNCTION);
+ pNode->GetFont().SetItalic(ITALIC_NONE);
+ aStyleHelper.nIsItalic = -1;
+ }
+ else
+ pNode = new SmTextNode(aToken,FNT_VARIABLE);
+ if (aStyleHelper.bFontNodeNeeded && aStyleHelper.nIsItalic != -1)
+ {
+ if (aStyleHelper.nIsItalic)
+ pNode->GetFont().SetItalic(ITALIC_NORMAL);
+ else
+ pNode->GetFont().SetItalic(ITALIC_NONE);
+ }
+
+ if ((-1!=aStyleHelper.nIsBold) || (0.0!=aStyleHelper.nFontSize) ||
+ (aStyleHelper.sFontFamily.getLength()) ||
+ aStyleHelper.sColor.getLength())
+ aStyleHelper.bFontNodeNeeded=sal_True;
+ else
+ aStyleHelper.bFontNodeNeeded=sal_False;
+ if (aStyleHelper.bFontNodeNeeded)
+ aStyleHelper.ApplyAttrs();
+ GetSmImport().GetNodeStack().Push(pNode);
+}
+
+void SmXMLIdentifierContext_Impl::TCharacters(const OUString &rChars)
+{
+ aToken.aText = rChars;
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLOperatorContext_Impl : public SmXMLImportContext
+{
+ sal_Bool bIsStretchy;
+
+protected:
+ SmToken aToken;
+
+public:
+ SmXMLOperatorContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLImportContext(rImport,nPrefix,rLName), bIsStretchy(sal_False)
+ {
+ aToken.nGroup = 0;
+ aToken.eType = TSPECIAL;
+ aToken.nLevel = 5;
+ }
+
+ void TCharacters(const OUString &rChars);
+ void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
+ void EndElement();
+};
+
+void SmXMLOperatorContext_Impl::TCharacters(const OUString &rChars)
+{
+ aToken.cMathChar = rChars[0];
+}
+
+void SmXMLOperatorContext_Impl::EndElement()
+{
+ SmMathSymbolNode *pNode = new SmMathSymbolNode(aToken);
+ //For stretchy scaling the scaling must be retrieved from this node
+ //and applied to the expression itself so as to get the expression
+ //to scale the operator to the height of the expression itself
+ if (bIsStretchy)
+ pNode->SetScaleMode(SCALE_HEIGHT);
+ GetSmImport().GetNodeStack().Push(pNode);
+}
+
+
+
+void SmXMLOperatorContext_Impl::StartElement(const uno::Reference<
+ xml::sax::XAttributeList > & xAttrList )
+{
+ sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+ for (sal_Int16 i=0;i<nAttrCount;i++)
+ {
+ OUString sAttrName = xAttrList->getNameByIndex(i);
+ OUString aLocalName;
+ sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
+ GetKeyByAttrName(sAttrName,&aLocalName);
+
+ OUString sValue = xAttrList->getValueByIndex(i);
+ const SvXMLTokenMap &rAttrTokenMap =
+ GetSmImport().GetOperatorAttrTokenMap();
+ switch(rAttrTokenMap.Get(nPrefix,aLocalName))
+ {
+ case XML_TOK_STRETCHY:
+ bIsStretchy = sValue.equals(
+ GetXMLToken(XML_TRUE));
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+
+class SmXMLSpaceContext_Impl : public SmXMLImportContext
+{
+public:
+ SmXMLSpaceContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLImportContext(rImport,nPrefix,rLName) {}
+
+ void StartElement(const uno::Reference< xml::sax::XAttributeList >& xAttrList );
+};
+
+void SmXMLSpaceContext_Impl::StartElement(
+ const uno::Reference<xml::sax::XAttributeList > & /*xAttrList*/ )
+{
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.eType = TBLANK;
+ aToken.nLevel = 5;
+ SmBlankNode *pBlank = new SmBlankNode(aToken);
+ pBlank->IncreaseBy(aToken);
+ GetSmImport().GetNodeStack().Push(pBlank);
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLSubContext_Impl : public SmXMLRowContext_Impl
+{
+protected:
+ void GenericEndElement(SmTokenType eType,SmSubSup aSubSup);
+
+public:
+ SmXMLSubContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
+
+ void EndElement()
+ {
+ GenericEndElement(TRSUB,RSUB);
+ }
+};
+
+
+void SmXMLSubContext_Impl::GenericEndElement(SmTokenType eType, SmSubSup eSubSup)
+{
+ /*The <msub> element requires exactly 2 arguments.*/
+ DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
+ "Sub has not two arguments");
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 0;
+ aToken.eType = eType;
+ SmSubSupNode *pNode = new SmSubSupNode(aToken);
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+
+ // initialize subnodes array
+ SmNodeArray aSubNodes;
+ aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES);
+ for (ULONG i = 1; i < aSubNodes.size(); i++)
+ aSubNodes[i] = NULL;
+
+ aSubNodes[eSubSup+1] = rNodeStack.Pop();
+ aSubNodes[0] = rNodeStack.Pop();
+ pNode->SetSubNodes(aSubNodes);
+ rNodeStack.Push(pNode);
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLSupContext_Impl : public SmXMLSubContext_Impl
+{
+public:
+ SmXMLSupContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLSubContext_Impl(rImport,nPrefix,rLName) {}
+
+ void EndElement()
+ {
+ GenericEndElement(TRSUP,RSUP);
+ }
+};
+
+////////////////////////////////////////////////////////////
+
+class SmXMLSubSupContext_Impl : public SmXMLRowContext_Impl
+{
+protected:
+ void GenericEndElement(SmTokenType eType, SmSubSup aSub,SmSubSup aSup);
+
+public:
+ SmXMLSubSupContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLRowContext_Impl(rImport,nPrefix,rLName) {}
+
+ void EndElement()
+ {
+ GenericEndElement(TRSUB,RSUB,RSUP);
+ }
+};
+
+void SmXMLSubSupContext_Impl::GenericEndElement(SmTokenType eType,
+ SmSubSup aSub,SmSubSup aSup)
+{
+ /*The <msub> element requires exactly 3 arguments.*/
+ DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 3,
+ "SubSup has not three arguments");
+
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 0;
+ aToken.eType = eType;
+ SmSubSupNode *pNode = new SmSubSupNode(aToken);
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+
+ // initialize subnodes array
+ SmNodeArray aSubNodes;
+ aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES);
+ for (ULONG i = 1; i < aSubNodes.size(); i++)
+ aSubNodes[i] = NULL;
+
+ aSubNodes[aSup+1] = rNodeStack.Pop();
+ aSubNodes[aSub+1] = rNodeStack.Pop();
+ aSubNodes[0] = rNodeStack.Pop();
+ pNode->SetSubNodes(aSubNodes);
+ rNodeStack.Push(pNode);
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLUnderContext_Impl : public SmXMLSubContext_Impl
+{
+protected:
+ sal_Int16 nAttrCount;
+
+public:
+ SmXMLUnderContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLSubContext_Impl(rImport,nPrefix,rLName) {}
+
+ void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
+ void EndElement();
+ void HandleAccent();
+};
+
+void SmXMLUnderContext_Impl::StartElement(const uno::Reference<
+ xml::sax::XAttributeList > & xAttrList )
+{
+ nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+}
+
+void SmXMLUnderContext_Impl::HandleAccent()
+{
+ DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
+ "Sub has not two arguments");
+
+ /*Just one special case for the underline thing*/
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+ SmNode *pTest = rNodeStack.Pop();
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 0;
+ aToken.eType = TUNDERLINE;
+
+
+ SmNodeArray aSubNodes;
+ aSubNodes.resize(2);
+
+ SmStructureNode *pNode = new SmAttributNode(aToken);
+ if ((pTest->GetToken().cMathChar & 0x0FFF) == 0x0332)
+ {
+ aSubNodes[0] = new SmRectangleNode(aToken);
+ delete pTest;
+ }
+ else
+ aSubNodes[0] = pTest;
+
+ aSubNodes[1] = rNodeStack.Pop();
+ pNode->SetSubNodes(aSubNodes);
+ pNode->SetScaleMode(SCALE_WIDTH);
+ rNodeStack.Push(pNode);
+}
+
+
+void SmXMLUnderContext_Impl::EndElement()
+{
+ if (!nAttrCount)
+ GenericEndElement(TCSUB,CSUB);
+ else
+ HandleAccent();
+#if 0
+ //UnderBrace trick
+ SmStructureNode *pNode = rNodeStack.Pop();
+ if (pNode->GetSubNode(1)->GetToken().cMathChar == (0x0332|0xf000))
+ if (pNode->GetSubNode(0)->GetToken().cMathChar == (0x0332|0xf000))
+#endif
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLOverContext_Impl : public SmXMLSubContext_Impl
+{
+protected:
+ sal_Int16 nAttrCount;
+
+public:
+ SmXMLOverContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLSubContext_Impl(rImport,nPrefix,rLName), nAttrCount(0) {}
+
+ void EndElement();
+ void StartElement(const uno::Reference< xml::sax::XAttributeList > &xAttrList );
+ void HandleAccent();
+};
+
+
+void SmXMLOverContext_Impl::StartElement(const uno::Reference<
+ xml::sax::XAttributeList > & xAttrList )
+{
+ nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+}
+
+
+void SmXMLOverContext_Impl::EndElement()
+{
+ if (!nAttrCount)
+ GenericEndElement(TCSUP,CSUP);
+ else
+ HandleAccent();
+}
+
+
+void SmXMLOverContext_Impl::HandleAccent()
+{
+ DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
+ "Sub has not two arguments");
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 0;
+ aToken.eType = TACUTE;
+
+ SmAttributNode *pNode = new SmAttributNode(aToken);
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+
+ SmNodeArray aSubNodes;
+ aSubNodes.resize(2);
+ aSubNodes[0] = rNodeStack.Pop();
+ aSubNodes[1] = rNodeStack.Pop();
+ pNode->SetSubNodes(aSubNodes);
+ pNode->SetScaleMode(SCALE_WIDTH);
+ rNodeStack.Push(pNode);
+
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLUnderOverContext_Impl : public SmXMLSubSupContext_Impl
+{
+public:
+ SmXMLUnderOverContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLSubSupContext_Impl(rImport,nPrefix,rLName) {}
+
+ void EndElement()
+ {
+ GenericEndElement(TCSUB,CSUB,CSUP);
+ }
+};
+
+////////////////////////////////////////////////////////////
+
+class SmXMLMultiScriptsContext_Impl : public SmXMLSubSupContext_Impl
+{
+ sal_Bool bHasPrescripts;
+
+public:
+ SmXMLMultiScriptsContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName) :
+ SmXMLSubSupContext_Impl(rImport,nPrefix,rLName),
+ bHasPrescripts(FALSE) {}
+
+ void EndElement();
+ void MiddleElement();
+ SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const uno::Reference< xml::sax::XAttributeList > &xAttrList);
+};
+
+////////////////////////////////////////////////////////////
+
+class SmXMLNoneContext_Impl : public SmXMLImportContext
+{
+public:
+ SmXMLNoneContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLImportContext(rImport,nPrefix,rLName) {}
+
+ void EndElement();
+};
+
+
+void SmXMLNoneContext_Impl::EndElement(void)
+{
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.aText.Erase();
+ aToken.nLevel = 5;
+ aToken.eType = TIDENT;
+ GetSmImport().GetNodeStack().Push(
+ new SmTextNode(aToken,FNT_VARIABLE));
+}
+
+////////////////////////////////////////////////////////////
+
+class SmXMLPrescriptsContext_Impl : public SmXMLImportContext
+{
+public:
+ SmXMLPrescriptsContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName)
+ : SmXMLImportContext(rImport,nPrefix,rLName) {}
+};
+
+////////////////////////////////////////////////////////////
+
+class SmXMLTableRowContext_Impl : public SmXMLRowContext_Impl
+{
+public:
+ SmXMLTableRowContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName) :
+ SmXMLRowContext_Impl(rImport,nPrefix,rLName)
+ {}
+
+ SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const uno::Reference< xml::sax::XAttributeList > &xAttrList);
+};
+
+
+////////////////////////////////////////////////////////////
+
+class SmXMLTableContext_Impl : public SmXMLTableRowContext_Impl
+{
+public:
+ SmXMLTableContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName) :
+ SmXMLTableRowContext_Impl(rImport,nPrefix,rLName)
+ {}
+
+ void EndElement();
+ SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const uno::Reference< xml::sax::XAttributeList > &xAttrList);
+};
+
+
+////////////////////////////////////////////////////////////
+
+class SmXMLTableCellContext_Impl : public SmXMLRowContext_Impl
+{
+public:
+ SmXMLTableCellContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName) :
+ SmXMLRowContext_Impl(rImport,nPrefix,rLName)
+ {}
+};
+
+////////////////////////////////////////////////////////////
+
+class SmXMLAlignGroupContext_Impl : public SmXMLRowContext_Impl
+{
+public:
+ SmXMLAlignGroupContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName) :
+ SmXMLRowContext_Impl(rImport,nPrefix,rLName)
+ {}
+
+ /*Don't do anything with alignment for now*/
+ void EndElement()
+ {
+ }
+};
+
+////////////////////////////////////////////////////////////
+
+class SmXMLActionContext_Impl : public SmXMLRowContext_Impl
+{
+public:
+ SmXMLActionContext_Impl(SmXMLImport &rImport,sal_uInt16 nPrefix,
+ const OUString& rLName) :
+ SmXMLRowContext_Impl(rImport,nPrefix,rLName)
+ {}
+
+ void EndElement();
+};
+
+////////////////////////////////////////////////////////////
+
+// NB: virtually inherit so we can multiply inherit properly
+// in SmXMLFlatDocContext_Impl
+class SmXMLOfficeContext_Impl : public virtual SvXMLImportContext
+{
+public:
+ SmXMLOfficeContext_Impl( SmXMLImport &rImport, sal_uInt16 nPrfx,
+ const OUString& rLName)
+ : SvXMLImportContext(rImport,nPrfx,rLName) {}
+
+ virtual SvXMLImportContext *CreateChildContext(sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > &xAttrList);
+};
+
+SvXMLImportContext *SmXMLOfficeContext_Impl::CreateChildContext(sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const uno::Reference< xml::sax::XAttributeList > &xAttrList)
+{
+ SvXMLImportContext *pContext = 0;
+ if ( XML_NAMESPACE_OFFICE == nPrefix &&
+ rLocalName == GetXMLToken(XML_META) )
+ {
+ DBG_WARNING("XML_TOK_DOC_META: should not have come here, maybe document is invalid?");
+ }
+ else if ( XML_NAMESPACE_OFFICE == nPrefix &&
+ rLocalName == GetXMLToken(XML_SETTINGS) )
+ {
+ pContext = new XMLDocumentSettingsContext( GetImport(),
+ XML_NAMESPACE_OFFICE, rLocalName,
+ xAttrList );
+ }
+ else
+ pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+
+ return pContext;
+}
+
+////////////////////////////////////////////////////////////
+
+// context for flat file xml format
+class SmXMLFlatDocContext_Impl
+ : public SmXMLOfficeContext_Impl, public SvXMLMetaDocumentContext
+{
+public:
+ SmXMLFlatDocContext_Impl( SmXMLImport& i_rImport,
+ USHORT i_nPrefix, const OUString & i_rLName,
+ const uno::Reference<document::XDocumentProperties>& i_xDocProps,
+ const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder);
+
+ virtual ~SmXMLFlatDocContext_Impl();
+
+ virtual SvXMLImportContext *CreateChildContext(USHORT i_nPrefix, const OUString& i_rLocalName, const uno::Reference<xml::sax::XAttributeList>& i_xAttrList);
+};
+
+SmXMLFlatDocContext_Impl::SmXMLFlatDocContext_Impl( SmXMLImport& i_rImport,
+ USHORT i_nPrefix, const OUString & i_rLName,
+ const uno::Reference<document::XDocumentProperties>& i_xDocProps,
+ const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder) :
+ SvXMLImportContext(i_rImport, i_nPrefix, i_rLName),
+ SmXMLOfficeContext_Impl(i_rImport, i_nPrefix, i_rLName),
+ SvXMLMetaDocumentContext(i_rImport, i_nPrefix, i_rLName,
+ i_xDocProps, i_xDocBuilder)
+{
+}
+
+SmXMLFlatDocContext_Impl::~SmXMLFlatDocContext_Impl()
+{
+}
+
+SvXMLImportContext *SmXMLFlatDocContext_Impl::CreateChildContext(
+ USHORT i_nPrefix, const OUString& i_rLocalName,
+ const uno::Reference<xml::sax::XAttributeList>& i_xAttrList)
+{
+ // behave like meta base class iff we encounter office:meta
+ if ( XML_NAMESPACE_OFFICE == i_nPrefix &&
+ i_rLocalName == GetXMLToken(XML_META) )
+ {
+ return SvXMLMetaDocumentContext::CreateChildContext(
+ i_nPrefix, i_rLocalName, i_xAttrList );
+ }
+ else
+ {
+ return SmXMLOfficeContext_Impl::CreateChildContext(
+ i_nPrefix, i_rLocalName, i_xAttrList );
+ }
+}
+
+////////////////////////////////////////////////////////////
+
+static __FAR_DATA SvXMLTokenMapEntry aPresLayoutElemTokenMap[] =
+{
+ { XML_NAMESPACE_MATH, XML_SEMANTICS, XML_TOK_SEMANTICS },
+ { XML_NAMESPACE_MATH, XML_MATH, XML_TOK_MATH },
+ { XML_NAMESPACE_MATH, XML_MSTYLE, XML_TOK_MSTYLE },
+ { XML_NAMESPACE_MATH, XML_MERROR, XML_TOK_MERROR },
+ { XML_NAMESPACE_MATH, XML_MPHANTOM, XML_TOK_MPHANTOM },
+ { XML_NAMESPACE_MATH, XML_MROW, XML_TOK_MROW },
+ { XML_NAMESPACE_MATH, XML_MFRAC, XML_TOK_MFRAC },
+ { XML_NAMESPACE_MATH, XML_MSQRT, XML_TOK_MSQRT },
+ { XML_NAMESPACE_MATH, XML_MROOT, XML_TOK_MROOT },
+ { XML_NAMESPACE_MATH, XML_MSUB, XML_TOK_MSUB },
+ { XML_NAMESPACE_MATH, XML_MSUP, XML_TOK_MSUP },
+ { XML_NAMESPACE_MATH, XML_MSUBSUP, XML_TOK_MSUBSUP },
+ { XML_NAMESPACE_MATH, XML_MUNDER, XML_TOK_MUNDER },
+ { XML_NAMESPACE_MATH, XML_MOVER, XML_TOK_MOVER },
+ { XML_NAMESPACE_MATH, XML_MUNDEROVER, XML_TOK_MUNDEROVER },
+ { XML_NAMESPACE_MATH, XML_MMULTISCRIPTS, XML_TOK_MMULTISCRIPTS },
+ { XML_NAMESPACE_MATH, XML_MTABLE, XML_TOK_MTABLE },
+ { XML_NAMESPACE_MATH, XML_MACTION, XML_TOK_MACTION },
+ { XML_NAMESPACE_MATH, XML_MFENCED, XML_TOK_MFENCED },
+ { XML_NAMESPACE_MATH, XML_MPADDED, XML_TOK_MPADDED },
+ XML_TOKEN_MAP_END
+};
+
+static __FAR_DATA SvXMLTokenMapEntry aPresLayoutAttrTokenMap[] =
+{
+ { XML_NAMESPACE_MATH, XML_FONTWEIGHT, XML_TOK_FONTWEIGHT },
+ { XML_NAMESPACE_MATH, XML_FONTSTYLE, XML_TOK_FONTSTYLE },
+ { XML_NAMESPACE_MATH, XML_FONTSIZE, XML_TOK_FONTSIZE },
+ { XML_NAMESPACE_MATH, XML_FONTFAMILY, XML_TOK_FONTFAMILY },
+ { XML_NAMESPACE_MATH, XML_COLOR, XML_TOK_COLOR },
+ XML_TOKEN_MAP_END
+};
+
+static __FAR_DATA SvXMLTokenMapEntry aFencedAttrTokenMap[] =
+{
+ { XML_NAMESPACE_MATH, XML_OPEN, XML_TOK_OPEN },
+ { XML_NAMESPACE_MATH, XML_CLOSE, XML_TOK_CLOSE },
+ XML_TOKEN_MAP_END
+};
+
+static __FAR_DATA SvXMLTokenMapEntry aOperatorAttrTokenMap[] =
+{
+ { XML_NAMESPACE_MATH, XML_STRETCHY, XML_TOK_STRETCHY },
+ XML_TOKEN_MAP_END
+};
+
+static __FAR_DATA SvXMLTokenMapEntry aAnnotationAttrTokenMap[] =
+{
+ { XML_NAMESPACE_MATH, XML_ENCODING, XML_TOK_ENCODING },
+ XML_TOKEN_MAP_END
+};
+
+
+static __FAR_DATA SvXMLTokenMapEntry aPresElemTokenMap[] =
+{
+ { XML_NAMESPACE_MATH, XML_ANNOTATION, XML_TOK_ANNOTATION },
+ { XML_NAMESPACE_MATH, XML_MI, XML_TOK_MI },
+ { XML_NAMESPACE_MATH, XML_MN, XML_TOK_MN },
+ { XML_NAMESPACE_MATH, XML_MO, XML_TOK_MO },
+ { XML_NAMESPACE_MATH, XML_MTEXT, XML_TOK_MTEXT },
+ { XML_NAMESPACE_MATH, XML_MSPACE,XML_TOK_MSPACE },
+ { XML_NAMESPACE_MATH, XML_MS, XML_TOK_MS },
+ { XML_NAMESPACE_MATH, XML_MALIGNGROUP, XML_TOK_MALIGNGROUP },
+ XML_TOKEN_MAP_END
+};
+
+static __FAR_DATA SvXMLTokenMapEntry aPresScriptEmptyElemTokenMap[] =
+{
+ { XML_NAMESPACE_MATH, XML_MPRESCRIPTS, XML_TOK_MPRESCRIPTS },
+ { XML_NAMESPACE_MATH, XML_NONE, XML_TOK_NONE },
+ XML_TOKEN_MAP_END
+};
+
+static __FAR_DATA SvXMLTokenMapEntry aPresTableElemTokenMap[] =
+{
+ { XML_NAMESPACE_MATH, XML_MTR, XML_TOK_MTR },
+ { XML_NAMESPACE_MATH, XML_MTD, XML_TOK_MTD },
+ XML_TOKEN_MAP_END
+};
+
+static __FAR_DATA SvXMLTokenMapEntry aColorTokenMap[] =
+{
+ { XML_NAMESPACE_MATH, XML_BLACK, TBLACK},
+ { XML_NAMESPACE_MATH, XML_WHITE, TWHITE},
+ { XML_NAMESPACE_MATH, XML_RED, TRED},
+ { XML_NAMESPACE_MATH, XML_GREEN, TGREEN},
+ { XML_NAMESPACE_MATH, XML_BLUE, TBLUE},
+ { XML_NAMESPACE_MATH, XML_AQUA, TCYAN},
+ { XML_NAMESPACE_MATH, XML_FUCHSIA, TMAGENTA},
+ { XML_NAMESPACE_MATH, XML_YELLOW, TYELLOW},
+ XML_TOKEN_MAP_END
+};
+
+
+////////////////////////////////////////////////////////////
+
+const SvXMLTokenMap& SmXMLImport::GetPresLayoutElemTokenMap()
+{
+ if (!pPresLayoutElemTokenMap)
+ pPresLayoutElemTokenMap = new SvXMLTokenMap(aPresLayoutElemTokenMap);
+ return *pPresLayoutElemTokenMap;
+}
+
+const SvXMLTokenMap& SmXMLImport::GetPresLayoutAttrTokenMap()
+{
+ if (!pPresLayoutAttrTokenMap)
+ pPresLayoutAttrTokenMap = new SvXMLTokenMap(aPresLayoutAttrTokenMap);
+ return *pPresLayoutAttrTokenMap;
+}
+
+
+const SvXMLTokenMap& SmXMLImport::GetFencedAttrTokenMap()
+{
+ if (!pFencedAttrTokenMap)
+ pFencedAttrTokenMap = new SvXMLTokenMap(aFencedAttrTokenMap);
+ return *pFencedAttrTokenMap;
+}
+
+const SvXMLTokenMap& SmXMLImport::GetOperatorAttrTokenMap()
+{
+ if (!pOperatorAttrTokenMap)
+ pOperatorAttrTokenMap = new SvXMLTokenMap(aOperatorAttrTokenMap);
+ return *pOperatorAttrTokenMap;
+}
+
+const SvXMLTokenMap& SmXMLImport::GetAnnotationAttrTokenMap()
+{
+ if (!pAnnotationAttrTokenMap)
+ pAnnotationAttrTokenMap = new SvXMLTokenMap(aAnnotationAttrTokenMap);
+ return *pAnnotationAttrTokenMap;
+}
+
+const SvXMLTokenMap& SmXMLImport::GetPresElemTokenMap()
+{
+ if (!pPresElemTokenMap)
+ pPresElemTokenMap = new SvXMLTokenMap(aPresElemTokenMap);
+ return *pPresElemTokenMap;
+}
+
+const SvXMLTokenMap& SmXMLImport::GetPresScriptEmptyElemTokenMap()
+{
+ if (!pPresScriptEmptyElemTokenMap)
+ pPresScriptEmptyElemTokenMap = new
+ SvXMLTokenMap(aPresScriptEmptyElemTokenMap);
+ return *pPresScriptEmptyElemTokenMap;
+}
+
+const SvXMLTokenMap& SmXMLImport::GetPresTableElemTokenMap()
+{
+ if (!pPresTableElemTokenMap)
+ pPresTableElemTokenMap = new SvXMLTokenMap(aPresTableElemTokenMap);
+ return *pPresTableElemTokenMap;
+}
+
+const SvXMLTokenMap& SmXMLImport::GetColorTokenMap()
+{
+ if (!pColorTokenMap)
+ pColorTokenMap = new SvXMLTokenMap(aColorTokenMap);
+ return *pColorTokenMap;
+}
+
+////////////////////////////////////////////////////////////
+
+SvXMLImportContext *SmXMLDocContext_Impl::CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const uno::Reference<xml::sax::XAttributeList>& xAttrList)
+{
+ SvXMLImportContext* pContext = 0L;
+
+ const SvXMLTokenMap& rTokenMap = GetSmImport().GetPresLayoutElemTokenMap();
+
+ //UINT32 nTest = rTokenMap.Get(nPrefix, rLocalName);
+
+ switch(rTokenMap.Get(nPrefix, rLocalName))
+ {
+ //Consider semantics a dummy except for any starmath annotations
+ case XML_TOK_SEMANTICS:
+ pContext = GetSmImport().CreateRowContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ /*General Layout Schemata*/
+ case XML_TOK_MROW:
+ pContext = GetSmImport().CreateRowContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MFRAC:
+ pContext = GetSmImport().CreateFracContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MSQRT:
+ pContext = GetSmImport().CreateSqrtContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MROOT:
+ pContext = GetSmImport().CreateRootContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MSTYLE:
+ pContext = GetSmImport().CreateStyleContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MERROR:
+ pContext = GetSmImport().CreateErrorContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MPADDED:
+ pContext = GetSmImport().CreatePaddedContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MPHANTOM:
+ pContext = GetSmImport().CreatePhantomContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MFENCED:
+ pContext = GetSmImport().CreateFencedContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ /*Script and Limit Schemata*/
+ case XML_TOK_MSUB:
+ pContext = GetSmImport().CreateSubContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MSUP:
+ pContext = GetSmImport().CreateSupContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MSUBSUP:
+ pContext = GetSmImport().CreateSubSupContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MUNDER:
+ pContext = GetSmImport().CreateUnderContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MOVER:
+ pContext = GetSmImport().CreateOverContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MUNDEROVER:
+ pContext = GetSmImport().CreateUnderOverContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MMULTISCRIPTS:
+ pContext = GetSmImport().CreateMultiScriptsContext(nPrefix,
+ rLocalName, xAttrList);
+ break;
+ case XML_TOK_MTABLE:
+ pContext = GetSmImport().CreateTableContext(nPrefix,
+ rLocalName, xAttrList);
+ break;
+ case XML_TOK_MACTION:
+ pContext = GetSmImport().CreateActionContext(nPrefix,
+ rLocalName, xAttrList);
+ break;
+ default:
+ /*Basically theres an implicit mrow around certain bare
+ *elements, use a RowContext to see if this is one of
+ *those ones*/
+ SmXMLRowContext_Impl aTempContext(GetSmImport(),nPrefix,
+ GetXMLToken(XML_MROW));
+
+ pContext = aTempContext.StrictCreateChildContext(nPrefix,
+ rLocalName, xAttrList);
+ break;
+ }
+ return pContext;
+}
+
+void SmXMLDocContext_Impl::EndElement()
+{
+ SmNodeArray ContextArray;
+ ContextArray.resize(1);
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+
+ for (ULONG i=0;i< 1;i++)
+ ContextArray[i] = rNodeStack.Pop();
+
+ SmToken aDummy;
+ SmStructureNode *pSNode = new SmLineNode(aDummy);
+ pSNode->SetSubNodes(ContextArray);
+ rNodeStack.Push(pSNode);
+
+ SmNodeArray LineArray;
+ ULONG n = rNodeStack.Count();
+ LineArray.resize(n);
+ for (ULONG j = 0; j < n; j++)
+ LineArray[n - (j + 1)] = rNodeStack.Pop();
+ SmStructureNode *pSNode2 = new SmTableNode(aDummy);
+ pSNode2->SetSubNodes(LineArray);
+ rNodeStack.Push(pSNode2);
+}
+
+void SmXMLFracContext_Impl::EndElement()
+{
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 0;
+ aToken.eType = TOVER;
+ SmStructureNode *pSNode = new SmBinVerNode(aToken);
+ SmNode *pOper = new SmRectangleNode(aToken);
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+ DBG_ASSERT(rNodeStack.Count() - nElementCount == 2,
+ "Fraction (mfrac) tag is missing component");
+ if (rNodeStack.Count() - nElementCount == 2)
+ {
+ SmNode *pSecond = rNodeStack.Pop();
+ SmNode *pFirst = rNodeStack.Pop();
+ pSNode->SetSubNodes(pFirst,pOper,pSecond);
+ rNodeStack.Push(pSNode);
+ }
+}
+
+void SmXMLRootContext_Impl::EndElement()
+{
+ /*The <mroot> element requires exactly 2 arguments.*/
+ DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount == 2,
+ "Root tag is missing component");
+
+ SmToken aToken;
+ aToken.cMathChar = MS_SQRT; //Temporary: alert, based on StarSymbol font
+ aToken.nGroup = 0;
+ aToken.nLevel = 0;
+ aToken.eType = TNROOT;
+ SmStructureNode *pSNode = new SmRootNode(aToken);
+ SmNode *pOper = new SmRootSymbolNode(aToken);
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+ SmNode *pIndex = rNodeStack.Pop();
+ SmNode *pBase = rNodeStack.Pop();
+ pSNode->SetSubNodes(pIndex,pOper,pBase);
+ rNodeStack.Push(pSNode);
+}
+
+void SmXMLSqrtContext_Impl::EndElement()
+{
+ /*
+ <msqrt> accepts any number of arguments; if this number is not 1, its
+ contents are treated as a single "inferred <mrow>" containing its
+ arguments
+ */
+ if (GetSmImport().GetNodeStack().Count() - nElementCount > 1)
+ SmXMLRowContext_Impl::EndElement();
+
+ SmToken aToken;
+ aToken.cMathChar = MS_SQRT; //Temporary: alert, based on StarSymbol font
+ aToken.nGroup = 0;
+ aToken.nLevel = 0;
+ aToken.eType = TSQRT;
+ SmStructureNode *pSNode = new SmRootNode(aToken);
+ SmNode *pOper = new SmRootSymbolNode(aToken);
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+ pSNode->SetSubNodes(0,pOper,rNodeStack.Pop());
+ rNodeStack.Push(pSNode);
+}
+
+void SmXMLRowContext_Impl::EndElement()
+{
+ SmNodeArray aRelationArray;
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+ ULONG nSize = rNodeStack.Count()-nElementCount;
+
+ if (nSize > 0)
+ {
+ aRelationArray.resize(nSize);
+ for (ULONG j=rNodeStack.Count()-nElementCount;j > 0;j--)
+ aRelationArray[j-1] = rNodeStack.Pop();
+
+
+ //If the first or last element is an operator with stretchyness
+ //set then we must create a brace node here from those elements,
+ //removing the stretchness from the operators and applying it to
+ //ourselves, and creating the appropiate dummy StarMath none bracket
+ //to balance the arrangement
+ if (((aRelationArray[0]->GetScaleMode() == SCALE_HEIGHT)
+ && (aRelationArray[0]->GetType() == NMATH))
+ || ((aRelationArray[nSize-1]->GetScaleMode() == SCALE_HEIGHT)
+ && (aRelationArray[nSize-1]->GetType() == NMATH)))
+ {
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 5;
+
+ int nLeft=0,nRight=0;
+ if ((aRelationArray[0]->GetScaleMode() == SCALE_HEIGHT)
+ && (aRelationArray[0]->GetType() == NMATH))
+ {
+ aToken = aRelationArray[0]->GetToken();
+ nLeft=1;
+ }
+ else
+ aToken.cMathChar = '\0';
+
+ aToken.eType = TLPARENT;
+ SmNode *pLeft = new SmMathSymbolNode(aToken);
+
+ if ((aRelationArray[nSize-1]->GetScaleMode() == SCALE_HEIGHT)
+ && (aRelationArray[nSize-1]->GetType() == NMATH))
+ {
+ aToken = aRelationArray[nSize-1]->GetToken();
+ nRight=1;
+ }
+ else
+ aToken.cMathChar = '\0';
+
+ aToken.eType = TRPARENT;
+ SmNode *pRight = new SmMathSymbolNode(aToken);
+
+ SmNodeArray aRelationArray2;
+
+ //!! nSize-nLeft-nRight may be < 0 !!
+ int nRelArrSize = nSize-nLeft-nRight;
+ if (nRelArrSize > 0)
+ {
+ aRelationArray2.resize(nRelArrSize);
+ for (int i=0;i < nRelArrSize;i++)
+ aRelationArray2[i] = aRelationArray[i+nLeft];
+ }
+
+ SmToken aDummy;
+ SmStructureNode *pSNode = new SmBraceNode(aToken);
+ SmStructureNode *pBody = new SmExpressionNode(aDummy);
+ pBody->SetSubNodes(aRelationArray2);
+
+ pSNode->SetSubNodes(pLeft,pBody,pRight);
+ pSNode->SetScaleMode(SCALE_HEIGHT);
+ rNodeStack.Push(pSNode);
+ return;
+ }
+ }
+ else //Multiple newlines result in empty row elements
+ {
+ aRelationArray.resize(1);
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 5;
+ aToken.eType = TNEWLINE;
+ aRelationArray[0] = new SmLineNode(aToken);
+ }
+
+ SmToken aDummy;
+ SmStructureNode *pSNode = new SmExpressionNode(aDummy);
+ pSNode->SetSubNodes(aRelationArray);
+ rNodeStack.Push(pSNode);
+}
+
+
+SvXMLImportContext *SmXMLRowContext_Impl::StrictCreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const uno::Reference<xml::sax::XAttributeList>& xAttrList)
+{
+ SvXMLImportContext* pContext = 0L;
+
+ const SvXMLTokenMap& rTokenMap = GetSmImport().GetPresElemTokenMap();
+ switch(rTokenMap.Get(nPrefix, rLocalName))
+ {
+ /*Note that these should accept malignmark subelements, but do not*/
+ case XML_TOK_MN:
+ pContext = GetSmImport().CreateNumberContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MI:
+ pContext = GetSmImport().CreateIdentifierContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MO:
+ pContext = GetSmImport().CreateOperatorContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MTEXT:
+ pContext = GetSmImport().CreateTextContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MSPACE:
+ pContext = GetSmImport().CreateSpaceContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ case XML_TOK_MS:
+ pContext = GetSmImport().CreateStringContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+
+ /*Note: The maligngroup should only be seen when the row
+ * (or decendants) are in a table*/
+ case XML_TOK_MALIGNGROUP:
+ pContext = GetSmImport().CreateAlignGroupContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+
+ case XML_TOK_ANNOTATION:
+ pContext = GetSmImport().CreateAnnotationContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+
+ default:
+ break;
+ }
+ return pContext;
+}
+
+
+SvXMLImportContext *SmXMLRowContext_Impl::CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const uno::Reference<xml::sax::XAttributeList>& xAttrList)
+{
+ SvXMLImportContext* pContext = StrictCreateChildContext(nPrefix,
+ rLocalName, xAttrList);
+
+ if (!pContext)
+ {
+ //Hmm, unrecognized for this level, check to see if its
+ //an element that can have an implicit schema around it
+ pContext = SmXMLDocContext_Impl::CreateChildContext(nPrefix,
+ rLocalName,xAttrList);
+ }
+ return pContext;
+}
+
+
+SvXMLImportContext *SmXMLMultiScriptsContext_Impl::CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const uno::Reference<xml::sax::XAttributeList>& xAttrList)
+{
+ SvXMLImportContext* pContext = 0L;
+
+ const SvXMLTokenMap& rTokenMap = GetSmImport().
+ GetPresScriptEmptyElemTokenMap();
+ switch(rTokenMap.Get(nPrefix, rLocalName))
+ {
+ case XML_TOK_MPRESCRIPTS:
+ MiddleElement();
+ pContext = GetSmImport().CreatePrescriptsContext(nPrefix,
+ rLocalName, xAttrList);
+ break;
+ case XML_TOK_NONE:
+ pContext = GetSmImport().CreateNoneContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ default:
+ pContext = SmXMLRowContext_Impl::CreateChildContext(nPrefix,
+ rLocalName,xAttrList);
+ break;
+ }
+ return pContext;
+}
+
+void SmXMLMultiScriptsContext_Impl::MiddleElement()
+{
+ bHasPrescripts=sal_True;
+
+ DBG_ASSERT(GetSmImport().GetNodeStack().Count() - nElementCount > 0,
+ "Sub has no arguments");
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+ if (rNodeStack.Count()-nElementCount > 1)
+ {
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 0;
+ aToken.eType = TRSUB;
+ ULONG nFinalCount = rNodeStack.Count()-nElementCount-1;
+
+ SmNodeStack aReverseStack;
+ while (rNodeStack.Count()-nElementCount)
+ {
+ SmNode *pThing = rNodeStack.Pop();
+ aReverseStack.Push(pThing);
+ }
+
+ for (ULONG nCount=0;nCount < nFinalCount;nCount+=2)
+ {
+ SmSubSupNode *pNode = new SmSubSupNode(aToken);
+
+ // initialize subnodes array
+ SmNodeArray aSubNodes;
+ aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES);
+ for (ULONG i = 1; i < aSubNodes.size(); i++)
+ aSubNodes[i] = NULL;
+
+ /*On each loop the base and its sub sup pair becomes the
+ base for the next loop to which the next sub sup pair is
+ attached, i.e. wheels within wheels*/
+ //if (nCount == 0)
+ aSubNodes[0] = aReverseStack.Pop();
+
+ SmNode *pScriptNode = aReverseStack.Pop();
+
+ if (pScriptNode && ((pScriptNode->GetToken().eType != TIDENT) ||
+ (pScriptNode->GetToken().aText.Len())))
+ aSubNodes[RSUB+1] = pScriptNode;
+ pScriptNode = aReverseStack.Pop();
+ if (pScriptNode && ((pScriptNode->GetToken().eType != TIDENT) ||
+ (pScriptNode->GetToken().aText.Len())))
+ aSubNodes[RSUP+1] = pScriptNode;
+
+ pNode->SetSubNodes(aSubNodes);
+ aReverseStack.Push(pNode);
+ }
+ rNodeStack.Push(aReverseStack.Pop());
+ }
+}
+
+
+void SmXMLTableContext_Impl::EndElement()
+{
+ SmNodeArray aExpressionArray;
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+ SmNodeStack aReverseStack;
+ aExpressionArray.resize(rNodeStack.Count()-nElementCount);
+
+ ULONG nRows = rNodeStack.Count()-nElementCount;
+ USHORT nCols = 0;
+
+ SmStructureNode *pArray;
+ for (ULONG i=rNodeStack.Count()-nElementCount;i > 0;i--)
+ {
+ pArray = (SmStructureNode *)rNodeStack.Pop();
+ if (pArray->GetNumSubNodes() == 0)
+ {
+ //This is a little tricky, it is possible that there was
+ //be elements that were not inside a <mtd> pair, in which
+ //case they will not be in a row, i.e. they will not have
+ //SubNodes, so we have to wait until here before we can
+ //resolve the situation. Implicitsurrounding tags are
+ //surprisingly difficult to get right within this
+ //architecture
+
+ SmNodeArray aRelationArray;
+ aRelationArray.resize(1);
+ aRelationArray[0] = pArray;
+ SmToken aDummy;
+ pArray = new SmExpressionNode(aDummy);
+ pArray->SetSubNodes(aRelationArray);
+ }
+
+ if (pArray->GetNumSubNodes() > nCols)
+ nCols = pArray->GetNumSubNodes();
+ aReverseStack.Push(pArray);
+ }
+ aExpressionArray.resize(nCols*nRows);
+ ULONG j=0;
+ while (aReverseStack.Count())
+ {
+ pArray = (SmStructureNode *)aReverseStack.Pop();
+ for (USHORT i=0;i<pArray->GetNumSubNodes();i++)
+ aExpressionArray[j++] = pArray->GetSubNode(i);
+ }
+
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = TRGROUP;
+ aToken.nLevel = 0;
+ aToken.eType = TMATRIX;
+ SmMatrixNode *pSNode = new SmMatrixNode(aToken);
+ pSNode->SetSubNodes(aExpressionArray);
+ pSNode->SetRowCol(static_cast<USHORT>(nRows),nCols);
+ rNodeStack.Push(pSNode);
+}
+
+SvXMLImportContext *SmXMLTableRowContext_Impl::CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const uno::Reference<xml::sax::XAttributeList>& xAttrList)
+{
+ SvXMLImportContext* pContext = 0L;
+
+ const SvXMLTokenMap& rTokenMap = GetSmImport().
+ GetPresTableElemTokenMap();
+ switch(rTokenMap.Get(nPrefix, rLocalName))
+ {
+ case XML_TOK_MTD:
+ pContext = GetSmImport().CreateTableCellContext(nPrefix,
+ rLocalName, xAttrList);
+ break;
+ default:
+ pContext = SmXMLRowContext_Impl::CreateChildContext(nPrefix,
+ rLocalName,xAttrList);
+ break;
+ }
+ return pContext;
+}
+
+SvXMLImportContext *SmXMLTableContext_Impl::CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const uno::Reference<xml::sax::XAttributeList>& xAttrList)
+{
+ SvXMLImportContext* pContext = 0L;
+
+ const SvXMLTokenMap& rTokenMap = GetSmImport().
+ GetPresTableElemTokenMap();
+ switch(rTokenMap.Get(nPrefix, rLocalName))
+ {
+ case XML_TOK_MTR:
+ pContext = GetSmImport().CreateTableRowContext(nPrefix,rLocalName,
+ xAttrList);
+ break;
+ default:
+ pContext = SmXMLTableRowContext_Impl::CreateChildContext(nPrefix,
+ rLocalName,xAttrList);
+ break;
+ }
+ return pContext;
+}
+
+void SmXMLMultiScriptsContext_Impl::EndElement()
+{
+ if (!bHasPrescripts)
+ MiddleElement();
+
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+ if (rNodeStack.Count()-nElementCount > 1)
+ {
+ SmToken aToken;
+ aToken.cMathChar = '\0';
+ aToken.nGroup = 0;
+ aToken.nLevel = 0;
+ aToken.eType = TLSUB;
+ ULONG nFinalCount = rNodeStack.Count()-nElementCount-1;
+
+ SmNodeStack aReverseStack;
+ while (rNodeStack.Count()-nElementCount)
+ aReverseStack.Push(rNodeStack.Pop());
+ for (ULONG nCount=0;nCount < nFinalCount;nCount+=2)
+ {
+ SmSubSupNode *pNode = new SmSubSupNode(aToken);
+
+ // initialize subnodes array
+ SmNodeArray aSubNodes;
+ aSubNodes.resize(1 + SUBSUP_NUM_ENTRIES);
+ for (ULONG i = 1; i < aSubNodes.size(); i++)
+ aSubNodes[i] = NULL;
+
+ /*On each loop the base and its sub sup pair becomes the
+ base for the next loop to which the next sub sup pair is
+ attached, i.e. wheels within wheels*/
+ //if (nCount == 0)
+ aSubNodes[0] = aReverseStack.Pop();
+
+ SmNode *pScriptNode = aReverseStack.Pop();
+ if (pScriptNode->GetToken().aText.Len())
+ aSubNodes[LSUB+1] = pScriptNode;
+ pScriptNode = aReverseStack.Pop();
+ if (pScriptNode->GetToken().aText.Len())
+ aSubNodes[LSUP+1] = pScriptNode;
+
+ pNode->SetSubNodes(aSubNodes);
+ aReverseStack.Push(pNode);
+ }
+ rNodeStack.Push(aReverseStack.Pop());
+ }
+
+}
+void SmXMLActionContext_Impl::EndElement()
+{
+ /*For now we will just assume that the
+ selected attribute is one, and then just display
+ that expression alone, i.e. remove all expect the
+ first pushed one*/
+
+ SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
+ for (ULONG i=rNodeStack.Count()-nElementCount;i > 1;i--)
+ {
+ delete rNodeStack.Pop();
+ }
+}
+
+SvXMLImportContext *SmXMLImport::CreateContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ if ( XML_NAMESPACE_OFFICE == nPrefix )
+ {
+ if ( (IsXMLToken(rLocalName, XML_DOCUMENT) ||
+ IsXMLToken(rLocalName, XML_DOCUMENT_META)))
+ {
+ uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
+ mxServiceFactory->createInstance(
+ ::rtl::OUString::createFromAscii(
+ "com.sun.star.xml.dom.SAXDocumentBuilder")),
+ uno::UNO_QUERY_THROW);
+ uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
+ GetModel(), uno::UNO_QUERY_THROW);
+ return IsXMLToken(rLocalName, XML_DOCUMENT_META)
+ ? new SvXMLMetaDocumentContext(*this,
+ XML_NAMESPACE_OFFICE, rLocalName,
+ xDPS->getDocumentProperties(), xDocBuilder)
+ // flat OpenDocument file format -- this has not been tested...
+ : new SmXMLFlatDocContext_Impl( *this, nPrefix, rLocalName,
+ xDPS->getDocumentProperties(), xDocBuilder);
+ }
+ else
+ {
+ return new SmXMLOfficeContext_Impl( *this,nPrefix,rLocalName);
+ }
+ }
+ else
+ return new SmXMLDocContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateRowContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLRowContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateTextContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLTextContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateAnnotationContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLAnnotationContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateStringContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLStringContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateNumberContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLNumberContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateIdentifierContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLIdentifierContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateOperatorContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLOperatorContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateSpaceContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLSpaceContext_Impl(*this,nPrefix,rLocalName);
+}
+
+
+SvXMLImportContext *SmXMLImport::CreateFracContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLFracContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateSqrtContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLSqrtContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateRootContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLRootContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateStyleContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLStyleContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreatePaddedContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLPaddedContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreatePhantomContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLPhantomContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateFencedContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLFencedContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateErrorContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLErrorContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateSubContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLSubContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateSubSupContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLSubSupContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateSupContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLSupContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateUnderContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLUnderContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateOverContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLOverContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateUnderOverContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLUnderOverContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateMultiScriptsContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLMultiScriptsContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateTableContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLTableContext_Impl(*this,nPrefix,rLocalName);
+}
+SvXMLImportContext *SmXMLImport::CreateTableRowContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLTableRowContext_Impl(*this,nPrefix,rLocalName);
+}
+SvXMLImportContext *SmXMLImport::CreateTableCellContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLTableCellContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateNoneContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLNoneContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreatePrescriptsContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLPrescriptsContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateAlignGroupContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLAlignGroupContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SvXMLImportContext *SmXMLImport::CreateActionContext(sal_uInt16 nPrefix,
+ const OUString &rLocalName,
+ const uno::Reference <xml::sax::XAttributeList> & /*xAttrList*/)
+{
+ return new SmXMLActionContext_Impl(*this,nPrefix,rLocalName);
+}
+
+SmXMLImport::~SmXMLImport() throw ()
+{
+ delete pPresLayoutElemTokenMap;
+ delete pPresElemTokenMap;
+ delete pPresScriptEmptyElemTokenMap;
+ delete pPresTableElemTokenMap;
+ delete pPresLayoutAttrTokenMap;
+ delete pFencedAttrTokenMap;
+ delete pColorTokenMap;
+ delete pOperatorAttrTokenMap;
+ delete pAnnotationAttrTokenMap;
+}
+
+void SmXMLImport::SetViewSettings(const Sequence<PropertyValue>& aViewProps)
+{
+ uno::Reference <frame::XModel> xModel = GetModel();
+ if ( !xModel.is() )
+ return;
+
+ uno::Reference <lang::XUnoTunnel> xTunnel;
+ xTunnel = uno::Reference <lang::XUnoTunnel> (xModel,uno::UNO_QUERY);
+ SmModel *pModel = reinterpret_cast<SmModel *>
+ (xTunnel->getSomething(SmModel::getUnoTunnelId()));
+
+ if ( !pModel )
+ return;
+
+ SmDocShell *pDocShell =
+ static_cast<SmDocShell*>(pModel->GetObjectShell());
+ if ( !pDocShell )
+ return;
+
+ Rectangle aRect( pDocShell->GetVisArea() );
+
+ sal_Int32 nCount = aViewProps.getLength();
+ const PropertyValue *pValue = aViewProps.getConstArray();
+
+ long nTmp = 0;
+ //sal_Bool bShowDeletes = sal_False, bShowInserts = sal_False, bShowFooter = sal_False, bShowHeader = sal_False;
+
+ for (sal_Int32 i = 0; i < nCount ; i++)
+ {
+ if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaTop" ) ) )
+ {
+ pValue->Value >>= nTmp;
+ aRect.setY( nTmp );
+ }
+ else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaLeft" ) ) )
+ {
+ pValue->Value >>= nTmp;
+ aRect.setX( nTmp );
+ }
+ else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaWidth" ) ) )
+ {
+ pValue->Value >>= nTmp;
+ Size aSize( aRect.GetSize() );
+ aSize.Width() = nTmp;
+ aRect.SetSize( aSize );
+ }
+ else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "ViewAreaHeight" ) ) )
+ {
+ pValue->Value >>= nTmp;
+ Size aSize( aRect.GetSize() );
+ aSize.Height() = nTmp;
+ aRect.SetSize( aSize );
+ }
+ pValue++;
+ }
+
+ pDocShell->SetVisArea ( aRect );
+}
+
+void SmXMLImport::SetConfigurationSettings(const Sequence<PropertyValue>& aConfProps)
+{
+ uno::Reference < XPropertySet > xProps ( GetModel(), UNO_QUERY );
+ if ( xProps.is() )
+ {
+ Reference < XPropertySetInfo > xInfo ( xProps->getPropertySetInfo() );
+ if (xInfo.is() )
+ {
+ sal_Int32 nCount = aConfProps.getLength();
+ const PropertyValue* pValues = aConfProps.getConstArray();
+
+ const OUString sFormula ( RTL_CONSTASCII_USTRINGPARAM ( "Formula" ) );
+ const OUString sBasicLibraries ( RTL_CONSTASCII_USTRINGPARAM ( "BasicLibraries" ) );
+ const OUString sDialogLibraries ( RTL_CONSTASCII_USTRINGPARAM ( "DialogLibraries" ) );
+ while ( nCount-- )
+ {
+ if (pValues->Name != sFormula &&
+ pValues->Name != sBasicLibraries &&
+ pValues->Name != sDialogLibraries)
+ {
+ try
+ {
+ if ( xInfo->hasPropertyByName( pValues->Name ) )
+ xProps->setPropertyValue( pValues->Name, pValues->Value );
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR( "SmXMLImport::SetConfigurationSettings: Exception!" );
+ }
+ }
+
+ pValues++;
+ }
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+
+
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index ad3987549c0f..8159acd64362 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -1651,7 +1651,7 @@ void SmBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
"Sm : unterschiedliche Fontgroessen");
aTmpSize.Width() = Min((long) nBraceHeight * 60L / 100L,
rFormat.GetBaseSize().Height() * 3L / 2L);
- // correction factor since change from StarMath to StarSymbol font
+ // correction factor since change from StarMath to OpenSymbol font
// because of the different font width in the FontMetric
aTmpSize.Width() *= 182;
aTmpSize.Width() /= 267;
@@ -2694,7 +2694,7 @@ void SmMathSymbolNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocSh
DBG_ASSERT(GetFont().GetCharSet() == RTL_TEXTENCODING_SYMBOL ||
GetFont().GetCharSet() == RTL_TEXTENCODING_UNICODE,
- "incorrect charset for character from StarMath/StarSymbol font");
+ "incorrect charset for character from StarMath/OpenSymbol font");
Flags() |= FLG_FONT | FLG_ITALIC;
};
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 83662e50b123..727d595b40ea 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -40,7 +40,7 @@
#include <i18npool/lang.h>
#include <unotools/charclass.hxx>
#include <svx/unolingu.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#include "parse.hxx"
#ifndef _STARMATH_HRC
#include "starmath.hrc"
diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx
index 0718be8ffd37..94d0761d7fce 100644
--- a/starmath/source/rect.cxx
+++ b/starmath/source/rect.cxx
@@ -150,8 +150,7 @@ void SmRect::BuildRect(const OutputDevice &rDev, const SmFormat *pFormat,
aSize = Size(rDev.GetTextWidth(rText), rDev.GetTextHeight());
const FontMetric aFM (rDev.GetFontMetric());
- BOOL bIsMath = aFM.GetName().EqualsIgnoreCaseAscii( FONTNAME_MATH ) ||
- aFM.GetName().EqualsIgnoreCaseAscii( FONTNAME_MATH2 );
+ BOOL bIsMath = aFM.GetName().EqualsIgnoreCaseAscii( FONTNAME_MATH );
BOOL bAllowSmaller = bIsMath && !SmIsMathAlpha(rText);
const long nFontHeight = rDev.GetFont().GetSize().Height();
diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx
index f65b7fcdc764..f7008403cddf 100644
--- a/starmath/source/smdetect.cxx
+++ b/starmath/source/smdetect.cxx
@@ -60,10 +60,10 @@
#include <rtl/ustring.h>
#include <rtl/logfile.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <vcl/window.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/stritem.hxx>
#include <tools/urlobj.hxx>
#include <vos/mutex.hxx>
#include <svtools/sfxecode.hxx>
diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx
index 20cfc284d006..8ad99121acfa 100644
--- a/starmath/source/smmod.cxx
+++ b/starmath/source/smmod.cxx
@@ -37,7 +37,7 @@
#include <sfx2/msg.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objface.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/whiter.hxx>
#include <sfx2/request.hxx>
#include <sfx2/sfx.hrc>
#include <sfx2/viewsh.hxx>
@@ -47,7 +47,7 @@
#endif
#include <vcl/msgbox.hxx>
#include <vcl/virdev.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#include <tools/rtti.hxx>
#include "smmod.hxx"
#include "symbol.hxx"
@@ -251,6 +251,8 @@ SmModule::SmModule(SfxObjectFactory* pObjFact) :
SmModule::~SmModule()
{
delete pConfig;
+ if (pColorConfig)
+ pColorConfig->RemoveListener(this);
delete pColorConfig;
delete pLocSymbolData;
delete pSysLocale;
@@ -295,19 +297,14 @@ svtools::ColorConfig & SmModule::GetColorConfig()
{
pColorConfig = new svtools::ColorConfig;
ApplyColorConfigValues( *pColorConfig );
- StartListening( *pColorConfig );
+ pColorConfig->AddListener(this);
}
return *pColorConfig;
}
-void SmModule::Notify( SfxBroadcaster & /*rBC*/, const SfxHint &rHint )
+void SmModule::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 )
{
- if (rHint.ISA(SfxSimpleHint))
- {
- ULONG nHintId = ((SfxSimpleHint&)rHint).GetId();
- if (SFX_HINT_COLORS_CHANGED == nHintId)
- ApplyColorConfigValues(*pColorConfig);
- }
+ ApplyColorConfigValues(*pColorConfig);
}
SmConfig * SmModule::GetConfig()
diff --git a/starmath/source/toolbox.cxx b/starmath/source/toolbox.cxx
index 487bd6155fc9..c775f9be038b 100644
--- a/starmath/source/toolbox.cxx
+++ b/starmath/source/toolbox.cxx
@@ -33,9 +33,9 @@
#include <rtl/logfile.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <sfx2/app.hxx>
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
#include <svtools/imgdef.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/imgmgr.hxx>
@@ -222,7 +222,7 @@ const ImageList * SmToolBoxWindow::GetImageList( USHORT nResId, BOOL bHighContra
void SmToolBoxWindow::ApplyImageLists( USHORT nCategoryRID )
{
- BOOL bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0;
+ BOOL bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
// set image list for toolbox 'catalog'
const ImageList *pImageList = GetImageList( bHighContrast ? RID_ILH_CATALOG : RID_IL_CATALOG, bHighContrast );
diff --git a/starmath/source/typemap.cxx b/starmath/source/typemap.cxx
index d0e796533e3f..bc61839af470 100644
--- a/starmath/source/typemap.cxx
+++ b/starmath/source/typemap.cxx
@@ -141,10 +141,10 @@
#define SvxCellVerJustifyEnumItem SfxVoidItem
#define SvxCellOrientationEnumItem SfxVoidItem
#include <sfx2/msg.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/stritem.hxx>
+#include <svl/eitem.hxx>
#include <svx/zoomitem.hxx>
-#include <svtools/slstitm.hxx>
+#include <svl/slstitm.hxx>
#define SFX_TYPEMAP
#include "smslots.hxx"
diff --git a/starmath/source/types.cxx b/starmath/source/types.cxx
index 6a4fe919ae95..9f02e27876b6 100644
--- a/starmath/source/types.cxx
+++ b/starmath/source/types.cxx
@@ -35,227 +35,21 @@
#include <types.hxx>
-//!! no official unicode code point for these in non-private-area
-//!! (even MathMl uses the code points listed on the right which are
-//!! from the private-use-area as well)
-// MS_UNDERBRACE = (xub_Unicode) 0xE081, 0xF613 ?
-// MS_OVERBRACE = (xub_Unicode) 0xE082, 0xF612 ?
-
-struct MathConversionEntry
-{
- sal_Unicode cMath; // code point of the character from the
- // StarSymbol/OpenSymbol private-use-area
- sal_Unicode cUnicode; // 'official' Unicode code point the above
- // character should be matched to and vice versa.
- // See http://www.w3.org/TR/2000/WD-MathML2-20000211/bycodes.html
- // for most of them.
-// const sal_Unicode *pFontName;
- sal_Unicode cMathType; // 0 if the same value of cUnicode is to be used
-};
-
-static MathConversionEntry aMathConvTbl[] =
-{
-// MS_UNDERBRACE, 0xF613, // only Math-ML code-point available !
-// MS_OVERBRACE, 0xF612, // only Math-ML code-point available !
- { MS_PLUS, 0x002B, 0 },
- { MS_LT, 0x003C, 0 },
- { MS_GT, 0x003E, 0 },
- { MS_LESLANT, 0x2264, 0 },
- { MS_GESLANT, 0x2265, 0 },
- { MS_DOTSLOW, 0x2026, 0 },
- { MS_RIGHTARROW, 0x2192, 0 },
- { MS_SQRT, 0x221A, 0 },
- { MS_HAT, 0x02C6, 0 },
- { MS_CHECK, 0x02C7, 0 },
- { MS_BREVE, 0x02D8, 0 },
- { MS_ACUTE, 0x00B4, 0 },
- { MS_GRAVE, 0x0060, 0 },
- { MS_TILDE, 0x02DC, 0 },
- { MS_BAR, 0x02C9, 0 },
- { MS_VEC, 0x2192, 0 },
- { MS_DDDOT, 0x22EF, 0 },
- { MS_LPARENT, 0x0028, 0 },
- { MS_RPARENT, 0x0029, 0 },
- { MS_PLACE, 0x25A1, 0 },
- { MS_LEFTARROW, 0x2190, 0 },
- { MS_UPARROW, 0x2191, 0 },
- { MS_DOWNARROW, 0x2193, 0 },
- { MS_PLACE, 0x2751, 0 },
-
- // predefined-user-defined symbols
- // (code-points on the left as defined in 'officecfg' for SO8,
- // non-private-use-area characters uncommented):
-
-// 0x0041, 0x0391, 0, // %ALPHA
-// 0x0042, 0x0392, 0, // %BETA
- { 0xE0AC, 0x0393, 0 }, // %GAMMA
- { 0xE0AD, 0x0394, 0 }, // %DELTA
-// 0x0045, 0x0395, 0, // %EPSILON
-// 0x005A, 0x0396, 0, // %ZETA
-// 0x0048, 0x0397, 0, // %ETA
- { 0xE0AE, 0x0398, 0 }, // %THETA
-// 0x0049, 0x0399, 0, // %IOTA
-// 0x004B, 0x039A, 0, // %KAPPA
- { 0xE0AF, 0x039B, 0 }, // %LAMBDA
-// 0x004D, 0x039C, 0, // %MU
-// 0x004E, 0x039D, 0, // %NU
- { 0xE0B0, 0x039E, 0 }, // %XI
-// 0x004F, 0x039F, 0, // %OMICRON
- { 0xE0B1, 0x03A0, 0 }, // %PI
-// 0x0050, 0x03A1, 0, // %RHO
- { 0xE0B2, 0x03A3, 0 }, // %SIGMA
-// 0x0054, 0x03A4, 0, // %TAU
- { 0xE0B3, 0x03A5, 0 }, // %UPSILON
- { 0xE0B4, 0x03A6, 0 }, // %PHI
-// 0x0058, 0x03A7, 0, // %CHI
- { 0xE0B5, 0x03A8, 0 }, // %PSI
- { 0xE0B6, 0x03A9, 0 }, // %OMEGA
-
- { 0xE0B7, 0x03B1, 0 }, // %alpha
- { 0xE0B8, 0x03B2, 0 }, // %beta
- { 0xE0B9, 0x03B3, 0 }, // %gamma
- { 0xE0BA, 0x03B4, 0 }, // %delta
- { 0xE0BB, 0x03B5, 0 }, // %epsilon
- { 0xE0BC, 0x03B6, 0 }, // %zeta
- { 0xE0BD, 0x03B7, 0 }, // %eta
- { 0xE0BE, 0x03B8, 0 }, // %theta
- { 0xE0BF, 0x03B9, 0 }, // %iota
- { 0xE0C0, 0x03BA, 0 }, // %kappa
- { 0xE0C1, 0x03BB, 0 }, // %lambda
- { 0xE0C2, 0x03BC, 0 }, // %mu
- { 0xE0C3, 0x03BD, 0 }, // %nu
- { 0xE0C4, 0x03BE, 0 }, // %xi
- { 0xE0C5, 0x03BF, 0 }, // %omicron
- { 0xE0C6, 0x03C0, 0 }, // %pi
- { 0xE0C7, 0x03C1, 0 }, // %rho
- { 0xE0C8, 0x03C3, 0 }, // %sigma
- { 0xE0C9, 0x03C4, 0 }, // %tau
- { 0xE0CA, 0x03C5, 0 }, // %upsilon
- { 0xE0CB, 0x03C6, 0 }, // %phi
- { 0xE0CC, 0x03C7, 0 }, // %chi
- { 0xE0CD, 0x03C8, 0 }, // %psi
- { 0xE0CE, 0x03C9, 0 }, // %omega
-
- { 0xE0CF, 0x025B, 0,/*x03B5*/}, // %varepsilon
- { 0xE0D0, 0x03D1, 0 }, // %vartheta
- { 0xE0D4, 0x03D5, 0 }, // %varphi
- { 0xE0D1, 0x03D6, 0 }, // %varpi
-// 0x03F1, 0x03F1, 0/*x03C1*/, // %varrho
- { 0xE0D3, 0x03C2, 0 }, // %varsigma
-
-// 0x2227, 0x2227, 0, // %and
-// 0x2228, 0x2228, 0, // %or
-// 0x2208, 0x2208, 0, // %element
-// 0x2209, 0x2209, 0, // %noelement
-// 0x226B, 0x226B, 0, // %strictlygreaterthan
-// 0x226A, 0x226A, 0, // %strictlylessthan
-// 0x2261, 0x2261, 0, // %identical
-// 0x221E, 0x221E, 0, // %infinite
-// 0x2260, 0x2260, 0, // %notequal
- { 0xE080, 0x2030, 0 }, // %perthousand
-// 0x2222, 0x2222, 0, // %angle
- { 0xE08C, 0x2192, 0 } // %tendto
-};
-
-
-static int nMathToUnicodeLen = sizeof(aMathConvTbl) / sizeof(aMathConvTbl[0]);
-
sal_Unicode ConvertMathPrivateUseAreaToUnicode( sal_Unicode cChar )
{
- sal_Unicode cRes = 0;
+ sal_Unicode cRes = cChar;
if (IsInPrivateUseArea( cChar ))
{
- for (int i = 0; i < nMathToUnicodeLen && cRes == 0; ++i)
- {
- if (aMathConvTbl[i].cMath == cChar)
- cRes = aMathConvTbl[i].cUnicode;
- }
- }
- return cRes;
-}
-
-#ifdef TL_NOT_YET_USED
-sal_Unicode ConvertUnicodeToMathPrivateUseArea( sal_Unicode cChar )
-{
- sal_Unicode cRes = 0;
- for (int i = 0; i < nMathToUnicodeLen && cRes == 0; ++i)
- {
- if (aMathConvTbl[i].cUnicode == cChar)
- cRes = aMathConvTbl[i].cMath;
- }
- return cRes;
-}
-
-
-sal_Unicode ConvertMathToMathType( sal_Unicode cChar )
-{
- sal_Unicode cRes = 0;
- for (int i = 0; i < nMathToUnicodeLen && cRes == 0; ++i)
- {
- const MathConversionEntry &rEntry = aMathConvTbl[i];
- if (rEntry.cMath == cChar)
- {
- cRes = rEntry.cMathType;
- if (cRes == 0)
- cRes = rEntry.cUnicode;
- }
+ DBG_ASSERT( 0, "Error: private use area characters should no longer be in use!" );
+ cRes = (sal_Unicode) '&'; // just some character that should easily be notice as odd in the context
}
return cRes;
}
-sal_Unicode ConvertMathTypeToMath( sal_Unicode cChar )
-{
- sal_Unicode cRes = 0;
- for (int i = 0; i < nMathToUnicodeLen && cRes == 0; ++i)
- {
- const MathConversionEntry &rEntry = aMathConvTbl[i];
- sal_Unicode cTmp = rEntry.cMathType;
- if (cTmp == 0)
- cTmp = rEntry.cUnicode;
- if (cTmp == cChar)
- cRes = rEntry.cMath;
- }
- return cRes;
-}
-#endif //TL_NOT_YET_USED
sal_Unicode ConvertMathToMathML( sal_Unicode cChar )
{
- sal_Unicode cRes = 0;
- if (cChar == MS_OVERBRACE)
- cRes = 0xF612; // Math-ML code-point (there is no official unicode-point)
- else if (cChar == MS_UNDERBRACE)
- cRes = 0xF613; // Math-ML code-point (there is no official unicode-point)
- else
- cRes = ConvertMathPrivateUseAreaToUnicode( cChar );
- return cRes;
-}
-
-#ifdef TL_NOT_YET_USED
-sal_Unicode ConvertMathMLToMath( sal_Unicode cChar )
-{
- sal_Unicode cRes = 0;
- if (cChar == 0xF612)
- cRes = MS_OVERBRACE; // Math-ML code-point (there is no official unicode-point)
- else if (cChar == 0xF613)
- cRes = MS_UNDERBRACE; // Math-ML code-point (there is no official unicode-point)
- else
- cRes = ConvertUnicodeToMathPrivateUseArea( cChar );
+ sal_Unicode cRes = ConvertMathPrivateUseAreaToUnicode( cChar );
return cRes;
}
-
-sal_Unicode GetTokenChar( sal_Unicode cChar, sal_Bool bConvertForExport )
-{
- sal_Unicode cRes = cChar;
- if (bConvertForExport)
- {
- sal_Unicode cTmp = ConvertMathPrivateUseAreaToUnicode( cChar );
- if (cTmp != 0)
- cRes = cTmp;
- }
- return cRes;
-}
-#endif //TL_NOT_YET_USED
-
-
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index ed6e5b6bd23f..6a4a65b7e228 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -37,7 +37,7 @@
#include <sfx2/printer.hxx>
#include <vcl/svapp.hxx>
#include <svtools/ctrltool.hxx>
-#include <svtools/itemprop.hxx>
+#include <svl/itemprop.hxx>
#include <unotools/localedatawrapper.hxx>
#include <unotools/processfactory.hxx>
#include <svx/paperinf.hxx>
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 5492553e46fe..855831fc9e9f 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -51,15 +51,15 @@
#include <sfx2/objface.hxx>
#include <sfx2/printer.hxx>
#include <sfx2/request.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/intitem.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/poolitem.hxx>
-#include <svtools/ptitem.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/itemset.hxx>
+#include <svl/poolitem.hxx>
+#include <svl/ptitem.hxx>
+#include <svl/stritem.hxx>
#include <svtools/transfer.hxx>
-#include <svtools/undo.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/undo.hxx>
+#include <svl/whiter.hxx>
#include <svx/dialogs.hrc>
#include <svx/editeng.hxx>
#include <svx/svxdlg.hxx>
@@ -1653,7 +1653,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aSet, RID_SVXDLG_ZOOM);
+ pDlg = pFact->CreateSvxZoomDialog(&GetViewFrame()->GetWindow(), aSet);
DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
}
pDlg->SetLimits( MINZOOM, MAXZOOM );
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index e01041edafcd..36e9bdd08639 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -31,8 +31,6 @@
#ifndef _POSTITMGR_HXX
#define _POSTITMGR_HXX
-#include <svtools/lstner.hxx>
-
#include <list>
#include <vector>
#include <svx/outlobj.hxx>
@@ -41,8 +39,10 @@
#include <tools/debug.hxx>
#include <swrect.hxx>
#include <unotools/configitem.hxx>
+#include <unotools/options.hxx>
#include <com/sun/star/util/SearchOptions.hpp>
#include <com/sun/star/uno/Any.hxx>
+#include <svl/lstner.hxx>
class SwWrtShell;
class SwDoc;
@@ -139,6 +139,9 @@ class SwNoteProps: public utl::ConfigItem
}
return aNames;
}
+
+ virtual void Commit();
+ virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
};
class SwPostItMgr: public SfxListener
diff --git a/sw/inc/SwAppletImpl.hxx b/sw/inc/SwAppletImpl.hxx
index fcf9d727f05e..8ea953136e49 100644
--- a/sw/inc/SwAppletImpl.hxx
+++ b/sw/inc/SwAppletImpl.hxx
@@ -46,9 +46,9 @@
#include <vcl/wrkwin.hxx>
#endif
#include <sot/storage.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
-#include <svtools/ownlist.hxx>
+#include <svl/ownlist.hxx>
class SfxItemSet;
diff --git a/sw/inc/SwNumberTree.hxx b/sw/inc/SwNumberTree.hxx
index 03815a265c18..7f4c88b6081c 100644
--- a/sw/inc/SwNumberTree.hxx
+++ b/sw/inc/SwNumberTree.hxx
@@ -385,7 +385,7 @@ public:
// RTL_TEXTENCODING_ASCII_US),
// int nDepth = -1) const;
-#ifndef PRODUCT
+#ifdef DBG_UTIL
static unsigned long GetInstances();
unsigned long GetSerial();
#endif
@@ -494,7 +494,7 @@ protected:
*/
mutable tSwNumberTreeChildren::iterator mItLastValid;
-#ifndef PRODUCT
+#ifdef DBG_UTIL
/**
Counter for the number of created instances.
*/
diff --git a/sw/inc/acmplwrd.hxx b/sw/inc/acmplwrd.hxx
index 964371ca40da..31041cd700dc 100644
--- a/sw/inc/acmplwrd.hxx
+++ b/sw/inc/acmplwrd.hxx
@@ -32,7 +32,7 @@
#define _SVSTDARR_STRINGSISORTDTOR
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
class SwDoc;
class SwAutoCompleteWord_Impl;
diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx
index 1b209ac0b47c..8447210a2d01 100644
--- a/sw/inc/authfld.hxx
+++ b/sw/inc/authfld.hxx
@@ -35,7 +35,7 @@
#include <toxe.hxx>
#define _SVSTDARR_LONGS
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
class SwAuthDataArr;
/* -----------------21.09.99 13:32-------------------
diff --git a/sw/inc/calc.hxx b/sw/inc/calc.hxx
index 91f1e538d355..e336a4fea524 100644
--- a/sw/inc/calc.hxx
+++ b/sw/inc/calc.hxx
@@ -30,7 +30,7 @@
#ifndef _CALC_HXX
#define _CALC_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#ifndef __SBX_SBXVALUE //autogen
#include <basic/sbxvar.hxx>
diff --git a/sw/inc/ccoll.hxx b/sw/inc/ccoll.hxx
index cd25c3c6f892..fe8051c8465c 100644
--- a/sw/inc/ccoll.hxx
+++ b/sw/inc/ccoll.hxx
@@ -30,7 +30,7 @@
#ifndef _CCOLL_HXX
#define _CCOLL_HXX
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <tools/string.hxx>
#include <sfx2/tabdlg.hxx>
diff --git a/sw/inc/cellatr.hxx b/sw/inc/cellatr.hxx
index 1ea47d89f8c9..6ce11b1e6cb8 100644
--- a/sw/inc/cellatr.hxx
+++ b/sw/inc/cellatr.hxx
@@ -31,8 +31,8 @@
#ifndef _CELLATR_HXX
#define _CELLATR_HXX
-#include <svtools/intitem.hxx>
-#include <svtools/zforlist.hxx>
+#include <svl/intitem.hxx>
+#include <svl/zforlist.hxx>
#include "swdllapi.h"
#include "format.hxx"
#include "cellfml.hxx"
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 85fea8317ef2..b0c8a54125f0 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -111,7 +111,7 @@ struct SwContentAtPos
SW_NUMLABEL = 0x0200, // #i23726#
SW_CONTENT_CHECK = 0x0400, // --> FME 2005-05-13 #i43742# <--
SW_SMARTTAG = 0x0800
-#ifndef PRODUCT
+#ifdef DBG_UTIL
,SW_CURR_ATTRS = 0x4000 // nur zum Debuggen
,SW_TABLEBOXVALUE = 0x8000 // nur zum Debuggen
#endif
@@ -465,7 +465,7 @@ public:
*/
void Combine();
-#if defined( PRODUCT )
+#if !defined(DBG_UTIL)
void SttCrsrMove() { ++nCrsrMove; StartAction(); }
void EndCrsrMove( const BOOL bIdleEnd = FALSE )
{ EndAction( bIdleEnd ); --nCrsrMove; }
diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx
index 0c359bd05cdb..dfb67a7025f9 100644
--- a/sw/inc/dbmgr.hxx
+++ b/sw/inc/dbmgr.hxx
@@ -33,7 +33,7 @@
#include <tools/string.hxx>
#include <tools/link.hxx>
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <com/sun/star/util/Date.hpp>
#include "swdllapi.h"
#include <swdbdata.hxx>
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index de82d9056ff9..df81a13dab12 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -60,7 +60,7 @@ class SwList;
// <--
#include <IDocumentExternalData.hxx>
#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <vcl/timer.hxx>
@@ -77,7 +77,7 @@ class SwList;
#include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
#include <vos/ref.hxx>
#include <svx/svdtypes.hxx>
-#include <svtools/style.hxx>
+#include <svl/style.hxx>
#include <svx/numitem.hxx>
#include "comphelper/implementationreference.hxx"
#include <com/sun/star/chart2/data/XDataProvider.hpp>
@@ -492,7 +492,7 @@ private:
bool mbColumnSelection : 1; // true: this content has bee created by a column selection
// (clipboard docs only)
-#ifndef PRODUCT
+#ifdef DBG_UTIL
bool mbXMLExport : 1; // TRUE: during XML export
#endif
@@ -1066,7 +1066,7 @@ public:
inline void SetOLEPrtNotifyPending( bool bSet = true );
void PrtOLENotify( sal_Bool bAll ); //Alle oder nur Markierte
-#ifndef PRODUCT
+#ifdef DBG_UTIL
bool InXMLExport() const { return mbXMLExport; }
void SetXMLExport( bool bFlag ) { mbXMLExport = bFlag; }
#endif
diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index c8ffcba549ab..d993c0949f2a 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -51,7 +51,7 @@ namespace com { namespace sun { namespace star { namespace i18n {
#include <tools/table.hxx>
#endif
#include <swtypes.hxx>
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
typedef SwFieldType* SwFldTypePtr;
#define GROW_FLDTYPES 16
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 6ed3f6d652bd..a0c7635029f0 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -39,7 +39,7 @@
#include <swdll.hxx>
#include <shellid.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <svtools/embedhlp.hxx>
class SwDoc;
diff --git a/sw/inc/docstat.hxx b/sw/inc/docstat.hxx
index 9e03f57d5a97..4575796440bf 100644
--- a/sw/inc/docstat.hxx
+++ b/sw/inc/docstat.hxx
@@ -33,12 +33,6 @@
#include <tools/solar.h>
#include "swdllapi.h"
-///////////////////////////////////////////////////////////////////////////
-// PRODUCT: struct SwInternStat ist nur fuer CORE Interne Statistics und
-// hat nichts in einer ProductVersion zu suchen.
-///////////////////////////////////////////////////////////////////////////
-
-struct SwInternStat;
struct SW_DLLPUBLIC SwDocStat
{
@@ -46,11 +40,14 @@ struct SW_DLLPUBLIC SwDocStat
USHORT nGrf;
USHORT nOLE;
ULONG nPage;
+ /// paragraphs for document statistic: non-empty and non-hidden ones
ULONG nPara;
+ /// all paragraphs, including empty/hidden ones
+ ULONG nAllPara;
ULONG nWord;
ULONG nChar;
BOOL bModified;
- SwInternStat* pInternStat;
+
SwDocStat();
void Reset();
};
diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx
index e93972690e66..f7e6019de511 100644
--- a/sw/inc/docstyle.hxx
+++ b/sw/inc/docstyle.hxx
@@ -34,10 +34,10 @@
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#endif
-#include <svtools/style.hxx>
-#include <svtools/itemset.hxx>
+#include <svl/style.hxx>
+#include <svl/itemset.hxx>
#include "swdllapi.h"
class SwDoc;
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 88c4e650cfd0..6048a18c3a8b 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -35,7 +35,7 @@
#include <tools/datetime.hxx>
-#include <svtools/macitem.hxx>
+#include <svl/macitem.hxx>
#include "fldbas.hxx"
#include "numrule.hxx"
@@ -548,6 +548,8 @@ public:
const OutlinerParaObject* GetTextObject() const;
void SetTextObject( OutlinerParaObject* pText );
+ sal_uInt32 GetNumberOfParagraphs() const;
+
virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
virtual String GetDescription() const;
diff --git a/sw/inc/edglbldc.hxx b/sw/inc/edglbldc.hxx
index b2c5d411f07a..be792453e485 100644
--- a/sw/inc/edglbldc.hxx
+++ b/sw/inc/edglbldc.hxx
@@ -30,7 +30,7 @@
#ifndef _EDGLBLDC_HXX
#define _EDGLBLDC_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
class SwSection;
class SwTOXBase;
diff --git a/sw/inc/edimp.hxx b/sw/inc/edimp.hxx
index 8cfa04648cf7..8b8a6c8bfde4 100644
--- a/sw/inc/edimp.hxx
+++ b/sw/inc/edimp.hxx
@@ -32,7 +32,7 @@
#define _EDIMP_HXX
#include <tools/solar.h>
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
class SwPaM;
class SwNodeIndex;
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 1ce87e0df410..d802eb910cff 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -33,7 +33,7 @@
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <tools/string.hxx>
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <vcl/font.hxx>
#include <svx/swafopt.hxx>
#include "swdllapi.h"
diff --git a/sw/inc/errhdl.hxx b/sw/inc/errhdl.hxx
index f9fae69e7358..3d7c8a19085d 100644
--- a/sw/inc/errhdl.hxx
+++ b/sw/inc/errhdl.hxx
@@ -30,7 +30,7 @@
#ifndef _ERRHDL_HXX
#define _ERRHDL_HXX
-#ifndef PRODUCT
+#ifdef DBG_UTIL
#include <tools/solar.h>
#include <sal/types.h>
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index 83629f8cf6d5..00a7c57efb3b 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -30,7 +30,7 @@
#ifndef _EXPFLD_HXX
#define _EXPFLD_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include "swdllapi.h"
#include <fldbas.hxx>
#include <cellfml.hxx>
diff --git a/sw/inc/extinput.hxx b/sw/inc/extinput.hxx
index c11c6b9ecaf0..05b88d1bd5a6 100644
--- a/sw/inc/extinput.hxx
+++ b/sw/inc/extinput.hxx
@@ -32,7 +32,7 @@
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_USHORTS
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#endif
#include <pam.hxx>
#include <i18npool/lang.h>
diff --git a/sw/inc/fchrfmt.hxx b/sw/inc/fchrfmt.hxx
index c34d6f484037..b201dddf4f05 100644
--- a/sw/inc/fchrfmt.hxx
+++ b/sw/inc/fchrfmt.hxx
@@ -31,7 +31,7 @@
#define _FCHRFMT_HXX
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <calbck.hxx>
#include <format.hxx>
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 11213224844c..186ca702c8f0 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -278,7 +278,7 @@ protected:
public:
-#ifndef PRODUCT
+#ifdef DBG_UTIL
virtual ~SwFieldType();
#endif
static const String& GetTypeStr( USHORT nTypeId );
@@ -337,7 +337,7 @@ public:
// ResId
USHORT Which() const
-#ifdef PRODUCT
+#ifndef DBG_UTIL
{ return pType->Which(); }
#else
; // in fldbas.cxx implementiert
diff --git a/sw/inc/flypos.hxx b/sw/inc/flypos.hxx
index 287e6544712b..0ac8b016d24d 100644
--- a/sw/inc/flypos.hxx
+++ b/sw/inc/flypos.hxx
@@ -31,7 +31,7 @@
#define _FLYPOS_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <swdllapi.h>
class SwFrmFmt;
diff --git a/sw/inc/fmtanchr.hxx b/sw/inc/fmtanchr.hxx
index fd6975205347..d74ed247e0cc 100644
--- a/sw/inc/fmtanchr.hxx
+++ b/sw/inc/fmtanchr.hxx
@@ -34,7 +34,7 @@
#include <hintids.hxx>
#include <swtypes.hxx>
#include <format.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
struct SwPosition;
class IntlWrapper;
diff --git a/sw/inc/fmtautofmt.hxx b/sw/inc/fmtautofmt.hxx
index 1d4df2210f15..b39475c8a54c 100644
--- a/sw/inc/fmtautofmt.hxx
+++ b/sw/inc/fmtautofmt.hxx
@@ -31,7 +31,7 @@
#define _FMTAUTOFMT_HXX
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <format.hxx>
#include <boost/shared_ptr.hpp>
diff --git a/sw/inc/fmtclbl.hxx b/sw/inc/fmtclbl.hxx
index c10898ca5716..58d87a06ae42 100644
--- a/sw/inc/fmtclbl.hxx
+++ b/sw/inc/fmtclbl.hxx
@@ -31,7 +31,7 @@
#define _FMTCLBL_HXX
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <hintids.hxx>
#include <format.hxx>
#include "swdllapi.h"
diff --git a/sw/inc/fmtclds.hxx b/sw/inc/fmtclds.hxx
index 3a4069f22acb..c50bfd5bc1a2 100644
--- a/sw/inc/fmtclds.hxx
+++ b/sw/inc/fmtclds.hxx
@@ -31,7 +31,7 @@
#define _FMTCLDS_HXX
#include <tools/color.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include "swdllapi.h"
#include <hintids.hxx>
#include <format.hxx>
diff --git a/sw/inc/fmtcnct.hxx b/sw/inc/fmtcnct.hxx
index d229f91b8b78..20e33fbe7439 100644
--- a/sw/inc/fmtcnct.hxx
+++ b/sw/inc/fmtcnct.hxx
@@ -31,7 +31,7 @@
#define _FMTCNCT_HXX
#include <hintids.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <format.hxx>
#include <calbck.hxx>
diff --git a/sw/inc/fmtcntnt.hxx b/sw/inc/fmtcntnt.hxx
index c5b262331e44..f5a5443c14be 100644
--- a/sw/inc/fmtcntnt.hxx
+++ b/sw/inc/fmtcntnt.hxx
@@ -30,7 +30,7 @@
#ifndef _FMTCNTNT_HXX
#define _FMTCNTNT_HXX
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <hintids.hxx>
#include <format.hxx>
diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx
index d06a64cf9bfd..8b4d3cb285b7 100644
--- a/sw/inc/fmtcol.hxx
+++ b/sw/inc/fmtcol.hxx
@@ -30,7 +30,7 @@
#ifndef _FMTCOL_HXX
#define _FMTCOL_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include "swdllapi.h"
#include <format.hxx>
#include <swtypes.hxx> // fuer MAXLEVEL
diff --git a/sw/inc/fmteiro.hxx b/sw/inc/fmteiro.hxx
index a45e9fafc495..b7ab6bc01543 100644
--- a/sw/inc/fmteiro.hxx
+++ b/sw/inc/fmteiro.hxx
@@ -31,7 +31,7 @@
#define _FMTEIRO_HXX
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <hintids.hxx>
#include <format.hxx>
#include "swdllapi.h"
diff --git a/sw/inc/fmtflcnt.hxx b/sw/inc/fmtflcnt.hxx
index c018e8c31c14..3bb498aee050 100644
--- a/sw/inc/fmtflcnt.hxx
+++ b/sw/inc/fmtflcnt.hxx
@@ -31,7 +31,7 @@
#define _FMTFLCNT_HXX
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
class SwFrmFmt;
class SwTxtFlyCnt;
diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx
index 2ca982e80c0b..58fbe2c05699 100644
--- a/sw/inc/fmtfld.hxx
+++ b/sw/inc/fmtfld.hxx
@@ -30,9 +30,9 @@
#ifndef _FMTFLD_HXX
#define _FMTFLD_HXX
-#include <svtools/poolitem.hxx>
-#include <svtools/brdcst.hxx>
-#include <svtools/smplhint.hxx>
+#include <svl/poolitem.hxx>
+#include <svl/brdcst.hxx>
+#include <svl/smplhint.hxx>
#include "swdllapi.h"
#include <calbck.hxx>
diff --git a/sw/inc/fmtfollowtextflow.hxx b/sw/inc/fmtfollowtextflow.hxx
index a33cf8a16475..c049b9e9eaa0 100644
--- a/sw/inc/fmtfollowtextflow.hxx
+++ b/sw/inc/fmtfollowtextflow.hxx
@@ -31,7 +31,7 @@
#define _FMTFOLLOWTEXTFLOW_HXX
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <hintids.hxx>
#include <format.hxx>
#include "swdllapi.h"
diff --git a/sw/inc/fmtfordr.hxx b/sw/inc/fmtfordr.hxx
index 93107807d1cd..7227d719c51c 100644
--- a/sw/inc/fmtfordr.hxx
+++ b/sw/inc/fmtfordr.hxx
@@ -30,7 +30,7 @@
#ifndef _FMTFORDR_HXX
#define _FMTFORDR_HXX
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <hintids.hxx>
#include <format.hxx>
diff --git a/sw/inc/fmtfsize.hxx b/sw/inc/fmtfsize.hxx
index b28e3ac94be1..f2486aa916f0 100644
--- a/sw/inc/fmtfsize.hxx
+++ b/sw/inc/fmtfsize.hxx
@@ -31,7 +31,7 @@
#define _FMTFSIZE_HXX
#include <tools/gen.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include "swdllapi.h"
#include <hintids.hxx>
#include <swtypes.hxx>
diff --git a/sw/inc/fmtftn.hxx b/sw/inc/fmtftn.hxx
index e31001ced75f..ca04985bff76 100644
--- a/sw/inc/fmtftn.hxx
+++ b/sw/inc/fmtftn.hxx
@@ -31,7 +31,7 @@
#define _FMTFTN_HXX
#include <tools/string.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include "swdllapi.h"
class SwDoc;
diff --git a/sw/inc/fmtftntx.hxx b/sw/inc/fmtftntx.hxx
index 8e95c4e7128a..b5cbfbfdc6bf 100644
--- a/sw/inc/fmtftntx.hxx
+++ b/sw/inc/fmtftntx.hxx
@@ -30,7 +30,7 @@
#ifndef _FMTFTNTX_HXX
#define _FMTFTNTX_HXX
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <hintids.hxx>
#include <format.hxx>
#include <numrule.hxx>
diff --git a/sw/inc/fmthdft.hxx b/sw/inc/fmthdft.hxx
index d6661c9d4ddc..1f8e8289ee86 100644
--- a/sw/inc/fmthdft.hxx
+++ b/sw/inc/fmthdft.hxx
@@ -32,7 +32,7 @@
#include <hintids.hxx>
#include <format.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <calbck.hxx>
class SwFrmFmt;
diff --git a/sw/inc/fmtinfmt.hxx b/sw/inc/fmtinfmt.hxx
index 8efd538ca6e3..4d030da66a7c 100644
--- a/sw/inc/fmtinfmt.hxx
+++ b/sw/inc/fmtinfmt.hxx
@@ -31,7 +31,7 @@
#define _FMTINFMT_HXX
#include <tools/string.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include "swdllapi.h"
class SvxMacro;
diff --git a/sw/inc/fmtline.hxx b/sw/inc/fmtline.hxx
index 357e6cd743b3..db8a694063c3 100644
--- a/sw/inc/fmtline.hxx
+++ b/sw/inc/fmtline.hxx
@@ -31,7 +31,7 @@
#define SW_FMTLINE_HXX
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <hintids.hxx>
#include <format.hxx>
#include "swdllapi.h"
diff --git a/sw/inc/fmtlsplt.hxx b/sw/inc/fmtlsplt.hxx
index 43e7ef090df5..0b14626b518e 100644
--- a/sw/inc/fmtlsplt.hxx
+++ b/sw/inc/fmtlsplt.hxx
@@ -30,7 +30,7 @@
#ifndef _FMTTSPLT_HXX
#define _FMTTSPLT_HXX
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <hintids.hxx>
#include <format.hxx>
#include "swdllapi.h"
diff --git a/sw/inc/fmtmeta.hxx b/sw/inc/fmtmeta.hxx
index 952181d0498c..f676469b908f 100755..100644
--- a/sw/inc/fmtmeta.hxx
+++ b/sw/inc/fmtmeta.hxx
@@ -31,7 +31,7 @@
#ifndef SW_FMTMETA_HXX
#define SW_FMTMETA_HXX
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <sfx2/Metadatable.hxx>
#include <boost/shared_ptr.hpp>
diff --git a/sw/inc/fmtornt.hxx b/sw/inc/fmtornt.hxx
index 8c2dcaff59bd..bdd03264e45c 100644
--- a/sw/inc/fmtornt.hxx
+++ b/sw/inc/fmtornt.hxx
@@ -37,7 +37,7 @@
#include <hintids.hxx>
#include <swtypes.hxx>
#include <format.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
class IntlWrapper;
diff --git a/sw/inc/fmtpdsc.hxx b/sw/inc/fmtpdsc.hxx
index 2c3f88f962b2..0cf3f4a82523 100644
--- a/sw/inc/fmtpdsc.hxx
+++ b/sw/inc/fmtpdsc.hxx
@@ -31,7 +31,7 @@
#define _FMTPDSC_HXX
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include "swdllapi.h"
#include <hintids.hxx>
#include <format.hxx>
diff --git a/sw/inc/fmtrfmrk.hxx b/sw/inc/fmtrfmrk.hxx
index cb12e38cf582..0be58da182aa 100644
--- a/sw/inc/fmtrfmrk.hxx
+++ b/sw/inc/fmtrfmrk.hxx
@@ -32,7 +32,7 @@
#include <tools/string.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
class SwTxtRefMark;
diff --git a/sw/inc/fmtrowsplt.hxx b/sw/inc/fmtrowsplt.hxx
index b398721e6246..6e15073813ab 100644
--- a/sw/inc/fmtrowsplt.hxx
+++ b/sw/inc/fmtrowsplt.hxx
@@ -30,7 +30,7 @@
#ifndef _FMTROWSPLT_HXX
#define _FMTROWSPLT_HXX
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include "swdllapi.h"
#include <hintids.hxx>
#include <format.hxx>
diff --git a/sw/inc/fmtruby.hxx b/sw/inc/fmtruby.hxx
index 516d5c3d8eed..b7a461427477 100644
--- a/sw/inc/fmtruby.hxx
+++ b/sw/inc/fmtruby.hxx
@@ -32,7 +32,7 @@
#include <tools/string.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
class SwTxtRuby;
diff --git a/sw/inc/fmtsrnd.hxx b/sw/inc/fmtsrnd.hxx
index ec6abe89e936..32b0e7d8e9bf 100644
--- a/sw/inc/fmtsrnd.hxx
+++ b/sw/inc/fmtsrnd.hxx
@@ -33,7 +33,7 @@
#include "swdllapi.h"
#include <hintids.hxx>
#include <format.hxx>
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
// --> OD 2006-08-15 #i68520# - refactoring
// separate enumeration <SwSurround> in own header file
diff --git a/sw/inc/fmturl.hxx b/sw/inc/fmturl.hxx
index bfc82fd4913a..b4bd47a68e9b 100644
--- a/sw/inc/fmturl.hxx
+++ b/sw/inc/fmturl.hxx
@@ -30,7 +30,7 @@
#ifndef _FMTURL_HXX
#define _FMTURL_HXX
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include "swdllapi.h"
#include <hintids.hxx>
#include <format.hxx>
diff --git a/sw/inc/fmtwrapinfluenceonobjpos.hxx b/sw/inc/fmtwrapinfluenceonobjpos.hxx
index b9ece15840e7..098c42cafc01 100644
--- a/sw/inc/fmtwrapinfluenceonobjpos.hxx
+++ b/sw/inc/fmtwrapinfluenceonobjpos.hxx
@@ -32,7 +32,7 @@
#include <hintids.hxx>
#include <format.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <com/sun/star/text/WrapInfluenceOnPosition.hpp>
class SW_DLLPUBLIC SwFmtWrapInfluenceOnObjPos: public SfxPoolItem
diff --git a/sw/inc/ftnidx.hxx b/sw/inc/ftnidx.hxx
index 15ab804b5ee0..a06ed6b61769 100644
--- a/sw/inc/ftnidx.hxx
+++ b/sw/inc/ftnidx.hxx
@@ -32,7 +32,7 @@
#define _SVSTDARR_USHORTS
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
class SwTxtFtn;
class SwNodeIndex;
diff --git a/sw/inc/grfatr.hxx b/sw/inc/grfatr.hxx
index f9a232bae0ef..377f1edbada3 100644
--- a/sw/inc/grfatr.hxx
+++ b/sw/inc/grfatr.hxx
@@ -32,8 +32,8 @@
#include <hintids.hxx> // fuer die WhichIds @@@ must be included first @@@
#include <tools/gen.hxx>
-#include <svtools/eitem.hxx>
-#include <svtools/intitem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/intitem.hxx>
#include <svx/grfcrop.hxx>
#include "swdllapi.h"
#include <swatrset.hxx> // fuer inlines
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index f709c95038f0..6bab531ad1c5 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -28,7 +28,7 @@
*
************************************************************************/
#ifndef _SOLAR_HRC
-#include <svtools/solar.hrc>
+#include <svl/solar.hrc>
#endif
#define HID_BASE HID_APP_START
diff --git a/sw/inc/hfspacingitem.hxx b/sw/inc/hfspacingitem.hxx
index 17b62c0d4760..032f4de88fd4 100644
--- a/sw/inc/hfspacingitem.hxx
+++ b/sw/inc/hfspacingitem.hxx
@@ -31,7 +31,7 @@
#define _SW_HF_EAT_SPACINGITEM_HXX
-#include <svtools/eitem.hxx>
+#include <svl/eitem.hxx>
#include <hintids.hxx>
#include <format.hxx>
diff --git a/sw/inc/hints.hxx b/sw/inc/hints.hxx
index f1911ce7f0c1..16f8568bcf74 100644
--- a/sw/inc/hints.hxx
+++ b/sw/inc/hints.hxx
@@ -88,14 +88,6 @@ public:
};
-class SwInsChr: public SwMsgPoolItem
-{
-public:
- xub_StrLen nPos;
-
- SwInsChr( USHORT nP );
-};
-
class SwInsTxt: public SwMsgPoolItem
{
public:
@@ -214,7 +206,7 @@ public:
USHORT Count() const { return pChgSet->Count(); }
void ClearItem( USHORT nWhichL = 0 )
-#ifdef PRODUCT
+#ifndef DBG_UTIL
{ pChgSet->ClearItem( nWhichL ); }
#else
;
@@ -270,17 +262,6 @@ public:
//};
// <--
-class SwNRuleLowerLevel : public SwMsgPoolItem
-{
- const String& rName;
- BYTE nLvl;
-public:
- SwNRuleLowerLevel( const String& rRuleName, BYTE nLevel );
-
- const String& GetName() const { return rName; }
- BYTE GetLevel() const { return nLvl; }
-};
-
class SwFindNearestNode : public SwMsgPoolItem
{
const SwNode *pNd, *pFnd;
diff --git a/sw/inc/index.hxx b/sw/inc/index.hxx
index 9837a4e664bc..5b28034aa27a 100644
--- a/sw/inc/index.hxx
+++ b/sw/inc/index.hxx
@@ -43,7 +43,7 @@ class SwIndex;
class SwIndexReg;
struct SwPosition;
-#ifdef PRODUCT
+#ifndef DBG_UTIL
#define INLINE inline
#else
#define INLINE
@@ -53,7 +53,7 @@ class SW_DLLPUBLIC SwIndex
{
friend class SwIndexReg;
-#ifndef PRODUCT
+#ifdef DBG_UTIL
static int nSerial;
int MySerial;
#endif
@@ -150,7 +150,7 @@ public:
void MoveTo( SwIndexReg& rArr );
};
-#ifdef PRODUCT
+#ifndef DBG_UTIL
inline xub_StrLen SwIndex::operator++()
{
diff --git a/sw/inc/istyleaccess.hxx b/sw/inc/istyleaccess.hxx
index 8a770d5b012c..52ce6ea2e4ec 100644
--- a/sw/inc/istyleaccess.hxx
+++ b/sw/inc/istyleaccess.hxx
@@ -31,7 +31,7 @@
#define _ISTYLEACCESS_HXX
#include <vector>
-#include <svtools/stylepool.hxx>
+#include <svl/stylepool.hxx>
/*--------------------------------------------------------------------
Management of (automatic) styles
diff --git a/sw/inc/makefile.mk b/sw/inc/makefile.mk
index 36aa66102618..16adca8192b8 100644
--- a/sw/inc/makefile.mk
+++ b/sw/inc/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -44,10 +44,10 @@ TARGET=inc
.INCLUDE : target.mk
-.IF "$(ENABLE_PCH)"!="" && ( "$(PRJNAME)"!="sw" || "$(BUILD_SPECIAL)"!="TRUE" )
+.IF "$(ENABLE_PCH)"!="" # && ( "$(PRJNAME)"!="sw" || "$(BUILD_SPECIAL)"!="TRUE" )
ALLTAR : \
$(SLO)$/precompiled.pch \
$(SLO)$/precompiled_ex.pch
-
+
.ENDIF # "$(ENABLE_PCH)"!=""
diff --git a/sw/inc/modcfg.hxx b/sw/inc/modcfg.hxx
index d17311027111..b800cb3dfc8e 100644
--- a/sw/inc/modcfg.hxx
+++ b/sw/inc/modcfg.hxx
@@ -33,7 +33,7 @@
#include <tools/string.hxx>
#include <vcl/wintypes.hxx>
#include <vcl/field.hxx>
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <unotools/configitem.hxx>
#include "swdllapi.h"
#include "authratr.hxx"
@@ -78,6 +78,7 @@ class SwRevisionConfig : public utl::ConfigItem
~SwRevisionConfig();
virtual void Commit();
+ virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
void Load();
void SetModified(){ConfigItem::SetModified();}
};
@@ -108,6 +109,7 @@ class SwInsertConfig : public utl::ConfigItem
~SwInsertConfig();
virtual void Commit();
+ virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
void Load();
void SetModified(){ConfigItem::SetModified();}
};
@@ -134,6 +136,7 @@ class SwTableConfig : public utl::ConfigItem
~SwTableConfig();
virtual void Commit();
+ virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
void Load();
void SetModified(){ConfigItem::SetModified();}
};
@@ -163,6 +166,7 @@ class SwMiscConfig : public utl::ConfigItem
~SwMiscConfig();
virtual void Commit();
+ virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
void Load();
void SetModified(){ConfigItem::SetModified();}
};
diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index 6bbd72778498..9f27b1885fe1 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -32,7 +32,7 @@
#define _NDARR_HXX
#include <com/sun/star/embed/XEmbeddedObject.hpp>
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#ifndef _BPARR_HXX
#include <bparr.hxx>
diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx
index e5a3ee794e0b..67cb84367515 100644
--- a/sw/inc/ndhints.hxx
+++ b/sw/inc/ndhints.hxx
@@ -31,7 +31,7 @@
#define _NDHINTS_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <tools/mempool.hxx>
#include "swtypes.hxx"
@@ -117,7 +117,7 @@ public:
{ return m_HintStarts[nIdx]; }
inline USHORT Count() const { return m_HintStarts.Count(); }
-#ifndef PRODUCT
+#ifdef DBG_UTIL
bool Check() const;
#endif
};
diff --git a/sw/inc/ndindex.hxx b/sw/inc/ndindex.hxx
index 0942621991e8..82153fa5b5e1 100644
--- a/sw/inc/ndindex.hxx
+++ b/sw/inc/ndindex.hxx
@@ -45,7 +45,7 @@ class SW_DLLPUBLIC SwNodeIndex
friend void SwNodes::DeRegisterIndex( SwNodeIndex& );
friend void SwNodes::RemoveNode( ULONG, ULONG, BOOL );
-#ifndef PRODUCT
+#ifdef DBG_UTIL
static int nSerial;
int MySerial;
#endif
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 5aa259b68c06..4862dafc6aac 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -89,7 +89,7 @@ class SW_DLLPUBLIC SwNode : private /* public*/ BigPtrEntry
{
friend class SwNodes;
-#ifndef PRODUCT
+#ifdef DBG_UTIL
static long nSerial;
long nMySerial;
#endif
@@ -114,7 +114,7 @@ protected:
public:
virtual ~SwNode();
-#ifndef PRODUCT
+#ifdef DBG_UTIL
long int GetSerial() const { return nMySerial; }
#endif
diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index 9b3714c806bf..dfaa5101c01c 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -116,7 +116,7 @@ public:
private:
friend void _FinitCore();
-#ifndef PRODUCT
+#ifdef DBG_UTIL
long int nSerial;
static long int nInstances;
#endif
diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 18579f1a918b..95e9c0ad42bb 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -192,8 +192,8 @@ public:
m_pMark = m_pPoint;
}
}
+#ifndef DBG_UTIL
-#ifdef PRODUCT
void Exchange()
{
if (m_pPoint != m_pMark)
diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx
index 3f65056e1cd5..e1b2ced1b513 100644
--- a/sw/inc/paratr.hxx
+++ b/sw/inc/paratr.hxx
@@ -29,8 +29,8 @@
************************************************************************/
#ifndef _PARATR_HXX
#define _PARATR_HXX
-#include <svtools/eitem.hxx>
-#include <svtools/stritem.hxx>
+#include <svl/eitem.hxx>
+#include <svl/stritem.hxx>
#include "swdllapi.h"
#include <hintids.hxx>
#include <calbck.hxx>
diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx
index 0a43d2c73d96..e8aadd472aa6 100644
--- a/sw/inc/pch/precompiled_sw.hxx
+++ b/sw/inc/pch/precompiled_sw.hxx
@@ -33,6 +33,7 @@
#ifdef PRECOMPILED_HEADERS
//---MARKER---
+
#include "sal/config.h"
#include "sal/types.h"
@@ -511,8 +512,6 @@
#include "cppuhelper/weak.hxx"
#include "cppuhelper/weakref.hxx"
-#include "cppunit/simpleheader.hxx"
-
#include "framework/interaction.hxx"
#include "goodies/grfmgr.hxx"
@@ -613,99 +612,99 @@
#include "sot/storinfo.hxx"
#include "svtools/FilterConfigItem.hxx"
-#include "svtools/PasswordHelper.hxx"
+#include "svl/PasswordHelper.hxx"
#include "svtools/accessibilityoptions.hxx"
-#include "svtools/aeitem.hxx"
-#include "svtools/cjkoptions.hxx"
-#include "svtools/cmdoptions.hxx"
-#include "svtools/cntnrsrt.hxx"
+#include "svl/aeitem.hxx"
+#include "svl/cjkoptions.hxx"
+#include "unotools/cmdoptions.hxx"
+#include "svl/cntnrsrt.hxx"
#include "svtools/collatorres.hxx"
#include "svtools/colorcfg.hxx"
-#include "svtools/compatibility.hxx"
+#include "unotools/compatibility.hxx"
#include "svtools/controldims.hrc"
-#include "svtools/ctloptions.hxx"
+#include "svl/ctloptions.hxx"
#include "svtools/ctrlbox.hxx"
#include "svtools/ctrltool.hxx"
#include "svtools/editbrowsebox.hxx"
#include "svtools/ehdl.hxx"
-#include "svtools/eitem.hxx"
+#include "svl/eitem.hxx"
#include "svtools/embedhlp.hxx"
#include "svtools/embedtransfer.hxx"
#include "svtools/filter.hxx"
-#include "svtools/flagitem.hxx"
-#include "svtools/fltrcfg.hxx"
-#include "svtools/fstathelper.hxx"
-#include "svtools/globalnameitem.hxx"
+#include "svl/flagitem.hxx"
+#include "unotools/fltrcfg.hxx"
+#include "svl/fstathelper.hxx"
+#include "svl/globalnameitem.hxx"
#include "svtools/headbar.hxx"
#include "svtools/htmlkywd.hxx"
#include "svtools/htmltokn.h"
-#include "svtools/imageitm.hxx"
+#include "svl/imageitm.hxx"
#include "svtools/imap.hxx"
#include "svtools/indexentryres.hxx"
-#include "svtools/inethist.hxx"
+#include "svl/inethist.hxx"
#include "svtools/inetimg.hxx"
#include "svtools/insdlg.hxx"
-#include "svtools/intitem.hxx"
-#include "svtools/isethint.hxx"
-#include "svtools/itemiter.hxx"
-#include "svtools/itempool.hxx"
-#include "svtools/itemprop.hxx"
-#include "svtools/itemset.hxx"
-#include "svtools/languageoptions.hxx"
-#include "svtools/lckbitem.hxx"
-#include "svtools/lingucfg.hxx"
-#include "svtools/linguprops.hxx"
-#include "svtools/lstner.hxx"
-#include "svtools/misccfg.hxx"
-#include "svtools/moduleoptions.hxx"
-#include "svtools/numuno.hxx"
-#include "svtools/ownlist.hxx"
+#include "svl/intitem.hxx"
+#include "svl/isethint.hxx"
+#include "svl/itemiter.hxx"
+#include "svl/itempool.hxx"
+#include "svl/itemprop.hxx"
+#include "svl/itemset.hxx"
+#include "svl/languageoptions.hxx"
+#include "svl/lckbitem.hxx"
+#include "unotools/lingucfg.hxx"
+#include "unotools/linguprops.hxx"
+#include "svl/lstner.hxx"
+#include "unotools/misccfg.hxx"
+#include "unotools/moduleoptions.hxx"
+#include "svl/numuno.hxx"
+#include "svl/ownlist.hxx"
#include "svtools/parhtml.hxx"
-#include "svtools/pathoptions.hxx"
-#include "svtools/poolitem.hxx"
+#include "unotools/pathoptions.hxx"
+#include "svl/poolitem.hxx"
#include "svtools/prgsbar.hxx"
#include "svtools/printdlg.hxx"
#include "svtools/prnsetup.hxx"
-#include "svtools/ptitem.hxx"
-#include "svtools/rectitem.hxx"
+#include "svl/ptitem.hxx"
+#include "svl/rectitem.hxx"
#include "svtools/rtfkeywd.hxx"
#include "svtools/rtfout.hxx"
#include "svtools/rtftoken.h"
#include "svtools/ruler.hxx"
-#include "svtools/saveopt.hxx"
+#include "unotools/saveopt.hxx"
#include "svtools/scriptedtext.hxx"
#include "svtools/sfxecode.hxx"
-#include "svtools/slstitm.hxx"
-#include "svtools/smplhint.hxx"
+#include "svl/slstitm.hxx"
+#include "svl/smplhint.hxx"
#include "svtools/soerr.hxx"
-#include "svtools/solar.hrc"
-#include "svtools/sourceviewconfig.hxx"
+#include "svl/solar.hrc"
+#include "unotools/sourceviewconfig.hxx"
#include "svtools/stdctrl.hxx"
-#include "svtools/stritem.hxx"
-#include "svtools/style.hrc"
-#include "svtools/style.hxx"
-#include "svtools/svarray.hxx"
+#include "svl/stritem.hxx"
+#include "svl/style.hrc"
+#include "svl/style.hxx"
+#include "svl/svarray.hxx"
#include "svtools/svmedit.hxx"
#include "svtools/svparser.hxx"
-#include "svtools/svstdarr.hxx"
+#include "svl/svstdarr.hxx"
#include "svtools/svtabbx.hxx"
#include "svtools/svtreebx.hxx"
-#include "svtools/syslocale.hxx"
+#include "unotools/syslocale.hxx"
#include "svtools/templdlg.hxx"
#include "svtools/textview.hxx"
#include "svtools/transfer.hxx"
#include "svtools/txtattr.hxx"
#include "svtools/txtcmp.hxx"
-#include "svtools/undo.hxx"
-#include "svtools/undoopt.hxx"
+#include "svl/undo.hxx"
+#include "unotools/undoopt.hxx"
#include "svtools/unoevent.hxx"
#include "svtools/unoimap.hxx"
-#include "svtools/urihelper.hxx"
-#include "svtools/urlbmk.hxx"
-#include "svtools/useroptions.hxx"
+#include "svl/urihelper.hxx"
+#include "svl/urlbmk.hxx"
+#include "unotools/useroptions.hxx"
#include "svtools/valueset.hxx"
-#include "svtools/visitem.hxx"
-#include "svtools/whiter.hxx"
+#include "svl/visitem.hxx"
+#include "svl/whiter.hxx"
#include "svtools/xtextedt.hxx"
#include "svx/IAccessibleParent.hxx"
@@ -731,7 +730,7 @@
#include "svx/editstat.hxx"
#include "svx/editview.hxx"
#include "svx/eeitem.hxx"
-#include "svx/escherex.hxx"
+#include "filter/msfilter/escherex.hxx"
#include "svx/extrusionbar.hxx"
#include "svx/extrusioncontrols.hxx"
#include "svx/fillctrl.hxx"
@@ -766,11 +765,11 @@
#include "svx/lboxctrl.hxx"
#include "svx/linectrl.hxx"
#include "svx/linkmgr.hxx"
-#include "svx/mscodec.hxx"
-#include "svx/msdffimp.hxx"
-#include "svx/msfiltertracer.hxx"
-#include "svx/msocximex.hxx"
-#include "svx/msoleexp.hxx"
+#include "filter/msfilter/mscodec.hxx"
+#include "filter/msfilter/msdffimp.hxx"
+#include "filter/msfilter/msfiltertracer.hxx"
+#include "filter/msfilter/msocximex.hxx"
+#include "filter/msfilter/msoleexp.hxx"
#include "svx/numitem.hxx"
#include "svx/numvset.hxx"
#include "svx/objfac3d.hxx"
@@ -921,7 +920,7 @@
#include "vcl/fixed.hxx"
#include "vcl/fldunit.hxx"
#include "vcl/font.hxx"
-#include "vcl/fontcvt.hxx"
+#include "unotools/fontcvt.hxx"
#include "vcl/graph.hxx"
#include "vcl/group.hxx"
#include "vcl/help.hxx"
diff --git a/sw/inc/postithelper.hxx b/sw/inc/postithelper.hxx
index 3f36c6015f6c..19ec6ed6084f 100644
--- a/sw/inc/postithelper.hxx
+++ b/sw/inc/postithelper.hxx
@@ -35,7 +35,7 @@
#include <redline.hxx>
#include <vector>
#include <vcl/window.hxx>
-#include <svtools/brdcst.hxx>
+#include <svl/brdcst.hxx>
class SwTxtFld;
class SwRootFrm;
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index ebf6e8cd9325..a35caaaae3f0 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -34,12 +34,12 @@
#include <tools/string.hxx>
#define _SVSTDARR_USHORTS
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#include <pam.hxx>
#include <IDocumentRedlineAccess.hxx>
-#include <svtools/smplhint.hxx>
+#include <svl/smplhint.hxx>
class SfxItemSet;
class SwView;
diff --git a/sw/inc/rolbck.hxx b/sw/inc/rolbck.hxx
index f910a44ca859..1f225aeeb8b0 100644
--- a/sw/inc/rolbck.hxx
+++ b/sw/inc/rolbck.hxx
@@ -34,9 +34,9 @@
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_USHORTS
#define _SVSTDARR_USHORTSSORT
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#endif
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
//Nur die History anziehen, um das docnew.cxx gegen die CLOOK's zu behaupten.
@@ -78,8 +78,7 @@ class SwCharFmt;
#include <memory>
-
-#ifndef PRODUCT
+#ifdef DBG_UTIL
class Writer;
#define OUT_HSTR_HINT( name ) \
friend Writer& OutUndo_Hstr_ ## name( Writer&, const SwHistoryHint& );
diff --git a/sw/inc/rubylist.hxx b/sw/inc/rubylist.hxx
index a175159fc418..41d1d7f890b1 100644
--- a/sw/inc/rubylist.hxx
+++ b/sw/inc/rubylist.hxx
@@ -30,7 +30,7 @@
#ifndef _RUBYLIST_HXX
#define _RUBYLIST_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <swtypes.hxx>
#include <fmtruby.hxx>
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index c530c8280870..1310325575cd 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -38,7 +38,7 @@
#ifndef _TOOLS_REF_HXX
#include <tools/ref.hxx>
#endif
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <frmfmt.hxx>
// Forward Deklaration
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 3be5406cf62c..45d413ced105 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -538,7 +538,7 @@ public:
inline SvStream& OutULong( ULONG nVal ) { return OutULong( Strm(), nVal ); }
void SetStrm( SvStream& rStrm ) { pStrm = &rStrm; }
-#ifdef PRODUCT
+#ifndef DBG_UTIL
SvStream& Strm() { return *pStrm; }
#else
SvStream& Strm();
@@ -637,6 +637,8 @@ public:
typedef Reader* (*FnGetReader)();
typedef void (*FnGetWriter)(const String&, const String& rBaseURL, WriterRef&);
+ULONG SaveOrDelMSVBAStorage( SfxObjectShell&, SotStorage&, BOOL, const String& );
+ULONG GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS );
struct SwReaderWriterEntry
{
diff --git a/sw/inc/shellres.hxx b/sw/inc/shellres.hxx
index 4c7bb09ebe45..8c677c9ed8db 100644
--- a/sw/inc/shellres.hxx
+++ b/sw/inc/shellres.hxx
@@ -39,7 +39,7 @@
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_STRINGSDTOR
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#endif
struct SW_DLLPUBLIC ShellResource : public Resource
@@ -72,6 +72,8 @@ struct SW_DLLPUBLIC ShellResource : public Resource
String aStrNone;
// fuer Felder, die Fixiert sind
String aFixedStr;
+ // custom fields of type css::util::Duration
+ String sDurationFormat;
//names of TOXs
String aTOXIndexName;
diff --git a/sw/inc/sortopt.hxx b/sw/inc/sortopt.hxx
index 103b58ed71b9..5b93f92e298d 100644
--- a/sw/inc/sortopt.hxx
+++ b/sw/inc/sortopt.hxx
@@ -31,7 +31,7 @@
#define _SORTOPT_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <tools/string.hxx>
#include "swdllapi.h"
diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx
index 3042f1def0c9..eccfc1a5b347 100644
--- a/sw/inc/swatrset.hxx
+++ b/sw/inc/swatrset.hxx
@@ -31,8 +31,8 @@
#define _SWATRSET_HXX
#include <tools/solar.h>
#include <tools/mempool.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itemset.hxx>
+#include <svl/itempool.hxx>
#include <swdllapi.h>
class SwModify;
diff --git a/sw/inc/swfltopt.hxx b/sw/inc/swfltopt.hxx
index 8b7e9c2ea451..d2556a31bccf 100644
--- a/sw/inc/swfltopt.hxx
+++ b/sw/inc/swfltopt.hxx
@@ -40,6 +40,8 @@ public:
void GetValues( sal_uInt16 nCnt, const sal_Char** ppNames,
sal_uInt32* pValues );
+ virtual void Commit();
+ virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
};
#endif
diff --git a/sw/inc/swhints.hxx b/sw/inc/swhints.hxx
index c4090cbe54f3..6c7b69eff7a6 100644
--- a/sw/inc/swhints.hxx
+++ b/sw/inc/swhints.hxx
@@ -30,7 +30,7 @@
#ifndef SW_HINTS_HXX
#define SW_HINTS_HXX
-#include <svtools/smplhint.hxx>
+#include <svl/smplhint.hxx>
#define SW_BROADCASTID_START SFX_HINT_USER00
#define SW_BROADCAST_DRAWVIEWS_CREATED SW_BROADCASTID_START
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index 57e8a3a1a31a..553ee20d9bc1 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -32,11 +32,12 @@
#include <tools/link.hxx>
#include <tools/string.hxx>
#include <vcl/fldunit.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
+#include <unotools/options.hxx>
#include <sfx2/module.hxx>
#include <tools/shl.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include "swdllapi.h"
#include "shellid.hxx"
#include <fldupde.hxx>
@@ -77,7 +78,7 @@ namespace com{ namespace sun{ namespace star{ namespace scanner{
class XScannerManager;
}}}}
-class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener
+class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener, public utl::ConfigurationListener
{
String sActAuthor;
@@ -126,6 +127,8 @@ class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener
// Hint abfangen fuer DocInfo
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+ virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
+
protected:
// Briefumschlaege, Etiketten
void InsertEnv(SfxRequest&);
diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index fc6d0238820e..c5ded7255c49 100644
--- a/sw/inc/swrect.hxx
+++ b/sw/inc/swrect.hxx
@@ -35,10 +35,8 @@ class SvStream;
class SwRect
{
- long nX;
- long nY;
- long nWidth;
- long nHeight;
+ Point m_Point;
+ Size m_Size;
public:
@@ -177,137 +175,133 @@ typedef void (SwRect:: *SwRectSetPos)( const Point& );
//---------------------------------- Set-Methoden
inline void SwRect::Chg( const Point& rNP, const Size &rNS )
{
- nX = rNP.X(); nY = rNP.Y();
- nWidth = rNS.Width(); nHeight = rNS.Height();
+ m_Point = rNP;
+ m_Size = rNS;
}
inline void SwRect::Pos( const Point& rNew )
{
- nX = rNew.X(); nY = rNew.Y();
+ m_Point = rNew;
}
inline void SwRect::Pos( const long nNewX, const long nNewY )
{
- nX = nNewX; nY = nNewY;
+ m_Point.setX(nNewX);
+ m_Point.setY(nNewY);
}
inline void SwRect::SSize( const Size& rNew )
{
- nWidth = rNew.Width(); nHeight = rNew.Height();
+ m_Size = rNew;
}
inline void SwRect::SSize( const long nNewHeight, const long nNewWidth )
{
- nWidth = nNewWidth; nHeight = nNewHeight;
+ m_Size.setWidth(nNewWidth);
+ m_Size.setHeight(nNewHeight);
}
inline void SwRect::Width( long nNew )
{
- nWidth = nNew;
+ m_Size.setWidth(nNew);
}
inline void SwRect::Height( long nNew )
{
- nHeight = nNew;
+ m_Size.setHeight(nNew);
}
inline void SwRect::Left( const long nLeft )
{
- nWidth += nX - nLeft;
- nX = nLeft;
+ m_Size.Width() += m_Point.getX() - nLeft;
+ m_Point.setX(nLeft);
}
inline void SwRect::Right( const long nRight )
{
- nWidth = nRight - nX + 1;
+ m_Size.setWidth(nRight - m_Point.getX() + 1);
}
inline void SwRect::Top( const long nTop )
{
- nHeight += nY - nTop;
- nY = nTop;
+ m_Size.Height() += m_Point.getY() - nTop;
+ m_Point.setY(nTop);
}
inline void SwRect::Bottom( const long nBottom )
{
- nHeight = nBottom - nY + 1;
+ m_Size.setHeight(nBottom - m_Point.getY() + 1);
}
//----------------------------------- Get-Methoden
inline const Point &SwRect::Pos() const
{
- return *(Point*)(&nX);
+ return m_Point;
}
inline Point &SwRect::Pos()
{
- return *(Point*)(&nX);
+ return m_Point;
}
inline const Size &SwRect::SSize() const
{
- return *(Size*)(&nWidth);
+ return m_Size;
}
inline Size &SwRect::SSize()
{
- return *(Size*)(&nWidth);
+ return m_Size;
}
inline long SwRect::Width() const
{
- return nWidth;
+ return m_Size.Width();
}
inline long SwRect::Height() const
{
- return nHeight;
+ return m_Size.Height();
}
inline long SwRect::Left() const
{
- return nX;
+ return m_Point.X();
}
inline long SwRect::Right() const
{
- return nWidth ? nX + nWidth - 1 : nX;
+ return m_Size.getWidth() ? m_Point.getX() + m_Size.getWidth() - 1 : m_Point.getX();
}
inline long SwRect::Top() const
{
- return nY;
+ return m_Point.Y();
}
inline long SwRect::Bottom() const
{
- return nHeight ? nY + nHeight - 1 : nY;
+ return m_Size.getHeight() ? m_Point.getY() + m_Size.getHeight() - 1 : m_Point.getY();
}
//----------------------------------- operatoren
inline SwRect &SwRect::operator = ( const SwRect &rRect )
{
- nX = rRect.Left();
- nY = rRect.Top();
- nWidth = rRect.Width();
- nHeight = rRect.Height();
+ m_Point = rRect.m_Point;
+ m_Size = rRect.m_Size;
return *this;
}
inline BOOL SwRect::operator == ( const SwRect& rRect ) const
{
- return (nX == rRect.Left() &&
- nY == rRect.Top() &&
- nWidth == rRect.Width() &&
- nHeight == rRect.Height());
+ return (m_Point == rRect.m_Point && m_Size == rRect.m_Size);
}
inline BOOL SwRect::operator != ( const SwRect& rRect ) const
{
- return (nX != rRect.Left() ||
- nY != rRect.Top() ||
- nWidth != rRect.Width() ||
- nHeight != rRect.Height());
+ return (m_Point != rRect.m_Point || m_Size != rRect.m_Size);
}
inline SwRect &SwRect::operator+=( const Point &rPt )
{
- nX += rPt.X(); nY += rPt.Y();
+ m_Point += rPt;
return *this;
}
inline SwRect &SwRect::operator-=( const Point &rPt )
{
- nX -= rPt.X(); nY -= rPt.Y();
+ m_Point -= rPt;
return *this;
}
inline SwRect &SwRect::operator+=( const Size &rSz )
{
- nWidth += rSz.Width(); nHeight += rSz.Height();
+ m_Size.Width() += rSz.Width();
+ m_Size.Height() += rSz.Height();
return *this;
}
inline SwRect &SwRect::operator-=( const Size &rSz )
{
- nWidth -= rSz.Width(); nHeight -= rSz.Height();
+ m_Size.Width() -= rSz.Width();
+ m_Size.Height() -= rSz.Height();
return *this;
}
@@ -315,10 +309,10 @@ inline SwRect &SwRect::operator-=( const Size &rSz )
//--------------------------- Sonstiges
inline Rectangle SwRect::SVRect() const
{
- ASSERT( nWidth && nHeight, "SVRect() ohne Widht oder Height" );
- return Rectangle( nX, nY,
- nX + nWidth - 1, //Right()
- nY + nHeight - 1 ); //Bottom()
+ ASSERT( !IsEmpty(), "SVRect() without Width or Height" );
+ return Rectangle( m_Point.getX(), m_Point.getY(),
+ m_Point.getX() + m_Size.getWidth() - 1, //Right()
+ m_Point.getY() + m_Size.getHeight() - 1 ); //Bottom()
}
inline SwRect SwRect::GetIntersection( const SwRect& rRect ) const
@@ -328,51 +322,44 @@ inline SwRect SwRect::GetIntersection( const SwRect& rRect ) const
inline BOOL SwRect::HasArea() const
{
- return nHeight && nWidth;
+ return !IsEmpty();
}
inline BOOL SwRect::IsEmpty() const
{
- return !(nHeight && nWidth);
+ return !(m_Size.getHeight() && m_Size.getWidth());
}
inline void SwRect::Clear()
{
- nX = nY = nWidth = nHeight = 0;
+ m_Point.setX(0);
+ m_Point.setY(0);
+ m_Size.setWidth(0);
+ m_Size.setHeight(0);
}
//-------------------------- CToren
inline SwRect::SwRect() :
- nX( 0 ),
- nY( 0 ),
- nWidth ( 0 ),
- nHeight( 0 )
+ m_Point( 0, 0 ),
+ m_Size( 0, 0 )
{
}
inline SwRect::SwRect( const SwRect &rRect ) :
- nX( rRect.Left() ),
- nY( rRect.Top() ),
- nWidth ( rRect.Width() ),
- nHeight( rRect.Height() )
+ m_Point( rRect.m_Point ),
+ m_Size( rRect.m_Size )
{
}
inline SwRect::SwRect( const Point& rLT, const Size& rSize ) :
- nX( rLT.X() ),
- nY( rLT.Y() ),
- nWidth ( rSize.Width() ),
- nHeight( rSize.Height())
+ m_Point( rLT ),
+ m_Size( rSize )
{
}
inline SwRect::SwRect( const Point& rLT, const Point& rRB ) :
- nX( rLT.X() ),
- nY( rLT.Y() ),
- nWidth ( rRB.X() - rLT.X() + 1 ),
- nHeight( rRB.Y() - rLT.Y() + 1 )
+ m_Point( rLT ),
+ m_Size( rRB.X() - rLT.X() + 1, rRB.Y() - rLT.Y() + 1 )
{
}
inline SwRect::SwRect( long X, long Y, long W, long H ) :
- nX( X ),
- nY( Y ),
- nWidth ( W ),
- nHeight( H )
+ m_Point( X, Y ),
+ m_Size( W, H )
{
}
diff --git a/sw/inc/swregion.hxx b/sw/inc/swregion.hxx
index 0b1e42070101..793746877d9f 100644
--- a/sw/inc/swregion.hxx
+++ b/sw/inc/swregion.hxx
@@ -30,7 +30,7 @@
#ifndef _SWREGION_HXX
#define _SWREGION_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include "swrect.hxx"
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index 1a62bb3d4dfd..1699cf439030 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -33,12 +33,12 @@
#ifndef _TOOLS_REF_HXX
#include <tools/ref.hxx>
#endif
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <tblenum.hxx>
#include <swtypes.hxx>
#include <calbck.hxx>
#include <swrect.hxx>
-#ifdef PRODUCT
+#ifndef DBG_UTIL
#include <node.hxx> // fuer StartNode->GetMyIndex
#else
class SwStartNode;
@@ -111,7 +111,7 @@ protected:
BOOL bModifyLocked :1;
BOOL bNewModel :1; // FALSE: old SubTableModel; TRUE: new RowSpanModel
-#ifndef PRODUCT
+#ifdef DBG_UTIL
bool bDontChangeModel; // This is set by functions (like Merge()) to forbid a laet model change
#endif
@@ -210,7 +210,7 @@ public:
BOOL Merge( SwDoc* pDoc, const SwSelBoxes& rBoxes, const SwSelBoxes& rMerged,
SwTableBox* pMergeBox, SwUndoTblMerge* pUndo = 0 )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
bDontChangeModel = true;
#endif
return bNewModel ? NewMerge( pDoc, rBoxes, rMerged, pMergeBox, pUndo ) :
@@ -219,7 +219,7 @@ public:
BOOL SplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt=1,
BOOL bSameHeight = FALSE )
{
-#ifndef PRODUCT
+#ifdef DBG_UTIL
bDontChangeModel = true;
#endif
return bNewModel ? NewSplitRow( pDoc, rBoxes, nCnt, bSameHeight ) :
@@ -323,7 +323,7 @@ public:
SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo );
BOOL SetRowHeight( SwTableBox& rAktBox, USHORT eType,
SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo );
-#ifndef PRODUCT
+#ifdef DBG_UTIL
void CheckConsistency() const;
#endif
};
@@ -412,7 +412,7 @@ public:
const SwStartNode *GetSttNd() const { return pSttNd; }
ULONG GetSttIdx() const
-#ifdef PRODUCT
+#ifndef DBG_UTIL
{ return pSttNd ? pSttNd->GetIndex() : 0; }
#else
;
diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx
index ce997cc3f43d..1ce8f7318131 100644
--- a/sw/inc/swundo.hxx
+++ b/sw/inc/swundo.hxx
@@ -30,7 +30,7 @@
#ifndef _SWUNDO_HXX
#define _SWUNDO_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
// die Ids fuer StdAktionen
enum SwUndoId
diff --git a/sw/inc/tabcol.hxx b/sw/inc/tabcol.hxx
index 092d6b12f22b..10eff5c1f33f 100644
--- a/sw/inc/tabcol.hxx
+++ b/sw/inc/tabcol.hxx
@@ -33,7 +33,7 @@
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_LONGS
#define _SVSTDARR_BOOLS
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#endif
#ifndef INCLUDED_VECTOR
diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index 0b26219ab7e1..3ca914531882 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -47,7 +47,7 @@ JP 20.07.95:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
**************************************************************************/
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include "hintids.hxx" //_immmer_ vor den solar-items!
#include <svx/algitem.hxx>
#include <svx/fontitem.hxx>
@@ -65,7 +65,7 @@ JP 20.07.95:
#include <svx/brshitem.hxx>
#include <svx/adjitem.hxx>
#include <svx/rotmodit.hxx>
-#include <svtools/intitem.hxx>
+#include <svl/intitem.hxx>
#include <svx/bolnitem.hxx>
#include "swdllapi.h"
diff --git a/sw/inc/tblsel.hxx b/sw/inc/tblsel.hxx
index d87768664fe5..9bd5ef390da1 100644
--- a/sw/inc/tblsel.hxx
+++ b/sw/inc/tblsel.hxx
@@ -30,7 +30,7 @@
#ifndef _TBLSEL_HXX
#define _TBLSEL_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <swtable.hxx>
#include <swrect.hxx>
#include "swdllapi.h"
diff --git a/sw/inc/tgrditem.hxx b/sw/inc/tgrditem.hxx
index c502454efcea..659b05207aa9 100644
--- a/sw/inc/tgrditem.hxx
+++ b/sw/inc/tgrditem.hxx
@@ -31,7 +31,7 @@
#define SW_TGRDITEM_HXX
#include <tools/color.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include "swdllapi.h"
#include <hintids.hxx>
#include <format.hxx>
diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx
index 9223ffa2d9df..65a4879485b7 100644
--- a/sw/inc/tox.hxx
+++ b/sw/inc/tox.hxx
@@ -34,8 +34,8 @@
#include <tools/string.hxx>
#include <svx/svxenum.hxx>
-#include <svtools/svarray.hxx>
-#include <svtools/poolitem.hxx>
+#include <svl/svarray.hxx>
+#include <svl/poolitem.hxx>
#include "swdllapi.h"
#include <swtypes.hxx>
#include <toxe.hxx>
diff --git a/sw/inc/txatbase.hxx b/sw/inc/txatbase.hxx
index 2a49460a05ca..4ceb64e90f0d 100644
--- a/sw/inc/txatbase.hxx
+++ b/sw/inc/txatbase.hxx
@@ -31,7 +31,7 @@
#define _TXATBASE_HXX
#include <tools/solar.h>
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
#include <hintids.hxx>
#include <errhdl.hxx>
@@ -121,7 +121,6 @@ public:
inline const SwTOXMark &GetTOXMark() const;
inline const SwFmtRefMark &GetRefMark() const;
inline const SwFmtINetFmt &GetINetFmt() const;
- inline const SvXMLAttrContainerItem &GetXMLAttrContainer() const;
inline const SwFmtRuby &GetRuby() const;
inline const SwFmtMeta &GetMeta() const;
@@ -230,13 +229,6 @@ inline const SwFmtINetFmt& SwTxtAttr::GetINetFmt() const
return (const SwFmtINetFmt&)(*m_pAttr);
}
-inline const SvXMLAttrContainerItem& SwTxtAttr::GetXMLAttrContainer() const
-{
- ASSERT( m_pAttr && m_pAttr->Which() == RES_UNKNOWNATR_CONTAINER,
- "Wrong attribute" );
- return (const SvXMLAttrContainerItem&)(*m_pAttr);
-}
-
inline const SwFmtRuby& SwTxtAttr::GetRuby() const
{
ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_CJK_RUBY,
diff --git a/sw/inc/txatritr.hxx b/sw/inc/txatritr.hxx
index e50eb2dbda77..a087ebcb087d 100644
--- a/sw/inc/txatritr.hxx
+++ b/sw/inc/txatritr.hxx
@@ -32,7 +32,7 @@
#include <tools/solar.h>
#include <sal/types.h>
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <svx/langitem.hxx>
#include <hintids.hxx>
diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx
index 92b51fede495..d9e9463a30a7 100644
--- a/sw/inc/txtatr.hxx
+++ b/sw/inc/txtatr.hxx
@@ -60,15 +60,6 @@ public:
};
-// ATT_XMLCONTAINERITEM ******************************
-
-class SwTxtXMLAttrContainer : public SwTxtAttrEnd
-{
-public:
- SwTxtXMLAttrContainer( SvXMLAttrContainerItem& rAttr,
- xub_StrLen nStart, xub_StrLen nEnd );
-};
-
// ******************************
class SwTxtAttrNesting : public SwTxtAttrEnd
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index aaafa3fca76a..5b08b496a360 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -36,9 +36,9 @@
#define _SVSTDARR_BOOLS
#define _SVSTDARR_BYTES
#define _SVSTDARR_USHORTSSORT
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#endif
-#include <svtools/itemset.hxx>
+#include <svl/itemset.hxx>
#include <com/sun/star/uno/Sequence.h>
#include <numrule.hxx>
#include <itabenum.hxx>
@@ -115,7 +115,7 @@ namespace utl {
class TransliterationWrapper;
}
-#ifndef PRODUCT
+#ifdef DBG_UTIL
class Writer;
class SwUndo;
#define OUT_UNDOBJ( name ) \
@@ -206,6 +206,11 @@ namespace nsDelCntntType
const DelCntntType DELCNT_CHKNOCNTNT = 0x80;
}
+/// will DelCntntIndex destroy a frame anchored at character at rAnchorPos?
+bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
+ SwPosition const & rStart, SwPosition const & rEnd,
+ DelCntntType const nDelCntntType = nsDelCntntType::DELCNT_ALL);
+
// diese Klasse muss in ein Undo-Object vererbt werden, wenn dieses Inhalt
// fuers Redo/Undo ... speichert
class SwUndoSaveCntnt
diff --git a/sw/inc/unoatxt.hxx b/sw/inc/unoatxt.hxx
index b115919a5623..87e896d76046 100644
--- a/sw/inc/unoatxt.hxx
+++ b/sw/inc/unoatxt.hxx
@@ -41,8 +41,8 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/document/XEventsSupplier.hpp>
-#include <svtools/itemprop.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/itemprop.hxx>
+#include <svl/lstner.hxx>
#include <cppuhelper/implbase3.hxx> // helper for implementations
#include <cppuhelper/implbase4.hxx> // helper for implementations
#include <cppuhelper/implbase5.hxx> // helper for implementations
diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx
index 1a7401fd4a33..b630668f8965 100644
--- a/sw/inc/unocoll.hxx
+++ b/sw/inc/unocoll.hxx
@@ -43,6 +43,7 @@
#include <cppuhelper/implbase4.hxx> // helper for implementations
#include <IMark.hxx>
#include <unobaseclass.hxx>
+#include "swdllapi.h"
/***************************************************
***************************************************
*
@@ -284,7 +285,7 @@ cppu::WeakImplHelper3
::com::sun::star::lang::XServiceInfo
>
SwCollectionBaseClass;
-class SwXTextTables : public SwCollectionBaseClass,
+class SW_DLLPUBLIC SwXTextTables : public SwCollectionBaseClass,
public SwUnoCollection
{
protected:
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index 05857bbc6fe1..5b277af11a49 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -48,7 +48,7 @@
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
// <--
-#include <svtools/itemprop.hxx>
+#include <svl/itemprop.hxx>
class SdrMarkList;
class SdrView;
diff --git a/sw/inc/unoevent.hxx b/sw/inc/unoevent.hxx
index 40beb04943e5..6cb39ac5c481 100644
--- a/sw/inc/unoevent.hxx
+++ b/sw/inc/unoevent.hxx
@@ -31,7 +31,7 @@
#define _UNOEVENT_HXX
#include <svtools/unoevent.hxx>
-#include <svtools/macitem.hxx>
+#include <svl/macitem.hxx>
class SvxMacroItem;
diff --git a/sw/inc/unoevtlstnr.hxx b/sw/inc/unoevtlstnr.hxx
index 5b5dceac47e3..38b70b308bd0 100644
--- a/sw/inc/unoevtlstnr.hxx
+++ b/sw/inc/unoevtlstnr.hxx
@@ -30,7 +30,7 @@
#ifndef _UNOEVTLSTNR_HXX
#define _UNOEVTLSTNR_HXX
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <com/sun/star/uno/Reference.h>
namespace com{namespace sun{namespace star{
diff --git a/sw/inc/unomailmerge.hxx b/sw/inc/unomailmerge.hxx
index 3dbe497b2e3c..2e31ed8766de 100644
--- a/sw/inc/unomailmerge.hxx
+++ b/sw/inc/unomailmerge.hxx
@@ -43,7 +43,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
#include <com/sun/star/text/XMailMergeBroadcaster.hpp>
-#include <svtools/itemprop.hxx>
+#include <svl/itemprop.hxx>
#include <sfx2/objsh.hxx> // SfxObjectShellRef
#include <functional>
diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx
index e569383a335e..c5fcbfe15489 100644
--- a/sw/inc/unomap.hxx
+++ b/sw/inc/unomap.hxx
@@ -30,7 +30,7 @@
#ifndef _UNOMAP_HXX
#define _UNOMAP_HXX
-#include <svtools/itemprop.hxx>
+#include <svl/itemprop.hxx>
#define PROPERTY_NONE 0
@@ -251,6 +251,7 @@
#define WID_DOC_LOCK_UPDATES 1016
#define WID_DOC_HAS_VALID_SIGNATURES 1017
#define WID_DOC_BUILDID 1024
+#define WID_DOC_ISTEMPLATEID 1025
// --> OD 2006-03-21 #b6375613#
#define WID_APPLY_WORKAROUND_FOR_B6375613 1070
// <--
@@ -295,6 +296,7 @@
#define WID_LAYOUT_SIZE 1104
#define WID_DOC_DIALOG_LIBRARIES 1105
+#define WID_DOC_VBA_DOCOBJ 1106
//AutoText
diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx
index b7a6c54d2bd2..0447c39920df 100644
--- a/sw/inc/unoobj.hxx
+++ b/sw/inc/unoobj.hxx
@@ -34,8 +34,8 @@
#include <unoevtlstnr.hxx>
#include <unobaseclass.hxx>
#include <unocrsr.hxx>
-#include <svtools/itemprop.hxx>
-#include <svtools/svarray.hxx>
+#include <svl/itemprop.hxx>
+#include <svl/svarray.hxx>
#include <frmfmt.hxx>
#include <flyenum.hxx>
#include <fldbas.hxx>
diff --git a/sw/inc/unoport.hxx b/sw/inc/unoport.hxx
index ef20027994cf..acf21fc501f3 100644
--- a/sw/inc/unoport.hxx
+++ b/sw/inc/unoport.hxx
@@ -48,7 +48,7 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <cppuhelper/implbase8.hxx>
#include <cppuhelper/implbase3.hxx>
-#include <svtools/itemprop.hxx>
+#include <svl/itemprop.hxx>
#include <memory>
#include <deque>
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 56360281915d..60b77d65061d 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -808,7 +808,9 @@ enum SwPropNameIds
/* 0737 */ UNO_NAME_DESCRIPTION,
// <--
/* 0738 */ UNO_NAME_META, // #i91565#
-/* 0739 */ SW_PROPNAME_END
+/* 0739 */ UNO_NAME_IS_TEMPLATE,
+/* 0740 */ UNO_NAME_VBA_DOCOBJ,
+/* 0741 */ SW_PROPNAME_END
};
diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx
index bc9cd02a3ac7..81f5710b811b 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -44,7 +44,7 @@
#include <cppuhelper/implbase4.hxx>
#include <cppuhelper/implbase5.hxx>
#include <tools/string.hxx>
-#include <svtools/itemprop.hxx>
+#include <svl/itemprop.hxx>
class SwDoc;
class SwFmtCol;
diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index 7c9e00f6671f..fbadd2da1618 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -31,8 +31,8 @@
#define _UNOSTYLE_HXX
#include <boost/shared_ptr.hpp>
-#include <svtools/style.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/style.hxx>
+#include <svl/lstner.hxx>
#include <unocoll.hxx>
#include <unomap.hxx>
#include <com/sun/star/style/XStyle.hpp>
diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index 0ad2b3c494c8..a8ca07bb0f34 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -214,14 +214,13 @@ typedef cppu::WeakImplHelper3<
::com::sun::star::lang::XServiceInfo,
::com::sun::star::beans::XPropertySet
> SwXTextTableCursor_Base;
-class SwXTextTableCursor : public SwXTextTableCursor_Base
+class SW_DLLPUBLIC SwXTextTableCursor : public SwXTextTableCursor_Base
,public SwClient
,public OTextCursorHelper
{
SwDepend aCrsrDepend;
const SfxItemPropertySet* m_pPropSet;
- SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
// SwUnoCrsr* GetCrsr() const { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); }
protected:
@@ -271,6 +270,7 @@ public:
const SwUnoCrsr* GetCrsr() const;
SwUnoCrsr* GetCrsr();
+ SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
};
/*-----------------11.12.97 09:38-------------------
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 5ebe07e7f633..7bb2af6393d1 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -30,7 +30,7 @@
#ifndef _UNOTXDOC_HXX
#define _UNOTXDOC_HXX
#include "swdllapi.h"
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include <sfx2/sfxbasemodel.hxx>
#include <com/sun/star/beans/PropertyValues.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
@@ -70,7 +70,7 @@
#include <com/sun/star/text/XFlatParagraphIteratorProvider.hpp>
#include <com/sun/star/document/XDocumentLanguages.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <svtools/itemprop.hxx>
+#include <svl/itemprop.hxx>
#include <svx/fmdmod.hxx>
#include <svx/UnoForbiddenCharsTable.hxx>
#include <cppuhelper/weak.hxx>
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index d650d90cf08e..b3feded02ea1 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -175,7 +175,7 @@ protected:
BYTE nTblDest; // Ziel fuer Tabellenhintergrund
-#ifndef PRODUCT
+#ifdef DBG_UTIL
// korrespondieren zu den Angaben in ui/config/cfgvw.src
BOOL bTest1 :1; // Test-Flag "Layout not loading"
BOOL bTest2 :1; // Test-Flag "WYSIWYG++"
@@ -417,7 +417,7 @@ public:
USHORT GetViewLayoutColumns() const { return mnViewLayoutColumns; }
void SetViewLayoutColumns( USHORT nNew ) { mnViewLayoutColumns = nNew; }
-#ifndef PRODUCT
+#ifdef DBG_UTIL
// korrespondieren zu den Angaben in ui/config/cfgvw.src
inline BOOL IsTest1() const { return bTest1; }
inline void SetTest1( BOOL b ) { bTest1 = b; }
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 7a8d0eb0c273..f12b3ecbe9bc 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -32,7 +32,7 @@
#include <com/sun/star/embed/XClassifiedObject.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <tools/rtti.hxx>
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#include "swdllapi.h"
#include <swtypes.hxx>
#include <ring.hxx>
diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx
index a240e166d197..f1fd0abb4ae4 100644
--- a/sw/inc/viscrs.hxx
+++ b/sw/inc/viscrs.hxx
@@ -169,7 +169,7 @@ public:
// TRUE: an die Position kann der Cursor gesetzt werden
virtual BOOL IsAtValidPos( BOOL bPoint = TRUE ) const;
-#ifndef PRODUCT
+#ifdef DBG_UTIL
// JP 05.03.98: zum Testen des UNO-Crsr Verhaltens hier die Implementierung
// am sichtbaren Cursor
virtual BOOL IsSelOvr( int eFlags =
@@ -213,7 +213,7 @@ public:
// TRUE: an die Position kann der Cursor gesetzt werden
virtual BOOL IsAtValidPos( BOOL bPoint = TRUE ) const;
-#ifndef PRODUCT
+#ifdef DBG_UTIL
// JP 05.03.98: zum Testen des UNO-Crsr Verhaltens hier die Implementierung
// am sichtbaren Cursor
virtual BOOL IsSelOvr( int eFlags =
diff --git a/sw/prj/build.lst b/sw/prj/build.lst
index d8cac64ff9e8..6fd49c1d77b0 100644..100755
--- a/sw/prj/build.lst
+++ b/sw/prj/build.lst
@@ -1,4 +1,4 @@
-sw sw : l10n connectivity OOo:writerperfect svx stoc uui writerfilter NULL
+sw sw : filter l10n connectivity OOo:writerperfect vbahelper svx stoc writerfilter NULL
sw sw usr1 - all sw_mkout NULL
sw sw\inc nmake - all sw_inc NULL
sw sw\uiconfig\layout nmake - all sw_layout NULL
@@ -33,6 +33,7 @@ sw sw\source\ui\smartmenu nmake
sw sw\source\ui\table nmake - all sw_table sw_inc NULL
sw sw\source\ui\uiview nmake - all sw_uivw sw_sdi sw_inc NULL
sw sw\source\ui\uno nmake - all sw_uiuno sw_sdi sw_inc NULL
+sw sw\source\ui\vba nmake - all sw_vba sw_inc NULL
sw sw\source\ui\utlui nmake - all sw_utlui sw_inc NULL
sw sw\source\ui\web nmake - all sw_web sw_uinc sw_sdi sw_inc NULL
sw sw\source\ui\wrtsh nmake - all sw_wrtsh sw_inc NULL
@@ -69,7 +70,7 @@ sw sw\source\filter\writer nmake - all sw_wrtr sw_i
sw sw\source\filter\ww1 nmake - all sw_ww1 sw_inc NULL
sw sw\source\filter\ww8 nmake - all sw_ww8 sw_inc NULL
sw sw\source\filter\xml nmake - all sw_xml sw_inc NULL
-sw sw\source\ui nmake - all sw_ui sw_app sw_cctrl sw_chrdl sw_conf sw_dbui sw_dchdl sw_dcvw sw_dlg sw_envlp sw_fldui sw_fmtui sw_frmdl sw_globd sw_index sw_ling sw_misc sw_rbbar sw_shell sw_table sw_uiuno sw_uivw sw_utlui sw_web sw_wrtsh sw_smartmenu NULL
+sw sw\source\ui nmake - all sw_ui sw_app sw_cctrl sw_chrdl sw_conf sw_dbui sw_dchdl sw_dcvw sw_dlg sw_envlp sw_fldui sw_fmtui sw_frmdl sw_globd sw_index sw_ling sw_misc sw_rbbar sw_shell sw_table sw_uiuno sw_uivw sw_utlui sw_web sw_wrtsh sw_smartmenu sw_vba NULL
sw sw\source\core nmake - all sw_core sw_attr sw_bast sw_crsr sw_dcnd sw_doc sw_draw sw_edit sw_excpt sw_fld sw_frmed sw_grph sw_layo sw_ole sw_para sw_sw3io sw_swg sw_text sw_tox sw_txtnd sw_uco sw_undo sw_view sw_acc sw_objpos sw_NumberTree sw_tablecore NULL
sw sw\source\filter nmake - all sw_flt sw_ascii sw_bsflt sw_html sw_rtf sw_wrtr sw_ww1 sw_ww8 sw_xml NULL
sw sw\util nmake - all sw_util sw_core sw_flt sw_sdi sw_ui NULL
diff --git a/sw/prj/d.lst b/sw/prj/d.lst
index 09c417cd6f17..958771dad257 100644
--- a/sw/prj/d.lst
+++ b/sw/prj/d.lst
@@ -63,6 +63,7 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\swreport\statusbar
..\%__SRC%\bin\swd?????.dll %_DEST%\bin%_EXT%\swd?????.dll
..\%__SRC%\bin\swui?????.dll %_DEST%\bin%_EXT%\swui?????.dll
..\%__SRC%\bin\msword?????.dll %_DEST%\bin%_EXT%\msword?????.dll
+..\%__SRC%\bin\vbaswobj*.dll %_DEST%\bin%_EXT%\vbaswobj*.dll
..\%__SRC%\bin\sw*.res %_DEST%\bin%_EXT%\sw*.res
..\%__SRC%\lib\lib*.* %_DEST%\lib%_EXT%\lib*.*
diff --git a/sw/qa/complex/checkColor/makefile.mk b/sw/qa/complex/checkColor/makefile.mk
index 0541b44e1d44..d9f7060a83fb 100755
--- a/sw/qa/complex/checkColor/makefile.mk
+++ b/sw/qa/complex/checkColor/makefile.mk
@@ -40,7 +40,7 @@ PACKAGE = complex$/checkColor
#----- compile .java files -----------------------------------------
-JARFILES = mysql.jar sandbox.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar mysql.jar
+JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar mysql.jar
JAVAFILES = CheckChangeColor.java
JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
diff --git a/sw/qa/complex/indeterminateState/makefile.mk b/sw/qa/complex/indeterminateState/makefile.mk
index 5261e70667be..731822e03278 100755
--- a/sw/qa/complex/indeterminateState/makefile.mk
+++ b/sw/qa/complex/indeterminateState/makefile.mk
@@ -40,7 +40,7 @@ PACKAGE = complex$/indeterminateState
#----- compile .java files -----------------------------------------
-JARFILES = mysql.jar sandbox.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
JAVAFILES = CheckIndeterminateState.java
JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
diff --git a/sw/qa/complex/writer/TextPortionEnumerationTest.java b/sw/qa/complex/writer/TextPortionEnumerationTest.java
index aec77b891a0b..a07b3cccadef 100755
--- a/sw/qa/complex/writer/TextPortionEnumerationTest.java
+++ b/sw/qa/complex/writer/TextPortionEnumerationTest.java
@@ -2099,6 +2099,19 @@ public class TextPortionEnumerationTest extends ComplexTestCase
.appendChild( url4.dup().appendChild( new TextNode("7") ) )
.appendChild( new TextNode("89") );
doTest(root, false);
+ // empty
+ TreeNode url6 = new HyperlinkNode( mkName("url") );
+ inserter.insertRange( new Range(7, 7, url6) );
+ root = new TreeNode()
+ .appendChild( url2.dup().appendChild( new TextNode("12") ) )
+ .appendChild( url1.dup().appendChild( new TextNode("3") ) )
+ .appendChild( url4.dup().appendChild( new TextNode("4") ) )
+ .appendChild( url5.dup().appendChild( new TextNode("56") ) )
+ .appendChild( url4.dup().appendChild( new TextNode("7") ) )
+// this one gets eaten, but we still need to test inserting it (#i106930#)
+// .appendChild( url6.dup().appendChild( new TextNode("") ) )
+ .appendChild( new TextNode("89") );
+ doTest(root, false);
}
public void testRangeHyperlinkRuby() throws Exception
diff --git a/sw/qa/complex/writer/makefile.mk b/sw/qa/complex/writer/makefile.mk
index de5200d47142..9aa7e95c9af2 100755
--- a/sw/qa/complex/writer/makefile.mk
+++ b/sw/qa/complex/writer/makefile.mk
@@ -40,7 +40,7 @@ PACKAGE = complex$/writer
#----- compile .java files -----------------------------------------
-JARFILES = mysql.jar sandbox.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
JAVAFILES = CheckIndexedPropertyValues.java CheckNamedPropertyValues.java CheckCrossReferences.java CheckBookmarks.java CheckFlies.java TextPortionEnumerationTest.java
JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
diff --git a/sw/qa/core/Test-BigPtrArray.cxx b/sw/qa/core/Test-BigPtrArray.cxx
index ad069407b669..cc10355d75e7 100644
--- a/sw/qa/core/Test-BigPtrArray.cxx
+++ b/sw/qa/core/Test-BigPtrArray.cxx
@@ -32,7 +32,7 @@
#include "precompiled_sw.hxx"
#define TIMELOG
-#include <cppunit/simpleheader.hxx>
+#include <testshl/simpleheader.hxx>
#include <bparr.hxx>
#include <string>
#include <stdlib.h>
diff --git a/sw/qa/core/makefile.mk b/sw/qa/core/makefile.mk
index 66308d1eed33..3982536b28e5 100644
--- a/sw/qa/core/makefile.mk
+++ b/sw/qa/core/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -42,7 +42,7 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
# BEGIN ----------------------------------------------------------------
-# auto generated Target:testjob by codegen.pl
+# auto generated Target:testjob by codegen.pl
.IF "$(GUI)" == "WNT"
CFLAGS+=/Ob1
@@ -52,17 +52,7 @@ SHL1OBJS=$(SLO)$/Test-BigPtrArray.obj \
$(SLO)$/bparr.obj
SHL1TARGET=$(TARGET)
-SHL1STDLIBS=$(SALLIB) $(TOOLSLIB)
-
-.IF "$(GUI)" == "WNT"
-SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-.ENDIF
-.IF "$(GUI)" == "UNX"
-SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-# .IF "$(OS)" == "SOLARIS"
-# SHL1STDLIBS += -lrt -laio
-# .ENDIF
-.ENDIF
+SHL1STDLIBS=$(SALLIB) $(TOOLSLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
SHL1IMPLIB= i$(SHL1TARGET)
diff --git a/sw/sdi/_docsh.sdi b/sw/sdi/_docsh.sdi
index 9154e6ce2578..de0be1f9a5c1 100644
--- a/sw/sdi/_docsh.sdi
+++ b/sw/sdi/_docsh.sdi
@@ -28,7 +28,7 @@
*
************************************************************************/
-interface BaseTextDocument : OfficeDocument