Files
libreoffice/sw/source/core/fields/cellfml.cxx
Michael Meeks ed40f62e64 Merge commit 'ooo/DEV300_m101' into integration/dev300_m101
Conflicts:
	starmath/inc/applicat.hxx
	starmath/inc/dialog.hxx
	starmath/inc/document.hxx
	starmath/inc/edit.hxx
	starmath/inc/format.hxx
	starmath/inc/node.hxx
	starmath/inc/parse.hxx
	starmath/inc/rect.hxx
	starmath/inc/smdll.hxx
	starmath/inc/smmod.hxx
	starmath/inc/starmath.hrc
	starmath/inc/symbol.hxx
	starmath/inc/toolbox.hxx
	starmath/inc/utility.hxx
	starmath/inc/view.hxx
	starmath/prj/build.lst
	starmath/qa/cppunit/version.map
	starmath/sdi/smslots.sdi
	starmath/source/accessibility.cxx
	starmath/source/cfgitem.cxx
	starmath/source/cfgitem.hxx
	starmath/source/config.cxx
	starmath/source/dialog.cxx
	starmath/source/document.cxx
	starmath/source/edit.cxx
	starmath/source/format.cxx
	starmath/source/makefile.mk
	starmath/source/math_pch.cxx
	starmath/source/mathmlexport.cxx
	starmath/source/mathmlimport.cxx
	starmath/source/mathtype.cxx
	starmath/source/node.cxx
	starmath/source/parse.cxx
	starmath/source/rect.cxx
	starmath/source/register.cxx
	starmath/source/smdetect.cxx
	starmath/source/smdll.cxx
	starmath/source/smmod.cxx
	starmath/source/smres.src
	starmath/source/symbol.cxx
	starmath/source/toolbox.cxx
	starmath/source/unomodel.cxx
	starmath/source/utility.cxx
	starmath/source/view.cxx
	sw/JunitTest_sw_unoapi.mk
	sw/Library_swd.mk
	sw/Makefile
	sw/inc/IDocumentFieldsAccess.hxx
	sw/inc/IDocumentSettingAccess.hxx
	sw/inc/IDocumentUndoRedo.hxx
	sw/inc/IShellCursorSupplier.hxx
	sw/inc/SwUndoField.hxx
	sw/inc/acmplwrd.hxx
	sw/inc/authfld.hxx
	sw/inc/bparr.hxx
	sw/inc/calbck.hxx
	sw/inc/calc.hxx
	sw/inc/ccoll.hxx
	sw/inc/cellatr.hxx
	sw/inc/cellfml.hxx
	sw/inc/chpfld.hxx
	sw/inc/cmdid.h
	sw/inc/crsrsh.hxx
	sw/inc/crstate.hxx
	sw/inc/dbfld.hxx
	sw/inc/dbmgr.hxx
	sw/inc/dcontact.hxx
	sw/inc/ddefld.hxx
	sw/inc/doc.hxx
	sw/inc/docary.hxx
	sw/inc/docsh.hxx
	sw/inc/docstat.hxx
	sw/inc/docstyle.hxx
	sw/inc/docufld.hxx
	sw/inc/editsh.hxx
	sw/inc/errhdl.hxx
	sw/inc/expfld.hxx
	sw/inc/fchrfmt.hxx
	sw/inc/fesh.hxx
	sw/inc/fldbas.hxx
	sw/inc/flddat.hxx
	sw/inc/flddropdown.hxx
	sw/inc/flypos.hxx
	sw/inc/fmtanchr.hxx
	sw/inc/fmtautofmt.hxx
	sw/inc/fmtclds.hxx
	sw/inc/fmtcnct.hxx
	sw/inc/fmtcol.hxx
	sw/inc/fmtfsize.hxx
	sw/inc/fmtftn.hxx
	sw/inc/fmtftntx.hxx
	sw/inc/fmthdft.hxx
	sw/inc/fmtinfmt.hxx
	sw/inc/fmtline.hxx
	sw/inc/fmtornt.hxx
	sw/inc/fmtpdsc.hxx
	sw/inc/fmtruby.hxx
	sw/inc/fmtsrnd.hxx
	sw/inc/fmturl.hxx
	sw/inc/fmtwrapinfluenceonobjpos.hxx
	sw/inc/format.hxx
	sw/inc/frmatr.hxx
	sw/inc/frmfmt.hxx
	sw/inc/grfatr.hxx
	sw/inc/helpid.h
	sw/inc/hintids.hxx
	sw/inc/hints.hxx
	sw/inc/htmltbl.hxx
	sw/inc/inetfld.hxx
	sw/inc/io.hxx
	sw/inc/iodetect.hxx
	sw/inc/itabenum.hxx
	sw/inc/ndarr.hxx
	sw/inc/ndgrf.hxx
	sw/inc/ndindex.hxx
	sw/inc/ndnotxt.hxx
	sw/inc/ndole.hxx
	sw/inc/ndtxt.hxx
	sw/inc/ndtyp.hxx
	sw/inc/node.hxx
	sw/inc/numrule.hxx
	sw/inc/pagedesc.hxx
	sw/inc/pagepreviewlayout.hxx
	sw/inc/pam.hxx
	sw/inc/paratr.hxx
	sw/inc/poolfmt.awk
	sw/inc/poolfmt.hxx
	sw/inc/printdata.hxx
	sw/inc/reffld.hxx
	sw/inc/shellio.hxx
	sw/inc/shellres.hxx
	sw/inc/swabstdlg.hxx
	sw/inc/swatrset.hxx
	sw/inc/swerror.h
	sw/inc/swprtopt.hxx
	sw/inc/swtable.hxx
	sw/inc/swtypes.hxx
	sw/inc/tblafmt.hxx
	sw/inc/tgrditem.hxx
	sw/inc/tox.hxx
	sw/inc/undobj.hxx
	sw/inc/unocoll.hxx
	sw/inc/unoframe.hxx
	sw/inc/unoprnms.hxx
	sw/inc/usrfld.hxx
	sw/inc/viewopt.hxx
	sw/inc/viewsh.hxx
	sw/inc/viscrs.hxx
	sw/prj/build.lst
	sw/qa/complex/accessibility/makefile.mk
	sw/qa/core/Test-BigPtrArray.cxx
	sw/qa/core/makefile.mk
	sw/sdi/makefile.mk
	sw/source/core/access/makefile.mk
	sw/source/core/access/textmarkuphelper.cxx
	sw/source/core/attr/calbck.cxx
	sw/source/core/attr/cellatr.cxx
	sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
	sw/source/core/attr/format.cxx
	sw/source/core/attr/hints.cxx
	sw/source/core/bastyp/calc.cxx
	sw/source/core/bastyp/init.cxx
	sw/source/core/bastyp/makefile.mk
	sw/source/core/bastyp/swcache.cxx
	sw/source/core/crsr/bookmrk.cxx
	sw/source/core/crsr/callnk.cxx
	sw/source/core/crsr/crsrsh.cxx
	sw/source/core/crsr/crstrvl.cxx
	sw/source/core/crsr/findattr.cxx
	sw/source/core/crsr/findcoll.cxx
	sw/source/core/crsr/makefile.mk
	sw/source/core/crsr/pam.cxx
	sw/source/core/crsr/swcrsr.cxx
	sw/source/core/crsr/trvltbl.cxx
	sw/source/core/crsr/unocrsr.cxx
	sw/source/core/crsr/viscrs.cxx
	sw/source/core/doc/acmplwrd.cxx
	sw/source/core/doc/doc.cxx
	sw/source/core/doc/docbm.cxx
	sw/source/core/doc/doccomp.cxx
	sw/source/core/doc/docdesc.cxx
	sw/source/core/doc/docdraw.cxx
	sw/source/core/doc/docedt.cxx
	sw/source/core/doc/docfld.cxx
	sw/source/core/doc/docfly.cxx
	sw/source/core/doc/docfmt.cxx
	sw/source/core/doc/docftn.cxx
	sw/source/core/doc/docglbl.cxx
	sw/source/core/doc/docglos.cxx
	sw/source/core/doc/doclay.cxx
	sw/source/core/doc/docnew.cxx
	sw/source/core/doc/docnum.cxx
	sw/source/core/doc/docredln.cxx
	sw/source/core/doc/docruby.cxx
	sw/source/core/doc/docsort.cxx
	sw/source/core/doc/docstat.cxx
	sw/source/core/doc/doctxm.cxx
	sw/source/core/doc/fmtcol.cxx
	sw/source/core/doc/gctable.cxx
	sw/source/core/doc/htmltbl.cxx
	sw/source/core/doc/makefile.mk
	sw/source/core/doc/number.cxx
	sw/source/core/doc/poolfmt.cxx
	sw/source/core/doc/tblafmt.cxx
	sw/source/core/doc/tblcpy.cxx
	sw/source/core/doc/tblrwcl.cxx
	sw/source/core/docnode/makefile.mk
	sw/source/core/docnode/ndcopy.cxx
	sw/source/core/docnode/ndnum.cxx
	sw/source/core/docnode/ndsect.cxx
	sw/source/core/docnode/ndtbl.cxx
	sw/source/core/docnode/ndtbl1.cxx
	sw/source/core/docnode/node.cxx
	sw/source/core/docnode/node2lay.cxx
	sw/source/core/docnode/nodes.cxx
	sw/source/core/docnode/section.cxx
	sw/source/core/docnode/swbaslnk.cxx
	sw/source/core/draw/dcontact.cxx
	sw/source/core/draw/dflyobj.cxx
	sw/source/core/draw/drawdoc.cxx
	sw/source/core/draw/dview.cxx
	sw/source/core/draw/makefile.mk
	sw/source/core/edit/autofmt.cxx
	sw/source/core/edit/edattr.cxx
	sw/source/core/edit/eddel.cxx
	sw/source/core/edit/edfcol.cxx
	sw/source/core/edit/edfld.cxx
	sw/source/core/edit/edfldexp.cxx
	sw/source/core/edit/edfmt.cxx
	sw/source/core/edit/edglss.cxx
	sw/source/core/edit/editsh.cxx
	sw/source/core/edit/edlingu.cxx
	sw/source/core/edit/ednumber.cxx
	sw/source/core/edit/edsect.cxx
	sw/source/core/edit/edtab.cxx
	sw/source/core/edit/edtox.cxx
	sw/source/core/edit/edundo.cxx
	sw/source/core/edit/makefile.mk
	sw/source/core/except/dbgloop.cxx
	sw/source/core/except/errhdl.cxx
	sw/source/core/fields/authfld.cxx
	sw/source/core/fields/cellfml.cxx
	sw/source/core/fields/chpfld.cxx
	sw/source/core/fields/dbfld.cxx
	sw/source/core/fields/ddefld.cxx
	sw/source/core/fields/ddetbl.cxx
	sw/source/core/fields/docufld.cxx
	sw/source/core/fields/expfld.cxx
	sw/source/core/fields/fldbas.cxx
	sw/source/core/fields/flddat.cxx
	sw/source/core/fields/flddropdown.cxx
	sw/source/core/fields/macrofld.cxx
	sw/source/core/fields/makefile.mk
	sw/source/core/fields/reffld.cxx
	sw/source/core/fields/scrptfld.cxx
	sw/source/core/fields/tblcalc.cxx
	sw/source/core/fields/usrfld.cxx
	sw/source/core/frmedt/fecopy.cxx
	sw/source/core/frmedt/fedesc.cxx
	sw/source/core/frmedt/fefly1.cxx
	sw/source/core/frmedt/feshview.cxx
	sw/source/core/frmedt/fetab.cxx
	sw/source/core/frmedt/fews.cxx
	sw/source/core/frmedt/makefile.mk
	sw/source/core/frmedt/tblsel.cxx
	sw/source/core/graphic/grfatr.cxx
	sw/source/core/inc/SwUndoFmt.hxx
	sw/source/core/inc/SwUndoTOXChange.hxx
	sw/source/core/inc/anchoredobjectposition.hxx
	sw/source/core/inc/dbgloop.hxx
	sw/source/core/inc/drawfont.hxx
	sw/source/core/inc/flowfrm.hxx
	sw/source/core/inc/frame.hxx
	sw/source/core/inc/frmtool.hxx
	sw/source/core/inc/layact.hxx
	sw/source/core/inc/layfrm.hxx
	sw/source/core/inc/notxtfrm.hxx
	sw/source/core/inc/rolbck.hxx
	sw/source/core/inc/rootfrm.hxx
	sw/source/core/inc/scriptinfo.hxx
	sw/source/core/inc/swblocks.hxx
	sw/source/core/inc/swcache.hxx
	sw/source/core/inc/tabfrm.hxx
	sw/source/core/inc/txmsrt.hxx
	sw/source/core/inc/undoflystrattr.hxx
	sw/source/core/inc/viewimp.hxx
	sw/source/core/layout/atrfrm.cxx
	sw/source/core/layout/calcmove.cxx
	sw/source/core/layout/dbg_lay.cxx
	sw/source/core/layout/findfrm.cxx
	sw/source/core/layout/flowfrm.cxx
	sw/source/core/layout/fly.cxx
	sw/source/core/layout/flycnt.cxx
	sw/source/core/layout/flyincnt.cxx
	sw/source/core/layout/flylay.cxx
	sw/source/core/layout/frmtool.cxx
	sw/source/core/layout/ftnfrm.cxx
	sw/source/core/layout/layact.cxx
	sw/source/core/layout/laycache.cxx
	sw/source/core/layout/makefile.mk
	sw/source/core/layout/objectformatter.cxx
	sw/source/core/layout/pagechg.cxx
	sw/source/core/layout/pagedesc.cxx
	sw/source/core/layout/paintfrm.cxx
	sw/source/core/layout/sectfrm.cxx
	sw/source/core/layout/tabfrm.cxx
	sw/source/core/layout/trvlfrm.cxx
	sw/source/core/layout/unusedf.cxx
	sw/source/core/layout/wsfrm.cxx
	sw/source/core/makefile.mk
	sw/source/core/objectpositioning/anchoredobjectposition.cxx
	sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
	sw/source/core/objectpositioning/makefile.mk
	sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
	sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
	sw/source/core/ole/ndole.cxx
	sw/source/core/para/makefile.mk
	sw/source/core/para/paratr.cxx
	sw/source/core/sw3io/makefile.mk
	sw/source/core/sw3io/sw3convert.cxx
	sw/source/core/swg/SwXMLTextBlocks.cxx
	sw/source/core/swg/makefile.mk
	sw/source/core/swg/swblocks.cxx
	sw/source/core/table/swnewtable.cxx
	sw/source/core/table/swtable.cxx
	sw/source/core/text/EnhancedPDFExportHelper.cxx
	sw/source/core/text/atrstck.cxx
	sw/source/core/text/frmcrsr.cxx
	sw/source/core/text/frmform.cxx
	sw/source/core/text/itrcrsr.cxx
	sw/source/core/text/itrform2.cxx
	sw/source/core/text/makefile.mk
	sw/source/core/text/porlay.cxx
	sw/source/core/text/pormulti.cxx
	sw/source/core/text/txtfld.cxx
	sw/source/core/text/txtfrm.cxx
	sw/source/core/text/txtio.cxx
	sw/source/core/tox/makefile.mk
	sw/source/core/tox/txmsrt.cxx
	sw/source/core/txtnode/fmtatr2.cxx
	sw/source/core/txtnode/fntcache.cxx
	sw/source/core/txtnode/fntcap.cxx
	sw/source/core/txtnode/makefile.mk
	sw/source/core/txtnode/ndhints.cxx
	sw/source/core/txtnode/ndtxt.cxx
	sw/source/core/txtnode/swfont.cxx
	sw/source/core/txtnode/thints.cxx
	sw/source/core/txtnode/txtatr2.cxx
	sw/source/core/txtnode/txtedt.cxx
	sw/source/core/undo/SwUndoField.cxx
	sw/source/core/undo/SwUndoPageDesc.cxx
	sw/source/core/undo/SwUndoTOXChange.cxx
	sw/source/core/undo/docundo.cxx
	sw/source/core/undo/makefile.mk
	sw/source/core/undo/rolbck.cxx
	sw/source/core/undo/unbkmk.cxx
	sw/source/core/undo/undel.cxx
	sw/source/core/undo/undobj.cxx
	sw/source/core/undo/undobj1.cxx
	sw/source/core/undo/unfmco.cxx
	sw/source/core/undo/unins.cxx
	sw/source/core/undo/unnum.cxx
	sw/source/core/undo/unoutl.cxx
	sw/source/core/undo/unredln.cxx
	sw/source/core/undo/unsect.cxx
	sw/source/core/undo/unsort.cxx
	sw/source/core/undo/unspnd.cxx
	sw/source/core/undo/untbl.cxx
	sw/source/core/unocore/makefile.mk
	sw/source/core/unocore/swunohelper.cxx
	sw/source/core/unocore/unobkm.cxx
	sw/source/core/unocore/unocoll.cxx
	sw/source/core/unocore/unocrsrhelper.cxx
	sw/source/core/unocore/unodraw.cxx
	sw/source/core/unocore/unofield.cxx
	sw/source/core/unocore/unoframe.cxx
	sw/source/core/unocore/unomap.cxx
	sw/source/core/unocore/unoprnms.cxx
	sw/source/core/unocore/unoredlines.cxx
	sw/source/core/unocore/unosett.cxx
	sw/source/core/unocore/unosrch.cxx
	sw/source/core/unocore/unostyle.cxx
	sw/source/core/unocore/unotbl.cxx
	sw/source/core/view/vdraw.cxx
	sw/source/core/view/viewimp.cxx
	sw/source/core/view/viewpg.cxx
	sw/source/core/view/viewsh.cxx
	sw/source/core/view/vnew.cxx
	sw/source/core/view/vprint.cxx
	sw/source/filter/ascii/ascatr.cxx
	sw/source/filter/ascii/makefile.mk
	sw/source/filter/ascii/wrtasc.cxx
	sw/source/filter/basflt/fltini.cxx
	sw/source/filter/basflt/iodetect.cxx
	sw/source/filter/basflt/makefile.mk
	sw/source/filter/html/SwAppletImpl.cxx
	sw/source/filter/html/css1atr.cxx
	sw/source/filter/html/htmlatr.cxx
	sw/source/filter/html/htmlbas.cxx
	sw/source/filter/html/htmlcss1.cxx
	sw/source/filter/html/htmlfly.cxx
	sw/source/filter/html/htmlftn.cxx
	sw/source/filter/html/htmlgrin.cxx
	sw/source/filter/html/htmlnum.cxx
	sw/source/filter/html/htmlplug.cxx
	sw/source/filter/html/htmltab.cxx
	sw/source/filter/html/makefile.mk
	sw/source/filter/html/parcss1.cxx
	sw/source/filter/html/svxcss1.cxx
	sw/source/filter/html/swhtml.cxx
	sw/source/filter/inc/msfilter.hxx
	sw/source/filter/inc/wrtswtbl.hxx
	sw/source/filter/rtf/makefile.mk
	sw/source/filter/rtf/rtffly.cxx
	sw/source/filter/rtf/rtfnum.cxx
	sw/source/filter/rtf/rtftbl.cxx
	sw/source/filter/rtf/swparrtf.cxx
	sw/source/filter/rtf/swparrtf.hxx
	sw/source/filter/writer/makefile.mk
	sw/source/filter/writer/writer.cxx
	sw/source/filter/writer/wrt_fn.cxx
	sw/source/filter/writer/wrtswtbl.cxx
	sw/source/filter/ww1/fltshell.cxx
	sw/source/filter/ww1/makefile.mk
	sw/source/filter/ww1/w1class.cxx
	sw/source/filter/ww1/w1class.hxx
	sw/source/filter/ww1/w1filter.cxx
	sw/source/filter/ww1/w1par.cxx
	sw/source/filter/ww1/w1sprm.cxx
	sw/source/filter/ww1/w1struct.hxx
	sw/source/filter/ww8/README-rtf.txt
	sw/source/filter/ww8/attributeoutputbase.hxx
	sw/source/filter/ww8/docxattributeoutput.cxx
	sw/source/filter/ww8/docxattributeoutput.hxx
	sw/source/filter/ww8/docxexport.cxx
	sw/source/filter/ww8/docxexport.hxx
	sw/source/filter/ww8/docxexportfilter.cxx
	sw/source/filter/ww8/dump/dump8.cxx
	sw/source/filter/ww8/dump/dump8a.cxx
	sw/source/filter/ww8/dump/msvbasic.cxx
	sw/source/filter/ww8/dump/msvbasic.hxx
	sw/source/filter/ww8/dump/ww8darr.cxx
	sw/source/filter/ww8/dump/ww8darr.hxx
	sw/source/filter/ww8/dump/ww8dout.cxx
	sw/source/filter/ww8/dump/ww8dout.hxx
	sw/source/filter/ww8/dump/ww8scan.cxx
	sw/source/filter/ww8/dump/ww8scan.hxx
	sw/source/filter/ww8/dump/ww8struc.hxx
	sw/source/filter/ww8/makefile.mk
	sw/source/filter/ww8/rtfattributeoutput.cxx
	sw/source/filter/ww8/rtfattributeoutput.hxx
	sw/source/filter/ww8/rtfexport.cxx
	sw/source/filter/ww8/rtfexport.hxx
	sw/source/filter/ww8/rtfexportfilter.cxx
	sw/source/filter/ww8/rtfexportfilter.hxx
	sw/source/filter/ww8/rtfimportfilter.cxx
	sw/source/filter/ww8/rtfimportfilter.hxx
	sw/source/filter/ww8/rtfsdrexport.cxx
	sw/source/filter/ww8/rtfsdrexport.hxx
	sw/source/filter/ww8/writerhelper.cxx
	sw/source/filter/ww8/writerwordglue.cxx
	sw/source/filter/ww8/wrtw8esh.cxx
	sw/source/filter/ww8/wrtw8nds.cxx
	sw/source/filter/ww8/wrtw8num.cxx
	sw/source/filter/ww8/wrtw8sty.cxx
	sw/source/filter/ww8/wrtww8.cxx
	sw/source/filter/ww8/wrtww8.hxx
	sw/source/filter/ww8/wrtww8gr.cxx
	sw/source/filter/ww8/ww8atr.cxx
	sw/source/filter/ww8/ww8attributeoutput.hxx
	sw/source/filter/ww8/ww8graf.cxx
	sw/source/filter/ww8/ww8graf.hxx
	sw/source/filter/ww8/ww8graf2.cxx
	sw/source/filter/ww8/ww8par.cxx
	sw/source/filter/ww8/ww8par.hxx
	sw/source/filter/ww8/ww8par2.cxx
	sw/source/filter/ww8/ww8par3.cxx
	sw/source/filter/ww8/ww8par5.cxx
	sw/source/filter/ww8/ww8par6.cxx
	sw/source/filter/ww8/ww8scan.cxx
	sw/source/filter/ww8/ww8scan.hxx
	sw/source/filter/ww8/ww8struc.hxx
	sw/source/filter/xml/makefile.mk
	sw/source/filter/xml/xmlimpit.cxx
	sw/source/filter/xml/xmltble.cxx
	sw/source/filter/xml/xmltbli.cxx
	sw/source/ui/app/appenv.cxx
	sw/source/ui/app/apphdl.cxx
	sw/source/ui/app/applab.cxx
	sw/source/ui/app/appopt.cxx
	sw/source/ui/app/docsh.cxx
	sw/source/ui/app/docsh2.cxx
	sw/source/ui/app/docshini.cxx
	sw/source/ui/app/docst.cxx
	sw/source/ui/app/docstyle.cxx
	sw/source/ui/app/makefile.mk
	sw/source/ui/app/mn.src
	sw/source/ui/app/swmodul1.cxx
	sw/source/ui/cctrl/makefile.mk
	sw/source/ui/cctrl/swlbox.cxx
	sw/source/ui/chrdlg/break.cxx
	sw/source/ui/chrdlg/ccoll.cxx
	sw/source/ui/chrdlg/chardlg.cxx
	sw/source/ui/chrdlg/drpcps.cxx
	sw/source/ui/chrdlg/makefile.mk
	sw/source/ui/chrdlg/numpara.cxx
	sw/source/ui/chrdlg/pardlg.cxx
	sw/source/ui/chrdlg/swuiccoll.cxx
	sw/source/ui/config/barcfg.cxx
	sw/source/ui/config/caption.cxx
	sw/source/ui/config/cfgitems.cxx
	sw/source/ui/config/fontcfg.cxx
	sw/source/ui/config/mailconfigpage.cxx
	sw/source/ui/config/makefile.mk
	sw/source/ui/config/modcfg.cxx
	sw/source/ui/config/optcomp.cxx
	sw/source/ui/config/optload.cxx
	sw/source/ui/config/optpage.cxx
	sw/source/ui/config/prtopt.cxx
	sw/source/ui/config/uinums.cxx
	sw/source/ui/config/usrpref.cxx
	sw/source/ui/config/viewopt.cxx
	sw/source/ui/dbui/dbinsdlg.cxx
	sw/source/ui/dbui/dbmgr.cxx
	sw/source/ui/dbui/dbtree.cxx
	sw/source/ui/dbui/makefile.mk
	sw/source/ui/dbui/mmaddressblockpage.cxx
	sw/source/ui/dbui/mmdocselectpage.cxx
	sw/source/ui/dbui/mmoutputpage.cxx
	sw/source/ui/dbui/swdbtoolsclient.cxx
	sw/source/ui/dialog/abstract.cxx
	sw/source/ui/dialog/ascfldlg.cxx
	sw/source/ui/dialog/macassgn.cxx
	sw/source/ui/dialog/makefile.mk
	sw/source/ui/dialog/regionsw.cxx
	sw/source/ui/dialog/swdlgfact.cxx
	sw/source/ui/dialog/swdlgfact.hxx
	sw/source/ui/dialog/uiregionsw.cxx
	sw/source/ui/dochdl/gloshdl.cxx
	sw/source/ui/dochdl/makefile.mk
	sw/source/ui/dochdl/swdtflvr.cxx
	sw/source/ui/docvw/PostItMgr.cxx
	sw/source/ui/docvw/SidebarWin.cxx
	sw/source/ui/docvw/edtdd.cxx
	sw/source/ui/docvw/edtwin.cxx
	sw/source/ui/docvw/edtwin2.cxx
	sw/source/ui/docvw/edtwin3.cxx
	sw/source/ui/docvw/makefile.mk
	sw/source/ui/docvw/romenu.cxx
	sw/source/ui/docvw/romenu.hxx
	sw/source/ui/docvw/srcedtw.cxx
	sw/source/ui/envelp/envfmt.cxx
	sw/source/ui/envelp/envimg.cxx
	sw/source/ui/envelp/envlop1.cxx
	sw/source/ui/envelp/envprt.cxx
	sw/source/ui/envelp/label1.cxx
	sw/source/ui/envelp/labfmt.cxx
	sw/source/ui/envelp/labprt.cxx
	sw/source/ui/envelp/mailmrge.cxx
	sw/source/ui/envelp/makefile.mk
	sw/source/ui/fldui/flddb.cxx
	sw/source/ui/fldui/flddinf.cxx
	sw/source/ui/fldui/flddok.cxx
	sw/source/ui/fldui/fldedt.cxx
	sw/source/ui/fldui/fldfunc.cxx
	sw/source/ui/fldui/fldmgr.cxx
	sw/source/ui/fldui/fldpage.cxx
	sw/source/ui/fldui/fldref.cxx
	sw/source/ui/fldui/fldtdlg.cxx
	sw/source/ui/fldui/fldvar.cxx
	sw/source/ui/fldui/fldwrap.cxx
	sw/source/ui/fldui/inpdlg.cxx
	sw/source/ui/fldui/makefile.mk
	sw/source/ui/fmtui/makefile.mk
	sw/source/ui/fmtui/tmpdlg.cxx
	sw/source/ui/frmdlg/colmgr.cxx
	sw/source/ui/frmdlg/column.cxx
	sw/source/ui/frmdlg/cption.cxx
	sw/source/ui/frmdlg/frmdlg.cxx
	sw/source/ui/frmdlg/frmmgr.cxx
	sw/source/ui/frmdlg/frmpage.cxx
	sw/source/ui/frmdlg/makefile.mk
	sw/source/ui/frmdlg/wrap.cxx
	sw/source/ui/globdoc/makefile.mk
	sw/source/ui/inc/bmpwin.hxx
	sw/source/ui/inc/colmgr.hxx
	sw/source/ui/inc/column.hxx
	sw/source/ui/inc/envimg.hxx
	sw/source/ui/inc/envlop.hxx
	sw/source/ui/inc/frmpage.hxx
	sw/source/ui/inc/inputwin.hxx
	sw/source/ui/inc/javaedit.hxx
	sw/source/ui/inc/num.hxx
	sw/source/ui/inc/optpage.hxx
	sw/source/ui/inc/regionsw.hxx
	sw/source/ui/inc/split.hxx
	sw/source/ui/inc/swlbox.hxx
	sw/source/ui/inc/swmn_tmpl.hrc
	sw/source/ui/inc/swuiidxmrk.hxx
	sw/source/ui/inc/tabsh.hxx
	sw/source/ui/inc/toxmgr.hxx
	sw/source/ui/inc/uiitems.hxx
	sw/source/ui/inc/view.hxx
	sw/source/ui/inc/workctrl.hxx
	sw/source/ui/inc/wrap.hxx
	sw/source/ui/inc/wrtsh.hxx
	sw/source/ui/index/cnttab.cxx
	sw/source/ui/index/makefile.mk
	sw/source/ui/index/toxmgr.cxx
	sw/source/ui/lingu/hhcwrp.cxx
	sw/source/ui/lingu/makefile.mk
	sw/source/ui/lingu/olmenu.cxx
	sw/source/ui/misc/bookmark.cxx
	sw/source/ui/misc/docfnote.cxx
	sw/source/ui/misc/glosbib.cxx
	sw/source/ui/misc/glosdoc.cxx
	sw/source/ui/misc/glshell.cxx
	sw/source/ui/misc/insfnote.cxx
	sw/source/ui/misc/linenum.cxx
	sw/source/ui/misc/makefile.mk
	sw/source/ui/misc/num.cxx
	sw/source/ui/misc/numberingtypelistbox.cxx
	sw/source/ui/misc/outline.cxx
	sw/source/ui/misc/pgfnote.cxx
	sw/source/ui/misc/pggrid.cxx
	sw/source/ui/misc/redlndlg.cxx
	sw/source/ui/misc/srtdlg.cxx
	sw/source/ui/misc/swmodalredlineacceptdlg.cxx
	sw/source/ui/ribbar/conarc.cxx
	sw/source/ui/ribbar/drawbase.cxx
	sw/source/ui/ribbar/inputwin.cxx
	sw/source/ui/ribbar/inputwin.src
	sw/source/ui/ribbar/makefile.mk
	sw/source/ui/ribbar/tbxanchr.cxx
	sw/source/ui/ribbar/workctrl.cxx
	sw/source/ui/ribbar/workctrl.src
	sw/source/ui/shells/annotsh.cxx
	sw/source/ui/shells/basesh.cxx
	sw/source/ui/shells/beziersh.cxx
	sw/source/ui/shells/drawdlg.cxx
	sw/source/ui/shells/drwbassh.cxx
	sw/source/ui/shells/drwtxtex.cxx
	sw/source/ui/shells/drwtxtsh.cxx
	sw/source/ui/shells/frmsh.cxx
	sw/source/ui/shells/grfsh.cxx
	sw/source/ui/shells/grfshex.cxx
	sw/source/ui/shells/makefile.mk
	sw/source/ui/shells/tabsh.cxx
	sw/source/ui/shells/textfld.cxx
	sw/source/ui/shells/textglos.cxx
	sw/source/ui/shells/textsh.cxx
	sw/source/ui/shells/textsh1.cxx
	sw/source/ui/shells/txtattr.cxx
	sw/source/ui/shells/txtcrsr.cxx
	sw/source/ui/shells/txtnum.cxx
	sw/source/ui/table/convert.cxx
	sw/source/ui/table/instable.cxx
	sw/source/ui/table/makefile.mk
	sw/source/ui/table/swtablerep.cxx
	sw/source/ui/table/tabledlg.cxx
	sw/source/ui/table/tablemgr.cxx
	sw/source/ui/table/tablepg.hxx
	sw/source/ui/table/tautofmt.cxx
	sw/source/ui/uiview/formatclipboard.cxx
	sw/source/ui/uiview/makefile.mk
	sw/source/ui/uiview/pview.cxx
	sw/source/ui/uiview/pview.src
	sw/source/ui/uiview/scroll.cxx
	sw/source/ui/uiview/srcview.cxx
	sw/source/ui/uiview/swcli.cxx
	sw/source/ui/uiview/uivwimp.cxx
	sw/source/ui/uiview/view.cxx
	sw/source/ui/uiview/view1.cxx
	sw/source/ui/uiview/view2.cxx
	sw/source/ui/uiview/viewcoll.cxx
	sw/source/ui/uiview/viewdlg2.cxx
	sw/source/ui/uiview/viewling.cxx
	sw/source/ui/uiview/viewmdi.cxx
	sw/source/ui/uiview/viewport.cxx
	sw/source/ui/uiview/viewprt.cxx
	sw/source/ui/uiview/viewsrch.cxx
	sw/source/ui/uiview/viewtab.cxx
	sw/source/ui/uno/SwXDocumentSettings.cxx
	sw/source/ui/uno/SwXPrintPreviewSettings.cxx
	sw/source/ui/uno/SwXPrintPreviewSettings.hxx
	sw/source/ui/uno/unoatxt.cxx
	sw/source/ui/uno/unomod.cxx
	sw/source/ui/uno/unotxdoc.cxx
	sw/source/ui/uno/unotxvw.cxx
	sw/source/ui/utlui/attrdesc.cxx
	sw/source/ui/utlui/content.cxx
	sw/source/ui/utlui/glbltree.cxx
	sw/source/ui/utlui/initui.cxx
	sw/source/ui/utlui/makefile.mk
	sw/source/ui/utlui/navipi.cxx
	sw/source/ui/utlui/navipi.src
	sw/source/ui/utlui/numfmtlb.cxx
	sw/source/ui/utlui/prcntfld.cxx
	sw/source/ui/utlui/uiitems.cxx
	sw/source/ui/utlui/uitool.cxx
	sw/source/ui/utlui/unotools.cxx
	sw/source/ui/utlui/viewlayoutctrl.cxx
	sw/source/ui/utlui/zoomctrl.cxx
	sw/source/ui/vba/makefile.mk
	sw/source/ui/vba/service.cxx
	sw/source/ui/web/makefile.mk
	sw/source/ui/wrtsh/makefile.mk
	sw/source/ui/wrtsh/wrtsh1.cxx
	sw/source/ui/wrtsh/wrtsh2.cxx
	sw/source/ui/wrtsh/wrtsh4.cxx
	sw/source/ui/wrtsh/wrtundo.cxx
	sw/util/hidother.src
	sw/util/makefile.mk
	sw/util/msword.map
