summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/AllLangResTarget_sw.mk1
-rwxr-xr-xsw/JunitTest_sw_complex.mk13
-rw-r--r--sw/inc/IDocumentLayoutAccess.hxx10
-rw-r--r--sw/inc/authfld.hxx4
-rw-r--r--sw/inc/calbck.hxx243
-rw-r--r--sw/inc/crsrsh.hxx5
-rw-r--r--sw/inc/dcontact.hxx35
-rw-r--r--sw/inc/doc.hxx25
-rw-r--r--sw/inc/docsh.hxx2
-rw-r--r--sw/inc/docufld.hxx14
-rw-r--r--sw/inc/editsh.hxx9
-rw-r--r--sw/inc/expfld.hxx8
-rw-r--r--sw/inc/fchrfmt.hxx5
-rw-r--r--sw/inc/fldbas.hxx2
-rw-r--r--sw/inc/fmtcol.hxx6
-rw-r--r--sw/inc/fmtfld.hxx8
-rw-r--r--sw/inc/fmthdft.hxx12
-rw-r--r--sw/inc/fmtmeta.hxx30
-rw-r--r--sw/inc/fmtpdsc.hxx9
-rw-r--r--sw/inc/format.hxx5
-rw-r--r--sw/inc/frmfmt.hxx8
-rw-r--r--sw/inc/ftninfo.hxx10
-rw-r--r--sw/inc/lineinfo.hxx4
-rw-r--r--sw/inc/ndhints.hxx9
-rw-r--r--sw/inc/ndnotxt.hxx2
-rw-r--r--sw/inc/ndtxt.hxx10
-rw-r--r--sw/inc/node.hxx21
-rw-r--r--sw/inc/numrule.hxx14
-rw-r--r--sw/inc/pagedesc.hxx4
-rw-r--r--sw/inc/paratr.hxx9
-rw-r--r--sw/inc/printdata.hxx9
-rw-r--r--sw/inc/reffld.hxx5
-rw-r--r--sw/inc/section.hxx12
-rw-r--r--sw/inc/swcrsr.hxx10
-rw-r--r--sw/inc/swddetbl.hxx4
-rwxr-xr-xsw/inc/switerator.hxx47
-rw-r--r--sw/inc/swtable.hxx24
-rw-r--r--sw/inc/swtblfmt.hxx6
-rw-r--r--sw/inc/swtypes.hxx2
-rw-r--r--sw/inc/tox.hxx12
-rw-r--r--sw/inc/txtatr.hxx33
-rw-r--r--sw/inc/txtftn.hxx3
-rw-r--r--sw/inc/txtinet.hxx7
-rw-r--r--sw/inc/txtrfmrk.hxx2
-rw-r--r--sw/inc/txttxmrk.hxx3
-rw-r--r--sw/inc/unobaseclass.hxx2
-rw-r--r--sw/inc/unobookmark.hxx3
-rw-r--r--sw/inc/unochart.hxx17
-rw-r--r--sw/inc/unocrsr.hxx5
-rw-r--r--sw/inc/unodraw.hxx6
-rw-r--r--sw/inc/unofield.hxx22
-rw-r--r--sw/inc/unoflatpara.hxx3
-rw-r--r--sw/inc/unoframe.hxx8
-rw-r--r--sw/inc/unoport.hxx13
-rw-r--r--sw/inc/unoredline.hxx6
-rw-r--r--sw/inc/unoredlines.hxx4
-rw-r--r--sw/inc/unosett.hxx7
-rw-r--r--sw/inc/unostyle.hxx15
-rw-r--r--sw/inc/unotbl.hxx22
-rw-r--r--sw/inc/unotext.hxx12
-rw-r--r--sw/inc/unotextmarkup.hxx6
-rw-r--r--sw/inc/unotxdoc.hxx13
-rw-r--r--sw/inc/usrfld.hxx5
-rw-r--r--sw/inc/viewopt.hxx15
-rw-r--r--sw/inc/viewsh.hxx14
-rw-r--r--sw/qa/complex/accessibility/makefile.mk50
-rw-r--r--sw/qa/complex/checkColor/makefile.mk50
-rw-r--r--sw/qa/complex/writer/TestDocument.java3
-rw-r--r--sw/qa/unoapi/makefile.mk48
-rw-r--r--sw/sdi/_docsh.sdi11
-rw-r--r--sw/sdi/_viewsh.sdi10
-rw-r--r--sw/source/core/access/accdoc.cxx8
-rw-r--r--sw/source/core/access/accframebase.cxx22
-rw-r--r--sw/source/core/access/accframebase.hxx3
-rw-r--r--sw/source/core/access/accfrmobj.cxx4
-rw-r--r--sw/source/core/access/accmap.cxx13
-rw-r--r--sw/source/core/access/accnotextframe.cxx6
-rw-r--r--sw/source/core/access/accnotextframe.hxx4
-rw-r--r--sw/source/core/access/accpara.cxx4
-rw-r--r--sw/source/core/access/accpara.hxx4
-rw-r--r--sw/source/core/access/acctable.cxx13
-rw-r--r--sw/source/core/access/acctable.hxx7
-rw-r--r--sw/source/core/access/acctextframe.cxx6
-rw-r--r--sw/source/core/access/acctextframe.hxx5
-rw-r--r--sw/source/core/attr/calbck.cxx476
-rw-r--r--sw/source/core/attr/cellatr.cxx11
-rw-r--r--sw/source/core/attr/format.cxx52
-rw-r--r--sw/source/core/crsr/bookmrk.cxx4
-rw-r--r--sw/source/core/crsr/callnk.cxx18
-rw-r--r--sw/source/core/crsr/callnk.hxx3
-rw-r--r--sw/source/core/crsr/crsrsh.cxx54
-rw-r--r--sw/source/core/crsr/crstrvl.cxx90
-rw-r--r--sw/source/core/crsr/crstrvl1.cxx2
-rw-r--r--sw/source/core/crsr/pam.cxx12
-rwxr-xr-x[-rw-r--r--]sw/source/core/crsr/swcrsr.cxx52
-rw-r--r--sw/source/core/crsr/trvlfnfl.cxx2
-rw-r--r--sw/source/core/crsr/trvltbl.cxx14
-rw-r--r--sw/source/core/crsr/unocrsr.cxx14
-rw-r--r--sw/source/core/crsr/viscrs.cxx16
-rw-r--r--sw/source/core/doc/acmplwrd.cxx9
-rw-r--r--sw/source/core/doc/doc.cxx172
-rw-r--r--sw/source/core/doc/docbm.cxx4
-rw-r--r--sw/source/core/doc/docchart.cxx6
-rw-r--r--sw/source/core/doc/doccorr.cxx10
-rw-r--r--sw/source/core/doc/docdesc.cxx192
-rw-r--r--sw/source/core/doc/docdraw.cxx54
-rw-r--r--sw/source/core/doc/docedt.cxx18
-rw-r--r--sw/source/core/doc/docfld.cxx77
-rw-r--r--sw/source/core/doc/docfly.cxx37
-rw-r--r--sw/source/core/doc/docfmt.cxx35
-rw-r--r--sw/source/core/doc/docftn.cxx66
-rw-r--r--sw/source/core/doc/docglbl.cxx7
-rw-r--r--sw/source/core/doc/doclay.cxx147
-rw-r--r--sw/source/core/doc/docnew.cxx30
-rw-r--r--sw/source/core/doc/docnum.cxx13
-rw-r--r--sw/source/core/doc/docredln.cxx10
-rw-r--r--sw/source/core/doc/doctxm.cxx65
-rw-r--r--sw/source/core/doc/fmtcol.cxx27
-rw-r--r--sw/source/core/doc/ftnidx.cxx7
-rw-r--r--sw/source/core/doc/htmltbl.cxx20
-rw-r--r--sw/source/core/doc/lineinfo.cxx29
-rw-r--r--sw/source/core/doc/notxtfrm.cxx18
-rw-r--r--sw/source/core/doc/number.cxx30
-rw-r--r--sw/source/core/doc/poolfmt.cxx2
-rw-r--r--sw/source/core/doc/swserv.cxx2
-rwxr-xr-x[-rw-r--r--]sw/source/core/doc/tblafmt.cxx4
-rw-r--r--sw/source/core/doc/tblrwcl.cxx29
-rw-r--r--sw/source/core/doc/visiturl.cxx4
-rw-r--r--sw/source/core/docnode/ndcopy.cxx2
-rw-r--r--sw/source/core/docnode/ndsect.cxx55
-rw-r--r--sw/source/core/docnode/ndtbl.cxx48
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx19
-rw-r--r--sw/source/core/docnode/node.cxx153
-rw-r--r--sw/source/core/docnode/node2lay.cxx101
-rw-r--r--sw/source/core/docnode/nodes.cxx81
-rw-r--r--sw/source/core/docnode/section.cxx149
-rw-r--r--sw/source/core/docnode/swbaslnk.cxx10
-rw-r--r--sw/source/core/draw/dcontact.cxx186
-rw-r--r--sw/source/core/draw/dflyobj.cxx7
-rw-r--r--sw/source/core/draw/dpage.cxx2
-rw-r--r--sw/source/core/draw/dview.cxx14
-rwxr-xr-x[-rw-r--r--]sw/source/core/edit/acorrect.cxx20
-rw-r--r--sw/source/core/edit/autofmt.cxx5
-rw-r--r--sw/source/core/edit/edattr.cxx2
-rw-r--r--sw/source/core/edit/eddel.cxx2
-rw-r--r--sw/source/core/edit/edfld.cxx53
-rw-r--r--sw/source/core/edit/edfldexp.cxx7
-rw-r--r--sw/source/core/edit/editsh.cxx44
-rw-r--r--sw/source/core/edit/edlingu.cxx10
-rw-r--r--sw/source/core/edit/edsect.cxx2
-rw-r--r--sw/source/core/edit/edtox.cxx10
-rw-r--r--sw/source/core/edit/edundo.cxx12
-rw-r--r--sw/source/core/fields/authfld.cxx21
-rw-r--r--sw/source/core/fields/cellfml.cxx4
-rw-r--r--sw/source/core/fields/dbfld.cxx15
-rw-r--r--sw/source/core/fields/ddefld.cxx14
-rw-r--r--sw/source/core/fields/ddetbl.cxx22
-rw-r--r--sw/source/core/fields/docufld.cxx49
-rw-r--r--sw/source/core/fields/expfld.cxx26
-rw-r--r--sw/source/core/fields/fldlst.cxx13
-rw-r--r--sw/source/core/fields/postithelper.cxx7
-rw-r--r--sw/source/core/fields/reffld.cxx61
-rw-r--r--sw/source/core/fields/tblcalc.cxx12
-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.cxx4
-rw-r--r--sw/source/core/frmedt/fefly1.cxx22
-rw-r--r--sw/source/core/frmedt/feflyole.cxx2
-rw-r--r--sw/source/core/frmedt/feshview.cxx54
-rw-r--r--sw/source/core/frmedt/fetab.cxx2
-rw-r--r--sw/source/core/frmedt/fews.cxx16
-rw-r--r--sw/source/core/frmedt/tblsel.cxx116
-rw-r--r--sw/source/core/graphic/ndgrf.cxx16
-rw-r--r--sw/source/core/inc/UndoAttribute.hxx2
-rw-r--r--sw/source/core/inc/UndoCore.hxx5
-rwxr-xr-x[-rw-r--r--]sw/source/core/inc/acorrect.hxx1
-rw-r--r--sw/source/core/inc/attrhint.hxx44
-rw-r--r--sw/source/core/inc/bodyfrm.hxx2
-rw-r--r--sw/source/core/inc/bookmrk.hxx7
-rw-r--r--sw/source/core/inc/cellfrm.hxx4
-rw-r--r--sw/source/core/inc/cntfrm.hxx9
-rw-r--r--sw/source/core/inc/colfrm.hxx2
-rw-r--r--sw/source/core/inc/fieldhint.hxx44
-rw-r--r--sw/source/core/inc/flyfrm.hxx18
-rw-r--r--sw/source/core/inc/flyfrms.hxx18
-rw-r--r--sw/source/core/inc/frame.hxx35
-rw-r--r--sw/source/core/inc/frmtool.hxx5
-rw-r--r--sw/source/core/inc/ftnboss.hxx2
-rw-r--r--sw/source/core/inc/ftnfrm.hxx4
-rw-r--r--sw/source/core/inc/hffrm.hxx6
-rw-r--r--sw/source/core/inc/layfrm.hxx2
-rw-r--r--sw/source/core/inc/notxtfrm.hxx4
-rw-r--r--sw/source/core/inc/pagedeschint.hxx46
-rw-r--r--sw/source/core/inc/pagefrm.hxx6
-rw-r--r--sw/source/core/inc/prevwpage.hxx27
-rw-r--r--sw/source/core/inc/rolbck.hxx6
-rw-r--r--sw/source/core/inc/rootfrm.hxx6
-rw-r--r--sw/source/core/inc/rowfrm.hxx4
-rw-r--r--sw/source/core/inc/sectfrm.hxx8
-rw-r--r--sw/source/core/inc/tabfrm.hxx7
-rw-r--r--sw/source/core/inc/txtfrm.hxx7
-rw-r--r--sw/source/core/layout/atrfrm.cxx191
-rw-r--r--sw/source/core/layout/calcmove.cxx15
-rw-r--r--sw/source/core/layout/colfrm.cxx19
-rw-r--r--sw/source/core/layout/findfrm.cxx25
-rw-r--r--sw/source/core/layout/flowfrm.cxx67
-rw-r--r--sw/source/core/layout/fly.cxx217
-rw-r--r--sw/source/core/layout/flycnt.cxx9
-rw-r--r--sw/source/core/layout/flyincnt.cxx6
-rw-r--r--sw/source/core/layout/flylay.cxx20
-rw-r--r--sw/source/core/layout/flypos.cxx30
-rw-r--r--sw/source/core/layout/frmtool.cxx330
-rw-r--r--sw/source/core/layout/ftnfrm.cxx91
-rw-r--r--sw/source/core/layout/hffrm.cxx28
-rw-r--r--sw/source/core/layout/layact.cxx32
-rw-r--r--sw/source/core/layout/laycache.cxx22
-rw-r--r--sw/source/core/layout/movedfwdfrmsbyobjpos.cxx9
-rw-r--r--sw/source/core/layout/newfrm.cxx51
-rw-r--r--sw/source/core/layout/pagechg.cxx138
-rw-r--r--sw/source/core/layout/pagedesc.cxx29
-rw-r--r--sw/source/core/layout/paintfrm.cxx49
-rw-r--r--sw/source/core/layout/sectfrm.cxx68
-rw-r--r--sw/source/core/layout/softpagebreak.cxx15
-rw-r--r--sw/source/core/layout/ssfrm.cxx80
-rw-r--r--sw/source/core/layout/tabfrm.cxx92
-rw-r--r--sw/source/core/layout/trvlfrm.cxx16
-rw-r--r--sw/source/core/layout/wsfrm.cxx123
-rw-r--r--sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx14
-rw-r--r--sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx6
-rw-r--r--sw/source/core/ole/ndole.cxx2
-rw-r--r--sw/source/core/para/paratr.cxx19
-rw-r--r--sw/source/core/table/swnewtable.cxx9
-rw-r--r--sw/source/core/table/swtable.cxx199
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx48
-rw-r--r--sw/source/core/text/blink.cxx2
-rw-r--r--sw/source/core/text/frmcrsr.cxx14
-rw-r--r--sw/source/core/text/frmform.cxx8
-rw-r--r--sw/source/core/text/frmpaint.cxx7
-rw-r--r--sw/source/core/text/inftxt.cxx8
-rw-r--r--sw/source/core/text/itratr.cxx42
-rw-r--r--sw/source/core/text/porfld.cxx6
-rw-r--r--sw/source/core/text/porfly.cxx3
-rw-r--r--sw/source/core/text/porlay.cxx16
-rw-r--r--sw/source/core/text/porrst.cxx15
-rw-r--r--sw/source/core/text/redlnitr.cxx4
-rw-r--r--sw/source/core/text/txtdrop.cxx18
-rw-r--r--sw/source/core/text/txtfld.cxx2
-rw-r--r--sw/source/core/text/txtfly.cxx15
-rw-r--r--sw/source/core/text/txtfrm.cxx52
-rw-r--r--sw/source/core/text/txtftn.cxx5
-rw-r--r--sw/source/core/text/txtio.cxx10
-rw-r--r--sw/source/core/text/txttab.cxx109
-rw-r--r--sw/source/core/tox/tox.cxx43
-rw-r--r--sw/source/core/tox/txmsrt.cxx2
-rw-r--r--sw/source/core/txtnode/SwGrammarContact.cxx44
-rw-r--r--sw/source/core/txtnode/atrfld.cxx47
-rw-r--r--sw/source/core/txtnode/atrflyin.cxx22
-rw-r--r--sw/source/core/txtnode/atrftn.cxx26
-rw-r--r--sw/source/core/txtnode/atrref.cxx2
-rw-r--r--sw/source/core/txtnode/atrtox.cxx2
-rw-r--r--sw/source/core/txtnode/fmtatr2.cxx88
-rw-r--r--sw/source/core/txtnode/fntcache.cxx9
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx118
-rw-r--r--sw/source/core/txtnode/thints.cxx45
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx41
-rwxr-xr-x[-rw-r--r--]sw/source/core/txtnode/txtedt.cxx20
-rw-r--r--sw/source/core/undo/SwUndoPageDesc.cxx32
-rw-r--r--sw/source/core/undo/rolbck.cxx10
-rw-r--r--sw/source/core/undo/unattr.cxx73
-rw-r--r--sw/source/core/undo/undobj1.cxx12
-rw-r--r--sw/source/core/undo/undraw.cxx129
-rw-r--r--sw/source/core/undo/unins.cxx2
-rw-r--r--sw/source/core/undo/untbl.cxx50
-rw-r--r--sw/source/core/unocore/unobkm.cxx8
-rw-r--r--sw/source/core/unocore/unochart.cxx4
-rw-r--r--sw/source/core/unocore/unocoll.cxx18
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx4
-rw-r--r--sw/source/core/unocore/unodraw.cxx23
-rw-r--r--sw/source/core/unocore/unofield.cxx49
-rw-r--r--sw/source/core/unocore/unoflatpara.cxx4
-rw-r--r--sw/source/core/unocore/unoframe.cxx27
-rw-r--r--sw/source/core/unocore/unoftn.cxx8
-rw-r--r--sw/source/core/unocore/unoidx.cxx38
-rw-r--r--sw/source/core/unocore/unoobj.cxx8
-rw-r--r--sw/source/core/unocore/unoobj2.cxx50
-rw-r--r--sw/source/core/unocore/unoparagraph.cxx8
-rw-r--r--sw/source/core/unocore/unoport.cxx12
-rw-r--r--sw/source/core/unocore/unoportenum.cxx4
-rw-r--r--sw/source/core/unocore/unoredline.cxx2
-rw-r--r--sw/source/core/unocore/unoredlines.cxx10
-rw-r--r--sw/source/core/unocore/unorefmk.cxx16
-rw-r--r--sw/source/core/unocore/unosect.cxx6
-rw-r--r--sw/source/core/unocore/unosett.cxx8
-rw-r--r--sw/source/core/unocore/unostyle.cxx10
-rw-r--r--sw/source/core/unocore/unotbl.cxx91
-rw-r--r--sw/source/core/unocore/unotext.cxx58
-rw-r--r--sw/source/core/unocore/unotextmarkup.cxx10
-rw-r--r--sw/source/core/view/printdata.cxx4
-rw-r--r--sw/source/core/view/vdraw.cxx2
-rw-r--r--sw/source/core/view/viewimp.cxx8
-rw-r--r--sw/source/core/view/viewpg.cxx1
-rw-r--r--sw/source/core/view/viewsh.cxx100
-rw-r--r--sw/source/core/view/vnew.cxx54
-rw-r--r--sw/source/core/view/vprint.cxx25
-rw-r--r--sw/source/filter/html/css1atr.cxx3
-rw-r--r--sw/source/filter/html/htmlforw.cxx3
-rw-r--r--sw/source/filter/html/htmltab.cxx2
-rw-r--r--sw/source/filter/html/htmlvsh.hxx5
-rw-r--r--sw/source/filter/html/swhtml.cxx6
-rw-r--r--sw/source/filter/html/swhtml.hxx2
-rw-r--r--sw/source/filter/inc/fltshell.hxx2
-rw-r--r--sw/source/filter/rtf/rtfnum.cxx2
-rw-r--r--sw/source/filter/rtf/rtftbl.cxx4
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx4
-rw-r--r--sw/source/filter/ww1/fltshell.cxx8
-rwxr-xr-x[-rw-r--r--]sw/source/filter/ww8/rtfexport.cxx7
-rwxr-xr-x[-rw-r--r--]sw/source/filter/ww8/rtfexport.hxx0
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx2
-rwxr-xr-x[-rw-r--r--]sw/source/filter/ww8/wrtw8nds.cxx30
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx3
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx1
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx24
-rw-r--r--sw/source/filter/ww8/ww8graf2.cxx3
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx2
-rw-r--r--sw/source/filter/xml/XMLRedlineImportHelper.cxx52
-rw-r--r--sw/source/filter/xml/wrtxml.cxx2
-rw-r--r--sw/source/filter/xml/xmlexp.cxx4
-rw-r--r--sw/source/filter/xml/xmlfmt.cxx4
-rw-r--r--sw/source/filter/xml/xmltbli.cxx2
-rw-r--r--sw/source/filter/xml/xmltexti.cxx6
-rw-r--r--sw/source/ui/app/apphdl.cxx15
-rw-r--r--sw/source/ui/app/docsh.cxx27
-rw-r--r--sw/source/ui/app/docsh2.cxx169
-rw-r--r--sw/source/ui/app/docstyle.cxx4
-rw-r--r--sw/source/ui/app/swmodul1.cxx4
-rw-r--r--sw/source/ui/config/viewopt.cxx19
-rw-r--r--sw/source/ui/dialog/SwSpellDialogChildWindow.cxx50
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx23
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx10
-rw-r--r--sw/source/ui/docvw/edtwin.cxx2
-rw-r--r--sw/source/ui/fldui/fldmgr.cxx6
-rw-r--r--sw/source/ui/fldui/fldpage.cxx8
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx2
-rw-r--r--sw/source/ui/inc/view.hxx1
-rw-r--r--sw/source/ui/inc/wrtsh.hxx2
-rwxr-xr-x[-rw-r--r--]sw/source/ui/index/cnttab.src4
-rwxr-xr-x[-rw-r--r--]sw/source/ui/lingu/hhcwrp.cxx10
-rw-r--r--sw/source/ui/lingu/sdrhhcwrap.cxx49
-rw-r--r--sw/source/ui/lingu/sdrhhcwrap.hxx1
-rw-r--r--sw/source/ui/shells/textfld.cxx10
-rwxr-xr-x[-rw-r--r--]sw/source/ui/shells/textsh.cxx8
-rw-r--r--sw/source/ui/table/tabledlg.cxx10
-rw-r--r--sw/source/ui/uiview/pview.cxx8
-rw-r--r--sw/source/ui/uiview/srcview.cxx1
-rw-r--r--sw/source/ui/uiview/view.cxx73
-rw-r--r--sw/source/ui/uiview/view0.cxx79
-rw-r--r--sw/source/ui/uiview/view2.cxx7
-rw-r--r--sw/source/ui/uiview/viewport.cxx20
-rw-r--r--sw/source/ui/uiview/viewtab.cxx8
-rw-r--r--sw/source/ui/uno/unomod.cxx11
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uno/unotxdoc.cxx103
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uno/unotxvw.cxx10
-rw-r--r--sw/source/ui/utlui/navipi.cxx4
-rw-r--r--sw/source/ui/utlui/uitool.cxx4
-rw-r--r--sw/source/ui/vba/vbainformationhelper.cxx5
-rw-r--r--sw/source/ui/vba/wordvbahelper.cxx4
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx15
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/sglobal/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/sweb/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/swform/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/swreport/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/swriter/menubar/menubar.xml2
-rwxr-xr-x[-rw-r--r--]sw/uiconfig/swxform/menubar/menubar.xml2
373 files changed, 5073 insertions, 4736 deletions
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index 1e21ccaae48c..20d6829a9a58 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -109,6 +109,7 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/dialog/wordcountdialog.src \
sw/source/ui/dochdl/dochdl.src \
sw/source/ui/dochdl/selglos.src \
+ sw/source/ui/docvw/annotation.src \
sw/source/ui/docvw/access.src \
sw/source/ui/docvw/docvw.src \
sw/source/ui/envelp/envelp.src \
diff --git a/sw/JunitTest_sw_complex.mk b/sw/JunitTest_sw_complex.mk
index 4eb0dc405264..df81b22f712d 100755
--- a/sw/JunitTest_sw_complex.mk
+++ b/sw/JunitTest_sw_complex.mk
@@ -27,6 +27,11 @@
$(eval $(call gb_JunitTest_JunitTest,sw_complex))
+$(eval $(call gb_JunitTest_set_defs,sw_complex,\
+ $$(DEFS) \
+ -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/sw/qa/complex/writer/testdocuments \
+))
+
$(eval $(call gb_JunitTest_add_sourcefiles,sw_complex,\
sw/qa/complex/checkColor/CheckChangeColor \
sw/qa/complex/indeterminateState/CheckIndeterminateState \
@@ -52,6 +57,14 @@ $(eval $(call gb_JunitTest_add_jars,sw_complex,\
$(eval $(call gb_JunitTest_add_classes,sw_complex,\
complex.accessibility.AccessibleRelationSet \
complex.checkColor.CheckChangeColor \
+ complex.writer.CheckCrossReferences \
+ complex.writer.CheckFlies \
+ complex.writer.CheckIndexedPropertyValues \
+ complex.writer.CheckNamedPropertyValues \
+ complex.writer.TextPortionEnumerationTest \
))
+# currently fails (should run again in os146) (except on windows)
+# complex.writer.CheckBookmarks \
+
# vim: set noet sw=4 ts=4:
diff --git a/sw/inc/IDocumentLayoutAccess.hxx b/sw/inc/IDocumentLayoutAccess.hxx
index 7593aa670a99..0e995e857650 100644
--- a/sw/inc/IDocumentLayoutAccess.hxx
+++ b/sw/inc/IDocumentLayoutAccess.hxx
@@ -31,6 +31,7 @@
#include <swtypes.hxx>
+class ViewShell;
class SwRootFrm;
class SwFrmFmt;
class SfxItemSet;
@@ -45,12 +46,15 @@ public:
/** Returns the layout set at the document.
*/
- virtual const SwRootFrm* GetRootFrm() const = 0;
- virtual SwRootFrm* GetRootFrm() = 0;
+ virtual const ViewShell* GetCurrentViewShell() const = 0;
+ virtual ViewShell* GetCurrentViewShell() = 0; //swmod 071107//swmod 071225
+ virtual const SwRootFrm* GetCurrentLayout() const = 0;
+ virtual SwRootFrm* GetCurrentLayout() = 0; //swmod 080218
+ virtual bool HasLayout() const = 0;
/** !!!The old layout must be deleted!!!
*/
- virtual void SetRootFrm( SwRootFrm* pNew ) = 0;
+ virtual void SetCurrentViewShell( ViewShell* pNew ) = 0; //swmod 071107//swmod 071225
/**
*/
diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx
index ebac43554a44..c11769d08912 100644
--- a/sw/inc/authfld.hxx
+++ b/sw/inc/authfld.hxx
@@ -81,13 +81,15 @@ class SW_DLLPUBLIC SwAuthorityFieldType : public SwFieldType
// @@@ private copy assignment, but public copy ctor? @@@
const SwAuthorityFieldType& operator=( const SwAuthorityFieldType& );
+protected:
+virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
+
public:
SwAuthorityFieldType(SwDoc* pDoc);
SwAuthorityFieldType( const SwAuthorityFieldType& );
~SwAuthorityFieldType();
virtual SwFieldType* Copy() const;
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhichId ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhichId );
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index e778e0366007..09d6fcbff3ed 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -26,140 +26,160 @@
*
************************************************************************/
-/*************************************************************
-#* service classes
- *************************************************************/
-
-/*
- * When an attribute in a format is changed, this change has to be propagated
- * to all dependent formats and over them to all concerned nodes.
- * In doing so it has to be decided whether the change can have an effect or
- * whether the dependent format redefines the changed attribute (such that the
- * attribute value of the dependent format occludes the changed value).
- * Furthermore, the concerned node can decide whether it makes use of the
- * changed attribute (for example: line distance for underlining was changed,
- * but the underlining attribute was not used). This way, the minimal effort
- * for reformatting is identified.
- */
#ifndef _CALBCK_HXX
#define _CALBCK_HXX
#include <tools/rtti.hxx>
#include "swdllapi.h"
+#include <boost/noncopyable.hpp>
class SwModify;
class SwClientIter;
class SfxPoolItem;
-class SvStream;
+class SfxHint;
+
+/*
+ SwModify and SwClient cooperate in propagating attribute changes.
+ If an attribute changes, the change is notified to all dependent
+ formats and other interested objects, e.g. Nodes. The clients will detect
+ if the change affects them. It could be that the changed attribute is
+ overruled in the receiving object so that its change does not become
+ effective or that the receiver is not interested in the particular attribute
+ in general (though probably in other attributes of the SwModify object they
+ are registered in).
+ As SwModify objects are derived from SwClient, they can create a chain of SwClient
+ objects where changes can get propagated through.
+ Each SwClient can be registered at only one SwModify object, while each SwModify
+ object is connected to a list of SwClient objects. If an object derived from SwClient
+ wants to get notifications from more than one SwModify object, it must create additional
+ SwClient objects. The SwDepend class allows to handle their notifications in the same
+ notification callback as it forwards the Modify() calls it receives to a "master"
+ SwClient implementation.
+ The SwClientIter class allows to iterate over the SwClient objects registered at an
+ SwModify. For historical reasons its ability to use TypeInfo to restrict this iteration
+ to objects of a particular type created a lot of code that misuses SwClient-SwModify
+ relationships that basically should be used only for Modify() callbacks.
+ This is still subject to refactoring.
+ Until this gets resolved, new SwClientIter base code should be reduced to the absolute
+ minimum and it also should be wrapped by SwIterator templates that prevent that the
+ code gets polluted by pointer casts (see switerator.hxx).
+ */
// ----------
// SwClient
// ----------
-class SW_DLLPUBLIC SwClient
+class SW_DLLPUBLIC SwClient : ::boost::noncopyable
{
+ // avoids making the details of the linked list and the callback method public
friend class SwModify;
friend class SwClientIter;
- SwClient *pLeft, *pRight; // for AVL sorting
- sal_Bool bModifyLocked : 1; // used in SwModify::Modify,
- // is really a member of SwModify
- // but here for lack of space
+ SwClient *pLeft, *pRight; // double-linked list of other clients
+ SwModify *pRegisteredIn; // event source
- sal_Bool bInModify : 1; // is in a modify. (Debug!!!)
- sal_Bool bInDocDTOR : 1; // Doc gets destroyed,
- // do not "unsubscribe"
- sal_Bool bInCache : 1; // is in BorderAttrCache of the layout,
- // unsubscribes itself then in Modify!
- sal_Bool bInSwFntCache : 1; // is in SwFont cache of the formatting
+ // in general clients should not be removed when their SwModify sends out Modify()
+ // notifications; in some rare cases this is necessary, but only the concrete SwClient
+ // sub class will know that; this flag allows to make that known
+ bool mbIsAllowedToBeRemovedInModifyCall;
-protected:
- SwModify *pRegisteredIn;
+ // callbacks received from SwModify (friend class - so these methods can be private)
+ // should be called only from SwModify the client is registered in
+ // mba: IMHO these methods should be pure virtual
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+ virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint );
+protected:
// single argument ctors shall be explicit.
explicit SwClient(SwModify *pToRegisterIn);
+ // write access to pRegisteredIn shall be granted only to the object itself (protected access)
+ SwModify* GetRegisteredInNonConst() const { return pRegisteredIn; }
+ void SetIsAllowedToBeRemovedInModifyCall( bool bSet ) { mbIsAllowedToBeRemovedInModifyCall = bSet; }
+
public:
+
inline SwClient();
virtual ~SwClient();
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ // in case an SwModify object is destroyed that itself is registered in another SwModify,
+ // its SwClient objects can decide to get registered to the latter instead by calling this method
+ void CheckRegistration( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue );
+
+ // controlled access to Modify method
+ // mba: this is still considered a hack and it should be fixed; the name makes grep-ing easier
+ void ModifyNotification( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue ) { Modify ( pOldValue, pNewValue ); }
+ void SwClientNotifyCall( const SwModify& rModify, const SfxHint& rHint ) { SwClientNotify( rModify, rHint ); }
+
const SwModify* GetRegisteredIn() const { return pRegisteredIn; }
+ bool IsLast() const { return !pLeft && !pRight; }
- //rtti, derived classes may do likewise or not. When they do, it can be
- //casted typesafely via the dependency list of a Modify
+ // needed for class SwClientIter
TYPEINFO();
- void LockModify() { bModifyLocked = sal_True; }
- void UnlockModify() { bModifyLocked = sal_False; }
- void SetInCache( sal_Bool bNew ) { bInCache = bNew; }
- void SetInSwFntCache( sal_Bool bNew ) { bInSwFntCache = bNew; }
- sal_Bool IsModifyLocked() const { return bModifyLocked; }
- sal_Bool IsInDocDTOR() const { return bInDocDTOR; }
- sal_Bool IsInCache() const { return bInCache; }
- sal_Bool IsInSwFntCache() const { return bInSwFntCache; }
-
- // get client Information
+ // get information about attribute
virtual sal_Bool GetInfo( SfxPoolItem& ) const;
-
-private:
- SwClient( const SwClient& );
- SwClient &operator=( const SwClient& );
};
inline SwClient::SwClient() :
- pLeft(0), pRight(0), pRegisteredIn(0)
-{ bModifyLocked = bInModify = bInDocDTOR = bInCache = bInSwFntCache = sal_False; }
-
+ pLeft(0), pRight(0), pRegisteredIn(0), mbIsAllowedToBeRemovedInModifyCall(false)
+{}
// ----------
// SwModify
// ----------
// class has a doubly linked list for dependencies
-
class SW_DLLPUBLIC SwModify: public SwClient
{
- friend SvStream& operator<<( SvStream& aS, SwModify & );
+ SwClient* pRoot; // the start of the linked list of clients
+ sal_Bool bModifyLocked : 1; // don't broadcast changes now
+ sal_Bool bLockClientList : 1; // may be set when this instance notifies its clients
+ sal_Bool bInDocDTOR : 1; // workaround for problems when a lot of objects are destroyed
+ sal_Bool bInCache : 1;
+ sal_Bool bInSwFntCache : 1;
- friend class SwClientIter;
- SwClient* pRoot;
-
- SwClient *_Remove(SwClient *pDepend);
+ // mba: IMHO this method should be pure virtual
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
- SwModify() : pRoot(0) {}
+ SwModify();
+
+ // broadcasting: send notifications to all clients
+ void NotifyClients( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue );
+
+ // the same, but without setting bModifyLocked or checking for any of the flags
+ // mba: it would be interesting to know why this is necessary
+ // also allows to limit callback to certain type (HACK)
+ void ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType = TYPE(SwClient) );
+
+ // a more universal broadcasting mechanism
+ void CallSwClientNotify( const SfxHint& rHint ) const;
// single argument ctors shall be explicit.
- explicit SwModify(SwModify *pToRegisterIn );
+ explicit SwModify( SwModify *pToRegisterIn );
virtual ~SwModify();
- virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue );
void Add(SwClient *pDepend);
- SwClient *Remove(SwClient *pDepend)
- { return bInDocDTOR ? 0 : _Remove( pDepend ); }
-
+ SwClient* Remove(SwClient *pDepend);
const SwClient* GetDepends() const { return pRoot; }
- // get client information
+ // get information about attribute
virtual sal_Bool GetInfo( SfxPoolItem& ) const;
- void SetInDocDTOR() { bInDocDTOR = sal_True; }
+ void LockModify() { bModifyLocked = sal_True; }
+ void UnlockModify() { bModifyLocked = sal_False; }
+ void SetInCache( sal_Bool bNew ) { bInCache = bNew; }
+ void SetInSwFntCache( sal_Bool bNew ) { bInSwFntCache = bNew; }
+ void SetInDocDTOR() { bInDocDTOR = sal_True; }
+ sal_Bool IsModifyLocked() const { return bModifyLocked; }
+ sal_Bool IsInDocDTOR() const { return bInDocDTOR; }
+ sal_Bool IsInCache() const { return bInCache; }
+ sal_Bool IsInSwFntCache() const { return bInSwFntCache; }
void CheckCaching( const sal_uInt16 nWhich );
-
- sal_Bool IsLastDepend() const
- { return pRoot && !pRoot->pLeft && !pRoot->pRight; }
-
-private:
- // forbidden and not implemented (see @ SwClient).
- SwModify & operator= (const SwModify &);
-
-protected:
- // forbidden and not implemented (see @ SwClient),
- // but GCC >= 3.4 needs an accessible "T (const T&)"
- // to pass a "T" as a "const T&" argument
- SwModify (const SwModify &);
+ bool IsLastDepend() { return pRoot && pRoot->IsLast(); }
+ int GetClientCount() const;
};
// ----------
@@ -167,9 +187,7 @@ protected:
// ----------
/*
- * Very useful class when an object depends on multiple objects.
- * This should have an object of the class SwDepend as member for each
- * dependency.
+ * Helper class for objects that need to depend on more than one SwClient
*/
class SW_DLLPUBLIC SwDepend: public SwClient
{
@@ -180,69 +198,66 @@ public:
SwDepend(SwClient *pTellHim, SwModify *pDepend);
SwClient* GetToTell() { return pToTell; }
- virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue );
// get Client information
virtual sal_Bool GetInfo( SfxPoolItem & ) const;
-private:
- // forbidden and not implemented (see @ SwClient).
- SwDepend (const SwDepend &);
- SwDepend & operator= (const SwDepend &);
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNewValue );
+ virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint );
};
class SwClientIter
{
- friend SwClient* SwModify::_Remove(SwClient *); // for ptr correction
- friend void SwModify::Add(SwClient *); // only for OSL_ENSURE !
+ friend SwClient* SwModify::Remove(SwClient *); // for pointer adjustments
+ friend void SwModify::Add(SwClient *pDepend); // for pointer adjustments
- SwModify const& rRoot;
- SwClient *pAkt, *pDelNext;
- // for updating of all iterators when inserting/deleting clients, while the
- // iterator points on it
- SwClientIter *pNxtIter;
+ const SwModify& rRoot;
+
+ // the current object in an iteration
+ SwClient* pAct;
+
+ // in case the current object is already removed, the next object in the list
+ // is marked down to become the current object in the next step
+ // this is necessary because iteration requires access to members of the current object
+ SwClient* pDelNext;
- SwClient* mpWatchClient; // if set, SwModify::_Remove checks if this client is removed
+ // SwClientIter objects are tracked in linked list so that they can react
+ // when the current (pAct) or marked down (pDelNext) SwClient is removed
+ // from its SwModify
+ SwClientIter *pNxtIter;
- TypeId aSrchId; // for First/Next - look for this type
+ // iterator can be limited to return only SwClient objects of a certain type
+ TypeId aSrchId;
public:
- SW_DLLPUBLIC SwClientIter( SwModify const& );
+ SW_DLLPUBLIC SwClientIter( const SwModify& );
SW_DLLPUBLIC ~SwClientIter();
- const SwModify& GetModify() const { return rRoot; }
+ const SwModify& GetModify() const { return rRoot; }
SwClient* operator++(int);
- SwClient* operator--(int);
- SwClient* operator++();
- SwClient* operator--();
-
SwClient* GoStart();
SwClient* GoEnd();
- inline SwClient* GoRoot(); // restart from root
-
+ // returns the current SwClient object;
+ // in case this was already removed, the object marked down to become
+ // the next current one is returned
SwClient* operator()() const
- { return pDelNext == pAkt ? pAkt : pDelNext; }
+ { return pDelNext == pAct ? pAct : pDelNext; }
- int IsChanged() const { return pDelNext != pAkt; }
+ // return "true" if an object was removed from a client chain in iteration
+ // adding objects to a client chain in iteration is forbidden
+ // SwModify::Add() asserts this
+ bool IsChanged() const { return pDelNext != pAct; }
SW_DLLPUBLIC SwClient* First( TypeId nType );
SW_DLLPUBLIC SwClient* Next();
-
- const SwClient* GetWatchClient() const { return mpWatchClient; }
- void SetWatchClient( SwClient* pWatch ) { mpWatchClient = pWatch; }
+ SW_DLLPUBLIC SwClient* Last( TypeId nType );
+ SW_DLLPUBLIC SwClient* Previous();
};
-inline SwClient* SwClientIter::GoRoot()
-{
- pAkt = rRoot.pRoot;
- return (pDelNext = pAkt);
-}
-
-
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 2a91682b5dc4..b24d29742db2 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -308,6 +308,9 @@ protected:
*/
SW_DLLPRIVATE void UpdateMarkedListLevel();
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
TYPEINFO();
SwCrsrShell( SwDoc& rDoc, Window *pWin, const SwViewOption *pOpt = 0 );
@@ -315,8 +318,6 @@ public:
SwCrsrShell( SwCrsrShell& rShell, Window *pWin );
virtual ~SwCrsrShell();
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
// create new cursor and append the old one
virtual SwPaM & CreateNewShellCursor();
virtual SwPaM & GetCurrentShellCursor();
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index 07044bce0182..54df6bf10243 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -36,6 +36,7 @@
#include <list>
#include "calbck.hxx"
+#include <anchoreddrawobject.hxx>
class SfxPoolItem;
class SwFrmFmt;
@@ -47,11 +48,10 @@ class SwVirtFlyDrawObj;
class SwFmtAnchor;
class SwFlyDrawObj;
class SwRect;
-// forward declaration for class <SwDrawVirtObj>
class SwDrawContact;
struct SwPosition;
class SwIndex;
-#include <anchoreddrawobject.hxx>
+class SdrTextObj;
// The other way round: Search format for given object.
// If object is a SwVirtFlyDrawObj the format will be obtained from it.
@@ -189,7 +189,7 @@ public:
/** get data collection of anchored objects, handled by with contact
*/
- virtual void GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const = 0;
+ virtual void GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const = 0;
/** get minimum order number of anchored objects handled by with contact
@@ -210,13 +210,9 @@ class SW_DLLPUBLIC SwFlyDrawContact : public SwContact
private:
SwFlyDrawObj* mpMasterObj;
- /** method to determine new order number for new instance of <SwVirtFlyDrawObj>
-
- Used in method <CreateNewRef(..)>.
-
- @author OD
- */
- sal_uInt32 _GetOrdNumForNewRef( const SwFlyFrm* pFlyFrm );
+protected:
+ // virtuelle Methoden von SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
public:
TYPEINFO();
@@ -232,11 +228,6 @@ public:
virtual SdrObject* GetMaster();
virtual void SetMaster( SdrObject* _pNewMaster );
- SwVirtFlyDrawObj* CreateNewRef( SwFlyFrm* pFly );
-
- // virtual methods from SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
-
// override methods to control Writer fly frames,
// which are linked, and to assure that all objects anchored at/inside the
// Writer fly frame are also made visible/invisible.
@@ -245,7 +236,7 @@ public:
/** get data collection of anchored objects handled by with contact
*/
- virtual void GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const;
+ virtual void GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const;
};
// new class for re-direct methods calls at a 'virtual'
@@ -416,6 +407,11 @@ class SwDrawContact : public SwContact
// no copy-constructor and no assignment operator
SwDrawContact( const SwDrawContact& );
SwDrawContact& operator=( const SwDrawContact& );
+
+ protected:
+ // virtuelle Methoden von SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
+
public:
TYPEINFO();
@@ -471,9 +467,6 @@ class SwDrawContact : public SwContact
// by frame.
SdrObject* GetDrawObjectByAnchorFrm( const SwFrm& _rAnchorFrm );
- // Virtual methods of SwClient.
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
-
// Virtual methods of SdrObjUserCall.
virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect);
@@ -490,7 +483,9 @@ class SwDrawContact : public SwContact
/** get data collection of anchored objects, handled by with contact
*/
- virtual void GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const;
+
+ static void GetTextObjectsFromFmt( std::list<SdrTextObj*>&, SwDoc* );
+ virtual void GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const;
};
#endif
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 44480a7012b7..1a4e7df2df65 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -321,7 +321,7 @@ class SW_DLLPUBLIC SwDoc :
SwTOXTypes *pTOXTypes; // Tables/indices
SwDefTOXBase_Impl * pDefTOXBases; // defaults of SwTOXBase's
- SwRootFrm *pLayout; // Rootframe of the specific layout.
+ ViewShell *pCurrentView; // SwDoc should get a new member pCurrentView//swmod 071225
SdrModel *pDrawModel; // StarView Drawing
SwDocUpdtFld *pUpdtFlds; // Struct for updating fields
@@ -447,7 +447,6 @@ private:
bool mbNewFldLst : 1; // TRUE: Rebuild field-list.
bool mbCopyIsMove : 1; // TRUE: Copy is a hidden Move.
bool mbVisibleLinks : 1; // TRUE: Links are inserted visibly.
- bool mbBrowseMode : 1; // TRUE: Show document in browser mode.
bool mbInReading : 1; // TRUE: Document is in the process of being read.
bool mbInXMLImport : 1; // TRUE: During xml import, attribute portion building is not necessary.
bool mbUpdateTOX : 1; // TRUE: After loading document, update TOX.
@@ -581,6 +580,8 @@ private:
bool mbCollapseEmptyCellPara : 1;
bool mbTabAtLeftIndentForParagraphsInList; // #i89181# - see above
+ bool mbLastBrowseMode : 1;
+
sal_uInt32 n32DummyCompatabilityOptions1;
sal_uInt32 n32DummyCompatabilityOptions2;
//
@@ -935,15 +936,18 @@ public:
/** IDocumentLayoutAccess
*/
- virtual const SwRootFrm* GetRootFrm() const ;
- virtual SwRootFrm* GetRootFrm();
- virtual void SetRootFrm( SwRootFrm* pNew );
+ virtual void SetCurrentViewShell( ViewShell* pNew );//swmod 071225
virtual SwLayouter* GetLayouter();
virtual const SwLayouter* GetLayouter() const;
virtual void SetLayouter( SwLayouter* pNew );
virtual SwFrmFmt* MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet );
virtual void DelLayoutFmt( SwFrmFmt *pFmt );
virtual SwFrmFmt* CopyLayoutFmt( const SwFrmFmt& rSrc, const SwFmtAnchor& rNewAnchor, bool bSetTxtFlyAtt, bool bMakeFrms );
+ virtual const ViewShell *GetCurrentViewShell() const; //swmod 080219
+ virtual ViewShell *GetCurrentViewShell();//swmod 080219 It must be able to communicate to a ViewShell.This is going to be removerd later.
+ virtual const SwRootFrm *GetCurrentLayout() const;
+ virtual SwRootFrm *GetCurrentLayout();//swmod 080219
+ virtual bool HasLayout() const;
/** IDocumentTimerAccess
*/
@@ -1130,6 +1134,8 @@ public:
String GetUniqueOLEName() const;
String GetUniqueFrameName() const;
+ std::set<SwRootFrm*> GetAllLayouts();//swmod 080225
+
void SetFlyName( SwFlyFrmFmt& rFmt, const String& rName );
const SwFlyFrmFmt* FindFlyByName( const String& rName, sal_Int8 nNdTyp = 0 ) const;
@@ -1288,16 +1294,13 @@ public:
// get the set of printable pages for the XRenderable API by
// evaluating the respective settings (see implementation)
- void CalculatePagesForPrinting( SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport,
+ void CalculatePagesForPrinting( const SwRootFrm& rLayout, SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport,
sal_Int32 nDocPageCount );
void UpdatePagesForPrintingWithPostItData( SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport,
sal_Int32 nDocPageCount );
- void CalculatePagePairsForProspectPrinting( SwRenderData &rData, const SwPrintUIOptions &rOptions,
+ void CalculatePagePairsForProspectPrinting( const SwRootFrm& rLayout, SwRenderData &rData, const SwPrintUIOptions &rOptions,
sal_Int32 nDocPageCount );
- sal_uInt16 GetPageCount() const;
- const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const;
-
// PageDescriptor interface.
sal_uInt16 GetPageDescCnt() const { return aPageDescs.Count(); }
const SwPageDesc& GetPageDesc( const sal_uInt16 i ) const { return *aPageDescs[i]; }
@@ -1842,7 +1845,7 @@ public:
// update all modified OLE-Objects. The modification is called over the
// StarOne - Interface
void SetOLEObjModified()
- { if( GetRootFrm() ) aOLEModifiedTimer.Start(); }
+ { if( GetCurrentViewShell() ) aOLEModifiedTimer.Start(); } //swmod 071107//swmod 071225
// -------------------- Uno - Interfaces ---------------------------
const SwUnoCrsrTbl& GetUnoCrsrTbl() const { return *pUnoCrsrTbl; }
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index a20d9d54f7a4..4f644afc40b0 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -278,7 +278,7 @@ public:
void EnterWait( sal_Bool bLockDispatcher );
void LeaveWait( sal_Bool bLockDispatcher );
- void ToggleBrowserMode(sal_Bool bOn, SwView* pView = 0);
+ void ToggleBrowserMode(sal_Bool bOn, SwView* pView);
sal_uLong LoadStylesFromFile( const String& rURL, SwgReaderOption& rOpt,
sal_Bool bUnoCall );
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 177229930bdb..d4dcbd06d2c7 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -639,8 +639,10 @@ public:
SwRefPageSetFieldType();
virtual SwFieldType* Copy() const;
- // Overlay, because there is nothing to update!
- virtual void Modify( SfxPoolItem *, SfxPoolItem * );
+
+protected:
+ // Overlay, because there is nothing to update!
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem * );
};
/*--------------------------------------------------------------------
@@ -680,15 +682,13 @@ class SwRefPageGetFieldType : public SwFieldType
sal_Int16 nNumberingType;
void UpdateField( SwTxtFld* pTxtFld, _SetGetExpFlds& rSetList );
-
+protected:
+ // ueberlagert, um alle RefPageGet-Felder zu updaten
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem * );
public:
SwRefPageGetFieldType( SwDoc* pDoc );
virtual SwFieldType* Copy() const;
-
- // Overlay in order to update all RefPageGet-fields.
- virtual void Modify( SfxPoolItem *, SfxPoolItem * );
sal_uInt16 MakeSetList( _SetGetExpFlds& rTmpLst );
-
SwDoc* GetDoc() const { return pDoc; }
};
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index b9c747b22ffd..0d09cda564b0 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -552,7 +552,7 @@ public:
sal_Bool HasOtherCnt() const;
// Apply ViewOptions with Start-/EndAction.
- inline void ApplyViewOptions( const SwViewOption &rOpt );
+ virtual void ApplyViewOptions( const SwViewOption &rOpt );
// Query text within selection.
// Returns FALSE, if selected range is too large to be copied
@@ -918,13 +918,6 @@ private:
const SwEditShell &operator=(const SwEditShell &);
};
-inline void SwEditShell::ApplyViewOptions( const SwViewOption &rOpt )
-{
- SwCrsrShell::StartAction();
- ViewShell::ApplyViewOptions( rOpt );
- SwEditShell::EndAction();
-}
-
inline const sfx2::LinkManager& SwEditShell::GetLinkManager() const
{ return ((SwEditShell*)this)->GetLinkManager(); }
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index e80b2c264578..a565244b89ba 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -77,8 +77,8 @@ public:
// Overlay, because get-field cannot be changed and therefore
// does not need to be updated. Update at changing of set-values!
-
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
};
class SW_DLLPUBLIC SwGetExpField : public SwFormulaField
@@ -153,6 +153,9 @@ class SW_DLLPUBLIC SwSetExpFieldType : public SwValueFieldType
sal_uInt8 nLevel;
sal_Bool bDeleted;
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
+
public:
SwSetExpFieldType( SwDoc* pDoc, const String& rName,
sal_uInt16 nType = nsSwGetSetExpType::GSE_EXPR );
@@ -169,7 +172,6 @@ public:
void SetDeleted( sal_Bool b ) { bDeleted = b; }
// Overlay, because set-field takes care for its being updated by itself.
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
inline const String& GetSetRefName() const;
sal_uInt16 SetSeqRefNo( SwSetExpField& rFld );
diff --git a/sw/inc/fchrfmt.hxx b/sw/inc/fchrfmt.hxx
index 48c7590dec11..a6951cde3372 100644
--- a/sw/inc/fchrfmt.hxx
+++ b/sw/inc/fchrfmt.hxx
@@ -54,6 +54,9 @@ public:
// @@@ public copy ctor, but no copy assignment?
SwFmtCharFmt( const SwFmtCharFmt& rAttr );
+protected:
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+
private:
// @@@ public copy ctor, but no copy assignment?
SwFmtCharFmt & operator= (const SwFmtCharFmt &);
@@ -73,8 +76,6 @@ public:
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
- // Pass to SwTxtCharFmt (from SwClient).
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const;
void SetCharFmt( SwFmt* pFmt ) { pFmt->Add(this); }
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 8c6c925d5bdf..0d2c13f0160a 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -272,7 +272,7 @@ public:
inline void SwFieldType::UpdateFlds() const
{
- ((SwFieldType*)this)->Modify( 0, 0 );
+ ((SwFieldType*)this)->ModifyNotification( 0, 0 );
}
// Base class of all fields.
diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx
index 4f941e084132..95b4af9faf41 100644
--- a/sw/inc/fmtcol.hxx
+++ b/sw/inc/fmtcol.hxx
@@ -91,10 +91,11 @@ protected:
mbAssignedToOutlineStyle(false)
{ pNextTxtFmtColl = this; }
-public:
// To get UL- / LR- / FontHeight-changes.
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+
+public:
TYPEINFO(); // Already in base class Client.
@@ -232,6 +233,7 @@ public:
void SetCondition( sal_uLong nCond, sal_uLong nSubCond );
SwTxtFmtColl* GetTxtFmtColl() const { return (SwTxtFmtColl*)GetRegisteredIn(); }
+ void RegisterToFormat( SwFmt& );
};
typedef SwCollCondition* SwCollConditionPtr;
diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx
index c6edb55fe82f..3641f3f6f534 100644
--- a/sw/inc/fmtfld.hxx
+++ b/sw/inc/fmtfld.hxx
@@ -28,6 +28,7 @@
#ifndef _FMTFLD_HXX
#define _FMTFLD_HXX
+#include <list>
#include <svl/poolitem.hxx>
#include <svl/brdcst.hxx>
#include <svl/smplhint.hxx>
@@ -38,6 +39,7 @@
class SwField;
class SwTxtFld;
class SwView;
+class SwFieldType;
// ATT_FLD
class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBroadcaster
@@ -54,6 +56,10 @@ class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBro
// @@@ copy construction allowed, but copy assignment is not? @@@
SwFmtFld& operator=(const SwFmtFld& rFld);
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+ virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint );
+
public:
TYPEINFO();
@@ -69,7 +75,6 @@ public:
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const;
const SwField *GetFld() const { return pField; }
@@ -87,6 +92,7 @@ public:
const SwTxtFld *GetTxtFld() const { return pTxtAttr; }
SwTxtFld *GetTxtFld() { return pTxtAttr; }
+ void RegisterToFieldType( SwFieldType& );
sal_Bool IsFldInDoc() const;
sal_Bool IsProtect() const;
};
diff --git a/sw/inc/fmthdft.hxx b/sw/inc/fmthdft.hxx
index 67134aabd75d..1abca0c96cb1 100644
--- a/sw/inc/fmthdft.hxx
+++ b/sw/inc/fmthdft.hxx
@@ -35,7 +35,7 @@
class SwFrmFmt;
class IntlWrapper;
-
+class SwFmt;
//Header, for PageFormats
//Client of FrmFmt discribing the header.
@@ -62,9 +62,10 @@ public:
String &rText,
const IntlWrapper* pIntl = 0 ) const;
- const SwFrmFmt *GetHeaderFmt() const { return (SwFrmFmt*)pRegisteredIn; }
- SwFrmFmt *GetHeaderFmt() { return (SwFrmFmt*)pRegisteredIn; }
+ const SwFrmFmt *GetHeaderFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
+ SwFrmFmt *GetHeaderFmt() { return (SwFrmFmt*)GetRegisteredIn(); }
+ void RegisterToFormat( SwFmt& rFmt );
sal_Bool IsActive() const { return bActive; }
void SetActive( sal_Bool bNew = sal_True ) { bActive = bNew; }
};
@@ -94,9 +95,10 @@ public:
String &rText,
const IntlWrapper* pIntl = 0 ) const;
- const SwFrmFmt *GetFooterFmt() const { return (SwFrmFmt*)pRegisteredIn; }
- SwFrmFmt *GetFooterFmt() { return (SwFrmFmt*)pRegisteredIn; }
+ const SwFrmFmt *GetFooterFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
+ SwFrmFmt *GetFooterFmt() { return (SwFrmFmt*)GetRegisteredIn(); }
+ void RegisterToFormat( SwFmt& rFmt );
sal_Bool IsActive() const { return bActive; }
void SetActive( sal_Bool bNew = sal_True ) { bActive = bNew; }
};
diff --git a/sw/inc/fmtmeta.hxx b/sw/inc/fmtmeta.hxx
index 459220c6007f..87f096d2d806 100644
--- a/sw/inc/fmtmeta.hxx
+++ b/sw/inc/fmtmeta.hxx
@@ -75,17 +75,13 @@ namespace com { namespace sun { namespace star {
* <li>The pool item is cloned (because it is non-poolable); the clone
* points to the same metadatable entity, but the metadatable entity's
* reverse pointer is unchanged.</li>
- * <li>A new text hint is created, taking over the new pool item.
- * Unfortunately, this also makes the metadatable entity point at the
- * cloned pool item.</li>
- * <li>The text hint is inserted into the hints array of some text node.</li>
- * <li>The DoCopy() method must be called at the new pool item:
- * it will clone the metadatable entity (using RegisterAsCopyOf),
- * and fix the reverse pointer of the original to point at the
- * original pool item.
+ * <li>The DoCopy() method is called at the new pool item:
+ * it will clone the metadatable entity (using RegisterAsCopyOf).
* This is necessary, because first, a metadatable entity may
* only be inserted once into a document, and second, the copy may be
* inserted into a different document than the source document!</li>
+ * <li>A new text hint is created, taking over the new pool item.</li>
+ * <li>The text hint is inserted into the hints array of some text node.</li>
* </ol>
*/
@@ -100,7 +96,7 @@ class SwFmtMeta
: public SfxPoolItem
{
private:
- friend class SwTxtMeta; // needs SetTxtAttr
+ friend class SwTxtMeta; // needs SetTxtAttr, DoCopy
friend class ::sw::Meta; // needs m_pTxtAttr
::boost::shared_ptr< ::sw::Meta > m_pMeta;
@@ -109,6 +105,10 @@ private:
SwTxtMeta * GetTxtAttr() { return m_pTxtAttr; }
void SetTxtAttr(SwTxtMeta * const i_pTxtAttr);
+ /// this method <em>must</em> be called when the hint is actually copied
+ void DoCopy(::sw::MetaFieldManager & i_rTargetDocManager,
+ SwTxtNode & i_rTargetTxtNode);
+
explicit SwFmtMeta( const sal_uInt16 i_nWhich );
public:
@@ -125,8 +125,6 @@ public:
void NotifyChangeTxtNode(SwTxtNode *const pTxtNode);
static SwFmtMeta * CreatePoolDefault( const sal_uInt16 i_nWhich );
::sw::Meta * GetMeta() { return m_pMeta.get(); }
- /// this method <em>must</em> be called when the hint is actually copied
- void DoCopy( SwFmtMeta & rOriginalMeta );
};
@@ -146,6 +144,7 @@ protected:
::com::sun::star::rdf::XMetadatable> m_wXMeta;
SwFmtMeta * m_pFmt;
+ SwTxtNode * m_pTxtNode;
SwTxtMeta * GetTxtAttr() const;
SwTxtNode * GetTxtNode() const; // returns 0 if not in document (undo)
@@ -153,7 +152,8 @@ protected:
SwFmtMeta * GetFmtMeta() const { return m_pFmt; }
void SetFmtMeta( SwFmtMeta * const i_pFmt ) { m_pFmt = i_pFmt; };
- void NotifyChangeTxtNode();
+ void NotifyChangeTxtNodeImpl();
+ void NotifyChangeTxtNode(SwTxtNode *const pTxtNode);
::com::sun::star::uno::WeakReference<
::com::sun::star::rdf::XMetadatable> const& GetXMeta() const
@@ -162,13 +162,13 @@ protected:
::com::sun::star::rdf::XMetadatable> const& xMeta)
{ m_wXMeta = xMeta; }
+ // SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
+
public:
explicit Meta(SwFmtMeta * const i_pFmt = 0);
virtual ~Meta();
- // SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
-
// sfx2::Metadatable
virtual ::sfx2::IXmlIdRegistry& GetRegistry();
virtual bool IsInClipboard() const;
diff --git a/sw/inc/fmtpdsc.hxx b/sw/inc/fmtpdsc.hxx
index 307fcb6576ab..64f93d260724 100644
--- a/sw/inc/fmtpdsc.hxx
+++ b/sw/inc/fmtpdsc.hxx
@@ -39,6 +39,7 @@ class SwPageDesc;
class SwHistory;
class SwPaM;
class IntlWrapper;
+class SwEndNoteInfo;
// Pagedescriptor
// Client of SwPageDesc that is "described" by the attribute.
@@ -56,6 +57,9 @@ class SW_DLLPUBLIC SwFmtPageDesc : public SfxPoolItem, public SwClient
sal_uInt16 nDescNameIdx; // SW3-Reader: stringpool-index of style name.
SwModify* pDefinedIn; // Points to the object in which the
// attribute was set (CntntNode/Format).
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
+ virtual void SwClientNotify( const SwModify&, const SfxHint& rHint );
public:
SwFmtPageDesc( const SwPageDesc *pDesc = 0 );
@@ -76,8 +80,6 @@ public:
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
-
SwPageDesc *GetPageDesc() { return (SwPageDesc*)GetRegisteredIn(); }
const SwPageDesc *GetPageDesc() const { return (SwPageDesc*)GetRegisteredIn(); }
@@ -87,6 +89,9 @@ public:
// Query / set where attribute is anchored.
inline const SwModify* GetDefinedIn() const { return pDefinedIn; }
void ChgDefinedIn( const SwModify* pNew ) { pDefinedIn = (SwModify*)pNew; }
+ void RegisterToEndNotInfo( SwEndNoteInfo& );
+ void RegisterToPageDesc( SwPageDesc& );
+ bool KnowsPageDesc() const;
};
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index 6f7e9b84f428..660a7fe653e8 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -44,7 +44,6 @@ class SwDoc;
class SW_DLLPUBLIC SwFmt : public SwModify
{
-
String aFmtName;
SwAttrSet aSet;
@@ -68,6 +67,7 @@ protected:
SwFmt( SwAttrPool& rPool, const String &rFmtNm, const sal_uInt16* pWhichRanges,
SwFmt *pDrvdFrm, sal_uInt16 nFmtWhich );
SwFmt( const SwFmt& rFmt );
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );
public:
TYPEINFO(); // Already in base class Client.
@@ -78,7 +78,6 @@ public:
// for Querying of Writer-functions.
sal_uInt16 Which() const { return nWhichId; }
- virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue );
// Query format information.
virtual sal_Bool GetInfo( SfxPoolItem& ) const;
@@ -106,7 +105,7 @@ public:
// returns count of deleted hints.
virtual sal_uInt16 ResetAllFmtAttr();
- inline SwFmt* DerivedFrom() const { return (SwFmt*)pRegisteredIn; }
+ inline SwFmt* DerivedFrom() const { return (SwFmt*)GetRegisteredIn(); }
inline sal_Bool IsDefault() const { return DerivedFrom() == 0; }
inline const String& GetName() const { return aFmtName; }
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 229d482b34e1..e06dea97ab54 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -29,12 +29,9 @@
#define _FRMFMT_HXX
#include <com/sun/star/text/PositionLayoutDir.hpp>
-
#include <cppuhelper/weakref.hxx>
#include <tools/gen.hxx>
-
#include <format.hxx>
-
#include "swdllapi.h"
class SwFlyFrm;
@@ -70,6 +67,8 @@ protected:
pDrvdFrm, nFmtWhich )
{}
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );
+
public:
TYPEINFO(); // Already in base class Client.
@@ -81,8 +80,6 @@ public:
virtual Graphic MakeGraphic( ImageMap* pMap = NULL );
- virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue );
-
// Returns the IMapObject defined at format (Fly)
// in the ImageMap at position Point.
// rPoint - test on DocPosition.
@@ -142,6 +139,7 @@ public:
{ m_wXObject = xObject; }
DECL_FIXEDMEMPOOL_NEWDEL_DLL(SwFrmFmt)
+ void RegisterToFormat( SwFmt& rFmt );
};
// The FlyFrame-Format
diff --git a/sw/inc/ftninfo.hxx b/sw/inc/ftninfo.hxx
index adfeda9975d2..95b626cc600a 100644
--- a/sw/inc/ftninfo.hxx
+++ b/sw/inc/ftninfo.hxx
@@ -46,13 +46,16 @@ class SW_DLLPUBLIC SwEndNoteInfo : public SwClient
String sSuffix;
protected:
bool m_bEndNote;
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
public:
SvxNumberType aFmt;
sal_uInt16 nFtnOffset;
void ChgPageDesc( SwPageDesc *pDesc );
- SwPageDesc *GetPageDesc( SwDoc &rDoc ) const;
- SwClient *GetPageDescDep() const { return (SwClient*)&aPageDescDep; }
+ SwPageDesc* GetPageDesc( SwDoc &rDoc ) const;
+ bool KnowsPageDesc() const;
+ bool DependsOn( const SwPageDesc* ) const;
void SetFtnTxtColl(SwTxtFmtColl& rColl);
SwTxtFmtColl* GetFtnTxtColl() const { return (SwTxtFmtColl*) GetRegisteredIn(); } // can be 0.
@@ -65,8 +68,6 @@ public:
void SetAnchorCharFmt( SwCharFmt* );
SwClient *GetAnchorCharFmtDep() const { return (SwClient*)&aAnchorCharFmtDep; }
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
-
SwEndNoteInfo & operator=(const SwEndNoteInfo&);
sal_Bool operator==( const SwEndNoteInfo &rInf ) const;
@@ -78,6 +79,7 @@ public:
void SetPrefix(const String& rSet) { sPrefix = rSet; }
void SetSuffix(const String& rSet) { sSuffix = rSet; }
+ void ReleaseCollection() { if ( GetRegisteredInNonConst() ) GetRegisteredInNonConst()->Remove( this ); }
};
enum SwFtnPos
diff --git a/sw/inc/lineinfo.hxx b/sw/inc/lineinfo.hxx
index 17f78e950ce5..66e3cbf23cff 100644
--- a/sw/inc/lineinfo.hxx
+++ b/sw/inc/lineinfo.hxx
@@ -58,6 +58,8 @@ class SW_DLLPUBLIC SwLineNumberInfo : public SwClient //purpose of derivation fr
sal_Bool bCountInFlys; //Count also within FlyFrames?
sal_Bool bRestartEachPage; //Restart counting at the first paragraph of each page
//(even on follows when paragraphs are splitted)
+protected:
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
SwLineNumberInfo();
@@ -98,7 +100,7 @@ public:
sal_Bool IsRestartEachPage() const { return bRestartEachPage; }
void SetRestartEachPage( sal_Bool b ) { bRestartEachPage = b; }
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ bool HasCharFormat() const { return GetRegisteredIn() != 0; }
};
diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx
index 58aa4c2d3037..7a345792f5c5 100644
--- a/sw/inc/ndhints.hxx
+++ b/sw/inc/ndhints.hxx
@@ -43,9 +43,16 @@ class SfxPoolItem;
class SfxItemSet;
class SwDoc;
+typedef enum {
+ COPY = true,
+ NEW = false,
+} CopyOrNew_t;
+
+// if COPY then pTxtNode must be given!
SW_DLLPRIVATE SwTxtAttr *
MakeTxtAttr( SwDoc & rDoc, SfxPoolItem & rNew,
- xub_StrLen nStt, xub_StrLen nEnd );
+ xub_StrLen const nStt, xub_StrLen const nEnd,
+ CopyOrNew_t const bIsCopy = NEW, SwTxtNode *const pTxtNode = 0);
SW_DLLPRIVATE SwTxtAttr *
MakeTxtAttr( SwDoc & rDoc, const SfxItemSet & rSet,
xub_StrLen nStt, xub_StrLen nEnd );
diff --git a/sw/inc/ndnotxt.hxx b/sw/inc/ndnotxt.hxx
index 70081fcac7ee..869696e4e1a3 100644
--- a/sw/inc/ndnotxt.hxx
+++ b/sw/inc/ndnotxt.hxx
@@ -60,7 +60,7 @@ protected:
public:
~SwNoTxtNode();
- virtual SwCntntFrm *MakeFrm();
+ virtual SwCntntFrm *MakeFrm( SwFrm* );
inline SwGrfFmtColl *GetGrfColl() const { return (SwGrfFmtColl*)GetRegisteredIn(); }
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 61838cf20a15..ee4b9a012c3a 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -44,6 +44,7 @@
#include <vector>
#include <set>
+class SfxHint;
class SwNumRule;
class SwNodeNum;
class SwList;
@@ -211,6 +212,10 @@ public:
//
// End: Data collected during idle time
//
+protected:
+ // fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!)
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+ virtual void SwClientNotify( const SwModify&, const SfxHint& );
public:
using SwCntntNode::GetAttr;
@@ -333,7 +338,7 @@ public:
const ::com::sun::star::uno::Sequence<sal_Int32>& rOffsets );
// Virtual methods from CntntNode.
- virtual SwCntntFrm *MakeFrm();
+ virtual SwCntntFrm *MakeFrm( SwFrm* );
virtual SwCntntNode *SplitCntntNode( const SwPosition & );
virtual SwCntntNode *JoinNext();
virtual SwCntntNode *JoinPrev();
@@ -741,9 +746,6 @@ public:
TYPEINFO(); // fuer rtti
- // For re-arranging TxtFmtCollections (outline-numbering!!).
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
-
// override SwIndexReg
virtual void Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
const bool bNegative = false, const bool bDelete = false );
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index f666b70d7536..839b40510e1d 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -65,6 +65,7 @@ class SwTOXBase;
class SwSectionNode;
class SwStartNode;
class SwTabFrm;
+class SwRootFrm;
class SwTable;
class SwTableNode;
class SwTableBox;
@@ -83,6 +84,7 @@ class IDocumentLinksAdministration;
class IDocumentFieldsAccess;
class IDocumentContentOperations;
class IDocumentListItems;
+class SwOLENodes;
// --------------------
// class SwNode
@@ -386,13 +388,17 @@ protected:
// SwAttrSet (handle):
sal_uInt16 ClearItemsFromAttrSet( const std::vector<sal_uInt16>& rWhichIds );
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
TYPEINFO(); //Already contained in base class Client.
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ // MakeFrm will be called for a certain layout
+ // pSib is another SwFrm of the same layout (e.g. the SwRootFrm itself, a sibling, the parent)
+ virtual SwCntntFrm *MakeFrm( SwFrm* pSib ) = 0;
- virtual SwCntntFrm *MakeFrm() = 0;
virtual SwCntntNode *SplitCntntNode(const SwPosition & ) = 0;
+
virtual SwCntntNode *JoinNext();
virtual SwCntntNode *JoinPrev();
// Is it possible to join two nodes?
@@ -406,7 +412,9 @@ public:
sal_Bool GoNext(SwIndex *, sal_uInt16 nMode ) const;
sal_Bool GoPrevious(SwIndex *, sal_uInt16 nMode ) const;
- SwCntntFrm *GetFrm( const Point* pDocPos = 0,
+ // Replacement for good old GetFrm(..):
+ SwCntntFrm *getLayoutFrm( const SwRootFrm*,
+ const Point* pDocPos = 0,
const SwPosition *pPos = 0,
const sal_Bool bCalcFrm = sal_True ) const;
// Returns the real size of the frame or an empty rectangle if
@@ -480,11 +488,12 @@ public:
inline void SetModifyAtAttr( bool bSetModifyAtAttr ) const { mbSetModifyAtAttr = bSetModifyAtAttr; }
inline bool GetModifyAtAttr() const { return mbSetModifyAtAttr; }
+ static SwOLENodes* CreateOLENodesArray( const SwFmtColl& rColl, bool bOnlyWithInvalidSize );
+
private:
// Private constructor because copying is never allowed!!
SwCntntNode( const SwCntntNode & rNode );
SwCntntNode & operator= ( const SwCntntNode & rNode );
-
};
@@ -504,7 +513,7 @@ public:
const SwTable& GetTable() const { return *pTable; }
SwTable& GetTable() { return *pTable; }
- SwTabFrm *MakeFrm();
+ SwTabFrm *MakeFrm( SwFrm* );
// Creates the frms for the table node (i.e. the TabFrms).
void MakeFrms( SwNodeIndex* pIdxBehind );
@@ -549,7 +558,7 @@ public:
const SwSection& GetSection() const { return *m_pSection; }
SwSection& GetSection() { return *m_pSection; }
- SwFrm *MakeFrm();
+ SwFrm *MakeFrm( SwFrm* );
// Creates the frms for the SectionNode (i.e. the SectionFrms).
// On default the frames are created until the end of the range.
diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index beb6b1fe8e5c..35bc16818507 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -39,12 +39,12 @@
#include <hints.hxx>
#include <boost/unordered_map.hpp>
#include <stringhash.hxx>
-class SwNodeNum;
#include <SwNumberTreeTypes.hxx>
#include <vector>
+
class SwTxtFmtColl;
class IDocumentListsAccess;
-
+class SwNodeNum;
class Font;
class SvxBrushItem;
class SvxNumRule;
@@ -65,6 +65,9 @@ class SW_DLLPUBLIC SwNumFmt : public SvxNumberFormat, public SwClient
using SvxNumberFormat::operator ==;
using SvxNumberFormat::operator !=;
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
public:
SwNumFmt();
SwNumFmt( const SwNumFmt& );
@@ -77,9 +80,9 @@ public:
sal_Bool operator==( const SwNumFmt& ) const;
sal_Bool operator!=( const SwNumFmt& r ) const { return !(*this == r); }
- SwCharFmt* GetCharFmt() const { return (SwCharFmt*)pRegisteredIn; }
+ SwCharFmt* GetCharFmt() const { return (SwCharFmt*)GetRegisteredIn(); }
void SetCharFmt( SwCharFmt* );
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
+ void ForgetCharFmt();
virtual void SetCharFmtName(const String& rSet);
virtual const String& GetCharFmtName()const;
@@ -142,9 +145,6 @@ private:
const SvxNumberFormat::SvxNumPositionAndSpaceMode meDefaultNumberFormatPositionAndSpaceMode;
String msDefaultListId;
- // forbidden and not implemented.
- SwNumRule();
-
public:
// add parameter <eDefaultNumberFormatPositionAndSpaceMode>
SwNumRule( const String& rNm,
diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index 156d5b2e1fc2..876540626620 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -162,6 +162,9 @@ class SW_DLLPUBLIC SwPageDesc : public SwModify
SW_DLLPRIVATE SwPageDesc(const String&, SwFrmFmt*, SwDoc *pDc );
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNewValue );
+
public:
const String &GetName() const { return aDescName; }
void SetName( const String& rNewName ) { aDescName = rNewName; }
@@ -215,7 +218,6 @@ public:
void SetRegisterFmtColl( const SwTxtFmtColl* rFmt );
const SwTxtFmtColl* GetRegisterFmtColl() const;
- virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue );
void RegisterChange();
// Query and set PoolFormat-Id.
diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx
index 54eff6a7cd26..d88201639530 100644
--- a/sw/inc/paratr.hxx
+++ b/sw/inc/paratr.hxx
@@ -65,6 +65,10 @@ public:
private:
// @@@ public copy ctor, but no copy assignment?
SwFmtDrop & operator= (const SwFmtDrop &);
+
+protected:
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+
public:
// "pure virtual methods" of SfxPoolItem
@@ -90,10 +94,9 @@ public:
inline sal_uInt16 GetDistance() const { return nDistance; }
inline sal_uInt16 &GetDistance() { return nDistance; }
- inline const SwCharFmt *GetCharFmt() const { return (SwCharFmt*)pRegisteredIn; }
- inline SwCharFmt *GetCharFmt() { return (SwCharFmt*)pRegisteredIn; }
+ inline const SwCharFmt *GetCharFmt() const { return (SwCharFmt*)GetRegisteredIn(); }
+ inline SwCharFmt *GetCharFmt() { return (SwCharFmt*)GetRegisteredIn(); }
void SetCharFmt( SwCharFmt *pNew );
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
// Get information from Client.
virtual sal_Bool GetInfo( SfxPoolItem& ) const;
diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx
index a93ff9957695..cc0a239815a1 100644
--- a/sw/inc/printdata.hxx
+++ b/sw/inc/printdata.hxx
@@ -46,7 +46,8 @@ class _SetGetExpFlds;
class SwViewOption;
class OutputDevice;
class SwViewOptionAdjust_Impl;
-class SwWrtShell;
+class SwPrtOptions;
+class ViewShell;
class SfxViewShell;
// forward declarations
@@ -267,9 +268,9 @@ public:
void DeletePostItData();
bool IsViewOptionAdjust() const { return m_pViewOptionAdjust != 0; }
- bool NeedNewViewOptionAdjust( const SwWrtShell& ) const;
- void ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions );
- void ViewOptionAdjust( SwPrintData const*const pPrtOptions );
+ bool NeedNewViewOptionAdjust( const ViewShell& ) const;
+ void ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions );
+ void ViewOptionAdjust( SwPrintData const* const pPrtOptions );
void ViewOptionAdjustStop();
bool HasSwPrtOptions() const { return m_pPrtOptions != 0; }
diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx
index 06b897576279..5b2b6cc10b66 100644
--- a/sw/inc/reffld.hxx
+++ b/sw/inc/reffld.hxx
@@ -73,13 +73,14 @@ enum REFERENCEMARK
class SwGetRefFieldType : public SwFieldType
{
SwDoc* pDoc;
+protected:
+ // ueberlagert, um alle Ref-Felder zu updaten
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem * );
public:
SwGetRefFieldType(SwDoc* pDoc );
virtual SwFieldType* Copy() const;
SwDoc* GetDoc() const { return pDoc; }
- // ueberlagert, um alle Ref-Felder zu updaten
- virtual void Modify( SfxPoolItem *, SfxPoolItem * );
void MergeWithOtherDoc( SwDoc& rDestDoc );
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index 5a30cc0b502d..f636756f39e5 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -154,7 +154,6 @@ public:
class SW_DLLPUBLIC SwSection
: public SwClient
- , private ::boost::noncopyable
{
// damit beim Anlegen/Loeschen von Frames das Flag richtig gepflegt wird!
friend class SwSectionNode;
@@ -170,6 +169,9 @@ private:
SW_DLLPRIVATE void ImplSetHiddenFlag(
bool const bHidden, bool const bCondition);
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
public:
TYPEINFO(); // rtti
@@ -186,10 +188,8 @@ public:
SectionType GetType() const { return m_Data.GetType(); }
void SetType(SectionType const eType) { return m_Data.SetType(eType); }
- SwSectionFmt* GetFmt() { return (SwSectionFmt*)pRegisteredIn; }
- SwSectionFmt* GetFmt() const { return (SwSectionFmt*)pRegisteredIn; }
-
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
+ SwSectionFmt* GetFmt() { return (SwSectionFmt*)GetRegisteredIn(); }
+ SwSectionFmt* GetFmt() const { return (SwSectionFmt*)GetRegisteredIn(); }
// setze die Hidden/Protected -> gesamten Baum updaten !
// (Attribute/Flags werden gesetzt/erfragt)
@@ -287,6 +287,7 @@ class SW_DLLPUBLIC SwSectionFmt
protected:
SwSectionFmt( SwSectionFmt* pDrvdFrm, SwDoc *pDoc );
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
public:
TYPEINFO(); //Bereits in Basisklasse Client drin.
@@ -298,7 +299,6 @@ public:
//Erzeugt die Ansichten
virtual void MakeFrms();
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
// erfrage vom Format Informationen
virtual sal_Bool GetInfo( SfxPoolItem& ) const;
diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx
index 57c41714e75a..2376e80775e8 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -96,11 +96,7 @@ public:
// @@@ semantic: no copy ctor.
SwCursor( SwCursor& rCpy);
-private:
- // forbidden and not implemented.
- //SwCursor( const SwCursor& );
- // @@@ used e.g. in core/frmedt/fetab.cxx @@@
- // SwCursor & operator= ( const SwCursor& );
+
public:
virtual SwCursor* Create( SwPaM* pRing = 0 ) const;
@@ -140,7 +136,7 @@ public:
sal_Bool GoEndWord();
sal_Bool GoNextWord();
sal_Bool GoPrevWord();
- sal_Bool SelectWord( const Point* pPt = 0 );
+ sal_Bool SelectWord( ViewShell* pViewShell, const Point* pPt = 0 );
// API versions of above functions (will be used with a different
// WordType for the break iterator)
@@ -151,7 +147,7 @@ public:
sal_Bool GoEndWordWT( sal_Int16 nWordType );
sal_Bool GoNextWordWT( sal_Int16 nWordType );
sal_Bool GoPrevWordWT( sal_Int16 nWordType );
- sal_Bool SelectWordWT( sal_Int16 nWordType, const Point* pPt = 0 );
+ sal_Bool SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, const Point* pPt = 0 );
enum SentenceMoveType
{
diff --git a/sw/inc/swddetbl.hxx b/sw/inc/swddetbl.hxx
index 57e000a998c5..e266465656c2 100644
--- a/sw/inc/swddetbl.hxx
+++ b/sw/inc/swddetbl.hxx
@@ -43,12 +43,14 @@ public:
sal_Bool bUpdate = sal_True );
~SwDDETable();
- void Modify( SfxPoolItem*, SfxPoolItem* );
void ChangeContent();
sal_Bool NoDDETable();
SwDDEFieldType* GetDDEFldType();
inline const SwDDEFieldType* GetDDEFldType() const;
+protected:
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+ virtual void SwClientNotify( const SwModify&, const SfxHint& );
};
diff --git a/sw/inc/switerator.hxx b/sw/inc/switerator.hxx
new file mode 100755
index 000000000000..be729771b54b
--- /dev/null
+++ b/sw/inc/switerator.hxx
@@ -0,0 +1,47 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SWITERATOR_HXX
+#define _SWITERATOR_HXX
+
+#include <calbck.hxx>
+#include <tools/debug.hxx>
+
+template< class TElementType, class TSource > class SwIterator
+{
+ SwClientIter aClientIter;
+public:
+
+ SwIterator( const TSource& rSrc ) : aClientIter(rSrc) { DBG_ASSERT( TElementType::IsOf( TYPE(SwClient) ), "Incompatible types!" ); }
+ TElementType* First() { SwClient* p = aClientIter.First(TYPE(TElementType)); return PTR_CAST(TElementType,p); }
+ TElementType* Last() { SwClient* p = aClientIter.Last( TYPE(TElementType)); return PTR_CAST(TElementType,p); }
+ TElementType* Next() { SwClient* p = aClientIter.Next(); return PTR_CAST(TElementType,p); }
+ TElementType* Previous() { SwClient* p = aClientIter.Previous(); return PTR_CAST(TElementType,p); }
+ static TElementType* FirstElement( const TSource& rMod ) { SwClient* p = SwClientIter(rMod).First(TYPE(TElementType)); return PTR_CAST(TElementType,p); }
+ bool IsChanged() { return aClientIter.IsChanged(); }
+};
+
+#endif
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index 7df49e2cd355..8f8e70e8a333 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -43,6 +43,7 @@ class SwStartNode;
#include <node.hxx> // fuer StartNode->GetMyIndex
#endif
+class SwFmt;
class Color;
class SwFrmFmt;
class SwTableFmt;
@@ -86,7 +87,7 @@ typedef SwTableLine* SwTableLinePtr;
class SW_DLLPUBLIC SwTable: public SwClient //Client vom FrmFmt
{
- using SwClient::IsModifyLocked;
+
protected:
SwTableLines aLines;
@@ -116,6 +117,8 @@ protected:
sal_Bool IsModifyLocked(){ return bModifyLocked;}
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
public:
enum SearchType
{
@@ -175,10 +178,9 @@ public:
SwTableLines &GetTabLines() { return aLines; }
const SwTableLines &GetTabLines() const { return aLines; }
- SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)pRegisteredIn; }
- SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)pRegisteredIn; }
-
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
+ SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)GetRegisteredIn(); }
+ SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
+ SwTableFmt* GetTableFmt() const { return (SwTableFmt*)GetRegisteredIn(); }
void GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart,
sal_Bool bHidden = sal_False, sal_Bool bCurRowOnly = sal_False ) const;
@@ -320,6 +322,7 @@ public:
SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo );
sal_Bool SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo );
+ void RegisterToFormat( SwFmt& rFmt );
#if OSL_DEBUG_LEVEL > 1
void CheckConsistency() const;
#endif
@@ -346,8 +349,8 @@ public:
void SetUpper( SwTableBox *pNew ) { pUpper = pNew; }
- SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)pRegisteredIn; }
- SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)pRegisteredIn; }
+ SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)GetRegisteredIn(); }
+ SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
//Macht ein eingenes FrmFmt wenn noch mehr Lines von ihm abhaengen.
SwFrmFmt* ClaimFrmFmt();
@@ -362,6 +365,7 @@ public:
SwTwips GetTableLineHeight( bool& bLayoutAvailable ) const;
bool hasSoftPageBreak() const;
+ void RegisterToFormat( SwFmt& rFmt );
};
class SW_DLLPUBLIC SwTableBox: public SwClient //Client vom FrmFmt
@@ -400,8 +404,8 @@ public:
const SwTableLine *GetUpper() const { return pUpper; }
void SetUpper( SwTableLine *pNew ) { pUpper = pNew; }
- SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)pRegisteredIn; }
- SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)pRegisteredIn; }
+ SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)GetRegisteredIn(); }
+ SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
//Macht ein eingenes FrmFmt wenn noch mehr Boxen von ihm abhaengen.
SwFrmFmt* ClaimFrmFmt();
@@ -466,6 +470,8 @@ public:
const SwTableBox& FindEndOfRowSpan( const SwTable& rTable,
sal_uInt16 nMaxStep = USHRT_MAX ) const
{ return const_cast<SwTableBox*>(this)->FindEndOfRowSpan( rTable, nMaxStep ); }
+ void RegisterToFormat( SwFmt& rFmt ) ;
+ void ForgetFrmFmt();
};
class SwCellFrm;
diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index fb7a63efb9b4..5165c76ec960 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -87,12 +87,12 @@ protected:
: SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange )
{}
+ // zum Erkennen von Veraenderungen (haupts. TableBoxAttribute)
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );
+
public:
TYPEINFO(); //Bereits in Basisklasse Client drin.
- // zum Erkennen von Veraenderungen (haupts. TableBoxAttribute)
- virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue );
-
DECL_FIXEDMEMPOOL_NEWDEL(SwTableBoxFmt)
};
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 87399c808ef6..15977766c25f 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -223,6 +223,8 @@ namespace nsSetAttrMode
// functionality will be disabled)
/// force hint expand (only matters for hints with CH_TXTATR)
const SetAttrMode SETATTR_FORCEHINTEXPAND= 0x0080;
+ /// the inserted item is a copy -- intended for use in ndtxt.cxx
+ const SetAttrMode SETATTR_IS_COPY = 0x0100;
}
//Umrechnung Twip<-> 1/100 mm fuer UNO
diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx
index 1f5bf0530f9b..bff0b9ded740 100644
--- a/sw/inc/tox.hxx
+++ b/sw/inc/tox.hxx
@@ -92,6 +92,10 @@ class SW_DLLPUBLIC SwTOXMark
SwTOXMark(); // to create the dflt. atr. in _InitCore
+protected:
+ // SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
public:
TYPEINFO(); // rtti
@@ -106,9 +110,6 @@ public:
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- // SwClient
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
-
void InvalidateTOXMark();
String GetText() const;
@@ -152,7 +153,9 @@ public:
SW_DLLPRIVATE void SetXTOXMark(::com::sun::star::uno::Reference<
::com::sun::star::text::XDocumentIndexMark> const& xMark)
{ m_wXDocumentIndexMark = xMark; }
-
+ void DeRegister() { GetRegisteredInNonConst()->Remove( this ); }
+ void RegisterToTOXType( SwTOXType& rMark );
+ static void InsertTOXMarks( SwTOXMarks& aMarks, const SwTOXType& rType );
};
/*--------------------------------------------------------------------
@@ -579,6 +582,7 @@ public:
// #i21237#
void AdjustTabStops(SwDoc & rDoc, sal_Bool bDefaultRightTabStop);
SwTOXBase& operator=(const SwTOXBase& rSource);
+ void RegisterToTOXType( SwTOXType& rMark );
};
diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx
index c3b816cc0d88..5224ec80b38f 100644
--- a/sw/inc/txtatr.hxx
+++ b/sw/inc/txtatr.hxx
@@ -35,6 +35,11 @@
class SwTxtNode; // fuer SwTxtFld
class SwCharFmt;
+namespace sw {
+ class MetaFieldManager;
+}
+
+
// ATT_CHARFMT *********************************************
class SwTxtCharFmt : public SwTxtAttrEnd
@@ -46,9 +51,9 @@ public:
SwTxtCharFmt( SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
virtual ~SwTxtCharFmt( );
- // werden vom SwFmtCharFmt hierher weitergeleitet
- virtual void Modify( SfxPoolItem*, SfxPoolItem* ); // SwClient
- virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const;
+ // werden vom SwFmtCharFmt hierher weitergeleitet (no derivation from SwClient!)
+ void ModifyNotification( const SfxPoolItem*, const SfxPoolItem* );
+ bool GetInfo( SfxPoolItem& rInfo ) const;
// get and set TxtNode pointer
void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
@@ -62,7 +67,7 @@ public:
class SwTxtAttrNesting : public SwTxtAttrEnd
{
-public:
+protected:
SwTxtAttrNesting( SfxPoolItem & i_rAttr,
const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
virtual ~SwTxtAttrNesting();
@@ -71,16 +76,20 @@ public:
class SwTxtMeta : public SwTxtAttrNesting
{
private:
- SwTxtNode * m_pTxtNode;
-
-public:
SwTxtMeta( SwFmtMeta & i_rAttr,
const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
+
+public:
+ static SwTxtMeta * CreateTxtMeta(
+ ::sw::MetaFieldManager & i_rTargetDocManager,
+ SwTxtNode *const i_pTargetTxtNode,
+ SwFmtMeta & i_rAttr,
+ xub_StrLen const i_nStart, xub_StrLen const i_nEnd,
+ bool const i_bIsCopy);
+
virtual ~SwTxtMeta();
void ChgTxtNode(SwTxtNode * const pNode);
- SwTxtNode * GetTxtNode() const { return m_pTxtNode; }
-
};
@@ -89,15 +98,17 @@ public:
class SW_DLLPUBLIC SwTxtRuby : public SwTxtAttrNesting, public SwClient
{
SwTxtNode* m_pTxtNode;
-
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
SwTxtRuby( SwFmtRuby& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
virtual ~SwTxtRuby();
TYPEINFO();
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const;
+ SW_DLLPRIVATE void InitRuby(SwTxtNode & rNode);
+
/// get and set TxtNode pointer
const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
inline const SwTxtNode& GetTxtNode() const;
diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx
index 36fbfb0ee269..d48bcf7c8dff 100644
--- a/sw/inc/txtftn.hxx
+++ b/sw/inc/txtftn.hxx
@@ -34,6 +34,7 @@ class SwNodeIndex;
class SwTxtNode;
class SwNodes;
class SwDoc;
+class SwFrm;
// ATT_FTN **********************************************************
@@ -60,7 +61,7 @@ public:
void MakeNewTextSection( SwNodes& rNodes );
// loesche die FtnFrame aus der Seite
- void DelFrms();
+ void DelFrms( const SwFrm* );
// bedingten Absatzvorlagen checken
void CheckCondColl();
diff --git a/sw/inc/txtinet.hxx b/sw/inc/txtinet.hxx
index d09792c915cf..f6e35addb183 100644
--- a/sw/inc/txtinet.hxx
+++ b/sw/inc/txtinet.hxx
@@ -43,17 +43,18 @@ class SW_DLLPUBLIC SwTxtINetFmt : public SwTxtAttrNesting, public SwClient
bool m_bVisited : 1; // visited link?
bool m_bVisitedValid : 1; // is m_bVisited valid?
- // forbidden and not implemented.
- SwTxtINetFmt();
+protected:
+virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
SwTxtINetFmt( SwFmtINetFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
virtual ~SwTxtINetFmt();
TYPEINFO();
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const;
+ SW_DLLPRIVATE void InitINetFmt(SwTxtNode & rNode);
+
// get and set TxtNode pointer
const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
inline const SwTxtNode& GetTxtNode() const;
diff --git a/sw/inc/txtrfmrk.hxx b/sw/inc/txtrfmrk.hxx
index c7507798be87..d60dd47cad4c 100644
--- a/sw/inc/txtrfmrk.hxx
+++ b/sw/inc/txtrfmrk.hxx
@@ -42,7 +42,7 @@ class SwTxtRefMark : public SwTxtAttrEnd
public:
SwTxtRefMark( SwFmtRefMark& rAttr,
- xub_StrLen nStart, xub_StrLen * pEnd = 0 );
+ xub_StrLen const nStart, xub_StrLen const*const pEnd = 0);
virtual xub_StrLen * GetEnd(); // SwTxtAttr
inline const xub_StrLen * GetEnd() const { return m_pEnd; }
diff --git a/sw/inc/txttxmrk.hxx b/sw/inc/txttxmrk.hxx
index e70c28305082..56a928b98ce2 100644
--- a/sw/inc/txttxmrk.hxx
+++ b/sw/inc/txttxmrk.hxx
@@ -42,7 +42,8 @@ class SwTxtTOXMark : public SwTxtAttrEnd
xub_StrLen * m_pEnd; // 0 if SwTOXMark without AlternativeText
public:
- SwTxtTOXMark( SwTOXMark& rAttr, xub_StrLen nStart, xub_StrLen * pEnd = 0 );
+ SwTxtTOXMark( SwTOXMark& rAttr,
+ xub_StrLen const nStart, xub_StrLen const*const pEnd = 0);
virtual ~SwTxtTOXMark();
virtual xub_StrLen *GetEnd(); // SwTxtAttr
diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx
index e49568b6256f..f04bb1adb04d 100644
--- a/sw/inc/unobaseclass.hxx
+++ b/sw/inc/unobaseclass.hxx
@@ -95,7 +95,7 @@ class UnoActionRemoveContext
::com::sun::star::uno::Sequence< sal_Int8 > CreateUnoTunnelId();
/// helper function for implementing SwClient::Modify
-void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew);
+void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem *pNew);
#include <boost/utility.hpp>
diff --git a/sw/inc/unobookmark.hxx b/sw/inc/unobookmark.hxx
index 4d76fca66849..474257b4a011 100644
--- a/sw/inc/unobookmark.hxx
+++ b/sw/inc/unobookmark.hxx
@@ -223,8 +223,9 @@ class SwXFieldmarkParameters
// XElementAccess
virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException);
+ protected:
//SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
private:
::sw::mark::IFieldmark::parameter_map_t* getCoreParameters() throw (::com::sun::star::uno::RuntimeException);
};
diff --git a/sw/inc/unochart.hxx b/sw/inc/unochart.hxx
index c88d62be1d9e..02da7c5fb805 100644
--- a/sw/inc/unochart.hxx
+++ b/sw/inc/unochart.hxx
@@ -172,6 +172,10 @@ class SwChartDataProvider :
rtl::OUString GetBrokenCellRangeForExport( const rtl::OUString &rCellRangeRepresentation );
+protected:
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwChartDataProvider( const SwDoc* pDoc );
virtual ~SwChartDataProvider();
@@ -198,10 +202,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
-
SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
void AddDataSequence( const SwTable &rTable, ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > &rxDataSequence );
@@ -293,6 +293,10 @@ class SwChartDataSequence :
SwChartDataSequence( const SwChartDataSequence &rObj );
SwChartDataSequence & operator = ( const SwChartDataSequence & );
+protected:
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwChartDataSequence( SwChartDataProvider &rProvider,
SwFrmFmt &rTblFmt,
@@ -349,11 +353,6 @@ public:
virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
-
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
-
SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
sal_Bool DeleteBox( const SwTableBox &rBox );
diff --git a/sw/inc/unocrsr.hxx b/sw/inc/unocrsr.hxx
index 0fc9b61b557a..26f193a9dc81 100644
--- a/sw/inc/unocrsr.hxx
+++ b/sw/inc/unocrsr.hxx
@@ -41,11 +41,6 @@ public:
SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing = 0 );
virtual ~SwUnoCrsr();
- // @@@ semantic: no copy ctor.
- SwUnoCrsr( SwUnoCrsr& );
-private:
- SwUnoCrsr & operator= ( const SwUnoCrsr& );
-
protected:
virtual const SwCntntFrm* DoSetBidiLevelLeftRight(
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index d45b83e9d6cf..7cc830cf6a96 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -232,6 +232,9 @@ class SwXShape : public SwXShapeBaseClass,
protected:
virtual ~SwXShape();
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXShape(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xShape);
@@ -281,9 +284,6 @@ public:
virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getShapeType( ) throw (::com::sun::star::uno::RuntimeException);
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
SwShapeDescriptor_Impl* GetDescImpl() {return pImpl;}
::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > GetAggregationInterface() {return xShapeAgg;}
diff --git a/sw/inc/unofield.hxx b/sw/inc/unofield.hxx
index ed36b278a652..6dc306cdb300 100644
--- a/sw/inc/unofield.hxx
+++ b/sw/inc/unofield.hxx
@@ -75,6 +75,9 @@ class SwXFieldMaster : public cppu::WeakImplHelper4
protected:
virtual ~SwXFieldMaster();
+ //SwClient
+virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId);
@@ -107,9 +110,6 @@ public:
virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
static rtl::OUString GetProgrammaticName(const SwFieldType& rType, SwDoc& rDoc);
static rtl::OUString LocalizeFormula(const SwSetExpField& rFld, const rtl::OUString& rFormula, sal_Bool bQuery);
@@ -148,6 +148,9 @@ class SwXTextField : public cppu::WeakImplHelper5
SwDoc* GetDoc() {return m_pDoc;}
protected:
virtual ~SwXTextField();
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc=0);
SwXTextField(const SwFmtFld& rFmt, SwDoc* pDoc);
@@ -193,19 +196,16 @@ public:
//XUpdatable
virtual void SAL_CALL update( ) throw (::com::sun::star::uno::RuntimeException);
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
const SwField* GetField() const;
const SwFmtFld* GetFldFmt(){return GetField() ? pFmtFld : 0; };
void Invalidate();
-};
-/// @return a SwXTextField, either an already existing one or a new one
-SwXTextField * CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt);
+ /// @return an SwXTextField, either an already existing one or a new one
+ static SwXTextField* CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt);
+};
typedef
cppu::WeakImplHelper2
@@ -294,6 +294,8 @@ class SwXFieldEnumeration : public cppu::WeakImplHelper2
protected:
virtual ~SwXFieldEnumeration();
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
SwXFieldEnumeration(SwDoc* pDoc);
@@ -306,8 +308,6 @@ public:
virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
};
#endif
diff --git a/sw/inc/unoflatpara.hxx b/sw/inc/unoflatpara.hxx
index 9eb36c20c1b3..2ab3e5988aa2 100644
--- a/sw/inc/unoflatpara.hxx
+++ b/sw/inc/unoflatpara.hxx
@@ -123,8 +123,9 @@ public:
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getParaBefore(const css::uno::Reference< css::text::XFlatParagraph > & xPara) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException);
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getParaAfter(const css::uno::Reference< css::text::XFlatParagraph > & xPara) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException);
+protected:
// SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
private:
SwXFlatParagraphIterator( const SwXFlatParagraphIterator & ); // not defined
diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx
index 903ed043ac74..3642a8c089e8 100644
--- a/sw/inc/unoframe.hxx
+++ b/sw/inc/unoframe.hxx
@@ -56,7 +56,6 @@ class SwDoc;
class SwFmt;
class SwFlyFrmFmt;
-
class BaseFrameProperties_Impl;
class SwXFrame : public cppu::WeakImplHelper6
<
@@ -85,6 +84,7 @@ class SwXFrame : public cppu::WeakImplHelper6
protected:
com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxStyleData;
com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > mxStyleFamily;
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
virtual ~SwXFrame();
public:
@@ -143,9 +143,6 @@ public:
virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
void attach( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xTextRange ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
@@ -361,7 +358,8 @@ public:
// ::com::sun::star::util::XModifyListener
virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException);
- void Modify( SfxPoolItem*, SfxPoolItem* );
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
diff --git a/sw/inc/unoport.hxx b/sw/inc/unoport.hxx
index 4b4f95abaee8..12f93f6fcb56 100644
--- a/sw/inc/unoport.hxx
+++ b/sw/inc/unoport.hxx
@@ -129,8 +129,9 @@ private:
SwFmtFld * GetFldFmt(bool bInit = false);
-protected:
+ void init(const SwUnoCrsr* pPortionCursor);
+protected:
void SAL_CALL SetPropertyValues_Impl(
const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames,
@@ -153,6 +154,9 @@ protected:
virtual ~SwXTextPortion();
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwTextPortionType eType );
SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwFrmFmt& rFmt );
@@ -220,9 +224,6 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createContentEnumeration(const rtl::OUString& aServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames() throw( ::com::sun::star::uno::RuntimeException );
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
void SetRefMark( ::com::sun::star::uno::Reference<
::com::sun::star::text::XTextContent > xMark)
{ m_xRefMark = xMark; }
@@ -305,9 +306,9 @@ public:
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
getSupportedServiceNames()
throw( ::com::sun::star::uno::RuntimeException );
-
+protected:
//SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
#endif
diff --git a/sw/inc/unoredline.hxx b/sw/inc/unoredline.hxx
index bf0a0173808f..0386830a2e39 100644
--- a/sw/inc/unoredline.hxx
+++ b/sw/inc/unoredline.hxx
@@ -141,10 +141,10 @@ public:
virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
const SwRedline* GetRedline() const {return pRedline;}
+protected:
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
#endif
diff --git a/sw/inc/unoredlines.hxx b/sw/inc/unoredlines.hxx
index 56ba53446922..af8ed1401bff 100644
--- a/sw/inc/unoredlines.hxx
+++ b/sw/inc/unoredlines.hxx
@@ -94,9 +94,9 @@ public:
virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
-
+protected:
//SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx
index c5e75de6eb8f..055732148f87 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -164,6 +164,10 @@ class SwXNumberingRules : public cppu::WeakAggImplHelper5
static String sInvalidStyle;
protected:
virtual ~SwXNumberingRules();
+
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXNumberingRules(SwDocShell& rDocSh); // chapter numbering
SwXNumberingRules(const SwNumRule& rRule); // NumRule for paragraphs, numbering styles
@@ -211,9 +215,6 @@ public:
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rProperties, sal_Int32 nIndex)
throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException );
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
const String* GetNewCharStyleNames() const {return sNewCharStyleNames;}
const String* GetBulletFontNames() const {return sNewBulletFontNames;}
const SwNumRule* GetNumRule() {return pNumRule;}
diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index 919c930f1fe6..1fd61f88f871 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -201,6 +201,7 @@ protected:
void SAL_CALL SetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
SwXStyle(SwDoc* pDoc, SfxStyleFamily eFam = SFX_STYLE_FAMILY_PARA, sal_Bool bConditional = sal_False);
SwXStyle(SfxStyleSheetBasePool& rPool, SfxStyleFamily eFam,
@@ -274,7 +275,6 @@ public:
StartListening(*pBasePool);
}
SwDoc* GetDoc() const { return m_pDoc; }
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
};
class SwXFrameStyle : public SwXStyle,
@@ -358,10 +358,12 @@ class SwXAutoStyleFamily : public cppu::WeakImplHelper1< com::sun::star::style::
SwDocShell *pDocShell;
IStyleAccess::SwAutoStyleFamily eFamily;
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXAutoStyleFamily(SwDocShell* pDocShell, IStyleAccess::SwAutoStyleFamily eFamily);
virtual ~SwXAutoStyleFamily();
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
//XAutoStyleFamily
virtual ::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyle > SAL_CALL insertStyle( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Values ) throw (::com::sun::star::uno::RuntimeException);
@@ -381,14 +383,15 @@ class SwXAutoStylesEnumerator : public cppu::WeakImplHelper1< ::com::sun::star::
public:
SwXAutoStylesEnumerator( SwDoc* pDoc, IStyleAccess::SwAutoStyleFamily eFam );
virtual ~SwXAutoStylesEnumerator();
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
//XEnumeration
virtual sal_Bool SAL_CALL hasMoreElements( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL nextElement( ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
+
// an automatic style
class SwXAutoStyle : public cppu::WeakImplHelper3
<
@@ -407,7 +410,6 @@ public:
SwXAutoStyle( SwDoc* pDoc, SfxItemSet_Pointer_t pInitSet, IStyleAccess::SwAutoStyleFamily eFam );
virtual ~SwXAutoStyle();
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
//XPropertySet
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
@@ -438,6 +440,9 @@ public:
// Special
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getProperties() throw (::com::sun::star::uno::RuntimeException);
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
};
#endif
diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index 72c5c6a76865..f4c5c8e2af4d 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -111,6 +111,9 @@ protected:
virtual ~SwXCell();
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, sal_uInt16 nPos=USHRT_MAX );
SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode); // XML import interface
@@ -158,9 +161,6 @@ public:
virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
//XEnumerationAccess - frueher XParagraphEnumerationAccess
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
@@ -188,6 +188,9 @@ class SwXTextTableRow : public cppu::WeakImplHelper2
SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
protected:
virtual ~SwXTextTableRow();
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLine);
@@ -208,9 +211,6 @@ public:
virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
const SwTableLine* GetTblRow() const {return pLine;}
static SwTableLine* FindLine(SwTable* pTable, SwTableLine* pLine);
};
@@ -264,7 +264,7 @@ public:
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
//SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
// ITextCursorHelper
virtual const SwPaM* GetPaM() const;
@@ -405,7 +405,7 @@ public:
SwRangeDescriptor& rDesc);
//SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
};
@@ -487,7 +487,7 @@ public:
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
//SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
sal_uInt16 getRowCount(void);
@@ -539,7 +539,7 @@ public:
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
//SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
class SwXTableColumns : public cppu::WeakImplHelper2
@@ -577,7 +577,7 @@ public:
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
//SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
#endif
diff --git a/sw/inc/unotext.hxx b/sw/inc/unotext.hxx
index 5e1543acfcde..cb483507b712 100644
--- a/sw/inc/unotext.hxx
+++ b/sw/inc/unotext.hxx
@@ -289,6 +289,12 @@ public:
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
+ // XTextCopy
+ virtual void SAL_CALL copyText(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XTextCopy >& xSource )
+ throw (::com::sun::star::uno::RuntimeException);
+
// XTextRangeCompare
sal_Int16 SAL_CALL compareRegionStarts(
const ::com::sun::star::uno::Reference<
@@ -332,12 +338,6 @@ public:
::com::sun::star::text::XTextContent>& xPredecessor)
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
-
- // XTextCopy
- virtual void SAL_CALL copyText(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextCopy >& xSource )
- throw (::com::sun::star::uno::RuntimeException);
};
#endif // SW_UNOTEXT_HXX
diff --git a/sw/inc/unotextmarkup.hxx b/sw/inc/unotextmarkup.hxx
index 4b015b95405e..b682a97db6a6 100644
--- a/sw/inc/unotextmarkup.hxx
+++ b/sw/inc/unotextmarkup.hxx
@@ -66,14 +66,14 @@ public:
// ::com::sun::star::text::XMultiTextMarkup:
virtual void SAL_CALL commitMultiTextMarkup( const ::com::sun::star::uno::Sequence< ::com::sun::star::text::TextMarkupDescriptor >& aMarkups ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
private:
SwXTextMarkup( const SwXTextMarkup & ); // not defined
SwXTextMarkup & operator =( const SwXTextMarkup & ); // not defined
protected:
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
SwTxtNode* mpTxtNode;
const ModelToViewHelper::ConversionMap* mpConversionMap;
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 82512aa9af5e..7aad16da1d3c 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -130,8 +130,7 @@ class SfxViewFrame;
class SwPrintUIOptions;
class SwPrintData;
class SwRenderData;
-class SwWrtShell;
-
+class ViewShell;
typedef UnoActionContext* UnoActionContextPtr;
SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4)
@@ -587,16 +586,14 @@ public:
-----------------------------------------------------------------------*/
class SwViewOptionAdjust_Impl
{
- SwWrtShell & m_rShell;
+ ViewShell & m_rShell;
SwViewOption m_aOldViewOptions;
public:
- SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewOption &rViewOptions );
+ SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions );
~SwViewOptionAdjust_Impl();
-
- void AdjustViewOptions( SwPrintData const*const pPrtOptions );
-
- bool checkShell( const SwWrtShell& rCompare ) const
+ void AdjustViewOptions( SwPrintData const* const pPrtOptions );
+ bool checkShell( const ViewShell& rCompare ) const
{ return &rCompare == &m_rShell; }
};
diff --git a/sw/inc/usrfld.hxx b/sw/inc/usrfld.hxx
index 5b041e620d9a..49e7368a4d79 100644
--- a/sw/inc/usrfld.hxx
+++ b/sw/inc/usrfld.hxx
@@ -62,8 +62,6 @@ public:
inline sal_Bool IsValid() const;
inline void ChgValid( sal_Bool bNew );
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
-
double GetValue(SwCalc& rCalc); // Member nValue neu berrechnen
inline double GetValue() const;
inline void SetValue(const double nVal);
@@ -76,6 +74,9 @@ public:
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nMId ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nMId );
+
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
};
inline sal_Bool SwUserFieldType::IsValid() const
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index af12afe42bbc..7da7da2f9c43 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -156,8 +156,9 @@ protected:
sal_Bool bStarOneSetting : 1;// prevent from UI automatics (no scrollbars in readonly documents)
sal_Bool bIsPagePreview : 1; // the preview mustn't print field/footnote/... shadings
sal_Bool bSelectionInReadonly : 1; //determines whether selection is switched on in readonly documents
- sal_Bool bFormView : 1;
- sal_Bool bBookview : 1; // view mode for page preview
+ sal_Bool mbFormView : 1;
+ sal_Bool mbBrowseMode : 1; //swmod 080130
+ sal_Bool mbBookView : 1; // view mode for page preview
sal_Bool mbViewLayoutBookMode : 1; // book view mode for edit view
sal_Bool bShowPlaceHolderFields : 1; //only used in printing!
mutable bool bIdle;
@@ -400,11 +401,13 @@ public:
sal_Bool IsSelectionInReadonly() const {return bSelectionInReadonly;}
void SetSelectionInReadonly(sal_Bool bSet) {bSelectionInReadonly = bSet;}
- sal_Bool IsFormView() const { return bFormView; }
- void SetFormView( sal_Bool bSet ) { bFormView = bSet; }
+ sal_Bool IsFormView() const { return mbFormView; }
+ void SetFormView( sal_Bool bSet ) { mbFormView = bSet; }
- inline sal_Bool IsPagePrevBookview() const { return bBookview; }
- inline void SetPagePrevBookview(sal_Bool bSet) { bBookview = bSet; }
+ inline sal_Bool getBrowseMode() const { return mbBrowseMode; }
+ inline void setBrowseMode(sal_Bool bSet) { mbBrowseMode = bSet; }
+ inline sal_Bool IsPagePrevBookview() const { return mbBookView; }
+ inline void SetPagePrevBookview(sal_Bool bSet) { mbBookView = bSet; }
sal_Bool IsAutoCompleteWords() const;
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 7e07979f47a0..27f4d434df44 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -36,6 +36,7 @@
#include <swtypes.hxx>
#include <ring.hxx>
#include <swrect.hxx>
+#include <boost/shared_ptr.hpp>// swmod 080115
#include <vcl/mapmod.hxx>
#include <vcl/print.hxx>
@@ -95,7 +96,8 @@ namespace vcl
// benoetigt werden.
// Zur Zeit wird fuer die DrawPage das PreView Flag benoetigt
#define VSHELLFLAG_ISPREVIEW ((long)0x1)
-
+#define VSHELLFLAG_SHARELAYOUT ((long)0x2)//swmod 080125 flag
+typedef boost::shared_ptr<SwRootFrm> SwRootFrmPtr;
class SW_DLLPUBLIC ViewShell : public Ring
{
@@ -164,6 +166,8 @@ class SW_DLLPUBLIC ViewShell : public Ring
SdrPaintWindow* mpTargetPaintWindow;
OutputDevice* mpBufferedOut;
+ SwRootFrmPtr pLayout; //swmod 080116
+
//Initialisierung, wird von den verschiedenen Konstruktoren gerufen.
SW_DLLPRIVATE void Init( const SwViewOption *pNewOpt );
@@ -271,7 +275,7 @@ public:
//Invalidierung der ersten Sichtbaren Seite fuer alle Shells im Ring.
void SetFirstVisPageInvalid();
- SwRootFrm *GetLayout() const;
+ SwRootFrm *GetLayout() const;//swmod 080116
sal_Bool IsNewLayout() const; //Wurde das Layout geladen oder neu
//erzeugt?
@@ -279,6 +283,10 @@ public:
void CalcLayout(); //Durchformatierung des Layouts erzwingen.
+ sal_uInt16 GetPageCount() const;
+
+ const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const;
+
inline SwDoc *GetDoc() const { return pDoc; } //niemals 0.
/** Provides access to the document setting interface
@@ -420,7 +428,7 @@ public:
void LayoutIdle();
inline const SwViewOption *GetViewOptions() const { return pOpt; }
- void ApplyViewOptions( const SwViewOption &rOpt );
+ virtual void ApplyViewOptions( const SwViewOption &rOpt );
void SetUIOptions( const SwViewOption &rOpt );
void SetReadonlyOption(sal_Bool bSet); // Readonly-Bit d. ViewOptions setzen
void SetPDFExportOption(sal_Bool bSet); // set/reset PDF export mode
diff --git a/sw/qa/complex/accessibility/makefile.mk b/sw/qa/complex/accessibility/makefile.mk
new file mode 100644
index 000000000000..06e7c6a70408
--- /dev/null
+++ b/sw/qa/complex/accessibility/makefile.mk
@@ -0,0 +1,50 @@
+#*************************************************************************
+#
+# 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.
+#
+#*************************************************************************
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../../..
+PRJNAME = sw
+TARGET = qa_complex_accessibility
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/accessibility
+JAVATESTFILES = AccessibleRelationSet.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/sw/qa/complex/checkColor/makefile.mk b/sw/qa/complex/checkColor/makefile.mk
new file mode 100644
index 000000000000..e5b368083ada
--- /dev/null
+++ b/sw/qa/complex/checkColor/makefile.mk
@@ -0,0 +1,50 @@
+#*************************************************************************
+#
+# 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.
+#
+#*************************************************************************
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../../..
+PRJNAME = sw
+TARGET = qa_complex_checkColor
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/checkColor
+JAVATESTFILES = CheckChangeColor.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/sw/qa/complex/writer/TestDocument.java b/sw/qa/complex/writer/TestDocument.java
index 25a11338ae5c..088c9aede3d6 100644
--- a/sw/qa/complex/writer/TestDocument.java
+++ b/sw/qa/complex/writer/TestDocument.java
@@ -29,10 +29,11 @@ package complex.writer;
import java.io.File;
import org.openoffice.test.OfficeFileUrl;
+import org.openoffice.test.Argument;
final class TestDocument {
public static String getUrl(String name) {
- return OfficeFileUrl.getAbsolute(new File("testdocuments", name));
+ return OfficeFileUrl.getAbsolute(new File(Argument.get("tdoc"), name));
}
private TestDocument() {}
diff --git a/sw/qa/unoapi/makefile.mk b/sw/qa/unoapi/makefile.mk
new file mode 100644
index 000000000000..f5102c2c9c84
--- /dev/null
+++ b/sw/qa/unoapi/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+# 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.
+#***********************************************************************/
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../..
+PRJNAME = sw
+TARGET = qa_unoapi
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/sw/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/sw/sdi/_docsh.sdi b/sw/sdi/_docsh.sdi
index 1c5b0db4f062..ad37160a3c1f 100644
--- a/sw/sdi/_docsh.sdi
+++ b/sw/sdi/_docsh.sdi
@@ -121,17 +121,6 @@ interface BaseTextDocument
StateMethod = GetState ;
]
- SID_BROWSER_MODE
- [
- ExecMethod = Execute;
- StateMethod = GetState;
- ]
-
- FN_PRINT_LAYOUT
- [
- ExecMethod = Execute;
- StateMethod = GetState;
- ]
SID_MAIL_PREPAREEXPORT
[
ExecMethod = Execute ;
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index ee5fc431e165..a17fbb8f5742 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -98,6 +98,16 @@ interface BaseTextEditView
ExecMethod = ExecDraw ;
StateMethod = GetDrawState ;
]
+ SID_BROWSER_MODE
+ [
+ ExecMethod = ExecViewOptions ;
+ StateMethod = StateViewOptions ;
+ ]
+ FN_PRINT_LAYOUT
+ [
+ ExecMethod = ExecViewOptions ;
+ StateMethod = StateViewOptions ;
+ ]
FN_REDLINE_PROTECT
[
ExecMethod = Execute;
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index 7e13c561bc8b..bad6b1b4f5ab 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -65,10 +65,10 @@ using lang::IndexOutOfBoundsException;
// SwAccessiblePreview
//
-SwAccessibleDocumentBase::SwAccessibleDocumentBase ( SwAccessibleMap* pInitMap ) :
- SwAccessibleContext( pInitMap, AccessibleRole::DOCUMENT,
- pInitMap->GetShell()->getIDocumentLayoutAccess()->GetRootFrm() ),
- mxParent( pInitMap->GetShell()->GetWin()->GetAccessibleParentWindow()->GetAccessible() ),
+SwAccessibleDocumentBase::SwAccessibleDocumentBase ( SwAccessibleMap *_pMap ) :
+ SwAccessibleContext( _pMap, AccessibleRole::DOCUMENT,
+ _pMap->GetShell()->GetLayout() ),//swmod 071107//swmod 071225
+ mxParent( _pMap->GetShell()->GetWin()->GetAccessibleParentWindow()->GetAccessible() ),
mpChildWin( 0 )
{
}
diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx
index 5ab12b068678..f96b050260b6 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -217,7 +217,7 @@ SwAccessibleFrameBase::~SwAccessibleFrameBase()
{
}
-void SwAccessibleFrameBase::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwAccessibleFrameBase::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
const SwFlyFrm *pFlyFrm = static_cast< const SwFlyFrm * >( GetFrm() );
@@ -231,13 +231,13 @@ void SwAccessibleFrameBase::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
OUString sOldName( GetName() );
OSL_ENSURE( !pOld ||
- static_cast < SwStringMsgPoolItem * >( pOld )->GetString() == String( sOldName ),
+ static_cast < const SwStringMsgPoolItem * >( pOld )->GetString() == String( sOldName ),
"invalid old name" );
const String& rNewName = pFrmFmt->GetName();
SetName( rNewName );
OSL_ENSURE( !pNew ||
- static_cast < SwStringMsgPoolItem * >( pNew )->GetString() == rNewName,
+ static_cast < const SwStringMsgPoolItem * >( pNew )->GetString() == rNewName,
"invalid new name" );
if( sOldName != GetName() )
@@ -251,18 +251,20 @@ void SwAccessibleFrameBase::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
}
break;
case RES_OBJECTDYING:
+ // mba: it seems that this class intentionally does not call code in base class SwClient
if( GetRegisteredIn() ==
- static_cast< SwModify *>( static_cast< SwPtrMsgPoolItem * >( pOld )->pObject ) )
- pRegisteredIn->Remove( this );
+ static_cast< SwModify *>( static_cast< const SwPtrMsgPoolItem * >( pOld )->pObject ) )
+ GetRegisteredInNonConst()->Remove( this );
break;
case RES_FMT_CHG:
- if( static_cast< SwFmtChg * >(pNew)->pChangedFmt == GetRegisteredIn() &&
- static_cast< SwFmtChg * >(pOld)->pChangedFmt->IsFmtInDTOR() )
- pRegisteredIn->Remove( this );
+ if( static_cast< const SwFmtChg * >(pNew)->pChangedFmt == GetRegisteredIn() &&
+ static_cast< const SwFmtChg * >(pOld)->pChangedFmt->IsFmtInDTOR() )
+ GetRegisteredInNonConst()->Remove( this );
break;
+
default:
- SwClient::Modify( pOld, pNew );
+ // mba: former call to base class method removed as it is meant to handle only RES_OBJECTDYING
break;
}
}
@@ -272,7 +274,7 @@ void SwAccessibleFrameBase::Dispose( sal_Bool bRecursive )
SolarMutexGuard aGuard;
if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
SwAccessibleContext::Dispose( bRecursive );
}
diff --git a/sw/source/core/access/accframebase.hxx b/sw/source/core/access/accframebase.hxx
index 4f0b17d0898e..8ac7f2e2e0c6 100644
--- a/sw/source/core/access/accframebase.hxx
+++ b/sw/source/core/access/accframebase.hxx
@@ -52,6 +52,7 @@ protected:
virtual void _InvalidateFocus();
virtual ~SwAccessibleFrameBase();
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
@@ -61,8 +62,6 @@ public:
virtual sal_Bool HasCursor(); // required by map to remember that object
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
static sal_uInt8 GetNodeType( const SwFlyFrm *pFlyFrm );
// The object is not visible an longer and should be destroyed
diff --git a/sw/source/core/access/accfrmobj.cxx b/sw/source/core/access/accfrmobj.cxx
index 1e72847fbe3f..6b3f73c713b3 100644
--- a/sw/source/core/access/accfrmobj.cxx
+++ b/sw/source/core/access/accfrmobj.cxx
@@ -357,7 +357,7 @@ const SwFrm* SwAccessibleChild::GetParent( const sal_Bool bInPagePreview ) const
if( bInPagePreview )
pParent = pFly->FindPageFrm();
else
- pParent = pFly->FindRootFrm();
+ pParent = pFly->getRootFrm();
}
}
else
@@ -393,7 +393,7 @@ const SwFrm* SwAccessibleChild::GetParent( const sal_Bool bInPagePreview ) const
if( bInPagePreview )
pParent = pContact->GetAnchorFrm()->FindPageFrm();
else
- pParent = pContact->GetAnchorFrm()->FindRootFrm();
+ pParent = pContact->GetAnchorFrm()->getRootFrm();
}
}
}
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 91c2614deac0..a3294bc2aa01 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -74,6 +74,7 @@
#include <ndtxt.hxx>
#include <dflyobj.hxx>
#include <prevwpage.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
@@ -2627,15 +2628,8 @@ SwAccessibleSelectedParas_Impl* SwAccessibleMap::_BuildSelectedParas()
if ( pTxtNode )
{
// loop on all text frames registered at the text node.
- SwClientIter aIter( *pTxtNode );
- for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
- pFrm;
- pFrm = (SwFrm*)aIter.Next() )
- {
- OSL_ENSURE( dynamic_cast<SwTxtFrm*>(pFrm),
- "<SwAccessibleMap::_BuildSelectedParas()> - unexpected frame type" );
- SwTxtFrm* pTxtFrm( dynamic_cast<SwTxtFrm*>(pFrm) );
- if ( pTxtFrm )
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( *pTxtNode );
+ for( SwTxtFrm* pTxtFrm = aIter.First(); pTxtFrm; pTxtFrm = aIter.Next() )
{
uno::WeakReference < XAccessible > xWeakAcc;
SwAccessibleContextMap_Impl::iterator aMapIter =
@@ -2663,7 +2657,6 @@ SwAccessibleSelectedParas_Impl* SwAccessibleMap::_BuildSelectedParas()
}
}
}
- }
// prepare next turn: get next cursor in ring
pCrsr = static_cast<SwPaM*>( pCrsr->GetNext() );
diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx
index 86910db5aa07..6777b63f23a5 100644
--- a/sw/source/core/access/accnotextframe.cxx
+++ b/sw/source/core/access/accnotextframe.cxx
@@ -91,7 +91,7 @@ SwAccessibleNoTextFrame::~SwAccessibleNoTextFrame()
{
}
-void SwAccessibleNoTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwAccessibleNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
// #i73249#
@@ -111,9 +111,9 @@ void SwAccessibleNoTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
case RES_TITLE_CHANGED:
{
const String& sOldTitle(
- dynamic_cast<SwStringMsgPoolItem*>(pOld)->GetString() );
+ dynamic_cast<const SwStringMsgPoolItem*>(pOld)->GetString() );
const String& sNewTitle(
- dynamic_cast<SwStringMsgPoolItem*>(pNew)->GetString() );
+ dynamic_cast<const SwStringMsgPoolItem*>(pNew)->GetString() );
if ( sOldTitle == sNewTitle )
{
break;
diff --git a/sw/source/core/access/accnotextframe.hxx b/sw/source/core/access/accnotextframe.hxx
index f5e3e536d11a..ce4ef672c110 100644
--- a/sw/source/core/access/accnotextframe.hxx
+++ b/sw/source/core/access/accnotextframe.hxx
@@ -46,14 +46,14 @@ protected:
const SwNoTxtNode *GetNoTxtNode() const;
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwAccessibleNoTextFrame( SwAccessibleMap* pInitMap,
sal_Int16 nInitRole,
const SwFlyFrm *pFlyFrm );
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
//===== XAccessibleContext ==============================================
// #i73249# - Return the object's current name.
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 87a59379fb38..f515494d234d 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -2601,11 +2601,11 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getNumberOfLineWithCaret()
}
// #i108125#
-void SwAccessibleParagraph::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwAccessibleParagraph::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
mpParaChangeTrackInfo->reset();
- SwClient::Modify( pOld, pNew );
+ CheckRegistration( pOld, pNew );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accpara.hxx b/sw/source/core/access/accpara.hxx
index 062af1aa8940..d3092e2326f3 100644
--- a/sw/source/core/access/accpara.hxx
+++ b/sw/source/core/access/accpara.hxx
@@ -226,6 +226,8 @@ protected:
::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew);
+
public:
SwAccessibleParagraph( SwAccessibleMap& rInitMap,
@@ -235,8 +237,6 @@ public:
virtual sal_Bool HasCursor(); // required by map to remember that object
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew); // #i108125#
-
//===== XAccessibleContext ==============================================
/// Return this object's description.
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 563a000a3230..ba843fb22715 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -732,7 +732,7 @@ SwAccessibleTable::~SwAccessibleTable()
delete mpTableData;
}
-void SwAccessibleTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwAccessibleTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
const SwTabFrm *pTabFrm = static_cast< const SwTabFrm * >( GetFrm() );
@@ -779,13 +779,14 @@ void SwAccessibleTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
break;
case RES_OBJECTDYING:
+ // mba: it seems that this class intentionally does not call code in base class SwClient
if( GetRegisteredIn() ==
- static_cast< SwModify *>( static_cast< SwPtrMsgPoolItem * >( pOld )->pObject ) )
- pRegisteredIn->Remove( this );
+ static_cast< SwModify *>( static_cast< const SwPtrMsgPoolItem * >( pOld )->pObject ) )
+ GetRegisteredInNonConst()->Remove( this );
break;
default:
- SwClient::Modify( pOld, pNew );
+ // mba: former call to base class method removed as it is meant to handle only RES_OBJECTDYING
break;
}
}
@@ -1350,7 +1351,7 @@ void SwAccessibleTable::Dispose( sal_Bool bRecursive )
SolarMutexGuard aGuard;
if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
SwAccessibleContext::Dispose( bRecursive );
}
@@ -1666,7 +1667,7 @@ SwAccessibleTableData_Impl* SwAccessibleTableColHeaders::CreateNewTableData()
}
-void SwAccessibleTableColHeaders::Modify( SfxPoolItem * /*pOld*/, SfxPoolItem * /*pNew*/ )
+void SwAccessibleTableColHeaders::Modify( const SfxPoolItem * /*pOld*/, const SfxPoolItem * /*pNew*/ )
{
}
diff --git a/sw/source/core/access/acctable.hxx b/sw/source/core/access/acctable.hxx
index 04fe465a91a6..491ba5c4416d 100644
--- a/sw/source/core/access/acctable.hxx
+++ b/sw/source/core/access/acctable.hxx
@@ -88,12 +88,12 @@ protected:
// Is table data evailable?
sal_Bool HasTableData() const { return (mpTableData != 0); }
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwAccessibleTable( SwAccessibleMap* pInitMap, const SwTabFrm* pTableFrm );
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
//===== XInterface ======================================================
// (XInterface methods need to be implemented to disambigouate
@@ -275,13 +275,12 @@ protected:
{}
virtual SwAccessibleTableData_Impl* CreateNewTableData();
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
SwAccessibleTableColHeaders( SwAccessibleMap *pMap, const SwTabFrm *pTabFrm );
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
//===== XInterface ======================================================
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx
index d86e3e3a8173..6d41322a7703 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -83,7 +83,7 @@ SwAccessibleTextFrame::~SwAccessibleTextFrame()
{
}
-void SwAccessibleTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwAccessibleTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
// #i73249# - suppress handling of RES_NAME_CHANGED
@@ -101,9 +101,9 @@ void SwAccessibleTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
case RES_TITLE_CHANGED:
{
const String& sOldTitle(
- dynamic_cast<SwStringMsgPoolItem*>(pOld)->GetString() );
+ dynamic_cast<const SwStringMsgPoolItem*>(pOld)->GetString() );
const String& sNewTitle(
- dynamic_cast<SwStringMsgPoolItem*>(pNew)->GetString() );
+ dynamic_cast<const SwStringMsgPoolItem*>(pNew)->GetString() );
if ( sOldTitle == sNewTitle )
{
break;
diff --git a/sw/source/core/access/acctextframe.hxx b/sw/source/core/access/acctextframe.hxx
index f9b90fe50d19..92c029d69e23 100644
--- a/sw/source/core/access/acctextframe.hxx
+++ b/sw/source/core/access/acctextframe.hxx
@@ -47,13 +47,12 @@ protected:
virtual ~SwAccessibleTextFrame();
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwAccessibleTextFrame( SwAccessibleMap* pInitMap, const SwFlyFrm* pFlyFrm );
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
-
//===== XAccessibleContext ==============================================
// #i73249# - Return the object's current name.
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index dc6c6d6dcecd..844bd0dfbbd2 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -29,117 +29,102 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include <hintids.hxx> // fuer RES_..
+#include <hintids.hxx> // contains RES_.. IDs
#include <frame.hxx>
#include <hints.hxx>
-#include <swcache.hxx>
-#include <swfntcch.hxx>
-
-#if OSL_DEBUG_LEVEL > 1
-#include <unotextmarkup.hxx>
-#endif
+#include <swcache.hxx> // mba: get rid of that dependency
+#include <swfntcch.hxx> // mba: get rid of that dependency
static SwClientIter* pClientIters = 0;
-TYPEINIT0(SwClient); //rtti
-
-/*************************************************************************
-|* SwClient::SwClient(SwModify *)
-|*
-|* Beschreibung callback.doc V1.14
-*************************************************************************/
-
+TYPEINIT0(SwClient);
+/*************************************************************************/
SwClient::SwClient(SwModify *pToRegisterIn)
- : pLeft( 0 ), pRight( 0 ), pRegisteredIn( 0 )
+ : pLeft( 0 ), pRight( 0 ), pRegisteredIn( 0 ), mbIsAllowedToBeRemovedInModifyCall(false)
{
- bModifyLocked =
- bInModify =
- bInDocDTOR =
- bInCache = sal_False;
- bInSwFntCache = sal_False;
-
if(pToRegisterIn)
+ // connect to SwModify
pToRegisterIn->Add(this);
}
-/*************************************************************************
-|* SwClient::Modify()
-|*
-|* Beschreibung callback.doc V1.14
-*************************************************************************/
-
-
-void SwClient::Modify( SfxPoolItem *pOld, SfxPoolItem * )
+/*************************************************************************/
+void SwClient::CheckRegistration( const SfxPoolItem* pOld, const SfxPoolItem * )
{
+ // this method only handles notification about dying SwModify objects
if( (!pOld || pOld->Which() != RES_OBJECTDYING) )
return;
- SwPtrMsgPoolItem *pDead = (SwPtrMsgPoolItem *)pOld;
- if(pDead->pObject == pRegisteredIn)
+ const SwPtrMsgPoolItem *pDead = static_cast<const SwPtrMsgPoolItem*>(pOld);
+ if(pDead && pDead->pObject == pRegisteredIn)
{
- SwModify *pAbove = (SwModify*)pRegisteredIn->GetRegisteredIn();
+ // I've got a notification from the object I know
+ SwModify *pAbove = const_cast<SwModify*>(pRegisteredIn->GetRegisteredIn());
if(pAbove)
{
+ // if the dying object itself was listening at an SwModify, I take over
+ // adding myself to pAbove will automatically remove me from my current pRegisteredIn
pAbove->Add(this);
return;
}
+
+ // destroy connection
pRegisteredIn->Remove(this);
}
}
-/*************************************************************************
-|* SwClient::~SwClient()
-|*
-|* Beschreibung callback.doc V1.14
-*************************************************************************/
+void SwClient::Modify( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue )
+{
+ CheckRegistration( pOldValue, pNewValue );
+}
+void SwClient::SwClientNotify( const SwModify&, const SfxHint& )
+{
+
+}
+//*************************************************************************
SwClient::~SwClient()
{
+ DBG_ASSERT( !pRegisteredIn || pRegisteredIn->GetDepends(),"SwModify still known, but Client already disconnected!" );
if( pRegisteredIn && pRegisteredIn->GetDepends() )
+ // still connected
pRegisteredIn->Remove( this );
-
- OSL_ENSURE( !IsModifyLocked(), "Modify destroyed but locked." );
}
- // erfrage vom Client Informationen
sal_Bool SwClient::GetInfo( SfxPoolItem& ) const
{
return sal_True; // und weiter
}
-/*************************************************************************
-|* SwModify::SwModify( SwModify * )
-|*
-|* Beschreibung Dokument 1.7
-*************************************************************************/
-
-SwModify::SwModify( SwModify *pToRegisterIn )
- : SwClient(pToRegisterIn), pRoot( 0 )
+/*************************************************************************/
+SwModify::SwModify()
+ : SwClient(0), pRoot(0)
{
+ bModifyLocked = sal_False;
+ bLockClientList = sal_False;
+ bInDocDTOR = sal_False;
+ bInCache = sal_False;
+ bInSwFntCache = sal_False;
}
-// @@@ forbidden and not implemented, but needs to be accessible (protected).
-SwModify::SwModify( const SwModify & )
- : SwClient( 0 )
+SwModify::SwModify( SwModify *pToRegisterIn )
+ : SwClient(pToRegisterIn), pRoot( 0 )
{
- OSL_PRECOND(0, "SwModify(const SwModify&): not implemented.");
+ bModifyLocked = sal_False;
+ bLockClientList = sal_False;
+ bInDocDTOR = sal_False;
+ bInCache = sal_False;
+ bInSwFntCache = sal_False;
}
-/*************************************************************************
-|* SwModify::~SwModify()
-|*
-|* Beschreibung Dokument 1.7
-*************************************************************************/
-
-
-
+/*************************************************************************/
SwModify::~SwModify()
{
+ OSL_ENSURE( !IsModifyLocked(), "Modify destroyed but locked." );
+
if ( IsInCache() )
SwFrm::GetCache().Delete( this );
@@ -148,42 +133,40 @@ SwModify::~SwModify()
if( pRoot )
{
+ // there are depending objects
if( IsInDocDTOR() )
{
- // alle Clients "logisch" austragen
+ // if document gets destroyed anyway, just tell clients to forget me
+ // so that they don't try to get removed from my list later when they also get destroyed
SwClientIter aIter( *this );
- SwClient* p;
- while( 0 != ( p = aIter++ ) )
- p->pRegisteredIn = 0;
-
- p = aIter.GoRoot(); // wieder ab Root (==Start) anfangen
- do {
+ SwClient* p = aIter.GoStart();
+ while ( p )
+ {
p->pRegisteredIn = 0;
- } while( 0 != ( p = aIter-- ) );
+ p = aIter++;
+ }
}
else
{
- // verschicke die Nachricht an die abgeleiteten Objekte.
+ // notify all clients that they shall remove themselves
SwPtrMsgPoolItem aDyObject( RES_OBJECTDYING, this );
- Modify( &aDyObject, &aDyObject );
+ NotifyClients( &aDyObject, &aDyObject );
- // Zwangsummeldung aller derjenigen, die sich nicht ausgetragen
- // haben, durch Aufruf von SwClient::Modify()
+ // remove all clients that have not done themselves
+ // mba: possibly a hotfix for forgotten base class calls?!
while( pRoot )
- pRoot->SwClient::Modify(&aDyObject, &aDyObject);
+ pRoot->CheckRegistration(&aDyObject, &aDyObject);
}
}
}
-/*************************************************************************
-|* SwModify::Modify( SwHint * pOldValue, SwHint * pNewValue )
-|*
-|* Beschreibung Dokument 1.7
-*************************************************************************/
-
-
+/*************************************************************************/
+void SwModify::Modify( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue )
+{
+ NotifyClients( pOldValue, pNewValue );
+}
-void SwModify::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
+void SwModify::NotifyClients( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue )
{
if (IsInCache() || IsInSwFntCache())
{
@@ -197,47 +180,35 @@ void SwModify::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
LockModify();
-#if OSL_DEBUG_LEVEL > 1
+ // mba: WTF?!
if( !pOldValue )
- bInModify = sal_True;
+ bLockClientList = sal_True;
else
- // following Modifies don't calls an ASSRT
+ {
+ // following Modifies shouldn't call an ASSERT
switch( pOldValue->Which() )
{
case RES_OBJECTDYING:
- case RES_REMOVE_UNO_OBJECT:
- bInModify = ((SwPtrMsgPoolItem *)pOldValue)->pObject != this;
+ case RES_REMOVE_UNO_OBJECT:
+ bLockClientList = ((SwPtrMsgPoolItem *)pOldValue)->pObject != this;
break;
case RES_FOOTNOTE_DELETED:
case RES_REFMARK_DELETED:
case RES_TOXMARK_DELETED:
case RES_FIELD_DELETED:
- bInModify = sal_False;
+ bLockClientList = sal_False;
break;
default:
- bInModify = sal_True;
+ bLockClientList = sal_True;
}
-#else
- bInModify = sal_True;
-#endif
-
- SwClientIter aIter( *this );
- SwClient * pLast = aIter.GoStart();
- if( pLast ) // konnte zum Anfang gesprungen werden ??
- do
- {
- pLast->Modify( pOldValue, pNewValue );
- if( !pRoot ) // Baum schon Weg ??
- break;
- } while( 0 != ( pLast = aIter++ ));
+ }
- bInModify = sal_False;
+ ModifyBroadcast( pOldValue, pNewValue );
+ bLockClientList = sal_False;
UnlockModify();
}
-// erfrage vom Modify Informationen
-
sal_Bool SwModify::GetInfo( SfxPoolItem& rInfo ) const
{
sal_Bool bRet = sal_True; // bedeutet weiter zum naechsten
@@ -253,46 +224,38 @@ sal_Bool SwModify::GetInfo( SfxPoolItem& rInfo ) const
;
}
- return bRet; // und weiter
+ return bRet;
}
-/*************************************************************************
-|* SwModify::Add( SwClient *pDepend )
-|*
-|* Beschreibung Dokument 1.7
-*************************************************************************/
-
-
-
+/*************************************************************************/
void SwModify::Add(SwClient *pDepend)
{
- OSL_ENSURE( !bInModify, "Client innerhalb des eigenen Modifies einfuegen?" );
+ OSL_ENSURE( !bLockClientList, "Client inserted while in Modify" );
- // nur wenn das hier noch nicht eingetragen ist einfuegen
if(pDepend->pRegisteredIn != this )
{
#if OSL_DEBUG_LEVEL > 1
SwClientIter* pTmp = pClientIters;
while( pTmp )
{
- OSL_ENSURE( &pTmp->rRoot != pRoot,
- "Client beim angemeldeten ClientIter einfuegen?" );
+ OSL_ENSURE( &pTmp->GetModify() != pRoot, "Client added to active ClientIter" );
pTmp = pTmp->pNxtIter;
}
#endif
- // wenn schon wanders angemeldet, dann dort abmelden
+ // deregister new client in case it is already registered elsewhere
if( pDepend->pRegisteredIn != 0 )
pDepend->pRegisteredIn->Remove( pDepend );
if( !pRoot )
{
+ // first client added
pRoot = pDepend;
pRoot->pLeft = 0;
pRoot->pRight = 0;
}
else
{
- // immer hinter die Root haengen
+ // append client
pDepend->pRight = pRoot->pRight;
pRoot->pRight = pDepend;
pDepend->pLeft = pRoot;
@@ -300,29 +263,24 @@ void SwModify::Add(SwClient *pDepend)
pDepend->pRight->pLeft = pDepend;
}
+ // connect client to me
pDepend->pRegisteredIn = this;
}
}
-/*************************************************************************
-|* SwModify::_Remove( SwClient *pDepend )
-|*
-|* Beschreibung Dokument 1.7
-*************************************************************************/
-
+/*************************************************************************/
-
-SwClient *SwModify::_Remove(SwClient * pDepend)
+SwClient* SwModify::Remove(SwClient * pDepend)
{
- // FME 2007-07-16 #i79641# SwXTextMarkup is allowed to be removed ...
-#if OSL_DEBUG_LEVEL > 1
- OSL_ENSURE( !bInModify || 0 != dynamic_cast<SwXTextMarkup*>(pDepend), "Client innerhalb des eigenen Modifies loeschen?" );
-#endif
+ if ( bInDocDTOR )
+ return 0;
+
+ OSL_ENSURE( !bLockClientList || pDepend->mbIsAllowedToBeRemovedInModifyCall, "SwClient shall be removed in Modify call!" );
- // loesche das Object aus der Liste und setze den
- // Registrierungs-Pointer zurueck
if( pDepend->pRegisteredIn == this )
{
+ // SwClient is my listener
+ // remove it from my list
SwClient* pR = pDepend->pRight;
SwClient* pL = pDepend->pLeft;
if( pRoot == pDepend )
@@ -333,36 +291,41 @@ SwClient *SwModify::_Remove(SwClient * pDepend)
if( pR )
pR->pLeft = pL;
- // alle Client-Iters updaten
+ // update ClientIters
SwClientIter* pTmp = pClientIters;
while( pTmp )
{
- if( pTmp->pAkt == pDepend || pTmp->pDelNext == pDepend )
+ if( pTmp->pAct == pDepend || pTmp->pDelNext == pDepend )
+ // if object being removed is the current or next object in an iterator, advance this iterator
pTmp->pDelNext = pR;
-
- // Notify SwClientIter if mpWatchClient is removed
- if ( pTmp->mpWatchClient == pDepend )
- pTmp->mpWatchClient = 0;
-
pTmp = pTmp->pNxtIter;
}
pDepend->pLeft = 0;
pDepend->pRight = 0;
}
- else {
- OSL_FAIL( "SwModify::Remove(): pDepend nicht gefunden");
+ else
+ {
+ OSL_FAIL( "SwModify::Remove(): pDepend nicht gefunden" );
}
+
+ // disconnect client from me
pDepend->pRegisteredIn = 0;
return pDepend;
}
-
-/*************************************************************************
-|* SwModify::CheckCaching( const sal_uInt16 nWhich )
-*************************************************************************/
-
-
+int SwModify::GetClientCount() const
+{
+ int nRet=0;
+ SwClientIter aIter( *this );
+ SwClient *pLast = aIter.GoStart();
+ if( pLast )
+ do
+ {
+ ++nRet;
+ } while( 0 != ( pLast = aIter++ ));
+ return nRet;
+}
void SwModify::CheckCaching( const sal_uInt16 nWhich )
{
@@ -394,17 +357,33 @@ void SwModify::CheckCaching( const sal_uInt16 nWhich )
}
}
+void SwModify::CallSwClientNotify( const SfxHint& rHint ) const
+{
+ SwClientIter aIter(*this);
+ SwClient * pClient = aIter.GoStart();
+ while (pClient)
+ {
+ pClient->SwClientNotify( *this, rHint );
+ pClient = aIter++;
+ }
+}
+
+void SwModify::ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType )
+{
+ SwClientIter aIter(*this);
+ SwClient * pClient = aIter.First( nType );
+ while (pClient)
+ {
+ pClient->Modify( pOldValue, pNewValue );
+ pClient = aIter.Next();
+ }
+}
// ----------
// SwDepend
// ----------
-/*************************************************************************
-|* SwDepend::SwDepend(SwClient *pTellHim,SwModify *pDepend)
-|*
-|* Beschreibung callback.doc V1.14
-*************************************************************************/
-
+/*************************************************************************/
SwDepend::SwDepend(SwClient *pTellHim, SwModify *pDepend)
: SwClient(pDepend)
@@ -412,25 +391,22 @@ SwDepend::SwDepend(SwClient *pTellHim, SwModify *pDepend)
pToTell = pTellHim;
}
-/*************************************************************************
-|*
-|* SwDepend::Modify(SwHint *, SwHint *)
-|*
-|* Beschreibung callback.doc V1.14
-|*
-*************************************************************************/
-
+/*************************************************************************/
-void SwDepend::Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue )
+void SwDepend::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem *pNewValue )
{
if(pNewValue && pNewValue->Which() == RES_OBJECTDYING)
- SwClient::Modify(pOldValue,pNewValue);
+ CheckRegistration(pOldValue,pNewValue);
else if(pToTell)
- pToTell->Modify(pOldValue, pNewValue);
+ pToTell->ModifyNotification(pOldValue, pNewValue);
}
+void SwDepend::SwClientNotify( const SwModify& rMod, const SfxHint& rHint )
+{
+ if ( pToTell )
+ pToTell->SwClientNotifyCall( rMod, rHint );
+}
- // erfrage vom Modify Informationen
sal_Bool SwDepend::GetInfo( SfxPoolItem& rInfo ) const
{
return pToTell ? pToTell->GetInfo( rInfo ) : sal_True;
@@ -438,14 +414,13 @@ sal_Bool SwDepend::GetInfo( SfxPoolItem& rInfo ) const
/********************************************************************/
-
-SwClientIter::SwClientIter( SwModify const& rModify )
+SwClientIter::SwClientIter( const SwModify& rModify )
: rRoot( rModify )
{
- // hinten einketten!
pNxtIter = 0;
if( pClientIters )
{
+ // append to list of ClientIters
SwClientIter* pTmp = pClientIters;
while( pTmp->pNxtIter )
pTmp = pTmp->pNxtIter;
@@ -454,9 +429,8 @@ SwClientIter::SwClientIter( SwModify const& rModify )
else
pClientIters = this;
- pAkt = rRoot.pRoot;
- pDelNext = pAkt;
- mpWatchClient = 0;
+ pAct = const_cast<SwClient*>(rRoot.GetDepends());
+ pDelNext = pAct;
}
@@ -465,6 +439,7 @@ SwClientIter::~SwClientIter()
{
if( pClientIters )
{
+ // reorganize list of ClientIters
if( pClientIters == this )
pClientIters = pNxtIter;
else
@@ -482,126 +457,111 @@ SwClientIter::~SwClientIter()
}
- // Postfix Operator
SwClient* SwClientIter::operator++(int)
{
- if( pDelNext == pAkt )
- {
- pAkt = pAkt->pRight;
- pDelNext = pAkt;
- }
- else
- pAkt = pDelNext;
- return pAkt;
-}
-
-
- // Prefix Operator
-SwClient* SwClientIter::operator++()
-{
- if( pDelNext == pAkt )
+ if( pDelNext == pAct )
{
- pAkt = pAkt->pRight;
- pDelNext = pAkt;
+ pAct = pAct->pRight;
+ pDelNext = pAct;
}
else
- pAkt = pDelNext;
- return pAkt;
+ pAct = pDelNext;
+ return pAct;
}
-
- // Postfix Operator
-SwClient* SwClientIter::operator--(int)
+SwClient* SwClientIter::GoStart()
{
-// solange der CFRONT Prefix und PostFix nicht unterscheiden kann, immer
-// als Prefix-Operator arbeiten. Wenn der CFRONT es kann, muss auch der
-// Code entsprechen umgestellt werden !!!
- if( pDelNext == pAkt )
- pAkt = pAkt->pLeft;
- else
- pAkt = pDelNext->pLeft;
- pDelNext = pAkt;
- return pAkt;
+ pAct = const_cast<SwClient*>(rRoot.GetDepends());
+ if( pAct )
+ while( pAct->pLeft )
+ pAct = pAct->pLeft;
+ pDelNext = pAct;
+ return pAct;
}
-
- // Prefix Operator
-SwClient* SwClientIter::operator--()
+SwClient* SwClientIter::GoEnd()
{
- if( pDelNext == pAkt )
- pAkt = pAkt->pLeft;
- else
- pAkt = pDelNext->pLeft;
- pDelNext = pAkt;
- return pAkt;
+ pAct = pDelNext;
+ if( !pAct )
+ pAct = const_cast<SwClient*>(rRoot.GetDepends());
+ if( pAct )
+ while( pAct->pRight )
+ pAct = pAct->pRight;
+ pDelNext = pAct;
+ return pAct;
}
-
-SwClient* SwClientIter::GoStart() // zum Anfang des Baums
-{
- pAkt = rRoot.pRoot;
- if( pAkt )
- while( pAkt->pLeft )
- pAkt = pAkt->pLeft;
- pDelNext = pAkt;
- return pAkt;
-}
-
-
-SwClient* SwClientIter::GoEnd() // zum End des Baums
-{
- pAkt = pDelNext;
- if( !pAkt )
- pAkt = rRoot.pRoot;
- if( pAkt )
- while( pAkt->pRight )
- pAkt = pAkt->pRight;
- pDelNext = pAkt;
- return pAkt;
-}
-
-
-
SwClient* SwClientIter::First( TypeId nType )
{
aSrchId = nType;
GoStart();
- if( pAkt )
+ if( pAct )
do {
- if( pAkt->IsA( aSrchId ) )
+ if( pAct->IsA( aSrchId ) )
break;
- if( pDelNext == pAkt )
+ if( pDelNext == pAct )
{
- pAkt = pAkt->pRight;
- pDelNext = pAkt;
+ pAct = pAct->pRight;
+ pDelNext = pAct;
}
else
- pAkt = pDelNext;
+ pAct = pDelNext;
- } while( pAkt );
- return pAkt;
+ } while( pAct );
+ return pAct;
}
-
SwClient* SwClientIter::Next()
{
do {
- // erstmal zum naechsten
- if( pDelNext == pAkt )
+ if( pDelNext == pAct )
{
- pAkt = pAkt->pRight;
- pDelNext = pAkt;
+ pAct = pAct->pRight;
+ pDelNext = pAct;
}
else
- pAkt = pDelNext;
+ pAct = pDelNext;
- if( pAkt && pAkt->IsA( aSrchId ) )
+ if( pAct && pAct->IsA( aSrchId ) )
break;
- } while( pAkt );
- return pAkt;
+ } while( pAct );
+ return pAct;
}
+SwClient* SwClientIter::Last( TypeId nType )
+{
+ aSrchId = nType;
+ GoEnd();
+ if( pAct )
+ do {
+ if( pAct->IsA( aSrchId ) )
+ break;
+
+ if( pDelNext == pAct )
+ pAct = pAct->pLeft;
+ else
+ pAct = pDelNext->pLeft;
+ pDelNext = pAct;
+
+ } while( pAct );
+ return pAct;
+}
+
+SwClient* SwClientIter::Previous()
+{
+ do {
+ if( pDelNext == pAct )
+ pAct = pAct->pLeft;
+ else
+ pAct = pDelNext->pLeft;
+ pDelNext = pAct;
+
+ if( pAct && pAct->IsA( aSrchId ) )
+ break;
+ } while( pAct );
+ return pAct;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx
index aae83558ca47..abd2dfd887d1 100644
--- a/sw/source/core/attr/cellatr.cxx
+++ b/sw/source/core/attr/cellatr.cxx
@@ -30,9 +30,7 @@
#include "precompiled_sw.hxx"
#include <float.h>
-
#include <rtl/math.hxx>
-
#include <hintids.hxx> // fuer RES_..
#include <cellatr.hxx>
#include <calc.hxx>
@@ -42,7 +40,7 @@
#include <node.hxx>
#include <hints.hxx>
#include <rolbck.hxx>
-
+#include <switerator.hxx>
//TYPEINIT1( SwFmt, SwClient ); //rtti fuer SwFmt
@@ -113,9 +111,9 @@ const SwNode* SwTblBoxFormula::GetNodeOfFormula() const
const SwNode* pRet = 0;
if( pDefinedIn )
{
- SwClient* pBox = SwClientIter( *pDefinedIn ).First( TYPE( SwTableBox ));
+ SwTableBox* pBox = SwIterator<SwTableBox,SwModify>::FirstElement( *pDefinedIn );
if( pBox )
- pRet = ((SwTableBox*)pBox)->GetSttNd();
+ pRet = pBox->GetSttNd();
}
return pRet;
}
@@ -125,8 +123,7 @@ SwTableBox* SwTblBoxFormula::GetTableBox()
{
SwTableBox* pBox = 0;
if( pDefinedIn )
- pBox = (SwTableBox*)SwClientIter( *pDefinedIn ).
- First( TYPE( SwTableBox ));
+ pBox = SwIterator<SwTableBox,SwModify>::FirstElement( *pDefinedIn );
return pBox;
}
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index d4b217e49d11..d15daee10f9a 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -139,16 +139,16 @@ SwFmt &SwFmt::operator=(const SwFmt& rFmt)
{
SwAttrSetChg aChgOld( aSet, aOld );
SwAttrSetChg aChgNew( aSet, aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
- if( pRegisteredIn != rFmt.pRegisteredIn )
+ if( GetRegisteredIn() != rFmt.GetRegisteredIn() )
{
- if( pRegisteredIn )
- pRegisteredIn->Remove(this);
- if(rFmt.pRegisteredIn)
+ if( GetRegisteredIn() )
+ GetRegisteredInNonConst()->Remove(this);
+ if(rFmt.GetRegisteredIn())
{
- rFmt.pRegisteredIn->Add(this);
+ const_cast<SwFmt&>(rFmt).GetRegisteredInNonConst()->Add(this);
aSet.SetParent( &rFmt.aSet );
}
else
@@ -167,7 +167,7 @@ void SwFmt::SetName( const String& rNewName, sal_Bool bBroadcast )
SwStringMsgPoolItem aOld( RES_NAME_CHANGED, aFmtName );
SwStringMsgPoolItem aNew( RES_NAME_CHANGED, rNewName );
aFmtName = rNewName;
- Modify( &aOld, &aNew );
+ ModifyNotification( &aOld, &aNew );
}
else
{
@@ -226,7 +226,7 @@ void SwFmt::CopyAttrs( const SwFmt& rFmt, sal_Bool bReplace )
SwAttrSetChg aChgOld( aSet, aOld );
SwAttrSetChg aChgNew( aSet, aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
}
@@ -264,7 +264,7 @@ SwFmt::~SwFmt()
SwFmtChg aNewFmt(pParentFmt);
SwClient * pDepend = (SwClient*)GetDepends();
pParentFmt->Add(pDepend);
- pDepend->Modify(&aOldFmt, &aNewFmt);
+ pDepend->ModifyNotification(&aOldFmt, &aNewFmt);
}
}
}
@@ -272,13 +272,13 @@ SwFmt::~SwFmt()
/*************************************************************************
-|* void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
+|* void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
|*
|* Beschreibung Dokument 1.14
*************************************************************************/
-void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
+void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
{
sal_Bool bWeiter = sal_True; // sal_True = Propagierung an die Abhaengigen
@@ -295,9 +295,9 @@ void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
SwFmt * pFmt = (SwFmt *) ((SwPtrMsgPoolItem *)pNewValue)->pObject;
// nicht umhaengen wenn dieses das oberste Format ist !!
- if( pRegisteredIn && pRegisteredIn == pFmt )
+ if( GetRegisteredIn() && GetRegisteredIn() == pFmt )
{
- if( pFmt->pRegisteredIn )
+ if( pFmt->GetRegisteredIn() )
{
// wenn Parent, dann im neuen Parent wieder anmelden
pFmt->DerivedFrom()->Add( this );
@@ -325,7 +325,7 @@ void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
if( aNew.Count() )
// keine mehr gesetzt, dann Ende !!
- SwModify::Modify( &aOld, &aNew );
+ NotifyClients( &aOld, &aNew );
bWeiter = sal_False;
}
break;
@@ -346,12 +346,12 @@ void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
{
// IsWritten-Flag zuruecksetzen. Hint nur an abhanegige
// Formate (und keine Frames) propagieren.
+ // mba: the code does the opposite from what is written in the comment!
ResetWritten();
- SwClientIter aIter( *this );
- for( SwClient *pClient = aIter.First( TYPE(SwFmt) ); pClient;
- pClient = aIter.Next() )
- pClient->Modify( pOldValue, pNewValue );
-
+ // mba: here we don't use the additional stuff from NotifyClients().
+ // should we?!
+ // mba: move the code that ignores this event to the clients
+ ModifyBroadcast( pOldValue, pNewValue, TYPE(SwFmt) );
bWeiter = sal_False;
}
break;
@@ -376,7 +376,7 @@ void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
if( bWeiter )
{
// laufe durch alle abhaengigen Formate
- SwModify::Modify( pOldValue, pNewValue );
+ NotifyClients( pOldValue, pNewValue );
}
}
@@ -424,7 +424,7 @@ sal_Bool SwFmt::SetDerivedFrom(SwFmt *pDerFrom)
SwFmtChg aOldFmt(this);
SwFmtChg aNewFmt(this);
- Modify( &aOldFmt, &aNewFmt );
+ ModifyNotification( &aOldFmt, &aNewFmt );
return sal_True;
}
@@ -468,7 +468,7 @@ sal_Bool SwFmt::SetFmtAttr(const SfxPoolItem& rAttr )
SwAttrSetChg aChgOld( aSet, aOld );
SwAttrSetChg aChgNew( aSet, aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
}
return bRet;
@@ -515,7 +515,7 @@ sal_Bool SwFmt::SetFmtAttr( const SfxItemSet& rSet )
aSet.SetModifyAtAttr( this );
SwAttrSetChg aChgOld( aSet, aOld );
SwAttrSetChg aChgNew( aSet, aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
}
return bRet;
@@ -552,7 +552,7 @@ sal_Bool SwFmt::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
{
SwAttrSetChg aChgOld( aSet, aOld );
SwAttrSetChg aChgNew( aSet, aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
return bRet;
}
@@ -585,7 +585,7 @@ sal_uInt16 SwFmt::ResetAllFmtAttr()
{
SwAttrSetChg aChgOld( aSet, aOld );
SwAttrSetChg aChgNew( aSet, aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
return aNew.Count();
}
@@ -630,7 +630,7 @@ void SwFmt::DelDiffs( const SfxItemSet& rSet )
{
SwAttrSetChg aChgOld( aSet, aOld );
SwAttrSetChg aChgNew( aSet, aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
}
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index fa3cf8761bc0..30039539de96 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -167,9 +167,9 @@ namespace sw { namespace mark
}
- void MarkBase::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+ void MarkBase::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew )
{
- SwModify::Modify(pOld, pNew);
+ NotifyClients(pOld, pNew);
if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which()))
{ // invalidate cached uno object
SetXBookmark(uno::Reference<text::XTextContent>(0));
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 7a496a422298..56b1f6ce6785 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -73,7 +73,7 @@ SwCallLink::SwCallLink( SwCrsrShell & rSh )
bHasSelection = ( *pCrsr->GetPoint() != *pCrsr->GetMark() );
if( ND_TEXTNODE & nNdTyp )
- nLeftFrmPos = SwCallLink::GetFrm( (SwTxtNode&)rNd, nCntnt,
+ nLeftFrmPos = SwCallLink::getLayoutFrm( rShell.GetLayout(), (SwTxtNode&)rNd, nCntnt,
!rShell.ActionPend() );
else
{
@@ -102,7 +102,7 @@ SwCallLink::~SwCallLink()
if( !pCNd )
return;
- SwFrm *myFrm=pCNd->GetFrm();
+ SwFrm *myFrm = pCNd->getLayoutFrm( rShell.GetLayout() );
if (myFrm!=NULL)
{
// We need to emulated a change of the row height in order
@@ -112,7 +112,7 @@ SwCallLink::~SwCallLink()
{
const SwTableLine* pLine = pRow->GetTabLine( );
SwFmtFrmSize pSize = pLine->GetFrmFmt( )->GetFrmSize( );
- pRow->Modify( NULL, &pSize );
+ pRow->ModifyNotification( NULL, &pSize );
}
}
@@ -124,7 +124,7 @@ SwCallLink::~SwCallLink()
}
if ( pNode != NULL )
{
- SwFrm *myFrm2=pNode->GetFrm();
+ SwFrm *myFrm2 = pNode->getLayoutFrm( rShell.GetLayout() );
if (myFrm2!=NULL)
{
// We need to emulated a change of the row height in order
@@ -134,7 +134,7 @@ SwCallLink::~SwCallLink()
{
const SwTableLine* pLine = pRow->GetTabLine( );
SwFmtFrmSize pSize = pLine->GetFrmFmt( )->GetFrmSize( );
- pRow->Modify( NULL, &pSize );
+ pRow->ModifyNotification( NULL, &pSize );
}
}
}
@@ -165,7 +165,7 @@ SwCallLink::~SwCallLink()
{
// If travelling with left/right only and the frame is
// unchanged (columns!) then check text hints.
- if( nLeftFrmPos == SwCallLink::GetFrm( (SwTxtNode&)*pCNd, nAktCntnt,
+ if( nLeftFrmPos == SwCallLink::getLayoutFrm( rShell.GetLayout(), (SwTxtNode&)*pCNd, nAktCntnt,
!rShell.ActionPend() ) &&
(( nCmp = nCntnt ) + 1 == nAktCntnt || // Right
nCntnt -1 == ( nCmp = nAktCntnt )) ) // Left
@@ -230,7 +230,7 @@ SwCallLink::~SwCallLink()
const SwFrm* pFrm;
const SwFlyFrm *pFlyFrm;
- if( !rShell.ActionPend() && 0 != ( pFrm = pCNd->GetFrm(0,0,sal_False) ) &&
+ if( !rShell.ActionPend() && 0 != ( pFrm = pCNd->getLayoutFrm(rShell.GetLayout(),0,0,sal_False) ) &&
0 != ( pFlyFrm = pFrm->FindFlyFrm() ) && !rShell.IsTableMode() )
{
const SwNodeIndex* pIndex = pFlyFrm->GetFmt()->GetCntnt().GetCntntIdx();
@@ -247,9 +247,9 @@ SwCallLink::~SwCallLink()
}
}
-long SwCallLink::GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm )
+long SwCallLink::getLayoutFrm( const SwRootFrm* pRoot, SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm )
{
- SwTxtFrm* pFrm = (SwTxtFrm*)rNd.GetFrm(0,0,bCalcFrm), *pNext = pFrm;
+ SwTxtFrm* pFrm = (SwTxtFrm*)rNd.getLayoutFrm(pRoot,0,0,bCalcFrm), *pNext = pFrm;
if ( pFrm && !pFrm->IsHiddenNow() )
{
if( pFrm->HasFollow() )
diff --git a/sw/source/core/crsr/callnk.hxx b/sw/source/core/crsr/callnk.hxx
index b710b5db96c3..56aade636601 100644
--- a/sw/source/core/crsr/callnk.hxx
+++ b/sw/source/core/crsr/callnk.hxx
@@ -32,6 +32,7 @@
class SwCrsrShell;
class SwTxtNode;
+class SwRootFrm;
class SwCallLink
{
@@ -49,7 +50,7 @@ public:
bool bAktSelection );
~SwCallLink();
- static long GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm );
+ static long getLayoutFrm( const SwRootFrm*, SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm );
};
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 7ec342cfd3bc..a91ccd2ee847 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -200,8 +200,8 @@ SwPaM* SwCrsrShell::GetCrsr( sal_Bool bMakeTblCrsr ) const
const SwCntntNode* pCNd;
if( pTblCrsr->GetPoint()->nNode.GetIndex() &&
pTblCrsr->GetMark()->nNode.GetIndex() &&
- 0 != ( pCNd = pTblCrsr->GetCntntNode() ) && pCNd->GetFrm() &&
- 0 != ( pCNd = pTblCrsr->GetCntntNode(sal_False) ) && pCNd->GetFrm())
+ 0 != ( pCNd = pTblCrsr->GetCntntNode() ) && pCNd->getLayoutFrm( GetLayout() ) &&
+ 0 != ( pCNd = pTblCrsr->GetCntntNode(sal_False) ) && pCNd->getLayoutFrm( GetLayout() ) )
{
SwShellTableCrsr* pTC = (SwShellTableCrsr*)pTblCrsr;
GetLayout()->MakeTblCrsrs( *pTC );
@@ -229,7 +229,7 @@ void SwCrsrShell::StartAction()
nAktNdTyp = rNd.GetNodeType();
bAktSelection = *pCurCrsr->GetPoint() != *pCurCrsr->GetMark();
if( ND_TEXTNODE & nAktNdTyp )
- nLeftFrmPos = SwCallLink::GetFrm( (SwTxtNode&)rNd, nAktCntnt, sal_True );
+ nLeftFrmPos = SwCallLink::getLayoutFrm( GetLayout(), (SwTxtNode&)rNd, nAktCntnt, sal_True );
else
nLeftFrmPos = 0;
}
@@ -296,6 +296,7 @@ void SwCrsrShell::EndAction( const sal_Bool bIdleEnd )
sal_uInt16 nParm = SwCrsrShell::CHKRANGE;
if ( !bIdleEnd )
nParm |= SwCrsrShell::SCROLLWIN;
+// if( !IsViewLocked() )
UpdateCrsr( nParm, bIdleEnd ); // Cursor-Aenderungen anzeigen
{
@@ -568,7 +569,7 @@ sal_Bool SwCrsrShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage )
SwCrsrSaveState aSaveState( *pCurCrsr );
Point& rPt = pCurCrsr->GetPtPos();
SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->
- GetFrm( &rPt, pCurCrsr->GetPoint() );
+ getLayoutFrm( GetLayout(), &rPt, pCurCrsr->GetPoint(), sal_False );
if( pFrm && sal_True == ( bRet = GetFrmInPage( pFrm, fnWhichPage,
fnPosPage, pCurCrsr ) ) &&
!pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
@@ -614,7 +615,7 @@ SwFrm* lcl_IsInHeaderFooter( const SwNodeIndex& rIdx, Point& rPt )
SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode();
if( pCNd )
{
- pFrm = pCNd->GetFrm( &rPt, 0, sal_False )->GetUpper();
+ pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &rPt, 0, sal_False )->GetUpper();
while( pFrm && !pFrm->IsHeaderFrm() && !pFrm->IsFooterFrm() )
pFrm = pFrm->IsFlyFrm() ? ((SwFlyFrm*)pFrm)->AnchorFrm()
: pFrm->GetUpper();
@@ -700,10 +701,10 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock )
else if( aPos.nNode.GetNode().IsCntntNode() )
{
// im gleichen Frame gelandet?
- SwFrm* pOld = ((SwCntntNode&)aPos.nNode.GetNode()).GetFrm(
- &aCharRect.Pos(), 0, sal_False );
- SwFrm* pNew = ((SwCntntNode&)aPos.nNode.GetNode()).GetFrm(
- &aPt, 0, sal_False );
+ SwFrm* pOld = ((SwCntntNode&)aPos.nNode.GetNode()).getLayoutFrm(
+ GetLayout(), &aCharRect.Pos(), 0, sal_False );
+ SwFrm* pNew = ((SwCntntNode&)aPos.nNode.GetNode()).getLayoutFrm(
+ GetLayout(), &aPt, 0, sal_False );
if( pNew == pOld )
return bRet;
}
@@ -1226,7 +1227,7 @@ void SwCrsrShell::UpdateCrsrPos()
Size aOldSz( GetDocSize() );
SwCntntNode *pCNode = pShellCrsr->GetCntntNode();
SwCntntFrm *pFrm = pCNode ?
- pCNode->GetFrm( &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint() ) :0;
+ pCNode->getLayoutFrm( GetLayout(), &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), sal_False ) :0;
if( !pFrm || (pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsHiddenNow()) )
{
SwCrsrMoveState aTmpState( MV_NONE );
@@ -1359,7 +1360,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
}
SwCntntFrm *pTblFrm = pPos->nNode.GetNode().GetCntntNode()->
- GetFrm( &aTmpPt, pPos );
+ getLayoutFrm( GetLayout(), &aTmpPt, pPos, sal_False );
OSL_ENSURE( pTblFrm, "Tabelle Crsr nicht im Content ??" );
@@ -1376,7 +1377,8 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
// Second check if mark is in repeated headline:
if ( !bInRepeatedHeadline )
{
- SwCntntFrm* pMarkTblFrm = pITmpCrsr->GetCntntNode( sal_False )->GetFrm( &aTmpMk, pITmpCrsr->GetMark() );
+ SwCntntFrm* pMarkTblFrm = pITmpCrsr->GetCntntNode( sal_False )->
+ getLayoutFrm( GetLayout(), &aTmpMk, pITmpCrsr->GetMark(), sal_False );
OSL_ENSURE( pMarkTblFrm, "Tabelle Crsr nicht im Content ??" );
if ( pMarkTblFrm )
@@ -1587,8 +1589,8 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
sal_Bool bAgainst;
do {
bAgainst = sal_False;
- pFrm = pShellCrsr->GetCntntNode()->GetFrm(
- &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint() );
+ pFrm = pShellCrsr->GetCntntNode()->getLayoutFrm( GetLayout(),
+ &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), sal_False );
// ist der Frm nicht mehr vorhanden, dann muss das gesamte Layout
// erzeugt werden, weil ja mal hier einer vorhanden war !!
if ( !pFrm )
@@ -1596,8 +1598,8 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
do
{
CalcLayout();
- pFrm = pShellCrsr->GetCntntNode()->GetFrm(
- &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint() );
+ pFrm = pShellCrsr->GetCntntNode()->getLayoutFrm( GetLayout(),
+ &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), sal_False );
} while( !pFrm );
}
else if ( Imp()->IsIdleAction() )
@@ -1782,7 +1784,7 @@ void SwCrsrShell::RefreshBlockCursor()
OSL_ENSURE( pBlockCrsr, "Don't call me without a block cursor" );
SwShellCrsr &rBlock = pBlockCrsr->getShellCrsr();
Point aPt = rBlock.GetPtPos();
- SwCntntFrm* pFrm = rBlock.GetCntntNode()->GetFrm( &aPt, rBlock.GetPoint() );
+ SwCntntFrm* pFrm = rBlock.GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, rBlock.GetPoint(), sal_False );
Point aMk;
if( pBlockCrsr->getEndPoint() && pBlockCrsr->getStartPoint() )
{
@@ -2100,13 +2102,13 @@ SwCntntFrm *SwCrsrShell::GetCurrFrm( const sal_Bool bCalcFrm ) const
const sal_uInt16* pST = &nStartAction;
++(*((sal_uInt16*)pST));
const Size aOldSz( GetDocSize() );
- pRet = pNd->GetFrm( &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint() );
+ pRet = pNd->getLayoutFrm( GetLayout(), &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint() );
--(*((sal_uInt16*)pST));
if( aOldSz != GetDocSize() )
((SwCrsrShell*)this)->SizeChgNotify();
}
else
- pRet = pNd->GetFrm( &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint(), sal_False);
+ pRet = pNd->getLayoutFrm( GetLayout(), &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint(), sal_False);
}
return pRet;
}
@@ -2116,7 +2118,7 @@ SwCntntFrm *SwCrsrShell::GetCurrFrm( const sal_Bool bCalcFrm ) const
// Link weitergeleitet.
-void SwCrsrShell::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwCrsrShell::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
const sal_uInt16 nWhich = pOld ?
pOld->Which() :
@@ -2286,7 +2288,7 @@ sal_Bool SwCrsrShell::SetVisCrsr( const Point &rPt )
pSectNd->GetSection().IsProtectFlag())) )
return sal_False;
- SwCntntFrm *pFrm = pTxtNd->GetFrm( &aPt, &aPos );
+ SwCntntFrm *pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt, &aPos );
if ( Imp()->IsIdleAction() )
pFrm->PrepareCrsr();
SwRect aTmp( aCharRect );
@@ -2627,7 +2629,7 @@ SwCrsrShell::~SwCrsrShell()
// der CursorShell haengt keine Chance geben, sich an den
// TextNode zu haengen.
if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
}
SwShellCrsr* SwCrsrShell::getShellCrsr( bool bBlock )
@@ -2724,7 +2726,7 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText )
SwCntntNode* pCNd = rNdIdx.GetNode().GetCntntNode();
const SwCntntFrm * pFrm;
- if( pCNd && 0 != (pFrm = pCNd->GetFrm(0,pCurCrsr->GetPoint(),sal_False)) &&
+ if( pCNd && 0 != (pFrm = pCNd->getLayoutFrm( GetLayout(),0,pCurCrsr->GetPoint(),sal_False)) &&
!IsReadOnlyAvailable() && pFrm->IsProtected() &&
nNdIdx < rNds.GetEndOfExtras().GetIndex() )
{
@@ -2840,7 +2842,7 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText )
if( bOk && rNdIdx.GetIndex() < rNds.GetEndOfExtras().GetIndex() )
{
// Teste mal auf Fly - kann auch noch geschuetzt sein!!
- if( 0 == (pFrm = pCNd->GetFrm(0,0,sal_False)) ||
+ if( 0 == (pFrm = pCNd->getLayoutFrm( GetLayout(),0,0,sal_False)) ||
( !IsReadOnlyAvailable() && pFrm->IsProtected() ) ||
( bOnlyText && pCNd->IsNoTxtNode() ) )
{
@@ -2871,7 +2873,7 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText )
// falls Cursor im versteckten Bereich ist, auf jedenfall schon mal
// verschieben!!
- if( !pCNd || !pCNd->GetFrm(0,0,sal_False) )
+ if( !pCNd || !pCNd->getLayoutFrm( GetLayout(),0,0,sal_False) )
{
SwCrsrMoveState aTmpState( MV_NONE );
aTmpState.bSetInReadOnly = IsReadOnlyAvailable();
@@ -3422,7 +3424,7 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect,
SwCrsrMoveState aState;
aState.bRealWidth = sal_True;
SwCntntNode* pCntntNode = pCrsr->GetCntntNode();
- SwCntntFrm *pCntntFrame = pCntntNode->GetFrm( &rPt, pCrsr->GetPoint(), sal_False);
+ SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), &rPt, pCrsr->GetPoint(), sal_False);
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
rContent = nWordEnd - 1;
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 610b3f988a3a..712670302367 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -73,7 +73,7 @@
#include <fmturl.hxx>
#include "txtfrm.hxx"
#include <wrong.hxx>
-
+#include <switerator.hxx>
#include <vcl/window.hxx>
#include <docufld.hxx>
@@ -94,7 +94,7 @@ sal_Bool SwCrsrShell::GotoNextNum()
// dann versuche den Cursor auf die Position zu setzen,
// auf halber Heohe vom Char-SRectangle
Point aPt( pCurCrsr->GetPtPos() );
- SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->GetFrm( &aPt,
+ SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), &aPt,
pCurCrsr->GetPoint() );
pFrm->GetCharRect( aCharRect, *pCurCrsr->GetPoint() );
pFrm->Calc();
@@ -134,7 +134,7 @@ sal_Bool SwCrsrShell::GotoPrevNum()
// dann versuche den Cursor auf die Position zu setzen,
// auf halber Heohe vom Char-SRectangle
Point aPt( pCurCrsr->GetPtPos() );
- SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->GetFrm( &aPt,
+ SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), &aPt,
pCurCrsr->GetPoint() );
pFrm->GetCharRect( aCharRect, *pCurCrsr->GetPoint() );
pFrm->Calc();
@@ -278,7 +278,7 @@ sal_Bool SwCrsrShell::SetCrsrInHdFt( sal_uInt16 nDescNo, sal_Bool bInHeader )
const SwFrm* pFrm;
Point aPt( pCurCrsr->GetPtPos() );
- if( pCNd && 0 != ( pFrm = pCNd->GetFrm( &aPt, 0, sal_False ) ))
+ if( pCNd && 0 != ( pFrm = pCNd->getLayoutFrm( GetLayout(), &aPt, 0, sal_False ) ))
{
// dann kann der Cursor ja auch hinein gesetzt werden
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
@@ -326,7 +326,7 @@ sal_Bool SwCrsrShell::GotoNextTOXBase( const String* pName )
const SwCntntFrm* pCFrm;
if( pCNd &&
pCNd->EndOfSectionIndex() <= pSectNd->EndOfSectionIndex() &&
- 0 != ( pCFrm = pCNd->GetFrm() ) &&
+ 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout() ) ) &&
( IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
{
pFnd = pCNd;
@@ -373,7 +373,7 @@ sal_Bool SwCrsrShell::GotoPrevTOXBase( const String* pName )
const SwCntntFrm* pCFrm;
if( pCNd &&
pCNd->EndOfSectionIndex() <= pSectNd->EndOfSectionIndex() &&
- 0 != ( pCFrm = pCNd->GetFrm() ) &&
+ 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout() ) ) &&
( IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
{
pFnd = pCNd;
@@ -407,14 +407,13 @@ sal_Bool SwCrsrShell::GotoTOXMarkBase()
// dann nehme den 1. und hole den Verzeichnis-Typ.
// Suche in seiner Abhaengigkeitsliste nach dem eigentlichem
// Verzeichnis
- SwModify* pType = (SwModify*)aMarks[0]->GetRegisteredIn();
- SwClientIter aIter( *pType );
+ const SwTOXType* pType = aMarks[0]->GetTOXType();
+ SwIterator<SwTOXBase,SwTOXType> aIter( *pType );
const SwSectionNode* pSectNd;
const SwSectionFmt* pSectFmt;
- for( SwTOXBase* pTOX =
- (SwTOXBase*)aIter.First( TYPE( SwTOXBase ));
- pTOX; pTOX = (SwTOXBase*)aIter.Next() )
+ for( SwTOXBase* pTOX = aIter.First(); pTOX; pTOX = aIter.Next() )
+ {
if( pTOX->ISA( SwTOXBaseSection ) &&
0 != ( pSectFmt = ((SwTOXBaseSection*)pTOX)->GetFmt() ) &&
0 != ( pSectNd = pSectFmt->GetSectionNode() ))
@@ -426,7 +425,7 @@ sal_Bool SwCrsrShell::GotoTOXMarkBase()
const SwCntntFrm* pCFrm;
if( pCNd &&
pCNd->EndOfSectionIndex() < pSectNd->EndOfSectionIndex() &&
- 0 != ( pCFrm = pCNd->GetFrm() ) &&
+ 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout() ) ) &&
( IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
@@ -441,6 +440,7 @@ sal_Bool SwCrsrShell::GotoTOXMarkBase()
}
}
}
+ }
return bRet;
}
@@ -474,9 +474,8 @@ sal_Bool SwCrsrShell::GotoNxtPrvTblFormula( sal_Bool bNext, sal_Bool bOnlyErrors
if( rPos.nNode < GetDoc()->GetNodes().GetEndOfExtras() )
// auch beim Einsammeln wird nur der erste Frame benutzt!
- aCurGEF.SetBodyPos( *rPos.nNode.GetNode().GetCntntNode()->GetFrm(
+ aCurGEF.SetBodyPos( *rPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(),
&aPt, &rPos, sal_False ) );
-
{
const SfxPoolItem* pItem;
const SwTableBox* pTBox;
@@ -494,7 +493,7 @@ sal_Bool SwCrsrShell::GotoNxtPrvTblFormula( sal_Bool bNext, sal_Bool bOnlyErrors
const SwCntntFrm* pCFrm;
SwNodeIndex aIdx( *pTBox->GetSttNd() );
const SwCntntNode* pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
- if( pCNd && 0 != ( pCFrm = pCNd->GetFrm( &aPt, 0, sal_False ) ) &&
+ if( pCNd && 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout(), &aPt, 0, sal_False ) ) &&
(IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
{
_SetGetExpFld aCmp( *pTBox );
@@ -545,8 +544,7 @@ sal_Bool SwCrsrShell::GotoNxtPrvTOXMark( sal_Bool bNext )
if( rPos.nNode.GetIndex() < GetDoc()->GetNodes().GetEndOfExtras().GetIndex() )
// auch beim Einsammeln wird nur der erste Frame benutzt!
aCurGEF.SetBodyPos( *rPos.nNode.GetNode().
- GetCntntNode()->GetFrm( &aPt, &rPos, sal_False ) );
-
+ GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, &rPos, sal_False ) );
{
const SfxPoolItem* pItem;
const SwCntntFrm* pCFrm;
@@ -559,7 +557,7 @@ sal_Bool SwCrsrShell::GotoNxtPrvTOXMark( sal_Bool bNext )
RES_TXTATR_TOXMARK, n ) ) &&
0 != (pTxtTOX = ((SwTOXMark*)pItem)->GetTxtTOXMark() ) &&
( pTxtNd = &pTxtTOX->GetTxtNode())->GetNodes().IsDocNodes() &&
- 0 != ( pCFrm = pTxtNd->GetFrm( &aPt, 0, sal_False )) &&
+ 0 != ( pCFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt, 0, sal_False )) &&
( IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
{
SwNodeIndex aNdIndex( *pTxtNd ); // UNIX benoetigt dieses Obj.
@@ -626,18 +624,18 @@ void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType,
// es muss immer der 1. Frame gesucht werden
Point aPt;
SwTxtFld* pTxtFld;
- SwClientIter aIter( (SwFieldType&)rFldType );
- sal_Bool bSubType = nSubType != USHRT_MAX;
- for( SwClient* pLast = aIter.First( TYPE( SwFmtFld )); pLast; pLast = aIter.Next() )
- if( 0 != ( pTxtFld = ((SwFmtFld*)pLast)->GetTxtFld() ) &&
+ SwIterator<SwFmtFld,SwFieldType> aIter(rFldType);
+ bool bSubType = nSubType != USHRT_MAX;
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
+ if( 0 != ( pTxtFld = pFmtFld->GetTxtFld() ) &&
( !bChkInpFlag || ((SwSetExpField*)pTxtFld->GetFld().GetFld())
->GetInputFlag() ) &&
- (!bSubType || (((SwFmtFld*)pLast)->GetFld()->GetSubType()
+ (!bSubType || (pFmtFld->GetFld()->GetSubType()
& 0xff ) == nSubType ))
{
SwCntntFrm* pCFrm;
const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
- if( 0 != ( pCFrm = rTxtNode.GetFrm( &aPt, 0, sal_False )) &&
+ if( 0 != ( pCFrm = rTxtNode.getLayoutFrm( rTxtNode.GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False )) &&
( bInReadOnly || !pCFrm->IsProtected() ))
{
_SetGetExpFld* pNew = new _SetGetExpFld(
@@ -722,7 +720,7 @@ sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
{
// auch beim Einsammeln wird nur der erste Frame benutzt!
Point aPt;
- aSrch.SetBodyPos( *pTNd->GetFrm( &aPt, &rPos, sal_False ) );
+ aSrch.SetBodyPos( *pTNd->getLayoutFrm( GetLayout(), &aPt, &rPos, sal_False ) );
}
sal_Bool bFound = aSrtLst.Seek_Entry( &aSrch, &nPos );
@@ -1097,7 +1095,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
{
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_SMARTTAG;
- if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) )
+ if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
}
}
@@ -1117,7 +1115,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
if( pFld )
{
- if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) )
+ if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
if( bSetCrsr )
@@ -1215,7 +1213,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.pFndTxtAttr = pTxtAttr;
rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
- if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) )
+ if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
}
}
@@ -1283,7 +1281,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.pFndTxtAttr = pTxtAttr;
rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
- if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) )
+ if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
}
}
@@ -1320,7 +1318,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_INETATTR;
rCntntAtPos.pFndTxtAttr = pTxtAttr;
- if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) )
+ if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
}
}
@@ -1336,7 +1334,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.pFndTxtAttr = 0;
bRet = sal_True;
- if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) )
+ if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
}
}
@@ -1367,7 +1365,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
#endif
)
{
- SwFrm* pF = pTxtNd->GetFrm( &aPt );
+ SwFrm* pF = pTxtNd->getLayoutFrm( GetLayout(), &aPt );
if( pF )
{
// dann aber den CellFrame
@@ -1574,9 +1572,10 @@ sal_Bool SwContentAtPos::IsInProtectSect() const
const SwCntntFrm* pFrm;
return pNd && ( pNd->IsInProtectSect() ||
- ( 0 != ( pFrm = pNd->GetFrm(0,0,sal_False)) &&
+ ( 0 != ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), 0,0,sal_False)) &&
pFrm->IsProtected() ));
}
+
bool SwContentAtPos::IsInRTLText()const
{
bool bRet = false;
@@ -1596,20 +1595,16 @@ bool SwContentAtPos::IsInRTLText()const
}
if(pNd)
{
- SwClientIter aClientIter( * const_cast<SwTxtNode*>(pNd) );
- SwClient* pLast = aClientIter.GoStart();
- while( pLast )
+ SwIterator<SwTxtFrm,SwTxtNode> aIter(*pNd);
+ SwTxtFrm* pTmpFrm = aIter.First();
+ while( pTmpFrm )
{
- if ( pLast->ISA( SwTxtFrm ) )
- {
- SwTxtFrm* pTmpFrm = static_cast<SwTxtFrm*>( pLast );
if ( !pTmpFrm->IsFollow())
{
bRet = pTmpFrm->IsRightToLeft();
break;
}
- }
- pLast = ++aClientIter;
+ pTmpFrm = aIter.Next();
}
}
return bRet;
@@ -2083,7 +2078,7 @@ sal_Bool SwCrsrShell::SelectNxtPrvHyperlink( sal_Bool bNext )
{
const SwCntntNode* pCNd = aCurPos.GetNodeFromCntnt()->GetCntntNode();
SwCntntFrm* pFrm;
- if( pCNd && 0 != ( pFrm = pCNd->GetFrm( &aPt )) )
+ if( pCNd && 0 != ( pFrm = pCNd->getLayoutFrm( GetLayout(), &aPt )) )
aCurPos.SetBodyPos( *pFrm );
}
@@ -2093,19 +2088,18 @@ sal_Bool SwCrsrShell::SelectNxtPrvHyperlink( sal_Bool bNext )
const SwCharFmts* pFmts = GetDoc()->GetCharFmts();
for( sal_uInt16 n = pFmts->Count(); 1 < n; )
{
- SwClientIter aIter( *(*pFmts)[ --n ] );
+ SwIterator<SwTxtINetFmt,SwCharFmt> aIter(*(*pFmts)[--n]);
- for( SwClient* pFnd = aIter.First(TYPE( SwTxtINetFmt ));
- pFnd; pFnd = aIter.Next() )
- if( 0 != ( pTxtNd = ((SwTxtINetFmt*)pFnd)->GetpTxtNode()) &&
+ for( SwTxtINetFmt* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
+ if( 0 != ( pTxtNd = pFnd->GetpTxtNode()) &&
pTxtNd->GetNodes().IsDocNodes() )
{
- SwTxtINetFmt& rAttr = *(SwTxtINetFmt*)pFnd;
+ SwTxtINetFmt& rAttr = *pFnd;
SwPosition aTmpPos( *pTxtNd );
_SetGetExpFld aPos( aTmpPos.nNode, rAttr );
SwCntntFrm* pFrm;
if( pTxtNd->GetIndex() < nBodySttNdIdx &&
- 0 != ( pFrm = pTxtNd->GetFrm( &aPt )) )
+ 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt )) )
aPos.SetBodyPos( *pFrm );
if( bNext
diff --git a/sw/source/core/crsr/crstrvl1.cxx b/sw/source/core/crsr/crstrvl1.cxx
index 0c28f43c0965..96bc4636d0bf 100644
--- a/sw/source/core/crsr/crstrvl1.cxx
+++ b/sw/source/core/crsr/crstrvl1.cxx
@@ -96,7 +96,7 @@ sal_Bool SwCrsrShell::GoStartSentence()
sal_Bool SwCrsrShell::SelectWord( const Point* pPt )
{
- return pCurCrsr->SelectWord( pPt );
+ return pCurCrsr->SelectWord( this, pPt );
}
sal_Bool SwCrsrShell::ExpandToSentenceBorders()
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 24a51cd362e1..fa79b3e5f397 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -634,7 +634,7 @@ sal_uInt16 SwPaM::GetPageNum( sal_Bool bAtPoint, const Point* pLayPos )
const SwPosition* pPos = bAtPoint ? m_pPoint : m_pMark;
if( 0 != ( pNd = pPos->nNode.GetNode().GetCntntNode() ) &&
- 0 != ( pCFrm = pNd->GetFrm( pLayPos, pPos, sal_False )) &&
+ 0 != ( pCFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), pLayPos, pPos, sal_False )) &&
0 != ( pPg = pCFrm->FindPageFrm() ))
return pPg->GetPhyPageNum();
return 0;
@@ -675,7 +675,7 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
const SwCntntFrm *pFrm;
if( 0 != ( pNd = GetPoint()->nNode.GetNode().GetCntntNode() ))
- pFrm = pNd->GetFrm( &aTmpPt, GetPoint(), sal_False );
+ pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetPoint(), sal_False );
else
pFrm = 0;
@@ -697,7 +697,7 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
if( !bRet && HasMark() && GetPoint()->nNode != GetMark()->nNode )
{
if( 0 != ( pNd = GetMark()->nNode.GetNode().GetCntntNode() ))
- pFrm = pNd->GetFrm( &aTmpPt, GetMark(), sal_False );
+ pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetMark(), sal_False );
else
pFrm = 0;
@@ -832,7 +832,7 @@ SwCntntNode* GetNode( SwPaM & rPam, sal_Bool& rbFirst, SwMoveFn fnMove,
{
if(
(
- 0 == ( pFrm = pNd->GetFrm()) ||
+ 0 == ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout() ) ) ||
( !bInReadOnly && pFrm->IsProtected() ) ||
(pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsHiddenNow())
) ||
@@ -869,7 +869,7 @@ SwCntntNode* GetNode( SwPaM & rPam, sal_Bool& rbFirst, SwMoveFn fnMove,
{
// nur in der AutoTextSection koennen Node stehen, die
// nicht angezeigt werden !!
- if( 0 == ( pFrm = pNd->GetFrm()) ||
+ if( 0 == ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout() ) ) ||
( !bInReadOnly && pFrm->IsProtected() ) ||
( pFrm->IsTxtFrm() &&
((SwTxtFrm*)pFrm)->IsHiddenNow() ) )
@@ -1193,7 +1193,7 @@ void SwPaM::InvalidatePaM()
SwInsTxt aHint( Start()->nContent.GetIndex(),
End()->nContent.GetIndex() - Start()->nContent.GetIndex() + 1 );
SwModify *_pModify=(SwModify*)_pTxtNd;
- _pModify->Modify( 0, &aHint);
+ _pModify->ModifyNotification( 0, &aHint);
}
}
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 432ef6d0d281..9d26aaac80c9 100644..100755
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -32,10 +32,8 @@
#include <hintids.hxx>
#include <editeng/protitem.hxx>
-
#include <com/sun/star/i18n/WordType.hdl>
#include <com/sun/star/i18n/CharType.hdl>
-
#include <unotools/charclass.hxx>
#include <svl/ctloptions.hxx>
#include <swmodule.hxx>
@@ -55,6 +53,7 @@
#include <scriptinfo.hxx>
#include <crstate.hxx>
#include <docsh.hxx>
+#include <viewsh.hxx>
#include <frmatr.hxx>
#include <breakit.hxx>
#include <crsskip.hxx>
@@ -347,7 +346,7 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
const SwNode* pNd = &GetPoint()->nNode.GetNode();
if( pNd->IsCntntNode() && !dynamic_cast<SwUnoCrsr*>(this) )
{
- const SwCntntFrm* pFrm = ((SwCntntNode*)pNd)->GetFrm();
+ const SwCntntFrm* pFrm = ((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() );
if( pFrm && pFrm->IsValid() && 0 == pFrm->Frm().Height() &&
0 != ( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags ) )
{
@@ -364,7 +363,7 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
if( !pFrm )
{
bGoNxt = !bGoNxt;
- pFrm = ((SwCntntNode*)pNd)->GetFrm();
+ pFrm = ((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() );
while ( pFrm && 0 == pFrm->Frm().Height() )
{
pFrm = bGoNxt ? pFrm->GetNextCntntFrm()
@@ -421,7 +420,7 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
const SwTableNode* pPtNd = pNd->FindTableNode();
if( (pNd = &GetMark()->nNode.GetNode())->IsCntntNode() &&
- !((SwCntntNode*)pNd)->GetFrm() && !dynamic_cast<SwUnoCrsr*>(this) )
+ !((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() ) && !dynamic_cast<SwUnoCrsr*>(this) )
{
DeleteMark();
RestoreSavePos();
@@ -692,7 +691,7 @@ sal_Bool SwCursor::IsAtValidPos( sal_Bool bPoint ) const
const SwPosition* pPos = bPoint ? GetPoint() : GetMark();
const SwNode* pNd = &pPos->nNode.GetNode();
- if( pNd->IsCntntNode() && !((SwCntntNode*)pNd)->GetFrm() &&
+ if( pNd->IsCntntNode() && !((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() ) &&
!dynamic_cast<const SwUnoCrsr*>(this) )
{
return sal_False;
@@ -970,7 +969,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
{
// Cursor als Kopie vom akt. und in den Ring aufnehmen
// Verkettung zeigt immer auf den zuerst erzeugten, also vorwaerts
- SwCursor* pSav = Create( this ); // sicher den aktuellen Crsr
+ std::auto_ptr< SwCursor > pSav( Create( this ) ); // save the current cursor
// wenn schon ausserhalb vom Bodytext, suche von der Position,
// ansonsten beginne mit der 1. GrundSection
@@ -999,11 +998,10 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
}
else
DeleteMark();
- delete pSav;
return 0;
}
+ pSav.release();
- delete pSav;
if( !( FND_IN_SELALL & eFndRngs ))
{
// es sollte nur einer gesucht werden, also fuege in dazu
@@ -1029,7 +1027,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
}
else if( FND_IN_SELALL & eFndRngs )
{
- SwCursor* pSav = Create( this ); // sicher den aktuellen Crsr
+ ::std::auto_ptr< SwCursor> pSav( Create( this ) ); // save the current cursor
const SwNode* pSttNd = ( FND_IN_BODYONLY & eFndRngs )
? rNds.GetEndOfContent().StartOfSectionNode()
@@ -1054,13 +1052,9 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
}
else
DeleteMark();
- delete pSav;
return 0;
}
- // es wurde ein- bis mehrmals gefunden. Das steht alles
- // im neuen Crsr-Ring. Darum hebe erstmal den alten Ring auf
- delete pSav;
-
+ pSav.release();
while( GetNext() != this )
delete GetNext();
@@ -1175,9 +1169,9 @@ sal_Bool SwCursor::GoPrevWord()
return GoPrevWordWT( WordType::ANYWORD_IGNOREWHITESPACES );
}
-sal_Bool SwCursor::SelectWord( const Point* pPt )
+sal_Bool SwCursor::SelectWord( ViewShell* pViewShell, const Point* pPt )
{
- return SelectWordWT( WordType::ANYWORD_IGNOREWHITESPACES, pPt );
+ return SelectWordWT( pViewShell, WordType::ANYWORD_IGNOREWHITESPACES, pPt );
}
sal_Bool SwCursor::IsStartWordWT( sal_Int16 nWordType ) const
@@ -1353,20 +1347,20 @@ sal_Bool SwCursor::GoPrevWordWT( sal_Int16 nWordType )
return bRet;
}
-sal_Bool SwCursor::SelectWordWT( sal_Int16 nWordType, const Point* pPt )
+sal_Bool SwCursor::SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, const Point* pPt )
{
SwCrsrSaveState aSave( *this );
sal_Bool bRet = sal_False;
sal_Bool bForward = sal_True;
DeleteMark();
- SwRootFrm* pLayout;
- if( pPt && 0 != (pLayout = GetDoc()->GetRootFrm()) )
+ const SwRootFrm* pLayout = pViewShell->GetLayout();
+ if( pPt && 0 != pLayout )
{
// set the cursor to the layout position
Point aPt( *pPt );
pLayout->GetCrsrOfst( GetPoint(), aPt );
- }
+ } //swmod 071107//swmod 071225
const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
if( pTxtNd && pBreakIt->GetBreakIter().is() )
@@ -1596,7 +1590,7 @@ SwCursor::DoSetBidiLevelLeftRight(
// for visual cursor travelling (used in bidi layout)
// we first have to convert the logic to a visual position
Point aPt;
- pSttFrm = rTNd.GetFrm( &aPt, GetPoint() );
+ pSttFrm = rTNd.getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
if( pSttFrm )
{
sal_uInt8 nCrsrLevel = GetCrsrBidiLevel();
@@ -1735,7 +1729,7 @@ sal_Bool SwCursor::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
if ( &rTmpNode != &rNode && rTmpNode.IsTxtNode() )
{
Point aPt;
- const SwCntntFrm* pEndFrm = ((SwTxtNode&)rTmpNode).GetFrm( &aPt, GetPoint() );
+ const SwCntntFrm* pEndFrm = ((SwTxtNode&)rTmpNode).getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
if ( pEndFrm )
{
if ( ! pEndFrm->IsRightToLeft() != ! pSttFrm->IsRightToLeft() )
@@ -1804,7 +1798,7 @@ sal_Bool SwCursor::UpDown( sal_Bool bUp, sal_uInt16 nCnt,
Point aPt;
if( pPt )
aPt = *pPt;
- SwCntntFrm* pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() );
+ SwCntntFrm* pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
if( pFrm )
{
@@ -1842,7 +1836,7 @@ sal_Bool SwCursor::UpDown( sal_Bool bUp, sal_uInt16 nCnt,
const SwNode* pEndNd = pTblNd->EndOfSectionNode();
GetPoint()->nNode = *pEndNd;
pTblCrsr->Move( fnMoveBackward, fnGoNode );
- pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() );
+ pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
}
}
@@ -1851,7 +1845,7 @@ sal_Bool SwCursor::UpDown( sal_Bool bUp, sal_uInt16 nCnt,
: pFrm->UnitDown( this, nUpDownX, bInReadOnly ) ) &&
CheckNodesRange( aOldPos.nNode, GetPoint()->nNode, bChkRange ))
{
- pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() );
+ pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
--nCnt;
}
@@ -1862,7 +1856,7 @@ sal_Bool SwCursor::UpDown( sal_Bool bUp, sal_uInt16 nCnt,
{
// dann versuche den Cursor auf die Position zu setzen,
// auf halber Heohe vom Char-Rectangle
- pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() );
+ pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
SwCrsrMoveState eTmpState( MV_UPDOWN );
eTmpState.bSetInReadOnly = bInReadOnly;
SwRect aTmpRect;
@@ -1895,7 +1889,7 @@ sal_Bool SwCursor::UpDown( sal_Bool bUp, sal_uInt16 nCnt,
sal_Bool SwCursor::LeftRightMargin( sal_Bool bLeft, sal_Bool bAPI )
{
Point aPt;
- SwCntntFrm * pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() );
+ SwCntntFrm * pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
// calculate cursor bidi level
if ( pFrm )
@@ -1909,7 +1903,7 @@ sal_Bool SwCursor::IsAtLeftRightMargin( sal_Bool bLeft, sal_Bool bAPI ) const
{
sal_Bool bRet = sal_False;
Point aPt;
- SwCntntFrm * pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() );
+ SwCntntFrm * pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
if( pFrm )
{
SwPaM aPam( *GetPoint() );
diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx
index c2ead9272ea0..765e4094712a 100644
--- a/sw/source/core/crsr/trvlfnfl.cxx
+++ b/sw/source/core/crsr/trvlfnfl.cxx
@@ -96,7 +96,7 @@ sal_Bool SwCrsrShell::GotoFtnTxt()
_GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode() : NULL;
if( pTxtNd )
{
- const SwFrm *pFrm = pTxtNd->GetFrm( &_GetCrsr()->GetSttPos(),
+ const SwFrm *pFrm = pTxtNd->getLayoutFrm( GetLayout(), &_GetCrsr()->GetSttPos(),
_GetCrsr()->Start() );
const SwFtnBossFrm* pFtnBoss;
sal_Bool bSkip = pFrm && pFrm->IsInFtn();
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx
index c1d1e00e2e03..7bd158d3be87 100644
--- a/sw/source/core/crsr/trvltbl.cxx
+++ b/sw/source/core/crsr/trvltbl.cxx
@@ -194,7 +194,7 @@ sal_Bool SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple )
const SwShellCrsr *pCrsr = _GetCrsr();
const SwFrm* pStartFrm = pFrm;
const SwCntntNode *pCNd = pCrsr->GetCntntNode( sal_False );
- const SwFrm* pEndFrm = pCNd ? pCNd->GetFrm( &pCrsr->GetMkPos() ) : 0;
+ const SwFrm* pEndFrm = pCNd ? pCNd->getLayoutFrm( GetLayout(), &pCrsr->GetMkPos() ) : 0;
if ( bRow )
{
@@ -381,7 +381,7 @@ bool lcl_FindNextCell( SwNodeIndex& rIdx, sal_Bool bInReadOnly )
if ( !pCNd )
return false;
- SwCntntFrm* pFrm = pCNd->GetFrm();
+ SwCntntFrm* pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() );
if ( 0 == pFrm || pCNd->FindTableNode() != pTblNd ||
(!bInReadOnly && pFrm->IsProtected() ) )
@@ -413,7 +413,7 @@ bool lcl_FindNextCell( SwNodeIndex& rIdx, sal_Bool bInReadOnly )
return false;
// check if we have found a suitable table cell:
- pFrm = pCNd->GetFrm();
+ pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() );
if ( 0 != pFrm && pCNd->FindTableNode() == pTblNd &&
(bInReadOnly || !pFrm->IsProtected() ) )
@@ -455,7 +455,7 @@ bool lcl_FindPrevCell( SwNodeIndex& rIdx, sal_Bool bInReadOnly )
if ( !pCNd )
return false;
- SwCntntFrm* pFrm = pCNd->GetFrm();
+ SwCntntFrm* pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() );
if( 0 == pFrm || pCNd->FindTableNode() != pTblNd ||
(!bInReadOnly && pFrm->IsProtected() ))
@@ -476,7 +476,7 @@ bool lcl_FindPrevCell( SwNodeIndex& rIdx, sal_Bool bInReadOnly )
if ( !pCNd )
return false;
- pFrm = pCNd->GetFrm();
+ pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() );
if( 0 != pFrm && pCNd->FindTableNode() == pTblNd &&
(bInReadOnly || !pFrm->IsProtected() ) )
@@ -747,7 +747,7 @@ String SwCrsrShell::GetBoxNms() const
if( IsTableMode() )
{
SwCntntNode *pCNd = pTblCrsr->Start()->nNode.GetNode().GetCntntNode();
- pFrm = pCNd ? pCNd->GetFrm() : 0;
+ pFrm = pCNd ? pCNd->getLayoutFrm( GetLayout() ) : 0;
if( !pFrm )
return sNm;
@@ -769,7 +769,7 @@ String SwCrsrShell::GetBoxNms() const
}
SwCntntNode* pCNd = pPos->nNode.GetNode().GetCntntNode();
- pFrm = pCNd ? pCNd->GetFrm() : 0;
+ pFrm = pCNd ? pCNd->getLayoutFrm( GetLayout() ) : 0;
if( pFrm )
{
diff --git a/sw/source/core/crsr/unocrsr.cxx b/sw/source/core/crsr/unocrsr.cxx
index 48bb4b1f2cf4..6adb1e14dfa7 100644
--- a/sw/source/core/crsr/unocrsr.cxx
+++ b/sw/source/core/crsr/unocrsr.cxx
@@ -48,14 +48,6 @@ SwUnoCrsr::SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing )
{}
-// @@@ semantic: no copy ctor.
-SwUnoCrsr::SwUnoCrsr( SwUnoCrsr& rICrsr )
- : SwCursor( rICrsr ), SwModify( 0 ),
- bRemainInSection( rICrsr.bRemainInSection ),
- bSkipOverHiddenSections( rICrsr.bSkipOverHiddenSections ),
- bSkipOverProtectSections( rICrsr.bSkipOverProtectSections )
-{}
-
SwUnoCrsr::~SwUnoCrsr()
{
SwDoc* pDoc = GetDoc();
@@ -245,9 +237,9 @@ void SwUnoTableCrsr::MakeBoxSels()
const SwCntntNode* pCNd;
bool bMakeTblCrsrs = true;
if( GetPoint()->nNode.GetIndex() && GetMark()->nNode.GetIndex() &&
- 0 != ( pCNd = GetCntntNode() ) && pCNd->GetFrm() &&
- 0 != ( pCNd = GetCntntNode(sal_False) ) && pCNd->GetFrm() )
- bMakeTblCrsrs = GetDoc()->GetRootFrm()->MakeTblCrsrs( *this );
+ 0 != ( pCNd = GetCntntNode() ) && pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) &&
+ 0 != ( pCNd = GetCntntNode(sal_False) ) && pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) )
+ bMakeTblCrsrs = GetDoc()->GetCurrentLayout()->MakeTblCrsrs( *this );
if ( !bMakeTblCrsrs )
{
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 251e4d7fc23b..2f333f708486 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -215,7 +215,7 @@ void SwVisCrsr::_SetPosAndShow()
if( rNode.IsTxtNode() )
{
const SwTxtNode& rTNd = *rNode.GetTxtNode();
- const SwFrm* pFrm = rTNd.GetFrm( 0, 0, sal_False );
+ const SwFrm* pFrm = rTNd.getLayoutFrm( pCrsrShell->GetLayout(), 0, 0, sal_False );
if ( pFrm )
{
const SwScriptInfo* pSI = ((SwTxtFrm*)pFrm)->GetScriptInfo();
@@ -497,11 +497,11 @@ void SwShellCrsr::FillRects()
// calculate the new rectangles
if( HasMark() &&
GetPoint()->nNode.GetNode().IsCntntNode() &&
- GetPoint()->nNode.GetNode().GetCntntNode()->GetFrm() &&
+ GetPoint()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) &&
(GetMark()->nNode == GetPoint()->nNode ||
(GetMark()->nNode.GetNode().IsCntntNode() &&
- GetMark()->nNode.GetNode().GetCntntNode()->GetFrm() ) ))
- GetDoc()->GetRootFrm()->CalcFrmRects( *this, GetShell()->IsTableMode() );
+ GetMark()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) ) ))
+ GetShell()->GetLayout()->CalcFrmRects( *this, GetShell()->IsTableMode() ); //swmod 071107//swmod 071225
}
@@ -563,7 +563,7 @@ short SwShellCrsr::MaxReplaceArived()
// a SSelection can be created.
SvUShorts aArr;
sal_uInt16 nActCnt;
- ViewShell *pShell = GetDoc()->GetRootFrm()->GetCurrShell(),
+ ViewShell *pShell = const_cast< SwCrsrShell* >( GetShell() ),
*pSh = pShell;
do {
for( nActCnt = 0; pSh->ActionPend(); ++nActCnt )
@@ -580,7 +580,7 @@ short SwShellCrsr::MaxReplaceArived()
for( nActCnt = aArr[n]; nActCnt--; )
pSh->StartAction();
pSh = (ViewShell*)pSh->GetNext();
- }
+ } //swmod 071107//swmod 071225
}
else
// otherwise from the Basic, and than switch to RET_YES
@@ -693,7 +693,7 @@ void SwShellTableCrsr::FillRects()
if( !pCNd )
continue;
- SwFrm* pFrm = pCNd->GetFrm( &GetSttPos() );
+ SwFrm* pFrm = pCNd->getLayoutFrm( GetShell()->GetLayout(), &GetSttPos() );
while( pFrm && !pFrm->IsCellFrm() )
pFrm = pFrm->GetUpper();
@@ -729,7 +729,7 @@ sal_Bool SwShellTableCrsr::IsInside( const Point& rPt ) const
if( !pCNd )
continue;
- SwFrm* pFrm = pCNd->GetFrm( &GetPtPos() );
+ SwFrm* pFrm = pCNd->getLayoutFrm( GetShell()->GetLayout(), &GetPtPos() );
while( pFrm && !pFrm->IsCellFrm() )
pFrm = pFrm->GetUpper();
OSL_ENSURE( pFrm, "Node nicht in einer Tabelle" );
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index b597117315a9..ec5c65332b1c 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -65,11 +65,12 @@ public:
SwAutoCompleteClient& operator=(const SwAutoCompleteClient& rClient);
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
const SwDoc& GetDoc(){return *pDoc;}
#if OSL_DEBUG_LEVEL > 1
static sal_uLong GetElementCount() {return nSwAutoCompleteClientCount;}
#endif
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
typedef std::vector<SwAutoCompleteClient> SwAutoCompleteClientVector;
@@ -142,13 +143,13 @@ SwAutoCompleteClient& SwAutoCompleteClient::operator=(const SwAutoCompleteClient
pAutoCompleteWord = rClient.pAutoCompleteWord;
pDoc = rClient.pDoc;
if(rClient.GetRegisteredIn())
- rClient.pRegisteredIn->Add(this);
+ ((SwModify*)rClient.GetRegisteredIn())->Add(this);
else if(GetRegisteredIn())
- pRegisteredIn->Remove(this);
+ GetRegisteredInNonConst()->Remove(this);
return *this;
}
-void SwAutoCompleteClient::Modify(SfxPoolItem *pOld, SfxPoolItem *)
+void SwAutoCompleteClient::Modify( const SfxPoolItem* pOld, const SfxPoolItem *)
{
switch( pOld ? pOld->Which() : 0 )
{
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 18fafac8331f..a031aa86098f 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -112,11 +112,14 @@
#include <SwUndoFmt.hxx>
#include <unocrsr.hxx>
#include <docsh.hxx>
+#include <viewopt.hxx>
#include <docfld.hxx> // _SetGetExpFld
#include <docufld.hxx> // SwPostItField
#include <viewsh.hxx>
#include <shellres.hxx>
#include <txtfrm.hxx>
+#include <attrhint.hxx>
+
#include <wdocsh.hxx> // SwWebDocShell
#include <prtopt.hxx> // SwPrintOptions
@@ -127,6 +130,8 @@
#include <osl/interlck.h>
#include <vbahelper/vbaaccesshelper.hxx>
+#include "switerator.hxx"
+
/* @@@MAINTAINABILITY-HORROR@@@
Probably unwanted dependency on SwDocShell
*/
@@ -197,7 +202,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
case INVERT_BORDER_SPACING: return mbInvertBorderSpacing;
case COLLAPSE_EMPTY_CELL_PARA: return mbCollapseEmptyCellPara;
- case BROWSE_MODE: return mbBrowseMode;
+ case BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the ViewShell has to be asked!
case HTML_MODE: return mbHTMLMode;
case GLOBAL_DOCUMENT: return mbIsGlobalDoc;
case GLOBAL_DOCUMENT_SAVE_LINKS: return mbGlblDocSaveLinks;
@@ -328,8 +333,8 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
break;
// COMPATIBILITY FLAGS END
- case BROWSE_MODE:
- mbBrowseMode = value;
+ case BROWSE_MODE: //can be used temporary (load/save) when no ViewShell is avaiable
+ mbLastBrowseMode = value;
break;
case HTML_MODE:
@@ -379,7 +384,7 @@ const i18n::ForbiddenCharacters*
}
void SwDoc::setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang,
- /*[in]*/ const i18n::ForbiddenCharacters& rFChars )
+ /*[in]*/ const com::sun::star::i18n::ForbiddenCharacters& rFChars )
{
if( !xForbiddenCharsTable.is() )
{
@@ -396,12 +401,14 @@ void SwDoc::setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang,
pDrawModel->ReformatAllTextObjects();
}
- if( pLayout && !mbInReading )
+ SwRootFrm* pTmpRoot = GetCurrentLayout();
+ if( pTmpRoot && !mbInReading )
{
- pLayout->StartAllAction();
- pLayout->InvalidateAllCntnt();
- pLayout->EndAllAction();
- }
+ pTmpRoot->StartAllAction();
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(), std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_SIZE));
+ pTmpRoot->EndAllAction();
+ }//swmod 080310
SetModified();
}
@@ -465,12 +472,14 @@ void SwDoc::setCharacterCompressionType( /*[in]*/SwCharCompressType n )
pDrawModel->ReformatAllTextObjects();
}
- if( pLayout && !mbInReading )
+ SwRootFrm* pTmpRoot = GetCurrentLayout();
+ if( pTmpRoot && !mbInReading )
{
- pLayout->StartAllAction();
- pLayout->InvalidateAllCntnt();
- pLayout->EndAllAction();
- }
+ pTmpRoot->StartAllAction();
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(), std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_SIZE));
+ pTmpRoot->EndAllAction();
+ }//swmod 080310
SetModified();
}
}
@@ -1087,9 +1096,8 @@ sal_uInt16 _PostItFld::GetPageNo(
//Bereichs ermittelt werden.
rVirtPgNo = 0;
sal_uInt16 nPos = GetCntnt();
- SwClientIter aIter( (SwModify &)GetFld()->GetTxtNode() );
- for( SwTxtFrm* pFrm = (SwTxtFrm*)aIter.First( TYPE( SwFrm ));
- pFrm; pFrm = (SwTxtFrm*)aIter.Next() )
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( GetFld()->GetTxtNode() );
+ for( SwTxtFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
if( pFrm->GetOfst() > nPos ||
(pFrm->HasFollow() && pFrm->GetFollow()->GetOfst() <= nPos) )
@@ -1118,13 +1126,11 @@ bool lcl_GetPostIts(
if( pFldType->GetDepends() )
{
// Modify-Object gefunden, trage alle Felder ins Array ein
- SwClientIter aIter( *pFldType );
- SwClient* pLast;
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
const SwTxtFld* pTxtFld;
-
- for( pLast = aIter.First( TYPE(SwFmtFld)); pLast; pLast = aIter.Next() )
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
- if( 0 != ( pTxtFld = ((SwFmtFld*)pLast)->GetTxtFld() ) &&
+ if( 0 != ( pTxtFld = pFld->GetTxtFld() ) &&
pTxtFld->GetTxtNode().GetNodes().IsDocNodes() )
{
bHasPostIts = true;
@@ -1212,15 +1218,12 @@ static sal_Int32 lcl_GetPaperBin( const SwPageFrm *pStartFrm )
}
void SwDoc::CalculatePagesForPrinting(
+ const SwRootFrm& rLayout,
/* out */ SwRenderData &rData,
const SwPrintUIOptions &rOptions,
bool bIsPDFExport,
sal_Int32 nDocPageCount )
{
- DBG_ASSERT( pLayout, "no layout present" );
- if (!pLayout)
- return;
-
const sal_Int32 nContent = rOptions.getIntValue( "PrintContent", 0 );
const bool bPrintSelection = nContent == 2;
@@ -1237,7 +1240,7 @@ void SwDoc::CalculatePagesForPrinting(
aMulti.SetTotalRange( Range( 0, RANGE_MAX ) );
aMulti.Select( aPages );
- const SwPageFrm *pStPage = (SwPageFrm*)pLayout->Lower();
+ const SwPageFrm *pStPage = dynamic_cast<const SwPageFrm*>( rLayout.Lower() );
const SwFrm *pEndPage = pStPage;
sal_uInt16 nFirstPageNo = 0;
@@ -1427,7 +1430,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
{
// get the correct number of current pages for the post-it document
rData.m_pPostItShell->CalcLayout();
- const sal_Int32 nPages = rData.m_pPostItDoc->GetPageCount();
+ const sal_Int32 nPages = rData.m_pPostItShell->GetPageCount();
aPostItLastStartPageNum[ nPhyPageNum ] = nPages;
}
}
@@ -1435,7 +1438,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
// format post-it doc to get correct number of pages
rData.m_pPostItShell->CalcLayout();
- const sal_Int32 nPostItDocPageCount = rData.m_pPostItDoc->GetPageCount();
+ const sal_Int32 nPostItDocPageCount = rData.m_pPostItShell->GetPageCount();
if (nPostItMode == POSTITS_ONLY || nPostItMode == POSTITS_ENDDOC)
{
@@ -1553,6 +1556,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
}
void SwDoc::CalculatePagePairsForProspectPrinting(
+ const SwRootFrm& rLayout,
/* out */ SwRenderData &rData,
const SwPrintUIOptions &rOptions,
sal_Int32 nDocPageCount )
@@ -1581,11 +1585,10 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
}
StringRangeEnumerator aRange( aPageRange, 1, nDocPageCount, 0 );
- DBG_ASSERT( pLayout, "no layout present" );
- if (!pLayout || aRange.size() <= 0)
+ if ( aRange.size() <= 0)
return;
- const SwPageFrm *pStPage = (SwPageFrm*)pLayout->Lower();
+ const SwPageFrm *pStPage = dynamic_cast<const SwPageFrm*>( rLayout.Lower() );
sal_Int32 i = 0;
for ( i = 1; pStPage && i < nDocPageCount; ++i )
pStPage = (SwPageFrm*)pStPage->GetNext();
@@ -1595,7 +1598,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
// currently for prospect printing all pages are valid to be printed
// thus we add them all to the respective map and set for later use
sal_Int32 nPageNum = 0;
- const SwPageFrm *pPageFrm = (SwPageFrm*)pLayout->Lower();
+ const SwPageFrm *pPageFrm = dynamic_cast<const SwPageFrm*>( rLayout.Lower() );
while( pPageFrm && nPageNum < nDocPageCount )
{
DBG_ASSERT( pPageFrm, "Empty page frame. How are we going to print this?" );
@@ -1698,36 +1701,6 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
// thus we are done here.
}
-sal_uInt16 SwDoc::GetPageCount() const
-{
- return GetRootFrm() ? GetRootFrm()->GetPageNum() : 0;
-}
-
-const Size SwDoc::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const
-{
- Size aSize;
- if ( GetRootFrm() && nPageNum )
- {
- const SwPageFrm* pPage = static_cast<const SwPageFrm*>
- (GetRootFrm()->Lower());
-
- while ( --nPageNum && pPage->GetNext() )
- {
- pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
- }
-
- // switch to next page for an empty page, if empty pages are not skipped
- // in order to get a sensible page size for an empty page - e.g. for printing.
- if ( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() )
- {
- pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
- }
-
- aSize = pPage->Frm().SSize();
- }
- return aSize;
-}
-
/*************************************************************************
* void UpdateDocStat( const SwDocStat& rStat );
*************************************************************************/
@@ -1756,10 +1729,8 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
// #i93174#: notes contain paragraphs that are not nodes
{
SwFieldType * const pPostits( GetSysFldType(RES_POSTITFLD) );
- SwClientIter aIter(*pPostits);
- SwFmtFld const * pFmtFld =
- static_cast<SwFmtFld const*>(aIter.First( TYPE(SwFmtFld) ));
- while (pFmtFld)
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pPostits );
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
if (pFmtFld->IsFldInDoc())
{
@@ -1767,11 +1738,10 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
static_cast<SwPostItField const*>(pFmtFld->GetFld()));
rStat.nAllPara += pField->GetNumberOfParagraphs();
}
- pFmtFld = static_cast<SwFmtFld const*>(aIter.Next());
}
}
- rStat.nPage = GetRootFrm() ? GetRootFrm()->GetPageNum() : 0;
+ rStat.nPage = GetCurrentLayout() ? GetCurrentLayout()->GetPageNum() : 0; //swmod 080218
rStat.bModified = sal_False;
SetDocStat( rStat );
@@ -2071,46 +2041,35 @@ sal_Bool lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void* )
************************************************************************/
void SwDoc::SpellItAgainSam( sal_Bool bInvalid, sal_Bool bOnlyWrong, sal_Bool bSmartTags )
{
- OSL_ENSURE( GetRootFrm(), "SpellAgain: Where's my RootFrm?" );
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080307
+ OSL_ENSURE( GetCurrentLayout(), "SpellAgain: Where's my RootFrm?" );
if( bInvalid )
{
- SwPageFrm *pPage = (SwPageFrm*)GetRootFrm()->Lower();
- while ( pPage )
- {
- if ( bSmartTags )
- pPage->InvalidateSmartTags();
-
- pPage->InvalidateSpelling();
- pPage = (SwPageFrm*)pPage->GetNext();
- }
- GetRootFrm()->SetNeedGrammarCheck( true );
-
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::AllInvalidateSmartTagsOrSpelling),bSmartTags));//swmod 080305
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::SetNeedGrammarCheck), true) );
if ( bSmartTags )
GetNodes().ForEach( lcl_CheckSmartTagsAgain, &bOnlyWrong );
-
GetNodes().ForEach( lcl_SpellAndGrammarAgain, &bOnlyWrong );
}
- GetRootFrm()->SetIdleFlags();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::SetIdleFlags));//swmod 080307
}
void SwDoc::InvalidateAutoCompleteFlag()
{
- if( GetRootFrm() )
+ SwRootFrm* pTmpRoot = GetCurrentLayout();
+ if( pTmpRoot )
{
- SwPageFrm *pPage = (SwPageFrm*)GetRootFrm()->Lower();
- while ( pPage )
- {
- pPage->InvalidateAutoCompleteWords();
- pPage = (SwPageFrm*)pPage->GetNext();
- }
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllInvalidateAutoCompleteWords));//swmod 080305
for( sal_uLong nNd = 1, nCnt = GetNodes().Count(); nNd < nCnt; ++nNd )
{
SwTxtNode* pTxtNode = GetNodes()[ nNd ]->GetTxtNode();
if ( pTxtNode ) pTxtNode->SetAutoCompleteWordDirty( true );
}
- GetRootFrm()->SetIdleFlags();
- }
+
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::SetIdleFlags));//swmod 080228
+ } //swmod 080219
}
const SwFmtINetFmt* SwDoc::FindINetAttr( const String& rName ) const
@@ -2215,9 +2174,8 @@ bool SwDoc::RemoveInvisibleContent()
{
SwTxtNode* pTxtNd;
- SwClientIter aIter( *GetSysFldType( RES_HIDDENPARAFLD ) );
- for( SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
- pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *GetSysFldType( RES_HIDDENPARAFLD ) );
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
if( pFmtFld->GetTxtFld() &&
0 != ( pTxtNd = (SwTxtNode*)pFmtFld->GetTxtFld()->GetpTxtNode() ) &&
@@ -2456,14 +2414,11 @@ sal_Bool SwDoc::ConvertFieldsToText()
if ( RES_POSTITFLD == pCurType->Which() )
continue;
- SwClientIter aIter( *(SwFieldType*)pCurType );
- const SwFmtFld* pCurFldFmt = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pCurType );
::std::vector<const SwFmtFld*> aFieldFmts;
- while (pCurFldFmt)
- {
+ for( SwFmtFld* pCurFldFmt = aIter.First(); pCurFldFmt; pCurFldFmt = aIter.Next() )
aFieldFmts.push_back(pCurFldFmt);
- pCurFldFmt = (SwFmtFld*)aIter.Next();
- }
+
::std::vector<const SwFmtFld*>::iterator aBegin = aFieldFmts.begin();
::std::vector<const SwFmtFld*>::iterator aEnd = aFieldFmts.end();
while(aBegin != aEnd)
@@ -2744,21 +2699,8 @@ void SwDoc::ChkCondColls()
for (sal_uInt16 n = 0; n < pTxtFmtCollTbl->Count(); n++)
{
SwTxtFmtColl *pColl = (*pTxtFmtCollTbl)[n];
-
if (RES_CONDTXTFMTCOLL == pColl->Which())
- {
- SwClientIter aIter(*pColl);
-
- SwClient * pClient = aIter.First(TYPE(SwTxtNode));
- while (pClient)
- {
- SwTxtNode * pTxtNode = static_cast<SwTxtNode *>(pClient);
-
- pTxtNode->ChkCondColl();
-
- pClient = aIter.Next();
- }
- }
+ pColl->CallSwClientNotify( SwAttrHint(RES_CONDTXTFMTCOLL) );
}
}
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 5a0b377ee5d4..85a90d2565e3 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1277,7 +1277,7 @@ void _SaveCntntIdx(SwDoc* pDoc,
if( pNode )
{
- SwFrm* pFrm = pNode->GetFrm();
+ SwFrm* pFrm = pNode->getLayoutFrm( pDoc->GetCurrentLayout() );
#if OSL_DEBUG_LEVEL > 1
static sal_Bool bViaDoc = sal_False;
if( bViaDoc )
@@ -1481,7 +1481,7 @@ void _RestoreCntntIdx(SwDoc* pDoc,
{
SwFrmFmt *pFrmFmt = (*pSpz)[ aSave.GetCount() ];
SfxPoolItem *pAnchor = (SfxPoolItem*)&pFrmFmt->GetAnchor();
- pFrmFmt->SwModify::Modify( pAnchor, pAnchor );
+ pFrmFmt->NotifyClients( pAnchor, pAnchor );
}
break;
diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx
index 78fafdf4d15d..7297413eb239 100644
--- a/sw/source/core/doc/docchart.cxx
+++ b/sw/source/core/doc/docchart.cxx
@@ -132,7 +132,7 @@ IMPL_LINK( SwDoc, DoUpdateAllCharts, Timer *, EMPTYARG )
return 0;
}
-void SwDoc::_UpdateCharts( const SwTable& rTbl, ViewShell& /*rVSh*/ ) const
+void SwDoc::_UpdateCharts( const SwTable& rTbl, ViewShell& rVSh ) const
{
String aName( rTbl.GetFrmFmt()->GetName() );
SwOLENode *pONd;
@@ -144,7 +144,7 @@ void SwDoc::_UpdateCharts( const SwTable& rTbl, ViewShell& /*rVSh*/ ) const
SwFrm* pFrm;
if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) &&
aName.Equals( pONd->GetChartTblName() ) &&
- 0 != ( pFrm = pONd->GetFrm() ) )
+ 0 != ( pFrm = pONd->getLayoutFrm( rVSh.GetLayout() ) ) )
{
SwChartDataProvider *pPCD = GetChartDataProvider();
if (pPCD)
@@ -248,7 +248,7 @@ void SwDoc::CreateChartInternalDataProviders( const SwTable *pTable )
aIdx++;
if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) &&
aName.Equals( pONd->GetChartTblName() ) /* OLE node is chart? */ &&
- 0 != (pONd->GetFrm()) /* chart frame is not hidden */ )
+ 0 != (pONd->getLayoutFrm( GetCurrentLayout() )) /* chart frame is not hidden */ )
{
uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef();
if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index d13affa1c536..8f59503b2455 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -44,8 +44,6 @@
#include <swundo.hxx>
#include <hints.hxx>
-/* */
-
/*
* MACROS um ueber alle CrsrShells zu iterieren
*/
@@ -193,7 +191,7 @@ void PaMCorrAbs( const SwPaM& rRange,
{
// the UNO cursor has left its section. We need to notify it!
SwMsgPoolItem aHint( RES_UNOCURSOR_LEAVES_SECTION );
- pUnoCursor->Modify( &aHint, NULL );
+ pUnoCursor->ModifyNotification( &aHint, NULL );
}
}
}
@@ -335,9 +333,9 @@ void SwDoc::CorrRel(const SwNodeIndex& rOldNode,
SwEditShell* SwDoc::GetEditShell( ViewShell** ppSh ) const
{
// Layout und OLE-Shells sollten vorhanden sein!
- if( pLayout && pLayout->GetCurrShell() )
+ if( pCurrentView )
{
- ViewShell *pSh = pLayout->GetCurrShell(), *pVSh = pSh;
+ ViewShell *pSh = pCurrentView, *pVSh = pSh;
if( ppSh )
*ppSh = pSh;
@@ -349,7 +347,7 @@ SwEditShell* SwDoc::GetEditShell( ViewShell** ppSh ) const
} while( pVSh != ( pSh = (ViewShell*)pSh->GetNext() ));
}
else if( ppSh )
- *ppSh = 0;
+ *ppSh = 0; //swmod 071029//swmod 071225
return 0;
}
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 30adf7eb721a..6133185a6b7a 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -71,10 +71,10 @@
#include <GetMetricVal.hxx>
#include <unotools/syslocale.hxx>
#include <statstr.hrc>
+#include <switerator.hxx>
#include <hints.hxx>
-
#include <SwUndoPageDesc.hxx>
-
+#include <pagedeschint.hxx>
#include <tgrditem.hxx>
using namespace com::sun::star;
@@ -199,6 +199,7 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
OSL_ENSURE( i < aPageDescs.Count(), "PageDescs ueberindiziert." );
SwPageDesc *pDesc = aPageDescs[i];
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -394,9 +395,12 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
}
}
- if ( (bUseOn || bFollow) && GetRootFrm() )
+ if ( (bUseOn || bFollow) && pTmpRoot)
//Layot benachrichtigen!
- GetRootFrm()->CheckPageDescs( (SwPageFrm*)GetRootFrm()->Lower() );
+ {
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));//swmod 080304
+ }
//Jetzt noch die Seiten-Attribute uebernehmen.
::lcl_DescSetAttr( rChged.GetMaster(), pDesc->GetMaster() );
@@ -409,16 +413,10 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
pDesc->SetFtnInfo( rChged.GetFtnInfo() );
SwMsgPoolItem aInfo( RES_PAGEDESC_FTNINFO );
{
- SwClientIter aIter( pDesc->GetMaster() );
- for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
- pLast = aIter.Next() )
- pLast->Modify( &aInfo, 0 );
+ pDesc->GetMaster().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
{
- SwClientIter aIter( pDesc->GetLeft() );
- for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
- pLast = aIter.Next() )
- pLast->Modify( &aInfo, 0 );
+ pDesc->GetLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
}
SetModified();
@@ -439,62 +437,33 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
|*
|*************************************************************************/
-void lcl_RemoveFrms( SwFrmFmt& rFmt, sal_Bool& rbFtnsRemoved )
-{
- SwClientIter aIter( rFmt );
- SwFrm *pFrm;
- for( pFrm = (SwFrm*)aIter.First(TYPE(SwFrm)); pFrm;
- pFrm = (SwFrm*)aIter.Next() )
- if ( !rbFtnsRemoved && pFrm->IsPageFrm() &&
- ((SwPageFrm*)pFrm)->IsFtnPage() )
- {
- rFmt.getIDocumentLayoutAccess()->GetRootFrm()->RemoveFtns( 0, sal_False, sal_True );
- rbFtnsRemoved = sal_True;
- }
- else
- {
- pFrm->Cut();
- delete pFrm;
- }
-}
-
// #i7983#
void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
{
if (0 == pDel)
return;
- SwFmtPageDesc aDfltDesc( aPageDescs[0] );
- SwClientIter aIter( *pDel );
- SwClient* pLast;
- while( 0 != ( pLast = aIter.GoRoot() ))
+ // mba: test iteration as clients are removed while iteration
+ SwPageDescHint aHint( aPageDescs[0] );
+ pDel->CallSwClientNotify( aHint );
+
+ bool bHasLayout = HasLayout();
+ if ( pFtnInfo->DependsOn( pDel ) )
{
- if( pLast->ISA( SwFmtPageDesc ) )
+ pFtnInfo->ChgPageDesc( aPageDescs[0] );
+ if ( bHasLayout )
{
- const SwModify* pMod = ((SwFmtPageDesc*)pLast)->GetDefinedIn();
- if ( pMod )
- {
- if( pMod->ISA( SwCntntNode ) )
- ((SwCntntNode*)pMod)->SetAttr( aDfltDesc );
- else if( pMod->ISA( SwFmt ))
- ((SwFmt*)pMod)->SetFmtAttr( aDfltDesc );
- else
- {
- OSL_ENSURE( !this, "was ist das fuer ein Mofify-Obj?" );
- aPageDescs[0]->Add( pLast );
- }
- }
- else //Es kann noch eine Undo-Kopie existieren
- aPageDescs[0]->Add( pLast );
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), false));
}
-
- sal_Bool bFtnInf = sal_False;
- if ( sal_True == (bFtnInf = pLast == pFtnInfo->GetPageDescDep()) ||
- pLast == pEndNoteInfo->GetPageDescDep() )
+ }
+ else if ( pEndNoteInfo->DependsOn( pDel ) )
+ {
+ pEndNoteInfo->ChgPageDesc( aPageDescs[0] );
+ if ( bHasLayout )
{
- aPageDescs[0]->Add( pLast );
- if ( GetRootFrm() )
- GetRootFrm()->CheckFtnPageDescs( !bFtnInf );
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), true));
}
}
@@ -503,29 +472,13 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
if ( aPageDescs[j]->GetFollow() == pDel )
{
aPageDescs[j]->SetFollow( 0 );
- //Clients des PageDesc sind die Attribute, denen sagen wir bescheid.
- //die Attribute wiederum reichen die Meldung an die Absaetze weiter.
-
- //Layot benachrichtigen!
- if( GetRootFrm() ) // ist nicht immer vorhanden!! (Orginizer)
- GetRootFrm()->CheckPageDescs( (SwPageFrm*)GetRootFrm()->Lower() );
+ if( bHasLayout )
+ {
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));//swmod 080228
+ }
}
}
-
- if( GetRootFrm() ) // ist nicht immer vorhanden!! (Orginizer)
- {
- //Wenn jetzt noch irgendwelche Seiten auf die FrmFmt'e (Master und Left)
- //Zeigen (z.B. irgendwelche Fussnotenseiten), so muessen die Seiten
- //vernichtet werden.
-
- // Wenn wir auf Endnotenseiten stossen, schmeissen wir alle Fussnoten weg,
- // anders kann die Reihenfolge der Seiten (FollowsPageDescs usw.)
- // nicht garantiert werden.
- sal_Bool bFtnsRemoved = sal_False;
-
- ::lcl_RemoveFrms( pDel->GetMaster(), bFtnsRemoved );
- ::lcl_RemoveFrms( pDel->GetLeft(), bFtnsRemoved );
- }
}
void SwDoc::BroadcastStyleOperation(String rName, SfxStyleFamily eFamily,
@@ -653,7 +606,7 @@ void SwDoc::PrtDataChanged()
OSL_ENSURE( get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) ||
0 != getPrinter( sal_False ), "PrtDataChanged will be called recursive!" );
// <--
-
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
SwWait *pWait = 0;
sal_Bool bEndAction = sal_False;
@@ -661,16 +614,16 @@ void SwDoc::PrtDataChanged()
GetDocShell()->UpdateFontList();
sal_Bool bDraw = sal_True;
- if ( GetRootFrm() )
+ if ( pTmpRoot )
{
- ViewShell *pSh = GetRootFrm()->GetCurrShell();
- if( !get(IDocumentSettingAccess::BROWSE_MODE) ||
- ( pSh && pSh->GetViewOptions()->IsPrtFormat() ) )
+ ViewShell *pSh = GetCurrentViewShell();
+ if( !pSh->GetViewOptions()->getBrowseMode() ||
+ pSh->GetViewOptions()->IsPrtFormat() )
{
if ( GetDocShell() )
pWait = new SwWait( *GetDocShell(), sal_True );
- GetRootFrm()->StartAllAction();
+ pTmpRoot->StartAllAction();
bEndAction = sal_True;
bDraw = sal_False;
@@ -681,7 +634,9 @@ void SwDoc::PrtDataChanged()
}
pFntCache->Flush();
- GetRootFrm()->InvalidateAllCntnt();
+
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_SIZE));//swmod 080304
if ( pSh )
{
@@ -690,11 +645,11 @@ void SwDoc::PrtDataChanged()
pSh->InitPrt( pPrt );
pSh = (ViewShell*)pSh->GetNext();
}
- while ( pSh != GetRootFrm()->GetCurrShell() );
+ while ( pSh != GetCurrentViewShell() );
}
}
- }
+ } //swmod 080218
if ( bDraw && pDrawModel )
{
const sal_Bool bTmpAddExtLeading = get(IDocumentSettingAccess::ADD_EXT_LEADING);
@@ -709,7 +664,7 @@ void SwDoc::PrtDataChanged()
PrtOLENotify( sal_True );
if ( bEndAction )
- GetRootFrm()->EndAllAction();
+ pTmpRoot->EndAllAction(); //swmod 080218
delete pWait;
}
@@ -723,18 +678,18 @@ extern SvPtrarr *pGlobalOLEExcludeList;
void SwDoc::PrtOLENotify( sal_Bool bAll )
{
SwFEShell *pShell = 0;
- if ( GetRootFrm() && GetRootFrm()->GetCurrShell() )
+ if ( GetCurrentViewShell() )
{
- ViewShell *pSh = GetRootFrm()->GetCurrShell();
+ ViewShell *pSh = GetCurrentViewShell();
if ( !pSh->ISA(SwFEShell) )
do
{ pSh = (ViewShell*)pSh->GetNext();
} while ( !pSh->ISA(SwFEShell) &&
- pSh != GetRootFrm()->GetCurrShell() );
+ pSh != GetCurrentViewShell() );
if ( pSh->ISA(SwFEShell) )
pShell = (SwFEShell*)pSh;
- }
+ } //swmod 071107//swmod 071225
if ( !pShell )
{
//Das hat ohne Shell und damit ohne Client keinen Sinn, weil nur darueber
@@ -753,28 +708,12 @@ void SwDoc::PrtOLENotify( sal_Bool bAll )
mbOLEPrtNotifyPending = mbAllOLENotify = sal_False;
-
- SwOLENodes *pNodes = 0;
- SwClientIter aIter( *(SwModify*)GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd;
- pNd = (SwCntntNode*)aIter.Next() )
- {
- SwOLENode *pONd;
- if ( 0 != (pONd = pNd->GetOLENode()) &&
- (bAll || pONd->IsOLESizeInvalid()) )
- {
- if ( !pNodes )
- pNodes = new SwOLENodes;
- pNodes->Insert( pONd, pNodes->Count() );
- }
- }
-
+ SwOLENodes *pNodes = SwCntntNode::CreateOLENodesArray( *GetDfltGrfFmtColl(), !bAll );
if ( pNodes )
{
::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY,
0, pNodes->Count(), GetDocShell());
- GetRootFrm()->StartAllAction();
+ GetCurrentLayout()->StartAllAction(); //swmod 080218
for( sal_uInt16 i = 0; i < pNodes->Count(); ++i )
{
@@ -817,7 +756,7 @@ void SwDoc::PrtOLENotify( sal_Bool bAll )
}
}
delete pNodes;
- GetRootFrm()->EndAllAction();
+ GetCurrentLayout()->EndAllAction(); //swmod 080218
::EndProgress( GetDocShell() );
}
}
@@ -830,42 +769,31 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
{
mbOLEPrtNotifyPending = mbAllOLENotify = sal_False;
- SwOLENodes aOLENodes;
- SwClientIter aIter( *(SwModify*)GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd;
- pNd = (SwCntntNode*)aIter.Next() )
- {
- SwOLENode *pONd = pNd->GetOLENode();
- if( pONd && pONd->IsOLESizeInvalid() )
- {
- aOLENodes.Insert( pONd, aOLENodes.Count() );
- }
- }
-
- if( aOLENodes.Count() )
+ SwOLENodes *pNodes = SwCntntNode::CreateOLENodesArray( *GetDfltGrfFmtColl(), true );
+ if( pNodes )
{
::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY,
- 0, aOLENodes.Count(), GetDocShell());
- GetRootFrm()->StartAllAction();
+ 0, pNodes->Count(), GetDocShell());
+ GetCurrentLayout()->StartAllAction(); //swmod 080218
SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR );
- for( sal_uInt16 i = 0; i < aOLENodes.Count(); ++i )
+ for( sal_uInt16 i = 0; i < pNodes->Count(); ++i )
{
::SetProgressState( i, GetDocShell() );
- SwOLENode* pOLENd = aOLENodes[i];
+ SwOLENode* pOLENd = (*pNodes)[i];
pOLENd->SetOLESizeInvalid( sal_False );
//Kennen wir nicht, also muss das Objekt geladen werden.
//Wenn es keine Benachrichtigung wuenscht
if( pOLENd->GetOLEObj().GetOleRef().is() ) //Kaputt?
{
- pOLENd->Modify( &aMsgHint, &aMsgHint );
+ pOLENd->ModifyNotification( &aMsgHint, &aMsgHint );
}
}
- GetRootFrm()->EndAllAction();
+ GetCurrentLayout()->EndAllAction(); //swmod 080218
::EndProgress( GetDocShell() );
+ delete pNodes;
}
}
return 0;
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index a240afbf3dc6..bf2dcbbd93cb 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -66,16 +66,14 @@
#include <dflyobj.hxx>
#include <svx/svdetc.hxx>
#include <editeng/fhgtitem.hxx>
-
#include <svx/svdpagv.hxx>
-
#include <txtfrm.hxx>
#include <editeng/frmdiritem.hxx>
#include <fmtornt.hxx>
-
#include <svx/svditer.hxx>
#include <vector>
+#include <switerator.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::linguistic2;
@@ -516,28 +514,29 @@ _ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn,
// #i11176#
// This also needs to work when no layout exists. Thus, for
// FlyFrames an alternative method is used now in that case.
- SwClientIter aIter( (SwFmt&)*pFmt );
-
if( RES_FLYFRMFMT == pFmt->Which() )
{
- if( pFmt->getIDocumentLayoutAccess()->GetRootFrm() )
+ if( pFmt->getIDocumentLayoutAccess()->GetCurrentViewShell() ) //swmod 071107//swmod 071225
{
// Schauen, ob es ein SdrObject dafuer gibt
- if( aIter.First( TYPE( SwFlyFrm) ) )
- nOrdNum = ((SwFlyFrm*)aIter())->GetVirtDrawObj()->GetOrdNum();
+ SwFlyFrm* pFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement( *pFrmFmt );
+ if( pFly )
+ nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum();
}
else
{
// Schauen, ob es ein SdrObject dafuer gibt
- if( aIter.First( TYPE(SwFlyDrawContact) ) )
- nOrdNum = ((SwFlyDrawContact*)aIter())->GetMaster()->GetOrdNum();
+ SwFlyDrawContact* pContact = SwIterator<SwFlyDrawContact,SwFmt>::FirstElement( *pFrmFmt );
+ if( pContact )
+ nOrdNum = pContact->GetMaster()->GetOrdNum();
}
}
else if( RES_DRAWFRMFMT == pFmt->Which() )
{
// Schauen, ob es ein SdrObject dafuer gibt
- if( aIter.First( TYPE(SwDrawContact) ) )
- nOrdNum = ((SwDrawContact*)aIter())->GetMaster()->GetOrdNum();
+ SwDrawContact* pContact = SwIterator<SwDrawContact,SwFmt>::FirstElement( *pFrmFmt );
+ if( pContact )
+ nOrdNum = pContact->GetMaster()->GetOrdNum();
}
else {
OSL_ENSURE( !this, "was ist das fuer ein Format?" );
@@ -618,7 +617,8 @@ void SwDoc::InitDrawModel()
nInvisibleControls = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
}
- pDrawModel->InsertPage( pDrawModel->AllocPage( sal_False ) );
+ SdrPage* pMasterPage = pDrawModel->AllocPage( sal_False );
+ pDrawModel->InsertPage( pMasterPage );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "after create DrawDocument" );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create Spellchecker/Hyphenator" );
@@ -643,10 +643,24 @@ void SwDoc::InitDrawModel()
pDrawModel->SetRefDevice( pRefDev );
pDrawModel->SetNotifyUndoActionHdl( LINK( this, SwDoc, AddDrawUndo ));
- if ( pLayout )
+ if ( pCurrentView )
{
- pLayout->SetDrawPage( pDrawModel->GetPage( 0 ) );
- pLayout->GetDrawPage()->SetSize( pLayout->Frm().SSize() );
+ ViewShell* pViewSh = pCurrentView;
+ do
+ {
+ SwRootFrm* pRoot = pViewSh->GetLayout();
+ if( pRoot && !pRoot->GetDrawPage() )
+ {
+ // Disable "multiple layout" for the moment:
+ // use pMasterPage instead of a new created SdrPage
+ // pDrawModel->AllocPage( FALSE );
+ // pDrawModel->InsertPage( pDrawPage );
+ SdrPage* pDrawPage = pMasterPage;
+ pRoot->SetDrawPage( pDrawPage );
+ pDrawPage->SetSize( pRoot->Frm().SSize() );
+ }
+ pViewSh = (ViewShell*)pViewSh->GetNext();
+ }while( pViewSh != pCurrentView );
}
}
@@ -798,14 +812,14 @@ SdrModel* SwDoc::_MakeDrawModel()
{
OSL_ENSURE( !pDrawModel, "_MakeDrawModel: Why?" );
InitDrawModel();
- if ( pLayout && pLayout->GetCurrShell() )
+ if ( pCurrentView )
{
- ViewShell* pTmp = pLayout->GetCurrShell();
+ ViewShell* pTmp = pCurrentView;
do
{
pTmp->MakeDrawView();
pTmp = (ViewShell*) pTmp->GetNext();
- } while ( pTmp != pLayout->GetCurrShell() );
+ } while ( pTmp != pCurrentView );
//Broadcast, damit die FormShell mit der DrawView verbunden werden kann
if( GetDocShell() )
@@ -813,7 +827,7 @@ SdrModel* SwDoc::_MakeDrawModel()
SfxSimpleHint aHnt( SW_BROADCAST_DRAWVIEWS_CREATED );
GetDocShell()->Broadcast( aHnt );
}
- }
+ } //swmod 071029//swmod 071225
return pDrawModel;
}
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 31d7e95d16c5..8d9849f547b8 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -216,7 +216,7 @@ void _RestFlyInRange( _SaveFlyArr & rArr, const SwNodeIndex& rSttIdx,
pFmt, pFmt->GetDoc()->GetSpzFrmFmts()->Count() );
pFmt->SetFmtAttr( aAnchor );
SwCntntNode* pCNd = aPos.nNode.GetNode().GetCntntNode();
- if( pCNd && pCNd->GetFrm( 0, 0, sal_False ) )
+ if( pCNd && pCNd->getLayoutFrm( pFmt->GetDoc()->GetCurrentLayout(), 0, 0, sal_False ) )
pFmt->MakeFrms();
}
}
@@ -406,7 +406,7 @@ bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd,
}
else
{
- pSrch->DelFrms();
+ pSrch->DelFrms(0);
rFtnArr.Remove( nPos );
if( bSaveFtn )
rSaveArr.Insert( pSrch );
@@ -434,7 +434,7 @@ bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd,
}
else
{
- pSrch->DelFrms();
+ pSrch->DelFrms(0);
rFtnArr.Remove( nPos );
if( bSaveFtn )
rSaveArr.Insert( pSrch );
@@ -825,13 +825,7 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
if( nOldAttrCnt != nNewAttrCnt )
{
SwUpdateAttr aHint( 0, 0, 0 );
- SwClientIter aIter( *pNode );
- SwClient* pGTO = aIter.First(TYPE( SwCrsrShell ));
- while( pGTO )
- {
- pGTO->Modify( 0, &aHint );
- pGTO = aIter.Next();
- }
+ pNode->ModifyBroadcast( 0, &aHint, TYPE( SwCrsrShell ) );
}
if (!GetIDocumentUndoRedo().DoesUndo() &&
@@ -1892,7 +1886,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
switch( pNd->GetNodeType() )
{
case ND_TEXTNODE:
- if( 0 != ( pCntFrm = ((SwTxtNode*)pNd)->GetFrm()) )
+ if( 0 != ( pCntFrm = ((SwTxtNode*)pNd)->getLayoutFrm( GetCurrentLayout() )) )
{
// geschutze Cellen/Flys ueberspringen, ausgeblendete
//ebenfalls
@@ -2121,7 +2115,7 @@ sal_Bool lcl_HyphenateNode( const SwNodePtr& rpNd, void* pArgs )
SwHyphArgs *pHyphArgs = (SwHyphArgs*)pArgs;
if( pNode )
{
- SwCntntFrm* pCntFrm = pNode->GetFrm();
+ SwCntntFrm* pCntFrm = pNode->getLayoutFrm( pNode->GetDoc()->GetCurrentLayout() );
if( pCntFrm && !((SwTxtFrm*)pCntFrm)->IsHiddenNow() )
{
sal_uInt16 *pPageSt = pHyphArgs->GetPageSt();
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 8b246e37b254..62cc8b4763b5 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -73,6 +73,7 @@
#include <poolfmt.hrc> // fuer InitFldTypes
#include <SwUndoField.hxx>
+#include "switerator.hxx"
using namespace ::com::sun::star::uno;
@@ -354,10 +355,10 @@ void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB )
if( !pNewHt )
{
SwMsgPoolItem aUpdateDDE( RES_UPDATEDDETBL );
- (*pFldTypes)[i]->Modify( 0, &aUpdateDDE );
+ (*pFldTypes)[i]->ModifyNotification( 0, &aUpdateDDE );
}
else
- (*pFldTypes)[i]->Modify( 0, pNewHt );
+ (*pFldTypes)[i]->ModifyNotification( 0, pNewHt );
break;
}
case RES_GETEXPFLD:
@@ -368,7 +369,7 @@ void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB )
if( !pNewHt )
break;
default:
- (*pFldTypes)[i]->Modify( 0, pNewHt );
+ (*pFldTypes)[i]->ModifyNotification ( 0, pNewHt );
}
}
@@ -418,7 +419,7 @@ void SwDoc::UpdateRefFlds( SfxPoolItem* pHt )
SwFieldType* pFldType;
for( sal_uInt16 i = 0; i < pFldTypes->Count(); ++i )
if( RES_GETREFFLD == ( pFldType = (*pFldTypes)[i] )->Which() )
- pFldType->Modify( 0, pHt );
+ pFldType->ModifyNotification( 0, pHt );
}
void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
@@ -436,9 +437,9 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
if( pHt && RES_TABLEFML_UPDATE == pHt->Which() )
pUpdtFld = (SwTableFmlUpdate*)pHt;
- SwClientIter aIter( *pFldType );
- for( SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
- pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
+ {
if( pFmtFld->GetTxtFld() )
{
SwTblField* pFld = (SwTblField*)pFmtFld->GetFld();
@@ -489,6 +490,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
// setze bei allen das Value-Flag zurueck
pFld->ChgValid( sal_False );
}
+ }
break;
}
@@ -517,16 +519,13 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
if( pFldType )
{
- SwClient* pLast;
- SwClientIter aIter( *pFldType );
- // dann rechne mal schoen
- // JP 27.03.97: Beim Berechnen am Ende anfangen - weil neue
- // Felder immer am Anfang der Modifykette eingefuegt
- // werden. Beim Import haben wir damit eine bessere/
- // schnellere Berechnung bei "Kettenformeln"
- if( 0 != ( pLast = aIter.GoEnd() ))
- do {
- SwFmtFld* pFmtFld = (SwFmtFld*)pLast;
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ for( SwFmtFld* pFmtFld = aIter.Last(); pFmtFld; pFmtFld = aIter.Previous() )
+ {
+ // start calculation at the end
+ // new fields are inserted at the beginning of the modify chain
+ // that gives faster calculation on import
+ // mba: do we really need this "optimization"? Is it still valid?
SwTblField* pFld;
if( !pFmtFld->GetTxtFld() || (nsSwExtendedSubType::SUB_CMD &
(pFld = (SwTblField*)pFmtFld->GetFld())->GetSubType() ))
@@ -559,7 +558,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
{
// steht im Sonderbereich, wird teuer !!
Point aPt; // den im Layout 1. Frame returnen - Tab.Kopfzeile !!
- pFrm = rTxtNd.GetFrm( &aPt );
+ pFrm = rTxtNd.getLayoutFrm( GetCurrentLayout(), &aPt );
if( pFrm )
{
SwPosition aPos( *pTblNd );
@@ -595,8 +594,8 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
}
pCalc->SetCalcError( CALC_NOERR );
}
- pFmtFld->Modify( 0, pHt );
- } while( 0 != ( pLast = aIter-- ));
+ pFmtFld->ModifyNotification( 0, pHt );
+ }
}
// dann berechene noch die Formeln an den Boxen
@@ -631,7 +630,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
if( !pCNd )
pCNd = GetNodes().GoNext( &aCNdIdx );
- if( pCNd && 0 != (pFrm = pCNd->GetFrm( &aPt )) )
+ if( pCNd && 0 != (pFrm = pCNd->getLayoutFrm( GetCurrentLayout(), &aPt )) )
{
SwPosition aPos( *pCNd );
if( GetBodyTxtNode( *this, aPos, *pFrm ) )
@@ -694,10 +693,10 @@ void SwDoc::UpdatePageFlds( SfxPoolItem* pMsgHnt )
case RES_CHAPTERFLD:
case RES_GETEXPFLD:
case RES_REFPAGEGETFLD:
- pFldType->Modify( 0, pMsgHnt );
+ pFldType->ModifyNotification( 0, pMsgHnt );
break;
case RES_DOCSTATFLD:
- pFldType->Modify( 0, 0 );
+ pFldType->ModifyNotification( 0, 0 );
break;
}
SetNewFldLst(true);
@@ -1508,7 +1507,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
}
} // switch
- pFmtFld->Modify( 0, 0 ); // Formatierung anstossen
+ pFmtFld->ModifyNotification( 0, 0 ); // Formatierung anstossen
if( pUpdtFld == pTxtFld ) // sollte nur dieses geupdatet werden
{
@@ -1643,9 +1642,8 @@ const SwDBData& SwDoc::GetDBDesc()
case RES_DBNUMSETFLD:
case RES_DBSETNUMBERFLD:
{
- SwClientIter aIter( rFldType );
- SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
- while(pFld)
+ SwIterator<SwFmtFld,SwFieldType> aIter( rFldType );
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
if(pFld->IsFldInDoc())
{
@@ -1657,7 +1655,6 @@ const SwDBData& SwDoc::GetDBDesc()
aDBData = (static_cast < SwDBNameInfField* > (pFld->GetFld()))->GetRealDBData();
break;
}
- pFld = (SwFmtFld*)aIter.Next();
}
}
break;
@@ -1894,7 +1891,7 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames,
SwDBFieldType* pTyp = (SwDBFieldType*)InsertFldType(
SwDBFieldType(this, pOldTyp->GetColumnName(), aNewDBData));
- pTyp->Add(pFmtFld); // Feld auf neuen Typ umhaengen
+ pFmtFld->RegisterToFieldType( *pTyp );
pFld->ChgTyp(pTyp);
((SwDBField*)pFld)->ClearInitialized();
@@ -2031,10 +2028,8 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime )
for( ; nStt < 5; ++nStt )
{
SwFieldType* pFldType = GetSysFldType( aTypes[ nStt ] );
- SwClientIter aDocInfIter( *pFldType );
-
- for( SwFmtFld* pFld = (SwFmtFld*)aDocInfIter.First( TYPE( SwFmtFld ));
- pFld; pFld = (SwFmtFld*)aDocInfIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
if( pFld && pFld->GetTxtFld() )
{
@@ -2102,7 +2097,7 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime )
// Formatierung anstossen
if( bChgd )
- pFld->Modify( 0, 0 );
+ pFld->ModifyNotification( 0, 0 );
}
}
}
@@ -2347,7 +2342,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
pFormel = 0;
// Formatierung anstossen
- ((SwFmtFld*)pFmtFld)->Modify( 0, 0 );
+ ((SwFmtFld*)pFmtFld)->ModifyNotification( 0, 0 );
}
break;
@@ -2367,7 +2362,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
// Feld Evaluieren
((SwHiddenTxtField*)pFld)->Evaluate(&rDoc);
// Formatierung anstossen
- ((SwFmtFld*)pFmtFld)->Modify( 0, 0 );
+ ((SwFmtFld*)pFmtFld)->ModifyNotification( 0, 0 );
}
break;
@@ -2416,7 +2411,7 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich )
// immer den ersten !! (in Tab-Headline, Kopf-/Fuss )
Point aPt;
- const SwCntntFrm* pFrm = rTxtNd.GetFrm( &aPt, 0, sal_False );
+ const SwCntntFrm* pFrm = rTxtNd.getLayoutFrm( rDoc.GetCurrentLayout(), &aPt, 0, sal_False );
_SetGetExpFld* pNew = NULL;
sal_Bool bIsInBody = sal_False;
@@ -2482,7 +2477,7 @@ void SwDocUpdtFld::GetBodyNode( const SwSectionNode& rSectNd )
// immer den ersten !! (in Tab-Headline, Kopf-/Fuss )
Point aPt;
- const SwCntntFrm* pFrm = pCNd->GetFrm( &aPt, 0, sal_False );
+ const SwCntntFrm* pFrm = pCNd->getLayoutFrm( rDoc.GetCurrentLayout(), &aPt, 0, sal_False );
if( !pFrm )
break;
@@ -2638,7 +2633,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
if (bUpdateFlds)
UpdateTblFlds( &aTblUpdate );
else
- pNewFld->GetTyp()->Modify(0, &aTblUpdate);
+ pNewFld->GetTyp()->ModifyNotification(0, &aTblUpdate);
if (! bUpdateFlds)
bTblSelBreak = sal_True;
@@ -2649,7 +2644,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
case RES_MACROFLD:
if( bUpdateFlds && pDstTxtFld->GetpTxtNode() )
(pDstTxtFld->GetpTxtNode())->
- Modify( 0, pDstFmtFld );
+ ModifyNotification( 0, pDstFmtFld );
break;
case RES_DBNAMEFLD:
@@ -2676,7 +2671,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
// kein break;
default:
- pDstFmtFld->Modify( 0, pMsgHnt );
+ pDstFmtFld->ModifyNotification( 0, pMsgHnt );
}
// Die Felder die wir berechnen koennen werden hier expli.
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 4030972a325b..b39f329956a5 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -66,8 +66,8 @@
#include <UndoAttribute.hxx>
#include <fmtcnct.hxx>
#include <dflyobj.hxx>
-
#include <undoflystrattr.hxx>
+#include <switerator.hxx>
extern sal_uInt16 GetHtmlMode( const SwDocShell* );
@@ -154,16 +154,11 @@ SwFrmFmt* SwDoc::GetFlyNum( sal_uInt16 nIdx, FlyCntType eType )
return pRetFmt;
}
-/***********************************************************************
-#* Class : SwDoc
-#* Methode : SetFlyFrmAnchor
-#* Beschreibung: Das Ankerattribut des FlyFrms aendert sich.
-#***********************************************************************/
Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
const SwFrmFmt* pFlyFmt )
{
Point aRet;
- if( rDoc.GetRootFrm() )
+ if( rDoc.GetCurrentViewShell() ) //swmod 071107//swmod 071225
switch( rAnch.GetAnchorId() )
{
case FLY_AS_CHAR:
@@ -181,7 +176,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
{
const SwPosition *pPos = rAnch.GetCntntAnchor();
const SwCntntNode* pNd = pPos->nNode.GetNode().GetCntntNode();
- const SwFrm* pOld = pNd ? pNd->GetFrm( &aRet, 0, sal_False ) : 0;
+ const SwFrm* pOld = pNd ? pNd->getLayoutFrm( rDoc.GetCurrentLayout(), &aRet, 0, sal_False ) : 0;
if( pOld )
aRet = pOld->Frm().Pos();
}
@@ -201,7 +196,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
case FLY_AT_PAGE:
{
sal_uInt16 nPgNum = rAnch.GetPageNum();
- const SwPageFrm *pPage = (SwPageFrm*)rDoc.GetRootFrm()->Lower();
+ const SwPageFrm *pPage = (SwPageFrm*)rDoc.GetCurrentLayout()->Lower();
for( sal_uInt16 i = 1; (i <= nPgNum) && pPage; ++i,
pPage = (const SwPageFrm*)pPage->GetNext() )
if( i == nPgNum )
@@ -513,10 +508,6 @@ void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
SetModified();
}
-/***************************************************************************
- * Methode : sal_Bool SwDoc::SetFrmFmtToFly( SwFlyFrm&, SwFrmFmt& )
- * Beschreibung:
- ***************************************************************************/
sal_Bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
SfxItemSet* pSet, sal_Bool bKeepOrient )
{
@@ -600,7 +591,7 @@ sal_Bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
rFmt.MakeFrms();
if( pUndo )
- rFmt.Remove( pUndo );
+ pUndo->DeRegisterFromFormat( rFmt );
SetModified();
@@ -616,17 +607,12 @@ void SwDoc::GetGrfNms( const SwFlyFrmFmt& rFmt, String* pGrfName,
pGrfNd->GetFileFilterNms( pGrfName, pFltName );
}
-/*************************************************************************
-|*
-|* SwDoc::ChgAnchor()
-|*
-*************************************************************************/
sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
RndStdIds _eAnchorType,
const sal_Bool _bSameOnly,
const sal_Bool _bPosCorr )
{
- OSL_ENSURE( GetRootFrm(), "Ohne Layout geht gar nichts" );
+ OSL_ENSURE( GetCurrentLayout(), "Ohne Layout geht gar nichts" );
if ( !_rMrkList.GetMarkCount() ||
_rMrkList.GetMark( 0 )->GetMarkedSdrObj()->GetUpGroup() )
@@ -722,11 +708,11 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
SwPosition aPos( GetNodes() );
Point aPoint( aPt );
aPoint.X() -= 1;
- GetRootFrm()->GetCrsrOfst( &aPos, aPoint, &aState );
+ GetCurrentLayout()->GetCrsrOfst( &aPos, aPoint, &aState );
// consider that drawing objects can be in
// header/footer. Thus, <GetFrm()> by left-top-corner
pTxtFrm = aPos.nNode.GetNode().
- GetCntntNode()->GetFrm( &aPt, 0, sal_False );
+ GetCntntNode()->getLayoutFrm( GetCurrentLayout(), &aPt, 0, sal_False );
}
const SwFrm *pTmp = ::FindAnchor( pTxtFrm, aPt );
pNewAnchorFrm = pTmp->FindFlyFrm();
@@ -744,7 +730,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
}
case FLY_AT_PAGE:
{
- pNewAnchorFrm = GetRootFrm()->Lower();
+ pNewAnchorFrm = GetCurrentLayout()->Lower();
while ( pNewAnchorFrm && !pNewAnchorFrm->Frm().IsInside( aPt ) )
pNewAnchorFrm = pNewAnchorFrm->GetNext();
if ( !pNewAnchorFrm )
@@ -783,7 +769,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
// es muss ein TextNode gefunden werden, denn nur dort
// ist ein inhaltsgebundenes DrawObjekt zu verankern
SwCrsrMoveState aState( MV_SETONLYTEXT );
- GetRootFrm()->GetCrsrOfst( &aPos, aPoint, &aState );
+ GetCurrentLayout()->GetCrsrOfst( &aPos, aPoint, &aState ); //swmod 080218
}
else
{
@@ -997,8 +983,7 @@ int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
SwFmtFrmSize aSize( rSource.GetFrmSize() );
if ( aSize.GetHeightSizeType() != ATT_FIX_SIZE )
{
- SwClientIter aIter( rSource );
- SwFlyFrm *pFly = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm) );
+ SwFlyFrm *pFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement( rSource );
if ( pFly )
aSize.SetHeight( pFly->Frm().Height() );
aSize.SetHeightSizeType( ATT_FIX_SIZE );
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 32592c827649..bc6c1e6f3e16 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1325,7 +1325,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
{
SwFmtChg aChgFmt( pDfltCharFmt );
// dann sage mal den Frames bescheid
- aCallMod.Modify( &aChgFmt, &aChgFmt );
+ aCallMod.ModifyNotification( &aChgFmt, &aChgFmt );
}
}
}
@@ -1334,7 +1334,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
{
SwAttrSetChg aChgOld( aOld, aOld );
SwAttrSetChg aChgNew( aNew, aNew );
- aCallMod.Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ aCallMod.ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
// und die default-Formate wieder beim Object austragen
@@ -1988,10 +1988,9 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
pDest = FindFmtByName( rDestArr, pSrc->GetName() );
pDest->SetAuto( sal_False );
-
-//JP 19.02.96: ist so wohl optimaler - loest ggfs. kein Modify aus!
pDest->DelDiffs( *pSrc );
- //JP 18.08.98: Bug 55115 - copy PageDescAttribute in this case
+
+ // #i94285#: existing <SwFmtPageDesc> instance, before copying attributes
const SfxPoolItem* pItem;
if( &GetAttrPool() != pSrc->GetAttrSet().GetPool() &&
SFX_ITEM_SET == pSrc->GetAttrSet().GetItemState(
@@ -2005,7 +2004,7 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
{
pPageDesc = aPageDescs[ MakePageDesc( rNm ) ];
}
- pPageDesc->Add( &aPageDesc );
+ aPageDesc.RegisterToPageDesc( *pPageDesc );
SwAttrSet aTmpAttrSet( pSrc->GetAttrSet() );
aTmpAttrSet.Put( aPageDesc );
pDest->SetFmtAttr( aTmpAttrSet );
@@ -2014,7 +2013,6 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
{
pDest->SetFmtAttr( pSrc->GetAttrSet() );
}
- // <--
pDest->SetPoolFmtId( pSrc->GetPoolFmtId() );
pDest->SetPoolHelpId( pSrc->GetPoolHelpId() );
@@ -2099,9 +2097,9 @@ void SwDoc::CopyPageDescHeaderFooterImpl( bool bCpyHeader,
pNewFmt->ResetFmtAttr( RES_CNTNT );
}
if( bCpyHeader )
- pNewFmt->Add( (SwFmtHeader*)pNewItem );
+ ((SwFmtHeader*)pNewItem)->RegisterToFormat(*pNewFmt);
else
- pNewFmt->Add( (SwFmtFooter*)pNewItem );
+ ((SwFmtFooter*)pNewItem)->RegisterToFormat(*pNewFmt);
rDestFmt.SetFmtAttr( *pNewItem );
}
delete pNewItem;
@@ -2111,6 +2109,7 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
sal_Bool bCopyPoolIds )
{
sal_Bool bNotifyLayout = sal_False;
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
rDstDesc.SetLandscape( rSrcDesc.GetLandscape() );
rDstDesc.SetNumType( rSrcDesc.GetNumType() );
@@ -2174,9 +2173,11 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
else
rDstDesc.GetLeft().SetFmtAttr( rDstDesc.GetMaster().GetFooter() );
- if( bNotifyLayout && GetRootFrm() )
- //Layot benachrichtigen!
- GetRootFrm()->CheckPageDescs( (SwPageFrm*)GetRootFrm()->Lower() );
+ if( bNotifyLayout && pTmpRoot )
+ {
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080225
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));//swmod 080226
+ }
//Wenn sich FussnotenInfo veraendert, so werden die Seiten
//angetriggert.
@@ -2185,16 +2186,10 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
rDstDesc.SetFtnInfo( rSrcDesc.GetFtnInfo() );
SwMsgPoolItem aInfo( RES_PAGEDESC_FTNINFO );
{
- SwClientIter aIter( rDstDesc.GetMaster() );
- for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
- pLast = aIter.Next() )
- pLast->Modify( &aInfo, 0 );
+ rDstDesc.GetMaster().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
{
- SwClientIter aIter( rDstDesc.GetLeft() );
- for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
- pLast = aIter.Next() )
- pLast->Modify( &aInfo, 0 );
+ rDstDesc.GetLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
}
}
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index 6f5d0f509f52..8d7c8523aa46 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -52,8 +52,8 @@ SwEndNoteInfo& SwEndNoteInfo::operator=(const SwEndNoteInfo& rInfo)
{
if( rInfo.GetFtnTxtColl() )
rInfo.GetFtnTxtColl()->Add(this);
- else if ( pRegisteredIn)
- pRegisteredIn->Remove(this);
+ else if ( GetRegisteredIn())
+ GetRegisteredInNonConst()->Remove(this);
if ( rInfo.aPageDescDep.GetRegisteredIn() )
((SwModify*)rInfo.aPageDescDep.GetRegisteredIn())->Add( &aPageDescDep );
@@ -109,8 +109,8 @@ SwEndNoteInfo::SwEndNoteInfo(const SwEndNoteInfo& rInfo) :
aFmt( rInfo.aFmt ),
nFtnOffset( rInfo.nFtnOffset )
{
- if( rInfo.GetPageDescDep()->GetRegisteredIn() )
- ((SwModify*)rInfo.GetPageDescDep()->GetRegisteredIn())->Add( &aPageDescDep );
+ if( rInfo.aPageDescDep.GetRegisteredIn() )
+ ((SwModify*)rInfo.aPageDescDep.GetRegisteredIn())->Add( &aPageDescDep );
if( rInfo.aCharFmtDep.GetRegisteredIn() )
((SwModify*)rInfo.aCharFmtDep.GetRegisteredIn())->Add( &aCharFmtDep );
@@ -139,7 +139,18 @@ SwPageDesc *SwEndNoteInfo::GetPageDesc( SwDoc &rDoc ) const
m_bEndNote ? RES_POOLPAGE_ENDNOTE : RES_POOLPAGE_FOOTNOTE ) );
pDesc->Add( &((SwClient&)aPageDescDep) );
}
- return (SwPageDesc*)aPageDescDep.GetRegisteredIn();
+
+ return (SwPageDesc*)( aPageDescDep.GetRegisteredIn() );
+}
+
+bool SwEndNoteInfo::KnowsPageDesc() const
+{
+ return (aPageDescDep.GetRegisteredIn() != 0);
+}
+
+bool SwEndNoteInfo::DependsOn( const SwPageDesc* pDesc ) const
+{
+ return ( aPageDescDep.GetRegisteredIn() == pDesc );
}
void SwEndNoteInfo::ChgPageDesc( SwPageDesc *pDesc )
@@ -186,7 +197,7 @@ void SwEndNoteInfo::SetAnchorCharFmt( SwCharFmt* pChFmt )
pChFmt->Add( &((SwClient&)aAnchorCharFmtDep) );
}
-void SwEndNoteInfo::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwEndNoteInfo::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
@@ -210,7 +221,7 @@ void SwEndNoteInfo::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
}
}
else
- SwClient::Modify( pOld, pNew );
+ CheckRegistration( pOld, pNew );
}
SwFtnInfo& SwFtnInfo::operator=(const SwFtnInfo& rInfo)
@@ -258,6 +269,7 @@ SwFtnInfo::SwFtnInfo(SwTxtFmtColl *pFmt) :
void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
{
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
if( !(GetFtnInfo() == rInfo) )
{
const SwFtnInfo &rOld = GetFtnInfo();
@@ -281,15 +293,19 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
*pFtnInfo = rInfo;
- if ( GetRootFrm() )
+ if (pTmpRoot)
{
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080304
if ( bFtnPos )
- GetRootFrm()->RemoveFtns();
+ //pTmpRoot->RemoveFtns();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllRemoveFtns));//swmod 080305
else
{
- GetRootFrm()->UpdateFtnNums();
+ //pTmpRoot->UpdateFtnNums();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFtnNums));//swmod 080304
if ( bFtnDesc )
- GetRootFrm()->CheckFtnPageDescs( sal_False );
+ //pTmpRoot->CheckFtnPageDescs( FALSE );
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), sal_False));//swmod 080304
if ( bExtra )
{
//Fuer die Benachrichtung bezueglich ErgoSum usw. sparen wir uns
@@ -304,14 +320,14 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
}
}
}
- }
+ } //swmod 080219
if( FTNNUM_PAGE != rInfo.eNum )
GetFtnIdxs().UpdateAllFtn();
else if( bFtnChrFmts )
{
SwFmtChg aOld( pOldChrFmt );
SwFmtChg aNew( pNewChrFmt );
- pFtnInfo->Modify( &aOld, &aNew );
+ pFtnInfo->ModifyNotification( &aOld, &aNew );
}
// #i81002# no update during loading
@@ -325,6 +341,7 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
{
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
if( !(GetEndNoteInfo() == rInfo) )
{
if(GetIDocumentUndoRedo().DoesUndo())
@@ -351,10 +368,14 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
*pEndNoteInfo = rInfo;
- if ( GetRootFrm() )
+ if ( pTmpRoot )
{
if ( bFtnDesc )
- GetRootFrm()->CheckFtnPageDescs( sal_True );
+ //pTmpRoot->CheckFtnPageDescs( TRUE );
+ {
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), sal_True));//swmod 080304
+ }
if ( bExtra )
{
//Fuer die Benachrichtung bezueglich ErgoSum usw. sparen wir uns
@@ -368,14 +389,14 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
pTxtFtn->SetNumber( rFtn.GetNumber(), &rFtn.GetNumStr());
}
}
- }
+ } //swmod 080219
if( bNumChg )
GetFtnIdxs().UpdateAllFtn();
else if( bFtnChrFmts )
{
SwFmtChg aOld( pOldChrFmt );
SwFmtChg aNew( pNewChrFmt );
- pEndNoteInfo->Modify( &aOld, &aNew );
+ pEndNoteInfo->ModifyNotification( &aOld, &aNew );
}
// #i81002# no update during loading
@@ -392,6 +413,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
sal_uInt16 nNumber, bool bIsEndNote )
{
SwFtnIdxs& rFtnArr = GetFtnIdxs();
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
const SwPosition* pStt = rPam.Start(), *pEnd = rPam.End();
const sal_uLong nSttNd = pStt->nNode.GetIndex();
@@ -439,7 +461,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
pTxtFtn->CheckCondColl();
//#i11339# dispose UNO wrapper when a footnote is changed to an endnote or vice versa
SwPtrMsgPoolItem aMsgHint( RES_FOOTNOTE_DELETED, (void*)&pTxtFtn->GetAttr() );
- GetUnoCallBack()->Modify( &aMsgHint, &aMsgHint );
+ GetUnoCallBack()->ModifyNotification( &aMsgHint, &aMsgHint );
}
}
}
@@ -487,8 +509,12 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
if ( !bTypeChgd )
rFtnArr.UpdateAllFtn();
}
- else if( GetRootFrm() )
- GetRootFrm()->UpdateFtnNums();
+ else if( pTmpRoot )
+ //
+ {
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFtnNums));
+ } //swmod 080304pTmpRoot->UpdateFtnNums(); //swmod 080219
SetModified();
}
else
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 14da026b3b8b..b72e5ded4689 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -55,7 +55,7 @@
#include <section.hxx>
#include <doctxm.hxx>
#include <poolfmt.hxx>
-
+#include <switerator.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
@@ -115,9 +115,8 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
if( pSplitColl->GetAttrOutlineLevel() == 0 )//<-end,zhaojianwei, 0814
{
pOutlNds = new SwOutlineNodes( 8, 8 );
- SwClientIter aIter( *(SwModify*)pSplitColl );
- for( SwTxtNode* pTNd = (SwTxtNode*)aIter.First( TYPE( SwTxtNode ));
- pTNd; pTNd = (SwTxtNode*)aIter.Next() )
+ SwIterator<SwTxtNode,SwFmtColl> aIter( *pSplitColl );
+ for( SwTxtNode* pTNd = aIter.First(); pTNd; pTNd = aIter.Next() )
if( pTNd->GetNodes().IsDocNodes() )
pOutlNds->Insert( pTNd );
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 631225ded54d..46dfe7ec0e2c 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -694,8 +694,8 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
}
// Frames anlegen
- if( GetRootFrm() )
- pFmt->MakeFrms(); // ???
+ if( GetCurrentViewShell() )
+ pFmt->MakeFrms(); // ??? //swmod 071108//swmod 071225
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -965,7 +965,7 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
SwDrawContact* pContact = new SwDrawContact( pFmt, &rDrawObj );
// ggfs. Frames anlegen
- if( GetRootFrm() )
+ if( GetCurrentViewShell() )
{
pFmt->MakeFrms();
// #i42319# - follow-up of #i35635#
@@ -1058,11 +1058,11 @@ void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts,
// kein Layout oder nur ein Teil, dann wars das
// Seitenbezogen Flys nur, wenn vollstaendig "gewuenscht" wird !
- if( !GetRootFrm() || pCmpRange )
+ if( !GetCurrentViewShell() || pCmpRange ) //swmod 071108//swmod 071225
return;
pFPos = 0;
- SwPageFrm *pPage = (SwPageFrm*)GetRootFrm()->GetLower();
+ SwPageFrm *pPage = (SwPageFrm*)GetCurrentLayout()->GetLower(); //swmod 080218
while( pPage )
{
if( pPage->GetSortedObjs() )
@@ -1245,6 +1245,17 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//Erstmal das Format zum Fly besorgen und das Layout entkoppeln.
SwFrmFmt *pOldFmt = rDoc.GetNodes()[nNdIdx]->GetFlyFmt();
OSL_ENSURE( pOldFmt, "Format des Fly nicht gefunden." );
+ // --> OD #i115719#
+ // <title> and <description> attributes are lost when calling <DelFrms()>.
+ // Thus, keep them and restore them after the calling <MakeFrms()>
+ const bool bIsSwFlyFrmFmtInstance( dynamic_cast<SwFlyFrmFmt*>(pOldFmt) != 0 );
+ const String sTitle( bIsSwFlyFrmFmtInstance
+ ? static_cast<SwFlyFrmFmt*>(pOldFmt)->GetObjTitle()
+ : String() );
+ const String sDescription( bIsSwFlyFrmFmtInstance
+ ? static_cast<SwFlyFrmFmt*>(pOldFmt)->GetObjDescription()
+ : String() );
+ // <--
pOldFmt->DelFrms();
pNewFmt = rDoc.MakeFlyFrmFmt( rDoc.GetUniqueFrameName(),
@@ -1382,6 +1393,13 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//Nun nur noch die Flys erzeugen lassen. Das ueberlassen
//wir vorhanden Methoden (insb. fuer InCntFlys etwas aufwendig).
pNewFmt->MakeFrms();
+ // --> OD #i115719#
+ if ( bIsSwFlyFrmFmtInstance )
+ {
+ static_cast<SwFlyFrmFmt*>(pOldFmt)->SetObjTitle( sTitle );
+ static_cast<SwFlyFrmFmt*>(pOldFmt)->SetObjDescription( sDescription );
+ }
+ // <--
}
break;
@@ -1840,11 +1858,12 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
pModLogFile = new ::rtl::Logfile( "First DoIdleJobs" );
#endif
- if( GetRootFrm() && GetRootFrm()->GetCurrShell() &&
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
+ if( pTmpRoot &&
!SfxProgress::GetActiveProgress( pDocShell ) )
{
ViewShell *pSh, *pStartSh;
- pSh = pStartSh = GetRootFrm()->GetCurrShell();
+ pSh = pStartSh = GetCurrentViewShell();
do {
if( pSh->ActionPend() )
{
@@ -1855,10 +1874,9 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
pSh = (ViewShell*)pSh->GetNext();
} while( pSh != pStartSh );
- if (GetRootFrm()->IsNeedGrammarCheck())
+ if( pTmpRoot->IsNeedGrammarCheck() )
{
sal_Bool bIsOnlineSpell = pSh->GetViewOptions()->IsOnlineSpell();
-
sal_Bool bIsAutoGrammar = sal_False;
SvtLinguConfig().GetProperty( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
UPN_IS_GRAMMAR_AUTO )) ) >>= bIsAutoGrammar;
@@ -1866,12 +1884,20 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
if (bIsOnlineSpell && bIsAutoGrammar)
StartGrammarChecking( *this );
}
-
- sal_uInt16 nFldUpdFlag;
- if( GetRootFrm()->IsIdleFormat() )
- GetRootFrm()->GetCurrShell()->LayoutIdle();
- else if( ( AUTOUPD_FIELD_ONLY ==
- ( nFldUpdFlag = static_cast<sal_uInt16>(getFieldUpdateFlags(true)) )
+ SwFldUpdateFlags nFldUpdFlag;
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080320
+ std::set<SwRootFrm*>::iterator pLayIter = aAllLayouts.begin();
+ for ( ;pLayIter != aAllLayouts.end();pLayIter++ )
+ {
+ if ((*pLayIter)->IsIdleFormat())
+ {
+ (*pLayIter)->GetCurrShell()->LayoutIdle();
+ break;
+ }
+ }
+ bool bAllValid = pLayIter == aAllLayouts.end() ? 1 : 0;
+ if( bAllValid && ( AUTOUPD_FIELD_ONLY ==
+ ( nFldUpdFlag = getFieldUpdateFlags(true) )
|| AUTOUPD_FIELD_AND_CHARTS == nFldUpdFlag ) &&
GetUpdtFlds().IsFieldsDirty() &&
!GetUpdtFlds().IsInUpdateFlds() &&
@@ -1883,25 +1909,25 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
// chaos::Action-Klammerung!
GetUpdtFlds().SetInUpdateFlds( sal_True );
- GetRootFrm()->StartAllAction();
+ pTmpRoot->StartAllAction();
// no jump on update of fields #i85168#
const sal_Bool bOldLockView = pStartSh->IsViewLocked();
pStartSh->LockView( sal_True );
- GetSysFldType( RES_CHAPTERFLD )->Modify( 0, 0 ); // KapitelFld
+ GetSysFldType( RES_CHAPTERFLD )->ModifyNotification( 0, 0 ); // KapitelFld
UpdateExpFlds( 0, sal_False ); // Expression-Felder Updaten
UpdateTblFlds(NULL); // Tabellen
UpdateRefFlds(NULL); // Referenzen
- GetRootFrm()->EndAllAction();
+ pTmpRoot->EndAllAction();
pStartSh->LockView( bOldLockView );
GetUpdtFlds().SetInUpdateFlds( sal_False );
GetUpdtFlds().SetFieldsDirty( sal_False );
}
- }
+ } //swmod 080219
#ifdef TIMELOG
if( pModLogFile && 1 != (long)pModLogFile )
delete pModLogFile, ((long&)pModLogFile) = 1;
@@ -1914,7 +1940,7 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
IMPL_STATIC_LINK( SwDoc, BackgroundDone, SvxBrushItem*, EMPTYARG )
{
ViewShell *pSh, *pStartSh;
- pSh = pStartSh = pThis->GetRootFrm()->GetCurrShell();
+ pSh = pStartSh = pThis->GetCurrentViewShell(); //swmod 071108//swmod 071225
if( pStartSh )
do {
if( pSh->GetWin() )
@@ -2151,9 +2177,9 @@ sal_Bool SwDoc::IsInHeaderFooter( const SwNodeIndex& rIdx ) const
// Redlines auch an Start- und Endnodes haengen, muss der Index nicht
// unbedingt der eines Content-Nodes sein.
SwNode* pNd = &rIdx.GetNode();
- if( pNd->IsCntntNode() && pLayout )
+ if( pNd->IsCntntNode() && pCurrentView )//swmod 071029//swmod 071225
{
- const SwFrm *pFrm = pNd->GetCntntNode()->GetFrm();
+ const SwFrm *pFrm = pNd->GetCntntNode()->getLayoutFrm( GetCurrentLayout() );
if( pFrm )
{
const SwFrm *pUp = pFrm->GetUpper();
@@ -2265,11 +2291,74 @@ sal_Bool SwDoc::IsInVerticalText( const SwPosition& rPos, const Point* pPt ) con
return FRMDIR_VERT_TOP_RIGHT == nDir || FRMDIR_VERT_TOP_LEFT == nDir;
}
-const SwRootFrm* SwDoc::GetRootFrm() const { return pLayout; }
-SwRootFrm* SwDoc::GetRootFrm() { return pLayout; }
-void SwDoc::SetRootFrm( SwRootFrm* pNew ) { pLayout = pNew; }
-SwLayouter* SwDoc::GetLayouter() { return pLayouter; }
-const SwLayouter* SwDoc::GetLayouter() const { return pLayouter; }
-void SwDoc::SetLayouter( SwLayouter* pNew ) { pLayouter = pNew; }
+void SwDoc::SetCurrentViewShell( ViewShell* pNew )
+{
+ pCurrentView = pNew;
+}
+
+SwLayouter* SwDoc::GetLayouter()
+{
+ return pLayouter;
+}
+
+const SwLayouter* SwDoc::GetLayouter() const
+{
+ return pLayouter;
+}
+
+void SwDoc::SetLayouter( SwLayouter* pNew )
+{
+ pLayouter = pNew;
+}
+
+const ViewShell *SwDoc::GetCurrentViewShell() const
+{
+ return pCurrentView;
+}
+
+ViewShell *SwDoc::GetCurrentViewShell()
+{
+ return pCurrentView;
+} //swmod 080219 It must be able to communicate to a ViewShell.This is going to be removedd later.
+
+const SwRootFrm *SwDoc::GetCurrentLayout() const
+{
+ if(GetCurrentViewShell())
+ return GetCurrentViewShell()->GetLayout();
+ return 0;
+}
+
+SwRootFrm *SwDoc::GetCurrentLayout()
+{
+ if(GetCurrentViewShell())
+ return GetCurrentViewShell()->GetLayout();
+ return 0;
+}
+
+bool SwDoc::HasLayout() const
+{
+ // if there is a view, there is always a layout
+ return (pCurrentView != 0);
+}
+
+std::set<SwRootFrm*> SwDoc::GetAllLayouts()
+{
+ std::set<SwRootFrm*> aAllLayouts;
+ ViewShell *pStart = GetCurrentViewShell();
+ ViewShell *pTemp = pStart;
+ if ( pTemp )
+ {
+ do
+ {
+ if (pTemp->GetLayout())
+ {
+ aAllLayouts.insert(pTemp->GetLayout());
+ pTemp = (ViewShell*)pTemp->GetNext();
+ }
+ } while(pTemp!=pStart);
+ }
+
+ return aAllLayouts;
+}//swmod 070825
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 754b9b000183..5c18528525f7 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -229,7 +229,7 @@ SwDoc::SwDoc()
pGrfFmtCollTbl( new SwGrfFmtColls() ),
pTOXTypes( new SwTOXTypes() ),
pDefTOXBases( new SwDefTOXBase_Impl() ),
- pLayout( 0 ), // Rootframe des spezifischen Layouts.
+ pCurrentView( 0 ), //swmod 071225
pDrawModel( 0 ),
pUpdtFlds( new SwDocUpdtFld() ),
pFldTypes( new SwFldTypes() ),
@@ -278,6 +278,7 @@ SwDoc::SwDoc()
mbClipBoard( false ),
mbColumnSelection( false ),
mbProtectForm(false), // i#78591#
+ mbLastBrowseMode( false ),
n32DummyCompatabilityOptions1(0),
n32DummyCompatabilityOptions2(0),
mbStartIdleTimer(sal_False)
@@ -292,7 +293,6 @@ SwDoc::SwDoc()
mbUpdateExpFld =
mbNewDoc =
mbCopyIsMove =
- mbBrowseMode =
mbInReading =
mbInXMLImport =
mbUpdateTOX =
@@ -492,8 +492,6 @@ SwDoc::~SwDoc()
mbDtor = sal_True;
- DELETEZ( pLayout );
-
delete pRedlineTbl;
delete pUnoCrsrTbl;
delete pAutoFmtRedlnComment;
@@ -572,10 +570,8 @@ SwDoc::~SwDoc()
// Delete fuer Collections
// damit die Abhaengigen wech sind
- SwTxtFmtColl *pFtnColl = pFtnInfo->GetFtnTxtColl();
- if ( pFtnColl ) pFtnColl->Remove(pFtnInfo);
- pFtnColl = pEndNoteInfo->GetFtnTxtColl();
- if ( pFtnColl ) pFtnColl->Remove(pEndNoteInfo);
+ pFtnInfo->ReleaseCollection();
+ pEndNoteInfo->ReleaseCollection();
OSL_ENSURE( pDfltTxtFmtColl == (*pTxtFmtCollTbl)[0],
"Default-Text-Collection muss immer am Anfang stehen" );
@@ -786,7 +782,7 @@ void SwDoc::ClearDoc()
// den ersten immer wieder neu anlegen (ohne Attribute/Vorlagen/...)
SwTxtNode* pFirstNd = GetNodes().MakeTxtNode( aSttIdx, pDfltTxtFmtColl );
- if( pLayout )
+ if( pCurrentView ) //swmod 071029//swmod 071225
{
// set the layout to the dummy pagedesc
pFirstNd->SetAttr( SwFmtPageDesc( pDummyPgDsc ));
@@ -819,10 +815,8 @@ void SwDoc::ClearDoc()
// Delete fuer Collections
// damit die Abhaengigen wech sind
- SwTxtFmtColl* pFtnColl = pFtnInfo->GetFtnTxtColl();
- if( pFtnColl ) pFtnColl->Remove( pFtnInfo );
- pFtnColl = pEndNoteInfo->GetFtnTxtColl();
- if( pFtnColl ) pFtnColl->Remove( pEndNoteInfo );
+ pFtnInfo->ReleaseCollection();
+ pEndNoteInfo->ReleaseCollection();
// opt.: ausgehend davon, das Standard als 2. im Array
// steht, sollte das als letztes geloescht werden, damit
@@ -833,14 +827,14 @@ void SwDoc::ClearDoc()
pGrfFmtCollTbl->DeleteAndDestroy( 1, pGrfFmtCollTbl->Count()-1 );
pCharFmtTbl->DeleteAndDestroy( 1, pCharFmtTbl->Count()-1 );
- if( pLayout )
+ if( pCurrentView )
{
// search the FrameFormat of the root frm. This is not allowed to delete
- pFrmFmtTbl->Remove( pFrmFmtTbl->GetPos( pLayout->GetFmt() ) );
+ pFrmFmtTbl->Remove( pFrmFmtTbl->GetPos( pCurrentView->GetLayout()->GetFmt() ) );
pFrmFmtTbl->DeleteAndDestroy( 1, pFrmFmtTbl->Count()-1 );
- pFrmFmtTbl->Insert( pLayout->GetFmt(), pFrmFmtTbl->Count() );
+ pFrmFmtTbl->Insert( pCurrentView->GetLayout()->GetFmt(), pFrmFmtTbl->Count() );
}
- else
+ else //swmod 071029//swmod 071225
pFrmFmtTbl->DeleteAndDestroy( 1, pFrmFmtTbl->Count()-1 );
xForbiddenCharsTable.clear();
@@ -938,7 +932,7 @@ void SwDoc::UpdateLinks( sal_Bool bUI )
SfxMedium* pMedium = GetDocShell()->GetMedium();
SfxFrame* pFrm = pMedium ? pMedium->GetLoadTargetFrame() : 0;
Window* pDlgParent = pFrm ? &pFrm->GetWindow() : 0;
- if( GetRootFrm() && !GetEditShell( &pVSh ) && !pVSh )
+ if( GetCurrentViewShell() && !GetEditShell( &pVSh ) && !pVSh ) //swmod 071108//swmod 071225
{
ViewShell aVSh( *this, 0, 0 );
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 2f423a902b78..b184b636162b 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -60,9 +60,9 @@
#include <frmatr.hxx>
#include <SwStyleNameMapper.hxx>
#include <SwNodeNum.hxx>
-
#include <list.hxx>
#include <listfunc.hxx>
+#include <switerator.hxx>
#include <map>
@@ -140,8 +140,6 @@ void SwDoc::PropagateOutlineRule()
if(pColl->IsAssignedToListLevelOfOutlineStyle())//<-end,zhaojianwei
{
- SwClientIter aIter(*pColl);
-
// Check only the list style, which is set at the paragraph style
const SwNumRuleItem & rCollRuleItem = pColl->GetNumRule( sal_False );
@@ -1161,11 +1159,10 @@ void SwDoc::StopNumRuleAnimations( OutputDevice* pOut )
aTxtNodeIter != aTxtNodeList.end(); ++aTxtNodeIter )
{
SwTxtNode* pTNd = *aTxtNodeIter;
- SwClientIter aIter( *pTNd );
- for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
- pFrm; pFrm = (SwFrm*)aIter.Next() )
- if( ((SwTxtFrm*)pFrm)->HasAnimation() )
- ((SwTxtFrm*)pFrm)->StopAnimation( pOut );
+ SwIterator<SwTxtFrm,SwTxtNode> aIter(*pTNd);
+ for(SwTxtFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
+ if( pFrm->HasAnimation() )
+ pFrm->StopAnimation( pOut );
}
}
}
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index e409ec3462d8..bbd8bc4ee608 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -2770,8 +2770,8 @@ void SwRedlineTbl::Remove( sal_uInt16 nP, sal_uInt16 nL )
_SwRedlineTbl::Remove( nP, nL );
ViewShell* pSh;
- if( pDoc && !pDoc->IsInDtor() && pDoc->GetRootFrm() &&
- 0 != ( pSh = pDoc->GetRootFrm()->GetCurrShell()) )
+ if( pDoc && !pDoc->IsInDtor() &&
+ 0 != ( pSh = pDoc->GetCurrentViewShell()) ) //swmod 071108//swmod 071225
pSh->InvalidateWindows( SwRect( 0, 0, LONG_MAX, LONG_MAX ) );
}
@@ -2784,8 +2784,8 @@ void SwRedlineTbl::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )
_SwRedlineTbl::DeleteAndDestroy( nP, nL );
ViewShell* pSh;
- if( pDoc && !pDoc->IsInDtor() && pDoc->GetRootFrm() &&
- 0 != ( pSh = pDoc->GetRootFrm()->GetCurrShell()) )
+ if( pDoc && !pDoc->IsInDtor() &&
+ 0 != ( pSh = pDoc->GetCurrentViewShell() ) ) //swmod 071108//swmod 071225
pSh->InvalidateWindows( SwRect( 0, 0, LONG_MAX, LONG_MAX ) );
}
@@ -3276,7 +3276,7 @@ void SwRedline::InvalidateRange() // das Layout anstossen
{
aHt.nStart = n == nSttNd ? nSttCnt : 0;
aHt.nEnd = n == nEndNd ? nEndCnt : ((SwTxtNode*)pNd)->GetTxt().Len();
- ((SwTxtNode*)pNd)->Modify( &aHt, &aHt );
+ ((SwTxtNode*)pNd)->ModifyNotification( &aHt, &aHt );
}
}
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 00d425324f25..870265cb288d 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -77,6 +77,7 @@
#include <breakit.hxx>
#include <editsh.hxx>
#include <scriptinfo.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
@@ -255,19 +256,20 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
const SwTOXMark* pMax = &rCurTOXMark;
const SwTOXMark* pMin = &rCurTOXMark;
- const SwModify* pType = rCurTOXMark.GetRegisteredIn();
- SwClientIter aIter( *(SwModify*)pType );
+ const SwTOXType* pType = rCurTOXMark.GetTOXType();
+ SwTOXMarks aMarks;
+ SwTOXMark::InsertTOXMarks( aMarks, *pType );
const SwTOXMark* pTOXMark;
const SwCntntFrm* pCFrm;
Point aPt;
- for( pTOXMark = (SwTOXMark*)aIter.First( TYPE( SwTOXMark )); pTOXMark;
- pTOXMark = (SwTOXMark*)aIter.Next() )
+ for( sal_Int32 nMark=0; nMark<aMarks.Count(); nMark++ )
{
+ pTOXMark = aMarks[nMark];
if( pTOXMark != &rCurTOXMark &&
0 != ( pMark = pTOXMark->GetTxtTOXMark()) &&
0 != ( pTOXSrc = pMark->GetpTxtNd() ) &&
- 0 != ( pCFrm = pTOXSrc->GetFrm( &aPt, 0, sal_False )) &&
+ 0 != ( pCFrm = pTOXSrc->getLayoutFrm( GetCurrentLayout(), &aPt, 0, sal_False )) &&
( bInReadOnly || !pCFrm->IsProtected() ))
{
CompareNodeCntnt aAbsNew( pTOXSrc->GetIndex(), *pMark->GetStart() );
@@ -775,7 +777,7 @@ sal_Bool SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart
Beschreibung: Verzeichnisinhalt zusammensammeln
--------------------------------------------------------------------*/
void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
- const bool _bNewTOX )
+ const bool _bNewTOX )//swmodtest 080307
{
const SwSectionNode* pSectNd;
if( !SwTOXBase::GetRegisteredIn()->GetDepends() ||
@@ -1053,8 +1055,11 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
pDoc->GetNodes().Delete( aInsPos, 1 );
aN2L.RestoreUpperFrms( pDoc->GetNodes(), nIdx, nIdx + 1 );
- if(pDoc->GetRootFrm())
- SwFrm::CheckPageDescs( (SwPageFrm*)pDoc->GetRootFrm()->Lower() );
+ std::set<SwRootFrm*> aAllLayouts = pDoc->GetAllLayouts();
+ for ( std::set<SwRootFrm*>::iterator pLayoutIter = aAllLayouts.begin(); pLayoutIter != aAllLayouts.end(); pLayoutIter++)
+ {
+ SwFrm::CheckPageDescs( (SwPageFrm*)(*pLayoutIter)->Lower() );
+ }//swmod 080310
SetProtect( SwTOXBase::IsProtected() );
}
@@ -1159,18 +1164,17 @@ SwTxtFmtColl* SwTOXBaseSection::GetTxtFmtColl( sal_uInt16 nLevel )
void SwTOXBaseSection::UpdateMarks( const SwTOXInternational& rIntl,
const SwTxtNode* pOwnChapterNode )
{
- const SwModify* pType = SwTOXBase::GetRegisteredIn();
+ const SwTOXType* pType = (SwTOXType*) SwTOXBase::GetRegisteredIn();
if( !pType->GetDepends() )
return;
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
TOXTypes eTOXTyp = GetTOXType()->GetType();
- SwClientIter aIter( *(SwModify*)pType );
+ SwIterator<SwTOXMark,SwTOXType> aIter( *pType );
SwTxtTOXMark* pTxtMark;
SwTOXMark* pMark;
- for( pMark = (SwTOXMark*)aIter.First( TYPE( SwTOXMark )); pMark;
- pMark = (SwTOXMark*)aIter.Next() )
+ for( pMark = aIter.First(); pMark; pMark = aIter.Next() )
{
::SetProgressState( 0, pDoc->GetDocShell() );
@@ -1184,7 +1188,7 @@ void SwTOXBaseSection::UpdateMarks( const SwTOXInternational& rIntl,
// if selected use marks from the same chapter only
if( pTOXSrc->GetNodes().IsDocNodes() &&
pTOXSrc->GetTxt().Len() && pTOXSrc->GetDepends() &&
- pTOXSrc->GetFrm() &&
+ pTOXSrc->getLayoutFrm( pDoc->GetCurrentLayout() ) &&
(!IsFromChapter() || ::lcl_FindChapterNode( *pTOXSrc, 0 ) == pOwnChapterNode ) &&
!pTOXSrc->HasHiddenParaField() &&
!SwScriptInfo::IsInHiddenRange( *pTOXSrc, *pTxtMark->GetStart() ) )
@@ -1244,7 +1248,7 @@ void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode )
SwTxtNode* pTxtNd = rOutlNds[ n ]->GetTxtNode();
if( pTxtNd && pTxtNd->Len() && pTxtNd->GetDepends() &&
sal_uInt16( pTxtNd->GetAttrOutlineLevel()) <= GetLevel() &&
- pTxtNd->GetFrm() &&
+ pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout() ) &&
!pTxtNd->HasHiddenParaField() &&
!pTxtNd->HasHiddenCharAttribute( true ) &&
( !IsFromChapter() ||
@@ -1278,13 +1282,12 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
pColl->IsAssignedToListLevelOfOutlineStyle()) )
continue;
- SwClientIter aIter( *pColl );
- SwTxtNode* pTxtNd = (SwTxtNode*)aIter.First( TYPE( SwTxtNode ));
- for( ; pTxtNd; pTxtNd = (SwTxtNode*)aIter.Next() )
+ SwIterator<SwTxtNode,SwFmtColl> aIter( *pColl );
+ for( SwTxtNode* pTxtNd = aIter.First(); pTxtNd; pTxtNd = aIter.Next() )
{
::SetProgressState( 0, pDoc->GetDocShell() );
- if( pTxtNd->GetTxt().Len() && pTxtNd->GetFrm() &&
+ if( pTxtNd->GetTxt().Len() && pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout() ) &&
pTxtNd->GetNodes().IsDocNodes() &&
( !IsFromChapter() || pOwnChapterNode ==
::lcl_FindChapterNode( *pTxtNd, 0 ) ) )
@@ -1307,9 +1310,8 @@ void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode )
if(!pSeqFld)
return;
- SwClientIter aIter( *pSeqFld );
- SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
- for( ; pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pSeqFld );
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
if(!pTxtFld)
@@ -1317,7 +1319,7 @@ void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode )
const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
::SetProgressState( 0, pDoc->GetDocShell() );
- if( rTxtNode.GetTxt().Len() && rTxtNode.GetFrm() &&
+ if( rTxtNode.GetTxt().Len() && rTxtNode.getLayoutFrm( pDoc->GetCurrentLayout() ) &&
rTxtNode.GetNodes().IsDocNodes() &&
( !IsFromChapter() ||
::lcl_FindChapterNode( rTxtNode, 0 ) == pOwnChapterNode ) )
@@ -1345,9 +1347,8 @@ void SwTOXBaseSection::UpdateAuthorities( const SwTOXInternational& rIntl )
if(!pAuthFld)
return;
- SwClientIter aIter( *pAuthFld );
- SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
- for( ; pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pAuthFld );
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
//undo
@@ -1356,11 +1357,11 @@ void SwTOXBaseSection::UpdateAuthorities( const SwTOXInternational& rIntl )
const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
::SetProgressState( 0, pDoc->GetDocShell() );
- if( rTxtNode.GetTxt().Len() && rTxtNode.GetFrm() &&
+ if( rTxtNode.GetTxt().Len() && rTxtNode.getLayoutFrm( pDoc->GetCurrentLayout() ) &&
rTxtNode.GetNodes().IsDocNodes() )
{
//#106485# the body node has to be used!
- SwCntntFrm *pFrm = rTxtNode.GetFrm();
+ SwCntntFrm *pFrm = rTxtNode.getLayoutFrm( pDoc->GetCurrentLayout() );
SwPosition aFldPos(rTxtNode);
const SwTxtNode* pTxtNode = 0;
if(pFrm && !pFrm->IsInDocBody())
@@ -1506,7 +1507,7 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
}
}
- if( pCNd->GetFrm() && ( !IsFromChapter() ||
+ if( pCNd->getLayoutFrm( pDoc->GetCurrentLayout() ) && ( !IsFromChapter() ||
::lcl_FindChapterNode( *pCNd, 0 ) == pOwnChapterNode ))
{
SwTOXPara * pNew = new SwTOXPara( *pCNd, eMyType,
@@ -1546,7 +1547,7 @@ void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode )
while( 0 != ( pCNd = rNds.GoNext( &aCntntIdx ) ) &&
aCntntIdx.GetIndex() < pTblNd->EndOfSectionIndex() )
{
- if( pCNd->GetFrm() && (!IsFromChapter() ||
+ if( pCNd->getLayoutFrm( pDoc->GetCurrentLayout() ) && (!IsFromChapter() ||
::lcl_FindChapterNode( *pCNd, 0 ) == pOwnChapterNode ))
{
SwTOXTable * pNew = new SwTOXTable( *pCNd );
@@ -1683,7 +1684,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
long nRightMargin;
if( pPageDesc )
{
- const SwFrm* pFrm = pTOXNd->GetFrm( 0, 0, sal_True );
+ const SwFrm* pFrm = pTOXNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0, 0, sal_True );
if( !pFrm || 0 == ( pFrm = pFrm->FindPageFrm() ) ||
pPageDesc != ((SwPageFrm*)pFrm)->GetPageDesc() )
// dann muss man ueber den PageDesc gehen
@@ -1768,7 +1769,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
if ( pTOXSource && pTOXSource->pNd &&
pTOXSource->pNd->IsCntntNode() )
{
- const SwCntntFrm* pFrm = pTOXSource->pNd->GetFrm();
+ const SwCntntFrm* pFrm = pTOXSource->pNd->getLayoutFrm( pDoc->GetCurrentLayout() );
if( pFrm )
{
SwChapterFieldType aFldTyp;
@@ -1941,7 +1942,7 @@ void SwTOXBaseSection::UpdatePageNum()
SwTOXSource& rTOXSource = pSortBase->aTOXSources[j];
if( rTOXSource.pNd )
{
- SwCntntFrm* pFrm = rTOXSource.pNd->GetFrm();
+ SwCntntFrm* pFrm = rTOXSource.pNd->getLayoutFrm( pDoc->GetCurrentLayout() );
OSL_ENSURE( pFrm || pDoc->IsUpdateTOX(), "TOX, no Frame found");
if( !pFrm )
continue;
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index 04f3ffcdb008..be40cb0fb67f 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -36,16 +36,14 @@
#include <editeng/fhgtitem.hxx>
#include <doc.hxx> // fuer GetAttrPool
#include <fmtcol.hxx>
-#include <fmtcolfunc.hxx> // #i71574#
+#include <fmtcolfunc.hxx>
#include <hints.hxx>
#include <calc.hxx>
#include <node.hxx>
#include <numrule.hxx>
#include <paratr.hxx>
-
-//--> #outlinelevel added by zhaojianwei
+#include <switerator.hxx>
#include <svl/intitem.hxx>
-//<--end
TYPEINIT1( SwTxtFmtColl, SwFmtColl );
TYPEINIT1( SwGrfFmtColl, SwFmtColl );
@@ -136,7 +134,7 @@ namespace TxtFmtCollFunc
* SwTxtFmtColl TXT
*/
-void SwTxtFmtColl::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( GetDoc()->IsInDtor() )
{
@@ -350,10 +348,10 @@ void SwTxtFmtColl::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
sal_Bool SwTxtFmtColl::IsAtDocNodeSet() const
{
- SwClientIter aIter( *(SwModify*)this );
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *this );
const SwNodes& rNds = GetDoc()->GetNodes();
- for( SwClient* pC = aIter.First(TYPE(SwCntntNode)); pC; pC = aIter.Next() )
- if( &((SwCntntNode*)pC)->GetNodes() == &rNds )
+ for( SwCntntNode* pNode = aIter.First(); pNode; pNode = aIter.Next() )
+ if( &(pNode->GetNodes()) == &rNds )
return sal_True;
return sal_False;
@@ -534,6 +532,12 @@ SwCollCondition::~SwCollCondition()
delete aSubCondition.pFldExpression;
}
+void SwCollCondition::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add( this );
+}
+
+
int SwCollCondition::operator==( const SwCollCondition& rCmp ) const
{
@@ -671,9 +675,8 @@ void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
SetAttrOutlineLevel(nAssignedListLevel+1);
// #i100277#
- SwClientIter aIter( *this );
- SwTxtFmtColl* pDerivedTxtFmtColl =
- dynamic_cast<SwTxtFmtColl*>(aIter.First( TYPE( SwTxtFmtColl ) ));
+ SwIterator<SwTxtFmtColl,SwFmtColl> aIter( *this );
+ SwTxtFmtColl* pDerivedTxtFmtColl = aIter.First();
while ( pDerivedTxtFmtColl != 0 )
{
if ( !pDerivedTxtFmtColl->IsAssignedToListLevelOfOutlineStyle() )
@@ -689,7 +692,7 @@ void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
}
}
- pDerivedTxtFmtColl = dynamic_cast<SwTxtFmtColl*>(aIter.Next());
+ pDerivedTxtFmtColl = aIter.Next();
}
// <--
}
diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx
index e0e257505ba7..0304d41ddf3d 100644
--- a/sw/source/core/doc/ftnidx.cxx
+++ b/sw/source/core/doc/ftnidx.cxx
@@ -221,6 +221,8 @@ void SwFtnIdxs::UpdateAllFtn()
SwUpdFtnEndNtAtEnd aNumArr;
+ SwRootFrm* pTmpRoot = pDoc->GetCurrentLayout();//swmod 080305
+ std::set<SwRootFrm*> aAllLayouts = pDoc->GetAllLayouts();
//Fuer normale Fussnoten werden Chapter- und Dokumentweise Nummerierung
//getrennt behandelt. Fuer Endnoten gibt es nur die Dokumentweise
//Nummerierung.
@@ -231,7 +233,6 @@ void SwFtnIdxs::UpdateAllFtn()
nFtnIdx = 0; // Index in das FtnIdx-Array
for( sal_uInt16 n = 0; n < rOutlNds.Count(); ++n )
{
- //if( !rOutlNds[ n ]->GetTxtNode()->GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
if ( rOutlNds[ n ]->GetTxtNode()->GetAttrOutlineLevel() == 1 )//<-end,zhaojianwei
{
sal_uLong nCapStt = rOutlNds[ n ]->GetIndex(); // Start eines neuen Kapitels
@@ -293,8 +294,8 @@ void SwFtnIdxs::UpdateAllFtn()
}
}
- if( pDoc->GetRootFrm() && FTNNUM_PAGE == rFtnInfo.eNum )
- pDoc->GetRootFrm()->UpdateFtnNums();
+ if( pTmpRoot && FTNNUM_PAGE == rFtnInfo.eNum )
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFtnNums));//swmod 0
}
SwTxtFtn* SwFtnIdxs::SeekEntry( const SwNodeIndex& rPos, sal_uInt16* pFndPos ) const
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index 8252e86feb2b..0147bdce47ca 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -46,9 +46,10 @@
#include "poolfmt.hxx"
#include "viewsh.hxx"
#include "tabfrm.hxx"
-
+#include "viewopt.hxx"
#include "htmltbl.hxx"
#include "ndindex.hxx"
+#include "switerator.hxx"
using namespace ::com::sun::star;
@@ -352,7 +353,7 @@ sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByVisArea( const SwDoc& rDoc )
sal_uInt16 SwHTMLTableLayout::GetBrowseWidth( const SwDoc& rDoc )
{
// Wenn ein Layout da ist, koennen wir die Breite dort herholen.
- const SwRootFrm *pRootFrm = rDoc.GetRootFrm();
+ const SwRootFrm *pRootFrm = rDoc.GetCurrentLayout(); //swmod 080218
if( pRootFrm )
{
const SwFrm *pPageFrm = pRootFrm->GetLower();
@@ -403,11 +404,10 @@ sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByTabFrm(
sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByTable( const SwDoc& rDoc ) const
{
sal_uInt16 nBrowseWidth = 0;
- SwClientIter aIter( *(SwModify*)pSwTable->GetFrmFmt() );
- SwClient* pCli = aIter.First( TYPE( SwTabFrm ));
- if( pCli )
+ SwTabFrm* pFrm = SwIterator<SwTabFrm,SwFmt>::FirstElement( *pSwTable->GetFrmFmt() );
+ if( pFrm )
{
- nBrowseWidth = GetBrowseWidthByTabFrm( *(SwTabFrm*)pCli );
+ nBrowseWidth = GetBrowseWidthByTabFrm( *pFrm );
}
else
{
@@ -1737,16 +1737,16 @@ void SwHTMLTableLayout::_Resize( sal_uInt16 nAbsAvail, sal_Bool bRecalc )
if( bRecalc )
AutoLayoutPass1();
- SwRootFrm *pRoot = (SwRootFrm*)GetDoc()->GetRootFrm();
+ SwRootFrm *pRoot = (SwRootFrm*)GetDoc()->GetCurrentViewShell()->GetLayout();
if ( pRoot && pRoot->IsCallbackActionEnabled() )
- pRoot->StartAllAction();
+ pRoot->StartAllAction(); //swmod 071108//swmod 071225
// Sonst koennen die Breiten gesetzt werden, wobei zuvor aber jewils
// noch der Pass 2 laufen muss.
SetWidths( sal_True, nAbsAvail );
if ( pRoot && pRoot->IsCallbackActionEnabled() )
- pRoot->EndAllAction( sal_True ); //True per VirDev (Browsen ruhiger)
+ pRoot->EndAllAction( sal_True ); //True per VirDev (Browsen ruhiger) //swmod 071108//swmod 071225
}
IMPL_STATIC_LINK( SwHTMLTableLayout, DelayedResize_Impl, void*, EMPTYARG )
@@ -1780,7 +1780,7 @@ sal_Bool SwHTMLTableLayout::Resize( sal_uInt16 nAbsAvail, sal_Bool bRecalc,
// und nicht die der VisArea uebergeben. Wenn wir nicht in einem Rahmen
// stehen, muss die Tabelle allerdings fuer die VisArea berechnet werden,
// weil sond die Umschaltung von relativ nach absolut nicht funktioniert.
- if( pDoc->GetRootFrm() && pDoc->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if( pDoc->GetCurrentViewShell() && pDoc->GetCurrentViewShell()->GetViewOptions()->getBrowseMode() )
{
const sal_uInt16 nVisAreaWidth = GetBrowseWidthByVisArea( *pDoc );
if( nVisAreaWidth < nAbsAvail && !FindFlyFrmFmt() )
diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx
index 8addb27cf01e..3fa6e2e0867d 100644
--- a/sw/source/core/doc/lineinfo.cxx
+++ b/sw/source/core/doc/lineinfo.cxx
@@ -35,19 +35,22 @@
#include "poolfmt.hxx"
#include "rootfrm.hxx"
#include "viewsh.hxx"
-
+#include <set>
void SwDoc::SetLineNumberInfo( const SwLineNumberInfo &rNew )
{
- if ( GetRootFrm() &&
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
+ if ( pTmpRoot &&
(rNew.IsCountBlankLines() != pLineNumberInfo->IsCountBlankLines() ||
rNew.IsRestartEachPage() != pLineNumberInfo->IsRestartEachPage()) )
{
- GetRootFrm()->StartAllAction();
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080225
+ pTmpRoot->StartAllAction();
// FME 2007-08-14 #i80120# Invalidate size, because ChgThisLines()
// is only (onny may only be) called by the formatting routines
- GetRootFrm()->InvalidateAllCntnt( INV_LINENUM | INV_SIZE );
- GetRootFrm()->EndAllAction();
- }
+ //pTmpRoot->InvalidateAllCntnt( INV_LINENUM | INV_SIZE );
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_LINENUM | INV_SIZE));//swmod 080226
+ pTmpRoot->EndAllAction();
+ } //swmod 080219
*pLineNumberInfo = rNew;
SetModified();
}
@@ -90,7 +93,7 @@ SwLineNumberInfo& SwLineNumberInfo::operator=(const SwLineNumberInfo &rCpy)
if ( rCpy.GetRegisteredIn() )
((SwModify*)rCpy.GetRegisteredIn())->Add( this );
else if ( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
aType = rCpy.GetNumType();
aDivider = rCpy.GetDivider();
@@ -138,15 +141,17 @@ void SwLineNumberInfo::SetCharFmt( SwCharFmt *pChFmt )
pChFmt->Add( this );
}
-void SwLineNumberInfo::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwLineNumberInfo::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- SwClient::Modify( pOld, pNew );
+ CheckRegistration( pOld, pNew );
SwDoc *pDoc = ((SwCharFmt*)GetRegisteredIn())->GetDoc();
- SwRootFrm* pRoot = pDoc->GetRootFrm();
- if( pRoot && pRoot->GetCurrShell() )
+ SwRootFrm* pRoot = pDoc->GetCurrentLayout();
+ if( pRoot )
{
pRoot->StartAllAction();
- pRoot->GetCurrShell()->AddPaintRect( pRoot->Frm() );
+ std::set<SwRootFrm*> aAllLayouts = pDoc->GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllAddPaintRect));//swmod 080305
+ //pRoot->GetCurrShell()->AddPaintRect( pRoot->Frm() );
pRoot->EndAllAction();
}
}
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 15aaccd7c9a1..d00e8d6415c8 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -155,8 +155,8 @@ void lcl_PaintReplacement( const SwRect &rRect, const String &rText,
*************************************************************************/
-SwNoTxtFrm::SwNoTxtFrm(SwNoTxtNode * const pNode)
- : SwCntntFrm(pNode)
+SwNoTxtFrm::SwNoTxtFrm(SwNoTxtNode * const pNode, SwFrm* pSib )
+ : SwCntntFrm( pNode, pSib )
{
InitCtor();
}
@@ -181,9 +181,9 @@ void SwNoTxtFrm::InitCtor()
*************************************************************************/
-SwCntntFrm *SwNoTxtNode::MakeFrm()
+SwCntntFrm *SwNoTxtNode::MakeFrm( SwFrm* pSib )
{
- return new SwNoTxtFrm(this);
+ return new SwNoTxtFrm(this, pSib);
}
/*************************************************************************
@@ -227,7 +227,7 @@ void lcl_ClearArea( const SwFrm &rFrm,
else
{
rOut.Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
- rOut.SetFillColor( rFrm.GetShell()->Imp()->GetRetoucheColor());
+ rOut.SetFillColor( rFrm.getRootFrm()->GetCurrShell()->Imp()->GetRetoucheColor());
rOut.SetLineColor();
for( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
rOut.DrawRect( aRegion[i].SVRect() );
@@ -247,7 +247,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if ( Frm().IsEmpty() )
return;
- const ViewShell* pSh = GetShell();
+ const ViewShell* pSh = getRootFrm()->GetCurrShell();
if( !pSh->GetViewOptions()->IsGraphic() )
{
StopAnimation();
@@ -622,7 +622,7 @@ sal_Bool SwNoTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& ,
}\
}
-void SwNoTxtFrm::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
sal_uInt16 nWhich = pNew ? pNew->Which() : pOld ? pOld->Which() : 0;
@@ -783,7 +783,7 @@ void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, Out
/// pixel-align coordinations for drawing graphic.
void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) const
{
- ViewShell* pShell = GetShell();
+ ViewShell* pShell = getRootFrm()->GetCurrShell();
SwNoTxtNode& rNoTNd = *(SwNoTxtNode*)GetNode();
SwGrfNode* pGrfNd = rNoTNd.GetGrfNode();
@@ -1013,7 +1013,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
sal_Bool SwNoTxtFrm::IsTransparent() const
{
- const ViewShell* pSh = GetShell();
+ const ViewShell* pSh = getRootFrm()->GetCurrShell();
if ( !pSh || !pSh->GetViewOptions()->IsGraphic() )
return sal_True;
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 73dcba920960..a5d12082f8fd 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -197,7 +197,7 @@ SwNumFmt::SwNumFmt() :
SwNumFmt::SwNumFmt( const SwNumFmt& rFmt) :
SvxNumberFormat(rFmt),
- SwClient( rFmt.pRegisteredIn ),
+ SwClient( rFmt.GetRegisteredInNonConst() ),
pVertOrient(new SwFmtVertOrient( 0, rFmt.GetVertOrient()))
{
sal_Int16 eMyVertOrient = rFmt.GetVertOrient();
@@ -227,7 +227,7 @@ SwNumFmt::SwNumFmt(const SvxNumberFormat& rNumFmt, SwDoc* pDoc) :
pCFmt->Add( this );
}
else if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
}
@@ -276,16 +276,16 @@ SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt)
{
SvxNumberFormat::operator=(rNumFmt);
if( rNumFmt.GetRegisteredIn() )
- rNumFmt.pRegisteredIn->Add( this );
+ rNumFmt.GetRegisteredInNonConst()->Add( this );
else if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
return *this;
}
sal_Bool SwNumFmt::operator==( const SwNumFmt& rNumFmt) const
{
sal_Bool bRet = SvxNumberFormat::operator==(rNumFmt) &&
- pRegisteredIn == rNumFmt.pRegisteredIn;
+ GetRegisteredIn() == rNumFmt.GetRegisteredIn();
return bRet;
}
@@ -294,15 +294,16 @@ void SwNumFmt::SetCharFmt( SwCharFmt* pChFmt)
if( pChFmt )
pChFmt->Add( this );
else if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
}
-void SwNumFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwNumFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
// dann suche mal in dem Doc nach dem NumRules-Object, in dem dieses
// NumFormat gesetzt ist. Das Format muss es nicht geben!
const SwCharFmt* pFmt = 0;
- switch( pOld ? pOld->Which() : pNew ? pNew->Which() : 0 )
+ sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
+ switch( nWhich )
{
case RES_ATTRSET_CHG:
case RES_FMT_CHG:
@@ -313,7 +314,7 @@ void SwNumFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( pFmt && !pFmt->GetDoc()->IsInDtor() )
UpdateNumNodes( (SwDoc*)pFmt->GetDoc() );
else
- SwClient::Modify( pOld, pNew );
+ CheckRegistration( pOld, pNew );
}
void SwNumFmt::SetCharFmtName(const String& rSet)
@@ -323,12 +324,19 @@ void SwNumFmt::SetCharFmtName(const String& rSet)
const String& SwNumFmt::GetCharFmtName() const
{
- if((SwCharFmt*)pRegisteredIn)
- return ((SwCharFmt*)pRegisteredIn)->GetName();
+ if((SwCharFmt*)GetRegisteredIn())
+ return ((SwCharFmt*)GetRegisteredIn())->GetName();
else
return aEmptyStr;
}
+void SwNumFmt::ForgetCharFmt()
+{
+ if ( GetRegisteredIn() )
+ GetRegisteredInNonConst()->Remove( this );
+}
+
+
void SwNumFmt::SetGraphicBrush( const SvxBrushItem* pBrushItem, const Size* pSize,
const sal_Int16* pOrient)
{
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index 8adea28c9971..d51ff0a2c947 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -1275,7 +1275,7 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
case RES_POOLFRM_FRAME:
{
- if ( get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( get(IDocumentSettingAccess::HTML_MODE) )
{
aSet.Put( SwFmtAnchor( FLY_AS_CHAR ));
aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::LINE_CENTER, text::RelOrientation::PRINT_AREA ) );
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index d6553658dd33..7290240d1151 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -327,7 +327,7 @@ SwDataChanged::~SwDataChanged()
{
// JP 09.04.96: nur wenn das Layout vorhanden ist ( also waehrend der
// Eingabe)
- if( pDoc->GetRootFrm() )
+ if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
const ::sfx2::SvLinkSources& rServers = pDoc->GetLinkManager().GetServers();
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 9d16beb1b4d0..54c0348339ef 100644..100755
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -335,7 +335,7 @@ sal_Bool SwBoxAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions, s
READ( aFont, SvxFontItem , rVersions.nFontVersion)
if( rStream.GetStreamCharSet() == aFont.GetCharSet() )
- aFont.GetCharSet() = ::gsl_getSystemTextEncoding();
+ aFont.SetCharSet(::gsl_getSystemTextEncoding());
READ( aHeight, SvxFontHeightItem , rVersions.nFontHeightVersion)
READ( aWeight, SvxWeightItem , rVersions.nWeightVersion)
@@ -423,7 +423,7 @@ sal_Bool SwBoxAutoFmt::LoadOld( SvStream& rStream, sal_uInt16 aLoadVer[] )
READ( aFont, SvxFontItem , 0)
if( rStream.GetStreamCharSet() == aFont.GetCharSet() )
- aFont.GetCharSet() = ::gsl_getSystemTextEncoding();
+ aFont.SetCharSet(::gsl_getSystemTextEncoding());
READ( aHeight, SvxFontHeightItem , 1)
READ( aWeight, SvxWeightItem , 2)
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index f20ef5bbdedd..5cdc3d5dc850 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -63,6 +63,7 @@
#include <tblrwcl.hxx>
#include <unochart.hxx>
#include <boost/shared_ptr.hpp>
+#include <switerator.hxx>
using namespace com::sun::star;
using namespace com::sun::star::uno;
@@ -208,20 +209,14 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize );
for ( sal_uInt16 i = 0; i < GetTabLines().Count(); ++i ) \
{ \
SwFrmFmt* pFmt = GetTabLines()[i]->GetFrmFmt(); \
- SwClientIter aIter( *pFmt ); \
- SwClient* pLast = aIter.GoStart(); \
- if( pLast ) \
+ SwIterator<SwRowFrm,SwFmt> aIter( *pFmt ); \
+ for (SwRowFrm* pFrm=aIter.First(); pFrm; pFrm=aIter.Next())\
{ \
- do \
- { \
- SwFrm *pFrm = PTR_CAST( SwFrm, pLast ); \
- if ( pFrm && \
- ((SwRowFrm*)pFrm)->GetTabLine() == GetTabLines()[i] ) \
+ if ( pFrm->GetTabLine() == GetTabLines()[i] ) \
{ \
OSL_ENSURE( pFrm->GetUpper()->IsTabFrm(), \
"Table layout does not match table structure" ); \
} \
- } while ( 0 != ( pLast = aIter++ ) ); \
} \
} \
}
@@ -520,11 +515,10 @@ void lcl_InsCol( _FndLine* pFndLn, _CpyPara& rCpyPara, sal_uInt16 nCpyCnt,
SwRowFrm* GetRowFrm( SwTableLine& rLine )
{
- SwClientIter aIter( *rLine.GetFrmFmt() );
- for( SwClient* pFrm = aIter.First( TYPE( SwRowFrm )); pFrm;
- pFrm = aIter.Next() )
- if( ((SwRowFrm*)pFrm)->GetTabLine() == &rLine )
- return (SwRowFrm*)pFrm;
+ SwIterator<SwRowFrm,SwFmt> aIter( *rLine.GetFrmFmt() );
+ for( SwRowFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
+ if( pFrm->GetTabLine() == &rLine )
+ return pFrm;
return 0;
}
@@ -619,7 +613,7 @@ sal_Bool SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
//Lines fuer das Layout-Update herausuchen.
const sal_Bool bLayout = !IsNewModel() &&
- 0 != SwClientIter( *GetFrmFmt() ).First( TYPE(SwTabFrm) );
+ 0 != SwIterator<SwTabFrm,SwFmt>::FirstElement( *GetFrmFmt() );
if ( bLayout )
{
@@ -739,7 +733,7 @@ sal_Bool SwTable::AppendRow( SwDoc* pDoc, sal_uInt16 nCnt )
SetHTMLTableLayout( 0 ); // MIB 9.7.97: HTML-Layout loeschen
//Lines fuer das Layout-Update herausuchen.
- const sal_Bool bLayout = 0 != SwClientIter( *GetFrmFmt() ).First( TYPE(SwTabFrm) );
+ bool bLayout = 0 != SwIterator<SwTabFrm,SwFmt>::FirstElement( *GetFrmFmt() );
if( bLayout )
{
aFndBox.SetTableLines( *this );
@@ -3715,8 +3709,7 @@ sal_Bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType,
if( GetFrmFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
!rSz.GetWidthPercent() )
{
- SwTabFrm* pTabFrm = (SwTabFrm*)SwClientIter(
- *GetFrmFmt() ).First( TYPE( SwTabFrm ));
+ SwTabFrm* pTabFrm = SwIterator<SwTabFrm,SwFmt>::FirstElement( *GetFrmFmt() );
if( pTabFrm &&
pTabFrm->Prt().Width() != rSz.GetWidth() )
{
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index a39ced3f767e..b269451ac512 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -55,7 +55,7 @@ SwURLStateChanged::~SwURLStateChanged()
void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
{
- if( rHint.ISA( INetURLHistoryHint ) && pDoc->GetRootFrm() )
+ if( rHint.ISA( INetURLHistoryHint ) && pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
// diese URL wurde veraendert:
const INetURLObject* pIURL = ((INetURLHistoryHint&)rHint).GetObject();
@@ -93,7 +93,7 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
SwUpdateAttr aUpdateAttr( *pAttr->GetStart(),
*pAttr->GetEnd(),
RES_FMT_CHG );
- ((SwTxtNode*)pTxtNd)->Modify( &aUpdateAttr, &aUpdateAttr );
+ ((SwTxtNode*)pTxtNd)->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
if( bAction )
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 156529b38f56..090c9654b501 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -437,7 +437,7 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
SwNodeIndex aInsPos( *pEndNd );
SwTable& rTbl = (SwTable&)pTblNd->GetTable();
- pTblFmt->Add( &rTbl ); // das Frame-Format setzen
+ rTbl.RegisterToFormat( *pTblFmt );
rTbl.SetRowsToRepeat( GetTable().GetRowsToRepeat() );
rTbl.SetTblChgMode( GetTable().GetTblChgMode() );
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 8adee6831112..00cee7bacd14 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
+#include <svl/smplhint.hxx>
#include <hintids.hxx>
#include <sfx2/linkmgr.hxx>
#include <svl/itemiter.hxx>
@@ -573,7 +573,7 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, sal_Bool bDelNodes )
{
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt );
- pFmt->Modify( &aMsgHint, &aMsgHint );
+ pFmt->ModifyNotification( &aMsgHint, &aMsgHint );
}
// A ClearRedo could result in a rekursive call of this function and delete some section
@@ -785,7 +785,7 @@ void lcl_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd )
// Werden die Nodes nicht geloescht mussen sie bei den Seiten
// abmeldet (Frms loeschen) werden, denn sonst bleiben sie
// stehen (Undo loescht sie nicht!)
- pSrch->DelFrms();
+ pSrch->DelFrms(0);
++nPos;
}
@@ -795,7 +795,7 @@ void lcl_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd )
// Werden die Nodes nicht geloescht mussen sie bei den Seiten
// abmeldet (Frms loeschen) werden, denn sonst bleiben sie
// stehen (Undo loescht sie nicht!)
- pSrch->DelFrms();
+ pSrch->DelFrms(0);
}
}
}
@@ -920,7 +920,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx,
// Hier bietet sich als Optimierung an, vorhandene Frames nicht zu
// zerstoeren und wieder neu anzulegen, sondern nur umzuhaengen.
sal_Bool bInsFrm = bCreateFrms && !pSectNd->GetSection().IsHidden() &&
- GetDoc()->GetRootFrm();
+ GetDoc()->GetCurrentViewShell(); //swmod 071108//swmod 071225
SwNode2Layout *pNode2Layout = NULL;
if( bInsFrm )
{
@@ -1065,22 +1065,8 @@ SwFrm* SwClearDummies( SwFrm* pFrm )
SwSectionNode::~SwSectionNode()
{
- {
- SwClientIter aIter( *(m_pSection->GetFmt()) );
- SwClient *pLast = aIter.GoStart();
- while ( pLast )
- {
- if ( pLast->IsA( TYPE(SwFrm) ) )
- {
- SwSectionFrm *pSectFrm = (SwSectionFrm*)pLast;
- SwSectionFrm::MoveCntntAndDelete( pSectFrm, sal_True );
- pLast = aIter.GoStart();
- }
- else
- pLast = aIter++;
- }
- }
-
+ // mba: test if iteration works as clients will be removed in callback
+ m_pSection->GetFmt()->CallSwClientNotify( SfxSimpleHint( SFX_HINT_DYING ) );
SwSectionFmt* pFmt = m_pSection->GetFmt();
if( pFmt )
{
@@ -1093,10 +1079,10 @@ SwSectionNode::~SwSectionNode()
}
-SwFrm *SwSectionNode::MakeFrm()
+SwFrm *SwSectionNode::MakeFrm( SwFrm *pSib )
{
m_pSection->m_Data.SetHiddenFlag(false);
- return new SwSectionFrm( *m_pSection );
+ return new SwSectionFrm( *m_pSection, pSib );
}
//Methode erzeugt fuer den vorhergehenden Node alle Ansichten vom
@@ -1106,7 +1092,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
{
// also nehme meinen nachfolgenden oder vorhergehenden ContentFrame:
SwNodes& rNds = GetNodes();
- if( rNds.IsDocNodes() && rNds.GetDoc()->GetRootFrm() )
+ if( rNds.IsDocNodes() && rNds.GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
if( GetSection().IsHidden() || IsCntntHidden() )
{
@@ -1128,7 +1114,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
while( 0 != (pFrm = aNode2Layout.NextFrm()) )
{
OSL_ENSURE( pFrm->IsSctFrm(), "Depend von Section keine Section." );
- pNew = rIdx.GetNode().GetCntntNode()->MakeFrm();
+ pNew = rIdx.GetNode().GetCntntNode()->MakeFrm( pFrm );
SwSectionNode* pS = rIdx.GetNode().FindSectionNode();
@@ -1150,7 +1136,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
bool bInitNewSect = false;
if( pS )
{
- SwSectionFrm *pSct = new SwSectionFrm( pS->GetSection() );
+ SwSectionFrm *pSct = new SwSectionFrm( pS->GetSection(), pFrm );
// prepare <Init()> of new section frame.
bInitNewSect = true;
SwLayoutFrm* pUp = pSct;
@@ -1167,7 +1153,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
// and relation CONTENT_FLOWS_TO for previous paragraph will change.
if ( pNew->IsTxtFrm() )
{
- ViewShell* pViewShell( pNew->GetShell() );
+ ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -1194,7 +1180,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
// and relation CONTENT_FLOWS_TO for previous paragraph will change.
if ( pNew->IsTxtFrm() )
{
- ViewShell* pViewShell( pNew->GetShell() );
+ ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -1333,7 +1319,7 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c
// dann kopiere auch noch die Links/Server
if( pNewSect->IsLinkType() ) // den Link eintragen
- pNewSect->CreateLink( pDoc->GetRootFrm() ? CREATE_CONNECT
+ pNewSect->CreateLink( pDoc->GetCurrentViewShell() ? CREATE_CONNECT //swmod 071108//swmod 071225
: CREATE_NONE );
// falls als Server aus dem Undo kopiert wird, wieder eintragen
@@ -1388,7 +1374,7 @@ void SwSectionNode::NodesArrChgd()
if( !rNds.IsDocNodes() )
{
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt );
- pFmt->Modify( &aMsgHint, &aMsgHint );
+ pFmt->ModifyNotification( &aMsgHint, &aMsgHint );
}
pFmt->LockModify();
@@ -1415,12 +1401,9 @@ void SwSectionNode::NodesArrChgd()
{
OSL_ENSURE( pDoc == GetDoc(),
"verschieben in unterschiedliche Documente?" );
- if (m_pSection->IsLinkType())
- {
- m_pSection->CreateLink( pDoc->GetRootFrm() ? CREATE_CONNECT
- : CREATE_NONE );
- }
-
+ if( m_pSection->IsLinkType() ) // den Link austragen
+ m_pSection->CreateLink( pDoc->GetCurrentViewShell() ? CREATE_CONNECT //swmod 071108
+ : CREATE_NONE );//swmod 071225
if (m_pSection->IsServer())
{
pDoc->GetLinkManager().InsertServer( m_pSection->GetObject() );
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index d1d7af788bfe..8a757a1b2537 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -30,9 +30,7 @@
#include "precompiled_sw.hxx"
#include <com/sun/star/chart2/XChartDocument.hpp>
-
#include <hintids.hxx>
-
#include <editeng/lrspitem.hxx>
#include <editeng/brkitem.hxx>
#include <editeng/protitem.hxx>
@@ -91,15 +89,13 @@
#include <comcore.hrc>
#include "docsh.hxx"
#include <unochart.hxx>
-
#include <node.hxx>
#include <ndtxt.hxx>
-
#include <map>
#include <algorithm>
-#include <rootfrm.hxx> // #i27138#
+#include <rootfrm.hxx>
#include <fldupde.hxx>
-
+#include <switerator.hxx>
#if OSL_DEBUG_LEVEL > 1
#define CHECK_TABLE(t) (t).CheckConsistency();
#else
@@ -471,7 +467,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
}
SwTable * pNdTbl = &pTblNd->GetTable();
- pTableFmt->Add( pNdTbl ); // das Frame-Format setzen
+ pNdTbl->RegisterToFormat( *pTableFmt );
pNdTbl->SetRowsToRepeat( nRowsToRepeat );
pNdTbl->SetTableModel( bNewModel );
@@ -759,7 +755,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
//Orientation am Fmt der Table setzen
pTableFmt->SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) );
- pTableFmt->Add( pNdTbl ); // das Frame-Format setzen
+ pNdTbl->RegisterToFormat( *pTableFmt );
if( pTAFmt || ( rInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER) )
{
@@ -923,7 +919,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
// JP 28.10.96: vom 1. Node die Positionen des Trenners besorgen,
// damit die Boxen entsprechend eingestellt werden
- SwTxtFrmInfo aFInfo( (SwTxtFrm*)pTxtNd->GetFrm() );
+ SwTxtFrmInfo aFInfo( (SwTxtFrm*)pTxtNd->getLayoutFrm( pTxtNd->GetDoc()->GetCurrentLayout() ) );
if( aFInfo.IsOneLine() ) // nur dann sinnvoll!
{
const sal_Unicode* pTxt = pTxtNd->GetTxt().GetBuffer();
@@ -1179,7 +1175,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
SwTable * pNdTbl = &pTblNd->GetTable();
OSL_ENSURE( pNdTbl, "kein Tabellen-Node angelegt." );
- pTableFmt->Add( pNdTbl ); // das Frame-Format setzen
+ pNdTbl->RegisterToFormat( *pTableFmt );
if( !pBoxFmt->GetDepends() )
{
@@ -2334,14 +2330,14 @@ SwTableNode::~SwTableNode()
SwFrmFmt* pTblFmt = GetTable().GetFrmFmt();
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
pTblFmt );
- pTblFmt->Modify( &aMsgHint, &aMsgHint );
+ pTblFmt->ModifyNotification( &aMsgHint, &aMsgHint );
DelFrms();
delete pTable;
}
-SwTabFrm *SwTableNode::MakeFrm()
+SwTabFrm *SwTableNode::MakeFrm( SwFrm* pSib )
{
- return new SwTabFrm( *pTable );
+ return new SwTabFrm( *pTable, pSib );
}
//Methode erzeugt fuer den vorhergehenden Node alle Ansichten vom
@@ -2363,7 +2359,7 @@ void SwTableNode::MakeFrms(const SwNodeIndex & rIdx )
while( 0 != (pFrm = aNode2Layout.NextFrm()) )
{
- pNew = pNode->MakeFrm();
+ pNew = pNode->MakeFrm( pFrm );
// wird ein Node vorher oder nachher mit Frames versehen
if ( bBefore )
// der neue liegt vor mir
@@ -2390,7 +2386,7 @@ void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind )
SwNode2Layout aNode2Layout( *pNd, GetIndex() );
while( 0 != (pUpper = aNode2Layout.UpperFrm( pFrm, *this )) )
{
- SwTabFrm* pNew = MakeFrm();
+ SwTabFrm* pNew = MakeFrm( pUpper );
pNew->Paste( pUpper, pFrm );
// #i27138#
// notify accessibility paragraphs objects about changed
@@ -2398,7 +2394,7 @@ void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind )
// Relation CONTENT_FLOWS_FROM for next paragraph will change
// and relation CONTENT_FLOWS_TO for previous paragraph will change.
{
- ViewShell* pViewShell( pNew->GetShell() );
+ ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -2420,14 +2416,12 @@ void SwTableNode::DelFrms()
//Sie muessen etwas umstaendlich zerstort werden, damit die Master
//die Follows mit in's Grab nehmen.
- SwClientIter aIter( *(pTable->GetFrmFmt()) );
- SwClient *pLast = aIter.GoStart();
- while ( pLast )
+ SwIterator<SwTabFrm,SwFmt> aIter( *(pTable->GetFrmFmt()) );
+ SwTabFrm *pFrm = aIter.First();
+ while ( pFrm )
{
sal_Bool bAgain = sal_False;
- if ( pLast->IsA( TYPE(SwFrm) ) )
{
- SwTabFrm *pFrm = (SwTabFrm*)pLast;
if ( !pFrm->IsFollow() )
{
while ( pFrm->HasFollow() )
@@ -2438,7 +2432,7 @@ void SwTableNode::DelFrms()
// Relation CONTENT_FLOWS_FROM for current next paragraph will change
// and relation CONTENT_FLOWS_TO for current previous paragraph will change.
{
- ViewShell* pViewShell( pFrm->GetShell() );
+ ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -2453,7 +2447,7 @@ void SwTableNode::DelFrms()
bAgain = sal_True;
}
}
- pLast = bAgain ? aIter.GoStart() : aIter++;
+ pFrm = bAgain ? aIter.First() : aIter.Next();
}
}
@@ -2493,7 +2487,7 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr,
if( pShCrsr )
aPt = pShCrsr->GetPtPos();
- const SwFrm* pTmpFrm = pCNd->GetFrm( &aPt, 0, sal_False );
+ const SwFrm* pTmpFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False );
do {
pTmpFrm = pTmpFrm->GetUpper();
} while ( !pTmpFrm->IsCellFrm() );
@@ -2715,7 +2709,7 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly,
if( pShCrsr )
aPt = pShCrsr->GetPtPos();
- const SwFrm* pTmpFrm = pCNd->GetFrm( &aPt, 0, sal_False );
+ const SwFrm* pTmpFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False );
do {
pTmpFrm = pTmpFrm->GetUpper();
} while ( !pTmpFrm->IsCellFrm() );
@@ -2924,7 +2918,7 @@ void SwDoc::SetRowsToRepeat( SwTable &rTable, sal_uInt16 nSet )
SwMsgPoolItem aChg( RES_TBLHEADLINECHG );
rTable.SetRowsToRepeat( nSet );
- rTable.GetFrmFmt()->Modify( &aChg, &aChg );
+ rTable.GetFrmFmt()->ModifyNotification( &aChg, &aChg );
SetModified();
}
@@ -3448,7 +3442,7 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, sal_Bool bAfter,
pOldTblFmt->GetDoc()->GetDfltFrmFmt() );
*pNewTblFmt = *pOldTblFmt;
- pNewTblFmt->Add( &pNewTblNd->GetTable() );
+ pNewTblNd->GetTable().RegisterToFormat( *pNewTblFmt );
// neue Size errechnen ? (lcl_ChgTblSize nur das 2. aufrufen, wenn es
// beim 1. schon geklappt hat; also absolute Groesse hat)
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index 14fac9d60f93..bdb3e5732bca 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -56,9 +56,10 @@
#include "swtblfmt.hxx"
#include "docary.hxx"
#include "ndindex.hxx"
+#include "undobj.hxx"
+#include "switerator.hxx"
#include <UndoTable.hxx>
-
using namespace ::com::sun::star;
@@ -123,8 +124,8 @@ void lcl_GetStartEndCell( const SwCursor& rCrsr,
SwCntntNode* pPointNd = rCrsr.GetCntntNode();
SwCntntNode* pMarkNd = rCrsr.GetCntntNode(sal_False);
- SwFrm* pPointFrm = pPointNd ? pPointNd->GetFrm( &aPtPos ) : 0;
- SwFrm* pMarkFrm = pMarkNd ? pMarkNd->GetFrm( &aMkPos ) : 0;
+ SwFrm* pPointFrm = pPointNd ? pPointNd->getLayoutFrm( pPointNd->GetDoc()->GetCurrentLayout(), &aPtPos ) : 0;
+ SwFrm* pMarkFrm = pMarkNd ? pMarkNd->getLayoutFrm( pMarkNd->GetDoc()->GetCurrentLayout(), &aMkPos ) : 0;
prStart = pPointFrm ? pPointFrm->GetUpper() : 0;
prEnd = pMarkFrm ? pMarkFrm->GetUpper() : 0;
@@ -456,12 +457,12 @@ sal_Bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, sal_Bool bTstOnly )
for ( i = 0; i < aRowArr.Count(); ++i )
{
- SwClientIter aIter( *((SwTableLine*)aRowArr[i])->GetFrmFmt() );
- SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
+ SwIterator<SwFrm,SwFmt> aIter( *((SwTableLine*)aRowArr[i])->GetFrmFmt() );
+ SwFrm* pFrm = aIter.First();
while ( pFrm )
{
nHeight = Max( nHeight, pFrm->Frm().Height() );
- pFrm = (SwFrm*)aIter.Next();
+ pFrm = aIter.Next();
}
}
SwFmtFrmSize aNew( ATT_MIN_SIZE, 0, nHeight );
@@ -790,7 +791,7 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout();
if( pTableLayout )
{
- SwCntntFrm* pFrm = rCursor.GetCntntNode()->GetFrm();
+ SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->GetCurrentLayout() );
SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm();
pTableLayout->BordersChanged(
@@ -886,7 +887,7 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout();
if( pTableLayout )
{
- SwCntntFrm* pFrm = rCursor.GetCntntNode()->GetFrm();
+ SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->GetCurrentLayout() );
SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm();
pTableLayout->BordersChanged(
@@ -1143,7 +1144,7 @@ void SwDoc::SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew )
SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout();
if( pTableLayout )
{
- SwCntntFrm* pFrm = rCursor.GetCntntNode()->GetFrm();
+ SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->GetCurrentLayout() );
SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm();
pTableLayout->Resize(
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 792f4ffaa4ce..26521624abb7 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -29,10 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
-
-#include <editeng/frmdiritem.hxx> // #i42921#
+#include <editeng/frmdiritem.hxx>
#include <editeng/protitem.hxx>
#include <com/sun/star/i18n/CharacterIteratorMode.hdl>
#include <fmtcntnt.hxx>
@@ -70,9 +68,11 @@
#include <crsskip.hxx>
#include <SwStyleNameMapper.hxx>
#include <scriptinfo.hxx>
-#include <rootfrm.hxx> // #i27138#
+#include <rootfrm.hxx>
#include <istyleaccess.hxx>
-#include <IDocumentListItems.hxx> // #i83479#
+#include <IDocumentListItems.hxx>
+#include <switerator.hxx>
+#include "ndole.hxx"
using namespace ::com::sun::star::i18n;
@@ -432,15 +432,16 @@ sal_Bool SwNode::IsInVisibleArea( ViewShell* pSh ) const
else
pNd = GetCntntNode();
- const SwFrm* pFrm;
- if( pNd && 0 != ( pFrm = pNd->GetFrm( 0, 0, sal_False ) ) )
- {
- if( !pSh )
- // dann die Shell vom Doc besorgen:
- GetDoc()->GetEditShell( &pSh );
+ if( !pSh )
+ // dann die Shell vom Doc besorgen:
+ GetDoc()->GetEditShell( &pSh );
- if( pSh )
+ if( pSh )
+ {
+ const SwFrm* pFrm;
+ if( pNd && 0 != ( pFrm = pNd->getLayoutFrm( pSh->GetLayout(), 0, 0, sal_False ) ) )
{
+
if ( pFrm->IsInTab() )
pFrm = pFrm->FindTabFrm();
@@ -477,7 +478,7 @@ sal_Bool SwNode::IsProtect() const
if( 0 != ( pSttNd = FindTableBoxStartNode() ) )
{
SwCntntFrm* pCFrm;
- if( IsCntntNode() && 0 != (pCFrm = ((SwCntntNode*)this)->GetFrm() ))
+ if( IsCntntNode() && 0 != (pCFrm = ((SwCntntNode*)this)->getLayoutFrm( GetDoc()->GetCurrentLayout() ) ))
return pCFrm->IsProtected();
const SwTableBox* pBox = pSttNd->FindTableNode()->GetTable().
@@ -545,7 +546,7 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay,
{
const SwFrm* pFrm;
const SwPageFrm* pPage;
- if( pNode && 0 != ( pFrm = pNode->GetFrm( 0, 0, bCalcLay ) ) &&
+ if( pNode && 0 != ( pFrm = pNode->getLayoutFrm( pNode->GetDoc()->GetCurrentLayout(), 0, 0, bCalcLay ) ) &&
0 != ( pPage = pFrm->FindPageFrm() ) )
{
pPgDesc = pPage->GetPageDesc();
@@ -767,10 +768,9 @@ SwFrmFmt* SwNode::GetFlyFmt() const
{
if( IsCntntNode() )
{
- SwClientIter aIter( *(SwCntntNode*)this );
- SwClient* pCli = aIter.First( TYPE( SwCntntFrm ));
- if( pCli )
- pRet = ((SwCntntFrm*)pCli)->FindFlyFrm()->GetFmt();
+ SwCntntFrm* pFrm = SwIterator<SwCntntFrm,SwCntntNode>::FirstElement( *(SwCntntNode*)this );
+ if( pFrm )
+ pRet = pFrm->FindFlyFrm()->GetFmt();
}
if( !pRet )
{
@@ -842,8 +842,8 @@ const SwTxtNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const
const SwCntntNode* pCNd = GetCntntNode();
Point aPt( 0, 0 );
- const SwFrm* pFrm = pRet->GetFrm( &aPt, 0, sal_False ),
- * pMyFrm = pCNd ? pCNd->GetFrm( &aPt, 0, sal_False ) : 0;
+ const SwFrm* pFrm = pRet->getLayoutFrm( pRet->GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False ),
+ * pMyFrm = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False ) : 0;
const SwPageFrm* pPgFrm = pFrm ? pFrm->FindPageFrm() : 0;
if( pPgFrm && pMyFrm &&
pPgFrm->Frm().Top() > pMyFrm->Frm().Top() )
@@ -1021,7 +1021,7 @@ SwCntntNode::~SwCntntNode()
((SwAttrSet*)mpAttrSet.get())->SetModifyAtAttr( 0 );
}
-void SwCntntNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
+void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
{
sal_uInt16 nWhich = pOldValue ? pOldValue->Which() :
pNewValue ? pNewValue->Which() : 0 ;
@@ -1033,7 +1033,7 @@ void SwCntntNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
SwFmt * pFmt = (SwFmt *) ((SwPtrMsgPoolItem *)pNewValue)->pObject;
// nicht umhaengen wenn dieses das oberste Format ist !!
- if( pRegisteredIn == pFmt )
+ if( GetRegisteredIn() == pFmt )
{
if( pFmt->GetRegisteredIn() )
{
@@ -1100,7 +1100,7 @@ void SwCntntNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
break;
}
- SwModify::Modify( pOldValue, pNewValue );
+ NotifyClients( pOldValue, pNewValue );
}
sal_Bool SwCntntNode::InvalidateNumRule()
@@ -1118,12 +1118,10 @@ sal_Bool SwCntntNode::InvalidateNumRule()
return 0 != pRule;
}
-
-SwCntntFrm *SwCntntNode::GetFrm( const Point* pPoint,
- const SwPosition *pPos,
- const sal_Bool bCalcFrm ) const
+SwCntntFrm *SwCntntNode::getLayoutFrm( const SwRootFrm* _pRoot,
+ const Point* pPoint, const SwPosition *pPos, const sal_Bool bCalcFrm ) const
{
- return (SwCntntFrm*) ::GetFrmOfModify( *(SwModify*)this, FRM_CNTNT,
+ return (SwCntntFrm*) ::GetFrmOfModify( _pRoot, *(SwModify*)this, FRM_CNTNT,
pPoint, pPos, bCalcFrm );
}
@@ -1131,7 +1129,7 @@ SwRect SwCntntNode::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint
const sal_Bool bCalcFrm ) const
{
SwRect aRet;
- SwCntntFrm* pFrm = (SwCntntFrm*)::GetFrmOfModify( *(SwModify*)this,
+ SwCntntFrm* pFrm = (SwCntntFrm*)::GetFrmOfModify( 0, *(SwModify*)this,
FRM_CNTNT, pPoint, 0, bCalcFrm );
if( pFrm )
aRet = bPrtArea ? pFrm->Prt() : pFrm->Frm();
@@ -1142,7 +1140,7 @@ SwRect SwCntntNode::FindPageFrmRect( const sal_Bool bPrtArea, const Point* pPoin
const sal_Bool bCalcFrm ) const
{
SwRect aRet;
- SwFrm* pFrm = ::GetFrmOfModify( *(SwModify*)this,
+ SwFrm* pFrm = ::GetFrmOfModify( 0, *(SwModify*)this,
FRM_CNTNT, pPoint, 0, bCalcFrm );
if( pFrm && 0 != ( pFrm = pFrm->FindPageFrm() ))
aRet = bPrtArea ? pFrm->Prt() : pFrm->Frm();
@@ -1180,8 +1178,6 @@ SwFmtColl *SwCntntNode::ChgFmtColl( SwFmtColl *pNewColl )
{
SwFmtChg aTmp1( pOldColl );
SwFmtChg aTmp2( pNewColl );
- // damit alles was im Modify passiert hier nicht noch impl.
- // werden muss
SwCntntNode::Modify( &aTmp1, &aTmp2 );
}
}
@@ -1314,7 +1310,7 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode )
while( 0 != (pUpper = aNode2Layout.UpperFrm( pFrm, rNode )) )
{
- pNew = rNode.MakeFrm();
+ pNew = rNode.MakeFrm( pUpper );
pNew->Paste( pUpper, pFrm );
// #i27138#
// notify accessibility paragraphs objects about changed
@@ -1323,7 +1319,7 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode )
// and relation CONTENT_FLOWS_TO for previous paragraph will change.
if ( pNew->IsTxtFrm() )
{
- ViewShell* pViewShell( pNew->GetShell() );
+ ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -1348,60 +1344,7 @@ void SwCntntNode::DelFrms()
if( !GetDepends() )
return;
- SwClientIter aIter( *this );
- SwCntntFrm *pFrm;
-
- for( pFrm = (SwCntntFrm*)aIter.First( TYPE(SwCntntFrm)); pFrm;
- pFrm = (SwCntntFrm*)aIter.Next() )
- {
- // #i27138#
- // notify accessibility paragraphs objects about changed
- // CONTENT_FLOWS_FROM/_TO relation.
- // Relation CONTENT_FLOWS_FROM for current next paragraph will change
- // and relation CONTENT_FLOWS_TO for current previous paragraph will change.
- if ( pFrm->IsTxtFrm() )
- {
- ViewShell* pViewShell( pFrm->GetShell() );
- if ( pViewShell && pViewShell->GetLayout() &&
- pViewShell->GetLayout()->IsAnyShellAccessible() )
- {
- pViewShell->InvalidateAccessibleParaFlowRelation(
- dynamic_cast<SwTxtFrm*>(pFrm->FindNextCnt( true )),
- dynamic_cast<SwTxtFrm*>(pFrm->FindPrevCnt( true )) );
- }
- }
- // <--
- if( pFrm->HasFollow() )
- pFrm->GetFollow()->_SetIsFollow( pFrm->IsFollow() );
- if( pFrm->IsFollow() )
- {
- SwCntntFrm* pMaster = (SwTxtFrm*)pFrm->FindMaster();
- pMaster->SetFollow( pFrm->GetFollow() );
- pFrm->_SetIsFollow( sal_False );
- }
- pFrm->SetFollow( 0 );//Damit er nicht auf dumme Gedanken kommt.
- //Andernfalls kann es sein, dass ein Follow
- //vor seinem Master zerstoert wird, der Master
- //greift dann ueber den ungueltigen
- //Follow-Pointer auf fremdes Memory zu.
- //Die Kette darf hier zerknauscht werden, weil
- //sowieso alle zerstoert werden.
- if( pFrm->GetUpper() && pFrm->IsInFtn() && !pFrm->GetIndNext() &&
- !pFrm->GetIndPrev() )
- {
- SwFtnFrm *pFtn = pFrm->FindFtnFrm();
- OSL_ENSURE( pFtn, "You promised a FtnFrm?" );
- SwCntntFrm* pCFrm;
- if( !pFtn->GetFollow() && !pFtn->GetMaster() &&
- 0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() )
- {
- OSL_ENSURE( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" );
- ((SwTxtFrm*)pCFrm->FindMaster())->Prepare( PREP_FTN_GONE );
- }
- }
- pFrm->Cut();
- delete pFrm;
- }
+ SwCntntFrm::DelFrms(*this);
if( IsTxtNode() )
{
((SwTxtNode*)this)->SetWrong( NULL );
@@ -1453,7 +1396,7 @@ sal_Bool SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const
case RES_CONTENT_VISIBLE:
{
((SwPtrMsgPoolItem&)rInfo).pObject =
- SwClientIter( *(SwCntntNode*)this ).First( TYPE(SwFrm) );
+ SwIterator<SwFrm,SwCntntNode>::FirstElement(*this);
}
return sal_False;
}
@@ -1491,7 +1434,7 @@ sal_Bool SwCntntNode::SetAttr(const SfxPoolItem& rAttr )
{
SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld );
SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
}
return bRet;
@@ -1567,7 +1510,7 @@ sal_Bool SwCntntNode::SetAttr( const SfxItemSet& rSet )
// einige Sonderbehandlungen fuer Attribute
SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld );
SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
}
return bRet;
@@ -1617,7 +1560,7 @@ sal_Bool SwCntntNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
{
SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld );
SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen
mpAttrSet.reset();//DELETEZ( mpAttrSet );
@@ -1658,7 +1601,7 @@ sal_Bool SwCntntNode::ResetAttr( const SvUShorts& rWhichArr )
{
SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld );
SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
}
if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen
@@ -1697,7 +1640,7 @@ sal_uInt16 SwCntntNode::ResetAllAttr()
{
SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld );
SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen
mpAttrSet.reset();//DELETEZ( mpAttrSet );
@@ -1837,7 +1780,7 @@ void SwCntntNode::SetCondFmtColl( SwFmtColl* pColl )
{
SwFmtChg aTmp1( pOldColl ? pOldColl : GetFmtColl() );
SwFmtChg aTmp2( pColl ? pColl : GetFmtColl() );
- SwModify::Modify( &aTmp1, &aTmp2 );
+ NotifyClients( &aTmp1, &aTmp2 );
}
if( IsInCache() )
{
@@ -1990,7 +1933,7 @@ short SwCntntNode::GetTextDirection( const SwPosition& rPos,
aPt = *pPt;
// #i72024# - No format of the frame, because this can cause recursive layout actions
- SwFrm* pFrm = GetFrm( &aPt, &rPos, sal_False );
+ SwFrm* pFrm = getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, &rPos, sal_False );
if ( pFrm )
{
@@ -2015,6 +1958,24 @@ short SwCntntNode::GetTextDirection( const SwPosition& rPos,
}
// <--
+SwOLENodes* SwCntntNode::CreateOLENodesArray( const SwFmtColl& rColl, bool bOnlyWithInvalidSize )
+{
+ SwOLENodes *pNodes = 0;
+ SwIterator<SwCntntNode,SwFmtColl> aIter( rColl );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
+ {
+ SwOLENode *pONd = pNd->GetOLENode();
+ if ( pONd && (!bOnlyWithInvalidSize || pONd->IsOLESizeInvalid()) )
+ {
+ if ( !pNodes )
+ pNodes = new SwOLENodes;
+ pNodes->Insert( pONd, pNodes->Count() );
+ }
+ }
+
+ return pNodes;
+}
+
//FEATURE::CONDCOLL
// Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
// os: nur fuer ICC, da der zum optimieren zu dumm ist
diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx
index 88169f482382..16bc2fef53ae 100644
--- a/sw/source/core/docnode/node2lay.cxx
+++ b/sw/source/core/docnode/node2lay.cxx
@@ -29,8 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include <calbck.hxx> // SwClientIter
+#include <switerator.hxx>
+#include <calbck.hxx>
#include <node.hxx>
#include <ndindex.hxx>
#include <swtable.hxx>
@@ -43,14 +43,14 @@
#include "section.hxx"
#include "node2lay.hxx"
-
/* --------------------------------------------------
* Die SwNode2LayImpl-Klasse erledigt die eigentliche Arbeit,
* die SwNode2Layout-Klasse ist nur die der Oefffentlichkeit bekannte Schnittstelle
* --------------------------------------------------*/
class SwNode2LayImpl
{
- SwClientIter *pIter; // Der eigentliche Iterator
+ SwIterator<SwFrm,SwModify>* pIter;
+ SwModify* pMod;
SvPtrarr *pUpperFrms;// Zum Einsammeln der Upper
sal_uLong nIndex; // Der Index des einzufuegenden Nodes
sal_Bool bMaster : 1; // sal_True => nur Master , sal_False => nur Frames ohne Follow
@@ -78,6 +78,71 @@ public:
* vor oder hinter den eingefuegt werden soll.
* --------------------------------------------------*/
+SwNode* GoNextWithFrm(const SwNodes& rNodes, SwNodeIndex *pIdx)
+{
+ if( pIdx->GetIndex() >= rNodes.Count() - 1 )
+ return 0;
+
+ SwNodeIndex aTmp(*pIdx, +1);
+ SwNode* pNd = 0;
+ while( aTmp < rNodes.Count()-1 )
+ {
+ pNd = &aTmp.GetNode();
+ bool bFound = false;
+ if ( pNd->IsCntntNode() )
+ bFound = ( SwIterator<SwFrm,SwCntntNode>::FirstElement(*(SwCntntNode*)pNd) != 0);
+ else if ( pNd->IsTableNode() )
+ bFound = ( SwIterator<SwFrm,SwFmt>::FirstElement(*((SwTableNode*)pNd)->GetTable().GetFrmFmt()) != 0 );
+ else if( pNd->IsEndNode() && !pNd->StartOfSectionNode()->IsSectionNode() )
+ {
+ pNd = 0;
+ break;
+ }
+ if ( bFound )
+ break;
+ aTmp++;
+ }
+
+ if( aTmp == rNodes.Count()-1 )
+ pNd = 0;
+ else if( pNd )
+ (*pIdx) = aTmp;
+ return pNd;
+}
+
+SwNode* GoPreviousWithFrm(SwNodeIndex *pIdx)
+{
+ if( !pIdx->GetIndex() )
+ return 0;
+
+ SwNodeIndex aTmp( *pIdx, -1 );
+ SwNode* pNd(0);
+ while( aTmp.GetIndex() )
+ {
+ pNd = &aTmp.GetNode();
+ bool bFound = false;
+ if ( pNd->IsCntntNode() )
+ bFound = ( SwIterator<SwFrm,SwCntntNode>::FirstElement(*(SwCntntNode*)pNd) != 0);
+ else if ( pNd->IsTableNode() )
+ bFound = ( SwIterator<SwFrm,SwFmt>::FirstElement(*((SwTableNode*)pNd)->GetTable().GetFrmFmt()) != 0 );
+ else if( pNd->IsStartNode() && !pNd->IsSectionNode() )
+ {
+ pNd = 0;
+ break;
+ }
+ if ( bFound )
+ break;
+ aTmp--;
+ }
+
+ if( !aTmp.GetIndex() )
+ pNd = 0;
+ else if( pNd )
+ (*pIdx) = aTmp;
+ return pNd;
+}
+
+
SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bSearch )
: pUpperFrms( NULL ), nIndex( nIdx ), bInit( sal_False )
{
@@ -89,7 +154,7 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bS
if( !bSearch && rNode.GetIndex() < nIndex )
{
SwNodeIndex aTmp( *rNode.EndOfSectionNode(), +1 );
- pNd = rNode.GetNodes().GoPreviousWithFrm( &aTmp );
+ pNd = GoPreviousWithFrm( &aTmp );
if( !bSearch && pNd && rNode.GetIndex() > pNd->GetIndex() )
pNd = NULL; // Nicht ueber den Bereich hinausschiessen
bMaster = sal_False;
@@ -97,7 +162,7 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bS
else
{
SwNodeIndex aTmp( rNode, -1 );
- pNd = rNode.GetNodes().GoNextWithFrm( &aTmp );
+ pNd = GoNextWithFrm( rNode.GetNodes(), &aTmp );
bMaster = sal_True;
if( !bSearch && pNd && rNode.EndOfSectionIndex() < pNd->GetIndex() )
pNd = NULL; // Nicht ueber den Bereich hinausschiessen
@@ -110,7 +175,6 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bS
}
if( pNd )
{
- SwModify *pMod;
if( pNd->IsCntntNode() )
pMod = (SwModify*)pNd->GetCntntNode();
else
@@ -118,10 +182,13 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bS
OSL_ENSURE( pNd->IsTableNode(), "For Tablenodes only" );
pMod = pNd->GetTableNode()->GetTable().GetFrmFmt();
}
- pIter = new SwClientIter( *pMod );
+ pIter = new SwIterator<SwFrm,SwModify>( *pMod );
}
else
+ {
pIter = NULL;
+ pMod = 0;
+ }
}
/* --------------------------------------------------
@@ -142,11 +209,11 @@ SwFrm* SwNode2LayImpl::NextFrm()
return sal_False;
if( !bInit )
{
- pRet = (SwFrm*)pIter->First(TYPE(SwFrm));
+ pRet = pIter->First();
bInit = sal_True;
}
else
- pRet = (SwFrm*)pIter->Next();
+ pRet = pIter->Next();
while( pRet )
{
SwFlowFrm* pFlow = SwFlowFrm::CastFlowFrm( pRet );
@@ -189,7 +256,7 @@ SwFrm* SwNode2LayImpl::NextFrm()
}
return pRet;
}
- pRet = (SwFrm*)pIter->Next();
+ pRet = pIter->Next();
}
return NULL;
}
@@ -216,6 +283,7 @@ void SwNode2LayImpl::SaveUpperFrms()
}
delete pIter;
pIter = NULL;
+ pMod = 0;
}
SwLayoutFrm* SwNode2LayImpl::UpperFrm( SwFrm* &rpFrm, const SwNode &rNode )
@@ -256,7 +324,7 @@ SwLayoutFrm* SwNode2LayImpl::UpperFrm( SwFrm* &rpFrm, const SwNode &rNode )
return static_cast<SwLayoutFrm*>(pFrm);
}
- pUpper = new SwSectionFrm(((SwSectionNode*)pNode)->GetSection());
+ pUpper = new SwSectionFrm(((SwSectionNode*)pNode)->GetSection(), rpFrm);
pUpper->Paste( rpFrm->GetUpper(),
bMaster ? rpFrm : rpFrm->GetNext() );
static_cast<SwSectionFrm*>(pUpper)->Init();
@@ -300,7 +368,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong
pNxt = pNxt->GetNext();
else
pNxt = pUp->Lower();
- pNew = ((SwCntntNode*)pNd)->MakeFrm();
+ pNew = ((SwCntntNode*)pNd)->MakeFrm( pUp );
pNew->Paste( pUp, pNxt );
(*pUpperFrms)[n-2] = pNew;
}
@@ -315,7 +383,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong
pNxt = pNxt->GetNext();
else
pNxt = pUp->Lower();
- pNew = ((SwTableNode*)pNd)->MakeFrm();
+ pNew = ((SwTableNode*)pNd)->MakeFrm( pUp );
OSL_ENSURE( pNew->IsTabFrm(), "Table exspected" );
pNew->Paste( pUp, pNxt );
((SwTabFrm*)pNew)->RegistFlys();
@@ -359,9 +427,8 @@ SwFrm* SwNode2LayImpl::GetFrm( const Point* pDocPos,
const SwPosition *pPos,
const sal_Bool bCalcFrm ) const
{
- return pIter ? ::GetFrmOfModify( pIter->GetModify(), USHRT_MAX,
- pDocPos, pPos, bCalcFrm )
- : 0;
+ // mba: test if change of member pIter -> pMod broke anything
+ return pMod ? ::GetFrmOfModify( 0, *pMod, USHRT_MAX, pDocPos, pPos, bCalcFrm ) : 0;
}
SwNode2Layout::SwNode2Layout( const SwNode& rNd, sal_uLong nIdx )
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 6f4640035830..dbd0f4194bf8 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -346,7 +346,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
SwPtrMsgPoolItem aMsgHint( nDelMsg,
(void*)&pAttr->GetAttr() );
rNds.GetDoc()->GetUnoCallBack()->
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
}
}
}
@@ -375,7 +375,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
if( bNewFrms )
bNewFrms = &GetDoc()->GetNodes() == (const SwNodes*)&rNds &&
- GetDoc()->GetRootFrm();
+ GetDoc()->GetCurrentViewShell(); //swmod 071108//swmod 071225
if( bNewFrms )
{
// Frames besorgen:
@@ -623,7 +623,7 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
SwFrmFmt* pTblFmt = pTblNd->GetTable().GetFrmFmt();
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
pTblFmt );
- pTblFmt->Modify( &aMsgHint, &aMsgHint );
+ pTblFmt->ModifyNotification( &aMsgHint, &aMsgHint );
}
}
if( bNewFrms )
@@ -1438,79 +1438,6 @@ SwCntntNode* SwNodes::GoPrevious(SwNodeIndex *pIdx) const
return (SwCntntNode*)pNd;
}
-SwNode* SwNodes::GoNextWithFrm(SwNodeIndex *pIdx) const
-{
- if( pIdx->GetIndex() >= Count() - 1 )
- return 0;
-
- SwNodeIndex aTmp(*pIdx, +1);
- SwNode* pNd = 0;
- while( aTmp < Count()-1 )
- {
- pNd = &aTmp.GetNode();
- SwModify *pMod = 0;
- if ( pNd->IsCntntNode() )
- pMod = (SwCntntNode*)pNd;
- else if ( pNd->IsTableNode() )
- pMod = ((SwTableNode*)pNd)->GetTable().GetFrmFmt();
- else if( pNd->IsEndNode() && !pNd->StartOfSectionNode()->IsSectionNode() )
- {
- pNd = 0;
- break;
- }
- if ( pMod && pMod->GetDepends() )
- {
- SwClientIter aIter( *pMod );
- if( aIter.First( TYPE(SwFrm) ) )
- break;
- }
- aTmp++;
- }
- if( aTmp == Count()-1 )
- pNd = 0;
- else if( pNd )
- (*pIdx) = aTmp;
- return pNd;
-}
-
-SwNode* SwNodes::GoPreviousWithFrm(SwNodeIndex *pIdx) const
-{
- if( !pIdx->GetIndex() )
- return 0;
-
- SwNodeIndex aTmp( *pIdx, -1 );
- SwNode* pNd(0);
- while( aTmp.GetIndex() )
- {
- pNd = &aTmp.GetNode();
- SwModify *pMod = 0;
- if ( pNd->IsCntntNode() )
- pMod = (SwCntntNode*)pNd;
- else if ( pNd->IsTableNode() )
- pMod = ((SwTableNode*)pNd)->GetTable().GetFrmFmt();
- else if( pNd->IsStartNode() && !pNd->IsSectionNode() )
- {
- pNd = 0;
- break;
- }
- if ( pMod && pMod->GetDepends() )
- {
- SwClientIter aIter( *pMod );
- if( aIter.First( TYPE(SwFrm) ) )
- break;
- }
- aTmp--;
- }
-
- if( !aTmp.GetIndex() )
- pNd = 0;
- else if( pNd )
- (*pIdx) = aTmp;
- return pNd;
-}
-
-
-
/*************************************************************************
|*
|* sal_Bool SwNodes::CheckNodesRange()
@@ -2295,7 +2222,7 @@ SwNode* SwNodes::FindPrvNxtFrmNode( SwNodeIndex& rFrmIdx,
SwNode* pFrmNd = 0;
// habe wir gar kein Layout, vergiss es
- if( GetDoc()->GetRootFrm() )
+ if( GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
SwNode* pSttNd = &rFrmIdx.GetNode();
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index af76b42d4150..a5bcf822af03 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -30,7 +30,6 @@
#include "precompiled_sw.hxx"
#include <stdlib.h>
-
#include <hintids.hxx>
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
@@ -39,7 +38,6 @@
#include <editeng/protitem.hxx>
#include <sfx2/linkmgr.hxx>
#include <tools/urlobj.hxx>
-
#include <sfx2/sfxsids.hrc>
#include <sfx2/fcontnr.hxx>
#include <docary.hxx>
@@ -65,9 +63,11 @@
#include <fmtftntx.hxx>
#include <ftnidx.hxx>
#include <doctxm.hxx>
-#include <fmteiro.hxx> // edit in readonly sections
+#include <fmteiro.hxx>
#include <swerror.h>
#include <unosection.hxx>
+#include <switerator.hxx>
+#include <svl/smplhint.hxx>
using namespace ::com::sun::star;
@@ -239,7 +239,7 @@ SwSection::~SwSection()
// dann melden wir noch schnell unser Format um ans dflt FrameFmt,
// damit es keine Abhaengigkeiten gibt
if( pFmt->DerivedFrom() != pDoc->GetDfltFrmFmt() )
- pDoc->GetDfltFrmFmt()->Add( pFmt );
+ pFmt->RegisterToFormat( *pDoc->GetDfltFrmFmt() );
}
else
{
@@ -258,7 +258,7 @@ SwSection::~SwSection()
// ist die Section der letzte Client im Format, kann dieses
// geloescht werden
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt );
- pFmt->Modify( &aMsgHint, &aMsgHint );
+ pFmt->ModifyNotification( &aMsgHint, &aMsgHint );
if( !pFmt->GetDepends() )
{
// Bug: 28191 - nicht ins Undo aufnehmen, sollte schon vorher
@@ -321,7 +321,7 @@ void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition)
// erstmal allen Childs sagen, das sie versteckt sind
SwMsgPoolItem aMsgItem( RES_SECTION_HIDDEN );
- pFmt->Modify( &aMsgItem, &aMsgItem );
+ pFmt->ModifyNotification( &aMsgItem, &aMsgItem );
// alle Frames loeschen
pFmt->DelFrms();
@@ -338,7 +338,7 @@ void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition)
// erstmal allen Childs sagen, das der Parent nicht mehr
// versteckt ist
SwMsgPoolItem aMsgItem( RES_SECTION_NOT_HIDDEN );
- pFmt->Modify( &aMsgItem, &aMsgItem );
+ pFmt->ModifyNotification( &aMsgItem, &aMsgItem );
pFmt->MakeFrms();
}
@@ -421,7 +421,7 @@ void SwSection::SetEditInReadonly(bool const bFlag)
}
}
-void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
bool bRemake = false;
bool bUpdateFtn = false;
@@ -470,7 +470,7 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( pNew )
{
bool bNewFlag =
- static_cast<SvxProtectItem*>(pNew)->IsCntntProtected();
+ static_cast<const SvxProtectItem*>(pNew)->IsCntntProtected();
if( !bNewFlag )
{
// Abschalten: teste ob nicht vielleich ueber die Parents
@@ -494,7 +494,7 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( pNew )
{
const bool bNewFlag =
- static_cast<SwFmtEditInReadonly*>(pNew)->GetValue();
+ static_cast<const SwFmtEditInReadonly*>(pNew)->GetValue();
m_Data.SetEditInReadonlyFlag( bNewFlag );
}
return;
@@ -525,6 +525,10 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
bUpdateFtn = true;
}
break;
+
+ default:
+ CheckRegistration( pOld, pNew );
+ break;
}
if( bRemake )
@@ -539,7 +543,6 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( pSectNd )
pSectNd->GetDoc()->GetFtnIdxs().UpdateFtn(SwNodeIndex( *pSectNd ));
}
- SwClient::Modify( pOld, pNew );
}
void SwSection::SetRefObject( SwServerObject* pObj )
@@ -682,19 +685,9 @@ SwSectionFmt::~SwSectionFmt()
rSect.SetHidden(false);
}
}
- SwClientIter aIter( *this );
- SwClient *pLast = aIter.GoStart();
- while ( pLast )
- {
- if ( pLast->IsA( TYPE(SwFrm) ) )
- {
- SwSectionFrm *pFrm = (SwSectionFrm*)pLast;
- SwSectionFrm::MoveCntntAndDelete( pFrm, sal_True );
- pLast = aIter.GoStart();
- }
- else
- pLast = aIter++;
- }
+ // mba: test iteration; objects are removed while iterating
+ CallSwClientNotify( SfxSimpleHint(SFX_HINT_DYING) );
+
// hebe die Section doch mal auf
SwNodeRange aRg( *pSectNd, 0, *pSectNd->EndOfSectionNode() );
GetDoc()->GetNodes().SectionUp( &aRg );
@@ -708,14 +701,7 @@ SwSectionFmt::~SwSectionFmt()
SwSection * SwSectionFmt::GetSection() const
{
- if( GetDepends() )
- {
- SwClientIter aIter( *(SwSectionFmt*)this );
- return (SwSectionPtr)aIter.First( TYPE(SwSection) );
- }
-
- OSL_FAIL( "keine Section als Client." );
- return 0;
+ return SwIterator<SwSection,SwSectionFmt>::FirstElement( *this );
}
extern void lcl_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd );
@@ -728,31 +714,17 @@ void SwSectionFmt::DelFrms()
if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() &&
0 != (pSectNd = pIdx->GetNode().GetSectionNode() ))
{
- SwClientIter aIter( *this );
- SwClient *pLast = aIter.GoStart();
- // First delete the <SwSectionFrm> of the <SwSectionFmt> instance
- while ( pLast )
- {
- if ( pLast->IsA( TYPE(SwFrm) ) )
- {
- SwSectionFrm *pFrm = (SwSectionFrm*)pLast;
- SwSectionFrm::MoveCntntAndDelete( pFrm, sal_False );
- pLast = aIter.GoStart();
- }
- else
- {
- pLast = aIter++;
- }
- }
+ // #147431# : First delete the <SwSectionFrm> of the <SwSectionFmt> instance
+ // mba: test iteration as objects are removed in iteration
+ CallSwClientNotify( SfxSimpleHint(SFX_HINT_DYING) );
+
// Then delete frames of the nested <SwSectionFmt> instances
- pLast = aIter.GoStart();
+ SwIterator<SwSectionFmt,SwSectionFmt> aIter( *this );
+ SwSectionFmt *pLast = aIter.First();
while ( pLast )
{
- if ( pLast->IsA( TYPE(SwSectionFmt) ) )
- {
- ((SwSectionFmt*)pLast)->DelFrms();
- }
- pLast = aIter++;
+ pLast->DelFrms();
+ pLast = aIter.Next();
}
sal_uLong nEnde = pSectNd->EndOfSectionIndex();
@@ -770,7 +742,7 @@ void SwSectionFmt::DelFrms()
if( pCNd )
{
const SfxPoolItem& rItem = pCNd->GetSwAttrSet().Get( RES_PAGEDESC );
- pCNd->Modify( (SfxPoolItem*)&rItem, (SfxPoolItem*)&rItem );
+ pCNd->ModifyNotification( (SfxPoolItem*)&rItem, (SfxPoolItem*)&rItem );
}
}
}
@@ -790,18 +762,7 @@ void SwSectionFmt::MakeFrms()
}
}
-void lcl_ClientIter( SwSectionFmt* pFmt, const SfxPoolItem* pOld,
- const SfxPoolItem* pNew )
-{
- SwClientIter aIter( *pFmt );
- SwClient * pLast = aIter.GoStart();
- if( pLast )
- do {
- pLast->Modify( (SfxPoolItem*)pOld, (SfxPoolItem*)pNew );
- } while( 0 != ( pLast = aIter++ ));
-}
-
-void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
sal_Bool bClients = sal_False;
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
@@ -816,7 +777,7 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( SFX_ITEM_SET == pNewSet->GetItemState(
RES_PROTECT, sal_False, &pItem ))
{
- lcl_ClientIter( this, pItem, pItem );
+ ModifyBroadcast( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem );
pNewSet->ClearItem( RES_PROTECT );
pOldSet->ClearItem( RES_PROTECT );
}
@@ -825,7 +786,7 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( SFX_ITEM_SET == pNewSet->GetItemState(
RES_EDIT_IN_READONLY, sal_False, &pItem ) )
{
- lcl_ClientIter( this, pItem, pItem );
+ ModifyBroadcast( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem );
pNewSet->ClearItem( RES_EDIT_IN_READONLY );
pOldSet->ClearItem( RES_EDIT_IN_READONLY );
}
@@ -834,16 +795,14 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( SFX_ITEM_SET == pNewSet->GetItemState(
RES_FTN_AT_TXTEND, sal_False, &pItem ))
{
- lcl_ClientIter( this, &pOldSet->Get( RES_FTN_AT_TXTEND ),
- pItem );
+ ModifyBroadcast( (SfxPoolItem*)&pOldSet->Get( RES_FTN_AT_TXTEND ), (SfxPoolItem*)pItem );
pNewSet->ClearItem( RES_FTN_AT_TXTEND );
pOldSet->ClearItem( RES_FTN_AT_TXTEND );
}
if( SFX_ITEM_SET == pNewSet->GetItemState(
RES_END_AT_TXTEND, sal_False, &pItem ))
{
- lcl_ClientIter( this, &pOldSet->Get( RES_END_AT_TXTEND ),
- pItem );
+ ModifyBroadcast( (SfxPoolItem*)&pOldSet->Get( RES_END_AT_TXTEND ), (SfxPoolItem*)pItem );
pNewSet->ClearItem( RES_END_AT_TXTEND );
pOldSet->ClearItem( RES_END_AT_TXTEND );
}
@@ -863,12 +822,7 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( pSect && ( bClients || ( RES_SECTION_HIDDEN == nWhich ?
!pSect->IsHiddenFlag() : pSect->IsHiddenFlag() ) ) )
{
- // selbst ueber die Clients iterieren, sollte schneller sein!
- SwClientIter aIter( *this );
- SwClient * pLast = aIter.GoStart();
- do {
- pLast->Modify( pOld, pNew );
- } while( 0 != ( pLast = aIter++ ));
+ ModifyBroadcast( pOld, pNew );
}
}
return ;
@@ -879,12 +833,7 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
// diese Messages bis zum Ende des Baums durchreichen !
if( GetDepends() )
{
- SwClientIter aIter( *this );
- SwClient * pLast = aIter.GoStart();
- if( pLast ) // konnte zum Anfang gesprungen werden ??
- do {
- pLast->Modify( pOld, pNew );
- } while( 0 != ( pLast = aIter++ ));
+ ModifyBroadcast( pOld, pNew );
}
return; // das wars
@@ -936,17 +885,16 @@ sal_Bool SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const
case RES_CONTENT_VISIBLE:
{
- SwFrm* pFrm = (SwFrm*)SwClientIter( *(SwSectionFmt*)this ).First( TYPE(SwFrm) );
+ SwFrm* pFrm = SwIterator<SwFrm,SwFmt>::FirstElement(*this);
// if the current section has no own frame search for the children
if(!pFrm)
{
- SwClientIter aFormatIter( *(SwSectionFmt*)this );
- SwSectionFmt* pChild = (SwSectionFmt*)aFormatIter.
- First( TYPE(SwSectionFmt) );
+ SwIterator<SwSectionFmt,SwSectionFmt> aFormatIter(*this);
+ SwSectionFmt* pChild = aFormatIter.First();
while(pChild && !pFrm)
{
- pFrm = (SwFrm*)SwClientIter( *pChild ).First( TYPE(SwFrm) );
- pChild = (SwSectionFmt*)aFormatIter.Next();
+ pFrm = SwIterator<SwFrm,SwFmt>::FirstElement(*pChild);
+ pChild = aFormatIter.Next();
}
}
((SwPtrMsgPoolItem&)rInfo).pObject = pFrm;
@@ -1005,15 +953,14 @@ sal_uInt16 SwSectionFmt::GetChildSections( SwSections& rArr,
if( GetDepends() )
{
- SwClientIter aIter( *this );
- SwClient * pLast;
+ SwIterator<SwSectionFmt,SwSectionFmt> aIter(*this);
const SwNodeIndex* pIdx;
- for( pLast = aIter.First(TYPE(SwSectionFmt)); pLast; pLast = aIter.Next() )
+ for( SwSectionFmt* pLast = aIter.First(); pLast; pLast = aIter.Next() )
if( bAllSections ||
- ( 0 != ( pIdx = ((SwSectionFmt*)pLast)->GetCntnt(sal_False).
+ ( 0 != ( pIdx = pLast->GetCntnt(sal_False).
GetCntntIdx()) && &pIdx->GetNodes() == &GetDoc()->GetNodes() ))
{
- const SwSection* Dummy=((SwSectionFmt*)pLast)->GetSection();
+ const SwSection* Dummy = pLast->GetSection();
rArr.C40_INSERT( SwSection,
Dummy,
rArr.Count() );
@@ -1062,8 +1009,8 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
const SwFmtEditInReadonly* pEditInReadonly = 0;
bool bIsHidden = false;
- SwClientIter aIter( *this );
- SwClient * pLast = aIter.GoStart();
+ SwClientIter aIter( *this ); // TODO
+ ::SwClient * pLast = aIter.GoStart();
if( pLast ) // konnte zum Anfang gesprungen werden ??
do {
if( pLast->IsA( TYPE(SwSectionFmt) ) )
@@ -1090,7 +1037,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
if (!pProtect->IsCntntProtected() !=
!pSection->IsProtectFlag())
{
- pLast->Modify( (SfxPoolItem*)pProtect,
+ pLast->ModifyNotification( (SfxPoolItem*)pProtect,
(SfxPoolItem*)pProtect );
}
@@ -1098,7 +1045,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
if (!pEditInReadonly->GetValue() !=
!pSection->IsEditInReadonlyFlag())
{
- pLast->Modify( (SfxPoolItem*)pEditInReadonly,
+ pLast->ModifyNotification( (SfxPoolItem*)pEditInReadonly,
(SfxPoolItem*)pEditInReadonly );
}
@@ -1107,7 +1054,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
SwMsgPoolItem aMsgItem( static_cast<sal_uInt16>(bIsHidden
? RES_SECTION_HIDDEN
: RES_SECTION_NOT_HIDDEN ) );
- pLast->Modify( &aMsgItem, &aMsgItem );
+ pLast->ModifyNotification( &aMsgItem, &aMsgItem );
}
}
else if( !pSection &&
diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx
index 464753c462b7..d04fd3fee03b 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -78,7 +78,7 @@ void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem )
// them havent't a loaded Graphic.
rGrfNd.LockModify();
- SwClientIter aIter( rGrfNd );
+ SwClientIter aIter( rGrfNd ); // TODO
for( int n = 0; n < 2; ++n )
{
SwClient * pLast = aIter.GoStart();
@@ -86,7 +86,7 @@ void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem )
{
do {
if( (0 == n) ^ ( 0 != pLast->ISA( SwCntntFrm )) )
- pLast->Modify( &rItem, &rItem );
+ pLast->ModifyNotification( &rItem, &rItem );
} while( 0 != ( pLast = aIter++ ));
}
}
@@ -215,7 +215,7 @@ void SwBaseLink::DataChanged( const String& rMimeType,
if ( (!pSh || !pSh->ActionPend()) && (!pESh || !pESh->ActionPend()) )
{
SwMsgPoolItem aMsgHint( RES_GRAPHIC_PIECE_ARRIVED );
- pCntntNode->Modify( &aMsgHint, &aMsgHint );
+ pCntntNode->ModifyNotification( &aMsgHint, &aMsgHint );
bUpdate = sal_False;
}
}
@@ -280,7 +280,7 @@ void SwBaseLink::DataChanged( const String& rMimeType,
}
else
{
- pCntntNode->Modify( &aMsgHint, &aMsgHint );
+ pCntntNode->ModifyNotification( &aMsgHint, &aMsgHint );
}
@@ -409,7 +409,6 @@ sal_Bool SwBaseLink::SwapIn( sal_Bool bWaitForData, sal_Bool bNativFormat )
if( GetObj() )
{
String aMimeType( SotExchange::GetFormatMimeType( GetContentType() ));
-
uno::Any aValue;
GetObj()->GetData( aValue, aMimeType, !IsSynchron() && bWaitForData );
@@ -437,7 +436,6 @@ sal_Bool SwBaseLink::SwapIn( sal_Bool bWaitForData, sal_Bool bNativFormat )
bRes = Update();
bSwapIn = sal_False;
-
return bRes;
}
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 7e259ed3169d..d8d030fb4fec 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -34,6 +34,7 @@
#include <editeng/ulspitem.hxx>
#include <editeng/lrspitem.hxx>
#include <svx/svdpage.hxx>
+#include <svx/svditer.hxx>
#include <svx/fmglob.hxx>
#include <svx/svdogrp.hxx>
#include <svx/svdotext.hxx>
@@ -72,7 +73,7 @@
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
#include <com/sun/star/text/WritingMode2.hpp>
-
+#include <switerator.hxx>
#include <algorithm>
using namespace ::com::sun::star;
@@ -295,13 +296,13 @@ void SwContact::_MoveObjToLayer( const bool _bToVisible,
return;
}
- if ( !pRegisteredIn )
+ if ( !GetRegisteredIn() )
{
OSL_FAIL( "SwDrawContact::_MoveObjToLayer(..) - no drawing frame format!" );
return;
}
- const IDocumentDrawModelAccess* pIDDMA = static_cast<SwFrmFmt*>(pRegisteredIn)->getIDocumentDrawModelAccess();
+ const IDocumentDrawModelAccess* pIDDMA = static_cast<SwFrmFmt*>(GetRegisteredInNonConst())->getIDocumentDrawModelAccess();
if ( !pIDDMA )
{
OSL_FAIL( "SwDrawContact::_MoveObjToLayer(..) - no writer document!" );
@@ -392,7 +393,7 @@ sal_uInt32 SwContact::GetMinOrdNum() const
{
sal_uInt32 nMinOrdNum( SAL_MAX_UINT32 );
- std::vector< SwAnchoredObject* > aObjs;
+ std::list< SwAnchoredObject* > aObjs;
GetAnchoredObjs( aObjs );
while ( !aObjs.empty() )
@@ -420,7 +421,7 @@ sal_uInt32 SwContact::GetMaxOrdNum() const
{
sal_uInt32 nMaxOrdNum( 0L );
- std::vector< SwAnchoredObject* > aObjs;
+ std::list< SwAnchoredObject* > aObjs;
GetAnchoredObjs( aObjs );
while ( !aObjs.empty() )
@@ -524,90 +525,11 @@ void SwFlyDrawContact::SetMaster( SdrObject* _pNewMaster )
/*************************************************************************
|*
-|* SwFlyDrawContact::CreateNewRef()
-|*
-|*************************************************************************/
-
-SwVirtFlyDrawObj *SwFlyDrawContact::CreateNewRef( SwFlyFrm *pFly )
-{
- SwVirtFlyDrawObj *pDrawObj = new SwVirtFlyDrawObj( *GetMaster(), pFly );
- pDrawObj->SetModel( GetMaster()->GetModel() );
- pDrawObj->SetUserCall( this );
-
- //Der Reader erzeugt die Master und setzt diese, um die Z-Order zu
- //transportieren, in die Page ein. Beim erzeugen der ersten Referenz werden
- //die Master aus der Liste entfernt und fuehren von da an ein
- //Schattendasein.
- SdrPage* pPg( 0L );
- if ( 0 != ( pPg = GetMaster()->GetPage() ) )
- {
- const sal_uInt32 nOrdNum = GetMaster()->GetOrdNum();
- pPg->ReplaceObject( pDrawObj, nOrdNum );
- }
- // --> OD 2004-08-16 #i27030# - insert new <SwVirtFlyDrawObj> instance
- // into drawing page with correct order number
- else
- {
- GetFmt()->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 )->
- InsertObject( pDrawObj, _GetOrdNumForNewRef( pFly ) );
- }
- // <--
- // --> OD 2004-12-13 #i38889# - assure, that new <SwVirtFlyDrawObj> instance
- // is in a visible layer.
- MoveObjToVisibleLayer( pDrawObj );
- // <--
- return pDrawObj;
-}
-
-/** method to determine new order number for new instance of <SwVirtFlyDrawObj>
-
- OD 2004-08-16 #i27030#
- Used in method <CreateNewRef(..)>
-
- @author OD
-*/
-sal_uInt32 SwFlyDrawContact::_GetOrdNumForNewRef( const SwFlyFrm* _pFlyFrm )
-{
- sal_uInt32 nOrdNum( 0L );
-
- // search for another Writer fly frame registered at same frame format
- SwClientIter aIter( *GetFmt() );
- const SwFlyFrm* pFlyFrm( 0L );
- for ( pFlyFrm = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm) );
- pFlyFrm;
- pFlyFrm = (SwFlyFrm*)aIter.Next() )
- {
- if ( pFlyFrm != _pFlyFrm )
- {
- break;
- }
- }
-
- if ( pFlyFrm )
- {
- // another Writer fly frame found. Take its order number
- nOrdNum = pFlyFrm->GetVirtDrawObj()->GetOrdNum();
- }
- else
- {
- // no other Writer fly frame found. Take order number of 'master' object
- // --> OD 2004-11-11 #i35748# - use method <GetOrdNumDirect()> instead
- // of method <GetOrdNum()> to avoid a recalculation of the order number,
- // which isn't intended.
- nOrdNum = GetMaster()->GetOrdNumDirect();
- // <--
- }
-
- return nOrdNum;
-}
-
-/*************************************************************************
-|*
|* SwFlyDrawContact::Modify()
|*
|*************************************************************************/
-void SwFlyDrawContact::Modify( SfxPoolItem *, SfxPoolItem * )
+void SwFlyDrawContact::Modify( const SfxPoolItem*, const SfxPoolItem * )
{
}
@@ -687,17 +609,10 @@ void SwFlyDrawContact::MoveObjToInvisibleLayer( SdrObject* _pDrawObj )
@author
*/
-void SwFlyDrawContact::GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const
+void SwFlyDrawContact::GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const
{
const SwFrmFmt* pFmt = GetFmt();
-
- SwClientIter aIter( *(const_cast<SwFrmFmt*>(pFmt)) );
- for( SwFlyFrm* pFlyFrm = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm) );
- pFlyFrm;
- pFlyFrm = (SwFlyFrm*)aIter.Next() )
- {
- _roAnchoredObjs.push_back( pFlyFrm );
- }
+ SwFlyFrm::GetAnchoredObjects( _roAnchoredObjs, *pFmt );
}
/*************************************************************************
@@ -734,7 +649,7 @@ SwDrawContact::SwDrawContact( SwFrmFmt* pToRegisterIn, SdrObject* pObj ) :
// <mbUserCallActive> is sal_False.
meEventTypeOfCurrentUserCall( SDRUSERCALL_MOVEONLY )
{
- // clear vector containing 'virtual' drawing objects.
+ // clear list containing 'virtual' drawing objects.
maDrawVirtObjs.clear();
// --> #i33909# - assure, that drawing object is inserted
@@ -782,6 +697,45 @@ SwDrawContact::~SwDrawContact()
}
}
+void SwDrawContact::GetTextObjectsFromFmt( std::list<SdrTextObj*>& rTextObjects, SwDoc* pDoc )
+{
+ for( sal_Int32 n=0; n<pDoc->GetSpzFrmFmts()->Count(); n++ )
+ {
+ SwFrmFmt* pFly = (*pDoc->GetSpzFrmFmts())[n];
+ if( pFly->IsA( TYPE(SwDrawFrmFmt) ) )
+ {
+ std::list<SdrTextObj*> aTextObjs;
+ SwDrawContact* pContact = SwIterator<SwDrawContact,SwFrmFmt>::FirstElement(*pFly);
+ if( pContact )
+ {
+ SdrObject* pSdrO = pContact->GetMaster();
+ if ( pSdrO )
+ {
+ if ( pSdrO->IsA( TYPE(SdrObjGroup) ) )
+ {
+ SdrObjListIter aListIter( *pSdrO, IM_DEEPNOGROUPS );
+ //iterate inside of a grouped object
+ while( aListIter.IsMore() )
+ {
+ SdrObject* pSdrOElement = aListIter.Next();
+ if( pSdrOElement && pSdrOElement->IsA( TYPE(SdrTextObj) ) &&
+ static_cast<SdrTextObj*>( pSdrOElement)->HasText() )
+ {
+ rTextObjects.push_back((SdrTextObj*) pSdrOElement);
+ }
+ }
+ }
+ else if( pSdrO->IsA( TYPE(SdrTextObj) ) &&
+ static_cast<SdrTextObj*>( pSdrO )->HasText() )
+ {
+ rTextObjects.push_back((SdrTextObj*) pSdrO);
+ }
+ }
+ }
+ }
+ }
+}
+
// OD 2004-03-29 #i26791#
const SwAnchoredObject* SwDrawContact::GetAnchoredObj( const SdrObject* _pSdrObj ) const
{
@@ -1162,9 +1116,8 @@ void SwDrawContact::Changed( const SdrObject& rObj,
// OD 2004-06-01 #i26791# - no event handling, if existing <ViewShell>
// is in contruction
SwDoc* pDoc = GetFmt()->GetDoc();
- if ( pDoc->GetRootFrm() &&
- pDoc->GetRootFrm()->GetCurrShell() &&
- pDoc->GetRootFrm()->GetCurrShell()->IsInConstructor() )
+ if ( pDoc->GetCurrentViewShell() &&
+ pDoc->GetCurrentViewShell()->IsInConstructor() )
{
return;
}
@@ -1180,7 +1133,8 @@ void SwDrawContact::Changed( const SdrObject& rObj,
//Action aufsetzen, aber nicht wenn gerade irgendwo eine Action laeuft.
ViewShell *pSh = 0, *pOrg;
- if ( pDoc->GetRootFrm() && pDoc->GetRootFrm()->IsCallbackActionEnabled() )
+ SwRootFrm *pTmpRoot = pDoc->GetCurrentLayout();//swmod 080317
+ if ( pTmpRoot && pTmpRoot->IsCallbackActionEnabled() )
{
pDoc->GetEditShell( &pOrg );
pSh = pOrg;
@@ -1194,13 +1148,13 @@ void SwDrawContact::Changed( const SdrObject& rObj,
} while ( pSh && pSh != pOrg );
if ( pSh )
- pDoc->GetRootFrm()->StartAllAction();
+ pTmpRoot->StartAllAction();
}
SdrObjUserCall::Changed( rObj, eType, rOldBoundRect );
_Changed( rObj, eType, &rOldBoundRect ); //Achtung, ggf. Suizid!
if ( pSh )
- pDoc->GetRootFrm()->EndAllAction();
+ pTmpRoot->EndAllAction();
}
// helper class for method <SwDrawContact::_Changed(..)> for handling nested
@@ -1353,7 +1307,7 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
{
if(::CheckControlLayer(maAnchoredDrawObj.DrawObj()))
{
- const IDocumentDrawModelAccess* pIDDMA = static_cast<SwFrmFmt*>(pRegisteredIn)->getIDocumentDrawModelAccess();
+ const IDocumentDrawModelAccess* pIDDMA = static_cast<SwFrmFmt*>(GetRegisteredInNonConst())->getIDocumentDrawModelAccess();
const SdrLayerID aCurrentLayer(maAnchoredDrawObj.DrawObj()->GetLayer());
const SdrLayerID aControlLayerID(pIDDMA->GetControlsId());
const SdrLayerID aInvisibleControlLayerID(pIDDMA->GetInvisibleControlsId());
@@ -1549,7 +1503,7 @@ namespace
|*
|*************************************************************************/
-void SwDrawContact::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwDrawContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
OSL_ENSURE( !mbDisconnectInProgress,
"<SwDrawContact::Modify(..)> called during disconnection.");
@@ -1754,7 +1708,7 @@ void SwDrawContact::DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer )
// Instead of removing 'master' object from drawing page, move the
// 'master' drawing object into the corresponding invisible layer.
{
- //((SwFrmFmt*)pRegisteredIn)->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
+ //((SwFrmFmt*)GetRegisteredIn())->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
// RemoveObject( GetMaster()->GetOrdNum() );
// #i18447# - in order to consider group object correct
// use new method <SwDrawContact::MoveObjToInvisibleLayer(..)>
@@ -1773,7 +1727,7 @@ void SwDrawContact::RemoveMasterFromDrawPage()
GetMaster()->SetUserCall( 0 );
if ( GetMaster()->IsInserted() )
{
- ((SwFrmFmt*)pRegisteredIn)->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
+ ((SwFrmFmt*)GetRegisteredIn())->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
RemoveObject( GetMaster()->GetOrdNum() );
}
}
@@ -1859,13 +1813,10 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
}
// <--
- SwFrmFmt* pDrawFrmFmt = (SwFrmFmt*)pRegisteredIn;
+ SwFrmFmt* pDrawFrmFmt = (SwFrmFmt*)GetRegisteredIn();
- SwRootFrm* pRoot = pDrawFrmFmt->getIDocumentLayoutAccess()->GetRootFrm();
- if ( !pRoot )
- {
+ if( !pDrawFrmFmt->getIDocumentLayoutAccess()->GetCurrentViewShell() )
return;
- }
// remove 'virtual' drawing objects from writer
// layout and from drawing page, and remove 'master' drawing object from
@@ -1882,6 +1833,10 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
case FLY_AT_PAGE:
{
sal_uInt16 nPgNum = pAnch->GetPageNum();
+ ViewShell *pShell = pDrawFrmFmt->getIDocumentLayoutAccess()->GetCurrentViewShell();
+ if( !pShell )
+ break;
+ SwRootFrm* pRoot = pShell->GetLayout();
SwPageFrm *pPage = static_cast<SwPageFrm*>(pRoot->Lower());
for ( sal_uInt16 i = 1; i < nPgNum && pPage; ++i )
@@ -1920,8 +1875,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
{
SwNodeIndex aIdx( pAnch->GetCntntAnchor()->nNode );
SwCntntNode* pCNd = pDrawFrmFmt->GetDoc()->GetNodes().GoNext( &aIdx );
- SwClientIter aIter( *pCNd );
- if ( aIter.First( TYPE(SwFrm) ) )
+ if ( SwIterator<SwFrm,SwCntntNode>::FirstElement( *pCNd ) )
pModify = pCNd;
else
{
@@ -1953,11 +1907,9 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
pModify = pAnch->GetCntntAnchor()->nNode.GetNode().GetCntntNode();
}
}
- SwClientIter aIter( *pModify );
+ SwIterator<SwFrm,SwModify> aIter( *pModify );
SwFrm* pAnchorFrmOfMaster = 0;
- for( SwFrm *pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
- pFrm;
- pFrm = (SwFrm*)aIter.Next() )
+ for( SwFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
// append drawing object, if
// (1) proposed anchor frame isn't a follow and
@@ -2110,7 +2062,7 @@ void SwDrawContact::ChangeMasterObject( SdrObject *pNewMaster )
}
// get data collection of anchored objects, handled by with contact
-void SwDrawContact::GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const
+void SwDrawContact::GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const
{
_roAnchoredObjs.push_back( const_cast<SwAnchoredDrawObject*>(&maAnchoredDrawObj) );
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 096386733626..a350cc1772e1 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -55,6 +55,7 @@
#include "ndnotxt.hxx"
#include "grfatr.hxx"
#include "pagefrm.hxx"
+#include "rootfrm.hxx"
using namespace ::com::sun::star;
@@ -457,7 +458,7 @@ SwFrmFmt *SwVirtFlyDrawObj::GetFmt()
void SwVirtFlyDrawObj::wrap_DoPaintObject() const
{
- ViewShell* pShell = pFlyFrm->GetShell();
+ ViewShell* pShell = pFlyFrm->getRootFrm()->GetCurrShell();
// Only paint when we have a current shell and a DrawingLayer paint is in progress.
// This avcoids evtl. problems with renderers which do processing stuff,
@@ -817,9 +818,9 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef,
const SwFrm *pRel = GetFlyFrm()->IsFlyLayFrm() ?
GetFlyFrm()->GetAnchorFrm() :
GetFlyFrm()->GetAnchorFrm()->GetUpper();
- const ViewShell *pSh = GetFlyFrm()->GetShell();
+ const ViewShell *pSh = GetFlyFrm()->getRootFrm()->GetCurrShell();
if ( pSh && pRel->IsBodyFrm() &&
- pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ pSh->GetViewOptions()->getBrowseMode() &&
pSh->VisArea().HasArea() )
{
nRelWidth = pSh->GetBrowseWidth();
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index b39bd6521a76..b47d1a1c134c 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -108,7 +108,7 @@ void InsertGridFrame( SdrPageGridFrameList *pLst, const SwFrm *pPg )
const SdrPageGridFrameList* SwDPage::GetGridFrameList(
const SdrPageView* pPV, const Rectangle *pRect ) const
{
- ViewShell *pSh = ((SwDrawDocument*)GetModel())->GetDoc().GetRootFrm()->GetCurrShell();
+ ViewShell *pSh = ((SwDrawDocument*)GetModel())->GetDoc().GetCurrentViewShell(); //swmod 071108//swmod 071225
if ( pSh )
{
while ( pSh->Imp()->GetPageView() != pPV )
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index 658bbbf802c2..4827627f6ef1 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -423,7 +423,7 @@ void SwDrawView::_MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
const std::vector<SdrObject*>& _rMovedChildObjs ) const
{
// determine 'repeated' objects of already moved object <_rMovedAnchoredObj>
- std::vector<SwAnchoredObject*> aAnchoredObjs;
+ std::list<SwAnchoredObject*> aAnchoredObjs;
{
const SwContact* pContact = ::GetUserCall( _rMovedAnchoredObj.GetDrawObj() );
OSL_ENSURE( pContact,
@@ -1042,8 +1042,9 @@ void SwDrawView::ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView )
void SwDrawView::DeleteMarked()
{
SwDoc* pDoc = Imp().GetShell()->GetDoc();
- if ( pDoc->GetRootFrm() )
- pDoc->GetRootFrm()->StartAllAction();
+ SwRootFrm *pTmpRoot = pDoc->GetCurrentLayout();//swmod 080317
+ if ( pTmpRoot )
+ pTmpRoot->StartAllAction();
pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
// replace marked <SwDrawVirtObj>-objects by its reference objects.
{
@@ -1063,11 +1064,8 @@ void SwDrawView::DeleteMarked()
::FrameNotify( Imp().GetShell(), FLY_DRAG_END );
}
pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
- if( pDoc->GetRootFrm() )
- pDoc->GetRootFrm()->EndAllAction();
+ if( pTmpRoot )
+ pTmpRoot->EndAllAction(); //swmod 080218
}
-
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index c047543e4bf9..a9ab99f2ee4b 100644..100755
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -158,6 +158,10 @@ sal_Bool SwAutoCorrDoc::Insert( xub_StrLen nPos, const String& rTxt )
sal_Bool SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt )
{
+ return ReplaceRange( nPos, rTxt.Len(), rTxt );
+}
+sal_Bool SwAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, const String& rTxt )
+{
SwPaM* pPam = &rCrsr;
if( pPam->GetPoint()->nContent.GetIndex() != nPos )
{
@@ -201,14 +205,26 @@ sal_Bool SwAutoCorrDoc::Replace( xub_StrLen nPos, const String& rTxt )
pPam->SetMark();
pPam->GetPoint()->nContent = Min( pNd->GetTxt().Len(),
- xub_StrLen( nPos + rTxt.Len() ));
+ xub_StrLen( nPos + nSourceLength ));
pDoc->ReplaceRange( *pPam, rTxt, false );
pPam->Exchange();
pPam->DeleteMark();
}
}
else
- pDoc->Overwrite( *pPam, rTxt );
+ {
+ if( nSourceLength != rTxt.Len() )
+ {
+ pPam->SetMark();
+ pPam->GetPoint()->nContent = Min( pNd->GetTxt().Len(),
+ xub_StrLen( nPos + nSourceLength ));
+ pDoc->ReplaceRange( *pPam, rTxt, false );
+ pPam->Exchange();
+ pPam->DeleteMark();
+ }
+ else
+ pDoc->Overwrite( *pPam, rTxt );
+ }
// pDoc->SetRedlineMode_intern( eOld );
if( bUndoIdInitialized )
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 5658526ea35d..4400b66b1704 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -269,7 +269,7 @@ const sal_Unicode* StrChr( const sal_Unicode* pSrc, sal_Unicode c )
SwTxtFrm* SwAutoFormat::GetFrm( const SwTxtNode& rTxtNd ) const
{
// get the Frame
- const SwCntntFrm *pFrm = rTxtNd.GetFrm();
+ const SwCntntFrm *pFrm = rTxtNd.getLayoutFrm( pEditShell->GetLayout() );
OSL_ENSURE( pFrm, "zum Autoformat muss das Layout vorhanden sein" );
if( aFlags.bAFmtByInput && !pFrm->IsValid() )
{
@@ -1526,6 +1526,9 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
aFmt.SetBulletFont( pBullFnt );
aFmt.SetBulletChar( cBullChar );
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
+ // #i93908# clear suffix for bullet lists
+ aFmt.SetPrefix(::rtl::OUString());
+ aFmt.SetSuffix(::rtl::OUString());
aFmt.SetFirstLineOffset( lBullFirstLineOffset );
aFmt.SetAbsLSpace( nAbsPos );
if( !aFmt.GetCharFmt() )
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index e55b8c3f05ed..a67663445a85 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -343,7 +343,7 @@ sal_Bool SwEditShell::IsMoveLeftMargin( sal_Bool bRight, sal_Bool bModulus ) con
long nNext = rLS.GetTxtLeft() + nDefDist;
if( bModulus )
nNext = ( nNext / nDefDist ) * nDefDist;
- SwFrm* pFrm = pCNd->GetFrm();
+ SwFrm* pFrm = pCNd->getLayoutFrm( GetLayout() );
if ( pFrm )
{
const sal_uInt16 nFrmWidth = static_cast<sal_uInt16>( pFrm->IsVertical() ?
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index e6b111dd38f1..494f780898df 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -91,7 +91,7 @@ void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo )
}
// geschuetze Boxen ueberspringen !
if( !pNd->IsCntntNode() ||
- !((SwCntntNode*)pNd)->GetFrm()->IsProtected() )
+ !((SwCntntNode*)pNd)->getLayoutFrm( GetLayout() )->IsProtected() )
{
// alles loeschen
GetDoc()->DeleteAndJoin( aDelPam );
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index 8e20335fe89f..58005a97832b 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -46,7 +46,8 @@
#include <dbmgr.hxx>
#include <swddetbl.hxx>
#include <hints.hxx>
-
+#include <switerator.hxx>
+#include <fieldhint.hxx>
/*--------------------------------------------------------------------
Beschreibung: Feldtypen zu einer ResId zaehlen
@@ -201,45 +202,13 @@ void SwEditShell::FieldToText( SwFieldType* pType )
Push();
SwPaM* pPaM = GetCrsr();
- sal_Bool bDDEFld = RES_DDEFLD == pType->Which();
- // Modify-Object gefunden, trage alle Felder ins Array ein
+ SwFieldHint aHint( pPaM );
SwClientIter aIter( *pType );
- SwClient * pLast = aIter.GoStart();
-
- if( pLast ) // konnte zum Anfang gesprungen werden ??
- do {
- pPaM->DeleteMark();
- const SwFmtFld* pFmtFld = bDDEFld
- ? PTR_CAST( SwFmtFld, pLast )
- : (SwFmtFld*)pLast;
-
- if( pFmtFld )
- {
- if( !pFmtFld->GetTxtFld() )
- continue;
-
- // kann keine DDETabelle sein
- const SwTxtNode& rTxtNode = pFmtFld->GetTxtFld()->GetTxtNode();
- pPaM->GetPoint()->nNode = rTxtNode;
- pPaM->GetPoint()->nContent.Assign( (SwTxtNode*)&rTxtNode,
- *pFmtFld->GetTxtFld()->GetStart() );
-
- // Feldinhalt durch Text ersetzen
- String const aEntry( pFmtFld->GetFld()->ExpandField(true) );
- pPaM->SetMark();
- pPaM->Move( fnMoveForward );
- GetDoc()->DeleteRange( *pPaM );
- GetDoc()->InsertString( *pPaM, aEntry );
- }
- else if( bDDEFld )
- {
- // DDETabelle
- SwDepend* pDep = (SwDepend*)pLast;
- SwDDETable* pDDETbl = (SwDDETable*)pDep->GetToTell();
- pDDETbl->NoDDETable();
- }
-
- } while( 0 != ( pLast = aIter++ ));
+ for ( SwClient* pClient = aIter.GoStart(); pClient; aIter++ )
+ {
+ pPaM->DeleteMark();
+ pClient->SwClientNotifyCall( *pType, aHint );
+ }
Pop( sal_False );
EndAllAction();
@@ -569,13 +538,13 @@ sal_Bool SwEditShell::IsAnyDatabaseFieldInDoc()const
case RES_DBNUMSETFLD:
case RES_DBSETNUMBERFLD:
{
- SwClientIter aIter( rFldType );
- SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( rFldType );
+ SwFmtFld* pFld = aIter.First();
while(pFld)
{
if(pFld->IsFldInDoc())
return sal_True;
- pFld = (SwFmtFld*)aIter.Next();
+ pFld = aIter.Next();
}
}
break;
diff --git a/sw/source/core/edit/edfldexp.cxx b/sw/source/core/edit/edfldexp.cxx
index a506445ad10f..0bc650313adc 100644
--- a/sw/source/core/edit/edfldexp.cxx
+++ b/sw/source/core/edit/edfldexp.cxx
@@ -41,6 +41,7 @@
#include <fmtfld.hxx>
#include <edimp.hxx>
#include <flddat.hxx>
+#include <switerator.hxx>
using namespace com::sun::star;
using ::rtl::OUString;
@@ -66,8 +67,8 @@ sal_Bool SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const
{
case RES_DBFLD:
{
- SwClientIter aIter( rFldType );
- SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( rFldType );
+ SwFmtFld* pFld = aIter.First();
while(pFld)
{
if(pFld->IsFldInDoc())
@@ -84,7 +85,7 @@ sal_Bool SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const
return sal_False;
}
}
- pFld = (SwFmtFld*)aIter.Next();
+ pFld = aIter.Next();
}
}
break;
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 729a9061cef3..5f428d85c4f9 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -68,7 +68,7 @@
#include <numrule.hxx>
#include <SwNodeNum.hxx>
#include <unocrsr.hxx>
-
+#include <switerator.hxx>
using namespace com::sun::star;
@@ -153,7 +153,7 @@ void SwEditShell::Insert2(const String &rStr, const bool bForceExpandHints )
// seems to be an empty paragraph.
Point aPt;
SwCntntFrm* pFrm =
- ((SwTxtNode&)rNode).GetFrm( &aPt, pTmpCrsr->GetPoint(),
+ ((SwTxtNode&)rNode).getLayoutFrm( GetLayout(), &aPt, pTmpCrsr->GetPoint(),
sal_False );
SwScriptInfo aScriptInfo;
@@ -391,10 +391,9 @@ void SwEditShell::SetGraphicPolygon( const PolyPolygon *pPoly )
SwNoTxtNode *pNd = GetCrsr()->GetNode()->GetNoTxtNode();
StartAllAction();
pNd->SetContour( pPoly );
- SwFlyFrm *pFly = (SwFlyFrm*)pNd->GetFrm()->GetUpper();
+ SwFlyFrm *pFly = (SwFlyFrm*)pNd->getLayoutFrm(GetLayout())->GetUpper();
const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround();
- pFly->GetFmt()->SwModify::Modify( (SwFmtSurround*)&rSur,
- (SwFmtSurround*)&rSur );
+ pFly->GetFmt()->NotifyClients( (SwFmtSurround*)&rSur, (SwFmtSurround*)&rSur );
GetDoc()->SetModified();
EndAllAction();
}
@@ -407,10 +406,9 @@ void SwEditShell::ClearAutomaticContour()
{
StartAllAction();
pNd->SetContour( NULL, sal_False );
- SwFlyFrm *pFly = (SwFlyFrm*)pNd->GetFrm()->GetUpper();
+ SwFlyFrm *pFly = (SwFlyFrm*)pNd->getLayoutFrm(GetLayout())->GetUpper();
const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround();
- pFly->GetFmt()->SwModify::Modify( (SwFmtSurround*)&rSur,
- (SwFmtSurround*)&rSur );
+ pFly->GetFmt()->NotifyClients( (SwFmtSurround*)&rSur, (SwFmtSurround*)&rSur );
GetDoc()->SetModified();
EndAllAction();
}
@@ -449,7 +447,7 @@ sal_Bool SwEditShell::HasOLEObj( const String &rName ) const
SwNode& rNd = aIdx.GetNode();
if( rNd.IsOLENode() &&
rName == ((SwOLENode&)rNd).GetChartTblName() &&
- ((SwOLENode&)rNd).GetFrm() )
+ ((SwOLENode&)rNd).getLayoutFrm( GetLayout() ) )
return sal_True;
aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 );
@@ -701,7 +699,7 @@ Graphic SwEditShell::GetIMapGraphic() const
}
else
{
- SwFlyFrm* pFlyFrm = pNd->GetCntntNode()->GetFrm()->FindFlyFrm();
+ SwFlyFrm* pFlyFrm = pNd->GetCntntNode()->getLayoutFrm( GetLayout() )->FindFlyFrm();
if(pFlyFrm)
aRet = pFlyFrm->GetFmt()->MakeGraphic();
}
@@ -775,14 +773,13 @@ sal_uInt16 SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
const SwCharFmts* pFmts = GetDoc()->GetCharFmts();
for( sal_uInt16 n = pFmts->Count(); 1 < n; )
{
- SwClientIter aIter( *(*pFmts)[ --n ] );
-
- for( SwClient* pFnd = aIter.First(TYPE( SwTxtINetFmt ));
- pFnd; pFnd = aIter.Next() )
- if( 0 != ( pTxtNd = ((SwTxtINetFmt*)pFnd)->GetpTxtNode()) &&
+ SwIterator<SwTxtINetFmt,SwCharFmt> aIter(*(*pFmts)[--n]);
+ for( SwTxtINetFmt* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
+ {
+ if( 0 != ( pTxtNd = pFnd->GetpTxtNode()) &&
pTxtNd->GetNodes().IsDocNodes() )
{
- SwTxtINetFmt& rAttr = *(SwTxtINetFmt*)pFnd;
+ SwTxtINetFmt& rAttr = *pFnd;
String sTxt( pTxtNd->GetExpandTxt( *rAttr.GetStart(),
*rAttr.GetEnd() - *rAttr.GetStart() ) );
@@ -796,6 +793,7 @@ sal_uInt16 SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
}
}
}
+ }
return rArr.Count();
}
@@ -868,7 +866,7 @@ void SwEditShell::SetNumberingRestart()
switch( pNd->GetNodeType() )
{
case ND_TEXTNODE:
- if( 0 != ( pCntFrm = ((SwTxtNode*)pNd)->GetFrm()) )
+ if( 0 != ( pCntFrm = ((SwTxtNode*)pNd)->getLayoutFrm( GetLayout() )) )
{
//jump over hidden frames - ignore protection!
if( !((SwTxtFrm*)pCntFrm)->IsHiddenNow() )
@@ -936,7 +934,7 @@ sal_uInt16 SwEditShell::GetLineCount( sal_Bool bActPos )
else
{
if( 0 != ( pCNd = pPam->GetCntntNode() ) &&
- 0 != ( pCntFrm = pCNd->GetFrm() ) )
+ 0 != ( pCntFrm = pCNd->getLayoutFrm( GetLayout() ) ) )
{
const SwStartNode *pTmp;
if( pCntFrm->IsInFly() ) // Fly
@@ -964,7 +962,7 @@ sal_uInt16 SwEditShell::GetLineCount( sal_Bool bActPos )
while( 0 != ( pCNd = GetDoc()->GetNodes().GoNextSection(
&aStart, sal_True, sal_False )) && ( !bActPos || aStart <= rPtIdx ) )
{
- if( 0 != ( pCntFrm = pCNd->GetFrm() ) && pCntFrm->IsTxtFrm() )
+ if( 0 != ( pCntFrm = pCNd->getLayoutFrm( GetLayout() ) ) && pCntFrm->IsTxtFrm() )
{
xub_StrLen nActPos = bActPos && aStart == rPtIdx ?
pPam->GetPoint()->nContent.GetIndex() : USHRT_MAX;
@@ -1158,4 +1156,12 @@ void SwEditShell::CountWords( SwDocStat& rStat ) const
FOREACHPAM_END()
}
+void SwEditShell::ApplyViewOptions( const SwViewOption &rOpt )
+{
+ SwCrsrShell::StartAction();
+ ViewShell::ApplyViewOptions( rOpt );
+ SwEditShell::EndAction();
+}
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 65ae73daa6e1..f90ebe45748f 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -65,7 +65,7 @@
#include <docary.hxx> // SwRedlineTbl
#include <docsh.hxx>
#include <txatbase.hxx>
-
+#include <txtfrm.hxx>
using namespace ::svx;
using namespace ::com::sun::star;
@@ -73,8 +73,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::linguistic2;
-extern void repaintTextFrames( SwModify& rModify );
-
/*************************************************************************
* class SwLinguIter
*************************************************************************/
@@ -1082,7 +1080,7 @@ uno::Reference< XSpellAlternatives >
SwCrsrMoveState aState;
aState.bRealWidth = sal_True;
SwCntntNode* pCntntNode = pCrsr->GetCntntNode();
- SwCntntFrm *pCntntFrame = pCntntNode->GetFrm(pPt, pCrsr->GetPoint(), sal_False);
+ SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), sal_False);
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
rContent = nWordEnd - 1;
@@ -1214,7 +1212,7 @@ bool SwEditShell::GetGrammarCorrection(
SwCrsrMoveState aState;
aState.bRealWidth = sal_True;
SwCntntNode* pCntntNode = pCrsr->GetCntntNode();
- SwCntntFrm *pCntntFrame = pCntntNode->GetFrm(pPt, pCrsr->GetPoint(), sal_False);
+ SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), sal_False);
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
rContent = nWordEnd - 1;
@@ -1918,7 +1916,7 @@ void SwEditShell::IgnoreGrammarErrorAt( SwPaM& rErrorPosition )
pWrong = pNode->GetWrong();
if( pWrong )
pWrong->RemoveEntry( nStart, nEnd );
- ::repaintTextFrames( *pNode );
+ SwTxtFrm::repaintTextFrames( *pNode );
}
++aIdx;
nStart = 0;
diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx
index 62463af9f947..25e4dcb434af 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -104,7 +104,7 @@ const SwSection* SwEditShell::GetAnySection( sal_Bool bOutOfTab, const Point* pP
Point aPt( *pPt );
GetLayout()->GetCrsrOfst( &aPos, aPt );
SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode();
- pFrm = pNd->GetFrm( pPt );
+ pFrm = pNd->getLayoutFrm( GetLayout(), pPt );
}
else
pFrm = GetCurrFrm( sal_False );
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index b86a70f01be5..1bbf0b3b9e9a 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -331,13 +331,15 @@ void SwEditShell::ApplyAutoMark()
{
//1.
const SwTOXType* pTOXType = GetTOXType(TOX_INDEX, 0);
- SwClientIter aIter(*(SwTOXType*)pTOXType);
- SwTOXMark* pMark = (SwTOXMark*)aIter.First(TYPE(SwTOXMark));
- while( pMark )
+
+ SwTOXMarks aMarks;
+ SwTOXMark::InsertTOXMarks( aMarks, *pTOXType );
+ for( sal_uInt16 nMark=0; nMark<aMarks.Count(); nMark++ )
{
+ SwTOXMark* pMark = aMarks[nMark];
if(pMark->IsAutoGenerated() && pMark->GetTxtTOXMark())
+ // mba: test iteration; objects are deleted in iteration
DeleteTOXMark(pMark);
- pMark = (SwTOXMark*)aIter.Next();
}
//2.
diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx
index 8366ec3bf6fc..0ee3879c48c5 100644
--- a/sw/source/core/edit/edundo.cxx
+++ b/sw/source/core/edit/edundo.cxx
@@ -239,10 +239,16 @@ void lcl_SelectSdrMarkList( SwEditShell* pShell,
if( pShell->ISA( SwFEShell ) )
{
SwFEShell* pFEShell = static_cast<SwFEShell*>( pShell );
+ bool bFirst = true;
for( sal_uInt16 i = 0; i < pSdrMarkList->GetMarkCount(); ++i )
- pFEShell->SelectObj( Point(),
- (i==0) ? 0 : SW_ADD_SELECT,
- pSdrMarkList->GetMark( i )->GetMarkedSdrObj() );
+ {
+ SdrObject *pObj = pSdrMarkList->GetMark( i )->GetMarkedSdrObj();
+ if( pObj )
+ {
+ pFEShell->SelectObj( Point(), bFirst ? 0 : SW_ADD_SELECT, pObj );
+ bFirst = false;
+ }
+ }
// the old implementation would always unselect
// objects, even if no new ones were selected. If this
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index e1d88e187988..53052fb9ef08 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -54,7 +54,7 @@
#include <doc.hxx>
#include <unofldmid.h>
#include <unoprnms.hxx>
-
+#include <switerator.hxx>
#include <unomid.h>
using namespace ::com::sun::star::uno;
@@ -87,7 +87,6 @@ sal_Bool SwAuthEntry::operator==(const SwAuthEntry& rComp)
return sal_True;
}
// --------------------------------------------------------
-
SwAuthorityFieldType::SwAuthorityFieldType(SwDoc* pDoc)
: SwFieldType( RES_AUTHORITY ),
m_pDoc(pDoc),
@@ -270,9 +269,9 @@ bool SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry)
}
return bChanged;
}
-/*-----------------------------------------------------------------------
- Description: appends a new entry (if new) and returns the array position
+/*-------------------------------------------------------------------------
+ appends a new entry (if new) and returns the array position
-----------------------------------------------------------------------*/
sal_uInt16 SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert )
{
@@ -316,12 +315,11 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle)
if(m_SequArr.empty())
{
SwTOXSortTabBases aSortArr;
- SwClientIter aIter( *this );
+ SwIterator<SwFmtFld,SwFieldType> aIter( *this );
SwTOXInternational aIntl(m_eLanguage, 0, m_sSortAlgorithm);
- for( SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() )
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
if(!pTxtFld || !pTxtFld->GetpTxtNode())
@@ -335,7 +333,7 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle)
const SwTxtNode& rFldTxtNode = pTxtFld->GetTxtNode();
SwPosition aFldPos(rFldTxtNode);
SwDoc& rDoc = *(SwDoc*)rFldTxtNode.GetDoc();
- SwCntntFrm *pFrm = rFldTxtNode.GetFrm();
+ SwCntntFrm *pFrm = rFldTxtNode.getLayoutFrm( rDoc.GetCurrentLayout() );
const SwTxtNode* pTxtNode = 0;
if(pFrm && !pFrm->IsInDocBody())
pTxtNode = GetBodyTxtNode( rDoc, aFldPos, *pFrm );
@@ -343,7 +341,7 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle)
//body the directly available text node will be used
if(!pTxtNode)
pTxtNode = &rFldTxtNode;
- if( pTxtNode->GetTxt().Len() && pTxtNode->GetFrm() &&
+ if( pTxtNode->GetTxt().Len() && pTxtNode->getLayoutFrm( rDoc.GetCurrentLayout() ) &&
pTxtNode->GetNodes().IsDocNodes() )
{
SwTOXAuthority* pNew = new SwTOXAuthority( *pTxtNode,
@@ -404,7 +402,6 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(long nHandle)
return nRet;
}
-
bool SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) const
{
switch( nWhichId )
@@ -533,11 +530,11 @@ bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
return bRet;
}
-void SwAuthorityFieldType::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwAuthorityFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
//re-generate positions of the fields
DelSequenceArray();
- SwModify::Modify( pOld, pNew );
+ NotifyClients( pOld, pNew );
}
sal_uInt16 SwAuthorityFieldType::GetSortKeyCount() const
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index 12b2d4ede232..c27498819ee7 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -718,15 +718,13 @@ const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const String& rNm ) const
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 );
+ return pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, NULL, sal_False );
}
long lcl_GetLongBoxNum( String& rStr )
diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx
index 8f1e6bd16c87..3eb1f758f3ee 100644
--- a/sw/source/core/fields/dbfld.cxx
+++ b/sw/source/core/fields/dbfld.cxx
@@ -49,7 +49,7 @@
#include <expfld.hxx>
#include <txtatr.hxx>
#include <unofldmid.h>
-
+#include <switerator.hxx>
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star;
@@ -163,8 +163,8 @@ bool SwDBFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
if( sTmp != sColumn )
{
sColumn = sTmp;
- SwClientIter aIter( *this );
- SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( *this );
+ SwFmtFld* pFld = aIter.First();
while(pFld)
{
// Feld im Undo?
@@ -175,7 +175,7 @@ bool SwDBFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
pDBField->ClearInitialized();
pDBField->InitContent();
}
- pFld = (SwFmtFld*)aIter.Next();
+ pFld = aIter.Next();
}
}
}
@@ -448,8 +448,8 @@ bool SwDBField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
//invalidate text node
if(GetTyp())
{
- SwClientIter aIter( *GetTyp() );
- SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( *GetTyp() );
+ SwFmtFld* pFld = aIter.First();
while(pFld)
{
SwTxtFld *pTxtFld = pFld->GetTxtFld();
@@ -459,7 +459,7 @@ bool SwDBField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
pTxtFld->NotifyContentChange(*pFld);
break;
}
- pFld = (SwFmtFld*)aIter.Next();
+ pFld = aIter.Next();
}
}
}
@@ -922,7 +922,6 @@ String SwDBSetNumberField::Expand() const
return aEmptyStr;
else
return FormatNumber((sal_uInt16)nNumber, GetFormat());
- //return(nNumber == 0 ? aEmptyStr : FormatNumber(nNumber, GetFormat()));
}
//------------------------------------------------------------------------------
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index 464525ede506..4c6e08187c75 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -122,7 +122,7 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType,
int bCallModify = sal_False;
rFldType.LockModify();
- SwClientIter aIter( rFldType );
+ SwClientIter aIter( rFldType ); // TODO
SwClient * pLast = aIter.GoStart();
if( pLast ) // konnte zum Anfang gesprungen werden ??
do {
@@ -137,7 +137,7 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType,
else if( pSh )
pSh->StartAction();
}
- pLast->Modify( 0, &aUpdateDDE );
+ pLast->ModifyNotification( 0, &aUpdateDDE );
bCallModify = sal_True;
}
} while( 0 != ( pLast = aIter++ ));
@@ -184,7 +184,7 @@ const SwNode* SwIntrnlRefLink::GetAnchor() const
{
// hier sollte irgend ein Anchor aus dem normalen Nodes-Array reichen
const SwNode* pNd = 0;
- SwClientIter aIter( rFldType );
+ SwClientIter aIter( rFldType ); // TODO
SwClient * pLast = aIter.GoStart();
if( pLast ) // konnte zum Anfang gesprungen werden ??
do {
@@ -211,7 +211,7 @@ sal_Bool SwIntrnlRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd,
{
// hier sollte irgend ein Anchor aus dem normalen Nodes-Array reichen
SwNodes* pNds = &rFldType.GetDoc()->GetNodes();
- SwClientIter aIter( rFldType );
+ SwClientIter aIter( rFldType ); // TODO
SwClient * pLast = aIter.GoStart();
if( pLast ) // konnte zum Anfang gesprungen werden ??
do {
@@ -317,7 +317,7 @@ void SwDDEFieldType::_RefCntChgd()
{
refLink->SetVisible( pDoc->IsVisibleLinks() );
pDoc->GetLinkManager().InsertDDELink( refLink );
- if( pDoc->GetRootFrm() )
+ if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
UpdateNow();
}
else
@@ -393,8 +393,8 @@ SwDDEField::SwDDEField( SwDDEFieldType* pInitType )
SwDDEField::~SwDDEField()
{
- if( GetTyp()->IsLastDepend() ) // der Letzte mach das
- ((SwDDEFieldType*)GetTyp())->Disconnect(); // Licht aus
+ if( GetTyp()->IsLastDepend() )
+ ((SwDDEFieldType*)GetTyp())->Disconnect();
}
String SwDDEField::Expand() const
diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx
index c10ea7d2895f..e520cdbda4f2 100644
--- a/sw/source/core/fields/ddetbl.cxx
+++ b/sw/source/core/fields/ddetbl.cxx
@@ -40,7 +40,7 @@
#include <ndindex.hxx>
#include <fldupde.hxx>
#include <swtblfmt.hxx>
-
+#include <fieldhint.hxx>
TYPEINIT1( SwDDETable, SwTable );
@@ -63,10 +63,12 @@ SwDDETable::SwDDETable( SwTable& rTable, SwDDEFieldType* pDDEType,
const SwNode& rNd = *GetTabSortBoxes()[0]->GetSttNd();
if( rNd.GetNodes().IsDocNodes() )
{
- // "aktivieren der Updates" (Modify nicht noch mal rufen)
- aDepend.LockModify();
+ // mba: swclient refactoring - this code shouldn't have done anything!
+ // the ModifyLock Flag is evaluated in SwModify only, though it was accessible via SwClient
+ // This has been fixed now
+// aDepend.LockModify();
pDDEType->IncRefCnt();
- aDepend.UnlockModify();
+// aDepend.UnlockModify();
// Setzen der Werte in die einzelnen Boxen
// update box content only if update flag is set (false in import)
@@ -92,7 +94,7 @@ SwDDETable::~SwDDETable()
}
}
-void SwDDETable::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwDDETable::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( pNew && RES_UPDATEDDETBL == pNew->Which() )
ChangeContent();
@@ -100,6 +102,14 @@ void SwDDETable::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
SwTable::Modify( pOld, pNew );
}
+void SwDDETable::SwClientNotify( const SwModify&, const SfxHint& rHint )
+{
+ const SwFieldHint* pHint = dynamic_cast<const SwFieldHint*>( &rHint );
+ if ( pHint )
+ // replace DDETable by real table
+ NoDDETable();
+}
+
void SwDDETable::ChangeContent()
{
OSL_ENSURE( GetFrmFmt(), "Kein FrameFormat" );
@@ -177,7 +187,7 @@ sal_Bool SwDDETable::NoDDETable()
pNewTbl->GetTabLines().Insert( &GetTabLines(),0 ); // move die Lines
GetTabLines().Remove( 0, GetTabLines().Count() );
- if( pDoc->GetRootFrm() )
+ if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
((SwDDEFieldType*)aDepend.GetRegisteredIn())->DecRefCnt();
pTblNd->SetNewTable( pNewTbl ); // setze die Tabelle
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index a26c1facd378..cf340a808417 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -103,6 +103,7 @@
#include <editeng/outliner.hxx>
#include <editeng/outlobj.hxx>
+#include <switerator.hxx>
#define URL_DECODE INetURLObject::DECODE_UNAMBIGUOUS
@@ -176,14 +177,11 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc, sal_uInt16 nPage,
if( 0 != (pDesc = (SwFmtPageDesc*)rPool.GetItem2( RES_PAGEDESC, n ) )
&& pDesc->GetNumOffset() && pDesc->GetDefinedIn() )
{
- if( pDesc->GetDefinedIn()->ISA( SwCntntNode ))
+ SwCntntNode* pNd = PTR_CAST( SwCntntNode, pDesc->GetDefinedIn() );
+ if( pNd )
{
- SwClientIter aIter( *(SwModify*)pDesc->GetDefinedIn() );
- if( aIter.First( TYPE( SwFrm ) ) )
- {
+ if ( SwIterator<SwFrm,SwCntntNode>::FirstElement(*pNd) )
bVirtuell = sal_True;
- break;
- }
}
else if( pDesc->GetDefinedIn()->ISA( SwFmt ))
{
@@ -774,8 +772,8 @@ String SwDocStatFieldType::Expand(sal_uInt16 nSubType, sal_uInt32 nFmt) const
case DS_WORD: nVal = rDStat.nWord; break;
case DS_CHAR: nVal = rDStat.nChar; break;
case DS_PAGE:
- if( pDoc->GetRootFrm() )
- ((SwDocStat &)rDStat).nPage = pDoc->GetRootFrm()->GetPageNum();
+ if( pDoc->GetCurrentLayout() )//swmod 080218
+ ((SwDocStat &)rDStat).nPage = pDoc->GetCurrentLayout()->GetPageNum(); //swmod 080218
nVal = rDStat.nPage;
if( SVX_NUM_PAGEDESC == nFmt )
nFmt = (sal_uInt32)nNumberingType;
@@ -885,7 +883,6 @@ SwDocInfoFieldType::SwDocInfoFieldType(SwDoc* pDc)
{
}
-
SwFieldType* SwDocInfoFieldType::Copy() const
{
SwDocInfoFieldType* pTyp = new SwDocInfoFieldType(GetDoc());
@@ -905,7 +902,6 @@ void lcl_GetLocalDataWrapper( sal_uLong nLang,
SvxCreateLocale( static_cast<LanguageType>(nLang) ) );
}
-
String SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat,
sal_uInt16 nLang, const String& rName ) const
{
@@ -1053,7 +1049,6 @@ String SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat,
return aStr;
}
-
SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const String& rName, sal_uInt32 nFmt) :
SwValueField(pTyp, nFmt), nSubType(nSub)
{
@@ -2074,7 +2069,7 @@ SwFieldType* SwRefPageSetFieldType::Copy() const
}
// ueberlagert, weil es nichts zum Updaten gibt!
-void SwRefPageSetFieldType::Modify( SfxPoolItem *, SfxPoolItem * )
+void SwRefPageSetFieldType::Modify( const SfxPoolItem*, const SfxPoolItem * )
{
}
@@ -2155,7 +2150,7 @@ SwFieldType* SwRefPageGetFieldType::Copy() const
return pNew;
}
-void SwRefPageGetFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwRefPageGetFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
// Update auf alle GetReferenz-Felder
if( !pNew && !pOld && GetDepends() )
@@ -2164,28 +2159,24 @@ void SwRefPageGetFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
_SetGetExpFlds aTmpLst( 10, 5 );
if( MakeSetList( aTmpLst ) )
{
- SwClientIter aIter( *this );
- if( aIter.GoStart() )
- do {
+ SwIterator<SwFmtFld,SwFieldType> aIter( *this );
+ for ( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
// nur die GetRef-Felder Updaten
- SwFmtFld* pFmtFld = (SwFmtFld*)aIter();
if( pFmtFld->GetTxtFld() )
UpdateField( pFmtFld->GetTxtFld(), aTmpLst );
- } while( aIter++ );
}
}
// weiter an die Text-Felder, diese "Expandieren" den Text
- SwModify::Modify( pOld, pNew );
+ NotifyClients( pOld, pNew );
}
sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst )
{
- SwClientIter aIter( *pDoc->GetSysFldType( RES_REFPAGESETFLD));
- if( aIter.GoStart() )
- do {
+ SwIterator<SwFmtFld,SwFieldType> aIter(*pDoc->GetSysFldType( RES_REFPAGESETFLD));
+ for ( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
+ {
// nur die GetRef-Felder Updaten
- SwFmtFld* pFmtFld = (SwFmtFld*)aIter();
const SwTxtFld* pTFld = pFmtFld->GetTxtFld();
if( pTFld )
{
@@ -2193,7 +2184,7 @@ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst )
// immer den ersten !! (in Tab-Headline, Kopf-/Fuss )
Point aPt;
- const SwCntntFrm* pFrm = rTxtNd.GetFrm( &aPt, 0, sal_False );
+ const SwCntntFrm* pFrm = rTxtNd.getLayoutFrm( rTxtNd.GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False );
_SetGetExpFld* pNew;
@@ -2225,7 +2216,7 @@ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst )
if( !rTmpLst.Insert( pNew ))
delete pNew;
}
- } while( aIter++ );
+ }
return rTmpLst.Count();
}
@@ -2256,8 +2247,8 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld,
{
// dann bestimme mal den entsp. Offset
Point aPt;
- const SwCntntFrm* pFrm = pTxtNode->GetFrm( &aPt, 0, sal_False );
- const SwCntntFrm* pRefFrm = pRefTxtFld->GetTxtNode().GetFrm( &aPt, 0, sal_False );
+ const SwCntntFrm* pFrm = pTxtNode->getLayoutFrm( pTxtNode->GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False );
+ const SwCntntFrm* pRefFrm = pRefTxtFld->GetTxtNode().getLayoutFrm( pRefTxtFld->GetTxtNode().GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False );
const SwPageFrm* pPgFrm = 0;
sal_uInt16 nDiff = ( pFrm && pRefFrm )
? (pPgFrm = pFrm->FindPageFrm())->GetPhyPageNum() -
@@ -2275,7 +2266,7 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld,
}
}
// dann die Formatierung anstossen
- ((SwFmtFld&)pTxtFld->GetFld()).Modify( 0, 0 );
+ ((SwFmtFld&)pTxtFld->GetFld()).ModifyNotification( 0, 0 );
}
/*--------------------------------------------------------------------
@@ -2344,7 +2335,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm,
const SwRefPageSetField* pSetFld =
(SwRefPageSetField*)pRefTxtFld->GetFld().GetFld();
Point aPt;
- const SwCntntFrm* pRefFrm = pRefTxtFld ? pRefTxtFld->GetTxtNode().GetFrm( &aPt, 0, sal_False ) : 0;
+ const SwCntntFrm* pRefFrm = pRefTxtFld ? pRefTxtFld->GetTxtNode().getLayoutFrm( pFrm->getRootFrm(), &aPt, 0, sal_False ) : 0;
if( pSetFld->IsOn() && pRefFrm )
{
// dann bestimme mal den entsp. Offset
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 495d371967a5..9027ee7bf412 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -64,6 +64,7 @@
#include <SwStyleNameMapper.hxx>
#include <unofldmid.h>
#include <numrule.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
@@ -285,10 +286,10 @@ SwFieldType* SwGetExpFieldType::Copy() const
return new SwGetExpFieldType(GetDoc());
}
-void SwGetExpFieldType::Modify( SfxPoolItem*, SfxPoolItem* pNew )
+void SwGetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* pNew )
{
if( pNew && RES_DOCPOS_UPDATE == pNew->Which() )
- SwModify::Modify( 0, pNew );
+ NotifyClients( 0, pNew );
// sonst nichts weiter expandieren
}
@@ -503,10 +504,6 @@ bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
return true;
}
-/*-------------------------------------------------
- Set-Expression-Type
- --------------------------------------------------*/
-
SwSetExpFieldType::SwSetExpFieldType( SwDoc* pDc, const String& rName, sal_uInt16 nTyp )
: SwValueFieldType( pDc, RES_SETEXPFLD ),
sName( rName ),
@@ -534,16 +531,15 @@ const String& SwSetExpFieldType::GetName() const
return sName;
}
-void SwSetExpFieldType::Modify( SfxPoolItem*, SfxPoolItem* )
+void SwSetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* )
{
return; // nicht weiter expandieren
}
void SwSetExpFieldType::SetSeqFormat(sal_uLong nFmt)
{
- SwClientIter aIter(*this);
- for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFld; pFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter(*this);
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
pFld->GetFld()->ChangeFormat( nFmt );
}
@@ -568,10 +564,9 @@ extern void InsertSort( SvUShorts& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos =
// dann testmal, ob die Nummer schon vergeben ist oder ob eine neue
// bestimmt werden muss.
- SwClientIter aIter( *this );
+ SwIterator<SwFmtFld,SwFieldType> aIter( *this );
const SwTxtNode* pNd;
- for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF;
- pF = (SwFmtFld*)aIter.Next() )
+ for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
if( pF->GetFld() != &rFld && pF->GetTxtFld() &&
0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) &&
pNd->GetNodes().IsDocNodes() )
@@ -606,10 +601,9 @@ sal_uInt16 SwSetExpFieldType::GetSeqFldList( SwSeqFldList& rList )
if( rList.Count() )
rList.Remove( 0, rList.Count() );
- SwClientIter aIter( *this );
+ SwIterator<SwFmtFld,SwFieldType> aIter( *this );
const SwTxtNode* pNd;
- for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF;
- pF = (SwFmtFld*)aIter.Next() )
+ for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
if( pF->GetTxtFld() &&
0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) &&
pNd->GetNodes().IsDocNodes() )
diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx
index a7ee49314997..b3be2924760f 100644
--- a/sw/source/core/fields/fldlst.cxx
+++ b/sw/source/core/fields/fldlst.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
+#include "switerator.hxx"
#include "editsh.hxx"
#include "doc.hxx"
#include <docary.hxx>
@@ -64,10 +64,8 @@ SwInputFieldList::SwInputFieldList( SwEditShell* pShell, sal_Bool bBuildTmpLst )
if( RES_SETEXPFLD == nType || RES_INPUTFLD == nType || RES_DROPDOWN == nType )
{
- SwClientIter aIter( *pFldType );
- for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFld; pFld = (SwFmtFld*)aIter.Next() )
-
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
const SwTxtFld* pTxtFld = pFld->GetTxtFld();
@@ -162,9 +160,8 @@ sal_uInt16 SwInputFieldList::BuildSortLst()
if( RES_SETEXPFLD == nType || RES_INPUTFLD == nType )
{
- SwClientIter aIter( *pFldType );
- for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFld; pFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
const SwTxtFld* pTxtFld = pFld->GetTxtFld();
diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx
index fb57eebdeef3..81cc0c294713 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -48,7 +48,7 @@
#include <redline.hxx>
#include <scriptinfo.hxx>
#include <editeng/charhiddenitem.hxx>
-
+#include <switerator.hxx>
namespace {
@@ -94,9 +94,8 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( std::vector< SwLa
SwCntntNode* pNode = rPos.nNode.GetNode().GetCntntNode(); // getfirstcontentnode // getnext...
if( !pNode )
return aRet;
- SwClientIter aIter( *pNode );
- SwTxtFrm *pTxtFrm;
- for( pTxtFrm = (SwTxtFrm*)aIter.First( TYPE( SwTxtFrm )); pTxtFrm; pTxtFrm = (SwTxtFrm*)aIter.Next() )
+ SwIterator<SwTxtFrm,SwCntntNode> aIter( *pNode );
+ for( SwTxtFrm* pTxtFrm = aIter.First(); pTxtFrm; pTxtFrm = aIter.Next() )
{
if( !pTxtFrm->IsFollow() )
{
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 5a1b83fe4e5c..2035ac97fc38 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -58,9 +58,7 @@
#include <flyfrm.hxx>
#include <pagedesc.hxx>
#include <IMark.hxx>
-// --> OD 2007-10-18 #i81002#
#include <crossrefbookmark.hxx>
-// <--
#include <ftnidx.hxx>
#include <viewsh.hxx>
#include <unofldmid.h>
@@ -71,6 +69,7 @@
#include <comcore.hrc>
#include <numrule.hxx>
#include <SwNodeNum.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
@@ -106,8 +105,8 @@ void lcl_GetLayTree( const SwFrm* pFrm, SvPtrarr& rArr )
sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos,
const SwTxtNode& rBehindNd, sal_uInt16 nSttPos )
{
- const SwTxtFrm *pMyFrm = (SwTxtFrm*)rMyNd.GetFrm(0,0,sal_False),
- *pFrm = (SwTxtFrm*)rBehindNd.GetFrm(0,0,sal_False);
+ const SwTxtFrm *pMyFrm = (SwTxtFrm*)rMyNd.getLayoutFrm( rMyNd.GetDoc()->GetCurrentLayout(), 0,0,sal_False),
+ *pFrm = (SwTxtFrm*)rBehindNd.getLayoutFrm( rBehindNd.GetDoc()->GetCurrentLayout(), 0,0,sal_False);
while( pFrm && !pFrm->IsInside( nSttPos ) )
pFrm = (SwTxtFrm*)pFrm->GetFollow();
@@ -393,7 +392,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
case REF_PAGE:
case REF_PAGE_PGDESC:
{
- const SwTxtFrm* pFrm = (SwTxtFrm*)pTxtNd->GetFrm(0,0,sal_False),
+ const SwTxtFrm* pFrm = (SwTxtFrm*)pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0,0,sal_False),
*pSave = pFrm;
while( pFrm && !pFrm->IsInside( nStt ) )
pFrm = (SwTxtFrm*)pFrm->GetFollow();
@@ -415,7 +414,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
case REF_CHAPTER:
{
// ein bischen trickreich: suche irgend einen Frame
- const SwFrm* pFrm = pTxtNd->GetFrm();
+ const SwFrm* pFrm = pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout() );
if( pFrm )
{
SwChapterFieldType aFldTyp;
@@ -756,10 +755,6 @@ void SwGetRefField::ConvertProgrammaticToUIName()
}
}
}
-/*-----------------JP: 18.06.93 -------------------
- Get-Referenz-Type
- --------------------------------------------------*/
-
SwGetRefFieldType::SwGetRefFieldType( SwDoc* pDc )
: SwFieldType( RES_GETREFFLD ), pDoc( pDc )
@@ -772,14 +767,13 @@ SwFieldType* SwGetRefFieldType::Copy() const
}
-void SwGetRefFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwGetRefFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
// Update auf alle GetReferenz-Felder
if( !pNew && !pOld )
{
- SwClientIter aIter( *this );
- for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFld; pFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *this );
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
// nur die GetRef-Felder Updaten
//JP 3.4.2001: Task 71231 - we need the correct language
@@ -799,7 +793,7 @@ void SwGetRefFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
}
}
// weiter an die Text-Felder, diese "Expandieren" den Text
- SwModify::Modify( pOld, pNew );
+ NotifyClients( pOld, pNew );
}
SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark,
@@ -830,9 +824,8 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark,
if( pFldType && pFldType->GetDepends() &&
nsSwGetSetExpType::GSE_SEQ & ((SwSetExpFieldType*)pFldType)->GetType() )
{
- SwClientIter aIter( *pFldType );
- for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFld; pFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
if( pFld->GetTxtFld() && nSeqNo ==
((SwSetExpField*)pFld->GetFld())->GetSeqNumber() )
@@ -943,22 +936,20 @@ void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld,
if( bField )
{
const SwTxtNode* pNd;
- SwModify* pMod;
- if( 0 != ( pMod = rDestDoc.GetFldType( RES_SETEXPFLD, aName, false ) ))
+ SwFieldType* pType;
+ if( 0 != ( pType = rDestDoc.GetFldType( RES_SETEXPFLD, aName, false ) ))
{
- SwClientIter aIter( *pMod );
- for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF;
- pF = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
if( pF->GetTxtFld() &&
0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) &&
pNd->GetNodes().IsDocNodes() )
aIds.Insert( ((SwSetExpField*)pF->GetFld())->GetSeqNumber() );
}
- if( 0 != ( pMod = rDoc.GetFldType( RES_SETEXPFLD, aName, false ) ))
+ if( 0 != ( pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false ) ))
{
- SwClientIter aIter( *pMod );
- for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF;
- pF = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
if( pF->GetTxtFld() &&
0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) &&
pNd->GetNodes().IsDocNodes() )
@@ -1004,12 +995,11 @@ void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld,
// Id umsetzen
if( bField )
{
- SwModify* pMod = rDoc.GetFldType( RES_SETEXPFLD, aName, false );
- if( pMod )
+ SwFieldType* pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false );
+ if( pType )
{
- SwClientIter aIter( *pMod );
- for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF;
- pF = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
if( pF->GetTxtFld() && nSeqNo ==
((SwSetExpField*)pF->GetFld())->GetSeqNumber() )
((SwSetExpField*)pF->GetFld())->SetSeqNumber( n );
@@ -1047,11 +1037,10 @@ void SwGetRefFieldType::MergeWithOtherDoc( SwDoc& rDestDoc )
_RefIdsMap aFntMap( aEmptyStr );
_RefIdsMaps aFldMap;
- SwClientIter aIter( *this );
- for( SwClient* pFld = aIter.First( TYPE( SwFmtFld ));
- pFld; pFld = aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *this );
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
- SwGetRefField& rRefFld = *(SwGetRefField*)((SwFmtFld*)pFld)->GetFld();
+ SwGetRefField& rRefFld = *(SwGetRefField*)pFld->GetFld();
switch( rRefFld.GetSubType() )
{
case REF_SEQUENCEFLD:
diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx
index c3f081a3f2dd..451c963f39ee 100644
--- a/sw/source/core/fields/tblcalc.cxx
+++ b/sw/source/core/fields/tblcalc.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
+#include <switerator.hxx>
#include <cntfrm.hxx>
#include <doc.hxx>
#include <pam.hxx> // fuer GetBodyTxtNode
@@ -40,7 +40,6 @@
#include <docfld.hxx> // fuer _SetGetExpFld
#include <unofldmid.h>
-
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -105,15 +104,10 @@ const SwNode* SwTblField::GetNodeOfFormula() const
if( !GetTyp()->GetDepends() )
return 0;
- SwClientIter aIter( *GetTyp() );
- SwClient * pLast = aIter.GoStart();
- if( pLast ) // konnte zum Anfang gesprungen werden ??
- do {
- const SwFmtFld* pFmtFld = (SwFmtFld*)pLast;
+ SwIterator<SwFmtFld,SwFieldType> aIter( *GetTyp() );
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
if( this == pFmtFld->GetFld() )
return (SwTxtNode*)&pFmtFld->GetTxtFld()->GetTxtNode();
-
- } while( 0 != ( pLast = aIter++ ));
return 0;
}
diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx
index 8909f588f842..e5ba807f44fa 100644
--- a/sw/source/core/fields/usrfld.cxx
+++ b/sw/source/core/fields/usrfld.cxx
@@ -228,12 +228,12 @@ const String& SwUserFieldType::GetName() const
return aName;
}
-void SwUserFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwUserFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( !pOld && !pNew )
ChgValid( sal_False );
- SwModify::Modify( pOld, pNew );
+ NotifyClients( pOld, pNew );
// und ggfs. am UserFeld haengende InputFelder updaten!
GetDoc()->GetSysFldType( RES_INPUTFLD )->UpdateFlds();
}
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index f2a53816c0fe..8662286726de 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -262,7 +262,7 @@ sal_Bool lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrm* pFl
{
sal_Bool bRet = sal_True;
rAnchor.SetAnchor( &rPos );
- SwCntntFrm* pTmpFrm = rNd.GetCntntNode()->GetFrm( &rInsPt, 0, sal_False );
+ SwCntntFrm* pTmpFrm = rNd.GetCntntNode()->getLayoutFrm( rDestShell.GetLayout(), &rInsPt, 0, sal_False );
SwFlyFrm *pTmpFly = pTmpFrm->FindFlyFrm();
if( pTmpFly && bCheckFlyRecur && pFly->IsUpperOf( *pTmpFly ) )
{
diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx
index 11ea45c3cdea..28becd7069d7 100644
--- a/sw/source/core/frmedt/fedesc.cxx
+++ b/sw/source/core/frmedt/fedesc.cxx
@@ -229,14 +229,14 @@ const SwPageDesc* SwFEShell::GetSelectedPageDescs() const
FOREACHPAM_START(this)
if( 0 != (pCNd = PCURCRSR->GetCntntNode() ) &&
- 0 != ( pPtFrm = pCNd->GetFrm( &aNulPt, 0, sal_False )) )
+ 0 != ( pPtFrm = pCNd->getLayoutFrm( GetLayout(), &aNulPt, 0, sal_False )) )
pPtFrm = pPtFrm->FindPageFrm();
else
pPtFrm = 0;
if( PCURCRSR->HasMark() &&
0 != (pCNd = PCURCRSR->GetCntntNode( sal_False ) ) &&
- 0 != ( pMkFrm = pCNd->GetFrm( &aNulPt, 0, sal_False )) )
+ 0 != ( pMkFrm = pCNd->getLayoutFrm( GetLayout(), &aNulPt, 0, sal_False )) )
pMkFrm = pMkFrm->FindPageFrm();
else
pMkFrm = pPtFrm;
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 1a504d038f03..0661ae227dbc 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -108,7 +108,7 @@ sal_Bool lcl_SetNewFlyPos( const SwNode& rNode, SwFmtAnchor& rAnchor,
else
{
const SwCntntNode *pCntNd = rNode.GetCntntNode();
- const SwCntntFrm* pCFrm = pCntNd ? pCntNd->GetFrm( &rPt, 0, sal_False ) : 0;
+ const SwCntntFrm* pCFrm = pCntNd ? pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &rPt, 0, sal_False ) : 0;
const SwPageFrm *pPg = pCFrm ? pCFrm->FindPageFrm() : 0;
rAnchor.SetPageNum( pPg ? pPg->GetPhyPageNum() : 1 );
@@ -171,9 +171,9 @@ sal_Bool lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
SwCrsrMoveState aState( MV_SETONLYTEXT );
SwPosition aPos( rDoc.GetNodes() );
aTmpPnt.X() -= 1; //nicht im Fly landen!!
- rDoc.GetRootFrm()->GetCrsrOfst( &aPos, aTmpPnt, &aState );
+ rDoc.GetCurrentLayout()->GetCrsrOfst( &aPos, aTmpPnt, &aState ); //swmod 071108//swmod 071225
pNewAnch = ::FindAnchor(
- aPos.nNode.GetNode().GetCntntNode()->GetFrm( 0, 0, sal_False ),
+ aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( rFrm.getRootFrm(), 0, 0, sal_False ),
aTmpPnt )->FindFlyFrm();
if( pNewAnch && &rFrm != pNewAnch && !pNewAnch->IsProtected() )
@@ -281,7 +281,7 @@ SwFlyFrm *SwFEShell::FindFlyFrm() const
return 0;
SdrObject *pO = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
- return pO->ISA(SwVirtFlyDrawObj) ? ((SwVirtFlyDrawObj*)pO)->GetFlyFrm() : 0;
+ return ( pO && pO->ISA(SwVirtFlyDrawObj) ) ? ((SwVirtFlyDrawObj*)pO)->GetFlyFrm() : 0;
}
return 0;
}
@@ -341,7 +341,7 @@ const SwFrmFmt* SwFEShell::IsFlyInFly()
aPoint.X() -= 1; //nicht im Fly landen!!
GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState );
// determine text frame by left-top-corner of object
- pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->GetFrm( &aTmpPos, 0, sal_False );
+ pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aTmpPos, 0, sal_False );
}
const SwFrm *pTmp = ::FindAnchor( pTxtFrm, aTmpPos );
const SwFlyFrm *pFly = pTmp->FindFlyFrm();
@@ -462,7 +462,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
SwPosition aPos( GetDoc()->GetNodes().GetEndOfExtras() );
Point aTmpPnt( rAbsPos );
GetLayout()->GetCrsrOfst( &aPos, aTmpPnt, &aState );
- pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->GetFrm(0,&aPos,sal_False );
+ pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(),0,&aPos,sal_False );
}
const SwFrm *pNewAnch;
if( pTxtFrm )
@@ -905,8 +905,8 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj,
{
SwCrsrMoveState aState( MV_SETONLYTEXT );
Point aTmpPt( rInsertPosition );
- getIDocumentLayoutAccess()->GetRootFrm()->GetCrsrOfst( aPam.GetPoint(), aTmpPt, &aState );
- const SwFrm* pFrm = aPam.GetCntntNode()->GetFrm( 0, 0, sal_False );
+ GetLayout()->GetCrsrOfst( aPam.GetPoint(), aTmpPt, &aState );
+ const SwFrm* pFrm = aPam.GetCntntNode()->getLayoutFrm( GetLayout(), 0, 0, sal_False );
const Point aRelPos( rInsertPosition.X() - pFrm->Frm().Left(),
rInsertPosition.Y() - pFrm->Frm().Top() );
rDrawObj.SetRelativePos( aRelPos );
@@ -970,7 +970,7 @@ void SwFEShell::SetPageObjsNewPage( SvPtrarr& rFillArr, int nOffset )
SwFrmFmt* pFmt;
long nNewPage;
- SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetRootFrm();
+ SwRootFrm* pTmpRootFrm = GetLayout();//swmod 080317
sal_uInt16 nMaxPage = pTmpRootFrm->GetPageNum();
sal_Bool bTmpAssert = sal_False;
for( sal_uInt16 n = 0; n < rFillArr.Count(); ++n )
@@ -1709,7 +1709,7 @@ const SwFrmFmt* SwFEShell::GetFmtFromAnyObj( const Point& rPt ) const
Point aPt( rPt );
GetLayout()->GetCrsrOfst( &aPos, aPt );
SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode();
- SwFrm* pFrm = pNd->GetFrm( &rPt )->FindFlyFrm();
+ SwFrm* pFrm = pNd->getLayoutFrm( GetLayout(), &rPt, 0, sal_False )->FindFlyFrm();
pRet = pFrm ? ((SwLayoutFrm*)pFrm)->GetFmt() : 0;
}
return pRet;
@@ -1826,6 +1826,8 @@ ObjCntType SwFEShell::GetObjCntTypeOfSelection( SdrObject** ppObj ) const
for( sal_uInt32 i = 0, nE = rMrkList.GetMarkCount(); i < nE; ++i )
{
SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
+ if( !pObj )
+ continue;
ObjCntType eTmp = GetObjCntType( *pObj );
if( !i )
{
diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx
index 43df3c04d3a4..2de80477cd85 100644
--- a/sw/source/core/frmedt/feflyole.cxx
+++ b/sw/source/core/frmedt/feflyole.cxx
@@ -79,7 +79,7 @@ SwFlyFrm *SwFEShell::FindFlyFrm( const uno::Reference < embed::XEmbeddedObject >
((SwOLENode*)pNd)->GetOLEObj().GetOleRef() == xObj )
{
bExist = sal_True;
- SwFrm *pFrm = ((SwOLENode*)pNd)->GetFrm();
+ SwFrm *pFrm = ((SwOLENode*)pNd)->getLayoutFrm( GetLayout() );
if ( pFrm )
pFly = pFrm->FindFlyFrm();
break;
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 20edc3ecbcac..693fe638532a 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -50,7 +50,6 @@
#include <editeng/protitem.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdpagv.hxx>
-
#include <IDocumentSettingAccess.hxx>
#include <cmdid.h>
#include <poolfmt.hrc> // fuer InitFldTypes
@@ -88,9 +87,10 @@
#include "txtfrm.hxx"
#include "txatbase.hxx"
#include "mdiexp.hxx" // fuer Update der Statuszeile bei drag
-#include <sortedobjs.hxx> // #i28701#
+#include <sortedobjs.hxx>
#include <HandleAnchorNodeChg.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <switerator.hxx>
#define SCROLLVAL 75
@@ -107,7 +107,7 @@ SwFlyFrm *GetFlyFromMarked( const SdrMarkList *pLst, ViewShell *pSh )
if ( pLst && pLst->GetMarkCount() == 1 )
{
SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj();
- if ( pO->ISA(SwVirtFlyDrawObj) )
+ if ( pO && pO->ISA(SwVirtFlyDrawObj) )
return ((SwVirtFlyDrawObj*)pO)->GetFlyFrm();
}
return 0;
@@ -141,7 +141,6 @@ extern sal_Bool bNoInterrupt; // in swapp.cxx
/*************************************************************************
|*
|* SwFEShell::SelectObj()
-|*
*************************************************************************/
sal_Bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj )
@@ -589,7 +588,7 @@ bool SwFEShell::IsSelContainsControl() const
// if we have one marked object, get the SdrObject and check
// whether it contains a control
const SdrObject* pSdrObject = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
- bRet = ::CheckControlLayer( pSdrObject );
+ bRet = pSdrObject && ::CheckControlLayer( pSdrObject );
}
return bRet;
}
@@ -692,7 +691,7 @@ long SwFEShell::EndDrag( const Point *, sal_Bool )
//pView->ShowShownXor( GetOut() );
pView->EndDragObj();
- // JP 18.08.95: DrawUndo-Action auf FlyFrames werden nicht gespeichert
+ // DrawUndo-Action auf FlyFrames werden nicht gespeichert
// Die Fly aendern das Flag
GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true);
ChgAnchor( 0, sal_True );
@@ -732,7 +731,6 @@ void SwFEShell::BreakDrag()
|*
|* Beschreibung Wenn ein Fly selektiert ist, zieht er den Crsr in
|* den ersten CntntFrm
-|*
*************************************************************************/
const SwFrmFmt* SwFEShell::SelFlyGrabCrsr()
@@ -904,7 +902,6 @@ void SwFEShell::SelectionToBottom( sal_Bool bBottom )
|*
|* Beschreibung Objekt ueber/unter dem Dokument?
|* 2 Controls, 1 Heaven, 0 Hell, -1 Uneindeutig
-|*
*************************************************************************/
short SwFEShell::GetLayerId() const
@@ -916,6 +913,8 @@ short SwFEShell::GetLayerId() const
for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
+ if( !pObj )
+ continue;
if ( nRet == SHRT_MAX )
nRet = pObj->GetLayer();
else if ( nRet != pObj->GetLayer() )
@@ -950,7 +949,8 @@ void SwFEShell::ChangeOpaque( SdrLayerID nLayerId )
for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
- // #i18447# - no change of layer for controls
+ if( !pObj )
+ continue;
// or group objects containing controls.
// --> #i113730#
// consider that a member of a drawing group has been selected.
@@ -1544,7 +1544,7 @@ void SwFEShell::MoveCreate( const Point &rPos )
sal_Bool SwFEShell::EndCreate( sal_uInt16 eSdrCreateCmd )
{
- // JP 18.08.95: Damit das Undo-Object aus der DrawEngine nicht bei uns
+ // Damit das Undo-Object aus der DrawEngine nicht bei uns
// gespeichert wird, (wir erzeugen ein eigenes Undo-Object!) hier kurz
// das Undo abschalten
OSL_ENSURE( Imp()->HasDrawView(), "EndCreate without DrawView?" );
@@ -1580,7 +1580,7 @@ sal_Bool SwFEShell::ImpEndCreate()
if( rSdrObj.GetSnapRect().IsEmpty() )
{
- //JP 10.04.95: das Object vergessen wir lieber, fuerht nur
+ // das Object vergessen wir lieber, fuerht nur
// zu Problemen
Imp()->GetDrawView()->DeleteMarked();
Imp()->GetDrawView()->UnmarkAll();
@@ -1622,12 +1622,12 @@ sal_Bool SwFEShell::ImpEndCreate()
SwPosition aPos( GetDoc()->GetNodes() );
SwCrsrMoveState aState( MV_SETONLYTEXT );
Point aPoint( aPt.X(), aPt.Y() + rBound.GetHeight()/2 );
- getIDocumentLayoutAccess()->GetRootFrm()->GetCrsrOfst( &aPos, aPoint, &aState );
+ GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState ); //swmod 080317
- //JP 22.01.99: Zeichenbindung ist im ReadnOnly-Inhalt nicht erlaubt
+ //Zeichenbindung ist im ReadnOnly-Inhalt nicht erlaubt
if( !aPos.nNode.GetNode().IsProtect() )
{
- pAnch = aPos.nNode.GetNode().GetCntntNode()->GetFrm( &aPoint, &aPos );
+ pAnch = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aPoint, &aPos );
SwRect aTmp;
pAnch->GetCharRect( aTmp, aPos );
@@ -1669,13 +1669,13 @@ sal_Bool SwFEShell::ImpEndCreate()
SwPosition aPos( GetDoc()->GetNodes() );
GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState );
- //JP 22.01.99: nicht in ReadnOnly-Inhalt setzen
+ //nicht in ReadnOnly-Inhalt setzen
if( aPos.nNode.GetNode().IsProtect() )
// dann darf er nur seitengebunden sein. Oder sollte man
// die naechste nicht READONLY Position suchen?
bAtPage = true;
- pAnch = aPos.nNode.GetNode().GetCntntNode()->GetFrm( &aPoint, 0, sal_False );
+ pAnch = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aPoint, 0, sal_False );
if( !bAtPage )
{
@@ -1708,7 +1708,7 @@ sal_Bool SwFEShell::ImpEndCreate()
pAnch = ::FindAnchor( pPage, aPt, bBodyOnly );
aPos.nNode = *((SwCntntFrm*)pAnch)->GetNode();
- //JP 22.01.99: nicht in ReadnOnly-Inhalt setzen
+ //nicht in ReadnOnly-Inhalt setzen
if( aPos.nNode.GetNode().IsProtect() )
// dann darf er nur seitengebunden sein. Oder sollte man
// die naechste nicht READONLY Position suchen?
@@ -2385,14 +2385,12 @@ sal_Bool SwFEShell::GotoFly( const String& rName, FlyCntType eType, sal_Bool bSe
{
SET_CURR_SHELL( this );
- SwClientIter aIter( *(SwModify*)pFlyFmt );
- SwFlyFrm* pFrm = (SwFlyFrm*)aIter.First( TYPE( SwFlyFrm ));
+ SwFlyFrm* pFrm = SwIterator<SwFlyFrm,SwFmt>::FirstElement( *pFlyFmt );
if( pFrm )
{
- OSL_ENSURE( pFrm->IsFlyFrm(), "Wrong FrmType" );
if( bSelFrm )
{
- SelectObj( pFrm->Frm().Pos(), 0, ((SwFlyFrm*)pFrm)->GetVirtDrawObj() );
+ SelectObj( pFrm->Frm().Pos(), 0, pFrm->GetVirtDrawObj() );
if( !ActionPend() )
MakeVisible( pFrm->Frm() );
}
@@ -2798,25 +2796,17 @@ long SwFEShell::GetSectionWidth( SwFmt& rFmt ) const
do
{
// Ist es der Gewuenschte?
- if( pSect->GetRegisteredIn() == &rFmt )
+ if( pSect->KnowsFormat( rFmt ) )
return pSect->Frm().Width();
// fuer geschachtelte Bereiche
pSect = pSect->GetUpper()->FindSctFrm();
}
while( pSect );
}
- SwClientIter aIter( rFmt );
- SwClient *pLast = aIter.GoStart();
- while ( pLast )
- {
- if ( pLast->IsA( TYPE(SwFrm) ) )
- {
- SwSectionFrm* pSct = (SwSectionFrm*)pLast;
+ SwIterator<SwSectionFrm,SwFmt> aIter( rFmt );
+ for ( SwSectionFrm* pSct = aIter.First(); pFrm; pFrm = aIter.Next() )
if( !pSct->IsFollow() )
return pSct->Frm().Width();
- }
- pLast = aIter++;
- }
return 0;
}
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 6f90a7b74987..5f7b19bef5e2 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -1122,7 +1122,7 @@ sal_uInt16 lcl_GetRowNumber( const SwPosition& rPos )
const SwCntntFrm *pFrm;
if( 0 != ( pNd = rPos.nNode.GetNode().GetCntntNode() ))
- pFrm = pNd->GetFrm( &aTmpPt, &rPos, sal_False );
+ pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, &rPos, sal_False );
else
pFrm = 0;
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 787990831e75..d88e6e1b89bd 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -115,10 +115,17 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt,
Point aPt( *pPt );
GetLayout()->GetCrsrOfst( &aPos, aPt );
SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode();
- pFrm = pNd->GetFrm( pPt );
+ pFrm = pNd->getLayoutFrm( GetLayout(), pPt );
}
else
+ {
+ const bool bOldCallbackActionEnabled = GetLayout()->IsCallbackActionEnabled();
+ if( bOldCallbackActionEnabled )
+ GetLayout()->SetCallbackActionEnabled( sal_False );
pFrm = GetCurrFrm();
+ if( bOldCallbackActionEnabled )
+ GetLayout()->SetCallbackActionEnabled( sal_True );
+ }
}
if( !pFrm )
@@ -252,7 +259,7 @@ sal_uInt16 SwFEShell::GetFrmType( const Point *pPt, sal_Bool bStopAtFly ) const
Point aPt( *pPt );
GetLayout()->GetCrsrOfst( &aPos, aPt );
SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode();
- pFrm = pNd->GetFrm( pPt );
+ pFrm = pNd->getLayoutFrm( GetLayout(), pPt );
}
else
pFrm = GetCurrFrm( sal_False );
@@ -401,7 +408,7 @@ void SwFEShell::SetNewPageOffset( sal_uInt16 nOffset )
void SwFEShell::SetPageOffset( sal_uInt16 nOffset )
{
const SwPageFrm *pPage = GetCurrFrm( sal_False )->FindPageFrm();
- const SwRootFrm* pLayout = GetLayout();
+ const SwRootFrm* pDocLayout = GetLayout();
while ( pPage )
{
const SwFrm *pFlow = pPage->FindFirstBodyCntnt();
@@ -412,7 +419,7 @@ void SwFEShell::SetPageOffset( sal_uInt16 nOffset )
const SwFmtPageDesc& rPgDesc = pFlow->GetAttrSet()->GetPageDesc();
if ( rPgDesc.GetNumOffset() )
{
- pLayout->SetVirtPageNum( sal_True );
+ pDocLayout->SetVirtPageNum( sal_True );
lcl_SetAPageOffset( nOffset, (SwPageFrm*)pPage, this );
break;
}
@@ -495,6 +502,7 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const
for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject* pDrawObj = rMrkList.GetMark(i)->GetMarkedSdrObj();
+ if( pDrawObj )
aDrawObjs.push_back( pDrawObj );
}
}
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 46d6f23ebcc9..7de8f0727ee1 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -55,9 +55,9 @@
#include <swtblfmt.hxx>
#include <UndoTable.hxx>
#include <mvsave.hxx>
-// OD 26.08.2003 #i18103#
#include <sectfrm.hxx>
#include <frmtool.hxx>
+#include <switerator.hxx>
#include <deque>
//siehe auch swtable.cxx
@@ -197,7 +197,7 @@ void GetTblSelCrs( const SwTableCursor& rTblCrsr, SwSelBoxes& rBoxes )
if( rTblCrsr.IsChgd() || !rTblCrsr.GetBoxesCount() )
{
SwTableCursor* pTCrsr = (SwTableCursor*)&rTblCrsr;
- pTCrsr->GetDoc()->GetRootFrm()->MakeTblCrsrs( *pTCrsr );
+ pTCrsr->GetDoc()->GetCurrentLayout()->MakeTblCrsrs( *pTCrsr ); //swmod 080218
}
if( rTblCrsr.GetBoxesCount() )
@@ -292,10 +292,10 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes,
}
const SwCntntNode *pCntNd = rCrsr.GetCntntNode();
const SwLayoutFrm *pStart = pCntNd ?
- pCntNd->GetFrm( &aPtPos )->GetUpper() : 0;
+ pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aPtPos )->GetUpper() : 0;
pCntNd = rCrsr.GetCntntNode(sal_False);
const SwLayoutFrm *pEnd = pCntNd ?
- pCntNd->GetFrm( &aMkPos )->GetUpper() : 0;
+ pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aMkPos )->GetUpper() : 0;
if( pStart && pEnd )
GetTblSel( pStart, pEnd, rBoxes, 0, eSearchType );
}
@@ -502,10 +502,10 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
// #i22135# - Also the content of the table could be
// invisible - e.g. in a hidden section
// Robust: check, if content was found (e.g. empty table cells)
- if ( !pCNd || pCNd->GetFrm() == NULL )
+ if ( !pCNd || pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) == NULL )
return sal_False;
- const SwLayoutFrm *pStart = pCNd ? pCNd->GetFrm( &aNullPos )->GetUpper() : 0;
+ const SwLayoutFrm *pStart = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aNullPos )->GetUpper() : 0;
OSL_ENSURE( pStart, "ohne Frame geht gar nichts" );
aIdx = rEndNd;
@@ -514,12 +514,12 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
pCNd = aIdx.GetNodes().GoNextSection( &aIdx, sal_False, sal_False );
// #i22135# - Robust: check, if content was found and if it's visible
- if ( !pCNd || pCNd->GetFrm() == NULL )
+ if ( !pCNd || pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) == NULL )
{
return sal_False;
}
- const SwLayoutFrm *pEnd = pCNd ? pCNd->GetFrm( &aNullPos )->GetUpper() : 0;
+ const SwLayoutFrm *pEnd = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aNullPos )->GetUpper() : 0;
OSL_ENSURE( pEnd, "ohne Frame geht gar nichts" );
@@ -774,9 +774,9 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
if ( rShell.IsTableMode() )
pCrsr = rShell.pTblCrsr;
- const SwLayoutFrm *pStart = pCrsr->GetCntntNode()->GetFrm(
+ const SwLayoutFrm *pStart = pCrsr->GetCntntNode()->getLayoutFrm( rShell.GetLayout(),
&pCrsr->GetPtPos() )->GetUpper(),
- *pEnd = pCrsr->GetCntntNode(sal_False)->GetFrm(
+ *pEnd = pCrsr->GetCntntNode(sal_False)->getLayoutFrm( rShell.GetLayout(),
&pCrsr->GetMkPos() )->GetUpper();
const SwLayoutFrm* pSttCell = pStart;
@@ -1013,9 +1013,12 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
// richtig. Warum nicht Point 0,0 benutzen? Dann ist garantiert,
// das die 1. Headline mit drin ist.
Point aPt( 0, 0 );
- const SwLayoutFrm *pStart = rPam.GetCntntNode()->GetFrm(
- &aPt )->GetUpper(),
- *pEnd = rPam.GetCntntNode(sal_False)->GetFrm(
+
+ const SwCntntNode* pCntNd = rPam.GetCntntNode();
+ const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
+ &aPt )->GetUpper();
+ pCntNd = rPam.GetCntntNode(sal_False);
+ const SwLayoutFrm *pEnd = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
&aPt )->GetUpper();
SwSelUnions aUnions;
@@ -1529,9 +1532,11 @@ sal_uInt16 CheckMergeSel( const SwPaM& rPam )
// richtig. Warum nicht Point 0,0 benutzen? Dann ist garantiert,
// das die 1. Headline mit drin ist.
Point aPt;
- const SwLayoutFrm *pStart = rPam.GetCntntNode()->GetFrm(
- &aPt )->GetUpper(),
- *pEnd = rPam.GetCntntNode(sal_False)->GetFrm(
+ const SwCntntNode* pCntNd = rPam.GetCntntNode();
+ const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
+ &aPt )->GetUpper();
+ pCntNd = rPam.GetCntntNode(sal_False);
+ const SwLayoutFrm *pEnd = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
&aPt )->GetUpper();
GetTblSel( pStart, pEnd, aBoxes, 0 );
return CheckMergeSel( aBoxes );
@@ -2058,9 +2063,12 @@ sal_Bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
aPtPos = pShCrsr->GetPtPos();
aMkPos = pShCrsr->GetMkPos();
}
- const SwLayoutFrm *pStart = rCrsr.GetCntntNode()->GetFrm(
- &aPtPos )->GetUpper(),
- *pEnd = rCrsr.GetCntntNode(sal_False)->GetFrm(
+
+ const SwCntntNode* pCntNd = rCrsr.GetCntntNode();
+ const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
+ &aPtPos )->GetUpper();
+ pCntNd = rCrsr.GetCntntNode(sal_False);
+ const SwLayoutFrm *pEnd = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
&aMkPos )->GetUpper();
SWRECTFN( pStart->GetUpper() )
@@ -2119,7 +2127,7 @@ sal_Bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
void lcl_InsertRow( SwTableLine &rLine, SwLayoutFrm *pUpper, SwFrm *pSibling )
{
- SwRowFrm *pRow = new SwRowFrm( rLine );
+ SwRowFrm *pRow = new SwRowFrm( rLine, pUpper );
if ( pUpper->IsTabFrm() && ((SwTabFrm*)pUpper)->IsFollow() )
{
SwTabFrm* pTabFrm = (SwTabFrm*)pUpper;
@@ -2277,14 +2285,10 @@ void _FndBox::DelFrms( SwTable &rTable )
for ( sal_uInt16 i = nStPos; i <= nEndPos; ++i)
{
SwFrmFmt *pFmt = rTable.GetTabLines()[i]->GetFrmFmt();
- SwClientIter aIter( *pFmt );
- SwClient* pLast = aIter.GoStart();
- if( pLast )
+ SwIterator<SwRowFrm,SwFmt> aIter( *pFmt );
+ for ( SwRowFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
- do {
- SwFrm *pFrm = PTR_CAST( SwFrm, pLast );
- if ( pFrm &&
- ((SwRowFrm*)pFrm)->GetTabLine() == rTable.GetTabLines()[i] )
+ if ( pFrm->GetTabLine() == rTable.GetTabLines()[i] )
{
sal_Bool bDel = sal_True;
SwTabFrm *pUp = !pFrm->GetPrev() && !pFrm->GetNext() ?
@@ -2372,7 +2376,6 @@ void _FndBox::DelFrms( SwTable &rTable )
delete pFrm;
}
}
- } while( 0 != ( pLast = aIter++ ));
}
}
}
@@ -2406,8 +2409,7 @@ void lcl_UpdateRepeatedHeadlines( SwTabFrm& rTabFrm, bool bCalcLowers )
const sal_uInt16 nRepeat = rTable.GetRowsToRepeat();
for ( sal_uInt16 nIdx = 0; nIdx < nRepeat; ++nIdx )
{
- SwRowFrm* pHeadline = new SwRowFrm(
- *rTable.GetTabLines()[ nIdx ] );
+ SwRowFrm* pHeadline = new SwRowFrm( *rTable.GetTabLines()[ nIdx ], &rTabFrm );
pHeadline->SetRepeatedHeadline( true );
pHeadline->Paste( &rTabFrm, pLower );
pHeadline->RegistFlys();
@@ -2441,13 +2443,12 @@ void _FndBox::MakeFrms( SwTable &rTable )
--nEndPos;
}
//Jetzt die grosse Einfuegeoperation fuer alle Tabllen.
- SwClientIter aTabIter( *rTable.GetFrmFmt() );
- for ( SwTabFrm *pTable = (SwTabFrm*)aTabIter.First( TYPE(SwFrm) ); pTable;
- pTable = (SwTabFrm*)aTabIter.Next() )
+ SwIterator<SwTabFrm,SwFmt> aTabIter( *rTable.GetFrmFmt() );
+ for ( SwTabFrm *pTable = aTabIter.First(); pTable; pTable = aTabIter.Next() )
{
if ( !pTable->IsFollow() )
{
- SwFrm *pSibling = 0;
+ SwRowFrm *pSibling = 0;
SwFrm *pUpperFrm = 0;
int i;
for ( i = rTable.GetTabLines().Count()-1;
@@ -2455,19 +2456,19 @@ void _FndBox::MakeFrms( SwTable &rTable )
{
SwTableLine *pLine = pLineBehind ? pLineBehind :
rTable.GetTabLines()[static_cast<sal_uInt16>(i)];
- SwClientIter aIter( *pLine->GetFrmFmt() );
- pSibling = (SwFrm*)aIter.First( TYPE(SwFrm) );
+ SwIterator<SwRowFrm,SwFmt> aIter( *pLine->GetFrmFmt() );
+ pSibling = aIter.First();
while ( pSibling && (
- static_cast<SwRowFrm*>(pSibling)->GetTabLine() != pLine ||
+ pSibling->GetTabLine() != pLine ||
!lcl_IsLineOfTblFrm( *pTable, *pSibling ) ||
- static_cast<SwRowFrm*>(pSibling)->IsRepeatedHeadline() ||
+ pSibling->IsRepeatedHeadline() ||
// --> FME 2005-08-24 #i53647# If !pLineBehind,
// IsInSplitTableRow() should be checked.
( pLineBehind && pSibling->IsInFollowFlowRow() ) ||
(!pLineBehind && pSibling->IsInSplitTableRow() ) ) )
// <--
{
- pSibling = (SwFrm*)aIter.Next();
+ pSibling = aIter.Next();
}
}
if ( pSibling )
@@ -2515,32 +2516,31 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber,
(nBfPos != USHRT_MAX ? nBfPos + 1 : 0)) / (nNumber + 1);
//Den Master-TabFrm suchen
- SwClientIter aTabIter( *rTable.GetFrmFmt() );
+ SwIterator<SwTabFrm,SwFmt> aTabIter( *rTable.GetFrmFmt() );
SwTabFrm *pTable;
- for ( pTable = (SwTabFrm*)aTabIter.First( TYPE(SwFrm) ); pTable;
- pTable = (SwTabFrm*)aTabIter.Next() )
+ for ( pTable = aTabIter.First(); pTable; pTable = aTabIter.Next() )
{
if( !pTable->IsFollow() )
{
- SwFrm *pSibling = 0;
+ SwRowFrm* pSibling = 0;
SwLayoutFrm *pUpperFrm = 0;
if ( bBehind )
{
if ( pLineBehind )
{
- SwClientIter aIter( *pLineBehind->GetFrmFmt() );
- pSibling = (SwFrm*)aIter.First( TYPE(SwFrm) );
+ SwIterator<SwRowFrm,SwFmt> aIter( *pLineBehind->GetFrmFmt() );
+ pSibling = aIter.First();
while ( pSibling && (
// only consider row frames associated with pLineBehind:
- static_cast<SwRowFrm*>(pSibling)->GetTabLine() != pLineBehind ||
+ pSibling->GetTabLine() != pLineBehind ||
// only consider row frames that are in pTables Master-Follow chain:
!lcl_IsLineOfTblFrm( *pTable, *pSibling ) ||
// only consider row frames that are not repeated headlines:
- static_cast<SwRowFrm*>(pSibling)->IsRepeatedHeadline() ||
+ pSibling->IsRepeatedHeadline() ||
// only consider row frames that are not follow flow rows
pSibling->IsInFollowFlowRow() ) )
{
- pSibling = (SwFrm*)aIter.Next();
+ pSibling = aIter.Next();
}
}
if ( pSibling )
@@ -2571,16 +2571,16 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber,
{
SwTableLine* pLine = pLineBefore ? pLineBefore : rTable.GetTabLines()[i];
- SwClientIter aIter( *pLine->GetFrmFmt() );
- pSibling = (SwFrm*)aIter.First( TYPE(SwFrm) );
+ SwIterator<SwRowFrm,SwFmt> aIter( *pLine->GetFrmFmt() );
+ pSibling = aIter.First();
while ( pSibling && (
// only consider row frames associated with pLineBefore:
- static_cast<SwRowFrm*>(pSibling)->GetTabLine() != pLine ||
+ pSibling->GetTabLine() != pLine ||
// only consider row frames that are in pTables Master-Follow chain:
!lcl_IsLineOfTblFrm( *pTable, *pSibling ) ||
// only consider row frames that are not repeated headlines:
- static_cast<SwRowFrm*>(pSibling)->IsRepeatedHeadline() ||
+ pSibling->IsRepeatedHeadline() ||
// 1. case: pLineBefore == 0:
// only consider row frames that are not follow flow rows
// 2. case: pLineBefore != 0:
@@ -2591,13 +2591,13 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber,
( pLineBefore && pSibling->IsInSplitTableRow() ) ) ) )
// <--
{
- pSibling = (SwFrm*)aIter.Next();
+ pSibling = aIter.Next();
}
}
pUpperFrm = pSibling->GetUpper();
if ( pLineBefore )
- pSibling = pSibling->GetNext();
+ pSibling = (SwRowFrm*) pSibling->GetNext();
sal_uInt16 nMax = nBhPos != USHRT_MAX ?
nBhPos - nCnt :
@@ -2620,8 +2620,7 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber,
( ( !bBehind && ( nBfPos == USHRT_MAX || nBfPos + 1 < nRowsToRepeat ) ) ||
( bBehind && ( ( nBfPos == USHRT_MAX && nRowsToRepeat > 1 ) || nBfPos + 2 < nRowsToRepeat ) ) ) )
{
- for ( pTable = (SwTabFrm*)aTabIter.First( TYPE(SwFrm) ); pTable;
- pTable = (SwTabFrm*)aTabIter.Next() )
+ for ( pTable = aTabIter.First(); pTable; pTable = aTabIter.Next() )
{
if ( pTable->Lower() )
{
@@ -2672,9 +2671,8 @@ sal_Bool _FndBox::AreLinesToRestore( const SwTable &rTable ) const
{
// ups. sollte unsere zu wiederholende Kopfzeile geloescht worden
// sein??
- SwClientIter aIter( *rTable.GetFrmFmt() );
- for( SwTabFrm* pTable = (SwTabFrm*)aIter.First( TYPE( SwFrm ));
- pTable; pTable = (SwTabFrm*)aIter.Next() )
+ SwIterator<SwTabFrm,SwFmt> aIter( *rTable.GetFrmFmt() );
+ for( SwTabFrm* pTable = aIter.First(); pTable; pTable = aIter.Next() )
{
if( pTable->IsFollow() )
{
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 73b6c04237b2..b1d1c75b54a7 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -212,10 +212,10 @@ sal_Bool SwGrfNode::ReRead(
if( refLink.Is() )
{
- if( GetFrm() )
+ if( getLayoutFrm( GetDoc()->GetCurrentLayout() ) )
{
SwMsgPoolItem aMsgHint( RES_GRF_REREAD_AND_INCACHE );
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
}
// --> OD 2006-11-03 #i59688#
// do not load linked graphic, if it isn't a new linked graphic.
@@ -306,7 +306,7 @@ sal_Bool SwGrfNode::ReRead(
if( bReadGrf && bNewGrf )
{
SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR );
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
}
return bReadGrf;
@@ -434,7 +434,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
// keine default Bitmap mehr, also neu Painten!
aGrfObj.SetGraphic( Graphic() );
SwMsgPoolItem aMsgHint( RES_GRAPHIC_PIECE_ARRIVED );
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
}
}
else if( aGrfObj.IsSwappedOut() ) {
@@ -481,7 +481,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
if( 1 == nRet )
{
SwMsgPoolItem aMsg( RES_GRAPHIC_SWAPIN );
- Modify( &aMsg, &aMsg );
+ ModifyNotification( &aMsg, &aMsg );
}
}
else
@@ -590,7 +590,7 @@ sal_Bool SwGrfNode::RestorePersistentData()
IDocumentLinksAdministration* pIDLA = getIDocumentLinksAdministration();
refLink->SetVisible( pIDLA->IsVisibleLinks() );
pIDLA->GetLinkManager().InsertDDELink( refLink );
- if( getIDocumentLayoutAccess()->GetRootFrm() )
+ if( getIDocumentLayoutAccess()->GetCurrentLayout() ) //swmod 080218
refLink->Update();
}
return sal_True;
@@ -1158,7 +1158,7 @@ void SwGrfNode::ApplyInputStream(
mbIsStreamReadOnly = bIsStreamReadOnly;
mbLinkedInputStreamReady = true;
SwMsgPoolItem aMsgHint( RES_LINKED_GRAPHIC_STREAM_ARRIVED );
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
}
}
}
@@ -1170,7 +1170,7 @@ void SwGrfNode::UpdateLinkWithInputStream()
GetLink()->setStreamToLoadFrom( mxInputStream, mbIsStreamReadOnly );
GetLink()->Update();
SwMsgPoolItem aMsgHint( RES_GRAPHIC_ARRIVED );
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
// --> OD 2008-06-18 #i88291#
mxInputStream.clear();
diff --git a/sw/source/core/inc/UndoAttribute.hxx b/sw/source/core/inc/UndoAttribute.hxx
index 84423605b5d0..849603e2b534 100644
--- a/sw/source/core/inc/UndoAttribute.hxx
+++ b/sw/source/core/inc/UndoAttribute.hxx
@@ -192,7 +192,7 @@ class SwUndoFmtAttrHelper : public SwClient
public:
SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSaveDrawPt = true );
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
SwUndoFmtAttr* GetUndo() const { return m_pUndo.get(); }
// release the undo object (so it is not deleted here), and return it
diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx
index 41e89dcdd518..35abb46f7cf7 100644
--- a/sw/source/core/inc/UndoCore.hxx
+++ b/sw/source/core/inc/UndoCore.hxx
@@ -39,6 +39,8 @@ class SwFmtAnchor;
class SdrMarkList;
class SwUndoDelete;
class SwRedlineSaveData;
+class SwFrm;
+class SwFmt;
namespace sw {
class UndoManager;
@@ -177,7 +179,7 @@ class SwUndoSetFlyFmt : public SwUndo, public SwClient
sal_Bool bAnchorChgd;
void PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem );
- void Modify( SfxPoolItem*, SfxPoolItem* );
+ void Modify( const SfxPoolItem*, const SfxPoolItem* );
void GetAnchor( SwFmtAnchor& rAnhor, sal_uLong nNode, xub_StrLen nCntnt );
public:
@@ -188,6 +190,7 @@ public:
virtual void RedoImpl( ::sw::UndoRedoContext & );
virtual SwRewriter GetRewriter() const;
+ void DeRegisterFromFormat( SwFmt& );
};
diff --git a/sw/source/core/inc/acorrect.hxx b/sw/source/core/inc/acorrect.hxx
index 38975d37969f..d8b4f3ae0ffa 100644..100755
--- a/sw/source/core/inc/acorrect.hxx
+++ b/sw/source/core/inc/acorrect.hxx
@@ -69,6 +69,7 @@ public:
virtual sal_Bool Delete( xub_StrLen nStt, xub_StrLen nEnd );
virtual sal_Bool Insert( xub_StrLen nPos, const String& rTxt );
virtual sal_Bool Replace( xub_StrLen nPos, const String& rTxt );
+ virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const String& rTxt );
virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId,
SfxPoolItem& );
diff --git a/sw/source/core/inc/attrhint.hxx b/sw/source/core/inc/attrhint.hxx
new file mode 100644
index 000000000000..da2ed160b9c4
--- /dev/null
+++ b/sw/source/core/inc/attrhint.hxx
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _ATTRHINT_HXX
+#define _ATTRHINT_HXX
+
+#include <svl/hint.hxx>
+
+class SwAttrHint : public SfxHint
+{
+ sal_Int32 nId;
+public:
+ SwAttrHint( sal_Int32 n )
+ : nId(n)
+ {}
+
+ sal_Int32 GetId() const { return nId; }
+};
+
+#endif
diff --git a/sw/source/core/inc/bodyfrm.hxx b/sw/source/core/inc/bodyfrm.hxx
index 5d8a7f30f43b..42b77f36cec8 100644
--- a/sw/source/core/inc/bodyfrm.hxx
+++ b/sw/source/core/inc/bodyfrm.hxx
@@ -42,7 +42,7 @@ protected:
~SwBodyFrm();
#endif
public:
- SwBodyFrm( SwFrmFmt* );
+ SwBodyFrm( SwFrmFmt*, SwFrm* );
virtual void Paint( const SwRect&, const SwPrintData *pPrintData = NULL ) const;
diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx
index 8f1223b7beb6..06933e804888 100644
--- a/sw/source/core/inc/bookmrk.hxx
+++ b/sw/source/core/inc/bookmrk.hxx
@@ -52,7 +52,6 @@ namespace sw { namespace mark
{
class MarkBase
: virtual public IMark
- , private ::boost::noncopyable
{
public:
//getters
@@ -106,9 +105,6 @@ namespace sw { namespace mark
virtual ~MarkBase();
- // SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
-
const ::com::sun::star::uno::WeakReference<
::com::sun::star::text::XTextContent> & GetXBookmark() const
{ return m_wXBookmark; }
@@ -117,6 +113,9 @@ namespace sw { namespace mark
{ m_wXBookmark = xBkmk; }
protected:
+ // SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
+
MarkBase(const SwPaM& rPaM,
const ::rtl::OUString& rName);
::boost::scoped_ptr<SwPosition> m_pPos1;
diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx
index b50a1a7e3612..66a2f6d36662 100644
--- a/sw/source/core/inc/cellfrm.hxx
+++ b/sw/source/core/inc/cellfrm.hxx
@@ -42,13 +42,13 @@ class SwCellFrm: public SwLayoutFrm
protected:
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
- SwCellFrm( const SwTableBox &, bool bInsertContent = true );
+ SwCellFrm( const SwTableBox &, SwFrm*, bool bInsertContent = true );
~SwCellFrm();
virtual sal_Bool GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const;
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
virtual void Paint( SwRect const&,
SwPrintData const*const pPrintData = NULL ) const;
virtual void CheckDirection( sal_Bool bVert );
diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx
index 3a21ef14e0bc..5f7c69f71cf4 100644
--- a/sw/source/core/inc/cntfrm.hxx
+++ b/sw/source/core/inc/cntfrm.hxx
@@ -54,7 +54,7 @@ class SwCntntFrm: public SwFrm, public SwFlowFrm
// <--
virtual void MakeAll();
- void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, sal_uInt8 &,
+ void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &,
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
virtual sal_Bool ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool& );
@@ -65,11 +65,11 @@ protected:
sal_Bool MakePrtArea( const SwBorderAttrs & );
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
virtual SwTwips ShrinkFrm( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
virtual SwTwips GrowFrm ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
- SwCntntFrm( SwCntntNode * const );
+ SwCntntFrm( SwCntntNode * const, SwFrm* );
public:
virtual ~SwCntntFrm();
@@ -109,6 +109,9 @@ public:
inline SwCntntFrm* GetNextCntntFrm() const;
inline SwCntntFrm* GetPrevCntntFrm() const;
+ static bool CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave, long nBottom, bool bSkipRowSpanCells );
+ void RegisterToNode( SwCntntNode& );
+ static void DelFrms( const SwCntntNode& );
};
inline SwCntntFrm* SwCntntFrm::GetNextCntntFrm() const
diff --git a/sw/source/core/inc/colfrm.hxx b/sw/source/core/inc/colfrm.hxx
index 011daf07fa74..0485cdf064d7 100644
--- a/sw/source/core/inc/colfrm.hxx
+++ b/sw/source/core/inc/colfrm.hxx
@@ -34,7 +34,7 @@
class SwColumnFrm: public SwFtnBossFrm
{
public:
- SwColumnFrm( SwFrmFmt* );
+ SwColumnFrm( SwFrmFmt*, SwFrm* );
~SwColumnFrm();
DECL_FIXEDMEMPOOL_NEWDEL(SwColumnFrm)
diff --git a/sw/source/core/inc/fieldhint.hxx b/sw/source/core/inc/fieldhint.hxx
new file mode 100644
index 000000000000..82955be53bc8
--- /dev/null
+++ b/sw/source/core/inc/fieldhint.hxx
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _FIELDHINT_HXX
+#define _FIELDHINT_HXX
+
+#include <svl/hint.hxx>
+
+class SwFieldHint : public SfxHint
+{
+ SwPaM* pPaM;
+public:
+ SwFieldHint( SwPaM* p )
+ : pPaM(p)
+ {}
+
+ SwPaM* GetPaM() const { return pPaM; }
+};
+
+#endif
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index 7b1adc88c661..61726d03ad92 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/