2011-03-14 16:51:14 +00:00

1218 lines
40 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include <float.h>
#include <hintids.hxx>
#include <hints.hxx>
#include <fmtfld.hxx>
#include <txtfld.hxx>
#include <frmfmt.hxx>
#include <layfrm.hxx>
#include <cntfrm.hxx>
#include <tabfrm.hxx>
#include <doc.hxx>
#include <docary.hxx>
#include <ndtxt.hxx>
#include <swtable.hxx>
#include <tblsel.hxx>
#include <cellfml.hxx>
#include <calc.hxx>
#include <expfld.hxx>
#include <usrfld.hxx>
#include <flddat.hxx>
#include <cellatr.hxx>
#include <ndindex.hxx>
const sal_Unicode cRelTrenner = ',';
const sal_Unicode cRelKennung = ''; // CTRL-R
const sal_uInt16 cMAXSTACKSIZE = 50;
const SwFrm* lcl_GetBoxFrm( const SwTableBox& rBox );
long lcl_GetLongBoxNum( String& rStr );
const SwTableBox* lcl_RelToBox( const SwTable&, const SwTableBox*, const String& );
String lcl_BoxNmToRel( const SwTable&, const SwTableNode&,
const String& , const String& , bool );
/*************************************************************************
|*
|* double SwTableBox::GetValue() const
|* gebe den Wert dieser Box zurueck. Der Wert ergibt sich aus dem 1.
|* TextNode. Beginnt dieser mit einer Zahl/Formel, so berechne diese;
|* oder mit einem Feld, dann hole den Wert.
|* Alle anderen Bedingungen returnen einen Fehler (oder 0 ?)
|*
|*************************************************************************/
double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
{
double nRet = 0;
if( rCalcPara.rCalc.IsCalcError() )
return nRet; // schon ein Fehler in der Berechnung
rCalcPara.rCalc.SetCalcError( CALC_SYNTAX ); // default immer Fehler
// keine Content Box ?
if( !pSttNd )
return nRet;
if( rCalcPara.IncStackCnt() )
return nRet;
rCalcPara.SetLastTblBox( this );
// wird eine Rekursion erzeugt ?
SwTableBox* pBox = (SwTableBox*)this;
if( rCalcPara.pBoxStk->Seek_Entry( pBox ))
return nRet; // steht schon auf dem Stack: FEHLER
// bei dieser Box nochmal aufsetzen
rCalcPara.SetLastTblBox( this );
rCalcPara.pBoxStk->Insert( pBox ); // eintragen
do { // Middle-Check-Loop, damit aus dieser gesprungen werden kann
// hier aufgespannt, damit am Ende der Box-Pointer aus dem
// Stack ausgetragen wird
SwDoc* pDoc = GetFrmFmt()->GetDoc();
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == GetFrmFmt()->GetItemState(
RES_BOXATR_FORMULA, sal_False, &pItem ) )
{
rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // wieder zuruecksetzen
if( !((SwTblBoxFormula*)pItem)->IsValid() )
{
// dann berechnen
const SwTable* pTmp = rCalcPara.pTbl;
rCalcPara.pTbl = &pBox->GetSttNd()->FindTableNode()->GetTable();
((SwTblBoxFormula*)pItem)->Calc( rCalcPara, nRet );
if( !rCalcPara.IsStackOverFlow() )
{
SwFrmFmt* pFmt = pBox->ClaimFrmFmt();
SfxItemSet aTmp( pDoc->GetAttrPool(),
RES_BOXATR_BEGIN,RES_BOXATR_END-1 );
aTmp.Put( SwTblBoxValue( nRet ) );
if( SFX_ITEM_SET != pFmt->GetItemState( RES_BOXATR_FORMAT ))
aTmp.Put( SwTblBoxNumFormat( 0 ));
pFmt->SetFmtAttr( aTmp );
}
rCalcPara.pTbl = pTmp;
}
else
nRet = GetFrmFmt()->GetTblBoxValue().GetValue();
break;
}
else if( SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
RES_BOXATR_VALUE, sal_False, &pItem ) )
{
rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // wieder zuruecksetzen
nRet = ((SwTblBoxValue*)pItem)->GetValue();
break;
}
SwTxtNode* pTxtNd = pDoc->GetNodes()[ pSttNd->GetIndex() + 1 ]->GetTxtNode();
if( !pTxtNd )
break;
xub_StrLen nSttPos = 0;
const String& rTxt = pTxtNd->GetTxt();
while( nSttPos < rTxt.Len() &&
( ' ' == rTxt.GetChar( nSttPos ) || '\t' == rTxt.GetChar( nSttPos ) ) )
++nSttPos;
// beginnt an erster Position ein "RechenFeld", dann erfrage den Wert
// von diesem
sal_Unicode const Char = rTxt.GetChar(nSttPos);
if ( nSttPos < rTxt.Len() &&
( CH_TXTATR_BREAKWORD == Char || CH_TXTATR_INWORD == Char ) )
{
SwIndex aIdx( pTxtNd, nSttPos );
SwTxtFld * const pTxtFld = static_cast<SwTxtFld*>(
pTxtNd->GetTxtAttrForCharAt(aIdx.GetIndex(), RES_TXTATR_FIELD));
if( !pTxtFld )
break;
rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // wieder zuruecksetzen
const SwField* pFld = pTxtFld->GetFld().GetFld();
switch( pFld->GetTyp()->Which() )
{
case RES_SETEXPFLD:
nRet = ((SwSetExpField*)pFld)->GetValue();
break;
case RES_USERFLD:
nRet = ((SwUserFieldType*)pFld)->GetValue();
break;
case RES_TABLEFLD:
{
SwTblField* pTblFld = (SwTblField*)pFld;
if( !pTblFld->IsValid() ) // ist der Wert gueltig ??
{
// die richtige Tabelle mitgeben!
const SwTable* pTmp = rCalcPara.pTbl;
rCalcPara.pTbl = &pTxtNd->FindTableNode()->GetTable();
pTblFld->CalcField( rCalcPara );
rCalcPara.pTbl = pTmp;
}
nRet = pTblFld->GetValue();
}
break;
case RES_DATETIMEFLD:
nRet = ((SwDateTimeField*)pFld)->GetValue();
break;
case RES_JUMPEDITFLD:
//JP 14.09.98: Bug 56112 - der Platzhalter kann nie einen
// gueltigen Inhalt haben!
nRet = 0;
break;
default:
String const value(pFld->ExpandField(true));
nRet = rCalcPara.rCalc.Calculate(value).GetDouble();
}
}
else
{
// Ergebnis ist 0 und kein Fehler!
rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // wieder zuruecksetzen
double aNum;
String sTxt( rTxt.Copy( nSttPos ) );
sal_uInt32 nFmtIndex = GetFrmFmt()->GetTblBoxNumFmt().GetValue();
SvNumberFormatter* pNumFmtr = pDoc->GetNumberFormatter();
if( NUMBERFORMAT_TEXT == nFmtIndex )
nFmtIndex = 0;
// JP 22.04.98: Bug 49659 - Sonderbehandlung fuer Prozent
else if( sTxt.Len() &&
NUMBERFORMAT_PERCENT == pNumFmtr->GetType( nFmtIndex ))
{
sal_uInt32 nTmpFmt = 0;
if( pNumFmtr->IsNumberFormat( sTxt, nTmpFmt, aNum ) &&
NUMBERFORMAT_NUMBER == pNumFmtr->GetType( nTmpFmt ))
sTxt += '%';
}
if( pNumFmtr->IsNumberFormat( sTxt, nFmtIndex, aNum ))
nRet = aNum;
}
// ?? sonst ist das ein Fehler
} while( sal_False );
if( !rCalcPara.IsStackOverFlow() )
{
rCalcPara.pBoxStk->Remove( pBox ); // raus aus dem Stack
rCalcPara.DecStackCnt();
}
//JP 12.01.99: mit Fehlererkennung, Bug 60794
if( DBL_MAX == nRet )
rCalcPara.rCalc.SetCalcError( CALC_SYNTAX ); // Fehler setzen
return nRet;
}
/* */
// Struktur, die zum TabelleRechnen benoetigt wird
SwTblCalcPara::SwTblCalcPara( SwCalc& rCalculator, const SwTable& rTable )
: pLastTblBox( 0 ), nStackCnt( 0 ), nMaxSize( cMAXSTACKSIZE ),
rCalc( rCalculator ), pTbl( &rTable )
{
pBoxStk = new SwTableSortBoxes;
}
SwTblCalcPara::~SwTblCalcPara()
{
delete pBoxStk;
}
sal_Bool SwTblCalcPara::CalcWithStackOverflow()
{
// falls ein StackUeberlauf erkannt wurde, sollte mit
// der letzten Box noch mal aufgesetzt werden. Irgend
// ein Weg sollte dann
sal_uInt16 nSaveMaxSize = nMaxSize;
nMaxSize = cMAXSTACKSIZE - 5;
sal_uInt16 nCnt = 0;
SwTableBoxes aStackOverFlows;
do {
SwTableBox* pBox = (SwTableBox*)pLastTblBox;
nStackCnt = 0;
rCalc.SetCalcError( CALC_NOERR );
aStackOverFlows.C40_INSERT( SwTableBox, pBox, nCnt++ );
pBoxStk->Remove( pBox );
pBox->GetValue( *this );
} while( IsStackOverFlow() );
nMaxSize = cMAXSTACKSIZE - 3; // es muss mind. 1 Stufe tiefer gehen!
// falls Rekursionen erkannt wurden
nStackCnt = 0;
rCalc.SetCalcError( CALC_NOERR );
pBoxStk->Remove( sal_uInt16(0), pBoxStk->Count() );
while( !rCalc.IsCalcError() && nCnt )
{
aStackOverFlows[ --nCnt ]->GetValue( *this );
if( IsStackOverFlow() && !CalcWithStackOverflow() )
break;
}
nMaxSize = nSaveMaxSize;
aStackOverFlows.Remove( 0, aStackOverFlows.Count() );
return !rCalc.IsCalcError();
}
/* */
SwTableFormula::SwTableFormula( const String& rFormel )
: sFormel( rFormel )
{
eNmType = EXTRNL_NAME;
bValidValue = false;
}
SwTableFormula::~SwTableFormula()
{
}
void SwTableFormula::_MakeFormel( const SwTable& rTbl, String& rNewStr,
String& rFirstBox, String* pLastBox, void* pPara ) const
{
SwTblCalcPara* pCalcPara = (SwTblCalcPara*)pPara;
if( pCalcPara->rCalc.IsCalcError() ) // ist schon Fehler gesetzt ?
return;
SwTableBox* pSttBox, *pEndBox = 0;
rFirstBox.Erase(0,1); // Kennung fuer Box loeschen
// ein Bereich in dieser Klammer ?
if( pLastBox )
{
pEndBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(pLastBox->ToInt64()));
// ist das ueberhaupt ein gueltiger Pointer ??
if( !rTbl.GetTabSortBoxes().Seek_Entry( pEndBox ))
pEndBox = 0;
rFirstBox.Erase( 0, pLastBox->Len()+1 );
}
pSttBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(rFirstBox.ToInt64()));
// ist das ueberhaupt ein gueltiger Pointer ??
if( !rTbl.GetTabSortBoxes().Seek_Entry( pSttBox ))
pSttBox = 0;
rNewStr += ' ';
if( pEndBox && pSttBox ) // Bereich ?
{
// hole ueber das Layout alle "selectierten" Boxen und berechne
// deren Werte
SwSelBoxes aBoxes;
GetBoxes( *pSttBox, *pEndBox, aBoxes );
rNewStr += '(';
bool bDelim = false;
for( sal_uInt16 n = 0; n < aBoxes.Count() &&
!pCalcPara->rCalc.IsCalcError(); ++n )
{
const SwTableBox* pTblBox = aBoxes[n];
if ( pTblBox->getRowSpan() >= 1 )
{
if( bDelim )
rNewStr += cListDelim;
bDelim = true;
rNewStr += pCalcPara->rCalc.GetStrResult(
pTblBox->GetValue( *pCalcPara ), sal_False );
}
}
rNewStr += ')';
}
else if( pSttBox && !pLastBox ) // nur die StartBox ?
{
//JP 12.01.99: und keine EndBox in der Formel!
// Berechne den Wert der Box
if ( pSttBox->getRowSpan() >= 1 )
{
rNewStr += pCalcPara->rCalc.GetStrResult(
pSttBox->GetValue( *pCalcPara ), sal_False );
}
}
else
pCalcPara->rCalc.SetCalcError( CALC_SYNTAX ); // Fehler setzen
rNewStr += ' ';
}
void SwTableFormula::RelNmsToBoxNms( const SwTable& rTbl, String& rNewStr,
String& rFirstBox, String* pLastBox, void* pPara ) const
{
// relativen Namen zu Box-Namen (externe Darstellung)
SwNode* pNd = (SwNode*)pPara;
OSL_ENSURE( pNd, "Feld steht in keinem TextNode" );
const SwTableBox *pRelBox, *pBox = (SwTableBox *)rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() );
rNewStr += rFirstBox.Copy(0,1); // Kennung fuer Box erhalten
rFirstBox.Erase(0,1);
if( pLastBox )
{
if( 0 != ( pRelBox = lcl_RelToBox( rTbl, pBox, *pLastBox )) )
rNewStr += pRelBox->GetName();
else
rNewStr.AppendAscii("A1");
rNewStr += ':';
rFirstBox.Erase( 0, pLastBox->Len()+1 );
}
if( 0 != ( pRelBox = lcl_RelToBox( rTbl, pBox, rFirstBox )) )
rNewStr += pRelBox->GetName();
else
rNewStr.AppendAscii("A1");
// Kennung fuer Box erhalten
rNewStr += rFirstBox.GetChar( rFirstBox.Len() - 1 );
}
void SwTableFormula::RelBoxNmsToPtr( const SwTable& rTbl, String& rNewStr,
String& rFirstBox, String* pLastBox, void* pPara ) const
{
// relativen Namen zu Box-Pointern (interne Darstellung)
SwNode* pNd = (SwNode*)pPara;
OSL_ENSURE( pNd, "Feld steht in keinem Node" );
const SwTableBox *pRelBox, *pBox = (SwTableBox*)rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() );
rNewStr += rFirstBox.Copy(0,1); // Kennung fuer Box erhalten
rFirstBox.Erase(0,1);
if( pLastBox )
{
if( 0 != ( pRelBox = lcl_RelToBox( rTbl, pBox, *pLastBox )) )
rNewStr += String::CreateFromInt64( (sal_PtrDiff)pRelBox );
else
rNewStr += '0';
rNewStr += ':';
rFirstBox.Erase( 0, pLastBox->Len()+1 );
}
if( 0 != ( pRelBox = lcl_RelToBox( rTbl, pBox, rFirstBox )) )
rNewStr += String::CreateFromInt64( (sal_PtrDiff)pRelBox );
else
rNewStr += '0';
// Kennung fuer Box erhalten
rNewStr += rFirstBox.GetChar( rFirstBox.Len() - 1 );
}
void SwTableFormula::BoxNmsToRelNm( const SwTable& rTbl, String& rNewStr,
String& rFirstBox, String* pLastBox, void* pPara ) const
{
// Box-Namen (externe Darstellung) zu relativen Namen
SwNode* pNd = (SwNode*)pPara;
OSL_ENSURE( pNd, "Feld steht in keinem Node" );
const SwTableNode* pTblNd = pNd->FindTableNode();
String sRefBoxNm;
if( &pTblNd->GetTable() == &rTbl )
{
const SwTableBox *pBox = rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() );
OSL_ENSURE( pBox, "Feld steht in keiner Tabelle" );
sRefBoxNm = pBox->GetName();
}
rNewStr += rFirstBox.Copy(0,1); // Kennung fuer Box erhalten
rFirstBox.Erase(0,1);
if( pLastBox )
{
rNewStr += lcl_BoxNmToRel( rTbl, *pTblNd, sRefBoxNm, *pLastBox,
eNmType == EXTRNL_NAME );
rNewStr += ':';
rFirstBox.Erase( 0, pLastBox->Len()+1 );
}
rNewStr += lcl_BoxNmToRel( rTbl, *pTblNd, sRefBoxNm, rFirstBox,
eNmType == EXTRNL_NAME );
// Kennung fuer Box erhalten
rNewStr += rFirstBox.GetChar( rFirstBox.Len() - 1 );
}
void SwTableFormula::PtrToBoxNms( const SwTable& rTbl, String& rNewStr,
String& rFirstBox, String* pLastBox, void* ) const
{
// ein Bereich in dieser Klammer ?
SwTableBox* pBox;
rNewStr += rFirstBox.Copy(0,1); // Kennung fuer Box erhalten
rFirstBox.Erase(0,1);
if( pLastBox )
{
pBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(pLastBox->ToInt64()));
// ist das ueberhaupt ein gueltiger Pointer ??
if( rTbl.GetTabSortBoxes().Seek_Entry( pBox ))
rNewStr += pBox->GetName();
else
rNewStr += '?';
rNewStr += ':';
rFirstBox.Erase( 0, pLastBox->Len()+1 );
}
pBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(rFirstBox.ToInt64()));
// ist das ueberhaupt ein gueltiger Pointer ??
if( rTbl.GetTabSortBoxes().Seek_Entry( pBox ))
rNewStr += pBox->GetName();
else
rNewStr += '?';
// Kennung fuer Box erhalten
rNewStr += rFirstBox.GetChar( rFirstBox.Len() - 1 );
}
void SwTableFormula::BoxNmsToPtr( const SwTable& rTbl, String& rNewStr,
String& rFirstBox, String* pLastBox, void* ) const
{
// ein Bereich in dieser Klammer ?
const SwTableBox* pBox;
rNewStr += rFirstBox.Copy(0,1); // Kennung fuer Box erhalten
rFirstBox.Erase(0,1);
if( pLastBox )
{
pBox = rTbl.GetTblBox( *pLastBox );
rNewStr += String::CreateFromInt64( (sal_PtrDiff)pBox );
rNewStr += ':';
rFirstBox.Erase( 0, pLastBox->Len()+1 );
}
pBox = rTbl.GetTblBox( rFirstBox );
rNewStr += String::CreateFromInt64( (sal_PtrDiff)pBox );
// Kennung fuer Box erhalten
rNewStr += rFirstBox.GetChar( rFirstBox.Len() - 1 );
}
// erzeuge die externe (fuer UI) Formel
void SwTableFormula::PtrToBoxNm( const SwTable* pTbl )
{
const SwNode* pNd = 0;
FnScanFormel fnFormel = 0;
switch( eNmType)
{
case INTRNL_NAME:
if( pTbl )
fnFormel = &SwTableFormula::PtrToBoxNms;
break;
case REL_NAME:
if( pTbl )
{
fnFormel = &SwTableFormula::RelNmsToBoxNms;
pNd = GetNodeOfFormula();
}
break;
case EXTRNL_NAME:
return;
}
sFormel = ScanString( fnFormel, *pTbl, (void*)pNd );
eNmType = EXTRNL_NAME;
}
// erzeuge die interne (in CORE) Formel
void SwTableFormula::BoxNmToPtr( const SwTable* pTbl )
{
const SwNode* pNd = 0;
FnScanFormel fnFormel = 0;
switch( eNmType)
{
case EXTRNL_NAME:
if( pTbl )
fnFormel = &SwTableFormula::BoxNmsToPtr;
break;
case REL_NAME:
if( pTbl )
{
fnFormel = &SwTableFormula::RelBoxNmsToPtr;
pNd = GetNodeOfFormula();
}
break;
case INTRNL_NAME:
return;
}
sFormel = ScanString( fnFormel, *pTbl, (void*)pNd );
eNmType = INTRNL_NAME;
}
// erzeuge die relative (fuers Kopieren) Formel
void SwTableFormula::ToRelBoxNm( const SwTable* pTbl )
{
const SwNode* pNd = 0;
FnScanFormel fnFormel = 0;
switch( eNmType)
{
case INTRNL_NAME:
case EXTRNL_NAME:
if( pTbl )
{
fnFormel = &SwTableFormula::BoxNmsToRelNm;
pNd = GetNodeOfFormula();
}
break;
case REL_NAME:
return;
}
sFormel = ScanString( fnFormel, *pTbl, (void*)pNd );
eNmType = REL_NAME;
}
String SwTableFormula::ScanString( FnScanFormel fnFormel, const SwTable& rTbl,
void* pPara ) const
{
String aStr;
sal_uInt16 nFml = 0, nStt = 0, nEnd = 0, nTrenner;
do {
// falls der Formel ein Name vorangestellt ist, diese Tabelle
// benutzen !!
const SwTable* pTbl = &rTbl;
nStt = sFormel.Search( '<', nFml );
if( STRING_NOTFOUND != nStt )
{
while( STRING_NOTFOUND != nStt &&
( ' ' == sFormel.GetChar( nStt + 1 ) ||
'=' == sFormel.GetChar( nStt + 1 ) ) )
nStt = sFormel.Search( '<', nStt + 1 );
if( STRING_NOTFOUND != nStt )
nEnd = sFormel.Search( '>', nStt+1 );
}
if( STRING_NOTFOUND == nStt || STRING_NOTFOUND == nEnd )
{
// den Rest setzen und beenden
aStr.Insert( sFormel, nFml, sFormel.Len() - nFml );
break;
}
aStr.Insert( sFormel, nFml, nStt - nFml ); // Anfang schreiben
if( fnFormel != NULL )
{
// ist ein TabellenName vorangestellt ??
// JP 16.02.99: SplitMergeBoxNm behandeln den Namen selbst
// JP 22.02.99: der CAST muss fuer den Linux-Compiler sein
// JP 28.06.99: rel. BoxName have no preceding tablename!
if( fnFormel != (FnScanFormel)&SwTableFormula::_SplitMergeBoxNm &&
1 < sFormel.Len() && cRelKennung != sFormel.GetChar( 1 ) &&
STRING_NOTFOUND != ( nTrenner = sFormel.Search( '.', nStt ))
&& nTrenner < nEnd )
{
String sTblNm( sFormel.Copy( nStt, nEnd - nStt ));
// falls im Namen schon die Punkte enthalten sind,
// treten diese immer paarig auf!!! (A1.1.1 !!)
if( (sTblNm.GetTokenCount( '.' ) - 1 ) & 1 )
{
sTblNm.Erase( nTrenner - nStt );
// beim Bauen der Formel ist der TabellenName unerwuenscht
//JP 22.02.99: der CAST muss fuer den Linux-Compiler sein
if( fnFormel != (FnScanFormel)&SwTableFormula::_MakeFormel )
aStr += sTblNm;
nStt = nTrenner;
sTblNm.Erase( 0, 1 ); // Trenner loeschen
if( sTblNm != rTbl.GetFrmFmt()->GetName() )
{
// dann suchen wir uns mal unsere Tabelle:
const SwTable* pFnd = FindTable(
*rTbl.GetFrmFmt()->GetDoc(),
sTblNm );
if( pFnd )
pTbl = pFnd;
// ??
OSL_ENSURE( pFnd, "Tabelle nicht gefunden, was nun?" );
}
}
}
String sBox( sFormel.Copy( nStt, nEnd - nStt + 1 ));
// ein Bereich in dieser Klammer ?
if( STRING_NOTFOUND != ( nTrenner = sFormel.Search( ':', nStt ))
&& nTrenner < nEnd )
{
// ohne die Anfangsklammer
String aFirstBox( sFormel.Copy( nStt+1, nTrenner - nStt - 1 ));
(this->*fnFormel)( *pTbl, aStr, sBox, &aFirstBox, pPara );
}
else
(this->*fnFormel)( *pTbl, aStr, sBox, 0, pPara );
}
nFml = nEnd+1;
} while( sal_True );
return aStr;
}
const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const String& rNm ) const
{
const SwFrmFmts& rTblFmts = *rDoc.GetTblFrmFmts();
const SwTable* pTmpTbl, *pRet = 0;
for( sal_uInt16 nFmtCnt = rTblFmts.Count(); nFmtCnt; )
{
SwFrmFmt* pFmt = rTblFmts[ --nFmtCnt ];
// falls wir von Sw3Writer gerufen werden, dann ist dem
// FormatNamen eine Nummer anhaengig
SwTableBox* pFBox;
if( COMPARE_EQUAL == rNm.CompareTo( pFmt->GetName(),
pFmt->GetName().Search( 0x0a ) ) &&
0 != ( pTmpTbl = SwTable::FindTable( pFmt ) ) &&
0 != (pFBox = pTmpTbl->GetTabSortBoxes()[0] ) &&
pFBox->GetSttNd() &&
pFBox->GetSttNd()->GetNodes().IsDocNodes() )
{
// eine Tabelle im normalen NodesArr
pRet = pTmpTbl;
break;
}
}
return pRet;
}
/* */
const SwFrm* lcl_GetBoxFrm( const SwTableBox& rBox )
{
SwNodeIndex aIdx( *rBox.GetSttNd() );
SwCntntNode* pCNd = aIdx.GetNodes().GoNext( &aIdx );
OSL_ENSURE( pCNd, "Box hat keinen TextNode" );
Point aPt; // den im Layout 1. Frame returnen - Tab.Kopfzeile !!
return pCNd->GetFrm( &aPt, NULL, sal_False );
}
long lcl_GetLongBoxNum( String& rStr )
{
sal_uInt16 nPos;
long nRet;
if( STRING_NOTFOUND == ( nPos = rStr.Search( cRelTrenner ) ))
{
nRet = rStr.ToInt32();
rStr.Erase();
}
else
{
nRet = rStr.Copy( 0, nPos ).ToInt32();
rStr.Erase( 0, nPos+1 );
}
return nRet;
}
const SwTableBox* lcl_RelToBox( const SwTable& rTbl,
const SwTableBox* pRefBox,
const String& rGetName )
{
// hole die Line
const SwTableBox* pBox = 0;
String sGetName( rGetName );
// ist es denn wirklich eine relative Angabe??
if( cRelKennung == sGetName.GetChar(0) ) // ja, ...
{
if( !pRefBox )
return 0;
sGetName.Erase( 0, 1 );
const SwTableLines* pLines = (SwTableLines*)&rTbl.GetTabLines();
const SwTableBoxes* pBoxes;
const SwTableLine* pLine;
// bestimme erst mal die Start-Werte der Box:
pBox = (SwTableBox*)pRefBox;
pLine = pBox->GetUpper();
while( pLine->GetUpper() )
{
pBox = pLine->GetUpper();
pLine = pBox->GetUpper();
}
sal_uInt16 nSttBox = pLine->GetTabBoxes().GetPos( pBox );
sal_uInt16 nSttLine = rTbl.GetTabLines().GetPos( pLine );
long nBoxOffset = lcl_GetLongBoxNum( sGetName ) + nSttBox;
long nLineOffset = lcl_GetLongBoxNum( sGetName ) + nSttLine;
if( nBoxOffset < 0 || nBoxOffset >= USHRT_MAX ||
nLineOffset < 0 || nLineOffset >= USHRT_MAX )
return 0;
if( nLineOffset >= long(pLines->Count()) )
return 0;
pLine = (*pLines)[ sal_uInt16(nLineOffset) ];
// dann suche die Box
pBoxes = &pLine->GetTabBoxes();
if( nBoxOffset >= long(pBoxes->Count()) )
return 0;
pBox = (*pBoxes)[ sal_uInt16(nBoxOffset) ];
while( sGetName.Len() )
{
nSttBox = SwTable::_GetBoxNum( sGetName );
pLines = &pBox->GetTabLines();
if( nSttBox )
--nSttBox;
nSttLine = SwTable::_GetBoxNum( sGetName );
// bestimme die Line
if( !nSttLine || nSttLine > pLines->Count() )
break;
pLine = (*pLines)[ nSttLine-1 ];
// bestimme die Box
pBoxes = &pLine->GetTabBoxes();
if( nSttBox >= pBoxes->Count() )
break;
pBox = (*pBoxes)[ nSttBox ];
}
if( pBox )
{
if( !pBox->GetSttNd() )
// "herunterfallen lassen" bis zur ersten Box
while( pBox->GetTabLines().Count() )
pBox = pBox->GetTabLines()[0]->GetTabBoxes()[0];
}
}
else
{
// sonst ist es eine absolute externe Darstellung:
pBox = rTbl.GetTblBox( sGetName );
}
return pBox;
}
String lcl_BoxNmToRel( const SwTable& rTbl, const SwTableNode& rTblNd,
const String& rRefBoxNm, const String& rGetStr,
bool bExtrnlNm )
{
String sCpy( rRefBoxNm );
String sTmp( rGetStr );
if( !bExtrnlNm )
{
// in die Externe Darstellung umwandeln.
SwTableBox* pBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(sTmp.ToInt64()));
if( !rTbl.GetTabSortBoxes().Seek_Entry( pBox ))
return '?';
sTmp = pBox->GetName();
}
// sollte die es eine Tabellen uebergreifende Formel sein, dann behalte
// die externe Darstellung bei:
if( &rTbl == &rTblNd.GetTable() )
{
long nBox = SwTable::_GetBoxNum( sTmp, sal_True );
nBox -= SwTable::_GetBoxNum( sCpy, sal_True );
long nLine = SwTable::_GetBoxNum( sTmp );
nLine -= SwTable::_GetBoxNum( sCpy );
sCpy = sTmp; //JP 01.11.95: den Rest aus dem BoxNamen anhaengen
sTmp = cRelKennung;
sTmp += String::CreateFromInt32( nBox );
sTmp += cRelTrenner;
sTmp += String::CreateFromInt32( nLine );
if( sCpy.Len() )
{
sTmp += cRelTrenner;
sTmp += sCpy;
}
}
if( sTmp.Len() && '>' == sTmp.GetChar( sTmp.Len() - 1 ))
sTmp.Erase( sTmp.Len()-1 );
return sTmp;
}
sal_uInt16 SwTableFormula::GetBoxesOfFormula( const SwTable& rTbl,
SwSelBoxes& rBoxes )
{
if( rBoxes.Count() )
rBoxes.Remove( sal_uInt16(0), rBoxes.Count() );
BoxNmToPtr( &rTbl );
ScanString( &SwTableFormula::_GetFmlBoxes, rTbl, &rBoxes );
return rBoxes.Count();
}
void SwTableFormula::_GetFmlBoxes( const SwTable& rTbl, String& ,
String& rFirstBox, String* pLastBox, void* pPara ) const
{
SwSelBoxes* pBoxes = (SwSelBoxes*)pPara;
SwTableBox* pSttBox, *pEndBox = 0;
rFirstBox.Erase(0,1); // Kennung fuer Box loeschen
// ein Bereich in dieser Klammer ?
if( pLastBox )
{
pEndBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(pLastBox->ToInt64()));
// ist das ueberhaupt ein gueltiger Pointer ??
if( !rTbl.GetTabSortBoxes().Seek_Entry( pEndBox ))
pEndBox = 0;
rFirstBox.Erase( 0, pLastBox->Len()+1 );
}
pSttBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(rFirstBox.ToInt64()));
// ist das ueberhaupt ein gueltiger Pointer ??
if( !rTbl.GetTabSortBoxes().Seek_Entry( pSttBox ))
pSttBox = 0;
if( pEndBox && pSttBox ) // Bereich ?
{
// ueber das Layout alle "selectierten" Boxen und berechne
// deren Werte
SwSelBoxes aBoxes;
GetBoxes( *pSttBox, *pEndBox, aBoxes );
pBoxes->Insert( &aBoxes );
}
else if( pSttBox ) // nur die StartBox ?
pBoxes->Insert( pSttBox );
}
void SwTableFormula::GetBoxes( const SwTableBox& rSttBox,
const SwTableBox& rEndBox,
SwSelBoxes& rBoxes ) const
{
// hole ueber das Layout alle "selektierten" Boxen
const SwLayoutFrm *pStt, *pEnd;
const SwFrm* pFrm = lcl_GetBoxFrm( rSttBox );
pStt = pFrm ? pFrm->GetUpper() : 0;
pEnd = ( 0 != (pFrm = lcl_GetBoxFrm( rEndBox ))) ? pFrm->GetUpper() : 0;
if( !pStt || !pEnd )
return ; // no valid selection
GetTblSel( pStt, pEnd, rBoxes, 0 );
const SwTable* pTbl = pStt->FindTabFrm()->GetTable();
// filter die Kopfzeilen-Boxen heraus:
if( pTbl->GetRowsToRepeat() > 0 )
{
do { // middle-check loop
const SwTableLine* pLine = rSttBox.GetUpper();
while( pLine->GetUpper() )
pLine = pLine->GetUpper()->GetUpper();
if( pTbl->IsHeadline( *pLine ) )
break; // Headline mit im Bereich !
// vielleicht ist ja Start und Ende vertauscht
pLine = rEndBox.GetUpper();
while ( pLine->GetUpper() )
pLine = pLine->GetUpper()->GetUpper();
if( pTbl->IsHeadline( *pLine ) )
break; // Headline mit im Bereich !
const SwTabFrm *pTable = pStt->FindTabFrm();
const SwTabFrm *pEndTable = pEnd->FindTabFrm();
if( pTable == pEndTable ) // keine gespl. Tabelle
break;
// dann mal die Tabellenkoepfe raus:
for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
pLine = rBoxes[n]->GetUpper();
while( pLine->GetUpper() )
pLine = pLine->GetUpper()->GetUpper();
if( pTbl->IsHeadline( *pLine ) )
rBoxes.Remove( n--, 1 );
}
} while( sal_False );
}
}
// sind alle Boxen gueltig, auf die sich die Formel bezieht?
void SwTableFormula::_HasValidBoxes( const SwTable& rTbl, String& ,
String& rFirstBox, String* pLastBox, void* pPara ) const
{
bool* pBValid = (bool*)pPara;
if( *pBValid ) // einmal falsch, immer falsch
{
SwTableBox* pSttBox = 0, *pEndBox = 0;
rFirstBox.Erase(0,1); // Kennung fuer Box loeschen
// ein Bereich in dieser Klammer ?
if( pLastBox )
rFirstBox.Erase( 0, pLastBox->Len()+1 );
switch( eNmType)
{
case INTRNL_NAME:
if( pLastBox )
pEndBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(pLastBox->ToInt64()));
pSttBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(rFirstBox.ToInt64()));
break;
case REL_NAME:
{
const SwNode* pNd = GetNodeOfFormula();
const SwTableBox* pBox = !pNd ? 0
: (SwTableBox *)rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() );
if( pLastBox )
pEndBox = (SwTableBox*)lcl_RelToBox( rTbl, pBox, *pLastBox );
pSttBox = (SwTableBox*)lcl_RelToBox( rTbl, pBox, rFirstBox );
}
break;
case EXTRNL_NAME:
if( pLastBox )
pEndBox = (SwTableBox*)rTbl.GetTblBox( *pLastBox );
pSttBox = (SwTableBox*)rTbl.GetTblBox( rFirstBox );
break;
}
// sind das gueltige Pointer ?
if( ( pLastBox &&
( !pEndBox || !rTbl.GetTabSortBoxes().Seek_Entry( pEndBox ) ) ) ||
( !pSttBox || !rTbl.GetTabSortBoxes().Seek_Entry( pSttBox ) ) )
*pBValid = false;
}
}
bool SwTableFormula::HasValidBoxes() const
{
bool bRet = true;
const SwNode* pNd = GetNodeOfFormula();
if( pNd && 0 != ( pNd = pNd->FindTableNode() ) )
ScanString( &SwTableFormula::_HasValidBoxes,
((SwTableNode*)pNd)->GetTable(), &bRet );
return bRet;
}
sal_uInt16 SwTableFormula::GetLnPosInTbl( const SwTable& rTbl, const SwTableBox* pBox )
{
sal_uInt16 nRet = USHRT_MAX;
if( pBox )
{
const SwTableLine* pLn = pBox->GetUpper();
while( pLn->GetUpper() )
pLn = pLn->GetUpper()->GetUpper();
nRet = rTbl.GetTabLines().GetPos( pLn );
}
return nRet;
}
void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
String& rFirstBox, String* pLastBox, void* pPara ) const
{
SwTableFmlUpdate& rTblUpd = *(SwTableFmlUpdate*)pPara;
rNewStr += rFirstBox.Copy(0,1); // Kennung fuer Box erhalten
rFirstBox.Erase(0,1);
String sTblNm;
const SwTable* pTbl = &rTbl;
String* pTblNmBox = pLastBox ? pLastBox : &rFirstBox;
sal_uInt16 nLastBoxLen = pTblNmBox->Len();
sal_uInt16 nTrenner = pTblNmBox->Search( '.' );
if( STRING_NOTFOUND != nTrenner &&
// falls im Namen schon die Punkte enthalten sind,
// treten diese immer paarig auf!!! (A1.1.1 !!)
(pTblNmBox->GetTokenCount( '.' ) - 1 ) & 1 )
{
sTblNm = pTblNmBox->Copy( 0, nTrenner );
pTblNmBox->Erase( 0, nTrenner + 1);// den Punkt entfernen
const SwTable* pFnd = FindTable( *rTbl.GetFrmFmt()->GetDoc(), sTblNm );
if( pFnd )
pTbl = pFnd;
if( TBL_MERGETBL == rTblUpd.eFlags )
{
if( pFnd )
{
if( pFnd == rTblUpd.DATA.pDelTbl )
{
if( rTblUpd.pTbl != &rTbl ) // es ist nicht die akt.
(rNewStr += rTblUpd.pTbl->GetFrmFmt()->GetName() )
+= '.'; // den neuen Tabellen Namen setzen
rTblUpd.bModified = sal_True;
}
else if( pFnd != rTblUpd.pTbl ||
( rTblUpd.pTbl != &rTbl && &rTbl != rTblUpd.DATA.pDelTbl))
(rNewStr += sTblNm ) += '.'; // den Tabellen Namen behalten
else
rTblUpd.bModified = sal_True;
}
else
(rNewStr += sTblNm ) += '.'; // den Tabellen Namen behalten
}
}
if( pTblNmBox == pLastBox )
rFirstBox.Erase( 0, nLastBoxLen + 1 );
SwTableBox* pSttBox = 0, *pEndBox = 0;
switch( eNmType )
{
case INTRNL_NAME:
if( pLastBox )
pEndBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(pLastBox->ToInt64()));
pSttBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(rFirstBox.ToInt64()));
break;
case REL_NAME:
{
const SwNode* pNd = GetNodeOfFormula();
const SwTableBox* pBox = pNd ? pTbl->GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() ) : 0;
if( pLastBox )
pEndBox = (SwTableBox*)lcl_RelToBox( *pTbl, pBox, *pLastBox );
pSttBox = (SwTableBox*)lcl_RelToBox( *pTbl, pBox, rFirstBox );
}
break;
case EXTRNL_NAME:
if( pLastBox )
pEndBox = (SwTableBox*)pTbl->GetTblBox( *pLastBox );
pSttBox = (SwTableBox*)pTbl->GetTblBox( rFirstBox );
break;
}
if( pLastBox && !pTbl->GetTabSortBoxes().Seek_Entry( pEndBox ))
pEndBox = 0;
if( !pTbl->GetTabSortBoxes().Seek_Entry( pSttBox ))
pSttBox = 0;
if( TBL_SPLITTBL == rTblUpd.eFlags )
{
// wo liegen die Boxen, in der "alten" oder in der neuen Tabelle?
bool bInNewTbl = false;
if( pLastBox )
{
// das ist die "erste" Box in der Selektion. Die bestimmt ob die
// Formel in der alten oder neuen Tabelle steht.
sal_uInt16 nEndLnPos = SwTableFormula::GetLnPosInTbl( *pTbl, pEndBox ),
nSttLnPos = SwTableFormula::GetLnPosInTbl( *pTbl, pSttBox );
if( USHRT_MAX != nSttLnPos && USHRT_MAX != nEndLnPos &&
((rTblUpd.nSplitLine <= nSttLnPos) ==
(rTblUpd.nSplitLine <= nEndLnPos)) )
{
// bleiben in der gleichen Tabelle
bInNewTbl = rTblUpd.nSplitLine <= nEndLnPos &&
pTbl == rTblUpd.pTbl;
}
else
{
// das ist aufjedenfall eine ungueltige Formel, also fuers
// Undo auf Modified setzen
rTblUpd.bModified = sal_True;
if( pEndBox )
bInNewTbl = USHRT_MAX != nEndLnPos &&
rTblUpd.nSplitLine <= nEndLnPos &&
pTbl == rTblUpd.pTbl;
}
}
else
{
sal_uInt16 nSttLnPos = SwTableFormula::GetLnPosInTbl( *pTbl, pSttBox );
// dann landet das Teil in der neuen Tabelle?
bInNewTbl = USHRT_MAX != nSttLnPos &&
rTblUpd.nSplitLine <= nSttLnPos &&
pTbl == rTblUpd.pTbl;
}
// wenn die Formel selbst in der neuen Tabellen landet
if( rTblUpd.bBehindSplitLine )
{
if( !bInNewTbl )
{
rTblUpd.bModified = sal_True;
( rNewStr += rTblUpd.pTbl->GetFrmFmt()->GetName() ) += '.';
}
else if( sTblNm.Len() )
( rNewStr += sTblNm ) += '.';
}
else if( bInNewTbl )
{
rTblUpd.bModified = sal_True;
( rNewStr += *rTblUpd.DATA.pNewTblNm ) += '.';
}
else if( sTblNm.Len() )
( rNewStr += sTblNm ) += '.';
}
if( pLastBox )
( rNewStr += String::CreateFromInt64((sal_PtrDiff)pEndBox)) += ':';
( rNewStr += String::CreateFromInt64((sal_PtrDiff)pSttBox))
+= rFirstBox.GetChar( rFirstBox.Len() - 1 );
}
// erzeuge die externe Formel, beachte aber das die Formel
// in einer gesplitteten/gemergten Tabelle landet
void SwTableFormula::ToSplitMergeBoxNm( SwTableFmlUpdate& rTblUpd )
{
const SwTable* pTbl;
const SwNode* pNd = GetNodeOfFormula();
if( pNd && 0 != ( pNd = pNd->FindTableNode() ))
pTbl = &((SwTableNode*)pNd)->GetTable();
else
pTbl = rTblUpd.pTbl;
sFormel = ScanString( &SwTableFormula::_SplitMergeBoxNm, *pTbl, (void*)&rTblUpd );
eNmType = INTRNL_NAME;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */